1 /*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19 /**
20 * @file
21 * sample format and channel layout conversion audio filter
22 */
23
30
32
37
42
44
45 /* set by filter_frame() to signal an output frame to request_frame() */
48
50 {
54
59 }
60
61 e = NULL;
64
65 /* do not allow the user to override basic format options */
72
73 return 0;
74 }
75
77 {
79
83 }
85 }
86
88 {
91
98
101
104
107
108 return 0;
109 }
110
112 {
116 char buf1[64], buf2[64];
118
122 }
123
131 return 0;
132
135
140
142 }
143
150
153
156
158 -1, inlink ->channel_layout);
162 "fmt:%s srate:%d cl:%s -> fmt:%s srate:%d cl:%s\n",
165
166 return 0;
167 }
168
170 {
174
178
179 /* flush the lavr delay buffer */
186
187 if (!nb_samples)
189
191 if (!frame)
193
196 NULL, 0, 0);
197 if (ret <= 0) {
200 }
201
204 }
206 }
207
209 {
214
217 int delay, nb_samples;
218
219 /* maximum possible samples lavr can output */
224
226 if (!out) {
228 goto fail;
229 }
230
234 if (ret <= 0) {
236 if (ret < 0)
237 goto fail;
238 }
239
241
245 "assuming 0.\n");
247 } else
250 }
251
252 if (ret > 0) {
259 } else
261
263
266 }
267
268 fail:
270 } else {
274 }
275
277 }
278
280 {
282 }
283
285 {
287 return prev ? NULL : s->
avr;
288 }
289
296 };
297
299 {
303 },
304 { NULL }
305 };
306
308 {
313 },
314 { NULL }
315 };
316
321 .priv_class = &resample_class,
325 .
inputs = avfilter_af_resample_inputs,
326 .
outputs = avfilter_af_resample_outputs,
327 };