FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
audioconvert.c File Reference

audio conversion More...

#include "libavutil/avstring.h"
#include "libavutil/common.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
 

Macros

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

Functions

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 conversion

Author
Michael Niedermayer micha.nosp@m.elni.nosp@m.@gmx..nosp@m.at

Definition in file audioconvert.c.

Macro Definition 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);\
}
Number of sample formats. DO NOT USE if linking dynamically.
Definition: samplefmt.h:73
AVFormatContext * ctx
Definition: movenc-test.c:48
static av_cold int end(AVCodecContext *avctx)
Definition: avrndec.c:90

Referenced by av_audio_convert().

Function Documentation

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
Deprecated:
See libswresample

Definition at line 42 of file audioconvert.c.

Referenced by av_audio_resample_init().

void av_audio_convert_free ( AVAudioConvert ctx)

Free audio sample format converter context.

Deprecated:
See libswresample

Definition at line 58 of file audioconvert.c.

Referenced by audio_resample_close(), and av_audio_resample_init().

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)
Deprecated:
See libswresample

Definition at line 63 of file audioconvert.c.

Referenced by audio_resample().