summaryrefslogtreecommitdiff
path: root/voctogui/lib/clock.py
diff options
context:
space:
mode:
Diffstat (limited to 'voctogui/lib/clock.py')
-rw-r--r--voctogui/lib/clock.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/voctogui/lib/clock.py b/voctogui/lib/clock.py
new file mode 100644
index 0000000..8fdbe3d
--- /dev/null
+++ b/voctogui/lib/clock.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python3
+import logging
+from gi.repository import Gst, GstNet
+
+__all__ = ['Clock']
+port = 9998
+
+log = logging.getLogger('Clock')
+Clock = None
+
+log.debug("Obtaining System-Clock")
+SystemClock = Gst.SystemClock.obtain()
+
+def obtainClock(host):
+ global log, Clock
+
+ log.debug('obtaining NetClientClock from host %s', host)
+ Clock = GstNet.NetClientClock.new('voctocore', host, port, 0)
+ log.info('obtained NetClientClock from host %s: %s', host, Clock)