GstBase.FlowCombiner¶
Fields¶
None
Methods¶
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class GstBase.FlowCombiner¶
Utility struct to help handling
Gst.FlowReturncombination. Useful forGst.Elements that have multiple source pads and need to combine the differentGst.FlowReturnfor those pads.GstBase.FlowCombinerworks by using the lastGst.FlowReturnfor allGst.Padit has in its list and computes the combined return value and provides it to the caller.To add a new pad to the
GstBase.FlowCombineruseGstBase.FlowCombiner.add_pad(). The newGst.Padis stored with a default value ofGst.FlowReturn.OK.In case you want a
Gst.Padto 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.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.FlowReturncombination. 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.ERRORor 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.ERRORor below,Gst.FlowReturn.NOT_NEGOTIATEDandGst.FlowReturn.FLUSHINGare 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.Padto theGstBase.FlowCombiner.New in version 1.4.
- clear()[source]¶
Removes all pads from a
GstBase.FlowCombinerand resets it to its initial state.New in version 1.6.
- free()[source]¶
Frees a
GstBase.FlowCombinerstruct 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.Padfrom 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.FlowReturnreceived 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.FlowReturnparameter 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.PadwhoseGst.FlowReturnto updatefret (
Gst.FlowReturn) – the latestGst.FlowReturnreceived 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.FlowReturnparameter 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.