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 PadChainFunction, a PadEventFullFunction and a
PadQueryFunction 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
peek_buffer method, and remove it from the pad with the pop_buffer
method. When a buffer has been taken with pop_buffer
, a new buffer can be queued on that pad.
* When peek_buffer or
has_buffer are called, a reference is taken to the returned buffer,
which stays valid until either:
- pop_buffer is called, in which case the caller is guaranteed that
the buffer they receive is the same as the peeked buffer. - drop_buffer
is called, in which case the caller is guaranteed that the dropped buffer is the one that was peeked. - the subclass implementation
of aggregate returns.
Subsequent calls to peek_buffer or
has_buffer 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
finish_buffer 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
finish_buffer_list.
* 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) AggregatorPad for both their sink and
source pads. See add_static_pad_template_with_gtype.
This class used to live in gst-plugins-bad and was moved to core.
- public virtual FlowReturn aggregate (bool timeout)
- public virtual Buffer clip (AggregatorPad aggregator_pad, Buffer buf)
- public virtual bool decide_allocation (Query query)
- public virtual FlowReturn finish_buffer (owned Buffer buffer)
This method will push the provided output buffer downstream.
- public virtual FlowReturn finish_buffer_list (owned BufferList bufferlist)
This method will push the provided output buffer list downstream.
- public virtual Caps fixate_src_caps (Caps caps)
- public virtual FlowReturn flush ()
- public void get_allocator (out Allocator? allocator, out unowned AllocationParams @params)
Lets Aggregator sub-classes get
the memory allocator
acquired by the base class and its params
.
- public BufferPool? get_buffer_pool ()
- public bool get_ignore_inactive_pads ()
- public ClockTime get_latency ()
Retrieves the latency values reported by
this 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.
- public virtual ClockTime get_next_time ()
- public virtual bool negotiate ()
Negotiates src pad caps with downstream elements.
- public virtual bool negotiated_src_caps (Caps caps)
- public virtual Sample? peek_next_sample (AggregatorPad aggregator_pad)
Use this function to determine what input buffers will be aggregated
to produce the next output buffer.
- public virtual bool propose_allocation (AggregatorPad pad, Query decide_query, Query query)
- public void selected_samples (ClockTime pts, ClockTime dts, ClockTime duration, Structure? info)
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 should be
performed, for example z-index for video aggregators.
- public void set_ignore_inactive_pads (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.
- public void set_latency (ClockTime min_latency, ClockTime max_latency)
Lets Aggregator sub-classes tell
the baseclass what their internal latency is.
- public void set_src_caps (Caps caps)
Sets the caps to be used on the src pad.
- public ClockTime simple_get_next_time ()
This is a simple GstAggregatorClass::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.
- public virtual bool sink_event (AggregatorPad aggregator_pad, Event event)
- public virtual FlowReturn sink_event_pre_queue (AggregatorPad aggregator_pad, Event event)
- public virtual bool sink_query (AggregatorPad aggregator_pad, Query query)
- public virtual bool sink_query_pre_queue (AggregatorPad aggregator_pad, Query query)
- public virtual bool src_activate (PadMode mode, bool active)
- public virtual bool src_event (Event event)
- public virtual bool src_query (Query query)
- public virtual bool start ()
- public virtual bool stop ()
- public void update_segment (Segment segment)
Subclasses should use this to update the segment on their source pad,
instead of directly pushing new segment events downstream.
- public virtual FlowReturn update_src_caps (Caps caps, out Caps ret)