GStreamer SDK problem
JPM
jpmelian at gmail.com
Thu Oct 17 18:17:23 CEST 2013
Thanks Andoni,
Let me show you the .py file.
Without any gdk_threads.. when the program start running the GTK window is
displayed and after to click the play_stop button
videotestsrc video appears inside the window but I can not move it and
eventually it crashes.
Any idea what is happen ?
Regards.
import pygst
pygst.require("0.10")
import gst
import pygtk
pygtk.require("2.0")
import gtk
window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.set_border_width(10)
window.set_title("TEST W over W")
window.move(1100, 600)
window.set_keep_above(True)
window.connect("destroy", gtk.main_quit, "WM destroy")
vbox = gtk.VBox()
window.add(vbox)
movie_window = gtk.DrawingArea()
movie_window.set_size_request(320, 240)
movie_window.modify_bg(gtk.STATE_NORMAL, movie_window.style.black)
vbox.add(movie_window)
boton_play_stop = gtk.Button("PLAY / STOP")
vbox.pack_start(boton_play_stop, False)
def change_color(boton, color):
map = boton.get_colormap()
color = map.alloc_color(color)
style = boton.get_style().copy()
style.bg[gtk.STATE_NORMAL] = color
boton.set_style(style)
change_color(boton_play_stop, "#EAEAEA")
window.show_all()
def play_stop(w):
if str(pvideo.get_state()[1])[16:20] == "NULL":
pvideo.set_state(gst.STATE_PLAYING)
change_color(boton_play_stop, "#FF9999")
else:
pvideo.set_state(gst.STATE_NULL)
movie_window.modify_bg(gtk.STATE_NORMAL, movie_window.style.black)
change_color(boton_play_stop, "#EAEAEA")
boton_play_stop.connect("clicked", play_stop)
pvideo = gst.parse_launch ("videotestsrc ! autovideosink")
bus = pvideo.get_bus()
bus.add_signal_watch()
bus.enable_sync_message_emission()
def on_sync_message(bus, message):
if message.structure is None:
return
message_name = message.structure.get_name()
if message_name == "prepare-xwindow-id":
# Assign the viewport
imagesink = message.src
imagesink.set_property("force-aspect-ratio", True)
imagesink.set_xwindow_id(movie_window.window.handle)
imagesink.expose()
bus.connect("sync-message::element", on_sync_message)
gtk.main()
2013/10/17 JPM <jpmelian at gmail.com>
> Hello,
>
> I have installed in my PC Windows 7 64 bits, GStreamer SDK 2013.6 (Congo)
> for Windows 64 bits (Runtime) and Python 2.7.5 Windows X86-64 Installer.
>
> I am using PyGST and PyGTK included in Gstreamer SDK.
>
> Always I add gtk.gdk.threads_init() in .py file a deadlock is produced. I
> have tested the same .py file in Ubuntu without any error.
>
>
> Could you help me ?. Thanks and best regards.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20131017/4d2ed2e6/attachment.html>
More information about the gstreamer-devel
mailing list