Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (inaki@blueleaf.cc) |
Safe Haskell | None |
Language | Haskell2010 |
Manages a set of pads with the purpose of aggregating their buffers. Control is given to the subclass when all pads have data.
- Base class for mixers and muxers. Subclasses should at least implement
the
AggregatorClass
.aggregate
() virtual method. - Installs a
PadChainFunction
, aPadEventFullFunction
and aPadQueryFunction
to queue all serialized data packets per sink pad. Subclasses should not overwrite those, but instead implementAggregatorClass
.sink_event
() andAggregatorClass
.sink_query
() as needed. - When data is queued on all pads, the aggregate vmethod is called.
- One can peek at the data on any given GstAggregatorPad with the gst_aggregator_pad_peek_buffer () method, and remove it from the pad with the gst_aggregator_pad_pop_buffer () method. When a buffer has been taken with pop_buffer (), a new buffer can be queued on that pad.
- If the subclass wishes to push a buffer downstream in its aggregate implementation, it should do so through the gst_aggregator_finish_buffer () method. This method will take care of sending and ordering mandatory events such as stream start, caps and segment.
- Same goes for EOS events, which should not be pushed directly by the subclass, it should instead return GST_FLOW_EOS in its aggregate implementation.
- Note that the aggregator logic regarding gap event handling is to turn these into gap buffers with matching PTS and duration. It will also flag these buffers with GST_BUFFER_FLAG_GAP and GST_BUFFER_FLAG_DROPPABLE to ease their identification and subsequent processing.
- Subclasses must use (a subclass of)
AggregatorPad
for both their sink and source pads. SeeelementClassAddStaticPadTemplateWithGtype
.
This class used to live in gst-plugins-bad and was moved to core.
Since: 1.14
Synopsis
- newtype Aggregator = Aggregator (ManagedPtr Aggregator)
- class (GObject o, IsDescendantOf Aggregator o) => IsAggregator o
- toAggregator :: (MonadIO m, IsAggregator o) => o -> m Aggregator
- noAggregator :: Maybe Aggregator
- aggregatorFinishBuffer :: (HasCallStack, MonadIO m, IsAggregator a) => a -> Buffer -> m FlowReturn
- aggregatorGetAllocator :: (HasCallStack, MonadIO m, IsAggregator a) => a -> m (Allocator, AllocationParams)
- aggregatorGetBufferPool :: (HasCallStack, MonadIO m, IsAggregator a) => a -> m BufferPool
- aggregatorGetLatency :: (HasCallStack, MonadIO m, IsAggregator a) => a -> m Word64
- aggregatorSetLatency :: (HasCallStack, MonadIO m, IsAggregator a) => a -> Word64 -> Word64 -> m ()
- aggregatorSetSrcCaps :: (HasCallStack, MonadIO m, IsAggregator a) => a -> Caps -> m ()
- aggregatorSimpleGetNextTime :: (HasCallStack, MonadIO m, IsAggregator a) => a -> m Word64
- constructAggregatorLatency :: IsAggregator o => Word64 -> IO (GValueConstruct o)
- getAggregatorLatency :: (MonadIO m, IsAggregator o) => o -> m Word64
- setAggregatorLatency :: (MonadIO m, IsAggregator o) => o -> Word64 -> m ()
- constructAggregatorMinUpstreamLatency :: IsAggregator o => Word64 -> IO (GValueConstruct o)
- getAggregatorMinUpstreamLatency :: (MonadIO m, IsAggregator o) => o -> m Word64
- setAggregatorMinUpstreamLatency :: (MonadIO m, IsAggregator o) => o -> Word64 -> m ()
- constructAggregatorStartTime :: IsAggregator o => Word64 -> IO (GValueConstruct o)
- getAggregatorStartTime :: (MonadIO m, IsAggregator o) => o -> m Word64
- setAggregatorStartTime :: (MonadIO m, IsAggregator o) => o -> Word64 -> m ()
Exported types
newtype Aggregator Source #
Memory-managed wrapper type.
Instances
GObject Aggregator Source # | |
Defined in GI.GstBase.Objects.Aggregator gobjectType :: IO GType # | |
HasParentTypes Aggregator Source # | |
Defined in GI.GstBase.Objects.Aggregator | |
type ParentTypes Aggregator Source # | |
Defined in GI.GstBase.Objects.Aggregator |
class (GObject o, IsDescendantOf Aggregator o) => IsAggregator o Source #
Type class for types which can be safely cast to Aggregator
, for instance with toAggregator
.
Instances
(GObject o, IsDescendantOf Aggregator o) => IsAggregator o Source # | |
Defined in GI.GstBase.Objects.Aggregator |
toAggregator :: (MonadIO m, IsAggregator o) => o -> m Aggregator Source #
Cast to Aggregator
, for types for which this is known to be safe. For general casts, use castTo
.
noAggregator :: Maybe Aggregator Source #
A convenience alias for Nothing
:: Maybe
Aggregator
.
Methods
finishBuffer
aggregatorFinishBuffer Source #
:: (HasCallStack, MonadIO m, IsAggregator a) | |
=> a |
|
-> Buffer |
|
-> m FlowReturn |
This method will push the provided output buffer downstream. If needed, mandatory events such as stream-start, caps, and segment events will be sent before pushing the buffer.
getAllocator
aggregatorGetAllocator Source #
:: (HasCallStack, MonadIO m, IsAggregator a) | |
=> a |
|
-> m (Allocator, AllocationParams) |
Lets Aggregator
sub-classes get the memory allocator
acquired by the base class and its params
.
Unref the allocator
after use it.
getBufferPool
aggregatorGetBufferPool Source #
:: (HasCallStack, MonadIO m, IsAggregator a) | |
=> a |
|
-> m BufferPool | Returns: the instance of the |
No description available in the introspection data.
getLatency
:: (HasCallStack, MonadIO m, IsAggregator a) | |
=> a |
|
-> m Word64 | Returns: The latency or |
Retrieves the latency values reported by self
in response to the latency
query, or CLOCK_TIME_NONE
if there is not live source connected and the element
will not wait for the clock.
Typically only called by subclasses.
setLatency
:: (HasCallStack, MonadIO m, IsAggregator a) | |
=> a |
|
-> Word64 |
|
-> Word64 |
|
-> m () |
Lets Aggregator
sub-classes tell the baseclass what their internal
latency is. Will also post a LATENCY message on the bus so the pipeline
can reconfigure its global latency.
setSrcCaps
:: (HasCallStack, MonadIO m, IsAggregator a) | |
=> a |
|
-> Caps |
|
-> m () |
Sets the caps to be used on the src pad.
simpleGetNextTime
aggregatorSimpleGetNextTime Source #
:: (HasCallStack, MonadIO m, IsAggregator a) | |
=> a |
|
-> m Word64 | Returns: The running time based on the position |
This is a simple Aggregator
::get_next_time
implementation that
just looks at the Segment
on the srcpad of the aggregator and bases
the next time on the running time there.
This is the desired behaviour in most cases where you have a live source and you have a dead line based aggregator subclass.
Since: 1.16
Properties
latency
No description available in the introspection data.
constructAggregatorLatency :: IsAggregator o => Word64 -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “latency
” property. This is rarely needed directly, but it is used by new
.
getAggregatorLatency :: (MonadIO m, IsAggregator o) => o -> m Word64 Source #
Get the value of the “latency
” property.
When overloading is enabled, this is equivalent to
get
aggregator #latency
setAggregatorLatency :: (MonadIO m, IsAggregator o) => o -> Word64 -> m () Source #
Set the value of the “latency
” property.
When overloading is enabled, this is equivalent to
set
aggregator [ #latency:=
value ]
minUpstreamLatency
Force minimum upstream latency (in nanoseconds). When sources with a higher latency are expected to be plugged in dynamically after the aggregator has started playing, this allows overriding the minimum latency reported by the initial source(s). This is only taken into account when larger than the actually reported minimum latency.
Since: 1.16
constructAggregatorMinUpstreamLatency :: IsAggregator o => Word64 -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “min-upstream-latency
” property. This is rarely needed directly, but it is used by new
.
getAggregatorMinUpstreamLatency :: (MonadIO m, IsAggregator o) => o -> m Word64 Source #
Get the value of the “min-upstream-latency
” property.
When overloading is enabled, this is equivalent to
get
aggregator #minUpstreamLatency
setAggregatorMinUpstreamLatency :: (MonadIO m, IsAggregator o) => o -> Word64 -> m () Source #
Set the value of the “min-upstream-latency
” property.
When overloading is enabled, this is equivalent to
set
aggregator [ #minUpstreamLatency:=
value ]
startTime
No description available in the introspection data.
constructAggregatorStartTime :: IsAggregator o => Word64 -> IO (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “start-time
” property. This is rarely needed directly, but it is used by new
.
getAggregatorStartTime :: (MonadIO m, IsAggregator o) => o -> m Word64 Source #
Get the value of the “start-time
” property.
When overloading is enabled, this is equivalent to
get
aggregator #startTime
setAggregatorStartTime :: (MonadIO m, IsAggregator o) => o -> Word64 -> m () Source #
Set the value of the “start-time
” property.
When overloading is enabled, this is equivalent to
set
aggregator [ #startTime:=
value ]