5.6. Element States

After being created, an element will not actually perform any actions yet. You need to change elements state to make it do something. GStreamer knows four element states, each with a very specific meaning. Those four states are:

You can change the state of an element using the function gst_element_set_state (). If you set an element to another state, GStreamer will internally traverse all intermediate states. So if you set an element from NULL to PLAYING, GStreamer will internally set the element to READY and PAUSED in between.

Even though an element in GST_STATE_PLAYING is ready for data processing, it will not necessarily do that. If the element is placed in a thread (see Chapter 15), it will process data automatically. In other cases, however, you will need to iterate the element's container.