From: Anton Khirnov <anton@khirnov.net> To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH 1/2] lavfi: deprecate avfilter_link_free() Date: Mon, 4 Mar 2024 16:42:04 +0100 Message-ID: <20240304154205.27758-1-anton@khirnov.net> (raw) 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".
next reply other threads:[~2024-03-04 15:43 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-03-04 15:42 Anton Khirnov [this message] 2024-03-04 15:42 ` [FFmpeg-devel] [PATCH 2/2] lavfi: deprecate avfilter_config_links() Anton Khirnov
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20240304154205.27758-1-anton@khirnov.net \ --to=anton@khirnov.net \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
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