[{"id":35235,"web_url":"https://patchwork.libcamera.org/comment/35235/","msgid":"<5269d419b7b30fde5d2a9934a09434bb03b1fd01.camel@collabora.com>","date":"2025-07-29T16:12:39","subject":"Re: [PATCH] gstreamer: Use G_TYPE_UINT type for libcamera::Size","submitter":{"id":31,"url":"https://patchwork.libcamera.org/api/people/31/","name":"Nicolas Dufresne","email":"nicolas.dufresne@collabora.com"},"content":"Le mardi 29 juillet 2025 à 21:19 +0530, Umang Jain a écrit :\n> libcamera::Size has two components - width and height, which are of\n> unsigned integer type. Hence, use the G_TYPE_UINT for initialising\n> and setting the GValue for libcamera::Size in\n> gst_libcamera_gvalue_set_size().\n> \n> Signed-off-by: Umang Jain <uajain@igalia.com>\n> \n\nNote that in GStreamer, GstVideoInfo.width/height is gint, which have two\nbenefits, it allows having an invalid value for uninitialized structure, but the\nsecond has to do with GStreamer deserializer, which require no cast for int.\n\nI'm fine with the change, but I wanted to add some context, and the fact that\nthis will imply using cast when string from + deserializer is used. For video\nresolution, the provided range of MAX_INT was way enough.\n\nReviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\n> ---\n> Based on [PATCH v5 0/3] gstreamer: Report camera properties as device\n> properties\n> ---\n>  src/gstreamer/gstlibcamera-utils.cpp | 8 ++++----\n>  1 file changed, 4 insertions(+), 4 deletions(-)\n> \n> diff --git a/src/gstreamer/gstlibcamera-utils.cpp\n> b/src/gstreamer/gstlibcamera-utils.cpp\n> index ebc43f6c..e13ed43a 100644\n> --- a/src/gstreamer/gstlibcamera-utils.cpp\n> +++ b/src/gstreamer/gstlibcamera-utils.cpp\n> @@ -629,13 +629,13 @@ void gst_libcamera_gvalue_set_point(GValue *value, const\n> Point &point)\n>  void gst_libcamera_gvalue_set_size(GValue *value, const Size &size)\n>  {\n>  \tGValue width = G_VALUE_INIT;\n> -\tg_value_init(&width, G_TYPE_INT);\n> -\tg_value_set_int(&width, size.width);\n> +\tg_value_init(&width, G_TYPE_UINT);\n> +\tg_value_set_uint(&width, size.width);\n>  \tgst_value_array_append_and_take_value(value, &width);\n>  \n>  \tGValue height = G_VALUE_INIT;\n> -\tg_value_init(&height, G_TYPE_INT);\n> -\tg_value_set_int(&height, size.height);\n> +\tg_value_init(&height, G_TYPE_UINT);\n> +\tg_value_set_uint(&height, size.height);\n>  \tgst_value_array_append_and_take_value(value, &height);\n>  }\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 3B0E0BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 29 Jul 2025 16:12:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 358AF691E3;\n\tTue, 29 Jul 2025 18:12:43 +0200 (CEST)","from bali.collaboradmins.com (bali.collaboradmins.com\n\t[148.251.105.195])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0209269052\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 29 Jul 2025 18:12:41 +0200 (CEST)","from [IPv6:2606:6d00:11:5a76::5ac] (unknown\n\t[IPv6:2606:6d00:11:5a76::5ac])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (4096 bits))\n\t(No client certificate requested) (Authenticated sender: nicolas)\n\tby bali.collaboradmins.com (Postfix) with ESMTPSA id DBD9417E1293;\n\tTue, 29 Jul 2025 18:12:40 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=collabora.com header.i=@collabora.com\n\theader.b=\"Epskn3vM\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;\n\ts=mail; t=1753805561;\n\tbh=iX/BbK9MAK2Oc/2HuGmdkU4gPAmInfZOd/c2o0sUyX8=;\n\th=Subject:From:To:Cc:Date:In-Reply-To:References:From;\n\tb=Epskn3vMUQwh/bcb4qfF55iEjHvls8pejJeYfZTlh2TcwTYnZUUECqh30orAPiP/9\n\tPKfwW8tTQflzRnEdvfL69ddWBHXWsPTiNindpRVeDLx4MN9y12qxxhniKX69pNdYpr\n\tSxYaJQBFuHnMan6QTNPdowDHQDfPSWBYuquWUa6v3UMl0FQzooeF4Sw1QFvtD5JeSU\n\t0LV+gh79u3KZstkxv2mGyXHpSaIvZKHlebNozt8PfZ8Pstbb5uL6TF8gf0zWFqlzTQ\n\tgH4GWWwkMTyN0Lcyd51sPhgQpS6/aboSuAF9tqRtyN85HitiLlU8bdO6aSwwcs6wC9\n\tiapYk9jMXzN8w==","Message-ID":"<5269d419b7b30fde5d2a9934a09434bb03b1fd01.camel@collabora.com>","Subject":"Re: [PATCH] gstreamer: Use G_TYPE_UINT type for libcamera::Size","From":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","To":"Umang Jain <uajain@igalia.com>, libcamera-devel@lists.libcamera.org","Cc":"Jaslo Ziska <jaslo@ziska.de>","Date":"Tue, 29 Jul 2025 12:12:39 -0400","In-Reply-To":"<20250729154954.161715-1-uajain@igalia.com>","References":"<20250729154954.161715-1-uajain@igalia.com>","Autocrypt":"addr=nicolas.dufresne@collabora.com; prefer-encrypt=mutual;\n\tkeydata=mQGiBEUQN0MRBACQYceNSezSdMjx7sx6gwKkMghrrODgl3B0eXBTgNp6c431IfOOEsdvk\n\toOh1kwoYcQgbg4MXw6beOltysX4e8fFWsiRkc2nvvRW9ir9kHDm49MkBLqaDjTqOkYKNMiurFW+go\n\tzpr/lUW15QqT6v68RYe0zRdtwGZqeLzX2LVuukGwCg4AISzswrrYHNV7vQLcbaUhPgIl0D+gILYT9\n\tTJgAEK4YHW+bFRcY+cgUFoLQqQayECMlctKoLOE69nIYOc/hDr9uih1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n\tAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRBxUwItrAaoHLlxAKCYAGf4JL7DYDLs/188CPMGuwLypw\n\tCfWKc9DorA9f5pyYlD5pQo6SgSoiC0R05pY29sYXMgRHVmcmVzbmUgKEIgU2MuIEluZm9ybWF0aXF\n\t1ZSkgPG5pY29sYXMuZHVmcmVzbmVAdXNoZXJicm9va2UuY2E+iGAEExECACAFAkUQN0MCGwMGCwkI\n\tBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRBxUwItrAaoHPTnAJ0WGgJJVspoctAvEcI00mtp5WAFGgCgr\n\t+E7ItOqZEHAs+xabBgknYZIFPU=","Organization":"Collabora Canada","Content-Type":"multipart/signed; micalg=\"pgp-sha1\";\n\tprotocol=\"application/pgp-signature\"; \n\tboundary=\"=-lxk7Yl5FI1y/oXeojB/E\"","User-Agent":"Evolution 3.56.2 (3.56.2-1.fc42) ","MIME-Version":"1.0","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":35239,"web_url":"https://patchwork.libcamera.org/comment/35239/","msgid":"<abkzci6us7vpfp2gqjr3yi4wrwgtrtjxsxknybn3ilw4a4dmqw@pwnxch2qcjjc>","date":"2025-07-30T04:57:04","subject":"Re: [PATCH] gstreamer: Use G_TYPE_UINT type for libcamera::Size","submitter":{"id":232,"url":"https://patchwork.libcamera.org/api/people/232/","name":"Umang Jain","email":"uajain@igalia.com"},"content":"Hi Nicolas,\n\nThanks for the review.\n\nOn Tue, Jul 29, 2025 at 12:12:39PM -0400, Nicolas Dufresne wrote:\n> Le mardi 29 juillet 2025 à 21:19 +0530, Umang Jain a écrit :\n> > libcamera::Size has two components - width and height, which are of\n> > unsigned integer type. Hence, use the G_TYPE_UINT for initialising\n> > and setting the GValue for libcamera::Size in\n> > gst_libcamera_gvalue_set_size().\n> > \n> > Signed-off-by: Umang Jain <uajain@igalia.com>\n> > \n> \n> Note that in GStreamer, GstVideoInfo.width/height is gint, which have two\n> benefits, it allows having an invalid value for uninitialized structure, but the\n> second has to do with GStreamer deserializer, which require no cast for int.\n\nI was not aware of that, thanks for this context.\n\n> \n> I'm fine with the change, but I wanted to add some context, and the fact that\n> this will imply using cast when string from + deserializer is used. For video\n> resolution, the provided range of MAX_INT was way enough.\n\nI see that signed int usage has defined purpose in gstreamer, should we\nalign to that  here and probably consider dropping this?\n\n> \n> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> \n> > ---\n> > Based on [PATCH v5 0/3] gstreamer: Report camera properties as device\n> > properties\n> > ---\n> >  src/gstreamer/gstlibcamera-utils.cpp | 8 ++++----\n> >  1 file changed, 4 insertions(+), 4 deletions(-)\n> > \n> > diff --git a/src/gstreamer/gstlibcamera-utils.cpp\n> > b/src/gstreamer/gstlibcamera-utils.cpp\n> > index ebc43f6c..e13ed43a 100644\n> > --- a/src/gstreamer/gstlibcamera-utils.cpp\n> > +++ b/src/gstreamer/gstlibcamera-utils.cpp\n> > @@ -629,13 +629,13 @@ void gst_libcamera_gvalue_set_point(GValue *value, const\n> > Point &point)\n> >  void gst_libcamera_gvalue_set_size(GValue *value, const Size &size)\n> >  {\n> >  \tGValue width = G_VALUE_INIT;\n> > -\tg_value_init(&width, G_TYPE_INT);\n> > -\tg_value_set_int(&width, size.width);\n> > +\tg_value_init(&width, G_TYPE_UINT);\n> > +\tg_value_set_uint(&width, size.width);\n> >  \tgst_value_array_append_and_take_value(value, &width);\n> >  \n> >  \tGValue height = G_VALUE_INIT;\n> > -\tg_value_init(&height, G_TYPE_INT);\n> > -\tg_value_set_int(&height, size.height);\n> > +\tg_value_init(&height, G_TYPE_UINT);\n> > +\tg_value_set_uint(&height, size.height);\n> >  \tgst_value_array_append_and_take_value(value, &height);\n> >  }\n> >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 9640EBDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 30 Jul 2025 04:57:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6FA6F691F0;\n\tWed, 30 Jul 2025 06:57:03 +0200 (CEST)","from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7CF9361468\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 30 Jul 2025 06:57:00 +0200 (CEST)","from [49.36.71.87] (helo=uajain) by fanzine2.igalia.com with\n\tesmtpsa \n\t(Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim) id 1ugys5-005lBR-PV; Wed, 30 Jul 2025 06:56:58 +0200"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=igalia.com header.i=@igalia.com\n\theader.b=\"IyA9wbmT\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329;\n\th=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version\n\t:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=eQL+Cky7tAFLSW9LQRAJF/S/3HnZe5KpahXw51oEAcM=;\n\tb=IyA9wbmTGSHO1j55q3w/D+vuDn\n\tqpyhWg4lwmLKVNYq/aJO/QlyGtArDyKDkhzVZ7onnm8QhOECSgUZfBqTbALh7WpwAVzm3QYBdaJSN\n\tdKxxn0+4TubIa2GXygziXlNsnFDY4Mdzpnw3gqvKK93i0ooF9119md2O7alzHmoSEjDg0v3N+1HV/\n\tvjr9KWi3TpNr10U2ZyukJqpBFMPgdrZyCwK6tIsSPxvYIyD0JDSO8laCuwuD5ScLLF7G8gWnDtQ01\n\tBMVGPnD7KBN9MMUuF48Uy60bp+a7S9FDmHtc3kARMqZrBhiU3pty/moaJ2+yK4e6yySrK9m1KU86S\n\th7kWCidw==;","Date":"Wed, 30 Jul 2025 10:27:04 +0530","From":"Umang Jain <uajain@igalia.com>","To":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","Cc":"libcamera-devel@lists.libcamera.org, Jaslo Ziska <jaslo@ziska.de>","Subject":"Re: [PATCH] gstreamer: Use G_TYPE_UINT type for libcamera::Size","Message-ID":"<abkzci6us7vpfp2gqjr3yi4wrwgtrtjxsxknybn3ilw4a4dmqw@pwnxch2qcjjc>","References":"<20250729154954.161715-1-uajain@igalia.com>\n\t<5269d419b7b30fde5d2a9934a09434bb03b1fd01.camel@collabora.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<5269d419b7b30fde5d2a9934a09434bb03b1fd01.camel@collabora.com>","User-Agent":"NeoMutt/20250510-dirty","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":35246,"web_url":"https://patchwork.libcamera.org/comment/35246/","msgid":"<572ae08a5fea1a5de5760f7756a13ff5ef8e011d.camel@collabora.com>","date":"2025-07-30T12:45:55","subject":"Re: [PATCH] gstreamer: Use G_TYPE_UINT type for libcamera::Size","submitter":{"id":31,"url":"https://patchwork.libcamera.org/api/people/31/","name":"Nicolas Dufresne","email":"nicolas.dufresne@collabora.com"},"content":"Le mercredi 30 juillet 2025 à 10:27 +0530, Umang Jain a écrit :\n> Hi Nicolas,\n> \n> Thanks for the review.\n> \n> On Tue, Jul 29, 2025 at 12:12:39PM -0400, Nicolas Dufresne wrote:\n> > Le mardi 29 juillet 2025 à 21:19 +0530, Umang Jain a écrit :\n> > > libcamera::Size has two components - width and height, which are of\n> > > unsigned integer type. Hence, use the G_TYPE_UINT for initialising\n> > > and setting the GValue for libcamera::Size in\n> > > gst_libcamera_gvalue_set_size().\n> > > \n> > > Signed-off-by: Umang Jain <uajain@igalia.com>\n> > > \n> > \n> > Note that in GStreamer, GstVideoInfo.width/height is gint, which have two\n> > benefits, it allows having an invalid value for uninitialized structure, but\n> > the\n> > second has to do with GStreamer deserializer, which require no cast for int.\n> \n> I was not aware of that, thanks for this context.\n> \n> > \n> > I'm fine with the change, but I wanted to add some context, and the fact\n> > that\n> > this will imply using cast when string from + deserializer is used. For\n> > video\n> > resolution, the provided range of MAX_INT was way enough.\n> \n> I see that signed int usage has defined purpose in gstreamer, should we\n> align to that  here and probably consider dropping this?\n\nIts up to you, that helper is only used for the device properties, which are\ndevice specific, so we are free to choose.\n\n> \n> > \n> > Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> > \n> > > ---\n> > > Based on [PATCH v5 0/3] gstreamer: Report camera properties as device\n> > > properties\n> > > ---\n> > >  src/gstreamer/gstlibcamera-utils.cpp | 8 ++++----\n> > >  1 file changed, 4 insertions(+), 4 deletions(-)\n> > > \n> > > diff --git a/src/gstreamer/gstlibcamera-utils.cpp\n> > > b/src/gstreamer/gstlibcamera-utils.cpp\n> > > index ebc43f6c..e13ed43a 100644\n> > > --- a/src/gstreamer/gstlibcamera-utils.cpp\n> > > +++ b/src/gstreamer/gstlibcamera-utils.cpp\n> > > @@ -629,13 +629,13 @@ void gst_libcamera_gvalue_set_point(GValue *value,\n> > > const\n> > > Point &point)\n> > >  void gst_libcamera_gvalue_set_size(GValue *value, const Size &size)\n> > >  {\n> > >  \tGValue width = G_VALUE_INIT;\n> > > -\tg_value_init(&width, G_TYPE_INT);\n> > > -\tg_value_set_int(&width, size.width);\n> > > +\tg_value_init(&width, G_TYPE_UINT);\n> > > +\tg_value_set_uint(&width, size.width);\n> > >  \tgst_value_array_append_and_take_value(value, &width);\n> > >  \n> > >  \tGValue height = G_VALUE_INIT;\n> > > -\tg_value_init(&height, G_TYPE_INT);\n> > > -\tg_value_set_int(&height, size.height);\n> > > +\tg_value_init(&height, G_TYPE_UINT);\n> > > +\tg_value_set_uint(&height, size.height);\n> > >  \tgst_value_array_append_and_take_value(value, &height);\n> > >  }\n> > >  \n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id D841EBDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 30 Jul 2025 12:46:01 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A7522691FF;\n\tWed, 30 Jul 2025 14:46:00 +0200 (CEST)","from bali.collaboradmins.com (bali.collaboradmins.com\n\t[IPv6:2a01:4f8:201:9162::2])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E78BF691F8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 30 Jul 2025 14:45:58 +0200 (CEST)","from [IPv6:2606:6d00:11:5a76::5ac] (unknown\n\t[IPv6:2606:6d00:11:5a76::5ac])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (4096 bits)\n\tserver-digest SHA256)\n\t(No client certificate requested) (Authenticated sender: nicolas)\n\tby bali.collaboradmins.com (Postfix) with ESMTPSA id B766017E061F;\n\tWed, 30 Jul 2025 14:45:57 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=collabora.com header.i=@collabora.com\n\theader.b=\"lvKG8//k\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;\n\ts=mail; t=1753879558;\n\tbh=mt3jiLjUsEJ/2XaqGhfU/0eEsARVkveMvKE1L0uAjTU=;\n\th=Subject:From:To:Cc:Date:In-Reply-To:References:From;\n\tb=lvKG8//kxZ6bIkUuv+AuYiChcxppc44ts0BDl4bcXXiTG9uZoyEXzPiKdEWL2zeNX\n\t1k/p5SLWOmRex3WaBuStpBFaasH3XS/lDM44MYZUzrFt35Mx4IwUl5KDs1vwclqsdl\n\tznHgIJSsuSpE+3VB4QgSzy1dMlV/322NZ8fTsYP7Fql9fgCXAliAMyhKDfVeFpg+5t\n\tdPgUFWTeetfHABEYDp9YQzNmv63sZUQ/V2VxcG11Di8nkkfXeCJfRWmJfLV5GtYWtg\n\tr/sinecK/gkjvjqGDThx6Y9n9sXA4XSdt197TQWpAkYWRhWNrUidCqde8Gnu8YriaV\n\tYL8qTtBy1LMZg==","Message-ID":"<572ae08a5fea1a5de5760f7756a13ff5ef8e011d.camel@collabora.com>","Subject":"Re: [PATCH] gstreamer: Use G_TYPE_UINT type for libcamera::Size","From":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","To":"Umang Jain <uajain@igalia.com>","Cc":"libcamera-devel@lists.libcamera.org, Jaslo Ziska <jaslo@ziska.de>","Date":"Wed, 30 Jul 2025 08:45:55 -0400","In-Reply-To":"<abkzci6us7vpfp2gqjr3yi4wrwgtrtjxsxknybn3ilw4a4dmqw@pwnxch2qcjjc>","References":"<20250729154954.161715-1-uajain@igalia.com>\n\t<5269d419b7b30fde5d2a9934a09434bb03b1fd01.camel@collabora.com>\n\t<abkzci6us7vpfp2gqjr3yi4wrwgtrtjxsxknybn3ilw4a4dmqw@pwnxch2qcjjc>","Autocrypt":"addr=nicolas.dufresne@collabora.com; prefer-encrypt=mutual;\n\tkeydata=mQGiBEUQN0MRBACQYceNSezSdMjx7sx6gwKkMghrrODgl3B0eXBTgNp6c431IfOOEsdvk\n\toOh1kwoYcQgbg4MXw6beOltysX4e8fFWsiRkc2nvvRW9ir9kHDm49MkBLqaDjTqOkYKNMiurFW+go\n\tzpr/lUW15QqT6v68RYe0zRdtwGZqeLzX2LVuukGwCg4AISzswrrYHNV7vQLcbaUhPgIl0D+gILYT9\n\tTJgAEK4YHW+bFRcY+cgUFoLQqQayECMlctKoLOE69nIYOc/hDr9uih1wxrQ/yL0NJvQCohSPyoyLF\n\t9b2EuIGhQVp05XP7FzlTxhYvGO/DtO08ec85+bTfVBMV6eeY4MS3ZU+1z7ObD7Pf29YjyTehN2Dan\n\t6w1g2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R05pY29sYXMgRHVmcmVzbmUgKEIgU2MuIEluZm9ybWF0aXF\n\t1ZSkgPG5pY29sYXMuZHVmcmVzbmVAdXNoZXJicm9va2UuY2E+iGAEExECACAFAkUQN0MCGwMGCwkI\n\tBwMCBBUCCAMEFgIDAQIeAQIXgAAKCRBxUwItrAaoHPTnAJ0WGgJJVspoctAvEcI00mtp5WAFGgCgr\n\t+E7ItOqZEHAs+xabBgknYZIFPU=","Organization":"Collabora Canada","Content-Type":"multipart/signed; micalg=\"pgp-sha1\";\n\tprotocol=\"application/pgp-signature\"; \n\tboundary=\"=-grF8bsCxkyCwPRVMck7+\"","User-Agent":"Evolution 3.56.2 (3.56.2-1.fc42) ","MIME-Version":"1.0","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":35258,"web_url":"https://patchwork.libcamera.org/comment/35258/","msgid":"<bq3em2gaz4bllwejt3m3auf3wotxqbeel77ga64g37p3lpkdw4@ppjz7pogc6xm>","date":"2025-07-31T13:55:31","subject":"Re: [PATCH] gstreamer: Use G_TYPE_UINT type for libcamera::Size","submitter":{"id":232,"url":"https://patchwork.libcamera.org/api/people/232/","name":"Umang Jain","email":"uajain@igalia.com"},"content":"On Wed, Jul 30, 2025 at 08:45:55AM -0400, Nicolas Dufresne wrote:\n> Le mercredi 30 juillet 2025 à 10:27 +0530, Umang Jain a écrit :\n> > Hi Nicolas,\n> > \n> > Thanks for the review.\n> > \n> > On Tue, Jul 29, 2025 at 12:12:39PM -0400, Nicolas Dufresne wrote:\n> > > Le mardi 29 juillet 2025 à 21:19 +0530, Umang Jain a écrit :\n> > > > libcamera::Size has two components - width and height, which are of\n> > > > unsigned integer type. Hence, use the G_TYPE_UINT for initialising\n> > > > and setting the GValue for libcamera::Size in\n> > > > gst_libcamera_gvalue_set_size().\n> > > > \n> > > > Signed-off-by: Umang Jain <uajain@igalia.com>\n> > > > \n> > > \n> > > Note that in GStreamer, GstVideoInfo.width/height is gint, which have two\n> > > benefits, it allows having an invalid value for uninitialized structure, but\n> > > the\n> > > second has to do with GStreamer deserializer, which require no cast for int.\n> > \n> > I was not aware of that, thanks for this context.\n> > \n> > > \n> > > I'm fine with the change, but I wanted to add some context, and the fact\n> > > that\n> > > this will imply using cast when string from + deserializer is used. For\n> > > video\n> > > resolution, the provided range of MAX_INT was way enough.\n> > \n> > I see that signed int usage has defined purpose in gstreamer, should we\n> > align to that  here and probably consider dropping this?\n> \n> Its up to you, that helper is only used for the device properties, which are\n> device specific, so we are free to choose.\n\nIt's used for elements properties(i.e. libcamera controls) as well -\nwhere we have to set rectangles (e.g. scaler crops).\n\n> \n> > \n> > > \n> > > Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> > > \n> > > > ---\n> > > > Based on [PATCH v5 0/3] gstreamer: Report camera properties as device\n> > > > properties\n> > > > ---\n> > > >  src/gstreamer/gstlibcamera-utils.cpp | 8 ++++----\n> > > >  1 file changed, 4 insertions(+), 4 deletions(-)\n> > > > \n> > > > diff --git a/src/gstreamer/gstlibcamera-utils.cpp\n> > > > b/src/gstreamer/gstlibcamera-utils.cpp\n> > > > index ebc43f6c..e13ed43a 100644\n> > > > --- a/src/gstreamer/gstlibcamera-utils.cpp\n> > > > +++ b/src/gstreamer/gstlibcamera-utils.cpp\n> > > > @@ -629,13 +629,13 @@ void gst_libcamera_gvalue_set_point(GValue *value,\n> > > > const\n> > > > Point &point)\n> > > >  void gst_libcamera_gvalue_set_size(GValue *value, const Size &size)\n> > > >  {\n> > > >  \tGValue width = G_VALUE_INIT;\n> > > > -\tg_value_init(&width, G_TYPE_INT);\n> > > > -\tg_value_set_int(&width, size.width);\n> > > > +\tg_value_init(&width, G_TYPE_UINT);\n> > > > +\tg_value_set_uint(&width, size.width);\n> > > >  \tgst_value_array_append_and_take_value(value, &width);\n> > > >  \n> > > >  \tGValue height = G_VALUE_INIT;\n> > > > -\tg_value_init(&height, G_TYPE_INT);\n> > > > -\tg_value_set_int(&height, size.height);\n> > > > +\tg_value_init(&height, G_TYPE_UINT);\n> > > > +\tg_value_set_uint(&height, size.height);\n> > > >  \tgst_value_array_append_and_take_value(value, &height);\n> > > >  }\n> > > >  \n> >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id BEF83BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 31 Jul 2025 13:55:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9298269212;\n\tThu, 31 Jul 2025 15:55:35 +0200 (CEST)","from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F3E5669154\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 31 Jul 2025 15:55:30 +0200 (CEST)","from [49.36.71.87] (helo=uajain) by fanzine2.igalia.com with\n\tesmtpsa \n\t(Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim) id 1uhTkm-006g8s-Aj; Thu, 31 Jul 2025 15:55:28 +0200"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=igalia.com header.i=@igalia.com\n\theader.b=\"Fls4c7k8\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329;\n\th=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version\n\t:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=dYcbx/JWGb4rSfXBHe4N6jjXspC0pmb6emu9++w41Cg=;\n\tb=Fls4c7k8beCRan4Narh88HZnH6\n\t6r6Xc7/gbkI9utdZBKLTnUsxC6f7jWiPPpPkqKH6h3ZF9DtyHmt6U7/0RZuzlHitXPhKHPeiQw6yX\n\ttdwuufQZFDOGljtBNiGsDLsh9tHZLt7ZCklbPXt9RkPt+5zDhDtvYv4ss9tuTYsxBk2j06PbL67MH\n\tuJ4KG8XEfND24QRFri6gkRzJ1LvZWxps/KoDzMU5QmCIoedVsHrqCkCtcRH/T+sFgjfBTyKK5OCX1\n\tTPsSsFgxs0VSG5B0RtVwyGbYrPQ3tYtmMbIqhvpY3mkMq//p6GzfEp3YRG7K605n1QwaiXMaG40lS\n\tZ9wR5WAw==;","Date":"Thu, 31 Jul 2025 19:25:31 +0530","From":"Umang Jain <uajain@igalia.com>","To":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","Cc":"libcamera-devel@lists.libcamera.org, Jaslo Ziska <jaslo@ziska.de>","Subject":"Re: [PATCH] gstreamer: Use G_TYPE_UINT type for libcamera::Size","Message-ID":"<bq3em2gaz4bllwejt3m3auf3wotxqbeel77ga64g37p3lpkdw4@ppjz7pogc6xm>","References":"<20250729154954.161715-1-uajain@igalia.com>\n\t<5269d419b7b30fde5d2a9934a09434bb03b1fd01.camel@collabora.com>\n\t<abkzci6us7vpfp2gqjr3yi4wrwgtrtjxsxknybn3ilw4a4dmqw@pwnxch2qcjjc>\n\t<572ae08a5fea1a5de5760f7756a13ff5ef8e011d.camel@collabora.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<572ae08a5fea1a5de5760f7756a13ff5ef8e011d.camel@collabora.com>","User-Agent":"NeoMutt/20250510-dirty","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":35259,"web_url":"https://patchwork.libcamera.org/comment/35259/","msgid":"<775353322ae3e5debdeabd1ba619221913c9575a.camel@collabora.com>","date":"2025-07-31T14:19:08","subject":"Re: [PATCH] gstreamer: Use G_TYPE_UINT type for libcamera::Size","submitter":{"id":31,"url":"https://patchwork.libcamera.org/api/people/31/","name":"Nicolas Dufresne","email":"nicolas.dufresne@collabora.com"},"content":"Le jeudi 31 juillet 2025 à 19:25 +0530, Umang Jain a écrit :\n> On Wed, Jul 30, 2025 at 08:45:55AM -0400, Nicolas Dufresne wrote:\n> > Le mercredi 30 juillet 2025 à 10:27 +0530, Umang Jain a écrit :\n> > > Hi Nicolas,\n> > > \n> > > Thanks for the review.\n> > > \n> > > On Tue, Jul 29, 2025 at 12:12:39PM -0400, Nicolas Dufresne wrote:\n> > > > Le mardi 29 juillet 2025 à 21:19 +0530, Umang Jain a écrit :\n> > > > > libcamera::Size has two components - width and height, which are of\n> > > > > unsigned integer type. Hence, use the G_TYPE_UINT for initialising\n> > > > > and setting the GValue for libcamera::Size in\n> > > > > gst_libcamera_gvalue_set_size().\n> > > > > \n> > > > > Signed-off-by: Umang Jain <uajain@igalia.com>\n> > > > > \n> > > > \n> > > > Note that in GStreamer, GstVideoInfo.width/height is gint, which have\n> > > > two\n> > > > benefits, it allows having an invalid value for uninitialized structure,\n> > > > but\n> > > > the\n> > > > second has to do with GStreamer deserializer, which require no cast for\n> > > > int.\n> > > \n> > > I was not aware of that, thanks for this context.\n> > > \n> > > > \n> > > > I'm fine with the change, but I wanted to add some context, and the fact\n> > > > that\n> > > > this will imply using cast when string from + deserializer is used. For\n> > > > video\n> > > > resolution, the provided range of MAX_INT was way enough.\n> > > \n> > > I see that signed int usage has defined purpose in gstreamer, should we\n> > > align to that  here and probably consider dropping this?\n> > \n> > Its up to you, that helper is only used for the device properties, which are\n> > device specific, so we are free to choose.\n> \n> It's used for elements properties(i.e. libcamera controls) as well -\n> where we have to set rectangles (e.g. scaler crops).\n\nThen I'd drop this, since users will be very confused why they have to cast now.\n\nNicolas\n\n> \n> > \n> > > \n> > > > \n> > > > Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> > > > \n> > > > > ---\n> > > > > Based on [PATCH v5 0/3] gstreamer: Report camera properties as device\n> > > > > properties\n> > > > > ---\n> > > > >  src/gstreamer/gstlibcamera-utils.cpp | 8 ++++----\n> > > > >  1 file changed, 4 insertions(+), 4 deletions(-)\n> > > > > \n> > > > > diff --git a/src/gstreamer/gstlibcamera-utils.cpp\n> > > > > b/src/gstreamer/gstlibcamera-utils.cpp\n> > > > > index ebc43f6c..e13ed43a 100644\n> > > > > --- a/src/gstreamer/gstlibcamera-utils.cpp\n> > > > > +++ b/src/gstreamer/gstlibcamera-utils.cpp\n> > > > > @@ -629,13 +629,13 @@ void gst_libcamera_gvalue_set_point(GValue\n> > > > > *value,\n> > > > > const\n> > > > > Point &point)\n> > > > >  void gst_libcamera_gvalue_set_size(GValue *value, const Size &size)\n> > > > >  {\n> > > > >  \tGValue width = G_VALUE_INIT;\n> > > > > -\tg_value_init(&width, G_TYPE_INT);\n> > > > > -\tg_value_set_int(&width, size.width);\n> > > > > +\tg_value_init(&width, G_TYPE_UINT);\n> > > > > +\tg_value_set_uint(&width, size.width);\n> > > > >  \tgst_value_array_append_and_take_value(value, &width);\n> > > > >  \n> > > > >  \tGValue height = G_VALUE_INIT;\n> > > > > -\tg_value_init(&height, G_TYPE_INT);\n> > > > > -\tg_value_set_int(&height, size.height);\n> > > > > +\tg_value_init(&height, G_TYPE_UINT);\n> > > > > +\tg_value_set_uint(&height, size.height);\n> > > > >  \tgst_value_array_append_and_take_value(value, &height);\n> > > > >  }\n> > > > >  \n> > > \n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id A6B40BDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 31 Jul 2025 14:19:14 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CCE7869218;\n\tThu, 31 Jul 2025 16:19:13 +0200 (CEST)","from bali.collaboradmins.com (bali.collaboradmins.com\n\t[IPv6:2a01:4f8:201:9162::2])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0373169154\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 31 Jul 2025 16:19:12 +0200 (CEST)","from [IPv6:2606:6d00:11:5a76::c41] (unknown\n\t[IPv6:2606:6d00:11:5a76::c41])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\tkey-exchange X25519 server-signature RSA-PSS (4096 bits)\n\tserver-digest SHA256)\n\t(No client certificate requested) (Authenticated sender: nicolas)\n\tby bali.collaboradmins.com (Postfix) with ESMTPSA id D993D17E088C;\n\tThu, 31 Jul 2025 16:19:11 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=collabora.com header.i=@collabora.com\n\theader.b=\"lFId4/40\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;\n\ts=mail; t=1753971552;\n\tbh=ZxNKoA/SNO/SuGWBX3SGkVwkipQvz/QwWFIN/G8WIXE=;\n\th=Subject:From:To:Cc:Date:In-Reply-To:References:From;\n\tb=lFId4/40b0tIdV7GaPqMrq/nZ5NTJAAGigq11BcZ1n7Kp0gDKaEpS2eFd0t3Odwmu\n\tKFa7QAhCzI56yAxeB7VsIowpqMfqI7aKp+efhgGHX17rFnR/KX3wnHK7eu6UZyqrtg\n\toQI+gwlDlbCiLfARAPmiyKrVxfp3caEvFqgCWd2e9/HYb5mO/lhph9NKpoEMhULw3k\n\tmjbT2VoJtd9TlSHURD3sfcOSt16gW6IZLKJgdu3iSZp3+svA8l+JIwjAnkXxeZytmC\n\t+3Iaw+9yClNH3dUOigkAeluPY+wj1Ey8DZUnA3o4d2ulqyXyUaBKeDij6Yd2D2Xxuo\n\ti7rUp/RbaYsyg==","Message-ID":"<775353322ae3e5debdeabd1ba619221913c9575a.camel@collabora.com>","Subject":"Re: [PATCH] gstreamer: Use G_TYPE_UINT type for libcamera::Size","From":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","To":"Umang Jain <uajain@igalia.com>","Cc":"libcamera-devel@lists.libcamera.org, Jaslo Ziska <jaslo@ziska.de>","Date":"Thu, 31 Jul 2025 10:19:08 -0400","In-Reply-To":"<bq3em2gaz4bllwejt3m3auf3wotxqbeel77ga64g37p3lpkdw4@ppjz7pogc6xm>","References":"<20250729154954.161715-1-uajain@igalia.com>\n\t<5269d419b7b30fde5d2a9934a09434bb03b1fd01.camel@collabora.com>\n\t<abkzci6us7vpfp2gqjr3yi4wrwgtrtjxsxknybn3ilw4a4dmqw@pwnxch2qcjjc>\n\t<572ae08a5fea1a5de5760f7756a13ff5ef8e011d.camel@collabora.com>\n\t<bq3em2gaz4bllwejt3m3auf3wotxqbeel77ga64g37p3lpkdw4@ppjz7pogc6xm>","Autocrypt":"addr=nicolas.dufresne@collabora.com; prefer-encrypt=mutual;\n\tkeydata=mQGiBEUQN0MRBACQYceNSezSdMjx7sx6gwKkMghrrODgl3B0eXBTgNp6c431IfOOEsdvk\n\toOh1kwoYcQgbg4MXw6beOltysX4e8fFWsiRkc2nvvRW9ir9kHDm49MkBLqaDjTqOkYKNMiurFW+go\n\tzpr/lUW15QqT6v68RYe0zRdtwGZqeLzX2LVuukGwCg4AISzswrrYHNV7vQLcbaUhPgIl0D+gILYT9\n\tTJgAEK4YHW+bFRcY+cgUFoLQqQayECMlctKoLOE69nIYOc/hDr9uih1wxrQ/yL0NJvQCohSPyoyLF\n\t9b2EuIGhQVp05XP7FzlTxhYvGO/DtO08ec85+bTfVBMV6eeY4MS3ZU+1z7ObD7Pf29YjyTehN2Dan\n\t6w1g2rBk5MoA/9nDocSlk4pbFpsYSFmVHsDiAOFje3+iY4ftVDKunKYWMhwRVBjAREOByBagmRau0\n\tcLEcElpf4hX5f978GoxSGIsiKoDAlXX+ICDOWC1/EXhEEmBR1gL0QJgiVviNyLfGJlZWnPjw6xhhm\n\ttHYWTDxBOP5peztyc2PqeKsLsLWzAr7QnTmljb2xhcyBEdWZyZXNuZSA8bmljb2xhc0BuZHVmcmVz\n\tbmUuY2E+iGIEExECACIFAlXA3CACGwMGCwkIBwMCBhUI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p-sha1\";\n\tprotocol=\"application/pgp-signature\"; \n\tboundary=\"=-20hu5uxvDQTcVnqmLHpx\"","User-Agent":"Evolution 3.56.2 (3.56.2-1.fc42) ","MIME-Version":"1.0","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":35260,"web_url":"https://patchwork.libcamera.org/comment/35260/","msgid":"<nuzoojqawzvbiw6qcbysvlkiseujzvtvlnzwmsgaspw2qgmhfe@q7vjg4hchyr4>","date":"2025-07-31T15:00:58","subject":"Re: [PATCH] gstreamer: Use G_TYPE_UINT type for libcamera::Size","submitter":{"id":232,"url":"https://patchwork.libcamera.org/api/people/232/","name":"Umang Jain","email":"uajain@igalia.com"},"content":"On Thu, Jul 31, 2025 at 10:19:08AM -0400, Nicolas Dufresne wrote:\n> Le jeudi 31 juillet 2025 à 19:25 +0530, Umang Jain a écrit :\n> > On Wed, Jul 30, 2025 at 08:45:55AM -0400, Nicolas Dufresne wrote:\n> > > Le mercredi 30 juillet 2025 à 10:27 +0530, Umang Jain a écrit :\n> > > > Hi Nicolas,\n> > > > \n> > > > Thanks for the review.\n> > > > \n> > > > On Tue, Jul 29, 2025 at 12:12:39PM -0400, Nicolas Dufresne wrote:\n> > > > > Le mardi 29 juillet 2025 à 21:19 +0530, Umang Jain a écrit :\n> > > > > > libcamera::Size has two components - width and height, which are of\n> > > > > > unsigned integer type. Hence, use the G_TYPE_UINT for initialising\n> > > > > > and setting the GValue for libcamera::Size in\n> > > > > > gst_libcamera_gvalue_set_size().\n> > > > > > \n> > > > > > Signed-off-by: Umang Jain <uajain@igalia.com>\n> > > > > > \n> > > > > \n> > > > > Note that in GStreamer, GstVideoInfo.width/height is gint, which have\n> > > > > two\n> > > > > benefits, it allows having an invalid value for uninitialized structure,\n> > > > > but\n> > > > > the\n> > > > > second has to do with GStreamer deserializer, which require no cast for\n> > > > > int.\n> > > > \n> > > > I was not aware of that, thanks for this context.\n> > > > \n> > > > > \n> > > > > I'm fine with the change, but I wanted to add some context, and the fact\n> > > > > that\n> > > > > this will imply using cast when string from + deserializer is used. For\n> > > > > video\n> > > > > resolution, the provided range of MAX_INT was way enough.\n> > > > \n> > > > I see that signed int usage has defined purpose in gstreamer, should we\n> > > > align to that  here and probably consider dropping this?\n> > > \n> > > Its up to you, that helper is only used for the device properties, which are\n> > > device specific, so we are free to choose.\n> > \n> > It's used for elements properties(i.e. libcamera controls) as well -\n> > where we have to set rectangles (e.g. scaler crops).\n> \n> Then I'd drop this, since users will be very confused why they have to cast now.\n> \n\nack, thanks for the discussion!\n\n> Nicolas\n> \n> > \n> > > \n> > > > \n> > > > > \n> > > > > Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n> > > > > \n> > > > > > ---\n> > > > > > Based on [PATCH v5 0/3] gstreamer: Report camera properties as device\n> > > > > > properties\n> > > > > > ---\n> > > > > >  src/gstreamer/gstlibcamera-utils.cpp | 8 ++++----\n> > > > > >  1 file changed, 4 insertions(+), 4 deletions(-)\n> > > > > > \n> > > > > > diff --git a/src/gstreamer/gstlibcamera-utils.cpp\n> > > > > > b/src/gstreamer/gstlibcamera-utils.cpp\n> > > > > > index ebc43f6c..e13ed43a 100644\n> > > > > > --- a/src/gstreamer/gstlibcamera-utils.cpp\n> > > > > > +++ b/src/gstreamer/gstlibcamera-utils.cpp\n> > > > > > @@ -629,13 +629,13 @@ void gst_libcamera_gvalue_set_point(GValue\n> > > > > > *value,\n> > > > > > const\n> > > > > > Point &point)\n> > > > > >  void gst_libcamera_gvalue_set_size(GValue *value, const Size &size)\n> > > > > >  {\n> > > > > >  \tGValue width = G_VALUE_INIT;\n> > > > > > -\tg_value_init(&width, G_TYPE_INT);\n> > > > > > -\tg_value_set_int(&width, size.width);\n> > > > > > +\tg_value_init(&width, G_TYPE_UINT);\n> > > > > > +\tg_value_set_uint(&width, size.width);\n> > > > > >  \tgst_value_array_append_and_take_value(value, &width);\n> > > > > >  \n> > > > > >  \tGValue height = G_VALUE_INIT;\n> > > > > > -\tg_value_init(&height, G_TYPE_INT);\n> > > > > > -\tg_value_set_int(&height, size.height);\n> > > > > > +\tg_value_init(&height, G_TYPE_UINT);\n> > > > > > +\tg_value_set_uint(&height, size.height);\n> > > > > >  \tgst_value_array_append_and_take_value(value, &height);\n> > > > > >  }\n> > > > > >  \n> > > > \n> >","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 78D2ABDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 31 Jul 2025 15:00:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1985C6921A;\n\tThu, 31 Jul 2025 17:00:55 +0200 (CEST)","from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5377169154\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 31 Jul 2025 17:00:52 +0200 (CEST)","from [49.36.71.87] (helo=uajain) by fanzine2.igalia.com with\n\tesmtpsa \n\t(Cipher TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)\n\t(Exim) id 1uhUm3-006iD0-5m; Thu, 31 Jul 2025 17:00:51 +0200"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=igalia.com header.i=@igalia.com\n\theader.b=\"hIe40ZLx\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com;\n\ts=20170329;\n\th=In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version\n\t:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=cYMezwNrfRVHBxijo85k0X9fWQlwDqunim0Mdq5ikRM=;\n\tb=hIe40ZLx9YxnSeu6qVJpkG0peU\n\trJMI51nlS7C+GnPS8UDi3aYrMGd/0szm9ScqGNabV8d6/+W90vDiL/a8YCyKIb0wd+M1LtqwtEEPa\n\tyk3lEpp01dtKBmc9+/PItGZxNueCij+fKtAtBf0LiDypfQDJQgFsdQU+VSe49Lqi+JLKxGYvrbCqs\n\t3Nv5ugIEq6ddPX0yYlvtTVFoYGXwKo0OzHqH/nNS0PUtQ6GkP6doD/DdGxIoN28Auw/SMtUfh9kP+\n\tF42qDIKD0sub0b2C6CoSvup/p6/CX8GogrZvhXyVw8RtUj4Ff8az8dFKswZBWu2EG91MXF+77j52O\n\tQgmHyvyA==;","Date":"Thu, 31 Jul 2025 20:30:58 +0530","From":"Umang Jain <uajain@igalia.com>","To":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","Cc":"libcamera-devel@lists.libcamera.org, Jaslo Ziska <jaslo@ziska.de>","Subject":"Re: [PATCH] gstreamer: Use G_TYPE_UINT type for libcamera::Size","Message-ID":"<nuzoojqawzvbiw6qcbysvlkiseujzvtvlnzwmsgaspw2qgmhfe@q7vjg4hchyr4>","References":"<20250729154954.161715-1-uajain@igalia.com>\n\t<5269d419b7b30fde5d2a9934a09434bb03b1fd01.camel@collabora.com>\n\t<abkzci6us7vpfp2gqjr3yi4wrwgtrtjxsxknybn3ilw4a4dmqw@pwnxch2qcjjc>\n\t<572ae08a5fea1a5de5760f7756a13ff5ef8e011d.camel@collabora.com>\n\t<bq3em2gaz4bllwejt3m3auf3wotxqbeel77ga64g37p3lpkdw4@ppjz7pogc6xm>\n\t<775353322ae3e5debdeabd1ba619221913c9575a.camel@collabora.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<775353322ae3e5debdeabd1ba619221913c9575a.camel@collabora.com>","User-Agent":"NeoMutt/20250510-dirty","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]