[FFmpeg-cvslog] avfilter/avfilter: Deprecate avfilter_pad_count()
Andreas Rheinhardt
git at videolan.org
Fri Aug 20 15:33:01 EEST 2021
ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Thu Aug 12 15:21:57 2021 +0200| [e88db774d8c3905fc664446914202f66ebc1a140] | committer: Andreas Rheinhardt
avfilter/avfilter: Deprecate avfilter_pad_count()
It is unnecessary as the number of static inputs and outputs can now
be directly read via AVFilter.nb_(in|out)puts.
Reviewed-by: Nicolas George <george at nsup.org>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e88db774d8c3905fc664446914202f66ebc1a140
---
doc/APIchanges | 1 +
libavfilter/avfilter.c | 2 ++
libavfilter/avfilter.h | 5 +++++
libavfilter/version.h | 3 +++
4 files changed, 11 insertions(+)
diff --git a/doc/APIchanges b/doc/APIchanges
index 72c5fae125..fe7b874881 100644
--- a/doc/APIchanges
+++ b/doc/APIchanges
@@ -16,6 +16,7 @@ API changes, most recent first:
2021-08-20 - xxxxxxxxxx - lavfi 8.3.100 - avfilter.H
Add avfilter_filter_pad_count() as a replacement for avfilter_pad_count().
+ Deprecate avfilter_pad_count().
2021-08-17 - xxxxxxxxxx - lavu 57.4.101 - opt.h
av_opt_copy() now guarantees that allocated src and dst options
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index b5f5616fde..28123655d6 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -538,6 +538,7 @@ int avfilter_process_command(AVFilterContext *filter, const char *cmd, const cha
return AVERROR(ENOSYS);
}
+#if FF_API_PAD_COUNT
int avfilter_pad_count(const AVFilterPad *pads)
{
const AVFilter *filter;
@@ -555,6 +556,7 @@ int avfilter_pad_count(const AVFilterPad *pads)
av_assert0(!"AVFilterPad list not from a filter");
}
+#endif
unsigned avfilter_filter_pad_count(const AVFilter *filter, int is_output)
{
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 3a0f0b7926..69ecb0186d 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -70,10 +70,15 @@ typedef struct AVFilterPad AVFilterPad;
typedef struct AVFilterFormats AVFilterFormats;
typedef struct AVFilterChannelLayouts AVFilterChannelLayouts;
+#if FF_API_PAD_COUNT
/**
* Get the number of elements in an AVFilter's inputs or outputs array.
+ *
+ * @deprecated Use avfilter_filter_pad_count() instead.
*/
+attribute_deprecated
int avfilter_pad_count(const AVFilterPad *pads);
+#endif
/**
* Get the name of an AVFilterPad.
diff --git a/libavfilter/version.h b/libavfilter/version.h
index cb4c19cf05..bcd27aa6e8 100644
--- a/libavfilter/version.h
+++ b/libavfilter/version.h
@@ -56,5 +56,8 @@
#ifndef FF_API_BUFFERSINK_ALLOC
#define FF_API_BUFFERSINK_ALLOC (LIBAVFILTER_VERSION_MAJOR < 9)
#endif
+#ifndef FF_API_PAD_COUNT
+#define FF_API_PAD_COUNT (LIBAVFILTER_VERSION_MAJOR < 9)
+#endif
#endif /* AVFILTER_VERSION_H */
More information about the ffmpeg-cvslog
mailing list