Create a new #GstAudioConverter that is able to convert between in
and out
audio formats.
config
contains extra configuration options, see GST_AUDIO_CONVERTER_OPT_*
parameters for details about the options and values.
extra #GstAudioConverterFlags
a source #GstAudioInfo
a destination #GstAudioInfo
a #GstStructure with configuration options
Convenience wrapper around gst_audio_converter_samples(), which will perform allocation of the output buffer based on the result from gst_audio_converter_get_out_frames().
extra #GstAudioConverterFlags
input data
Free a previously allocated convert
instance.
Calculate how many input frames are currently needed by convert
to produce
out_frames
of output frames.
number of output frames
Get the maximum number of input frames that the converter would need before producing output.
Calculate how many output frames can be produced when in_frames
input
frames are given to convert
.
number of input frames
Returns whether the audio converter will operate in passthrough mode. The return value would be typically input to gst_base_transform_set_passthrough()
Reset convert
to the state it was when it was first created, clearing
any history it might currently have.
Perform the conversion with in_frames
in in
to out_frames
in out
using convert
.
In case the samples are interleaved, in
and out
must point to an
array with a single element pointing to a block of interleaved samples.
If non-interleaved samples are used, in
and out
must point to an
array with pointers to memory blocks, one for each channel.
in
may be %NULL, in which case in_frames
of silence samples are processed
by the converter.
This function always produces out_frames
of output and consumes in_frames
of
input. Use gst_audio_converter_get_out_frames() and
gst_audio_converter_get_in_frames() to make sure in_frames
and out_frames
are matching and in
and out
point to enough memory.
extra #GstAudioConverterFlags
input frames
number of input frames
output frames
number of output frames
Returns whether the audio converter can perform the conversion in-place. The return value would be typically input to gst_base_transform_set_in_place()
Set in_rate,
out_rate
and config
as extra configuration for convert
.
in_rate
and out_rate
specify the new sample rates of input and output
formats. A value of 0 leaves the sample rate unchanged.
config
can be %NULL, in which case, the current configuration is not
changed.
If the parameters in config
can not be set exactly, this function returns
%FALSE and will try to update as much state as possible. The new state can
then be retrieved and refined with gst_audio_converter_get_config().
Look at the GST_AUDIO_CONVERTER_OPT_*
fields to check valid configuration
option and values.
input rate
output rate
a #GstStructure or %NULL
Create a new #GstAudioConverter that is able to convert between in
and out
audio formats.
config
contains extra configuration options, see GST_AUDIO_CONVERTER_OPT_*
parameters for details about the options and values.
extra #GstAudioConverterFlags
a source #GstAudioInfo
a destination #GstAudioInfo
a #GstStructure with configuration options
This object is used to convert audio samples from one format to another. The object can perform conversion of:
audio format with optional dithering and noise shaping
audio samplerate
audio channels and channel layout