From patchwork Tue Mar 5 16:32:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 46814 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a21:3944:b0:19e:cdac:8cce with SMTP id ac4csp517889pzc; Tue, 5 Mar 2024 08:33:19 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWx4zi9118sfdzaZuwDOEWa9t2XYahDjau1Slm5bHH6DY9eXEj3RhT5qTy87sBCxOW9UhClvTMX7HiGmR7d34LzekdFS8sfJUJvbA== X-Google-Smtp-Source: AGHT+IHMXvz/EtS+5AdSVl3RXnXCosz2WvI313G7ZjNuZmqEESdK1e0wLqj9of8noOcyJt4IeZJC X-Received: by 2002:a05:6402:3590:b0:566:fbf5:a279 with SMTP id y16-20020a056402359000b00566fbf5a279mr9256486edc.20.1709656398960; Tue, 05 Mar 2024 08:33:18 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i5-20020a50d745000000b0056601e9fbacsi5282851edj.616.2024.03.05.08.33.10; Tue, 05 Mar 2024 08:33:18 -0800 (PST) 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=@outlook.com header.s=selector1 header.b=XMyE6F6+; arc=fail (body hash mismatch); 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 2A19468CA86; Tue, 5 Mar 2024 18:33:08 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02olkn2036.outbound.protection.outlook.com [40.92.50.36]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0D72E68CA86 for ; Tue, 5 Mar 2024 18:33:02 +0200 (EET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hpE3Pnx2pbqcNlpRUvuiXAmXb+EPMfD+Ucy9lSQTLfkJxv09+1WKYe2fTE2fa8W08Tiehtjk1onQwtWpxERcdOyrFPsFOVM3wt2c6Ux/u2nJcx4gp+fEfIjQ9lKWnDNenkty0srORKXpzKiRrw3OFMeDAROkxNOt2S8ngzVdKnKPgy/HJmZzKMRB7rX0Of0nQxR5sR+dV6++Zq2V/s6ti29QEtS40MSMYggcUJR+KUNpGXaVVIVbmmKhit8+PU0Ch7BwRsYH+fhmPBoite8iqydpzXSoALcLdFXlrzVIepgPjFnC/bV8cBM6e2zMwnsWmG6AJgpgHi5R83WHg2ZfIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=lXV5VdTvHqW2h+DYOWoRLWPo7xNOxzSscT8HNttuaPg=; b=JYPnq5q5eAxQFBmgSubgK7dinzeqlErXL1Mf7Ydp/ABV7wcGCkStoc8FgbfJKh1tqZy0mPDszZ4eCQD6JdnhgPJAkwjzjNXucJxU6+mxThrKsjz6JPUhlmYs7ZG6hQnJcr2YcedUskx0E2cVB1NSJMQF7eavMXicmitfCFF5lT8IABzBzilaXwW1ocZw65IKQKd9MAxZORDsPDGN0vcAKGe8wrPzANLdistOsowwno1cj4Z6ipmGySpl4wx4kyqIIohZdCHNS8gxkeGCaxRCgBimdM9ILzUXPQfCbixn3CFR+df4S6fEHyujB4pGnKVFCyqJXadp0uL3IZKltivMGQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lXV5VdTvHqW2h+DYOWoRLWPo7xNOxzSscT8HNttuaPg=; b=XMyE6F6+Og6QCYW4kUmZZ8XtVnb1MmdOuKnUlNd+qovVN01janwpwPBx2IHSwYyXy067JDdIca/XOzljPo6qjiMt2DEdDfzcZIElQeXv0FdA8URBYWGFCtD/6OD14HYudWGILXKAo+cf203Xod4zXlF5saKLQzLF+sBtxNKUuIJQSJas/RY46oBdNiMSAACBFCTBozTUeL6SsCFEAloiUIMnzItT1lOtSb8Ec6ID+spoL6dJl9zjDiUWT9VoTuOXPyTJPqLdKmQ4Chh6s+sjmYvXO++d2nPK/4ErrhsdUXcXt+ERrdIVmchhpThylDgLt6OkZV737bm18tVhGLYuBQ== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by AS8P250MB0396.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:37f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.38; Tue, 5 Mar 2024 16:33:00 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::65aa:deb0:a18e:d48d%5]) with mapi id 15.20.7316.023; Tue, 5 Mar 2024 16:32:55 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Tue, 5 Mar 2024 17:32:48 +0100 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: X-TMN: [OuTV0a5rKreju3ATvpMf2s2sOywADFGVgbz4usHKrRo=] X-ClientProxiedBy: ZR0P278CA0206.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:6a::23) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20240305163248.2756954-1-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|AS8P250MB0396:EE_ X-MS-Office365-Filtering-Correlation-Id: d4d9b931-abf8-4d87-dfc0-08dc3d31e8c7 X-MS-Exchange-SLBlob-MailProps: obhAqMD0nT/u7zouxSzPCfDpBJ1Y2is9oYySyuiUxN0HJrJuGIVRsg07/2HigS5wHtCmxME6iLVrXZX78BmXjB5NppLhX/sbIq8xq4/h72lSl3GdYxGGsOX00wWYUwBgR0KbSgkBCYjgD5lEwuXEtfO68I88ypUlOfSCJs64MzyokZ/pzH6GHWfKiOGFga923YdRw1XqVZkDy3A9COP8LoVhahNpo5pY7SWXgqgPA6+wKtRKG/NrQjeqbiGz46FePetAtKfklswwyz62jVdtkrTBNT5bW7rTIf7MooyWt9gwMI5y5PbVlRGl0jzBZp8SuBWsAUJeTP176pZkoBYrNCQ5qX60y/nu0cNYfsIBrcF1E0X2y6eAcUsVzchUiyJ4/9XL+HcrghP6rGudJpEwvxKXaFtIzZVUnnd42AKJW6EkVpEmKFkYSdLHortveTElGj8LfhciYsqfZXrvBpLZthZPagaHcjsfM5mgbWBbB2/T/Y2kM6PS5lplT0qlSw6mSX4K7+kruJXg+81Zq0H1FhEFGIbuMhxY4LpGThXkJW5mOR3lqG7tKekx0VVBDh7pjZfDYwzmS2mugUjUzH96yPu/kJ61ic2OsWRusTwsm57cMNdUYRA8SVQjJQlKaHdMh6LV6qAVOA7tIKNFuaaTN6wZEcS8dmZUKNUv0XQvF3PGIXskeX0Qq0mRX1GotvfRmXmkIh0OmzCGzGnIL+iTH2jGIaBPPNYIL2bWcfsv1DsOgPIvmeTFMY+zg5JYb5rF/UJ4kjUA2diTkCEdT/1xhWMuZgai1phv2ah9dTMDES3uf07xXPj6eJpd6RMamBnK X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Eu2bp3Xpnwid3180w04JvSaISnfmMg5SQXGwJK64cLoWgKzxaz15ofS/7KUl570h/gpJlDMlYY8JPzs1AOBddNOU0lxxqJKbqp8gpnrjKlTjYTzTytqLe3Ftu3HXguzEERG3vHzXIEizrlkbOghEwhnommGnXZtC87oSpji6tHF+aUHAxttTyqLyrx7tMcZKhYEjydmGfX/I49A7oeVz5zihhkxY/NW1MS+qeYKwb2bCg0w6ONv/g9zrZLjCBb8stcVrO0hD6kR4Kk8MMgrryibzyYbgrEiNvSywfiyN78k4PG8UpkzwoRv04ZzNNbvKdgYNJrY/102UObKT2eIsC1R8rigI1B7i7g8hd+218w8VC8YmenBNcVQTgj9ZMcG7RbkZHmWI3RMrxGMRR0x+d5MPLxotDrl3qL1bg6siJfZwQPkAPt79/+s/UU5ZPNGEd3JERCxJW9kWQP/AmuWme1uXhr/KJYr64oOq0GthhK7upEQEv5DcgfK7Cm+j7hjNugg8vkj3AltORagVU0te3rjizRE1hUbkZPIf040kwlm+eLC2NLhOjXO3bfjJBA2aQuUYQxEeamXcla7b3uQ+ZRgiRfTOHiSuERQ6aBk7ribrshgOT2c2n++y7TDmm932pvW9PrNOs6Lj5S1XZGXaSMWFKbakhSxZ5jpGaGsYV7iklcRZbiTx2Fj7W4qY1RZm X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: vGtUuOsLs9hulGrkJcvqAIa92RpfIGtxjQbGNk1wa1BvF00PAkZnCIt9IWZeLBkpS1poCKC+erVOoXUo5Wi3gi/WoCdaOZvIjerSzG9hqGNOx6jhWu6ggpvhn8BOosJCMZjJHc6Xf4iOB/c1WIqcRalVIYvT8pVWJ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GX242xjxZA9ZvXHg+WatPEy6oc+m7GcI2uJp+1fkWLiaXwOfVt4wTSBe3+wY0d/qCJw== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: d4d9b931-abf8-4d87-dfc0-08dc3d31e8c7 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Mar 2024 16:32:54.9479 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8P250MB0396 Subject: [FFmpeg-devel] [PATCH 2/2] avcodec/vdpau: Deprecate redundandt allocators and getter/setter 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: HSOnT/tGXnCb The allocators have been superseded by av_vdpau_bind_context(). The latter have only been added "to allow multiple forks to add fields to the structure without breaking ABI" [1], but libav is no more, so this is not needed any longer. [1]: https://ffmpeg.org/pipermail/ffmpeg-devel/2013-August/146954.html Signed-off-by: Andreas Rheinhardt --- doc/APIchanges | 6 ++++++ libavcodec/vdpau.c | 6 ++++++ libavcodec/vdpau.h | 24 +++++++++++++++++++----- libavcodec/version_major.h | 1 + 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 523945e511..16098fce90 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,12 @@ The last version increases of all libraries were on 2023-02-09 API changes, most recent first: +2024-03-05 - xxxxxxxxxx - lavc 60.xx.100 - vdpau.h + Deprecate av_vdpau_alloc_context(), av_alloc_vdpaucontext(), + av_vdpau_hwaccel_get_render2() and av_vdpau_hwaccel_set_render2(). + The former are superseded by av_vdpau_bind_context(), the latter + are unneeded as the relevant field is public and can be accessed directly. + 2024-03-05 - xxxxxxxxxx - lavf 60.24.100 - avformat.h Add avformat_stream_group_name(). diff --git a/libavcodec/vdpau.c b/libavcodec/vdpau.c index c56ee1f44c..538c57f9e8 100644 --- a/libavcodec/vdpau.c +++ b/libavcodec/vdpau.c @@ -64,15 +64,19 @@ static int vdpau_error(VdpStatus status) } } +#if FF_API_VDPAU_ALLOC_GET_SET AVVDPAUContext *av_alloc_vdpaucontext(void) { +FF_DISABLE_DEPRECATION_WARNINGS return av_vdpau_alloc_context(); +FF_ENABLE_DEPRECATION_WARNINGS } #define MAKE_ACCESSORS(str, name, type, field) \ type av_##name##_get_##field(const str *s) { return s->field; } \ void av_##name##_set_##field(str *s, type v) { s->field = v; } MAKE_ACCESSORS(AVVDPAUContext, vdpau_hwaccel, AVVDPAU_Render2, render2) +#endif int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type, @@ -400,10 +404,12 @@ int ff_vdpau_add_buffer(struct vdpau_picture_context *pic_ctx, return 0; } +#if FF_API_VDPAU_ALLOC_GET_SET AVVDPAUContext *av_vdpau_alloc_context(void) { return av_mallocz(sizeof(VDPAUHWContext)); } +#endif int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device, VdpGetProcAddress *get_proc, unsigned flags) diff --git a/libavcodec/vdpau.h b/libavcodec/vdpau.h index 35c4b1096b..8021c25761 100644 --- a/libavcodec/vdpau.h +++ b/libavcodec/vdpau.h @@ -66,16 +66,14 @@ typedef int (*AVVDPAU_Render2)(struct AVCodecContext *, struct AVFrame *, /** * This structure is used to share data between the libavcodec library and * the client video application. - * The user shall allocate the structure via the av_alloc_vdpau_hwaccel - * function and make it available as - * AVCodecContext.hwaccel_context. Members can be set by the user once + * This structure will be allocated and stored in AVCodecContext.hwaccel_context + * by av_vdpau_bind_context(). Members can be set by the user once * during initialization or through each AVCodecContext.get_buffer() * function call. In any case, they must be valid prior to calling * decoding functions. * * The size of this structure is not a part of the public ABI and must not - * be used outside of libavcodec. Use av_vdpau_alloc_context() to allocate an - * AVVDPAUContext. + * be used outside of libavcodec. */ typedef struct AVVDPAUContext { /** @@ -95,15 +93,27 @@ typedef struct AVVDPAUContext { AVVDPAU_Render2 render2; } AVVDPAUContext; +#if FF_API_VDPAU_ALLOC_GET_SET /** * @brief allocation function for AVVDPAUContext * * Allows extending the struct without breaking API/ABI + * @deprecated use av_vdpau_bind_context() instead */ +attribute_deprecated AVVDPAUContext *av_alloc_vdpaucontext(void); +/** + * @deprecated render2 is public and can be accessed directly + */ +attribute_deprecated AVVDPAU_Render2 av_vdpau_hwaccel_get_render2(const AVVDPAUContext *); +/** + * @deprecated render2 is public and can be accessed directly + */ +attribute_deprecated void av_vdpau_hwaccel_set_render2(AVVDPAUContext *, AVVDPAU_Render2); +#endif /** * Associate a VDPAU device with a codec context for hardware acceleration. @@ -145,12 +155,16 @@ int av_vdpau_bind_context(AVCodecContext *avctx, VdpDevice device, int av_vdpau_get_surface_parameters(AVCodecContext *avctx, VdpChromaType *type, uint32_t *width, uint32_t *height); +#if FF_API_VDPAU_ALLOC_GET_SET /** * Allocate an AVVDPAUContext. * * @return Newly-allocated AVVDPAUContext or NULL on failure. + * @deprecated use av_vdpau_bind_context() instead */ +attribute_deprecated AVVDPAUContext *av_vdpau_alloc_context(void); +#endif /** @} */ diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h index 161442df95..9e75303ed6 100644 --- a/libavcodec/version_major.h +++ b/libavcodec/version_major.h @@ -54,6 +54,7 @@ #define FF_API_FF_PROFILE_LEVEL (LIBAVCODEC_VERSION_MAJOR < 62) #define FF_API_AVCODEC_CLOSE (LIBAVCODEC_VERSION_MAJOR < 62) #define FF_API_BUFFER_MIN_SIZE (LIBAVCODEC_VERSION_MAJOR < 62) +#define FF_API_VDPAU_ALLOC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 62) // reminder to remove CrystalHD decoders on next major bump #define FF_CODEC_CRYSTAL_HD (LIBAVCODEC_VERSION_MAJOR < 61)