| Copyright | Will Thompson and Iñaki García Etxebarria |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria |
| Safe Haskell | Safe-Inferred |
| Language | Haskell2010 |
GI.GstBase.Structs.FlowCombiner
Description
Utility struct to help handling FlowReturn combination. Useful for
Elements that have multiple source pads and need to combine
the different FlowReturn for those pads.
FlowCombiner works by using the last FlowReturn for all 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 flowCombinerAddPad.
The new Pad is stored with a default value of FlowReturnOk.
In case you want a Pad to be removed, use flowCombinerRemovePad.
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 Pads.
Aside from reducing the user's code size, the main advantage of using this
helper struct is to follow the standard rules for FlowReturn combination.
These rules are:
FlowReturnEos: only if all returns are EOS tooFlowReturnNotLinked: only if all returns are NOT_LINKED tooFlowReturnErroror below: if at least one returns an error returnFlowReturnNotNegotiated: if at least one returns a not-negotiated returnFlowReturnFlushing: if at least one returns flushingFlowReturnOk: otherwise
FlowReturnError or below, GST_FLOW_NOT_NEGOTIATED and GST_FLOW_FLUSHING are
returned immediately from the flowCombinerUpdateFlow function.
Since: 1.4
Synopsis
- newtype FlowCombiner = FlowCombiner (ManagedPtr FlowCombiner)
- flowCombinerAddPad :: (HasCallStack, MonadIO m, IsPad a) => FlowCombiner -> a -> m ()
- flowCombinerClear :: (HasCallStack, MonadIO m) => FlowCombiner -> m ()
- flowCombinerFree :: (HasCallStack, MonadIO m) => FlowCombiner -> m ()
- flowCombinerNew :: (HasCallStack, MonadIO m) => m FlowCombiner
- flowCombinerRef :: (HasCallStack, MonadIO m) => FlowCombiner -> m FlowCombiner
- flowCombinerRemovePad :: (HasCallStack, MonadIO m, IsPad a) => FlowCombiner -> a -> m ()
- flowCombinerReset :: (HasCallStack, MonadIO m) => FlowCombiner -> m ()
- flowCombinerUnref :: (HasCallStack, MonadIO m) => FlowCombiner -> m ()
- flowCombinerUpdateFlow :: (HasCallStack, MonadIO m) => FlowCombiner -> FlowReturn -> m FlowReturn
- flowCombinerUpdatePadFlow :: (HasCallStack, MonadIO m, IsPad a) => FlowCombiner -> a -> FlowReturn -> m FlowReturn
Exported types
newtype FlowCombiner Source #
Memory-managed wrapper type.
Constructors
| FlowCombiner (ManagedPtr FlowCombiner) |
Instances
| Eq FlowCombiner Source # | |
Defined in GI.GstBase.Structs.FlowCombiner | |
| GBoxed FlowCombiner Source # | |
Defined in GI.GstBase.Structs.FlowCombiner | |
| ManagedPtrNewtype FlowCombiner Source # | |
Defined in GI.GstBase.Structs.FlowCombiner Methods | |
| TypedObject FlowCombiner Source # | |
Defined in GI.GstBase.Structs.FlowCombiner | |
| HasParentTypes FlowCombiner Source # | |
Defined in GI.GstBase.Structs.FlowCombiner | |
| IsGValue (Maybe FlowCombiner) Source # | Convert |
Defined in GI.GstBase.Structs.FlowCombiner Methods gvalueGType_ :: IO GType # gvalueSet_ :: Ptr GValue -> Maybe FlowCombiner -> IO () # gvalueGet_ :: Ptr GValue -> IO (Maybe FlowCombiner) # | |
| type ParentTypes FlowCombiner Source # | |
Defined in GI.GstBase.Structs.FlowCombiner | |
Methods
Click to display all available methods, including inherited ones
Methods
addPad, clear, free, ref, removePad, reset, unref, updateFlow, updatePadFlow.
Getters
None.
Setters
None.
addPad
Arguments
| :: (HasCallStack, MonadIO m, IsPad a) | |
| => FlowCombiner |
|
| -> a |
|
| -> m () |
Adds a new Pad to the FlowCombiner.
Since: 1.4
clear
Arguments
| :: (HasCallStack, MonadIO m) | |
| => FlowCombiner |
|
| -> m () |
Removes all pads from a FlowCombiner and resets it to its initial state.
Since: 1.6
free
Arguments
| :: (HasCallStack, MonadIO m) | |
| => FlowCombiner |
|
| -> m () |
Frees a FlowCombiner struct and all its internal data.
Since: 1.4
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m FlowCombiner | Returns: A new |
Creates a new FlowCombiner, use flowCombinerFree to free it.
Since: 1.4
ref
Arguments
| :: (HasCallStack, MonadIO m) | |
| => FlowCombiner |
|
| -> m FlowCombiner | Returns: the |
Increments the reference count on the FlowCombiner.
Since: 1.12.1
removePad
flowCombinerRemovePad Source #
Arguments
| :: (HasCallStack, MonadIO m, IsPad a) | |
| => FlowCombiner |
|
| -> a |
|
| -> m () |
Removes a Pad from the FlowCombiner.
Since: 1.4
reset
Arguments
| :: (HasCallStack, MonadIO m) | |
| => FlowCombiner |
|
| -> m () |
Reset flow combiner and all pads to their initial state without removing pads.
Since: 1.6
unref
Arguments
| :: (HasCallStack, MonadIO m) | |
| => FlowCombiner |
|
| -> m () |
Decrements the reference count on the FlowCombiner.
Since: 1.12.1
updateFlow
flowCombinerUpdateFlow Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => FlowCombiner |
|
| -> FlowReturn |
|
| -> m FlowReturn | Returns: The combined |
Computes the combined flow return for the pads in it.
The 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 FlowReturn.
Since: 1.4
updatePadFlow
flowCombinerUpdatePadFlow Source #
Arguments
| :: (HasCallStack, MonadIO m, IsPad a) | |
| => FlowCombiner |
|
| -> a |
|
| -> FlowReturn |
|
| -> m FlowReturn | Returns: The combined |
Sets the provided pad's last flow return to provided value and computes the combined flow return for the pads in it.
The 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 FlowReturn.
Since: 1.6