1 /*
2 * Copyright (c) 2011 Stefano Sabatini
3 * Copyright (c) 2011 Mina Nagy Zaki
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /**
23 * @file
24 * resampling audio filter
25 */
26
36
45
47 {
50
53 if (!aresample->
swr) {
56 }
57
58 if (opts) {
60
64 }
66 }
71 }
72
74 {
77 }
78
80 {
83 uint64_t out_layout =
av_get_int(aresample->
swr,
"ocl", NULL);
85
88
95
99
100 if(out_rate > 0) {
102 } else {
104 }
106
109 } else
112
113 if(out_layout) {
115 } else
118
119 return 0;
120 }
121
122
124 {
129 int out_rate;
130 uint64_t out_layout;
132 char inchl_buf[128], outchl_buf[128];
133
137 0, ctx);
144
146 if (ret < 0)
148
153
157
159
162
166 return 0;
167 }
168
170 {
173 int n_out = n_in * aresample->
ratio * 2 + 256;
177
178 if(!outsamplesref)
180
186
192 } else {
194 }
197 if (n_out <= 0) {
200 return 0;
201 }
202
204
209 }
210
212 {
217
219 do{
222
225 int n_out = 4096;
226
228 if (!outsamplesref)
231 if (n_out <= 0) {
234 }
235
238 #if 0
242 #else
245 #endif
246
248 }
250 }
251
253 {
255 }
256
258 {
260 return prev ? NULL : s->
swr;
261 }
262
263 #define OFFSET(x) offsetof(AResampleContext, x)
264 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
265
268 {NULL}
269 };
270
278 };
279
281 {
285 },
286 { NULL }
287 };
288
290 {
295 },
296 { NULL }
297 };
298
306 .priv_class = &aresample_class,
307 .
inputs = aresample_inputs,
309 };