Manages a set of pads that operate in collect mode.
This means that control is given to the manager of this object when all pads have data.
* Collectpads are created with CollectPads. A callback
should then be installed with set_function.
* Pads are added to the collection with add_pad/
remove_pad. The pad has to be a sinkpad. When added, the chain, event
and query functions of the pad are overridden. The element_private of the pad is used to store private information for the collectpads.
* For each pad, data is queued in the _chain function or by performing a pull_range.
* When data is queued on all pads in waiting mode, the callback function is called.
* Data can be dequeued from the pad with the pop method. One can peek at the
data with the peek function. These functions will return null if
the pad received an EOS event. When all pads return null from a peek
, the element can emit an EOS event itself.
* Elements should call start and
stop in their state change functions to start and stop the processing of the
collectpads. The stop call should be called before calling the parent element
state change function in the PAUSED_TO_READY state change to ensure no pad is blocked and the element can finish streaming.
* set_waiting sets a pad to waiting or non-waiting mode. CollectPads
element is not waiting for data to be collected on non-waiting pads. Thus these pads may but need not have data when the callback is
called. All pads are in waiting mode by default.
CollectPads provides a default collection algorithm that will
determine the oldest buffer available on all of its pads, and then delegate to a configured callback.