[{"id":26244,"web_url":"https://patchwork.libcamera.org/comment/26244/","msgid":"<edd784c6-4253-d540-9200-14a48d64a19d@ideasonboard.com>","date":"2023-01-17T07:32:52","subject":"Re: [libcamera-devel] [PATCH v3 1/2] libcamera: camera: fix\n\tvalidateColorSpaces to choose the correct \"main\" colour space","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi David,\n\nOn 1/12/23 5:40 PM, David Plowman via libcamera-devel wrote:\n> The intention is that the \"main\" colour space is the colour space of\n> the largest non-raw stream. Unfortunately the use of \"config_[i].size\"\n> is clearly incorrect, and has been copied from prior versions of the\n> code. This small change merely corrects the error.\n\nI would also document dropping of !colorspace condition, as it's vestigial.\n\n> Signed-off-by: David Plowman <david.plowman@raspberrypi.com>\n> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\n\n> ---\n>   src/libcamera/camera.cpp | 6 ++++--\n>   1 file changed, 4 insertions(+), 2 deletions(-)\n>\n> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\n> index 2d947a44..0da167a7 100644\n> --- a/src/libcamera/camera.cpp\n> +++ b/src/libcamera/camera.cpp\n> @@ -361,6 +361,7 @@ CameraConfiguration::Status CameraConfiguration::validateColorSpaces(ColorSpaceF\n>   \t * largest non-raw stream with a defined color space (if there is one).\n>   \t */\n>   \tstd::optional<ColorSpace> colorSpace;\n> +\tSize size;\n>   \n>   \tfor (auto [i, cfg] : utils::enumerate(config_)) {\n>   \t\tif (!cfg.colorSpace)\n> @@ -369,9 +370,10 @@ CameraConfiguration::Status CameraConfiguration::validateColorSpaces(ColorSpaceF\n>   \t\tif (cfg.colorSpace->adjust(cfg.pixelFormat))\n>   \t\t\tstatus = Adjusted;\n>   \n> -\t\tif (cfg.colorSpace != ColorSpace::Raw &&\n> -\t\t    (!colorSpace || cfg.size > config_[i].size))\n> +\t\tif (cfg.colorSpace != ColorSpace::Raw && cfg.size > size) {\n>   \t\t\tcolorSpace = cfg.colorSpace;\n> +\t\t\tsize = cfg.size;\n> +\t\t}\n>   \t}\n>   \n>   \tif (!colorSpace || !(flags & ColorSpaceFlag::StreamsShareColorSpace))","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 AAC67BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 17 Jan 2023 07:33:00 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E67D5625E4;\n\tTue, 17 Jan 2023 08:32:59 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 56D93603C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 17 Jan 2023 08:32:58 +0100 (CET)","from [192.168.1.103] (unknown [103.86.18.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3296A10C;\n\tTue, 17 Jan 2023 08:32:56 +0100 (CET)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1673940779;\n\tbh=5R0gSGsi74KiQaL4Dky9pqtLhSDuCcl08YpOyyD7WuQ=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=eAIu6CsH/tOADWv1q78LD5ct81En0cHkWZDkJN4ztWoMOVfOwTV6yEJwn97Rcmc4Z\n\tKmllqwnWBGFCt6lxA79ZaGdDupa241aB+4gMjTbFxmTPki/l87xZQRILEPDHkROrcE\n\t1aLWZY46S/LAEcwXBUbi9n4cs+5HSTpDhbawYLUMAm+0E2KxiXtEADN2fK48fPy7ic\n\ti87VokdIQdybwsupbPTJvYaaMToMROwJepzOx5hwD2c95XO2FecuC2C2XYKTQisemU\n\tV9Y/UzfgljmFthDG8AXt8BMvetagRJbaptSlCt0jhWmd+gQb2VYHFWHj/196XV2wuv\n\tabVwnwDNl9i1Q==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1673940777;\n\tbh=5R0gSGsi74KiQaL4Dky9pqtLhSDuCcl08YpOyyD7WuQ=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=WJBD35qqr/xlbxwcYRVBG2HDL3Lg0I52mCcKoooUjJC09/E9XCooIzUTH9bV0kvtY\n\tTaH40LM2UFW6q3bmQ+rVZWC0jAFeDjLYLO+1KW7DD4366qxO8uHyXHbeLvCdgUOJy7\n\tM1NRhLEuCqP0bZy9RS7D98sGEKIDvLrDsF97nIAs="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"WJBD35qq\"; dkim-atps=neutral","Message-ID":"<edd784c6-4253-d540-9200-14a48d64a19d@ideasonboard.com>","Date":"Tue, 17 Jan 2023 13:02:52 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.6.0","To":"David Plowman <david.plowman@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20230112121044.28003-1-david.plowman@raspberrypi.com>\n\t<20230112121044.28003-2-david.plowman@raspberrypi.com>","Content-Language":"en-US","In-Reply-To":"<20230112121044.28003-2-david.plowman@raspberrypi.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v3 1/2] libcamera: camera: fix\n\tvalidateColorSpaces to choose the correct \"main\" colour space","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>","From":"Umang Jain via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Umang Jain <umang.jain@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]