FFmpeg
|
#include "libavutil/samplefmt.h"
#include "avresample.h"
#include "internal.h"
#include "audio_data.h"
Go to the source code of this file.
Functions | |
void | ff_audio_convert_set_func (AudioConvert *ac, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int ptr_align, int samples_align, const char *descr, void *conv) |
Set conversion function if the parameters match. More... | |
AudioConvert * | ff_audio_convert_alloc (AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels, int sample_rate, int apply_map) |
Allocate and initialize AudioConvert context for sample format conversion. More... | |
void | ff_audio_convert_free (AudioConvert **ac) |
Free AudioConvert. More... | |
int | ff_audio_convert (AudioConvert *ac, AudioData *out, AudioData *in) |
Convert audio data from one sample format to another. More... | |
void | ff_audio_convert_init_arm (AudioConvert *ac) |
void | ff_audio_convert_init_x86 (AudioConvert *ac) |
Function Documentation
int ff_audio_convert | ( | AudioConvert * | ac, |
AudioData * | out, | ||
AudioData * | in | ||
) |
Convert audio data from one sample format to another.
For each call, the alignment of the input and output AudioData buffers are examined to determine whether to use the generic or optimized conversion function (when available).
The number of samples to convert is determined by in->nb_samples. The output buffer must be large enough to handle this many samples. out->nb_samples is set by this function before a successful return.
- Parameters
-
ac AudioConvert context out output audio data in input audio data
- Returns
- 0 on success, negative AVERROR code on failure
Referenced by avresample_convert(), and ff_convert_dither().
AudioConvert* ff_audio_convert_alloc | ( | AVAudioResampleContext * | avr, |
enum AVSampleFormat | out_fmt, | ||
enum AVSampleFormat | in_fmt, | ||
int | channels, | ||
int | sample_rate, | ||
int | apply_map | ||
) |
Allocate and initialize AudioConvert context for sample format conversion.
- Parameters
-
avr AVAudioResampleContext out_fmt output sample format in_fmt input sample format channels number of channels sample_rate sample rate (used for dithering) apply_map apply channel map during conversion
- Returns
- newly-allocated AudioConvert context
Referenced by avresample_open(), and ff_dither_alloc().
void ff_audio_convert_free | ( | AudioConvert ** | ac | ) |
Free AudioConvert.
The AudioConvert must have been previously allocated with ff_audio_convert_alloc().
- Parameters
-
ac AudioConvert struct
Referenced by avresample_close(), and ff_dither_free().
void ff_audio_convert_init_arm | ( | AudioConvert * | ac | ) |
Definition at line 34 of file libavresample/arm/audio_convert_init.c.
void ff_audio_convert_init_x86 | ( | AudioConvert * | ac | ) |
Definition at line 146 of file libavresample/x86/audio_convert_init.c.
void ff_audio_convert_set_func | ( | AudioConvert * | ac, |
enum AVSampleFormat | out_fmt, | ||
enum AVSampleFormat | in_fmt, | ||
int | channels, | ||
int | ptr_align, | ||
int | samples_align, | ||
const char * | descr, | ||
void * | conv | ||
) |
Set conversion function if the parameters match.
This compares the parameters of the conversion function to the parameters in the AudioConvert context. If the parameters do not match, no changes are made to the active functions. If the parameters do match and the alignment is not constrained, the function is set as the generic conversion function. If the parameters match and the alignment is constrained, the function is set as the optimized conversion function.
- Parameters
-
ac AudioConvert context out_fmt output sample format in_fmt input sample format channels number of channels, or 0 for any number of channels ptr_align buffer pointer alignment, in bytes samples_align buffer size alignment, in samples descr function type description (e.g. "C" or "SSE") conv conversion function pointer
Definition at line 70 of file audio_convert.c.
Referenced by ff_audio_convert_init_arm(), and ff_audio_convert_init_x86().
Generated on Mon Nov 18 2024 06:52:04 for FFmpeg by 1.8.11