From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 3AE2346C03 for ; Mon, 4 Mar 2024 15:43:54 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7E32268D46A; Mon, 4 Mar 2024 17:43:43 +0200 (EET) Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6695268D464 for ; Mon, 4 Mar 2024 17:43:37 +0200 (EET) Authentication-Results: mail1.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=h8yhDw+i; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 097324D3D for ; Mon, 4 Mar 2024 16:43:37 +0100 (CET) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id uyzRHYg3VP2g for ; Mon, 4 Mar 2024 16:43:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1709567014; bh=pOABSOJWCJBl28QGs+XsPlEJZAF4HpvQyTZMGAAjjv8=; h=From:To:Subject:Date:From; b=h8yhDw+iQ0lplTRFH+/jsIhmXjjCp5lVvvjINpcvzStJ+6k+gTHnvxYKE0g1O6BJ7 9JHpW35nblXjzySzUZIQpA65v5nJk7Dnt28z+TiY+P5tGu2MDxH+cakuzx95n7n6ky oSxfJRGWdy6lWoe16+MU6bfla8mWYr8TdHJ74UZ0qLRLLlyWHrHzgibUK4Hm6eyIsQ MFNVAXZs74TEIKeoY26eJ2hXSRqF3VpZcgrA41hibRf7QW3ObUTYVo7rltq2IqoJ0E rITJbXtjxJAMiynxtoJL/psSqnm73lJV5JeCj3gJVTah8WmSVgTAvZ6HL9blLw75ib bCY/q4j9cedUg== Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail1.khirnov.net (Postfix) with ESMTPS id B1F3610B9 for ; Mon, 4 Mar 2024 16:43:34 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 867BD3A0357 for ; Mon, 4 Mar 2024 16:43:34 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 4 Mar 2024 16:42:04 +0100 Message-ID: <20240304154205.27758-1-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/2] lavfi: deprecate avfilter_link_free() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: 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".