Table of Contents
Once you have created a pipeline packed with elements, nothing will happen right away. This is where the different states come into play.
All elements can be in one of the following four states:
NULL: this is the default state all elements are in when they are created and are doing nothing.
READY: An element is ready to start doing something.
PAUSED: The element is paused for a period of time.
PLAYING: The element is doing something.
All elements start with the NULL state. The elements will go throught the following state changes: NULL -> READY -> PAUSED -> PLAYING. Remember when going from PLAYING to READY, GStreamer will internally go throught the intermediate states.
The state of an element can be changed with the following code:
GstElement *bin; // create a bin, put elements in it and link them ... gst_element_set_state (bin, GST_STATE_PLAYING); ...
You can set the following states to an element:
GST_STATE_NULL | Reset the state of an element. |
GST_STATE_READY | will make the element ready to start processing data. |
GST_STATE_PAUSED | temporary stops the data flow. |
GST_STATE_PLAYING | means there really is data flowing through the graph. |