[FFmpeg-cvslog] avfilter/formats: Schedule avfilter_make_format64_list() for removal

Andreas Rheinhardt git at videolan.org
Wed Aug 12 22:46:12 EEST 2020


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at gmail.com> | Sat Aug  8 00:37:46 2020 +0200| [ae5026c90502fad71338b81badd227db00b462cf] | committer: Andreas Rheinhardt

avfilter/formats: Schedule avfilter_make_format64_list() for removal

Despite its name, this function is not part of the public API, as
formats.h, the header containing its declaration, is a private header.
The formats API was once public API, but that changed long ago
(b74a1da49db5ebed51aceae6cacc2329288a92c1, the commit scheduling it to
become private, is from 2012). That avfilter_make_format64_list() was
forgotten is probably a result of the confusion resulting from the
libav-ffmpeg split.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ae5026c90502fad71338b81badd227db00b462cf
---

 libavfilter/aeval.c          | 2 +-
 libavfilter/af_aresample.c   | 2 +-
 libavfilter/asrc_afirsrc.c   | 2 +-
 libavfilter/asrc_anoisesrc.c | 2 +-
 libavfilter/asrc_anullsrc.c  | 3 +--
 libavfilter/asrc_hilbert.c   | 2 +-
 libavfilter/asrc_sinc.c      | 2 +-
 libavfilter/asrc_sine.c      | 2 +-
 libavfilter/avf_showcqt.c    | 2 +-
 libavfilter/formats.c        | 9 ++++++++-
 libavfilter/formats.h        | 6 +++++-
 libavfilter/src_movie.c      | 2 +-
 12 files changed, 23 insertions(+), 13 deletions(-)

diff --git a/libavfilter/aeval.c b/libavfilter/aeval.c
index 855dc0009d..c7a8cd6550 100644
--- a/libavfilter/aeval.c
+++ b/libavfilter/aeval.c
@@ -258,7 +258,7 @@ static int query_formats(AVFilterContext *ctx)
     if (ret < 0)
         return ret;
 
-    layouts = avfilter_make_format64_list(chlayouts);
+    layouts = ff_make_format64_list(chlayouts);
     if (!layouts)
         return AVERROR(ENOMEM);
     ret = ff_set_common_channel_layouts(ctx, layouts);
diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index fb10bd1c33..b7b1b5ba3c 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -126,7 +126,7 @@ static int query_formats(AVFilterContext *ctx)
 
     if(out_layout) {
         int64_t layout_list[] = { out_layout, -1 };
-        out_layouts = avfilter_make_format64_list(layout_list);
+        out_layouts = ff_make_format64_list(layout_list);
     } else
         out_layouts = ff_all_channel_counts();
 
diff --git a/libavfilter/asrc_afirsrc.c b/libavfilter/asrc_afirsrc.c
index b90ffad57f..d8ba8f6a54 100644
--- a/libavfilter/asrc_afirsrc.c
+++ b/libavfilter/asrc_afirsrc.c
@@ -145,7 +145,7 @@ static av_cold int query_formats(AVFilterContext *ctx)
     if (ret < 0)
         return ret;
 
-    layouts = avfilter_make_format64_list(chlayouts);
+    layouts = ff_make_format64_list(chlayouts);
     if (!layouts)
         return AVERROR(ENOMEM);
     ret = ff_set_common_channel_layouts(ctx, layouts);
diff --git a/libavfilter/asrc_anoisesrc.c b/libavfilter/asrc_anoisesrc.c
index 7aa878707d..40ee077001 100644
--- a/libavfilter/asrc_anoisesrc.c
+++ b/libavfilter/asrc_anoisesrc.c
@@ -101,7 +101,7 @@ static av_cold int query_formats(AVFilterContext *ctx)
     if (ret < 0)
         return ret;
 
-    layouts = avfilter_make_format64_list(chlayouts);
+    layouts = ff_make_format64_list(chlayouts);
     if (!layouts)
         return AVERROR(ENOMEM);
     ret = ff_set_common_channel_layouts(ctx, layouts);
diff --git a/libavfilter/asrc_anullsrc.c b/libavfilter/asrc_anullsrc.c
index 52db61685d..7093f08275 100644
--- a/libavfilter/asrc_anullsrc.c
+++ b/libavfilter/asrc_anullsrc.c
@@ -83,11 +83,10 @@ static int query_formats(AVFilterContext *ctx)
     int ret;
 
     if ((ret = ff_set_common_formats         (ctx, ff_all_formats              (AVMEDIA_TYPE_AUDIO))) < 0 ||
-        (ret = ff_set_common_channel_layouts (ctx, avfilter_make_format64_list (chlayouts         ))) < 0 ||
         (ret = ff_set_common_samplerates     (ctx, ff_make_format_list         (sample_rates      ))) < 0)
         return ret;
 
-    return 0;
+    return ff_set_common_channel_layouts(ctx, ff_make_format64_list(chlayouts));
 }
 
 static int config_props(AVFilterLink *outlink)
diff --git a/libavfilter/asrc_hilbert.c b/libavfilter/asrc_hilbert.c
index a51c676c6f..640dfe46f9 100644
--- a/libavfilter/asrc_hilbert.c
+++ b/libavfilter/asrc_hilbert.c
@@ -113,7 +113,7 @@ static av_cold int query_formats(AVFilterContext *ctx)
     if (ret < 0)
         return ret;
 
-    layouts = avfilter_make_format64_list(chlayouts);
+    layouts = ff_make_format64_list(chlayouts);
     if (!layouts)
         return AVERROR(ENOMEM);
     ret = ff_set_common_channel_layouts(ctx, layouts);
diff --git a/libavfilter/asrc_sinc.c b/libavfilter/asrc_sinc.c
index 24aeab6e7b..c3ecb864d1 100644
--- a/libavfilter/asrc_sinc.c
+++ b/libavfilter/asrc_sinc.c
@@ -84,7 +84,7 @@ static int query_formats(AVFilterContext *ctx)
     if (ret < 0)
         return ret;
 
-    layouts = avfilter_make_format64_list(chlayouts);
+    layouts = ff_make_format64_list(chlayouts);
     if (!layouts)
         return AVERROR(ENOMEM);
     ret = ff_set_common_channel_layouts(ctx, layouts);
diff --git a/libavfilter/asrc_sine.c b/libavfilter/asrc_sine.c
index 3a87210b4b..6fe080efb6 100644
--- a/libavfilter/asrc_sine.c
+++ b/libavfilter/asrc_sine.c
@@ -194,7 +194,7 @@ static av_cold int query_formats(AVFilterContext *ctx)
     if (ret < 0)
         return ret;
 
-    layouts = avfilter_make_format64_list(chlayouts);
+    layouts = ff_make_format64_list(chlayouts);
     if (!layouts)
         return AVERROR(ENOMEM);
     ret = ff_set_common_channel_layouts(ctx, layouts);
diff --git a/libavfilter/avf_showcqt.c b/libavfilter/avf_showcqt.c
index 990db3143b..95efe72628 100644
--- a/libavfilter/avf_showcqt.c
+++ b/libavfilter/avf_showcqt.c
@@ -1334,7 +1334,7 @@ static int query_formats(AVFilterContext *ctx)
     if ((ret = ff_formats_ref(formats, &inlink->out_formats)) < 0)
         return ret;
 
-    layouts = avfilter_make_format64_list(channel_layouts);
+    layouts = ff_make_format64_list(channel_layouts);
     if ((ret = ff_channel_layouts_ref(layouts, &inlink->out_channel_layouts)) < 0)
         return ret;
 
diff --git a/libavfilter/formats.c b/libavfilter/formats.c
index bcc539bb38..48b27d0c53 100644
--- a/libavfilter/formats.c
+++ b/libavfilter/formats.c
@@ -289,7 +289,7 @@ AVFilterFormats *ff_make_format_list(const int *fmts)
     return formats;
 }
 
-AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts)
+AVFilterChannelLayouts *ff_make_format64_list(const int64_t *fmts)
 {
     MAKE_FORMAT_LIST(AVFilterChannelLayouts,
                      channel_layouts, nb_channel_layouts);
@@ -300,6 +300,13 @@ AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts)
     return formats;
 }
 
+#if LIBAVFILTER_VERSION_MAJOR < 8
+AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts)
+{
+    return ff_make_format64_list(fmts);
+}
+#endif
+
 #define ADD_FORMAT(f, fmt, unref_fn, type, list, nb)        \
 do {                                                        \
     type *fmts;                                             \
diff --git a/libavfilter/formats.h b/libavfilter/formats.h
index 708bee3ee8..ffe7a12d53 100644
--- a/libavfilter/formats.h
+++ b/libavfilter/formats.h
@@ -20,6 +20,7 @@
 #define AVFILTER_FORMATS_H
 
 #include "avfilter.h"
+#include "version.h"
 
 /**
  * A list of supported formats for one end of a filter link. This is used
@@ -139,8 +140,11 @@ av_warn_unused_result
 AVFilterChannelLayouts *ff_all_channel_counts(void);
 
 av_warn_unused_result
-AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts);
+AVFilterChannelLayouts *ff_make_format64_list(const int64_t *fmts);
 
+#if LIBAVFILTER_VERSION_MAJOR < 8
+AVFilterChannelLayouts *avfilter_make_format64_list(const int64_t *fmts);
+#endif
 
 /**
  * A helper for query_formats() which sets all links to the same list of channel
diff --git a/libavfilter/src_movie.c b/libavfilter/src_movie.c
index 476b8d3d96..64d82e9df1 100644
--- a/libavfilter/src_movie.c
+++ b/libavfilter/src_movie.c
@@ -376,7 +376,7 @@ static int movie_query_formats(AVFilterContext *ctx)
             if ((ret = ff_formats_ref(ff_make_format_list(list), &outlink->in_samplerates)) < 0)
                 return ret;
             list64[0] = c->channel_layout;
-            if ((ret = ff_channel_layouts_ref(avfilter_make_format64_list(list64),
+            if ((ret = ff_channel_layouts_ref(ff_make_format64_list(list64),
                                    &outlink->in_channel_layouts)) < 0)
                 return ret;
             break;



More information about the ffmpeg-cvslog mailing list