[gst-devel] how to make gstreamer run in separate thread

Gregory Petrosyan gregory.petrosyan at gmail.com
Sun May 2 15:20:32 CEST 2010


On Sun, Apr 25, 2010 at 10:35 PM, Alexey Chernov <4ernov at gmail.com> wrote:
> Thank you guys for support, I finally managed to make gstreamer process
> callbacks in separate thread. The solution was to set bus handler with
> gst_bus_set_sync_handler() instead of gst_bus_add_watch() as wl2776 proposed,
> special thanks for him. So here're some things which I found out from this
> case:
> 1. Qt actually dispatches glib events and no additional g_main_loop_run() is
> necessary for Qt applications.
> 2. Qt seems to create separate glib context for glib objects which are created
> in separate QThread objects.
> 3. To make callbacks be called in separate thread where the certain gst
> objects were created you need to set them as a handler with
> gst_bus_set_sync_handler() to make them processed in the context of certain
> objects and not in the main context.

Hi!

I'm also trying to use GStreamer with Qt, and I'm experiencing some
weird problems.

1) I'm not sure if Qt dispatches glib events (on Windows, at least):
gst_bus_add_watch()'ed callback is never called
2) gst_bus_set_sync_handler() works, but events that I send from it
(using Qt::QueuedConnection) seem to never reach the main loop, and I
don't even know how to debug this

If anybody can help me with these issues, it will be greatly appreciated.

                Gregory




More information about the gstreamer-devel mailing list