diff mbox series

[FFmpeg-devel,05/10] avfilter/avfilter: Deprecate avfilter_pad_count()

Message ID AM7PR03MB66600629B5319934CF9FF6E38FFC9@AM7PR03MB6660.eurprd03.prod.outlook.com
State Accepted
Headers show
Series [FFmpeg-devel,01/10] fftools/cmdutils: Use avfilter_pad_count() for AVFilter's number of pads | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 15, 2021, 9:55 a.m. UTC
It is unnecessary as the number of static inputs and outputs can now
be directly read via AVFilter.nb_(in|out)puts.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/avfilter.h | 5 +++++
 libavfilter/version.h  | 3 +++
 2 files changed, 8 insertions(+)

Comments

Paul B Mahol Aug. 15, 2021, 10 a.m. UTC | #1
and what about dynamic number of pads?
Andreas Rheinhardt Aug. 15, 2021, 10:05 a.m. UTC | #2
Paul B Mahol:
> and what about dynamic number of pads?
> 
Dynamic pads are counted in AVFilterContext.nb_(input|output). Notice
that avfilter_pad_count() is not usable with them at all, because these
arrays are not zero-terminated. avfilter_pad_count() is only usable with
AVFilter.inputs and AVFilter.outputs.

- Andreas
Nicolas George Aug. 20, 2021, 9:24 a.m. UTC | #3
Andreas Rheinhardt (12021-08-15):
> It is unnecessary as the number of static inputs and outputs can now
> be directly read via AVFilter.nb_(in|out)puts.
> 
> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
> ---
>  libavfilter/avfilter.h | 5 +++++
>  libavfilter/version.h  | 3 +++
>  2 files changed, 8 insertions(+)

LGTM.

Regards,
diff mbox series

Patch

diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 0905f308eb..6006663e70 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 75cd10dccd..31d9e6750c 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 */