Class AudioAggregator

java.lang.Object
All Implemented Interfaces:
Proxy
Direct Known Subclasses:
AudioAggregator.AudioAggregatorImpl

@Generated("io.github.jwharm.JavaGI") public abstract class AudioAggregator extends Aggregator
Subclasses must use (a subclass of) GstAudioAggregatorPad for both their source and sink pads, gst_element_class_add_static_pad_template_with_gtype() is a convenient helper.

GstAudioAggregator can perform conversion on the data arriving on its sink pads, based on the format expected downstream: in order to enable that behaviour, the GType of the sink pads must either be a (subclass of) GstAudioAggregatorConvertPad to use the default GstAudioConverter implementation, or a subclass of GstAudioAggregatorPad implementing GstAudioAggregatorPadClass.convert_buffer.

To allow for the output caps to change, the mechanism is the same as above, with the GType of the source pad.

See GstAudioMixer for an example.

When conversion is enabled, GstAudioAggregator will accept any type of raw audio caps and perform conversion on the data arriving on its sink pads, with whatever downstream expects as the target format.

In case downstream caps are not fully fixated, it will use the first configured sink pad to finish fixating its source pad caps.

A notable exception for now is the sample rate, sink pads must have the same sample rate as either the downstream requirement, or the first configured pad, or a combination of both (when downstream specifies a range or a set of acceptable rates).

The GstAggregator::samples-selected signal is provided with some additional information about the output buffer:

  • "offset" G_TYPE_UINT64 Offset in samples since segment start for the position that is next to be filled in the output buffer.
  • "frames" G_TYPE_UINT Number of frames per output buffer.

In addition the gst_aggregator_peek_next_sample() function returns additional information in the info GstStructure of the returned sample:

  • "output-offset" G_TYPE_UINT64 Sample offset in output segment relative to the output segment's start where the current position of this input buffer would be placed
  • "position" G_TYPE_UINT current position in the input buffer in samples
  • "size" G_TYPE_UINT size of the input buffer in samples