[gst-devel] how to make gstreamer run in separate thread
Alexey Chernov
4ernov at gmail.com
Sun Apr 25 20:35:32 CEST 2010
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.
Stefan is right that it's often unnecessary to run gst part of application in
its own thread, but in some cases especially when performance depends on some
drivers of special hardware (tuners, cameras etc.) it could be useful to
separate threads.
More information about the gstreamer-devel
mailing list