| GStreamer Base Plugins 1.0 Library Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
#include <gst/audio/audio.h>
GstAudioConverter;
enum GstAudioConverterFlags;
GstAudioConverter * gst_audio_converter_new (GstAudioConverterFlags flags,
GstAudioInfo *in_info,
GstAudioInfo *out_info,
GstStructure *config);
void gst_audio_converter_free (GstAudioConverter *convert);
gboolean gst_audio_converter_samples (GstAudioConverter *convert,
GstAudioConverterFlags flags,
gpointer in[],
gsize in_frames,
gpointer out[],
gsize out_frames);
gsize gst_audio_converter_get_in_frames (GstAudioConverter *convert,
gsize out_frames);
gsize gst_audio_converter_get_max_latency (GstAudioConverter *convert);
gsize gst_audio_converter_get_out_frames (GstAudioConverter *convert,
gsize in_frames);
#define GST_AUDIO_CONVERTER_OPT_DITHER_METHOD
#define GST_AUDIO_CONVERTER_OPT_NOISE_SHAPING_METHOD
#define GST_AUDIO_CONVERTER_OPT_QUANTIZATION
const GstStructure * gst_audio_converter_get_config (GstAudioConverter *convert,
gint *in_rate,
gint *out_rate);
typedef enum {
GST_AUDIO_CONVERTER_FLAG_NONE = 0,
GST_AUDIO_CONVERTER_FLAG_IN_WRITABLE = (1 << 0),
GST_AUDIO_CONVERTER_FLAG_VARIABLE_RATE = (1 << 1)
} GstAudioConverterFlags;
Extra flags passed to gst_audio_converter_new() and gst_audio_converter_samples().
GstAudioConverter * gst_audio_converter_new (GstAudioConverterFlags flags,GstAudioInfo *in_info,GstAudioInfo *out_info,GstStructure *config);
Create a new GstAudioConverter that is able to convert between in and out
audio formats.
config contains extra configuration options, see GST_VIDEO_CONVERTER_OPT_*
parameters for details about the options and values.
|
extra GstAudioConverterFlags |
|
a source GstAudioInfo |
|
a destination GstAudioInfo |
|
a GstStructure with configuration options. [transfer full] |
Returns : |
a GstAudioConverter or NULL if conversion is not possible. |
void gst_audio_converter_free (GstAudioConverter *convert);
Free a previously allocated convert instance.
|
a GstAudioConverter |
gboolean gst_audio_converter_samples (GstAudioConverter *convert,GstAudioConverterFlags flags,gpointer in[],gsize in_frames,gpointer out[],gsize out_frames);
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.
|
a GstAudioConverter |
|
extra GstAudioConverterFlags |
|
input frames |
|
number of input frames |
|
output frames |
|
number of output frames |
Returns : |
TRUE is the conversion could be performed. |
gsize gst_audio_converter_get_in_frames (GstAudioConverter *convert,gsize out_frames);
Calculate how many input frames are currently needed by convert to produce
out_frames of output frames.
|
a GstAudioConverter |
|
number of output frames |
Returns : |
the number of input frames |
gsize gst_audio_converter_get_max_latency (GstAudioConverter *convert);
Get the maximum number of input frames that the converter would need before producing output.
|
a GstAudioConverter |
Returns : |
the latency of convert as expressed in the number of
frames. |
gsize gst_audio_converter_get_out_frames (GstAudioConverter *convert,gsize in_frames);
Calculate how many output frames can be produced when in_frames input
frames are given to convert.
|
a GstAudioConverter |
|
number of input frames |
Returns : |
the number of output frames |
#define GST_AUDIO_CONVERTER_OPT_DITHER_METHOD "GstAudioConverter.dither-method"
GST_TYPE_AUDIO_DITHER_METHOD, The dither method to use when changing bit depth. Default is GST_AUDIO_DITHER_NONE.
#define GST_AUDIO_CONVERTER_OPT_NOISE_SHAPING_METHOD "GstAudioConverter.noise-shaping-method"
GST_TYPE_AUDIO_NOISE_SHAPING_METHOD, The noise shaping method to use to mask noise from quantization errors. Default is GST_AUDIO_NOISE_SHAPING_NONE.
#define GST_AUDIO_CONVERTER_OPT_QUANTIZATION "GstAudioConverter.quantization"
G_TYPE_UINT, The quantization amount. Components will be quantized to multiples of this value. Default is 1
const GstStructure * gst_audio_converter_get_config (GstAudioConverter *convert,gint *in_rate,gint *out_rate);
Get the current configuration of convert.
|
a GstAudioConverter |
|
result input rate |
|
result output rate |
Returns : |
a GstStructure that remains valid for as long as convert is valid
or until gst_audio_converter_update_config() is called. |