Since the application typically only wants to deal with delivery of these messages from one thread, the Bus will marshall the messages between different threads. This is important since the actual streaming of media is done in another thread than the application.
A message is posted on the bus with the gst_bus_post() method. With the gst_bus_peek() and gst_bus_pop() methods one can look at or retrieve a previously posted message.
The bus can be polled with the gst_bus_poll() method. This methods blocks up to the specified timeout value until one of the specified messages types is posted on the bus. The application can then _pop() the messages from the bus to handle them.
It is also possible to get messages from the bus without any thread marshalling with the {@link #setSyncHandler} method. This makes itpossible to react to a message in the same thread that posted the message on the bus. This should only be used if the application is able to deal with messages from different threads.
Every {@link Pipeline} has one bus.
Note that a Pipeline will set its bus into flushing state when changing from READY to NULL state.
|
|
|
|
|
|
|
|
|
|