GstAudio.AudioAggregator¶
- Subclasses:
None
Methods¶
- Inherited:
GstBase.Aggregator (17), 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.AudioAggregatorPadfor both their source and sink pads,Gst.ElementClass.add_static_pad_template_with_gtype() is a convenient helper.GstAudio.AudioAggregatorcan perform conversion on the data arriving on its sink pads, based on the format expected downstream: in order to enable that behaviour, theGObject.GTypeof the sink pads must either be a (subclass of)GstAudio.AudioAggregatorConvertPadto use the defaultGstAudio.AudioConverterimplementation, or a subclass ofGstAudio.AudioAggregatorPadimplementing GstAudio.AudioAggregatorPadClass.convert_buffer.To allow for the output caps to change, the mechanism is the same as above, with the
GObject.GTypeof the source pad.See #GstAudioMixer for an example.
When conversion is enabled,
GstAudio.AudioAggregatorwill 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-selectedsignal is provided with some additional information about the output buffer:“offset”
GObject.TYPE_UINT64Offset in samples since segment start for the position that is next to be filled in the output buffer.“frames”
GObject.TYPE_UINTNumber of frames per output buffer.
In addition the
GstBase.Aggregator.peek_next_sample() function returns additional information in the infoGst.Structureof the returned sample:“output-offset”
GObject.TYPE_UINT64Sample 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_UINTcurrent position in the input buffer in samples“size”
GObject.TYPE_UINTsize 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
Trueif 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-latencyfor 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.