Christoph Acs
Christoph Acs

Reputation: 78

Which state in gstreamer indicates that the pipeline is working correctly?

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

Answers (1)

airos
airos

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:

  • the return value of the function for changing the state (gst_element_set_state)
  • if any error message is sent to the bus:

    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

Related Questions