[gst-devel] Troubles with gstreamer, pygtk and ubuntu karmic
Nicolas Bertrand
nico at inattendu.org
Tue Nov 17 05:13:27 CET 2009
Jan Schmidt a écrit :
> On Mon, 2009-11-16 at 11:37 -0800, Ron McOuat wrote:
>
>> I had the same problem. The tutorial version of the code for handling
>> the assignment of the "prepare-xwindow-id" message is incomplete.
>> Looking in the example code under gst-python reveals a few more steps. I
>> changed the tutorial code to look like the following and it worked.
>>
>> def on_sync_message(self, bus, message):
>> if message.structure is None:
>> return
>>
>> if message.structure.get_name() == "prepare-xwindow-id":
>> # Assign the viewport
>> gtk.gdk.threads_enter()
>> gtk.gdk.display_get_default().sync()
>> imagesink = message.src
>> imagesink.set_property("force-aspect-ratio", True)
>> imagesink.set_xwindow_id(self.movie_window.window.xid)
>> gtk.gdk.threads_leave()
>>
>
>
Thanks for the solution,it rocks !
from the example in
http://pygstdocs.berlios.de/pygst-tutorial/webcam-viewer.html
I slightly changed by
def on_sync_message(self, bus, message):
if message.structure is None:
return
message_name = message.structure.get_name()
if message_name == "prepare-xwindow-id":
# Assign the viewport
# all this is needed to sync with the X server before giving the
# x id to the sink
gtk.gdk.threads_enter()
gtk.gdk.display_get_default().sync()
imagesink = message.src
imagesink.set_property("force-aspect-ratio", True)
imagesink.set_xwindow_id(self.videowidget.window.xid)
gtk.gdk.threads_leave()
as the exmple dos not use a VideoWidget class.
More information about the gstreamer-devel
mailing list