X-Git-Url: https://git.slaskete.net/python-gstreamer-examples/blobdiff_plain/578b34cf01a5acc18d024df1884e20f799bb2b52..cfb54fb6f7b6b16e7ee3db7e9eee7a35f38f8be6:/example2%203.py/python-gstreamer-examples/blobdiff_plain/578b34cf01a5acc18d024df1884e20f799bb2b52..cfb54fb6f7b6b16e7ee3db7e9eee7a35f38f8be6:/example2+3.py?ds=sidebyside diff --git a/example2+3.py b/example2+3.py index 44da53d..7775b06 100755 --- a/example2+3.py +++ b/example2+3.py @@ -2,12 +2,11 @@ # Let's see if we can get a viewport AND audio working, combining ex. 2 and 3 # GdkX11 to get access to xid, GstVideo to get access to set_window_handle -import gi +import gi, signal gi.require_version('Gtk', '3.0') gi.require_version('Gst', '1.0') gi.require_version('GstVideo', '1.0') from gi.repository import Gtk, Gst, GdkX11, GstVideo -import signal class Main: def __init__(self): @@ -77,23 +76,23 @@ class Main: self.win_id = self.mainwindow.get_object("viewport").get_window().get_xid() - # When we get a message that video is ready to display, set the + # When we get a message that video is ready to display, set the # correct window id to hook it to our viewport def OnSyncElement(self, bus, message): if message.get_structure().get_name() == "prepare-window-handle": - print "prepare-window-handle" + print("prepare-window-handle") message.src.set_window_handle(self.win_id) def OnPlay(self, widget): - print "play" + print("play") self.pipeline.set_state(Gst.State.PLAYING) def OnStop(self, widget): - print "stop" + print("stop") self.pipeline.set_state(Gst.State.READY) def OnQuit(self, widget): - print "quit" + print("quit") Gtk.main_quit() # Workaround to get Ctrl+C to terminate from command line