[{"id":23785,"web_url":"https://patchwork.libcamera.org/comment/23785/","msgid":"<CACGrz-M4HwJ_nPXohbhViuMAFPptnpMx161BuiGyKPj4YdauMw@mail.gmail.com>","date":"2022-07-07T11:51:15","subject":"Re: [libcamera-devel] [PATCH v2 2/4] gstreamer: Update the obtained\n\tcolorimetry in caps.","submitter":{"id":85,"url":"https://patchwork.libcamera.org/api/people/85/","name":"Vedant Paranjape","email":"vedantparanjape160201@gmail.com"},"content":"Hello Rishikesh,\n\nThanks for the patch,\n\nOn Thu, Jul 7, 2022 at 11:45 AM Rishikesh Donadkar\n<rishikeshdonadkar@gmail.com> wrote:\n>\n> If the colorspace is set in the StreamConfiguration, get the colorimetry as\n> a result of conversion from the previous patch and update it into the caps.\n\nthis sounds better:\n\nget the colorimetry after converting colorspace using functions\nfrom the previous patch and update it into the GStreamer caps.\n\n>\n> If the colorimetry corresponding to the colorspace set in the\n> StreamConfiguration is not available in GStreamer set the colorimetry\n> field to nullptr in the caps (this will fail the negotiation).\n>\n> Signed-off-by: Rishikesh Donadkar <rishikeshdonadkar@gmail.com>\n> ---\n>  src/gstreamer/gstlibcamera-utils.cpp | 15 +++++++++++++++\n>  1 file changed, 15 insertions(+)\n>\n> diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp\n> index 60ac8c8e..eb9c49da 100644\n> --- a/src/gstreamer/gstlibcamera-utils.cpp\n> +++ b/src/gstreamer/gstlibcamera-utils.cpp\n> @@ -166,11 +166,26 @@ gst_libcamera_stream_configuration_to_caps(const StreamConfiguration &stream_cfg\n>  {\n>         GstCaps *caps = gst_caps_new_empty();\n>         GstStructure *s = bare_structure_from_format(stream_cfg.pixelFormat);\n> +       gchar *colorimetry = nullptr;\n> +       std::optional<ColorSpace> colorspace = stream_cfg.colorSpace;\n>\n>         gst_structure_set(s,\n>                           \"width\", G_TYPE_INT, stream_cfg.size.width,\n>                           \"height\", G_TYPE_INT, stream_cfg.size.height,\n>                           nullptr);\n> +\n> +       if (colorspace) {\n\nYou might want to use\n\n> colorspace.has_value()\n\nEven though it's one and the same, this seems more verbose. Just a\npersonal preference, anyone has comments about this ?\n\n> +               colorimetry = colorimerty_from_colorspace(colorspace);\n> +               if (colorimetry) {\n> +                       gst_structure_set(s, \"colorimetry\", G_TYPE_STRING, colorimetry, nullptr);\n> +               } else {\n> +                       gst_structure_set(s, \"colorimetry\", G_TYPE_STRING, nullptr, nullptr);\n> +                       g_free(colorimetry);\n> +               }\n> +       } else {\n> +               g_free(colorimetry);\n> +       }\n> +\n\nThis if-else block can be further simplified as follows:\n\n<snip>\nif (colorspace) {\n    colorimetry = colorimerty_from_colorspace(colorspace);\n    gst_structure_set(s, \"colorimetry\", G_TYPE_STRING, colorimetry, nullptr);\n    g_free(colorimetry);\n}\n</snip>\n\nRegards,\nVedant Paranjape\n\n\n+\n+       if (colorspace) {\n+               colorimetry = colorimerty_from_colorspace(co\nlorspace);\n+               if (colorimetry) {\n+                       gst_structure_set(s, \"colorimetry\",\nG_TYPE_STRING, colorimetry, nullptr);\n+               } else {\n+                       gst_structure_set(s, \"colorimetry\",\nG_TYPE_STRING, nullptr, nullptr);\n+                       g_free(colorimetry);\n+               }\n+       } else {\n+               g_free(colorimetry);\n+       }\n+\n\n>         gst_caps_append_structure(caps, s);\n>\n>         return caps;\n> --\n> 2.25.1\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 D793CBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  7 Jul 2022 11:51:29 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3C6FE60400;\n\tThu,  7 Jul 2022 13:51:29 +0200 (CEST)","from mail-yb1-xb2e.google.com (mail-yb1-xb2e.google.com\n\t[IPv6:2607:f8b0:4864:20::b2e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2873260400\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  7 Jul 2022 13:51:28 +0200 (CEST)","by mail-yb1-xb2e.google.com with SMTP id 6so3155759ybc.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 07 Jul 2022 04:51:28 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1657194689;\n\tbh=NJoebP0hlltG7IhvuiROKepR9wwxPuCQ6JmAuYdCxHo=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=DnchQJH6L5j9/ArIlMUjhvPSvkd/OtDEAPPbPvs9OVdtFeRejBNHbPDfhq8zlDpww\n\tJSd1aQk7ZfhL4PNMiBdRImgjU5mmr9pmxe0zFCHgPMadtTSfAWFx7GrwMoFvVvjeNF\n\tQdQ3IEQ/bjgekQMQbxrX453LWs7QGXcIkl38s180037Eoj8lP2752MQfR81HUNz+ow\n\tVjGTsQhM28X6B2oMJkI2dcj6csZnaXmHRbXxHJ0fsqUpSadC0qlREDHDa0n5g4u3Vt\n\t+Qox1PropkH/FfZw12iyiCL7jV16GfHT2smMxNy6sBzO1KciSETRJ8AiJNtVXV9J+N\n\tflCQwJEIQ6rTQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=v/9GxkgxIXp/MM9uadc4Bv5CooBic7nYHejA+nRyjJg=;\n\tb=EZNF+pYbZfz+Z53jSNvHh+5UpfRMQjt1zMTuVNlFhhtEG7SksVEi+3A/R4OPGtxLbM\n\trmShdXlbWu/EOe5fMrcjMIUt9E58Y6S9WRCbDywqTAqjNQ1fdL1YrRjYKYeS/HKXf8s6\n\tDrNthOxw4amCTmUI+SNPpFNVcz2/kHcNqHgF9ZOJ1f6lyL7qIPQEW4P+hbdcgem65SQ3\n\t8YbH3wa+nmkzjYNDQUsUsmfyYbECF/685USNdZkpdnPBf4IbOGX597/xEES2gXpyAFio\n\tpCEJuQmLYRPvB5bdLSTnKDS6MHmfNuuHyNydg7NzH98F+zsE5Nguo/N4BwTUOojQdViD\n\tcsBQ=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"EZNF+pYb\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=v/9GxkgxIXp/MM9uadc4Bv5CooBic7nYHejA+nRyjJg=;\n\tb=sGYGAou7hT1nQmJ4r0C3Beim8zyHvJmKnmNGDSbpHKTmNIB948kBJLa97uwDOfMABG\n\tUyB5orv16x8hSAp2RH+DNlhrQWZEM8c8JvS9a3NlPux6fhMu7NsFgBQ0EhtbH1cc+jLz\n\tytV/WHGx8bM4/aR8HojH39ADEiOZcQbSklSA2/e6d1gJ8Xw3/1alr4a81uCuDnrR6PCC\n\t5FE799d/jzcAk3PECX5D/rxQHiKO8ZwKYJlh5QnDNW/5dQEobpBKtpyBQgjxPTQxJzYO\n\teP61BdLfzuhbOp8qi7I4S+8OtVmBk09qJ/94v12jPGmsg/B2iJUwz7/zX5DuWCuqySWI\n\t1Pxw==","X-Gm-Message-State":"AJIora95GF2dF+TVa5CUNjsuCg5fSGeCAMQaXfncaSbZ2KnsslnSQk4a\n\tAzUMy46TDomfthNT4mzqYsct5Gf0FSrZ3724T33emgyhpgs=","X-Google-Smtp-Source":"AGRyM1uZS7gQ3xtb1rKtZ2LdZ8iAq0eguMz8694Djd29ZJytgLcT110zm4o/E2YTo1uVgl11bK0dugOtPAYRi1VfJfo=","X-Received":"by 2002:a05:6902:1544:b0:66e:756a:b3fb with SMTP id\n\tr4-20020a056902154400b0066e756ab3fbmr14978737ybu.557.1657194686796;\n\tThu, 07 Jul 2022 04:51:26 -0700 (PDT)","MIME-Version":"1.0","References":"<20220707094402.28730-1-rishikeshdonadkar@gmail.com>\n\t<20220707094402.28730-3-rishikeshdonadkar@gmail.com>","In-Reply-To":"<20220707094402.28730-3-rishikeshdonadkar@gmail.com>","Date":"Thu, 7 Jul 2022 13:51:15 +0200","Message-ID":"<CACGrz-M4HwJ_nPXohbhViuMAFPptnpMx161BuiGyKPj4YdauMw@mail.gmail.com>","To":"Rishikesh Donadkar <rishikeshdonadkar@gmail.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v2 2/4] 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":"Vedant Paranjape via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>,\n\tNicolas Dufresne <nicolas.dufresne@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23789,"web_url":"https://patchwork.libcamera.org/comment/23789/","msgid":"<CACGrz-N8MEVwzrKbdT0dZb2cvOcgOhU1nQ3vmmVrfj2pxT9N5g@mail.gmail.com>","date":"2022-07-07T12:17:18","subject":"Re: [libcamera-devel] [PATCH v2 2/4] gstreamer: Update the obtained\n\tcolorimetry in caps.","submitter":{"id":85,"url":"https://patchwork.libcamera.org/api/people/85/","name":"Vedant Paranjape","email":"vedantparanjape160201@gmail.com"},"content":"Hello Rishikesh,\n\nOn Thu, Jul 7, 2022 at 11:45 AM Rishikesh Donadkar\n<rishikeshdonadkar@gmail.com> wrote:\n>\n> If the colorspace is set in the StreamConfiguration, get the colorimetry as\n> a result of conversion from the previous patch and update it into the caps.\n>\n> If the colorimetry corresponding to the colorspace set in the\n> StreamConfiguration is not available in GStreamer set the colorimetry\n> field to nullptr in the caps (this will fail the negotiation).\n>\n> Signed-off-by: Rishikesh Donadkar <rishikeshdonadkar@gmail.com>\n> ---\n>  src/gstreamer/gstlibcamera-utils.cpp | 15 +++++++++++++++\n>  1 file changed, 15 insertions(+)\n>\n> diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp\n> index 60ac8c8e..eb9c49da 100644\n> --- a/src/gstreamer/gstlibcamera-utils.cpp\n> +++ b/src/gstreamer/gstlibcamera-utils.cpp\n> @@ -166,11 +166,26 @@ gst_libcamera_stream_configuration_to_caps(const StreamConfiguration &stream_cfg\n>  {\n>         GstCaps *caps = gst_caps_new_empty();\n>         GstStructure *s = bare_structure_from_format(stream_cfg.pixelFormat);\n> +       gchar *colorimetry = nullptr;\n> +       std::optional<ColorSpace> colorspace = stream_cfg.colorSpace;\n>\n>         gst_structure_set(s,\n>                           \"width\", G_TYPE_INT, stream_cfg.size.width,\n>                           \"height\", G_TYPE_INT, stream_cfg.size.height,\n>                           nullptr);\n> +\n> +       if (colorspace) {\n> +               colorimetry = colorimerty_from_colorspace(colorspace);\n\ns/colorimerty_from_colorspace/colorimetry_from_colorspace\n\n> +               if (colorimetry) {\n> +                       gst_structure_set(s, \"colorimetry\", G_TYPE_STRING, colorimetry, nullptr);\n> +               } else {\n> +                       gst_structure_set(s, \"colorimetry\", G_TYPE_STRING, nullptr, nullptr);\n> +                       g_free(colorimetry);\n> +               }\n> +       } else {\n> +               g_free(colorimetry);\n> +       }\n> +\n>         gst_caps_append_structure(caps, s);\n>\n>         return caps;\n> --\n> 2.25.1\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 A0E1EBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  7 Jul 2022 12:17:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 561BA6048D;\n\tThu,  7 Jul 2022 14:17:32 +0200 (CEST)","from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com\n\t[IPv6:2607:f8b0:4864:20::b33])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EDB8F60400\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  7 Jul 2022 14:17:30 +0200 (CEST)","by mail-yb1-xb33.google.com with SMTP id i7so32171566ybe.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 07 Jul 2022 05:17:30 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1657196252;\n\tbh=oEVKNRl/woXwEJNlrs6mGnYJaxNziphgD2Q+owGtw0M=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=eLnFs2CIobzd5Yj96rFgJb5CvHpnfanKYx2aJkBxhF1ZDhNYLb6FcSJOUTdDNheHC\n\tkuLDhDLrTCj6xU7wMvsVBgtM6HRVkmTYUKHTsrFUPmNfCcLsSws82nFp/f8Lz2nFpm\n\tm0/749Xub+NDLha1Au+h2J65XCFCaC00d83vj8PxHEJA738QD5fjZOyDnUhVoMShL3\n\tqKtU6Gk88WTEbUJrkob6ZhB7fs33VFdR6EvF7c6hG4WayHBECe34rItTCcc9RLAwm1\n\tdlKqRyBaDyqsnlZvHdBoLbCRY2Vt9oo6bJMvhOf2noeYHlGIhWFGbaS9k9ddytkx+z\n\tKHSCX6m9j8umw==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=H2IAc07dupyRuhZUzIyBGwIQ6MPDsM2ygKAmVrNfrsI=;\n\tb=fYWtOlZ3svMZ4T/5+iemFjd/2aT2WC/KoiaEiNbXibNaDx2njXvW72pp5AWfKEiK+7\n\teBzlrT1Q4jn45a1FML2cvsUa4j7umpscNuYpfNZY+mflUyNQWxXW30h1YhnZIHf2+Eju\n\tk86tbf1PpUtF12Q7nCPYd64NuM8XMqFQu4l96TO8u9yNJ3aIv9WWBMvP0bJmS9uauxoy\n\tzDmt7YT2IcpsAvoU+iaR3mdYLVRTUYEv2quH+KgZx8ggtytkM2wl6ni2pdlMgDT9eOJY\n\tokcUpupHfE404yy2Nkn98kD4S3TjG3Me3Hjs0zvHcXW7OJKNmgzx5sMUCmFFJBMd8ym5\n\tbfMw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"fYWtOlZ3\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=H2IAc07dupyRuhZUzIyBGwIQ6MPDsM2ygKAmVrNfrsI=;\n\tb=vipkM27UrUp17CwviV3tt/c6C4y5VT9eGrhGnESc3poxKwI5yqkDFXMAicUoNvvKTh\n\t5QciE8B8VpwkOQS1UGUgrt1MRh0CTyayyLgr/PyxMNrefNNYOH+BwWT8k29hGHc5yioi\n\tQU28DA4Kj7O0xr6bj6J0GlFjCOPibtO7w1hsn1u9PsVx7b3jwNpuzgBAItjbN7oeITAB\n\tXmVqZhSYgnEA1NsKGrkA1xm8ZhSxiHmhbCzSqrY2sDQ6k9tK8x6UdM294fqgkFVh6+NW\n\tw4BHX0Z5Rt+F+CbNcBHBKBTDkTZbb6bCiq+V9bvTjsSUar+kPEHjHKSCBVtI6ipWH/74\n\tmNOw==","X-Gm-Message-State":"AJIora8nIV2Gv3jCB8uOMHc2VuNkpcnenlXRs7KE/XiA0DcyDJhAwiXT\n\t29NjUvPN3mDWbd89kGdqeAlcoLMZGcKmcsSr0yU=","X-Google-Smtp-Source":"AGRyM1vh1M63b05WNnMcZw9UC9JdbOLCbrwWXff91ToV7q7euu4hnvMpdHqCDdREW3uJYsSMD1U75QRbizbWwuOsQG0=","X-Received":"by 2002:a05:6902:1c6:b0:663:e9d8:3a73 with SMTP id\n\tu6-20020a05690201c600b00663e9d83a73mr47162024ybh.567.1657196249914;\n\tThu, 07 Jul 2022 05:17:29 -0700 (PDT)","MIME-Version":"1.0","References":"<20220707094402.28730-1-rishikeshdonadkar@gmail.com>\n\t<20220707094402.28730-3-rishikeshdonadkar@gmail.com>","In-Reply-To":"<20220707094402.28730-3-rishikeshdonadkar@gmail.com>","Date":"Thu, 7 Jul 2022 14:17:18 +0200","Message-ID":"<CACGrz-N8MEVwzrKbdT0dZb2cvOcgOhU1nQ3vmmVrfj2pxT9N5g@mail.gmail.com>","To":"Rishikesh Donadkar <rishikeshdonadkar@gmail.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v2 2/4] 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":"Vedant Paranjape via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Vedant Paranjape <vedantparanjape160201@gmail.com>","Cc":"LibCamera Devel <libcamera-devel@lists.libcamera.org>,\n\tNicolas Dufresne <nicolas.dufresne@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":23794,"web_url":"https://patchwork.libcamera.org/comment/23794/","msgid":"<c0cc78c49dfb36965b91f357f730fb88cbe252bc.camel@collabora.com>","date":"2022-07-07T14:02:36","subject":"Re: [libcamera-devel] [PATCH v2 2/4] 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 jeudi 07 juillet 2022 à 15:14 +0530, Rishikesh Donadkar via libcamera-devel a\nécrit :\n> If the colorspace is set in the StreamConfiguration, get the colorimetry as\n> a result of conversion from the previous patch and update it into the caps.\n> \n> If the colorimetry corresponding to the colorspace set in the\n> StreamConfiguration is not available in GStreamer set the colorimetry\n> field to nullptr in the caps (this will fail the negotiation).\n> \n> Signed-off-by: Rishikesh Donadkar <rishikeshdonadkar@gmail.com>\n> ---\n>  src/gstreamer/gstlibcamera-utils.cpp | 15 +++++++++++++++\n>  1 file changed, 15 insertions(+)\n> \n> diff --git a/src/gstreamer/gstlibcamera-utils.cpp b/src/gstreamer/gstlibcamera-utils.cpp\n> index 60ac8c8e..eb9c49da 100644\n> --- a/src/gstreamer/gstlibcamera-utils.cpp\n> +++ b/src/gstreamer/gstlibcamera-utils.cpp\n> @@ -166,11 +166,26 @@ 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> +\tgchar *colorimetry = nullptr;\n> +\tstd::optional<ColorSpace> colorspace = stream_cfg.colorSpace;\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  nullptr);\n> +\n> +\tif (colorspace) {\n> +\t\tcolorimetry = colorimerty_from_colorspace(colorspace);\n> +\t\tif (colorimetry) {\n> +\t\t\tgst_structure_set(s, \"colorimetry\", G_TYPE_STRING, colorimetry, nullptr);\n> +\t\t} else {\n> +\t\t\tgst_structure_set(s, \"colorimetry\", G_TYPE_STRING, nullptr, nullptr);\n> +\t\t\tg_free(colorimetry);\n\nSetting a string field as null is not allowed in gstreamer and will cause\nassertion later. If you don't know the colorspace/colorimetry, don't set that\nfield. If the field is there but unfixed, remove it.\n\n> +\t\t}\n> +\t} else {\n> +\t\tg_free(colorimetry);\n> +\t}\n> +\n>  \tgst_caps_append_structure(caps, s);\n>  \n>  \treturn caps;","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 0D4D1BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  7 Jul 2022 14:02:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B61FB6330E;\n\tThu,  7 Jul 2022 16:02:46 +0200 (CEST)","from madras.collabora.co.uk (madras.collabora.co.uk\n\t[46.235.227.172])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 019BC60400\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  7 Jul 2022 16:02:46 +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\tserver-digest SHA256)\n\t(No client certificate requested) (Authenticated sender: nicolas)\n\tby madras.collabora.co.uk (Postfix) with ESMTPSA id 5813966019AA;\n\tThu,  7 Jul 2022 15:02:45 +0100 (BST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1657202566;\n\tbh=LIHLqdL1J0wAs4oUKwTT/ebRl1Y4PixJ6ABBJOyMvso=;\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=b8F9kghQx6HsFGQsV6HLrF5mdiCkewjEb+WkkZ2ykjxMbzlxpFB5qWYjuXhwhGbyD\n\tHts3ZS2c2PVyEL5uJS9blSSzaad3XnDsirw12QYUfloaq30RwAgZCRvwJzepFzSfBv\n\tpnvNngZfGQCn0cYTqJktPzulnALuiAu2nNyxhS/lPYv1jGIc5db0AvKNnS5Zr0PEhb\n\te2wnqiCq8mNXeDuF46nDL4sVkGKCHFZHuZxaxWcOVndUBmqECNr4HutmZckKbZKt1p\n\tdl9kvs9IcGoSl6mJe/yUOGvLOK0mqWbs1aldxKY3iN+cCBB35DpoCl2UJEDJg1zGZf\n\t/G9y7A5eoIcpw==","v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com;\n\ts=mail; t=1657202565;\n\tbh=LIHLqdL1J0wAs4oUKwTT/ebRl1Y4PixJ6ABBJOyMvso=;\n\th=Subject:From:To:Cc:Date:In-Reply-To:References:From;\n\tb=AVY6XwKwGRS1Q78aJYL7InxlKUnaWaSq5rV1TxUjENvlBqIKNbwX2iBk36WJ7+cJ1\n\tFedVoOxHZOjiIz2hXqq7LWOx/zUqTigeYderKFP3CEbo+tir90G+lS1CVeKHsDqIca\n\tT2U0fHEA4RciQGvL7jk5jRI78xyZx8qYyQM2eXQFDegXc0r4rEZbNqiu7qdZN8qR51\n\tKi1jiKpTttrwa46xWjrhLfiNd6qZdtE8wD0B2jNiywXNNooxOfO3Lp5NShGd88CfNO\n\tVDkicVr8G6zBjBWRuYVixTPz1fOY0okrNtwqWC5GjSjtVr0+2YssktI4Fwv2tkqqho\n\teT5wLb9XKEGCg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=collabora.com\n\theader.i=@collabora.com\n\theader.b=\"AVY6XwKw\"; dkim-atps=neutral","Message-ID":"<c0cc78c49dfb36965b91f357f730fb88cbe252bc.camel@collabora.com>","To":"Rishikesh Donadkar <rishikeshdonadkar@gmail.com>, \n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 07 Jul 2022 10:02:36 -0400","In-Reply-To":"<20220707094402.28730-3-rishikeshdonadkar@gmail.com>","References":"<20220707094402.28730-1-rishikeshdonadkar@gmail.com>\n\t<20220707094402.28730-3-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 v2 2/4] 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>"}}]