#GstAudioDitherMethod, The dither method to use when changing bit depth. Default is #GST_AUDIO_DITHER_NONE.
Threshold for the output bit depth at/below which to apply dithering.
Default is 20 bit.
#GST_TYPE_LIST, The channel mapping matrix.
The matrix coefficients must be between -1 and 1: the number of rows is equal to the number of output channels and the number of columns is equal to the number of input channels.
To generate the matrix using code:
|[ GValue v = G_VALUE_INIT; GValue v2 = G_VALUE_INIT; GValue v3 = G_VALUE_INIT;
g_value_init (&v2, GST_TYPE_ARRAY); g_value_init (&v3, G_TYPE_DOUBLE); g_value_set_double (&v3, 1); gst_value_array_append_value (&v2, &v3); g_value_unset (&v3); [ Repeat for as many double as your input channels - unset and reinit v3 ] g_value_init (&v, GST_TYPE_ARRAY); gst_value_array_append_value (&v, &v2); g_value_unset (&v2); [ Repeat for as many v2's as your output channels - unset and reinit v2] g_object_set_property (G_OBJECT (audiomixmatrix), "matrix", &v); g_value_unset (&v);
#GstAudioNoiseShapingMethod, The noise shaping method to use to mask noise from quantization errors. Default is #GST_AUDIO_NOISE_SHAPING_NONE.
#G_TYPE_UINT, The quantization amount. Components will be quantized to multiples of this value. Default is 1
#GstAudioResamplerMethod, The resampler method to use when changing sample rates. Default is #GST_AUDIO_RESAMPLER_METHOD_BLACKMAN_NUTTALL.
Default maximum number of errors tolerated before signaling error.
The name of the templates for the sink pad.
The name of the templates for the source pad.
Standard number of channels used in consumer audio.
Standard format used in consumer audio.
Standard sampling rate used in consumer audio.
the name of the templates for the sink pad
the name of the templates for the source pad
List of all audio formats, for use in template caps strings.
Formats are sorted by decreasing "quality", using these criteria by priority:
Maximum range of allowed sample rates, for use in template caps strings.
G_TYPE_DOUBLE, B parameter of the cubic filter. Values between 0.0 and 2.0 are accepted. 1.0 is the default.
Below are some values of popular filters: B C Hermite 0.0 0.0 Spline 1.0 0.0 Catmull-Rom 0.0 1/2
G_TYPE_DOUBLE, C parameter of the cubic filter. Values between 0.0 and 2.0 are accepted. 0.0 is the default.
See #GST_AUDIO_RESAMPLER_OPT_CUBIC_B for some more common values
G_TYPE_DOUBLE, Cutoff parameter for the filter. 0.940 is the default.
GST_TYPE_AUDIO_RESAMPLER_INTERPOLATION: how the filter coefficients should be interpolated. GST_AUDIO_RESAMPLER_FILTER_INTERPOLATION_CUBIC is default.
GST_TYPE_AUDIO_RESAMPLER_FILTER_MODE: how the filter tables should be constructed. GST_AUDIO_RESAMPLER_FILTER_MODE_AUTO is the default.
G_TYPE_UINT: the amount of memory to use for full filter tables before switching to interpolated filter tables. 1048576 is the default.
G_TYPE_UINT, oversampling to use when interpolating filters 8 is the default.
G_TYPE_DOUBLE: The maximum allowed phase error when switching sample rates. 0.1 is the default.
G_TYPE_INT: the number of taps to use for the filter. 0 is the default and selects the taps automatically.
G_TYPE_DOUBLE, stopband attenuation in decibels. The attenuation after the stopband for the kaiser window. 85 dB is the default.
G_TYPE_DOUBLE, transition bandwidth. The width of the transition band for the kaiser window. 0.087 is the default.
This metadata stays relevant as long as channels are unchanged.
This metadata stays relevant as long as sample rate is unchanged.
This metadata is relevant for audio streams.
Clip the buffer to the given %GstSegment.
After calling this function the caller does not own a reference to
buffer
anymore.
The buffer to clip.
Segment in %GST_FORMAT_TIME or %GST_FORMAT_DEFAULT to which the buffer should be clipped.
sample rate.
size of one audio frame in bytes. This is the size of one sample * number of channels.
Maps an audio gstbuffer
so that it can be read or written and stores the
result of the map operation in buffer
.
This is especially useful when the gstbuffer
is in non-interleaved (planar)
layout, in which case this function will use the information in the
gstbuffer'
s attached #GstAudioMeta in order to map each channel in a
separate "plane" in #GstAudioBuffer. If a #GstAudioMeta is not attached
on the gstbuffer,
then it must be in interleaved layout.
If a #GstAudioMeta is attached, then the #GstAudioInfo on the meta is checked
against info
. Normally, they should be equal, but in case they are not,
a g_critical will be printed and the #GstAudioInfo from the meta will be
used.
In non-interleaved buffers, it is possible to have each channel on a separate #GstMemory. In this case, each memory will be mapped separately to avoid copying their contents in a larger memory area. Do note though that it is not supported to have a single channel spanning over two or more different #GstMemory objects. Although the map operation will likely succeed in this case, it will be highly sub-optimal and it is recommended to merge all the memories in the buffer before calling this function.
Note: The actual #GstBuffer is not ref'ed, but it is required to stay valid as long as it's mapped.
the audio properties of the buffer
the #GstBuffer to be mapped
the access mode for the memory
Reorders buffer
from the channel positions from
to the channel
positions to
. from
and to
must contain the same number of
positions and the same positions, only in a different order.
buffer
must be writable.
The buffer to reorder.
The %GstAudioFormat of the buffer.
The channel positions in the buffer.
The channel positions to convert to.
Truncate the buffer to finally have samples
number of samples, removing
the necessary amount of samples from the end and trim
number of samples
from the beginning.
This function does not know the audio rate, therefore the caller is responsible for re-setting the correct timestamp and duration to the buffer. However, timestamp will be preserved if trim == 0, and duration will also be preserved if there is no trimming to be done. Offset and offset end will be preserved / updated.
After calling this function the caller does not own a reference to
buffer
anymore.
The buffer to truncate.
size of one audio frame in bytes. This is the size of one sample * number of channels.
the number of samples to remove from the beginning of the buffer
the final number of samples that should exist in this buffer or -1 to use all the remaining samples if you are only removing samples from the beginning.
Get the fallback channel-mask for the given number of channels.
This function returns a reasonable fallback channel-mask and should be called as a last resort when the specific channel map is unknown.
the number of channels
Convert the channels
present in channel_mask
to a position
array
(which should have at least channels
entries ensured by caller).
If channel_mask
is set to 0, it is considered as 'not present' for purpose
of conversion.
A partially valid channel_mask
with less bits set than the number
of channels is considered valid.
The input channel_mask
The %GstAudioChannelPositions
Convert the position
array of channels
channels to a bitmask.
If force_order
is %TRUE it additionally checks if the channels are
in the order required by GStreamer.
The %GstAudioChannelPositions
Only consider the GStreamer channel order.
Converts position
to a human-readable string representation for
debugging purposes.
The %GstAudioChannelPositions to convert.
Reorders the channel positions in position
from any order to
the GStreamer channel order.
The channel positions to reorder to.
Checks if position
contains valid channel positions for
channels
channels. If force_order
is %TRUE it additionally
checks if the channels are in the order required by GStreamer.
The %GstAudioChannelPositions to check.
Only consider the GStreamer channel order.
Construct a #GstAudioFormat with given parameters.
signed or unsigned format
G_LITTLE_ENDIAN or G_BIG_ENDIAN
amount of bits used per sample
amount of used bits in width
Fill length
bytes in dest
with silence samples for info
.
a #GstAudioFormatInfo
a destination to fill
Convert the format
string to its #GstAudioFormat.
a format string
Get the #GstAudioFormatInfo for format
a #GstAudioFormat
Return all the raw audio formats supported by GStreamer.
Returns a reorder map for from
to to
that can be used in
custom channel reordering code, e.g. to convert from or to the
GStreamer channel order. from
and to
must contain the same
number of positions and the same positions, only in a
different order.
The resulting reorder_map
can be used for reordering by assigning
channel i of the input to channel reorder_map[i] of the output.
The channel positions to reorder from.
The channel positions to reorder to.
Pointer to the reorder map.
Calculated the size of the buffer expected by gst_audio_iec61937_payload() for
payloading type from spec
.
the ringbufer spec
Payloads src
in the form specified by IEC 61937 for the type from spec
and
stores the result in dst
. src
must contain exactly one frame of data and
the frame is not checked for errors.
a buffer containing the data to payload
the destination buffer to store the payloaded contents in. Should not overlap with src
the ringbufer spec for src
the expected byte order of the payloaded data
Initialize info
with default values.
Return the #GType associated with #GstAudioLevelMeta.
Return a generic raw audio caps for formats defined in formats
.
If formats
is %NULL returns a caps for all the supported raw audio formats,
see gst_audio_formats_raw().
an array of raw #GstAudioFormat, or %NULL
the layout of audio samples
Reorders data
from the channel positions from
to the channel
positions to
. from
and to
must contain the same number of
positions and the same positions, only in a different order.
Note: this function assumes the audio data is in interleaved layout
The pointer to the memory.
The %GstAudioFormat of the buffer.
The channel positions in the buffer.
The channel positions to convert to.
Make a new resampler.
a #GstAudioResamplerMethod
#GstAudioResamplerFlags
the #GstAudioFormat
the number of channels
input rate
output rate
extra options
Set the parameters for resampling from in_rate
to out_rate
using method
for quality
in options
.
a #GstAudioResamplerMethod
the quality
the input rate
the output rate
a #GstStructure
Attaches #GstAudioClippingMeta metadata to buffer
with the given parameters.
a #GstBuffer
GstFormat of start
and stop,
GST_FORMAT_DEFAULT is samples
Amount of audio to clip from start of buffer
Amount of to clip from end of buffer
Attaches #GstAudioDownmixMeta metadata to buffer
with the given parameters.
matrix
is an two-dimensional array of to_channels
times from_channels
coefficients, i.e. the i-th output channels is constructed by multiplicating
the input channels with the coefficients in matrix[
i] and taking the sum
of the results.
a #GstBuffer
the channel positions of the source
the channel positions of the destination
The matrix coefficients.
Attaches audio level information to buffer
. (RFC 6464)
a #GstBuffer
the -dBov from 0-127 (127 is silence).
whether the buffer contains voice activity.
Allocates and attaches a #GstAudioMeta on buffer,
which must be writable
for that purpose. The fields of the #GstAudioMeta are directly populated
from the arguments of this function.
When info->
layout is %GST_AUDIO_LAYOUT_NON_INTERLEAVED and offsets
is
%NULL, the offsets are calculated with a formula that assumes the planes are
tightly packed and in sequence:
offsets[channel] = channel * samples
* sample_stride
It is not allowed for channels to overlap in memory,
i.e. for each i in [0, channels), the range
[offsets[
i], offsets[
i] + samples
* sample_stride) must not overlap
with any other such range. This function will assert if the parameters
specified cause this restriction to be violated.
It is, obviously, also not allowed to specify parameters that would cause
out-of-bounds memory access on buffer
. This is also checked, which means
that you must add enough memory on the buffer
before adding this meta.
a #GstBuffer
the audio properties of the buffer
the number of valid samples in the buffer
the offsets (in bytes) where each channel plane starts in the buffer or %NULL to calculate it (see below); must be %NULL also when info->
layout is %GST_AUDIO_LAYOUT_INTERLEAVED
Find the #GstAudioDownmixMeta on buffer
for the given destination
channel positions.
a #GstBuffer
the channel positions of the destination
Find the #GstAudioLevelMeta on buffer
.
Maximum range of allowed channels, for use in template caps strings.