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 4671345EF3 for ; Mon, 17 Apr 2023 17:21:11 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id E8C9568BE62; Mon, 17 Apr 2023 20:21:09 +0300 (EEST) Received: from iq.passwd.hu (unknown [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4AB0268BE45 for ; Mon, 17 Apr 2023 20:21:04 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 20957E8A94 for ; Mon, 17 Apr 2023 19:20:26 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BEsGD3RE-hPn for ; Mon, 17 Apr 2023 19:20:24 +0200 (CEST) Received: from iq (iq [217.27.212.140]) by iq.passwd.hu (Postfix) with ESMTPS id 19F45E89E9 for ; Mon, 17 Apr 2023 19:20:24 +0200 (CEST) Date: Mon, 17 Apr 2023 19:20:24 +0200 (CEST) From: Marton Balint To: FFmpeg development discussions and patches In-Reply-To: <168175123922.3843.1216036854720395570@lain.khirnov.net> Message-ID: <2c5e42b3-fcad-c98-ad48-8dcfc6777846@passwd.hu> References: <20230417153408.1225-1-jamrial@gmail.com> <168175123922.3843.1216036854720395570@lain.khirnov.net> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH] avutil/frame: change the type of the crop fields to unsigned in the next major bump 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On Mon, 17 Apr 2023, Anton Khirnov wrote: > Quoting James Almer (2023-04-17 17:34:08) >> size_t is unnecessarily big on 64bit arches when width and height are ints. >> >> Signed-off-by: James Almer >> --- >> libavutil/frame.h | 7 +++++++ >> libavutil/version.h | 1 + >> 2 files changed, 8 insertions(+) >> >> diff --git a/libavutil/frame.h b/libavutil/frame.h >> index f85d630c5c..e10a1c65e3 100644 >> --- a/libavutil/frame.h >> +++ b/libavutil/frame.h >> @@ -722,10 +722,17 @@ typedef struct AVFrame { >> * the frame intended for presentation. >> * @{ >> */ >> +#if FF_API_CROP_SIZE_T >> size_t crop_top; >> size_t crop_bottom; >> size_t crop_left; >> size_t crop_right; >> +#else >> + unsigned int crop_top; >> + unsigned int crop_bottom; >> + unsigned int crop_left; >> + unsigned int crop_right; >> +#endif > > Ok, but should be mentioned in APIchanges I don't oppose this, but isn't this the same kind of change I wanted to do for frame_number which was rejected because of e.g. printf format string concerns? So based on that logic the proper way is to introduce new fields with different types and deprecate the old ones. If we want to be consistent with our API rules... Regards, Marton _______________________________________________ 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".