GStreamer SDK problem

classic Classic list List threaded Threaded
3 messages Options
JPM
Reply | Threaded
Open this post in threaded view
|

GStreamer SDK problem

JPM
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.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: GStreamer SDK problem

Andoni Morales



2013/10/17 JPM <[hidden email]>
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. 

That's a known issue in windows, and you should try do all your call to gtk from the main thread.
Do not call to threads_init and don't enclose you call to gtk_main with gdk_threads_enter gdk_threads_leave. If you need for instance to retrieve the window id do it in the "realized" callback.
Cheers,
Andoni

Could you help me ?. Thanks and best regards.

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




--
Andoni Morales Alastruey

LongoMatch:The Digital Coach
http://www.longomatch.ylatuya.es

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
JPM
Reply | Threaded
Open this post in threaded view
|

Re: GStreamer SDK problem

JPM
In reply to this post by JPM
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 <[hidden email]>
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.


_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel