diff options
author | MaZderMind <github@mazdermind.de> | 2015-06-17 18:03:39 +0200 |
---|---|---|
committer | MaZderMind <github@mazdermind.de> | 2015-06-17 18:03:39 +0200 |
commit | 0f1a7fa78984c2feaf24c1eb74ecd82ed0438af5 (patch) | |
tree | 34bd7dfb55b56fcc3a44e061297d2b8e86c4f9c7 | |
parent | d006874a84e196faf258322a59f9690c373ed323 (diff) |
implement gst video player
-rw-r--r-- | voctogui/lib/ui.py | 21 | ||||
-rw-r--r-- | voctogui/ui/voctogui.ui | 2 |
2 files changed, 19 insertions, 4 deletions
diff --git a/voctogui/lib/ui.py b/voctogui/lib/ui.py index 7e7a5e6..5bac103 100644 --- a/voctogui/lib/ui.py +++ b/voctogui/lib/ui.py @@ -3,6 +3,7 @@ import gi, logging from gi.repository import Gtk, Gst from lib.uibuilder import UiBuilder +from lib.videodisplay import VideoDisplay class Ui(UiBuilder): def __init__(self, uifile): @@ -17,20 +18,32 @@ class Ui(UiBuilder): self.win.connect('delete-event', Gtk.main_quit) self.previews = {} + self.preview_players = {} + self.configure_video_main() self.configure_video_previews() self.configure_audio_selector() + def configure_video_main(self): + video = self.find_widget_recursive(self.win, 'video_main') + self.video_main_player = VideoDisplay(11000, video) + pass + def configure_video_previews(self): sources = ['cam1', 'cam2', 'grabber'] box = self.get_check_widget('box_left') - for source in sources: + for idx, source in enumerate(sources): preview = self.get_check_widget('widget_preview', clone=True) box.pack_start(preview, fill=False, expand=False, padding=0) # http://stackoverflow.com/questions/3489520/python-gtk-widget-name - self.find_widget_recursive(preview, "label").set_label(source) + self.find_widget_recursive(preview, 'label').set_label(source) + + video = self.find_widget_recursive(preview, 'video') + player = VideoDisplay(13000 + idx, video) + + self.preview_players[source] = player self.previews[source] = preview def configure_audio_selector(self): @@ -49,4 +62,8 @@ class Ui(UiBuilder): combo.set_active_id('moofar') def show(self): + self.video_main_player.run() + for name, player in self.preview_players.items(): + player.run() + self.win.show_all() diff --git a/voctogui/ui/voctogui.ui b/voctogui/ui/voctogui.ui index dcd9da8..dc20452 100644 --- a/voctogui/ui/voctogui.ui +++ b/voctogui/ui/voctogui.ui @@ -229,7 +229,6 @@ <property name="width_request">1024</property> <property name="height_request">576</property> <property name="visible">True</property> - <property name="app_paintable">True</property> <property name="can_focus">False</property> <property name="double_buffered">False</property> </object> @@ -280,7 +279,6 @@ <property name="width_request">320</property> <property name="height_request">180</property> <property name="visible">True</property> - <property name="app_paintable">True</property> <property name="can_focus">False</property> <property name="double_buffered">False</property> </object> |