aboutsummaryrefslogtreecommitdiff
path: root/voctocore/lib
diff options
context:
space:
mode:
Diffstat (limited to 'voctocore/lib')
-rw-r--r--voctocore/lib/audiomix.py2
-rw-r--r--voctocore/lib/avpreviewoutput.py2
-rw-r--r--voctocore/lib/avrawoutput.py2
-rw-r--r--voctocore/lib/avsource.py2
-rw-r--r--voctocore/lib/clock.py15
-rw-r--r--voctocore/lib/streamblanker.py2
-rw-r--r--voctocore/lib/videomix.py2
7 files changed, 27 insertions, 0 deletions
diff --git a/voctocore/lib/audiomix.py b/voctocore/lib/audiomix.py
index 1c72ede..6c1768a 100644
--- a/voctocore/lib/audiomix.py
+++ b/voctocore/lib/audiomix.py
@@ -3,6 +3,7 @@ from gi.repository import Gst
from enum import Enum
from lib.config import Config
+from lib.clock import Clock
class AudioMix(object):
def __init__(self):
@@ -47,6 +48,7 @@ class AudioMix(object):
self.log.debug('Creating Mixing-Pipeline:\n%s', pipeline)
self.mixingPipeline = Gst.parse_launch(pipeline)
+ self.mixingPipeline.use_clock(Clock)
self.log.debug('Binding Error & End-of-Stream-Signal on Mixing-Pipeline')
self.mixingPipeline.bus.add_signal_watch()
diff --git a/voctocore/lib/avpreviewoutput.py b/voctocore/lib/avpreviewoutput.py
index f757e1c..04ff637 100644
--- a/voctocore/lib/avpreviewoutput.py
+++ b/voctocore/lib/avpreviewoutput.py
@@ -3,6 +3,7 @@ from gi.repository import Gst
from lib.config import Config
from lib.tcpmulticonnection import TCPMultiConnection
+from lib.clock import Clock
class AVPreviewOutput(TCPMultiConnection):
def __init__(self, channel, port):
@@ -49,6 +50,7 @@ class AVPreviewOutput(TCPMultiConnection):
self.log.debug('Creating Output-Pipeline:\n%s', pipeline)
self.outputPipeline = Gst.parse_launch(pipeline)
+ self.outputPipeline.use_clock(Clock)
self.log.debug('Binding Error & End-of-Stream-Signal on Output-Pipeline')
self.outputPipeline.bus.add_signal_watch()
diff --git a/voctocore/lib/avrawoutput.py b/voctocore/lib/avrawoutput.py
index 62a03d2..60d2b37 100644
--- a/voctocore/lib/avrawoutput.py
+++ b/voctocore/lib/avrawoutput.py
@@ -3,6 +3,7 @@ from gi.repository import Gst
from lib.config import Config
from lib.tcpmulticonnection import TCPMultiConnection
+from lib.clock import Clock
class AVRawOutput(TCPMultiConnection):
def __init__(self, channel, port):
@@ -38,6 +39,7 @@ class AVRawOutput(TCPMultiConnection):
)
self.log.debug('Creating Output-Pipeline:\n%s', pipeline)
self.outputPipeline = Gst.parse_launch(pipeline)
+ self.outputPipeline.use_clock(Clock)
self.log.debug('Binding Error & End-of-Stream-Signal on Output-Pipeline')
self.outputPipeline.bus.add_signal_watch()
diff --git a/voctocore/lib/avsource.py b/voctocore/lib/avsource.py
index c9f4dea..f814c45 100644
--- a/voctocore/lib/avsource.py
+++ b/voctocore/lib/avsource.py
@@ -3,6 +3,7 @@ from gi.repository import Gst
from lib.config import Config
from lib.tcpsingleconnection import TCPSingleConnection
+from lib.clock import Clock
class AVSource(TCPSingleConnection):
def __init__(self, name, port, outputs=None, has_audio=True, has_video=True):
@@ -64,6 +65,7 @@ class AVSource(TCPSingleConnection):
self.log.debug('Launching Source-Pipeline:\n%s', pipeline)
self.receiverPipeline = Gst.parse_launch(pipeline)
+ self.receiverPipeline.use_clock(Clock)
self.log.debug('Binding End-of-Stream-Signal on Source-Pipeline')
self.receiverPipeline.bus.add_signal_watch()
diff --git a/voctocore/lib/clock.py b/voctocore/lib/clock.py
new file mode 100644
index 0000000..ed8152e
--- /dev/null
+++ b/voctocore/lib/clock.py
@@ -0,0 +1,15 @@
+#!/usr/bin/python3
+import logging
+from gi.repository import Gst, GstNet
+
+__all__ = ['Clock', 'NetTimeProvider']
+port = 9998
+
+log = logging.getLogger('Clock')
+
+log.debug("Obtaining System-Clock")
+Clock = Gst.SystemClock.obtain()
+log.info("Using System-Clock for all Pipelines: %s", Clock)
+
+log.info("Starting NetTimeProvider on Port %u", port)
+NetTimeProvider = GstNet.NetTimeProvider.new(Clock, None, port)
diff --git a/voctocore/lib/streamblanker.py b/voctocore/lib/streamblanker.py
index b3f460c..fea3d6a 100644
--- a/voctocore/lib/streamblanker.py
+++ b/voctocore/lib/streamblanker.py
@@ -3,6 +3,7 @@ from gi.repository import Gst
from enum import Enum
from lib.config import Config
+from lib.clock import Clock
class StreamBlanker(object):
log = logging.getLogger('StreamBlanker')
@@ -53,6 +54,7 @@ class StreamBlanker(object):
self.log.debug('Creating Mixing-Pipeline:\n%s', pipeline)
self.mixingPipeline = Gst.parse_launch(pipeline)
+ self.mixingPipeline.use_clock(Clock)
self.log.debug('Binding Error & End-of-Stream-Signal on Mixing-Pipeline')
self.mixingPipeline.bus.add_signal_watch()
diff --git a/voctocore/lib/videomix.py b/voctocore/lib/videomix.py
index 98614db..7ff98c2 100644
--- a/voctocore/lib/videomix.py
+++ b/voctocore/lib/videomix.py
@@ -3,6 +3,7 @@ from gi.repository import Gst
from enum import Enum, unique
from lib.config import Config
+from lib.clock import Clock
@unique
class CompositeModes(Enum):
@@ -71,6 +72,7 @@ class VideoMix(object):
self.log.debug('Creating Mixing-Pipeline:\n%s', pipeline)
self.mixingPipeline = Gst.parse_launch(pipeline)
+ self.mixingPipeline.use_clock(Clock)
self.log.debug('Binding Error & End-of-Stream-Signal on Mixing-Pipeline')
self.mixingPipeline.bus.add_signal_watch()