diff options
author | MaZderMind <github@mazdermind.de> | 2015-07-22 19:52:20 +0200 |
---|---|---|
committer | MaZderMind <github@mazdermind.de> | 2015-07-23 09:59:00 +0200 |
commit | 7186f7b1f57ee9fa1e26d53135b769db20a04295 (patch) | |
tree | 9c7d46107bc4b0928b324453ba9d73544e8f71da /voctogui | |
parent | ebe3d3f5442d2393d7aae4f1ba58e6256d7ec4ef (diff) |
Fix error reporting
Diffstat (limited to 'voctogui')
-rw-r--r-- | voctogui/lib/videodisplay.py | 11 |
1 files changed, 10 insertions, 1 deletions
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) |