mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-24 02:31:03 +00:00
Update video player example
Original commit message from CVS: Update video player example
This commit is contained in:
parent
f47aedab55
commit
e888101baf
1 changed files with 7 additions and 6 deletions
|
@ -5,6 +5,10 @@ import pygtk
|
||||||
pygtk.require('2.0')
|
pygtk.require('2.0')
|
||||||
|
|
||||||
import gtk
|
import gtk
|
||||||
|
|
||||||
|
if gtk.pygtk_version < (2,3,91):
|
||||||
|
raise SystemExit, "PyGTK 2.3.91 or higher required"
|
||||||
|
|
||||||
import gst.play
|
import gst.play
|
||||||
import gst.interfaces
|
import gst.interfaces
|
||||||
|
|
||||||
|
@ -97,23 +101,20 @@ class PlayerWidget(gtk.DrawingArea):
|
||||||
self.player.set_video_sink(self.imagesink)
|
self.player.set_video_sink(self.imagesink)
|
||||||
|
|
||||||
def destroy_cb(self, da):
|
def destroy_cb(self, da):
|
||||||
overlay = gst.interfaces.XOverlay(self.imagesink)
|
self.imagesink.set_xwindow_id(0L)
|
||||||
overlay.set_xwindow_id(0L)
|
|
||||||
|
|
||||||
def after_realize_cb(self, window):
|
def after_realize_cb(self, window):
|
||||||
# Sort of a hack, but it works for now.
|
# Sort of a hack, but it works for now.
|
||||||
gtk.idle_add(self.idler)
|
gtk.idle_add(self.idler)
|
||||||
|
|
||||||
def idler(self):
|
def idler(self):
|
||||||
overlay = gst.interfaces.XOverlay(self.imagesink)
|
self.imagesink.set_xwindow_id(self.window.xid)
|
||||||
overlay.set_xwindow_id(self.window.xid)
|
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
self.player.set_state(gst.STATE_NULL)
|
self.player.set_state(gst.STATE_NULL)
|
||||||
|
|
||||||
def play(self):
|
def play(self):
|
||||||
overlay = gst.interfaces.XOverlay(self.imagesink)
|
self.imagesink.set_xwindow_id(self.window.xid)
|
||||||
overlay.set_xwindow_id(self.window.xid)
|
|
||||||
self.player.set_state(gst.STATE_PLAYING)
|
self.player.set_state(gst.STATE_PLAYING)
|
||||||
|
|
||||||
def pause(self):
|
def pause(self):
|
||||||
|
|
Loading…
Reference in a new issue