summaryrefslogtreecommitdiff
path: root/voctocore/lib/videomix.py
diff options
context:
space:
mode:
authorMaZderMind <github@mazdermind.de>2015-05-22 13:06:51 +0200
committerMaZderMind <github@mazdermind.de>2015-05-22 13:06:51 +0200
commitedcc25932bd94c65134b44c0c24b3984e49b7259 (patch)
treeaa38f881a44b57366a46975b8637d634743f39ec /voctocore/lib/videomix.py
parenta1d1076b2243f6c1e9527afb0be359407fe2f4c4 (diff)
better error-handling on all pipelines
Diffstat (limited to 'voctocore/lib/videomix.py')
-rw-r--r--voctocore/lib/videomix.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/voctocore/lib/videomix.py b/voctocore/lib/videomix.py
index d27c3e3..ffdbef2 100644
--- a/voctocore/lib/videomix.py
+++ b/voctocore/lib/videomix.py
@@ -50,8 +50,12 @@ class VideoMix(object):
self.log.debug('Creating Mixing-Pipeline:\n%s', pipeline)
self.mixingPipeline = Gst.parse_launch(pipeline)
- self.log.debug('Initializing Mixer-State')
+ self.log.debug('Binding Error & End-of-Stream-Signal on Mixing-Pipeline')
+ self.mixingPipeline.bus.add_signal_watch()
+ self.mixingPipeline.bus.connect("message::eos", self.on_eos)
+ self.mixingPipeline.bus.connect("message::error", self.on_error)
+ self.log.debug('Initializing Mixer-State')
self.compositeMode = CompositeModes.fullscreen
self.sourceA = 0
self.sourceB = 1
@@ -167,3 +171,11 @@ class VideoMix(object):
def setCompositeMode(self, mode):
self.compositeMode = mode
self.updateMixerState()
+
+ def on_eos(self, bus, message):
+ self.log.debug('Received End-of-Stream-Signal on Mixing-Pipeline')
+
+ def on_error(self, bus, message):
+ self.log.debug('Received Error-Signal on Mixing-Pipeline')
+ (error, debug) = message.parse_error()
+ self.log.debug('Error-Details: #%u: %s', error.code, debug)