From edcc25932bd94c65134b44c0c24b3984e49b7259 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Fri, 22 May 2015 13:06:51 +0200 Subject: better error-handling on all pipelines --- voctocore/lib/videomix.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'voctocore/lib/videomix.py') 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) -- cgit v1.2.3