libavcodec/audioconvert.h File Reference

Audio format conversion routines. More...

#include "avcodec.h"

Go to the source code of this file.

Typedefs

typedef struct AVAudioConvert AVAudioConvert

Functions

void avcodec_sample_fmt_string (char *buf, int buf_size, int sample_fmt)
 Generate string corresponding to the sample format with number sample_fmt, or a header if sample_fmt is negative.
const char * avcodec_get_sample_fmt_name (int sample_fmt)
enum SampleFormat avcodec_get_sample_fmt (const char *name)
const char * avcodec_get_channel_name (int channel_id)
void avcodec_get_channel_layout_string (char *buf, int buf_size, int nb_channels, int64_t channel_layout)
 Return description of channel layout.
int64_t avcodec_guess_channel_layout (int nb_channels, enum CodecID codec_id, const char *fmt_name)
 Guess the channel layout.
AVAudioConvertav_audio_convert_alloc (enum SampleFormat out_fmt, int out_channels, enum SampleFormat in_fmt, int in_channels, const float *matrix, int flags)
 Create an audio sample format converter context.
void av_audio_convert_free (AVAudioConvert *ctx)
 Free audio sample format converter context.
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.


Detailed Description

Audio format conversion routines.

Definition in file audioconvert.h.


Typedef Documentation

Definition at line 78 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] out array of output buffers for each channel. set to NULL to ignore processing of the given channel.
[in] out_stride distance between consecutive input samples (measured in bytes)
[in] in array of input buffers for each channel
[in] in_stride distance between consecutive output samples (measured in bytes)
len length of audio frame size (measured in samples)

Definition at line 179 of file audioconvert.c.

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

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

Create an audio sample format converter context.

Parameters:
out_fmt Output sample format
out_channels Number of output channels
in_fmt Input sample format
in_channels Number of input channels
[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore.
flags See FF_MM_xx
Returns:
NULL on error

Definition at line 158 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 174 of file audioconvert.c.

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

void avcodec_get_channel_layout_string ( char *  buf,
int  buf_size,
int  nb_channels,
int64_t  channel_layout 
)

Return description of channel layout.

Definition at line 121 of file audioconvert.c.

Referenced by avcodec_string().

const char* avcodec_get_channel_name ( int  channel_id  ) 

Returns:
NULL on error

enum SampleFormat avcodec_get_sample_fmt ( const char *  name  ) 

Returns:
SAMPLE_FMT_NONE on error

Definition at line 53 of file audioconvert.c.

Referenced by opt_audio_sample_fmt().

const char* avcodec_get_sample_fmt_name ( int  sample_fmt  ) 

Returns:
NULL on error

Definition at line 46 of file audioconvert.c.

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

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

Guess the channel layout.

Parameters:
nb_channels 
codec_id Codec identifier, or CODEC_ID_NONE if unknown
fmt_name Format name, or NULL if unknown
Returns:
Channel layout mask

Definition at line 89 of file audioconvert.c.

Referenced by avcodec_get_channel_layout_string().

void avcodec_sample_fmt_string ( char *  buf,
int  buf_size,
int  sample_fmt 
)

Generate string corresponding to the sample format with number sample_fmt, or a header if sample_fmt is negative.

Parameters:
[in] buf the buffer where to write the string
[in] buf_size the size of buf
[in] sample_fmt the number of the sample format to print the corresponding info string, or a negative value to print the corresponding header. Meaningful values for obtaining a sample format info vary from 0 to SAMPLE_FMT_NB -1.

Definition at line 63 of file audioconvert.c.

Referenced by opt_audio_sample_fmt().


Generated on Fri Oct 26 02:35:42 2012 for FFmpeg by  doxygen 1.5.8