Bins manage the state of all elements contained in them. If you set
a bin (or a pipeline, which is a special top-level type of bin) to
a certain target state using gst_element_set_state ()
,
it will make sure all elements contained within it will also be set
to this state. This means it's usually only necessary to set the state
of the top-level pipeline to start up the pipeline or shut it down.
Note, however, that if elements are added to a bin or pipeline that's
already running, , e.g. from within a "pad-added" or "new-decoded-pad"
signal callback, its state will not automatically be brought in line with
the current state or target state of the bin or pipeline it was added to.
Instead, you have to need to set it to the desired target state yourself
using gst_element_set_state ()
or
gst_element_sync_state_with_parent ()
when adding
elements to an already-running pipeline.