libavcodec/audioconvert.c File Reference

audio conversion More...

#include "libavutil/avstring.h"
#include "libavutil/libm.h"
#include "libavutil/samplefmt.h"
#include "avcodec.h"
#include "audioconvert.h"

Go to the source code of this file.

Data Structures

struct  AVAudioConvert

Defines

#define CONV(ofmt, otype, ifmt, expr)

Functions

const char * avcodec_get_sample_fmt_name (int sample_fmt)
enum AVSampleFormat avcodec_get_sample_fmt (const char *name)
void avcodec_sample_fmt_string (char *buf, int buf_size, int sample_fmt)
uint64_t avcodec_guess_channel_layout (int nb_channels, enum CodecID codec_id, const char *fmt_name)
 Guess the channel layout.
int64_t avcodec_get_channel_layout (const char *name)
void avcodec_get_channel_layout_string (char *buf, int buf_size, int nb_channels, int64_t channel_layout)
int avcodec_channel_layout_num_channels (int64_t channel_layout)
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.
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 conversion

Author:
Michael Niedermayer <michaelni@gmx.at>

Definition in file audioconvert.c.


Define Documentation

#define CONV ( ofmt,
otype,
ifmt,
expr   ) 

Value:

if(ctx->fmt_pair == ofmt + AV_SAMPLE_FMT_NB*ifmt){\
    do{\
        *(otype*)po = expr; pi += is; po += os;\
    }while(po < end);\
}

Referenced by av_audio_convert().


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 output samples (measured in bytes)
[in] in array of input buffers for each channel
[in] in_stride distance between consecutive input samples (measured in bytes)
len length of audio frame size (measured in samples)

Definition at line 108 of file audioconvert.c.

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

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_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 AV_CPU_FLAG_xx
Returns:
NULL on error

Definition at line 87 of file audioconvert.c.

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

void av_audio_convert_free ( AVAudioConvert ctx  ) 

Free audio sample format converter context.

Definition at line 103 of file audioconvert.c.

Referenced by audio_resample_close(), av_audio_resample_init(), do_audio_out(), transcode(), and uninit().

int avcodec_channel_layout_num_channels ( int64_t  channel_layout  ) 

Deprecated:
Use av_get_channel_layout_nb_channels() instead.

Definition at line 76 of file audioconvert.c.

int64_t avcodec_get_channel_layout ( const char *  name  ) 

Deprecated:
Use av_get_channel_layout() instead.

Definition at line 66 of file audioconvert.c.

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

Deprecated:
Use av_get_channel_layout_string() instead.

Definition at line 71 of file audioconvert.c.

enum AVSampleFormat avcodec_get_sample_fmt ( const char *  name  ) 

Deprecated:
Use av_get_sample_fmt() instead.

Definition at line 40 of file audioconvert.c.

const char* avcodec_get_sample_fmt_name ( int  sample_fmt  ) 

Deprecated:
Use av_get_sample_fmt_name() instead.

Definition at line 35 of file audioconvert.c.

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_id Codec identifier, or CODEC_ID_NONE if unknown
fmt_name Format name, or NULL if unknown
Returns:
Channel layout mask

Definition at line 51 of file audioconvert.c.

Referenced by set_channel_info().

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

Deprecated:
Use av_get_sample_fmt_string() instead.

Definition at line 45 of file audioconvert.c.


Generated on Fri Oct 26 02:43:46 2012 for FFmpeg by  doxygen 1.5.8