[ CCode ( cname = "GstFlowCombiner" , copy_function = "g_boxed_copy" , free_function = "g_boxed_free" , lower_case_cprefix = "gst_flow_combiner_" , type_id = "gst_flow_combiner_get_type ()" ) ]
[ Compact ]
[ GIR ( name = "FlowCombiner" ) ]
[ Version ( since = "1.4" ) ]
public class FlowCombiner
Utility struct to help handling FlowReturn combination.
Useful for Elements that have multiple source pads and need to combine
the different FlowReturn for those pads.
FlowCombiner works by using the last FlowReturn for
all Pad it has in its list and computes the combined return value and provides it to the
To add a new pad to the FlowCombiner use
add_pad. The new
Pad is stored with a default value of
In case you want a Pad to be removed, use
Please be aware that this struct isn't thread safe as its designed to be used by demuxers, those usually will have a single thread operating
These functions will take refs on the passed Pads.
Aside from reducing the user's code size, the main advantage of using this helper struct is to follow the standard rules for
FlowReturn combination. These rules are:
* EOS: only if all returns are EOS too *
NOT_LINKED: only if all returns are NOT_LINKED too *
ERROR or below: if at least one returns an error return *
NOT_NEGOTIATED: if at least one returns a not-negotiated
return * FLUSHING: if at least one returns flushing *
ERROR or below, GST_FLOW_NOT_NEGOTIATED and GST_FLOW_FLUSHING are
returned immediately from the update_flow function.
- public unowned FlowCombiner @ref ()
Increments the reference count on the FlowCombiner
- public void add_pad (Pad pad)
Adds a new Pad to
- public void clear ()
Removes all pads from a FlowCombiner and resets
it to its initial state.
- public void free ()
Frees a FlowCombiner struct and all its internal
- public void remove_pad (Pad pad)
Removes a Pad from
- public void reset ()
Reset flow combiner and all pads to their initial state without removing
- public void unref ()
Decrements the reference count on the FlowCombiner
- public FlowReturn update_flow (FlowReturn fret)
Computes the combined flow return for the pads in it.
- public FlowReturn update_pad_flow (Pad pad, FlowReturn fret)
Sets the provided pad's last flow return to provided value and computes the
combined flow return for the pads in it.