FlowCombiner

Utility struct to help handling GstFlowReturn combination. Useful for gstreamer.Element<!-- -->s that have multiple source pads and need to combine the different GstFlowReturn for those pads.

gst.FlowCombiner.FlowCombiner works by using the last GstFlowReturn for all gstreamer.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 gst.FlowCombiner.FlowCombiner use FlowCombiner.addPad. The new gstreamer.Pad is stored with a default value of GST_FLOW_OK.

In case you want a gstreamer.Pad to be removed, use FlowCombiner.removePad.

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 gstreamer.Pad<!-- -->s.

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

* GST_FLOW_EOS: only if all returns are EOS too * GST_FLOW_NOT_LINKED: only if all returns are NOT_LINKED too * GST_FLOW_ERROR or below: if at least one returns an error return * GST_FLOW_NOT_NEGOTIATED: if at least one returns a not-negotiated return * GST_FLOW_FLUSHING: if at least one returns flushing * GST_FLOW_OK: otherwise

GST_FLOW_ERROR or below, GST_FLOW_NOT_NEGOTIATED and GST_FLOW_FLUSHING are returned immediately from the FlowCombiner.updateFlow function.

Constructors

this
this(GstFlowCombiner* gstFlowCombiner, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this()

Creates a new gst.FlowCombiner.FlowCombiner, use FlowCombiner.free to free it.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Members

Functions

addPad
void addPad(Pad pad)

Adds a new gstreamer.Pad to the gst.FlowCombiner.FlowCombiner

clear
void clear()

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

free
void free()

Frees a gst.FlowCombiner.FlowCombiner struct and all its internal data.

getFlowCombinerStruct
GstFlowCombiner* getFlowCombinerStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

ref_
FlowCombiner ref_()

Increments the reference count on the gst.FlowCombiner.FlowCombiner

removePad
void removePad(Pad pad)

Removes a gstreamer.Pad from the gst.FlowCombiner.FlowCombiner

reset
void reset()

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

unref
void unref()

Decrements the reference count on the gst.FlowCombiner.FlowCombiner

updateFlow
GstFlowReturn updateFlow(GstFlowReturn fret)

Computes the combined flow return for the pads in it.

updatePadFlow
GstFlowReturn updatePadFlow(Pad pad, GstFlowReturn fret)

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

Static functions

getType
GType getType()

Variables

gstFlowCombiner
GstFlowCombiner* gstFlowCombiner;

the main Gtk struct

Meta