GstBase.FlowCombiner¶
Fields¶
None
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class GstBase.FlowCombiner¶
Utility struct to help handling
Gst.FlowReturn
combination. Useful forGst.Element
s that have multiple source pads and need to combine the differentGst.FlowReturn
for those pads.GstBase.FlowCombiner
works by using the lastGst.FlowReturn
for allGst.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
GstBase.FlowCombiner
useGstBase.FlowCombiner.add_pad
(). The newGst.Pad
is stored with a default value ofGst.FlowReturn.OK
.In case you want a
Gst.Pad
to be removed, useGstBase.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.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
Gst.FlowReturn
combination. These rules are:Gst.FlowReturn.EOS
: only if all returns are EOS tooGst.FlowReturn.NOT_LINKED
: only if all returns are NOT_LINKED tooGst.FlowReturn.ERROR
or below: if at least one returns an error returnGst.FlowReturn.NOT_NEGOTIATED
: 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.FlowReturn.NOT_NEGOTIATED
andGst.FlowReturn.FLUSHING
are returned immediately from theGstBase.FlowCombiner.update_flow
() function.New in version 1.4.
- classmethod new()[source]¶
- Returns:
A new
GstBase.FlowCombiner
- Return type:
Creates a new
GstBase.FlowCombiner
, useGstBase.FlowCombiner.free
() to free it.New in version 1.4.
- add_pad(pad)[source]¶
-
Adds a new
Gst.Pad
to theGstBase.FlowCombiner
.New in version 1.4.
- clear()[source]¶
Removes all pads from a
GstBase.FlowCombiner
and resets it to its initial state.New in version 1.6.
- free()[source]¶
Frees a
GstBase.FlowCombiner
struct and all its internal data.New in version 1.4.
- ref()[source]¶
- Returns:
the
GstBase.FlowCombiner
.- Return type:
Increments the reference count on the
GstBase.FlowCombiner
.New in version 1.12.1.
- remove_pad(pad)[source]¶
-
Removes a
Gst.Pad
from theGstBase.FlowCombiner
.New in version 1.4.
- reset()[source]¶
Reset flow combiner and all pads to their initial state without removing pads.
New in version 1.6.
- unref()[source]¶
Decrements the reference count on the
GstBase.FlowCombiner
.New in version 1.12.1.
- update_flow(fret)[source]¶
- Parameters:
fret (
Gst.FlowReturn
) – the latestGst.FlowReturn
received for a pad in thisGstBase.FlowCombiner
- Returns:
The combined
Gst.FlowReturn
- Return type:
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 thisGstBase.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 obtainedGst.FlowReturn
.New in version 1.4.
- update_pad_flow(pad, fret)[source]¶
- Parameters:
pad (
Gst.Pad
) – theGst.Pad
whoseGst.FlowReturn
to updatefret (
Gst.FlowReturn
) – the latestGst.FlowReturn
received for a pad in thisGstBase.FlowCombiner
- Returns:
The combined
Gst.FlowReturn
- Return type:
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 thisGstBase.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 obtainedGst.FlowReturn
.New in version 1.6.