Reputation: 78
Concerning Gstream state changes, we should send a event when the pipeline is working correctly (Stream OK) and when there is an error we should send another event (Stream Error).
Catching errors over the message callback works, but we don't know which state indicate that the full pipeline is working correctly (from src to sync).
Upvotes: 0
Views: 2397
Reputation: 752
There is no specific error state in GStreamer (GStreamer states are: NULL, READY, PAUSED, PLAYING (*)). Thus, you need to watch and check if any error occurs. You should check, at least:
gst_element_set_state
)Errors can be received by listening to the GstBus of the element/pipeline for GstMessage objects with the type GST_MESSAGE_ERROR or GST_MESSAGE_WARNING. The thrown errors should be inspected, and filtered if appropriate.
(*) Note: actually, the complete list of states in the API includes also a pending state that may be relevant in some cases (see e.g. How to resume playing after paused using gstreamer?)
Upvotes: 1