[{"id":23724,"web_url":"https://patchwork.libcamera.org/comment/23724/","msgid":"<ca5e31b86073e8d1345d73065ed8134ae9ab2539.camel@collabora.com>","date":"2022-07-04T18:10:28","subject":"Re: [libcamera-devel] [PATCH v1 2/5] gstreamer: Update the obtained\n\tcolorimetry in caps.","submitter":{"id":31,"url":"https://patchwork.libcamera.org/api/people/31/","name":"Nicolas Dufresne","email":"nicolas.dufresne@collabora.com"},"content":"Le dimanche 03 juillet 2022 à 13:03 +0530, Rishikesh Donadkar a écrit :\n> Get the colorimetry as a result conversion in the previous patch and\n> update the colorimetry in the gstreamer caps.\n> \n> Signed-off-by: Rishikesh Donadkar <rishikeshdonadkar@gmail.com>\n> ---\n>  src/gstreamer/gstlibcamera-utils.cpp | 7 +++++++\n>  1 file changed, 7 insertions(+)\n> \n> diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp\n> index 20c39919..690a9f43 100644\n> --- a/src/gstreamer/gstlibcamera-utils.cpp\n> +++ b/src/gstreamer/gstlibcamera-utils.cpp\n> @@ -205,10 +205,17 @@ gst_libcamera_stream_configuration_to_caps(const StreamConfiguration &stream_cfg\n>  {\n>  \tGstCaps *caps = gst_caps_new_empty();\n>  \tGstStructure *s = bare_structure_from_format(stream_cfg.pixelFormat);\n> +\tconst gchar *colorimetry;\n> +\tstd::optional<ColorSpace> colorspace = stream_cfg.colorSpace;\n> +\tif (colorspace)\n> +\t\tcolorimetry = colorimerty_from_colorspace(colorspace);\n> +\telse\n> +\t\tcolorimetry = g_strdup(\"Unset\");\n\nAs currently implemented, colorimerty_from_colorspace() never turns null. Also,\n\"Unset\" is an invalid colorimetry value that will break the streaming. If you\nadd a way for colorspace to fail, first don't leave that silent, its likely due\nto a missing mapping, and second, simply don't set the field or set it to a\nvalid fallback.\n\n>  \n>  \tgst_structure_set(s,\n>  \t\t\t  \"width\", G_TYPE_INT, stream_cfg.size.width,\n>  \t\t\t  \"height\", G_TYPE_INT, stream_cfg.size.height,\n> +\t\t\t  \"colorimetry\", G_TYPE_STRING, colorimetry,\n>  \t\t\t  nullptr);\n>  \tgst_caps_append_structure(caps, s);\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 72007BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  4 Jul 2022 18:10:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B44526564E;\n\tMon,  4 Jul 2022 20:10:40 +0200 (CEST)","from madras.collabora.co.uk (madras.collabora.co.uk\n\t[IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 96FBB61FB1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  4 Jul 2022 20:10:38 +0200 (CEST)","from nicolas-tpx395.localdomain (mtl.collabora.ca [66.171.169.34])\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 madras.collabora.co.uk (Postfix) with ESMTPSA id 9DFB466015BF;\n\tMon,  4 Jul 2022 19:10:37 +0100 (BST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656958240;\n\tbh=h/CQY3oZEI4SaDMjgtRQ2Xyy/JznCYIfpXpd3Xm/97A=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=AGPG8Y/f3gDOL9/5/15RMg39OzjNUAHmCPoNTXzBdkhyOmpeJdFYBzXWL/787Jn9m\n\tLW60agtGeaAFGabwAfVilkOaRc3H/DH1I1NuYK6fzxs7hvVakYR4L6KKZfkfZoF758\n\tETYlXF7ZU6fseUnKzWox2UJMGD+UltlXqyzrPIa67Ij4xn6FK7lLpreeO/CV6JWFc5\n\tC219qIGMfsOj3YPgZXfi27UlO9xqBiJbV6afdF8tJotAdDBfXErJR7Y3ZojZWvmbk2\n\tQUDTvRgPKKW6dK5tbk9PBBzdZIR2A7C+DgbSaNWFZXR5+vwOjX3STZHJSHMcmvkACS\n\t7F0RHtsnBkc4w==","v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;\n\ts=mail; t=1656958238;\n\tbh=h/CQY3oZEI4SaDMjgtRQ2Xyy/JznCYIfpXpd3Xm/97A=;\n\th=Subject:From:To:Cc:Date:In-Reply-To:References:From;\n\tb=eY42ZT7rrtKqCgTPoS/F6nwY7AF8iDWDWLENPNaTUf9T1WMMuYVkCHai57H6cwSmB\n\t7Bc/jOKBvOz3PKTccSf4CMpDMznF0YgLgtsiZlRlxxkN/Xcs+QPXAtKIK+4ncJpdSK\n\tsyPVbjlbSvRPIVW546w18S7MRM577kRx1Vraa7rNQj9OJmyQp96aqVOt8Fu6Jx6Rws\n\tVXHRI2Ycmkk3NU+NTZ2r8FD57webMsNYcKW4ak2bpNgGqJ6fmdTnraTCgz/9RCDZsk\n\tqXkPVkqhxGSNBpaMbfDWw2eeHeYPomtqfvMCsK4npyvcqo7rXfMNrVugotPG96a8Js\n\tqVCMFfSj1HDKQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=collabora.com\n\theader.i=@collabora.com\n\theader.b=\"eY42ZT7r\"; dkim-atps=neutral","Message-ID":"<ca5e31b86073e8d1345d73065ed8134ae9ab2539.camel@collabora.com>","To":"Rishikesh Donadkar <rishikeshdonadkar@gmail.com>, \n\tlibcamera-devel@lists.libcamera.org","Date":"Mon, 04 Jul 2022 14:10:28 -0400","In-Reply-To":"<20220703073358.76643-2-rishikeshdonadkar@gmail.com>","References":"<20220703073358.76643-1-rishikeshdonadkar@gmail.com>\n\t<20220703073358.76643-2-rishikeshdonadkar@gmail.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","User-Agent":"Evolution 3.44.2 (3.44.2-1.fc36) ","MIME-Version":"1.0","Subject":"Re: [libcamera-devel] [PATCH v1 2/5] gstreamer: Update the obtained\n\tcolorimetry in caps.","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":"Nicolas Dufresne via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Nicolas Dufresne <nicolas.dufresne@collabora.com>","Cc":"vedantparanjape160201@gmail.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]