summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2024-03-04 16:23:31 +0100
committerAnton Khirnov <anton@khirnov.net>2024-03-08 09:29:54 +0100
commit6b1f41e152cb05e9eed13baec2dca704bf917db0 (patch)
treeecf0b78930e097a25915e1e543b98520d4f57d00
parentc0aee39412affb2a575f95e7a7d1f75274f7f8bc (diff)
lavfi: deprecate avfilter_link_free()
It never makes sense for this function to be called by users.
-rw-r--r--libavfilter/avfilter.c11
-rw-r--r--libavfilter/avfilter.h5
-rw-r--r--libavfilter/version_major.h2
3 files changed, 15 insertions, 3 deletions
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 0afc953375..8a5f4282ad 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -192,7 +192,7 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
return 0;
}
-void avfilter_link_free(AVFilterLink **link)
+static void link_free(AVFilterLink **link)
{
FilterLinkInternal *li;
@@ -207,6 +207,13 @@ void avfilter_link_free(AVFilterLink **link)
av_freep(link);
}
+#if FF_API_LINK_PUBLIC
+void avfilter_link_free(AVFilterLink **link)
+{
+ link_free(link);
+}
+#endif
+
static void update_link_current_pts(FilterLinkInternal *li, int64_t pts)
{
AVFilterLink *const link = &li->l;
@@ -763,7 +770,7 @@ static void free_link(AVFilterLink *link)
ff_formats_unref(&link->outcfg.samplerates);
ff_channel_layouts_unref(&link->incfg.channel_layouts);
ff_channel_layouts_unref(&link->outcfg.channel_layouts);
- avfilter_link_free(&link);
+ link_free(&link);
}
void avfilter_free(AVFilterContext *filter)
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 25bb915f88..623c104885 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -676,10 +676,13 @@ struct AVFilterLink {
int avfilter_link(AVFilterContext *src, unsigned srcpad,
AVFilterContext *dst, unsigned dstpad);
+#if FF_API_LINK_PUBLIC
/**
- * Free the link in *link, and set its pointer to NULL.
+ * @deprecated this function should never be called by users
*/
+attribute_deprecated
void avfilter_link_free(AVFilterLink **link);
+#endif
/**
* Negotiate the media format, dimensions, etc of all inputs to a filter.
diff --git a/libavfilter/version_major.h b/libavfilter/version_major.h
index c8b94713dc..c5e660eeda 100644
--- a/libavfilter/version_major.h
+++ b/libavfilter/version_major.h
@@ -35,4 +35,6 @@
* the public API and may change, break or disappear at any time.
*/
+#define FF_API_LINK_PUBLIC (LIBAVFILTER_VERSION_MAJOR < 11)
+
#endif /* AVFILTER_VERSION_MAJOR_H */