yading@10: /* yading@10: * audio conversion yading@10: * Copyright (c) 2006 Michael Niedermayer yading@10: * Copyright (c) 2008 Peter Ross yading@10: * yading@10: * This file is part of FFmpeg. yading@10: * yading@10: * FFmpeg is free software; you can redistribute it and/or yading@10: * modify it under the terms of the GNU Lesser General Public yading@10: * License as published by the Free Software Foundation; either yading@10: * version 2.1 of the License, or (at your option) any later version. yading@10: * yading@10: * FFmpeg is distributed in the hope that it will be useful, yading@10: * but WITHOUT ANY WARRANTY; without even the implied warranty of yading@10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU yading@10: * Lesser General Public License for more details. yading@10: * yading@10: * You should have received a copy of the GNU Lesser General Public yading@10: * License along with FFmpeg; if not, write to the Free Software yading@10: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA yading@10: */ yading@10: yading@10: #ifndef AVCODEC_AUDIOCONVERT_H yading@10: #define AVCODEC_AUDIOCONVERT_H yading@10: yading@10: /** yading@10: * @file yading@10: * Audio format conversion routines yading@10: */ yading@10: yading@10: yading@10: #include "libavutil/cpu.h" yading@10: #include "avcodec.h" yading@10: #include "libavutil/channel_layout.h" yading@10: yading@10: struct AVAudioConvert; yading@10: typedef struct AVAudioConvert AVAudioConvert; yading@10: yading@10: /** yading@10: * Create an audio sample format converter context yading@10: * @param out_fmt Output sample format yading@10: * @param out_channels Number of output channels yading@10: * @param in_fmt Input sample format yading@10: * @param in_channels Number of input channels yading@10: * @param[in] matrix Channel mixing matrix (of dimension in_channel*out_channels). Set to NULL to ignore. yading@10: * @param flags See AV_CPU_FLAG_xx yading@10: * @return NULL on error yading@10: */ yading@10: AVAudioConvert *av_audio_convert_alloc(enum AVSampleFormat out_fmt, int out_channels, yading@10: enum AVSampleFormat in_fmt, int in_channels, yading@10: const float *matrix, int flags); yading@10: yading@10: /** yading@10: * Free audio sample format converter context yading@10: */ yading@10: void av_audio_convert_free(AVAudioConvert *ctx); yading@10: yading@10: /** yading@10: * Convert between audio sample formats yading@10: * @param[in] out array of output buffers for each channel. set to NULL to ignore processing of the given channel. yading@10: * @param[in] out_stride distance between consecutive output samples (measured in bytes) yading@10: * @param[in] in array of input buffers for each channel yading@10: * @param[in] in_stride distance between consecutive input samples (measured in bytes) yading@10: * @param len length of audio frame size (measured in samples) yading@10: */ yading@10: int av_audio_convert(AVAudioConvert *ctx, yading@10: void * const out[6], const int out_stride[6], yading@10: const void * const in[6], const int in_stride[6], int len); yading@10: yading@10: #endif /* AVCODEC_AUDIOCONVERT_H */