From 7186f7b1f57ee9fa1e26d53135b769db20a04295 Mon Sep 17 00:00:00 2001 From: MaZderMind Date: Wed, 22 Jul 2015 19:52:20 +0200 Subject: Fix error reporting --- voctogui/lib/videodisplay.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/voctogui/lib/videodisplay.py b/voctogui/lib/videodisplay.py index b98daf1..6915666 100644 --- a/voctogui/lib/videodisplay.py +++ b/voctogui/lib/videodisplay.py @@ -55,13 +55,22 @@ class VideoDisplay: def run(self): self.pipeline.set_state(Gst.State.PLAYING) + def set_overlay_callback(self, callback): + if callback: + if not self.draw_callback: + self.draw_callback = self.pipeline.get_by_name('overlay').connect('draw', callback) + else: + print('disconnect') + self.pipeline.get_by_name('overlay').disconnect(self.draw_callback) + self.draw_callback = None + def on_syncmsg(self, bus, msg): if msg.get_structure().get_name() == "prepare-window-handle": self.log.info('setting xvimagesink window-handle to %s', self.xid) msg.src.set_window_handle(self.xid) def on_error(self, bus, msg): - self.log.error('on_error():', msg.parse_error()) + self.log.error('on_error(): %s', msg.parse_error()) def on_level_draw(self, widget, cr): cr.set_source_rgb(1, 1, 1) -- cgit v1.2.3