libavresample/audio_convert.h File Reference

#include "libavutil/samplefmt.h"
#include "avresample.h"
#include "audio_data.h"

Go to the source code of this file.

Typedefs

typedef struct AudioConvert AudioConvert

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.
AudioConvertff_audio_convert_alloc (AVAudioResampleContext *avr, enum AVSampleFormat out_fmt, enum AVSampleFormat in_fmt, int channels)
 Allocate and initialize AudioConvert context for sample format conversion.
int ff_audio_convert (AudioConvert *ac, AudioData *out, AudioData *in, int len)
 Convert audio data from one sample format to another.
void ff_audio_convert_init_arm (AudioConvert *ac)
void ff_audio_convert_init_x86 (AudioConvert *ac)


Typedef Documentation

typedef struct AudioConvert AudioConvert

Definition at line 28 of file audio_convert.h.


Function Documentation

int ff_audio_convert ( AudioConvert ac,
AudioData out,
AudioData in,
int  len 
)

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).

Parameters:
ac AudioConvert context
out output audio data
in input audio data
len number of samples to convert
Returns:
0 on success, negative AVERROR code on failure

Referenced by avresample_convert().

AudioConvert* ff_audio_convert_alloc ( AVAudioResampleContext avr,
enum AVSampleFormat  out_fmt,
enum AVSampleFormat  in_fmt,
int  channels 
)

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
Returns:
newly-allocated AudioConvert context

Referenced by avresample_open().

void ff_audio_convert_init_arm ( AudioConvert ac  ) 

Definition at line 34 of file audio_convert_init.c.

void ff_audio_convert_init_x86 ( AudioConvert ac  ) 

Definition at line 146 of file 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 67 of file audio_convert.c.

Referenced by ff_audio_convert_init_arm(), and ff_audio_convert_init_x86().


Generated on Fri Oct 26 02:50:11 2012 for FFmpeg by  doxygen 1.5.8