From patchwork Mon Sep 23 15:01:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51758 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a59:d154:0:b0:48e:c0f8:d0de with SMTP id bt20csp2522995vqb; Mon, 23 Sep 2024 08:09:18 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWy1wkg2/7AFASHyCX4neBnfpZCu0S3fvzUZHF7CuxGCRd6YpVi7qNP3adYDx4yY2M3+AKBNb6NgahlcFjErPjJ@gmail.com X-Google-Smtp-Source: AGHT+IFU50bcL7vh6X22wadS12WYd/XBHDdmo8OBTXiS8c9YfQe3/zo5eDX22suvgWxem2hEoEcU X-Received: by 2002:a17:907:9708:b0:a83:8591:7505 with SMTP id a640c23a62f3a-a90d5167dc8mr1408500066b.59.1727104158373; Mon, 23 Sep 2024 08:09:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1727104158; cv=none; d=google.com; s=arc-20240605; b=MZ++4WLf6xeljW+M6GiFSBgtf8NxM1joHHv3lTgo5dmRBXx0zt4lITFuW2/EY0Nr8M /xdq/YJuMfE6G3WiVKwkVqWWHfNQTxXWMZqdgFgW2XXBnVrg9GbbSLhyWzGIzlRGmgpI dzSR3pIOxGdVtVJ2zoKcva3TXYqSJBMxp1FHh5CmD5PKnKK9+m5HDlbRh5PCUAe9eqHj E9ETT6tCO4fPHt7rWswqZbkQ55XCIRO1FQDRYKnsGGz6Jv4Vf1S6+vIvTmO/DM79CLrT eqewSeBSG76ShCunRpGf/5PuQxaJ9qe5Yzjb/SOH5uP8g5CSAHCykjQdBzIrd0cdbaa5 OCbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:dkim-signature:delivered-to; bh=3rOkmATwEZDRgFDw2yVDtZwDAwox+XD9cvnvd5z+QSY=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=Wpbu2X86RHwJzj5azhnpWJVG5xCMGNHx2C3MFP9mk/0Xu5tnRja4zB/1yWCY/3UbSl HK2/r5OFpSGWRhRw6gfchQWLUlOfkcOd9sxekNAIBXIyMon7YbsBXNkb1rwanI0Yt0Wy xhB5eXL2cuwomBGSFywwBODnwYGjl7dB4sxo7vbOmS1DQKzD2eljZRARW7T0y2393tie efCgjKKJf/QFBhU9g4PMP6VAtrIdsITrd1Y6lyXP6inN6vNAxkRDqGRsm37pF1aAvd4T sZsRietjwRkx0wq8Jp4mTGW24tldI85TAfBDdCP2YXGxLo7/pC84ruq2p7buuBRKQ6bw zJlw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=c5wdmmYJ; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id a640c23a62f3a-a906133a224si1369568466b.820.2024.09.23.08.09.18; Mon, 23 Sep 2024 08:09:18 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=c5wdmmYJ; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 535D668D9FD; Mon, 23 Sep 2024 18:02:21 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DF5D568DC59 for ; Mon, 23 Sep 2024 18:02:11 +0300 (EEST) 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=c5wdmmYJ; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id F39AB4DF1 for ; Mon, 23 Sep 2024 17:02:06 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id EgtXt_J7cOzS for ; Mon, 23 Sep 2024 17:02:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1727103724; bh=ydQRzTHD6KvUa4CWbJvQgpFY57IrrPx5xHoC3FwvDAk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=c5wdmmYJQVmxAp41LJ6gT9MHs1qqTyfjzr1ep0IRA4r3RkP8u/hJoTZCEHyh5oRt4 gGKYKJXAFsNg0lZCersE7fC4/GUQZw8UTZNePOsY92erECXJAMLJwSZP/9EchSmUBm PRftt86R29MdTgKLCz5HoYW0vIMoSdNeuPjk5ct0xcL8B0SGfqE3K4w9JSS4dJyYrB vledlUSLEboy2jhUfLraU7GpBq2ywXhcIRD9H9RYrwaHESs7CNPcfALjmuflAa8eal z5q51MbRn6NAesDnorE9uKhqvOAZUIyU2l7EBMK8l9hgqRfnCXjOM4WTLEJ/VIceML KnAGoNDofGPFw== 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 992B04E0A for ; Mon, 23 Sep 2024 17:02:04 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 747B63A164C for ; Mon, 23 Sep 2024 17:02:04 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 23 Sep 2024 17:01:45 +0200 Message-ID: <20240923150146.31693-7-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240923150146.31693-1-anton@khirnov.net> References: <20240923150146.31693-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 7/7] lavfi/buffersink: deprecate functions obsoleted by AV_BUFFERSINK_FLAG_PARAMS 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: j9gUtBT0d/h5 That is all av_buffersink_get_*() except type and frame_rate, for which AVFrame does not currently have fields. --- doc/APIchanges | 12 +++++++++++- libavfilter/buffersink.c | 4 ++++ libavfilter/buffersink.h | 19 ++++++++++++++++++- libavfilter/version_major.h | 1 + 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 5ddd7189f8..971750bfe7 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -4,7 +4,17 @@ API changes, most recent first: 2024-09-xx - xxxxxxxxxx - lavfi 10.4.100 Buffersink now sets AVFrame.time_base on the frames it outputs. - Add AV_BUFFERSINK_FLAG_PARAMS. + Add AV_BUFFERSINK_FLAG_PARAMS; deprecate + - av_buffersink_get_time_base() + - av_buffersink_get_w() + - av_buffersink_get_h() + - av_buffersink_get_sample_aspect_ratio() + - av_buffersink_get_colorspace() + - av_buffersink_get_color_range() + - av_buffersink_get_channels() + - av_buffersink_get_channel_layout() + - av_buffersink_get_sample_rate() + - av_buffersink_get_hw_frames_ctx() 2024-09-23 - xxxxxxxxxx - lavc 61.18.100 - avcodec.h Add a new flag AV_CODEC_EXPORT_DATA_ENHANCEMENTS for export_side_data. diff --git a/libavfilter/buffersink.c b/libavfilter/buffersink.c index d9cd074f17..e0c32d5f10 100644 --- a/libavfilter/buffersink.c +++ b/libavfilter/buffersink.c @@ -234,6 +234,7 @@ type av_buffersink_get_##field(const AVFilterContext *ctx) { \ } MAKE_AVFILTERLINK_ACCESSOR(enum AVMediaType , type ) +#if FF_API_BUFFERSINK_GET MAKE_AVFILTERLINK_ACCESSOR(AVRational , time_base ) MAKE_AVFILTERLINK_ACCESSOR(int , format ) @@ -244,6 +245,7 @@ MAKE_AVFILTERLINK_ACCESSOR(enum AVColorSpace, colorspace) MAKE_AVFILTERLINK_ACCESSOR(enum AVColorRange, color_range) MAKE_AVFILTERLINK_ACCESSOR(int , sample_rate ) +#endif AVRational av_buffersink_get_frame_rate(const AVFilterContext *ctx) { @@ -252,6 +254,7 @@ AVRational av_buffersink_get_frame_rate(const AVFilterContext *ctx) return l->frame_rate; } +#if FF_API_BUFFERSINK_GET AVBufferRef* av_buffersink_get_hw_frames_ctx(const AVFilterContext *ctx) { FilterLink *l = ff_filter_link(ctx->inputs[0]); @@ -277,6 +280,7 @@ int av_buffersink_get_ch_layout(const AVFilterContext *ctx, AVChannelLayout *out *out = ch_layout; return 0; } +#endif #define CHECK_LIST_SIZE(field) \ if (buf->field ## _size % sizeof(*buf->field)) { \ diff --git a/libavfilter/buffersink.h b/libavfilter/buffersink.h index 9c4468af5b..ef5aae8857 100644 --- a/libavfilter/buffersink.h +++ b/libavfilter/buffersink.h @@ -124,22 +124,39 @@ void av_buffersink_set_frame_size(AVFilterContext *ctx, unsigned frame_size); */ enum AVMediaType av_buffersink_get_type (const AVFilterContext *ctx); +AVRational av_buffersink_get_frame_rate (const AVFilterContext *ctx); + +#if FF_API_BUFFERSINK_GET +/** + * @deprecated Use av_buffersink_get_frame_flags() with AV_BUFFERSINK_FLAG_PARAMS + */ +attribute_deprecated AVRational av_buffersink_get_time_base (const AVFilterContext *ctx); +attribute_deprecated int av_buffersink_get_format (const AVFilterContext *ctx); -AVRational av_buffersink_get_frame_rate (const AVFilterContext *ctx); +attribute_deprecated int av_buffersink_get_w (const AVFilterContext *ctx); +attribute_deprecated int av_buffersink_get_h (const AVFilterContext *ctx); +attribute_deprecated AVRational av_buffersink_get_sample_aspect_ratio (const AVFilterContext *ctx); +attribute_deprecated enum AVColorSpace av_buffersink_get_colorspace (const AVFilterContext *ctx); +attribute_deprecated enum AVColorRange av_buffersink_get_color_range (const AVFilterContext *ctx); +attribute_deprecated int av_buffersink_get_channels (const AVFilterContext *ctx); +attribute_deprecated int av_buffersink_get_ch_layout (const AVFilterContext *ctx, AVChannelLayout *ch_layout); +attribute_deprecated int av_buffersink_get_sample_rate (const AVFilterContext *ctx); +attribute_deprecated AVBufferRef * av_buffersink_get_hw_frames_ctx (const AVFilterContext *ctx); +#endif /** @} */ diff --git a/libavfilter/version_major.h b/libavfilter/version_major.h index c5e660eeda..0ca3b0e358 100644 --- a/libavfilter/version_major.h +++ b/libavfilter/version_major.h @@ -36,5 +36,6 @@ */ #define FF_API_LINK_PUBLIC (LIBAVFILTER_VERSION_MAJOR < 11) +#define FF_API_BUFFERSINK_GET (LIBAVFILTER_VERSION_MAJOR < 11) #endif /* AVFILTER_VERSION_MAJOR_H */