GstAudio.AudioAggregator¶
- Subclasses:
None
Methods¶
- Inherited:
GstBase.Aggregator (16), Gst.Element (82), Gst.Object (27), GObject.Object (37)
- Structs:
|
Virtual Methods¶
|
|
|
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Timestamp alignment threshold in nanoseconds |
||
r/w |
Window of time in nanoseconds to wait before creating a discontinuity |
||
r/w/co |
Always operate in live mode and aggregate on timeout regardless of whether any live sources are linked upstream |
||
r/w |
Avoid timing out waiting for inactive pads |
||
r/w |
Output block size in nanoseconds |
||
r/w |
Output block size in nanoseconds, expressed as a fraction |
Signals¶
Fields¶
Name |
Type |
Access |
Description |
---|---|---|---|
current_caps |
r |
The caps set by the subclass |
|
parent |
r |
Class Details¶
- class GstAudio.AudioAggregator(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
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, theGObject.GType
of the sink pads must either be a (subclass of)GstAudio.AudioAggregatorConvertPad
to use the defaultGstAudio.AudioConverter
implementation, or a subclass ofGstAudio.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 infoGst.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:
pad (
GstAudio.AudioAggregatorPad
) –caps (
Gst.Caps
) –
- do_aggregate_one_buffer(pad, inbuf, in_offset, outbuf, out_offset, num_frames) virtual¶
- Parameters:
pad (
GstAudio.AudioAggregatorPad
) –inbuf (
Gst.Buffer
) –in_offset (
int
) –outbuf (
Gst.Buffer
) –out_offset (
int
) –num_frames (
int
) –
- Return type:
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
Property Details¶
- GstAudio.AudioAggregator.props.alignment_threshold¶
-
Timestamp alignment threshold in nanoseconds
- GstAudio.AudioAggregator.props.discont_wait¶
-
Window of time in nanoseconds to wait before creating a discontinuity
- GstAudio.AudioAggregator.props.force_live¶
- Name:
force-live
- Type:
- Default Value:
- Flags:
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¶
-
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¶
-
Output block size in nanoseconds
- GstAudio.AudioAggregator.props.output_buffer_duration_fraction¶
- Name:
output-buffer-duration-fraction
- Type:
- Default Value:
- Flags:
Output block size in nanoseconds, expressed as a fraction.
New in version 1.18.