From 7bb98b753b4502c08f5a9fd6785c91612beb36e9 Mon Sep 17 00:00:00 2001 From: Nicolas George Date: Wed, 26 Dec 2012 16:46:43 +0100 Subject: [PATCH] lavfi: implement ff_all_channel_counts(). --- libavfilter/formats.c | 9 +++++++++ libavfilter/formats.h | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/libavfilter/formats.c b/libavfilter/formats.c index 296e4f4b7c..5f8954c789 100644 --- a/libavfilter/formats.c +++ b/libavfilter/formats.c @@ -376,6 +376,15 @@ AVFilterChannelLayouts *ff_all_channel_layouts(void) return ret; } +AVFilterChannelLayouts *ff_all_channel_counts(void) +{ + AVFilterChannelLayouts *ret = av_mallocz(sizeof(*ret)); + if (!ret) + return NULL; + ret->all_layouts = ret->all_counts = 1; + return ret; +} + #define FORMATS_REF(f, ref) \ do { \ *ref = f; \ diff --git a/libavfilter/formats.h b/libavfilter/formats.h index 438267fc16..4ef63df27a 100644 --- a/libavfilter/formats.h +++ b/libavfilter/formats.h @@ -123,11 +123,17 @@ AVFilterFormats *ff_merge_samplerates(AVFilterFormats *a, /** * Construct an empty AVFilterChannelLayouts/AVFilterFormats struct -- - * representing any channel layout/sample rate. + * representing any channel layout (with known disposition)/sample rate. */ AVFilterChannelLayouts *ff_all_channel_layouts(void); AVFilterFormats *ff_all_samplerates(void); +/** + * Construct an AVFilterChannelLayouts coding for any channel layout, with + * known or unknown disposition. + */ +AVFilterChannelLayouts *ff_all_channel_counts(void); + AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts);