[Interest] "-glib" has no effect?

Nikos Chantziaras realnc at gmail.com
Fri Feb 20 21:51:40 CET 2015


On 20/02/15 05:43, Thiago Macieira wrote:
> On Friday 20 February 2015 05:09:56 Nikos Chantziaras wrote:
>> Ah, thanks. Actually I don't even need GMainLoop. It's just that
>> gstreamer does message dispatch through it *if* there one currently
>> running. But otherwise, there's hooks to advance the internal gstreamer
>> bus messages manually through gst_bus_pop().
>
> One way to do this is to do it the EFL way: lie and steal.
>
> Lie to GStreamer that there is a GMainLoop running, then steal the information
> from the GSources, adding them back to the Qt mainloop. If it's a GTimeout,
> you should be able to just do a QTimer.
>
> [Yes, EFL does this and the "steal file descriptors" was described to me by its
> maintainer :-)]

I took a look at GSource and it seems that "stealing" the GSources is 
somewhat of an overkill for my purposes, since there's only two 
callbacks invoked by gstreamer from where Qt code can be called. So it 
seems enough to just forward any Qt calls from those callbacks to the 
GUI thread with a QMetaObject::invokeMethod() using Qt::QueuedConnection.

The only question remaining now is whether invokeMethod() needs the 
GMainLoop thread to be started by a QThread for Qt::QueuedConnection 
invocations to be guaranteed to work, or if a GThread will do. It seems 
to work with a GThread just fine, but this might be just circumstantial?




More information about the Interest mailing list