Struct gstreamer_base::FlowCombiner[][src]

pub struct FlowCombiner(_);
Expand description

Utility struct to help handling gst::FlowReturn combination. Useful for gst::Elements that have multiple source pads and need to combine the different gst::FlowReturn for those pads.

FlowCombiner works by using the last gst::FlowReturn for all gst::Pad it has in its list and computes the combined return value and provides it to the caller.

To add a new pad to the FlowCombiner use add_pad(). The new gst::Pad is stored with a default value of gst::FlowReturn::Ok.

In case you want a gst::Pad to be removed, use remove_pad().

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 it.

These functions will take refs on the passed gst::Pads.

Aside from reducing the user’s code size, the main advantage of using this helper struct is to follow the standard rules for gst::FlowReturn combination. These rules are:

gst::FlowReturn::Error or below, GST_FLOW_NOT_NEGOTIATED and GST_FLOW_FLUSHING are returned immediately from the update_flow() function.

Implementations

Creates a new FlowCombiner, use gst_flow_combiner_free() to free it.

Returns

A new FlowCombiner

Adds a new gst::Pad to the FlowCombiner.

pad

the gst::Pad that is being added

Removes all pads from a FlowCombiner and resets it to its initial state.

Removes a gst::Pad from the FlowCombiner.

pad

the gst::Pad to remove

Reset flow combiner and all pads to their initial state without removing pads.

Computes the combined flow return for the pads in it.

The gst::FlowReturn parameter should be the last flow return update for a pad in this FlowCombiner. It will use this value to be able to shortcut some combinations and avoid looking over all pads again. e.g. The last combined return is the same as the latest obtained gst::FlowReturn.

fret

the latest gst::FlowReturn received for a pad in this FlowCombiner

Returns

The combined gst::FlowReturn

Sets the provided pad’s last flow return to provided value and computes the combined flow return for the pads in it.

The gst::FlowReturn parameter should be the last flow return update for a pad in this FlowCombiner. It will use this value to be able to shortcut some combinations and avoid looking over all pads again. e.g. The last combined return is the same as the latest obtained gst::FlowReturn.

pad

the gst::Pad whose gst::FlowReturn to update

fret

the latest gst::FlowReturn received for a pad in this FlowCombiner

Returns

The combined gst::FlowReturn

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Returns the type identifier of Self.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.