yading@10
|
1 /*
|
yading@10
|
2 * audio conversion
|
yading@10
|
3 * Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at>
|
yading@10
|
4 * Copyright (c) 2008 Peter Ross
|
yading@10
|
5 *
|
yading@10
|
6 * This file is part of FFmpeg.
|
yading@10
|
7 *
|
yading@10
|
8 * FFmpeg is free software; you can redistribute it and/or
|
yading@10
|
9 * modify it under the terms of the GNU Lesser General Public
|
yading@10
|
10 * License as published by the Free Software Foundation; either
|
yading@10
|
11 * version 2.1 of the License, or (at your option) any later version.
|
yading@10
|
12 *
|
yading@10
|
13 * FFmpeg is distributed in the hope that it will be useful,
|
yading@10
|
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
yading@10
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
yading@10
|
16 * Lesser General Public License for more details.
|
yading@10
|
17 *
|
yading@10
|
18 * You should have received a copy of the GNU Lesser General Public
|
yading@10
|
19 * License along with FFmpeg; if not, write to the Free Software
|
yading@10
|
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
yading@10
|
21 */
|
yading@10
|
22
|
yading@10
|
23 #ifndef AVCODEC_AUDIOCONVERT_H
|
yading@10
|
24 #define AVCODEC_AUDIOCONVERT_H
|
yading@10
|
25
|
yading@10
|
26 /**
|
yading@10
|
27 * @file
|
yading@10
|
28 * Audio format conversion routines
|
yading@10
|
29 */
|
yading@10
|
30
|
yading@10
|
31
|
yading@10
|
32 #include "libavutil/cpu.h"
|
yading@10
|
33 #include "avcodec.h"
|
yading@10
|
34 #include "libavutil/channel_layout.h"
|
yading@10
|
35
|
yading@10
|
36 struct AVAudioConvert;
|
yading@10
|
37 typedef struct AVAudioConvert AVAudioConvert;
|
yading@10
|
38
|
yading@10
|
39 /**
|
yading@10
|
40 * Create an audio sample format converter context
|
yading@10
|
41 * @param out_fmt Output sample format
|
yading@10
|
42 * @param out_channels Number of output channels
|
yading@10
|
43 * @param in_fmt Input sample format
|
yading@10
|
44 * @param in_channels Number of input channels
|
yading@10
|
45 * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore.
|
yading@10
|
46 * @param flags See AV_CPU_FLAG_xx
|
yading@10
|
47 * @return NULL on error
|
yading@10
|
48 */
|
yading@10
|
49 AVAudioConvert *av_audio_convert_alloc(enum AVSampleFormat out_fmt, int out_channels,
|
yading@10
|
50 enum AVSampleFormat in_fmt, int in_channels,
|
yading@10
|
51 const float *matrix, int flags);
|
yading@10
|
52
|
yading@10
|
53 /**
|
yading@10
|
54 * Free audio sample format converter context
|
yading@10
|
55 */
|
yading@10
|
56 void av_audio_convert_free(AVAudioConvert *ctx);
|
yading@10
|
57
|
yading@10
|
58 /**
|
yading@10
|
59 * Convert between audio sample formats
|
yading@10
|
60 * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel.
|
yading@10
|
61 * @param[in] out_stride distance between consecutive output samples (measured in bytes)
|
yading@10
|
62 * @param[in] in array of input buffers for each channel
|
yading@10
|
63 * @param[in] in_stride distance between consecutive input samples (measured in bytes)
|
yading@10
|
64 * @param len length of audio frame size (measured in samples)
|
yading@10
|
65 */
|
yading@10
|
66 int av_audio_convert(AVAudioConvert *ctx,
|
yading@10
|
67 void * const out[6], const int out_stride[6],
|
yading@10
|
68 const void * const in[6], const int in_stride[6], int len);
|
yading@10
|
69
|
yading@10
|
70 #endif /* AVCODEC_AUDIOCONVERT_H */
|