gi-gstbase-1.0.23: GStreamerBase bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

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:

FlowReturnError or below, GST_FLOW_NOT_NEGOTIATED and GST_FLOW_FLUSHING are returned immediately from the flowCombinerUpdateFlow function.

Since: 1.4

Synopsis

Exported types

newtype FlowCombiner Source #

Memory-managed wrapper type.

Constructors

FlowCombiner (ManagedPtr FlowCombiner) 

Instances

Instances details
Eq FlowCombiner Source # 
Instance details

Defined in GI.GstBase.Structs.FlowCombiner

Methods

(==) :: FlowCombiner -> FlowCombiner -> Bool

(/=) :: FlowCombiner -> FlowCombiner -> Bool

GBoxed FlowCombiner Source # 
Instance details

Defined in GI.GstBase.Structs.FlowCombiner

ManagedPtrNewtype FlowCombiner Source # 
Instance details

Defined in GI.GstBase.Structs.FlowCombiner

Methods

toManagedPtr :: FlowCombiner -> ManagedPtr FlowCombiner

TypedObject FlowCombiner Source # 
Instance details

Defined in GI.GstBase.Structs.FlowCombiner

Methods

glibType :: IO GType

IsGValue FlowCombiner Source #

Convert FlowCombiner to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.GstBase.Structs.FlowCombiner

Methods

toGValue :: FlowCombiner -> IO GValue

fromGValue :: GValue -> IO FlowCombiner

HasParentTypes FlowCombiner Source # 
Instance details

Defined in GI.GstBase.Structs.FlowCombiner

type ParentTypes FlowCombiner Source # 
Instance details

Defined in GI.GstBase.Structs.FlowCombiner

type ParentTypes FlowCombiner = '[] :: [Type]

Methods

Overloaded methods

addPad

flowCombinerAddPad Source #

Arguments

:: (HasCallStack, MonadIO m, IsPad a) 
=> FlowCombiner

combiner: the FlowCombiner

-> a

pad: the Pad that is being added

-> m () 

Adds a new Pad to the FlowCombiner.

Since: 1.4

clear

flowCombinerClear Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FlowCombiner

combiner: the FlowCombiner to clear

-> m () 

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

Since: 1.6

free

flowCombinerFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FlowCombiner

combiner: the FlowCombiner to free

-> m () 

Frees a FlowCombiner struct and all its internal data.

Since: 1.4

new

flowCombinerNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m FlowCombiner

Returns: A new FlowCombiner

Creates a new FlowCombiner, use flowCombinerFree to free it.

Since: 1.4

ref

flowCombinerRef Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FlowCombiner

combiner: the FlowCombiner to add a reference to.

-> m FlowCombiner

Returns: the FlowCombiner.

Increments the reference count on the FlowCombiner.

Since: 1.12.1

removePad

flowCombinerRemovePad Source #

Arguments

:: (HasCallStack, MonadIO m, IsPad a) 
=> FlowCombiner

combiner: the FlowCombiner

-> a

pad: the Pad to remove

-> m () 

Removes a Pad from the FlowCombiner.

Since: 1.4

reset

flowCombinerReset Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FlowCombiner

combiner: the FlowCombiner to clear

-> m () 

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

Since: 1.6

unref

flowCombinerUnref Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FlowCombiner

combiner: the FlowCombiner to unreference.

-> m () 

Decrements the reference count on the FlowCombiner.

Since: 1.12.1

updateFlow

flowCombinerUpdateFlow Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> FlowCombiner

combiner: the FlowCombiner

-> FlowReturn

fret: the latest FlowReturn received for a pad in this FlowCombiner

-> m FlowReturn

Returns: The combined FlowReturn

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

combiner: the FlowCombiner

-> a

pad: the Pad whose FlowReturn to update

-> FlowReturn

fret: the latest FlowReturn received for a pad in this FlowCombiner

-> m FlowReturn

Returns: The combined FlowReturn

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