From patchwork Thu Sep 7 01:05:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 43623 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8b17:b0:149:dfde:5c0a with SMTP id l23csp297845pzh; Wed, 6 Sep 2023 18:07:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFGjDvyaI4qI61eX2W/9qa7KZ0l8fOJZv7b1o769d40L+9J6YJJTUGCKJW8LPgmHTn3zs5A X-Received: by 2002:aa7:da49:0:b0:522:40dd:74f3 with SMTP id w9-20020aa7da49000000b0052240dd74f3mr3395996eds.39.1694048826933; Wed, 06 Sep 2023 18:07:06 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id w7-20020a056402128700b0052a1d5122dasi9926578edv.331.2023.09.06.18.07.06; Wed, 06 Sep 2023 18:07:06 -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=@outlook.com header.s=selector1 header.b=dFmQSwH+; 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 9761268C85B; Thu, 7 Sep 2023 04:06:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05olkn2089.outbound.protection.outlook.com [40.92.89.89]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A3AD368C85B for ; Thu, 7 Sep 2023 04:06:03 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P0bHoNWePAIvHB9rXki1db1KpeYIatizAlbhHWCQz0rD1AEGY6q+5uruO4Db6Rs0nbu1ecgyLlyDt6eEiK7FLFyyqxxVZTo9oP2h/AjL5pw3xKQE8e4/D5treFaHyf2r+O/JPbvNDt33wbV6iZUEgpns7xET0X9xhZt3+LOvCXiFuVkEuZxE7Zfs5CDOIfw75+5n93JXMilybTOXA4LMdMQDTj1PPFCTxrpMlwK/hRLrrJZLHkcfQvLHwYN5EnTA9WIvMKkfLBVParuvE082a9NZdbgr/efa9mpTr3mWJBjqoF8qbvpvsEDVThdSeTzf5xi/h9xAfyC/Z4FsjB39Jg== 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=CIxcnUGfUiSPlduaxJKynJ3marYhLlbhVCE6s3l9nJU=; b=Po9v4qB2LbNz5ahEiqv79mOCliUc1ckJkxqMv2fJxn4D1nCcOGiUI280Dso1Xh/N/0vKa0gnGBCZm63VtduPzsaN+bPV0R7k7Claf7LQTsnuLtEqalM9RTwL9gAPsGZAv1hGuMM8apE0s/gt7mL9Wzedf4LrvVE13n9mPX6YicaKWJfBoVAhQBu2ziTAVNMhLAq5DlE+WNjvxcwSPQquf+5yDjzSErypTzg0fQaA/3v9Y/QGkV35CZ2Aqtl8RbcSGPTgrk9IGf5gxQC6t3FDoGuEIyOtS5aJsD0P2RJAfUox7c1yHPa1bLeWrDmyEtnWLHWpkHlkDX8QTnEzXl81Cw== 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=CIxcnUGfUiSPlduaxJKynJ3marYhLlbhVCE6s3l9nJU=; b=dFmQSwH+sSJwLb3Bs/6/p6/y/Zg/s8/QLWAlO2lcqKOlZZ4LD2IeOnwxH0Q1ZRQ8Vi5KchTBqOzor1r5bhzmhJdnpU5QMiQsmI04WXlJdDJhbZml14uyR08uE2/SPizZzFbxVUFS0o2/TkbTA6+CQhlyFs1G6Cbe6UPuCKSMsJqwolBNUVzzBjT3JnQcmTgbp/jP9KfAGOxEwd1JEAh33iC25QpIPxW6EUrHnvBjFdrZ7A8Z/wm0uRluU/dPwbaxCzO4UAlNuq5VTxxWL8/F8OiMiFxrraI0NJDjeKR7LgW1BLC90HlZhY+HjzauLSVqrCsDhF8PD8V29s+RoRR9Rw== Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) by DU2P250MB0025.EURP250.PROD.OUTLOOK.COM (2603:10a6:10:2b6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6745.34; Thu, 7 Sep 2023 01:06:01 +0000 Received: from AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa]) by AS8P250MB0744.EURP250.PROD.OUTLOOK.COM ([fe80::5e01:aea5:d3a8:cafa%3]) with mapi id 15.20.6745.034; Thu, 7 Sep 2023 01:06:01 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Thu, 7 Sep 2023 03:05:32 +0200 Message-ID: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: X-TMN: [j21s/wDJ2I8h7aqwdBX3z2pXs1yqBZLm] X-ClientProxiedBy: ZR0P278CA0096.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:23::11) To AS8P250MB0744.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:541::14) X-Microsoft-Original-Message-ID: <20230907010538.488975-15-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AS8P250MB0744:EE_|DU2P250MB0025:EE_ X-MS-Office365-Filtering-Correlation-Id: 4c7a59ea-3518-4b7d-da4a-08dbaf3e9a69 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ZCtxN/eRHhiWjcuctkCfpny5ZY5NJI2lWWKEi6+t5x1gwm0Z7xg52yFeFhq1NJ2vOfr37HHgXs2+JAydIXo+gvALAr4NukzAV9C+ZfG1D7Wf5flRX7RLAMa6a8hJJYAFlLkDdbMgiWCyDQEEuxjl9EFSMLHfY34SFyobTtam6+JBQpPnGuj2dzb1ZeP/hd/VfWPc1DXD1k2mxbHOo+VubXHHG9joj9RGtaW6HGNJu/0Pu4LGBPYPeRndgVE8CkN9hkPTjojAMS9aFcqKBcmX8mgt0K/LjYcr1CPjSeke+f4/gwYZdzQ2LNaWbO77bwzqhxC6xTiuvF2G1ykaFJvMj9bOHgcyhNW5KinUsQBgl61PB88nMhZmksto42/Zq5HK7Oi/Z/9Vz7ae7hd5IRE/4je/VTrQro8dl1UGT0y9DM/pc8K+THSuflNbFIOIYOuZDNhirl/yhqE6NiLsE/vrGvl3+epkAmoN6YRSd9p5MDhhLhAqHUaPe4/R6z6s8LtJq8UBq4ETh2MwWhdtOetYUnYPAWramrY2RQLXLbOUKWKKdHyoiY3KiJhEtXSDOC524g8uaxteiTQ4TVXIm4jyxBpda+BBm4yfIPNjxVbvYOkKkIz9uiHsEv7l2lix68gS X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Y/gBBA5vJLNGbCPmFr+AnRE0Rwd+C/3ZNq3RmaPbHQIvcDIlhe9T3HMkGZP1YUyG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kamTBTn8qZvQvtzZ4sTk/hs3TfcwnvqQ/ROKz5PqCaXCeW+AYqJ/hquJcBZCMGRhmVq+OQH0cnaILjlTGkurXryFndbcB7N0PLfZ4xV2ySal/MZEH7Wx3cHaO0lgFjX X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4c7a59ea-3518-4b7d-da4a-08dbaf3e9a69 X-MS-Exchange-CrossTenant-AuthSource: AS8P250MB0744.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Sep 2023 01:06:01.8615 (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: DU2P250MB0025 Subject: [FFmpeg-devel] [PATCH v2 16/22] avutil/imgutils: Constify some pointees 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: dCkCeYpeKOH8 This is done immediately without waiting for the next major bump just as in 9546b3a1cbcd94e9107f85c8f1d2175efc6cf083 and 4eaaa38d3dfb8863a62f3646a62e4098b1c078d5. Signed-off-by: Andreas Rheinhardt --- doc/APIchanges | 4 ++++ libavutil/imgutils.c | 14 +++++++------- libavutil/imgutils.h | 10 +++++----- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/doc/APIchanges b/doc/APIchanges index 963ad477bf..048232b2eb 100644 --- a/doc/APIchanges +++ b/doc/APIchanges @@ -2,6 +2,10 @@ The last version increases of all libraries were on 2023-02-09 API changes, most recent first: +2023-09-07 - xxxxxxxxxx - lavu 58.xx.100 - imgutils.h + Constify some pointees in av_image_copy(), av_image_copy_uc_from() and + av_image_fill_black(). + 2023-09-07 - xxxxxxxxxx - lavf 60.xx.100 - avio.h Constify the buffer pointees in the write_packet and write_data_type callbacks of AVIOContext. diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c index 9ab5757cf6..da3812698e 100644 --- a/libavutil/imgutils.c +++ b/libavutil/imgutils.c @@ -378,8 +378,8 @@ void av_image_copy_plane(uint8_t *dst, int dst_linesize, image_copy_plane(dst, dst_linesize, src, src_linesize, bytewidth, height); } -static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], - const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4], +static void image_copy(uint8_t *const dst_data[4], const ptrdiff_t dst_linesizes[4], + const uint8_t *const src_data[4], const ptrdiff_t src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height, void (*copy_plane)(uint8_t *, ptrdiff_t, const uint8_t *, ptrdiff_t, ptrdiff_t, int)) @@ -419,8 +419,8 @@ static void image_copy(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], } } -void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], - const uint8_t *src_data[4], const int src_linesizes[4], +void av_image_copy(uint8_t *const dst_data[4], const int dst_linesizes[4], + const uint8_t * const src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height) { ptrdiff_t dst_linesizes1[4], src_linesizes1[4]; @@ -435,8 +435,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], width, height, image_copy_plane); } -void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], - const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4], +void av_image_copy_uc_from(uint8_t * const dst_data[4], const ptrdiff_t dst_linesizes[4], + const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height) { image_copy(dst_data, dst_linesizes, src_data, src_linesizes, pix_fmt, @@ -579,7 +579,7 @@ static void memset_bytes(uint8_t *dst, size_t dst_size, uint8_t *clear, // if it's a subsampled packed format). #define MAX_BLOCK_SIZE 32 -int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4], +int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4], enum AVPixelFormat pix_fmt, enum AVColorRange range, int width, int height) { diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h index e10ac14952..91312a72d3 100644 --- a/libavutil/imgutils.h +++ b/libavutil/imgutils.h @@ -170,8 +170,8 @@ void av_image_copy_plane_uc_from(uint8_t *dst, ptrdiff_t dst_linesize, * @param width width of the image in pixels * @param height height of the image in pixels */ -void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], - const uint8_t *src_data[4], const int src_linesizes[4], +void av_image_copy(uint8_t * const dst_data[4], const int dst_linesizes[4], + const uint8_t * const src_data[4], const int src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height); /** @@ -188,8 +188,8 @@ void av_image_copy(uint8_t *dst_data[4], int dst_linesizes[4], * @note On x86, the linesizes currently need to be aligned to the cacheline * size (i.e. 64) to get improved performance. */ -void av_image_copy_uc_from(uint8_t *dst_data[4], const ptrdiff_t dst_linesizes[4], - const uint8_t *src_data[4], const ptrdiff_t src_linesizes[4], +void av_image_copy_uc_from(uint8_t * const dst_data[4], const ptrdiff_t dst_linesizes[4], + const uint8_t * const src_data[4], const ptrdiff_t src_linesizes[4], enum AVPixelFormat pix_fmt, int width, int height); /** @@ -319,7 +319,7 @@ int av_image_check_sar(unsigned int w, unsigned int h, AVRational sar); * @param height the height of the image in pixels * @return 0 if the image data was cleared, a negative AVERROR code otherwise */ -int av_image_fill_black(uint8_t *dst_data[4], const ptrdiff_t dst_linesize[4], +int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4], enum AVPixelFormat pix_fmt, enum AVColorRange range, int width, int height);