[gst-devel] How to Implement Gstreamer with QObject model

George Kiagiadakis kiagiadakis.george at gmail.com
Thu Oct 28 15:37:23 CEST 2010


On Thu, Oct 28, 2010 at 3:02 PM, namus <suman.subj at gmail.com> wrote:
> Hi Guys,
> let me know ..how to catch the bus messages without gmainloop?

Using gst_bus_pop() or the "sync-message" signal.

> How will the other methods differ from gmainloop mechanism?

gst_bus_pop() is the same thing if you call it from the main thread.
Actually, the GMainLoop integration code calls gst_bus_pop()
periodically from the event loop and emits the "message" signal on the
bus if it finds that a new message has arrived.

The "sync-message" signal is a different thing, it delivers the
message on the same thread that it is sent from and it is not a good
idea to use it unless you need it.

> And just for curiosity ..
> 1.Can I define my own looping mechanism..
>    what can be the design considerations for designing my own looping
> mechanism?
>    (may be out of topic .. but just wanted to know .. is this similar to
> "creating a deamon" ? ..)
> Any tutorial/documents will be helpful to me .

Yes, you can. You can use a QTimer or something similar that expires
every once in a while and calls a slot that uses gst_bus_pop() to poll
for new messages. This is essentially what the GMainLoop integration
code does as well.

You can use this as an example:
http://gitorious.org/qtgstreamer/qtgstreamer/blobs/master/src/QGst/bus.cpp

Regards,
George




More information about the gstreamer-devel mailing list