1 /*
2 * Copyright (c) 2010 S.N. Hemanth Meenakshisundaram <smeenaks@ucsd.edu>
3 * Copyright (c) 2011 Stefano Sabatini
4 * Copyright (c) 2011 Mina Nagy Zaki
5 *
6 * This file is part of FFmpeg.
7 *
8 * FFmpeg is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * FFmpeg is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with FFmpeg; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 /**
24 * @file
25 * sample format and channel layout conversion audio filter
26 */
27
34
43
44 #define OFFSET(x) offsetof(AConvertContext, x)
45 #define A AV_OPT_FLAG_AUDIO_PARAM
46 #define F AV_OPT_FLAG_FILTERING_PARAM
50 { NULL }
51 };
52
54
56 {
59
61
64
71 }
72
74 {
77 }
78
80 {
86
90 formats = NULL;
93 } else
96
100 layouts = NULL;
103 } else
106
107 return 0;
108 }
109
111 {
116 char buf1[64], buf2[64];
117
118 /* if not specified in args, use the format and layout of the output */
123
127 0, ctx);
131 if (ret < 0)
133
135 -1, inlink ->channel_layout);
139 "fmt:%s cl:%s -> fmt:%s cl:%s\n",
142
143 return 0;
144 }
145
147 {
153
154 if (!outsamplesref)
158
162
166 }
167
169 {
173 },
174 { NULL }
175 };
176
178 {
182 },
183 { NULL }
184 };
185
190 .priv_class = &aconvert_class,
194 .
inputs = aconvert_inputs,
196 };