GstAudio.AudioAggregator

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gst.Element Gst.Element GstBase.Aggregator GstBase.Aggregator Gst.Element->GstBase.Aggregator Gst.Object->Gst.Element GstAudio.AudioAggregator GstAudio.AudioAggregator GstBase.Aggregator->GstAudio.AudioAggregator

Subclasses:

None

Methods

Inherited:

GstBase.Aggregator (16), Gst.Element (82), Gst.Object (27), GObject.Object (37)

Structs:

Gst.ElementClass (10), GObject.ObjectClass (5)

set_sink_caps (pad, caps)

Virtual Methods

Inherited:

GstBase.Aggregator (22), Gst.Element (16), Gst.Object (1), GObject.Object (7)

do_aggregate_one_buffer (pad, inbuf, in_offset, outbuf, out_offset, num_frames)

do_create_output_buffer (num_frames)

Properties

Inherited:

GstBase.Aggregator (5), Gst.Object (2)

Name

Type

Flags

Short Description

alignment-threshold

int

r/w

Timestamp alignment threshold in nanoseconds

discont-wait

int

r/w

Window of time in nanoseconds to wait before creating a discontinuity

force-live

bool

r/w/co

Always operate in live mode and aggregate on timeout regardless of whether any live sources are linked upstream

ignore-inactive-pads

bool

r/w

Avoid timing out waiting for inactive pads

output-buffer-duration

int

r/w

Output block size in nanoseconds

output-buffer-duration-fraction

Gst.Fraction

r/w

Output block size in nanoseconds, expressed as a fraction

Signals

Inherited:

GstBase.Aggregator (1), Gst.Element (3), Gst.Object (1), GObject.Object (1)

Fields

Inherited:

GstBase.Aggregator (1), Gst.Element (3), Gst.Object (1), GObject.Object (1)

Name

Type

Access

Description

current_caps

Gst.Caps

r

The caps set by the subclass

parent

GstBase.Aggregator

r

Class Details

class GstAudio.AudioAggregator(**kwargs)
Bases:

GstBase.Aggregator

Abstract:

Yes

Structure:

GstAudio.AudioAggregatorClass

Subclasses must use (a subclass of) GstAudio.AudioAggregatorPad for both their source and sink pads, Gst.ElementClass.add_static_pad_template_with_gtype() is a convenient helper.

GstAudio.AudioAggregator can perform conversion on the data arriving on its sink pads, based on the format expected downstream: in order to enable that behaviour, the GObject.GType of the sink pads must either be a (subclass of) GstAudio.AudioAggregatorConvertPad to use the default GstAudio.AudioConverter implementation, or a subclass of GstAudio.AudioAggregatorPad implementing GstAudio.AudioAggregatorPadClass.convert_buffer.

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

See #GstAudioMixer for an example.

When conversion is enabled, GstAudio.AudioAggregator 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 GstBase.Aggregator ::samples-selected signal is provided with some additional information about the output buffer:

  • “offset” GObject.TYPE_UINT64 Offset in samples since segment start for the position that is next to be filled in the output buffer.

  • “frames” GObject.TYPE_UINT Number of frames per output buffer.

In addition the GstBase.Aggregator.peek_next_sample() function returns additional information in the info Gst.Structure of the returned sample:

  • “output-offset” GObject.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” GObject.TYPE_UINT current position in the input buffer in samples

  • “size” GObject.TYPE_UINT size of the input buffer in samples

New in version 1.14.

set_sink_caps(pad, caps)[source]
Parameters:
do_aggregate_one_buffer(pad, inbuf, in_offset, outbuf, out_offset, num_frames) virtual
Parameters:
Return type:

bool

Aggregates one input buffer to the output buffer. The in_offset and out_offset are in “frames”, which is the size of a sample times the number of channels. Returns True if any non-silence was added to the buffer

do_create_output_buffer(num_frames) virtual
Parameters:

num_frames (int) –

Return type:

Gst.Buffer

Create a new output buffer contains num_frames frames.

Property Details

GstAudio.AudioAggregator.props.alignment_threshold
Name:

alignment-threshold

Type:

int

Default Value:

40000000

Flags:

READABLE, WRITABLE

Timestamp alignment threshold in nanoseconds

GstAudio.AudioAggregator.props.discont_wait
Name:

discont-wait

Type:

int

Default Value:

1000000000

Flags:

READABLE, WRITABLE

Window of time in nanoseconds to wait before creating a discontinuity

GstAudio.AudioAggregator.props.force_live
Name:

force-live

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Causes the element to aggregate on a timeout even when no live source is connected to its sinks. See GstBase.Aggregator :min-upstream-latency for a companion property: in the vast majority of cases where you plan to plug in live sources with a non-zero latency, you should set it to a non-zero value.

New in version 1.22.

GstAudio.AudioAggregator.props.ignore_inactive_pads
Name:

ignore-inactive-pads

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Don’t wait for inactive pads when live. An inactive pad is a pad that hasn’t yet received a buffer, but that has been waited on at least once.

The purpose of this property is to avoid aggregating on timeout when new pads are requested in advance of receiving data flow, for example the user may decide to connect it later, but wants to configure it already.

New in version 1.20.

GstAudio.AudioAggregator.props.output_buffer_duration
Name:

output-buffer-duration

Type:

int

Default Value:

10000000

Flags:

READABLE, WRITABLE

Output block size in nanoseconds

GstAudio.AudioAggregator.props.output_buffer_duration_fraction
Name:

output-buffer-duration-fraction

Type:

Gst.Fraction

Default Value:

None

Flags:

READABLE, WRITABLE

Output block size in nanoseconds, expressed as a fraction.

New in version 1.18.