Element states

One you have created a pipeline packed with elements, nothing will happen yet. This is where the different states come into play.

The different element states

All elements can be in one of the following four states:

All elements start with the NULL state. The elements will go throught the following state changes:

Figure 1. The different states of a GstElement and the state transitions

The state of an element can be changed with the following code:

  GstElement *bin;

  // create a bin, put elements in it and connect them
  ...
  gst_element_set_state (bin, GST_STATE_PLAYING);
  ...
    

You can set the following states to an element:

GST_STATE_NONE_PENDINGThe element is in the desired state.
GST_STATE_NULLReset the state of an element.
GST_STATE_READYwill make the element ready to start processing data.
GST_STATE_PLAYINGmeans there really is data flowing through the graph.
GST_STATE_PAUSEDtemporary stops the data flow.