Struct gstreamer_base::FlowCombiner [−]
pub struct FlowCombiner(_);
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 FlowCombiner::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 FlowCombiner::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::Eos: only if all returns are EOS toogst::FlowReturn::NotLinked: only if all returns are NOT_LINKED toogst::FlowReturn::Erroror below: if at least one returns an error returngst::FlowReturn::NotNegotiated: if at least one returns a not-negotiated returngst::FlowReturn::Flushing: if at least one returns flushinggst::FlowReturn::Ok: otherwise
gst::FlowReturn::Error or below, GST_FLOW_NOT_NEGOTIATED and GST_FLOW_FLUSHING are
returned immediatelly from the FlowCombiner::update_flow function.
Methods
impl FlowCombiner[src]
impl FlowCombinerpub fn new() -> FlowCombiner[src]
pub fn new() -> FlowCombinerpub fn add_pad<P: IsA<Pad>>(&self, pad: &P)[src]
pub fn add_pad<P: IsA<Pad>>(&self, pad: &P)pub fn clear(&self)[src]
pub fn clear(&self)Removes all pads from a FlowCombiner and resets it to its initial state.
pub fn remove_pad<P: IsA<Pad>>(&self, pad: &P)[src]
pub fn remove_pad<P: IsA<Pad>>(&self, pad: &P)pub fn reset(&self)[src]
pub fn reset(&self)Reset flow combiner and all pads to their initial state without removing pads.
pub fn update_flow(&self, fret: FlowReturn) -> FlowReturn[src]
pub fn update_flow(&self, fret: FlowReturn) -> FlowReturnComputes 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
pub fn update_pad_flow<P: IsA<Pad>>(
&self,
pad: &P,
fret: FlowReturn
) -> FlowReturn[src]
pub fn update_pad_flow<P: IsA<Pad>>(
&self,
pad: &P,
fret: FlowReturn
) -> FlowReturnSets 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
impl Clone for FlowCombiner
impl Clone for FlowCombinerfn clone(&self) -> FlowCombiner
fn clone(&self) -> FlowCombinerReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl StaticType for FlowCombiner
impl StaticType for FlowCombinerfn static_type() -> Type
fn static_type() -> TypeReturns the type identifier of Self.
impl Default for FlowCombiner[src]
impl Default for FlowCombinerAuto Trait Implementations
impl !Send for FlowCombiner
impl !Send for FlowCombinerimpl !Sync for FlowCombiner
impl !Sync for FlowCombiner