yading@11
|
1 /*
|
yading@11
|
2 * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
|
yading@11
|
3 *
|
yading@11
|
4 * This file is part of Libav.
|
yading@11
|
5 *
|
yading@11
|
6 * Libav is free software; you can redistribute it and/or
|
yading@11
|
7 * modify it under the terms of the GNU Lesser General Public
|
yading@11
|
8 * License as published by the Free Software Foundation; either
|
yading@11
|
9 * version 2.1 of the License, or (at your option) any later version.
|
yading@11
|
10 *
|
yading@11
|
11 * Libav is distributed in the hope that it will be useful,
|
yading@11
|
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
yading@11
|
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
yading@11
|
14 * Lesser General Public License for more details.
|
yading@11
|
15 *
|
yading@11
|
16 * You should have received a copy of the GNU Lesser General Public
|
yading@11
|
17 * License along with Libav; if not, write to the Free Software
|
yading@11
|
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
yading@11
|
19 */
|
yading@11
|
20
|
yading@11
|
21 #ifndef AVRESAMPLE_RESAMPLE_H
|
yading@11
|
22 #define AVRESAMPLE_RESAMPLE_H
|
yading@11
|
23
|
yading@11
|
24 #include "avresample.h"
|
yading@11
|
25 #include "internal.h"
|
yading@11
|
26 #include "audio_data.h"
|
yading@11
|
27
|
yading@11
|
28 /**
|
yading@11
|
29 * Allocate and initialize a ResampleContext.
|
yading@11
|
30 *
|
yading@11
|
31 * The parameters in the AVAudioResampleContext are used to initialize the
|
yading@11
|
32 * ResampleContext.
|
yading@11
|
33 *
|
yading@11
|
34 * @param avr AVAudioResampleContext
|
yading@11
|
35 * @return newly-allocated ResampleContext
|
yading@11
|
36 */
|
yading@11
|
37 ResampleContext *ff_audio_resample_init(AVAudioResampleContext *avr);
|
yading@11
|
38
|
yading@11
|
39 /**
|
yading@11
|
40 * Free a ResampleContext.
|
yading@11
|
41 *
|
yading@11
|
42 * @param c ResampleContext
|
yading@11
|
43 */
|
yading@11
|
44 void ff_audio_resample_free(ResampleContext **c);
|
yading@11
|
45
|
yading@11
|
46 /**
|
yading@11
|
47 * Resample audio data.
|
yading@11
|
48 *
|
yading@11
|
49 * Changes the sample rate.
|
yading@11
|
50 *
|
yading@11
|
51 * @par
|
yading@11
|
52 * All samples in the source data may not be consumed depending on the
|
yading@11
|
53 * resampling parameters and the size of the output buffer. The unconsumed
|
yading@11
|
54 * samples are automatically added to the start of the source in the next call.
|
yading@11
|
55 * If the destination data can be reallocated, that may be done in this function
|
yading@11
|
56 * in order to fit all available output. If it cannot be reallocated, fewer
|
yading@11
|
57 * input samples will be consumed in order to have the output fit in the
|
yading@11
|
58 * destination data buffers.
|
yading@11
|
59 *
|
yading@11
|
60 * @param c ResampleContext
|
yading@11
|
61 * @param dst destination audio data
|
yading@11
|
62 * @param src source audio data
|
yading@11
|
63 * @return 0 on success, negative AVERROR code on failure
|
yading@11
|
64 */
|
yading@11
|
65 int ff_audio_resample(ResampleContext *c, AudioData *dst, AudioData *src);
|
yading@11
|
66
|
yading@11
|
67 #endif /* AVRESAMPLE_RESAMPLE_H */
|