gstbase.aggregator
Module for [Aggregator] class
Types 3
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 #GstAggregatorClass::aggregate virtual method.
- Installs a #GstPadChainFunction, a #GstPadEventFullFunction and a
#GstPadQueryFunction to queue all serialized data packets per sink pad. Subclasses should not overwrite those, but instead implement #GstAggregatorClass::sink_event and #GstAggregatorClass::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
[gstbase.aggregator_pad.AggregatorPad.peekBuffer] 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.
- When [gstbase.aggregator_pad.AggregatorPad.peekBuffer] or [gstbase.aggregator_pad.AggregatorPad.hasBuffer]
are called, a reference is taken to the returned buffer, which stays valid until either:
- [gstbase.aggregator_pad.AggregatorPad.popBuffer] is called, in which case the caller
is guaranteed that the buffer they receive is the same as the peeked buffer.
- [gstbase.aggregator_pad.AggregatorPad.dropBuffer] is called, in which case the caller
is guaranteed that the dropped buffer is the one that was peeked.
- the subclass implementation of #GstAggregatorClass.aggregate returns.
Subsequent calls to [gstbase.aggregator_pad.AggregatorPad.peekBuffer] or [gstbase.aggregator_pad.AggregatorPad.hasBuffer] return / check the same buffer that was returned / checked, until one of the conditions listed above is met.
Subclasses are only allowed to call these methods from the aggregate thread.
- If the subclass wishes to push a buffer downstream in its aggregate
implementation, it should do so through the [gstbase.aggregator.Aggregator.finishBuffer] method. This method will take care of sending and ordering mandatory events such as stream start, caps and segment. Buffer lists can also be pushed out with [gstbase.aggregator.Aggregator.finishBufferList].
- 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. In addition, if the gap event was flagged with GST_GAP_FLAG_MISSING_DATA, a custom meta is added to the resulting gap buffer (GstAggregatorMissingDataMeta).
- Subclasses must use (a subclass of) #GstAggregatorPad for both their
sink and source pads. See [gst.element_class.ElementClass.addStaticPadTemplateWithGtype].
This class used to live in gst-plugins-bad and was moved to core.
Aggregator self()Returns `this`, for use in `with` statements.AggregatorGidBuilder builder()Get builder for [gstbase.aggregator.Aggregator] Returns: New builder objectbool emitSignals() @propertyGet `emitSignals` property. Returns: Enables the emission of signals such as #GstAggregator::samples-selectedvoid emitSignals(bool propval) @propertySet `emitSignals` property. Params: propval = Enables the emission of signals such as #GstAggregator::samples-selectedulong latency() @propertyvoid latency(ulong propval) @propertyulong minUpstreamLatency() @propertyGet `minUpstreamLatency` property. Returns: Force minimum upstream latency (in nanoseconds). When sources with a higher latency are expected to be plugged in dynamically after the aggregator has st...void minUpstreamLatency(ulong propval) @propertySet `minUpstreamLatency` property. Params: propval = Force minimum upstream latency (in nanoseconds). When sources with a higher latency are expected to be plugged in dynamically after the aggregat...ulong startTime() @propertyvoid startTime(ulong propval) @propertyvoid startTimeSelection(gstbase.types.AggregatorStartTimeSelection propval) @propertygst.types.FlowReturn finishBuffer(gst.buffer.Buffer buffer)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.gst.types.FlowReturn finishBufferList(gst.buffer_list.BufferList bufferlist)This method will push the provided output buffer list downstream. If needed, mandatory events such as stream-start, caps, and segment events will be sent before pushing the buffer.void getAllocator(out gst.allocator.Allocator allocator, out gst.allocation_params.AllocationParams params)Lets #GstAggregator sub-classes get the memory allocator acquired by the base class and its params.bool getForceLive()Subclasses may use the return value to inform whether they should return [gst.types.FlowReturn.Eos] from their aggregate implementation. Returns: whether live status was forced on self.bool getIgnoreInactivePads()gst.types.ClockTime getLatency()Retrieves the latency values reported by self in response to the latency query, or [gst.types.CLOCKTIMENONE] if there is not live source connected and the element will not wait for the clock.bool negotiate()Negotiates src pad caps with downstream elements. Unmarks GSTPADFLAGNEEDRECONFIGURE in any case. But marks it again if #GstAggregatorClass::negotiate fails. Returns: true if the negotiation succeed...gst.sample.Sample peekNextSample(gstbase.aggregator_pad.AggregatorPad pad)Use this function to determine what input buffers will be aggregated to produce the next output buffer. This should only be called from a #GstAggregator::samples-selected handler, and can be used t...void selectedSamples(gst.types.ClockTime pts, gst.types.ClockTime dts, gst.types.ClockTime duration, gst.structure.Structure info = null)Subclasses should call this when they have prepared the buffers they will aggregate for each of their sink pads, but before using any of the properties of the pads that govern how aggregation shoul...void setForceLive(bool forceLive)Subclasses should call this at construction time in order for self to aggregate on a timeout even when no live source is connected.void setIgnoreInactivePads(bool ignore)Subclasses should call this when they don't want to time out waiting for a pad that hasn't yet received any buffers in live mode.void setLatency(gst.types.ClockTime minLatency, gst.types.ClockTime maxLatency)Lets #GstAggregator 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 if the values changed.void setSrcCaps(gst.caps.Caps caps)Sets the caps to be used on the src pad.gst.types.ClockTime simpleGetNextTime()This is a simple #GstAggregatorClass::getnexttime implementation that just looks at the #GstSegment on the srcpad of the aggregator and bases the next time on the running time there.void updateSegment(gst.segment.Segment segment)Subclasses should use this to update the segment on their source pad, instead of directly pushing new segment events downstream.gulong connectSamplesSelected(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] == gst.segment.Segment)))
&& (Parameters!T.length < 2 || (ParameterStorageClassTuple!T[1] == ParameterStorageClass.none && is(Parameters!T[1] == ulong)))
&& (Parameters!T.length < 3 || (ParameterStorageClassTuple!T[2] == ParameterStorageClass.none && is(Parameters!T[2] == ulong)))
&& (Parameters!T.length < 4 || (ParameterStorageClassTuple!T[3] == ParameterStorageClass.none && is(Parameters!T[3] == ulong)))
&& (Parameters!T.length < 5 || (ParameterStorageClassTuple!T[4] == ParameterStorageClass.none && is(Parameters!T[4] == gst.structure.Structure)))
&& (Parameters!T.length < 6 || (ParameterStorageClassTuple!T[5] == ParameterStorageClass.none && is(Parameters!T[5] : gstbase.aggregator.Aggregator)))
&& Parameters!T.length < 7)Connect to `SamplesSelected` signal.T emitSignals(bool propval)Set `emitSignals` property. Params: propval = Enables the emission of signals such as #GstAggregator::samples-selected Returns: Builder instance for fluent chainingT latency(ulong propval)T minUpstreamLatency(ulong propval)Set `minUpstreamLatency` property. Params: propval = Force minimum upstream latency (in nanoseconds). When sources with a higher latency are expected to be plugged in dynamically after the aggregat...T startTime(ulong propval)Fluent builder for [gstbase.aggregator.Aggregator]