What is the difference between GST_BUS_PASS and GST_BUS_ASYNC?

Patrick Doyle wpdster at gmail.com
Tue Nov 11 04:52:09 PST 2014


Or, more accurately, why is GST_BUS_ASYNC called GST_BUS_ASYNC rather
than GST_BUS_SYNC?


When I read the documentation for GstBus and I look at the
GstBusSyncReply enum, I read:

GST_BUS_DROP - drop the message
GST_BUS_PASS  - pass the message to the async queue
GST_BUS_ASYNC - pass message to async queue, continue if message is handled

When I look at the source code (I'm looking at the 1.2.4 tag), I see
that when the sync_handler (if installed) returns GST_BUS_PASS, the
message is posted to the message queue.

When the sync_handler returns GST_BUS_ASYNC, the message is also
posted to the message queue, but then the calling thread blocks until
the message is freed.

This sounds a lot like synchronous behavior to me.

It's also very confusing between the sync_handler, which is executed
in the context of the thread that posted the message, the default (?)
GST_BUS_PASS handling, in which the the message is stuffed into a
queue to be processed asynchronously at some later time, and the
GST_BUS_ASYNC handling, in which the message is stuffed into a queue
and the calling thread synchronizes its processing with the receiving
thread.

I don't think this is actually holding me up.  If I understand things
properly, for my particular application, I think I want to install a
sync handler to process specific messages from my pipeline and let the
main loop handle the rest.  But it was very confusing to sort through.
So I thought I might learn something by asking what's going on. why is
it designed this way, and to what purposes to folks put the three
message handling mechanisms.

Thanks for reading :-)

--wpd


More information about the gstreamer-devel mailing list