audioconvert.h File Reference

Audio format conversion routines. More...

#include "libavutil/cpu.h"
#include "avcodec.h"
#include "libavutil/audioconvert.h"

Go to the source code of this file.

Typedefs

typedef struct AVAudioConvert AVAudioConvert
 

Functions

uint64_t avcodec_guess_channel_layout (int nb_channels, enum CodecID codec_id, const char *fmt_name)
 Guess the channel layout. More...
 
AVAudioConvertav_audio_convert_alloc (enum AVSampleFormat out_fmt, int out_channels, enum AVSampleFormat in_fmt, int in_channels, const float *matrix, int flags)
 Create an audio sample format converter context. More...
 
void av_audio_convert_free (AVAudioConvert *ctx)
 Free audio sample format converter context. More...
 
int av_audio_convert (AVAudioConvert *ctx, void *const out[6], const int out_stride[6], const void *const in[6], const int in_stride[6], int len)
 Convert between audio sample formats. More...
 

Detailed Description

Audio format conversion routines.

Definition in file audioconvert.h.

Typedef Documentation

Definition at line 86 of file audioconvert.h.

Function Documentation

int av_audio_convert ( AVAudioConvert ctx,
void *const  out[6],
const int  out_stride[6],
const void *const  in[6],
const int  in_stride[6],
int  len 
)

Convert between audio sample formats.

Parameters
[in]outarray of output buffers for each channel. set to NULL to ignore processing of the given channel.
[in]out_stridedistance between consecutive output samples (measured in bytes)
[in]inarray of input buffers for each channel
[in]in_stridedistance between consecutive input samples (measured in bytes)
lenlength of audio frame size (measured in samples)

Definition at line 108 of file audioconvert.c.

Referenced by audio_decode_frame(), audio_resample(), and do_audio_out().

AVAudioConvert* av_audio_convert_alloc ( enum AVSampleFormat  out_fmt,
int  out_channels,
enum AVSampleFormat  in_fmt,
int  in_channels,
const float *  matrix,
int  flags 
)

Create an audio sample format converter context.

Parameters
out_fmtOutput sample format
out_channelsNumber of output channels
in_fmtInput sample format
in_channelsNumber of input channels
[in]matrixChannel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore.
flagsSee AV_CPU_FLAG_xx
Returns
NULL on error

Definition at line 87 of file audioconvert.c.

Referenced by audio_decode_frame(), av_audio_resample_init(), and do_audio_out().

void av_audio_convert_free ( AVAudioConvert ctx)

Free audio sample format converter context.

Definition at line 103 of file audioconvert.c.

Referenced by audio_decode_frame(), audio_resample_close(), av_audio_resample_init(), do_audio_out(), stream_component_close(), and transcode().

uint64_t avcodec_guess_channel_layout ( int  nb_channels,
enum CodecID  codec_id,
const char *  fmt_name 
)

Guess the channel layout.

Parameters
nb_channels
codec_idCodec identifier, or CODEC_ID_NONE if unknown
fmt_nameFormat name, or NULL if unknown
Returns
Channel layout mask

Definition at line 51 of file audioconvert.c.

Referenced by set_channel_info().