yading@11: /* yading@11: * Copyright (c) 2004 Michael Niedermayer yading@11: * yading@11: * This file is part of Libav. yading@11: * yading@11: * Libav is free software; you can redistribute it and/or yading@11: * modify it under the terms of the GNU Lesser General Public yading@11: * License as published by the Free Software Foundation; either yading@11: * version 2.1 of the License, or (at your option) any later version. yading@11: * yading@11: * Libav is distributed in the hope that it will be useful, yading@11: * but WITHOUT ANY WARRANTY; without even the implied warranty of yading@11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU yading@11: * Lesser General Public License for more details. yading@11: * yading@11: * You should have received a copy of the GNU Lesser General Public yading@11: * License along with Libav; if not, write to the Free Software yading@11: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA yading@11: */ yading@11: yading@11: #ifndef AVRESAMPLE_RESAMPLE_H yading@11: #define AVRESAMPLE_RESAMPLE_H yading@11: yading@11: #include "avresample.h" yading@11: #include "internal.h" yading@11: #include "audio_data.h" yading@11: yading@11: /** yading@11: * Allocate and initialize a ResampleContext. yading@11: * yading@11: * The parameters in the AVAudioResampleContext are used to initialize the yading@11: * ResampleContext. yading@11: * yading@11: * @param avr AVAudioResampleContext yading@11: * @return newly-allocated ResampleContext yading@11: */ yading@11: ResampleContext *ff_audio_resample_init(AVAudioResampleContext *avr); yading@11: yading@11: /** yading@11: * Free a ResampleContext. yading@11: * yading@11: * @param c ResampleContext yading@11: */ yading@11: void ff_audio_resample_free(ResampleContext **c); yading@11: yading@11: /** yading@11: * Resample audio data. yading@11: * yading@11: * Changes the sample rate. yading@11: * yading@11: * @par yading@11: * All samples in the source data may not be consumed depending on the yading@11: * resampling parameters and the size of the output buffer. The unconsumed yading@11: * samples are automatically added to the start of the source in the next call. yading@11: * If the destination data can be reallocated, that may be done in this function yading@11: * in order to fit all available output. If it cannot be reallocated, fewer yading@11: * input samples will be consumed in order to have the output fit in the yading@11: * destination data buffers. yading@11: * yading@11: * @param c ResampleContext yading@11: * @param dst destination audio data yading@11: * @param src source audio data yading@11: * @return 0 on success, negative AVERROR code on failure yading@11: */ yading@11: int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src); yading@11: yading@11: #endif /* AVRESAMPLE_RESAMPLE_H */