2 * This file is part of Libav.
4 * Libav 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.
9 * Libav 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.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with Libav; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #ifndef AVFILTER_FORMATS_H
20 #define AVFILTER_FORMATS_H
24 typedef struct AVFilterChannelLayouts {
25 uint64_t *channel_layouts; ///< list of channel layouts
26 int nb_channel_layouts; ///< number of channel layouts
28 unsigned refcount; ///< number of references to this list
29 struct AVFilterChannelLayouts ***refs; ///< references to this list
30 } AVFilterChannelLayouts;
33 * Return a channel layouts/samplerates list which contains the intersection of
34 * the layouts/samplerates of a and b. Also, all the references of a, all the
35 * references of b, and a and b themselves will be deallocated.
37 * If a and b do not share any common elements, neither is modified, and NULL
40 AVFilterChannelLayouts *ff_merge_channel_layouts(AVFilterChannelLayouts *a,
41 AVFilterChannelLayouts *b);
42 AVFilterFormats *ff_merge_samplerates(AVFilterFormats *a,
46 * Construct an empty AVFilterChannelLayouts/AVFilterFormats struct --
47 * representing any channel layout/sample rate.
49 AVFilterChannelLayouts *ff_all_channel_layouts(void);
50 AVFilterFormats *ff_all_samplerates(void);
53 * A helper for query_formats() which sets all links to the same list of channel
54 * layouts/sample rates. If there are no links hooked to this filter, the list
57 void ff_set_common_channel_layouts(AVFilterContext *ctx,
58 AVFilterChannelLayouts *layouts);
59 void ff_set_common_samplerates(AVFilterContext *ctx,
60 AVFilterFormats *samplerates);
62 int ff_add_channel_layout(AVFilterChannelLayouts **l, uint64_t channel_layout);
65 * Add *ref as a new reference to f.
67 void ff_channel_layouts_ref(AVFilterChannelLayouts *f,
68 AVFilterChannelLayouts **ref);
71 * Remove a reference to a channel layouts list.
73 void ff_channel_layouts_unref(AVFilterChannelLayouts **ref);
75 void ff_channel_layouts_changeref(AVFilterChannelLayouts **oldref,
76 AVFilterChannelLayouts **newref);
78 int ff_default_query_formats(AVFilterContext *ctx);
80 #endif // AVFILTER_FORMATS_H