[gst-devel] how to make gstreamer run in separate thread
Alexey Chernov
4ernov at gmail.com
Mon Apr 19 22:24:06 CEST 2010
Thank you, Tim, you're right, tying bus to Qt's event loop is what I really
want. The problem is that although Qt has separate event loops for its threads
(QThreads) all of these loops seem to interact with the only GMainLoop
somewhere deep inside. And the aim is to switch the bus dispatching to its
QThread's event loop.
One of solutions is to set bus handler with gst_bus_set_sync_handler() instead
of gst_bus_add_watch() how wl2776 proposed.
В сообщении от Понедельник 19 апреля 2010 16:09:05 вы написали:
> 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