Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/2] lavfi: deprecate avfilter_link_free()
@ 2024-03-04 15:42 Anton Khirnov
  2024-03-04 15:42 ` [FFmpeg-devel] [PATCH 2/2] lavfi: deprecate avfilter_config_links() Anton Khirnov
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Khirnov @ 2024-03-04 15:42 UTC (permalink / raw)
  To: ffmpeg-devel

It never makes sense for this function to be called by users.
---
 libavfilter/avfilter.c      | 11 +++++++++--
 libavfilter/avfilter.h      |  5 ++++-
 libavfilter/version_major.h |  1 +
 3 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index daa7c3672a..cb2128252b 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 5eff35b836..0949870de4 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -692,10 +692,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 1decc4012e..97fcd57e90 100644
--- a/libavfilter/version_major.h
+++ b/libavfilter/version_major.h
@@ -36,5 +36,6 @@
  */
 
 #define FF_API_LIBPLACEBO_OPTS (LIBAVFILTER_VERSION_MAJOR < 10)
+#define FF_API_LINK_PUBLIC     (LIBAVFILTER_VERSION_MAJOR < 11)
 
 #endif /* AVFILTER_VERSION_MAJOR_H */
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [FFmpeg-devel] [PATCH 2/2] lavfi: deprecate avfilter_config_links()
  2024-03-04 15:42 [FFmpeg-devel] [PATCH 1/2] lavfi: deprecate avfilter_link_free() Anton Khirnov
@ 2024-03-04 15:42 ` Anton Khirnov
  0 siblings, 0 replies; 2+ messages in thread
From: Anton Khirnov @ 2024-03-04 15:42 UTC (permalink / raw)
  To: ffmpeg-devel

It never makes sense for this function to be called by users.
---
 libavfilter/avfilter.c       | 8 ++++++--
 libavfilter/avfilter.h       | 8 +++-----
 libavfilter/avfiltergraph.c  | 2 +-
 libavfilter/f_streamselect.c | 2 +-
 libavfilter/internal.h       | 8 ++++++++
 5 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index cb2128252b..859a6f9d16 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -212,6 +212,10 @@ void avfilter_link_free(AVFilterLink **link)
 {
     link_free(link);
 }
+int avfilter_config_links(AVFilterContext *filter)
+{
+    return ff_filter_config_links(EINVAL);
+}
 #endif
 
 static void update_link_current_pts(FilterLinkInternal *li, int64_t pts)
@@ -322,7 +326,7 @@ int avfilter_insert_filter(AVFilterLink *link, AVFilterContext *filt,
     return 0;
 }
 
-int avfilter_config_links(AVFilterContext *filter)
+int ff_filter_config_links(AVFilterContext *filter)
 {
     int (*config_link)(AVFilterLink *);
     unsigned i;
@@ -353,7 +357,7 @@ int avfilter_config_links(AVFilterContext *filter)
         case AVLINK_UNINIT:
             li->init_state = AVLINK_STARTINIT;
 
-            if ((ret = avfilter_config_links(link->src)) < 0)
+            if ((ret = ff_filter_config_links(link->src)) < 0)
                 return ret;
 
             if (!(config_link = link->srcpad->config_props)) {
diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h
index 0949870de4..08f185c4d2 100644
--- a/libavfilter/avfilter.h
+++ b/libavfilter/avfilter.h
@@ -698,15 +698,13 @@ int avfilter_link(AVFilterContext *src, unsigned srcpad,
  */
 attribute_deprecated
 void avfilter_link_free(AVFilterLink **link);
-#endif
 
 /**
- * Negotiate the media format, dimensions, etc of all inputs to a filter.
- *
- * @param filter the filter to negotiate the properties for its inputs
- * @return       zero on successful negotiation
+ * @deprecated this function should never be called by users
  */
+attribute_deprecated
 int avfilter_config_links(AVFilterContext *filter);
+#endif
 
 #define AVFILTER_CMD_FLAG_ONE   1 ///< Stop once a filter understood the command (for target=all for example), fast filters are favored automatically
 #define AVFILTER_CMD_FLAG_FAST  2 ///< Only execute command when its fast (like a video out that supports contrast adjustment in hw)
diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c
index 674711ec35..ac491ee89b 100644
--- a/libavfilter/avfiltergraph.c
+++ b/libavfilter/avfiltergraph.c
@@ -251,7 +251,7 @@ static int graph_config_links(AVFilterGraph *graph, void *log_ctx)
         filt = graph->filters[i];
 
         if (!filt->nb_outputs) {
-            if ((ret = avfilter_config_links(filt)))
+            if ((ret = ff_filter_config_links(filt)))
                 return ret;
         }
     }
diff --git a/libavfilter/f_streamselect.c b/libavfilter/f_streamselect.c
index 1328a842f9..fb96a46862 100644
--- a/libavfilter/f_streamselect.c
+++ b/libavfilter/f_streamselect.c
@@ -250,7 +250,7 @@ static int process_command(AVFilterContext *ctx, const char *cmd, const char *ar
 
         if (ret < 0)
             return ret;
-        return avfilter_config_links(ctx);
+        return ff_filter_config_links(ctx);
     }
     return AVERROR(ENOSYS);
 }
diff --git a/libavfilter/internal.h b/libavfilter/internal.h
index 0e3f68d1f4..000f94cb16 100644
--- a/libavfilter/internal.h
+++ b/libavfilter/internal.h
@@ -246,6 +246,14 @@ int ff_parse_channel_layout(AVChannelLayout *ret, int *nret, const char *arg,
  */
 void ff_avfilter_link_set_in_status(AVFilterLink *link, int status, int64_t pts);
 
+/**
+ * Negotiate the media format, dimensions, etc of all inputs to a filter.
+ *
+ * @param filter the filter to negotiate the properties for its inputs
+ * @return       zero on successful negotiation
+ */
+int ff_filter_config_links(AVFilterContext *filter);
+
 #define D2TS(d)      (isnan(d) ? AV_NOPTS_VALUE : (int64_t)(d))
 #define TS2D(ts)     ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts))
 #define TS2T(ts, tb) ((ts) == AV_NOPTS_VALUE ? NAN : (double)(ts) * av_q2d(tb))
-- 
2.43.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-03-04 15:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-04 15:42 [FFmpeg-devel] [PATCH 1/2] lavfi: deprecate avfilter_link_free() Anton Khirnov
2024-03-04 15:42 ` [FFmpeg-devel] [PATCH 2/2] lavfi: deprecate avfilter_config_links() Anton Khirnov

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git