<div dir="ltr"><div>Thanks Andoni,</div><div><br></div><div>Let me show you the .py file.</div><div><br></div><div>Without any gdk_threads.. when the program start running the GTK window is displayed and after to click the play_stop button</div>
<div>videotestsrc video appears inside the window but I can not move it and eventually it crashes.</div><div><br></div><div>Any idea what is happen ?</div><div><br></div><div>Regards.</div><div><br></div><div><br></div><div>
import pygst</div><div>pygst.require("0.10")</div><div>import gst</div><div>import pygtk</div><div>pygtk.require("2.0")</div><div>import gtk</div><div><br></div><div>window = gtk.Window(gtk.WINDOW_TOPLEVEL)</div>
<div>window.set_border_width(10)</div><div>window.set_title("TEST W over W")</div><div>window.move(1100, 600)</div><div>window.set_keep_above(True)</div><div>window.connect("destroy", gtk.main_quit, "WM destroy")</div>
<div><br></div><div>vbox = gtk.VBox()</div><div>window.add(vbox)</div><div>movie_window = gtk.DrawingArea()</div><div>movie_window.set_size_request(320, 240)</div><div>movie_window.modify_bg(gtk.STATE_NORMAL, movie_window.style.black)</div>
<div>vbox.add(movie_window)</div><div>boton_play_stop = gtk.Button("PLAY / STOP")</div><div>vbox.pack_start(boton_play_stop, False)</div><div>def change_color(boton, color):</div><div> map = boton.get_colormap()</div>
<div> color = map.alloc_color(color)</div><div> style = boton.get_style().copy()</div><div> <a href="http://style.bg">style.bg</a>[gtk.STATE_NORMAL] = color</div><div> boton.set_style(style)</div><div>change_color(boton_play_stop, "#EAEAEA")</div>
<div>window.show_all()</div><div><br></div><div>def play_stop(w):</div><div> if str(pvideo.get_state()[1])[16:20] == "NULL":</div><div> pvideo.set_state(gst.STATE_PLAYING)</div><div> change_color(boton_play_stop, "#FF9999")</div>
<div> else:</div><div> pvideo.set_state(gst.STATE_NULL)</div><div> movie_window.modify_bg(gtk.STATE_NORMAL, movie_window.style.black)</div><div> change_color(boton_play_stop, "#EAEAEA")</div>
<div>boton_play_stop.connect("clicked", play_stop)</div><div><br></div><div>pvideo = gst.parse_launch ("videotestsrc ! autovideosink")</div><div><br></div><div>bus = pvideo.get_bus()</div><div>bus.add_signal_watch()</div>
<div>bus.enable_sync_message_emission()</div><div><br></div><div>def on_sync_message(bus, message):</div><div> if message.structure is None:</div><div> return</div><div> message_name = message.structure.get_name()</div>
<div> if message_name == "prepare-xwindow-id":</div><div> # Assign the viewport</div><div> imagesink = message.src</div><div> imagesink.set_property("force-aspect-ratio", True)</div>
<div> imagesink.set_xwindow_id(movie_window.window.handle)</div><div> imagesink.expose()</div><div>bus.connect("sync-message::element", on_sync_message)</div><div><br></div><div>gtk.main()</div></div>
<div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/17 JPM <span dir="ltr"><<a href="mailto:jpmelian@gmail.com" target="_blank">jpmelian@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>Hello,</div><div><br></div><div>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.</div><div><br></div><div>
I am using PyGST and PyGTK included in Gstreamer SDK.</div><div><br></div><div>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. </div><div>
<br></div><div><br></div><div>Could you help me ?. Thanks and best regards.</div></div>
</blockquote></div><br></div>