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

Tim-Philipp Müller t.i.m at zen.co.uk
Mon Apr 19 14:09:05 CEST 2010


On Fri, 2010-04-16 at 23:32 +0400, Alexey Chernov wrote:

> Stefan, it seems that Qt event loop has g_main_loop_run() call somewhere 
> inside of it. For example, I don't call g_main_loop_run anywhere in my program 
> at all and even don't create GMainLoop object, I don't have while(true) pseudo 
> event loop but all the gstreamer stuff works just ok except this issue with 
> threads. Do you know if it's true? If so, maybe there's some way to bind 
> gstreamer's event loop to other QThread's Qt event loop..
> 
> Thanks for your help

If you want to process bus messages in a specific thread context that's
not the main application thread, then I would recommend just using
gst_bus_(timed)_pop_(filtered)() for this, either blocking in a while
loop with a small timeout, or hooked into whatever other event/loop
mechanism there is already. You don't need to use a GMainLoop to get to
the bus messages.

 Cheers
  -Tim






More information about the gstreamer-devel mailing list