Are Bus Messages Queued?

Tim Müller tim at centricular.com
Fri Nov 4 08:47:17 UTC 2016


On Thu, 2016-11-03 at 17:42 -0700, Nastooh Avessta wrote:

Hi Nastooh,

> Got an application that would take an action, upon receiving messages
> from multiple plugins , through a watch on the app bus: (Note that
> these messages are asynchronous and may arrive at the ~ same time.)
>>  
> What I am seeing is that on different runs not all messages make it
> to    “case GST_MESSAGE_ELEMENT”, and am wondering if I need to queue
> messages myself, start a new processing thread per message, etc.?

No, GstBus is a message queue itself. All messages should make it
through to your handler. No messages should be lost unless you pop them
off the bus yourself.

Two exceptions:

If you set a pipeline to NULL state the bus is 'flushed' in the NULL-
>READY state change transition. You can disable that behaviour though.

If you pop messages off the bus e.g. with gst_bus_*_pop_filtered() in
another thread whist at the same time having a bus watch set up that
might interact in weird ways.

Check the GST_DEBUG=GST_BUS:6 log to see whether those messages make it
to the bus in the first place.

Cheers
 -Tim
-- 
Tim Müller, Centricular Ltd - http://www.centricular.com


More information about the gstreamer-devel mailing list