[{"id":23791,"web_url":"https://patchwork.libcamera.org/comment/23791/","msgid":"<CACGrz-M1f1PWDbwLECT5ePT4jzkHVm3Wcx7cfTho+5LMtiE7aw@mail.gmail.com>","date":"2022-07-07T13:09:37","subject":"Re: [libcamera-devel] [PATCH v2 4/4] gstreamer: Configure the\n\tcolorSpace in the Stream configuration.","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> Get the colorimetry if requested in the gstreamer pipeline and pass\n\ns/and pass that to the function colorspace_form_colorimetry()/and\nconvert it to colorspace using the function\ncolorspace_from_colorimetry()\n\n> that to the function colorspace_form_colorimetry() which will set\n\ns/form/from. Also, given the name of the function, and its usage don't\nally much. I mean to say, colorspace_from_colorimetry should simply\nreturn the colorspace and not try to set it.\n\n> the colorspace corresponding to the requested colorimetry in the\n> stream configuration.\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 feefead9..229a29cd 100644\n> --- a/src/gstreamer/gstlibcamera-utils.cpp\n> +++ b/src/gstreamer/gstlibcamera-utils.cpp\n> @@ -279,6 +279,13 @@ gst_libcamera_configure_stream_from_caps(StreamConfiguration &stream_cfg,\n>                 g_critical(\"Unsupported media type: %s\", gst_structure_get_name(s));\n>         }\n>\n> +       /* Configure colorSpace */\n> +       if (gst_structure_has_field(s, \"colorimetry\")) {\n> +               const gchar *colorimetry = gst_structure_get_string(s, \"colorimetry\");\n> +               std::optional<ColorSpace> &colorSpace = stream_cfg.colorSpace;\n> +               colorspace_form_colorimetry(colorSpace, colorimetry);\n> +       }\n> +\n\nIf you do the changes to the function discussed in the patch 3 thread,\nthis code snip will be simplified.\n\n<snip>\nif (gst_structure_has_field(s, \"colorimetry\")) {\n    const gchar *colorimetry = gst_structure_get_string(s, \"colorimetry\");\n    stream_cfg.colorSpace = colorspace_from_colorimetry(colorimetry);\n}\n</snip>\n\nRegards,\nVedant Paranjape\n\n\n>         gint width, height;\n>         gst_structure_get_int(s, \"width\", &width);\n>         gst_structure_get_int(s, \"height\", &height);\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 CCB7BBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  7 Jul 2022 13:09:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 18F356330D;\n\tThu,  7 Jul 2022 15:09:52 +0200 (CEST)","from mail-yb1-xb29.google.com (mail-yb1-xb29.google.com\n\t[IPv6:2607:f8b0:4864:20::b29])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8C2C160400\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  7 Jul 2022 15:09:50 +0200 (CEST)","by mail-yb1-xb29.google.com with SMTP id 136so611747ybl.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 07 Jul 2022 06:09:50 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1657199392;\n\tbh=d1G00l4r3Qckmc/wpdAJEaYqXtU4og1Myn6kZBZX/p8=;\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=NIkXQ6817hVpZYoO0KNxKjDJpB2JjNn9dh0qsufdqzFnqmSRx5zQqy/v5YTSjBIzB\n\trHwvMP6CNpOhpPfFi1h5Mqy9brY8L6AFPN4P8EFHA7wt01LsBRN5fPxMaKoubDWOrH\n\tSAUepy1MRQtuxA/Iuza42IMjyIjuOvLDYBDqgCoD4/W0hMEb2Gde/Q+kzM/4whAAnY\n\tH2OIr70dSyby6DhoSIupDhzyJ+EUJAdQYxgLISHs6G1HR3hsIKXvmZyQ2h+idJlZ0o\n\tiCiDEQfP+h9MEDYE76B64/ssSmMjzvBIBCgoybmX3PZ7J9nJs8xpqSVeiKlX2aL6YF\n\th/YYtE10cfJcw==","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=xvhANnFJSoGx/+VS1BV5MTsDOlWt/pG0n1rgySPh5SY=;\n\tb=ZrWqbmntQBSimmBaZzabBzZnqaWOJoboLrXLx08g5J+OuQ+v56OlErCYp3Lh4f/gCq\n\t0GtHtc2Kbm9Bvli6syJKulHEeK3emvy3ieiIjkRV0YdA5GrtrCBVxCAJGtA+KxN0q9Oq\n\tkXOo4QaqqTbnBtF6B6yTHhrechaMfgOy5T2vAopVTc7hIvgUbYooCmvT/a4Q48D7Z0za\n\t1Rth4lilKFxu/PT+PlPHvlkfbK455vScE1DEZ7hkiGcEDjqOtmEBELibViy8p2y1dqwP\n\t7JMBQcjKaFySXGdBcPCqh09z3XGs4OgPjgOaGU9cLH+lmF33KZqwd4N6GK2oeEdrLaME\n\to+yA=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"ZrWqbmnt\"; 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=xvhANnFJSoGx/+VS1BV5MTsDOlWt/pG0n1rgySPh5SY=;\n\tb=q7CXFwBZrpZI0lD6JXMDMxWFIGAW/LNmCmMkIqFa8XbU9kW6lASXVLYM4eiw1NHWe2\n\tQX5voOScRLEbts1JMvCYpibRyPucyioabTdVSy8XjTCCHfg0QFtPv5JwItiXFW01iwDX\n\tPEkvDDUCXjCfk7rPkp9F6atvD+wgF6F02A25amEHgvcHv01SHo6xneDAMK8wQcnMJRGu\n\tHCBYe9ZzB5JuE+1WDZ40owotdnrbAb3oNY+43AUoISME2ldzcUhtGhz2a/+14P8QNtK3\n\tzqZoi16Mmi/jXiIr8S2zI5Z9at3eDVe61BV3n9p3guBu/MzA6wZ9n88TpPrnFPTKpMzO\n\tts+Q==","X-Gm-Message-State":"AJIora/JUJxOm+5DecDCXjdE49+J2Nwij26X1EVDcCNJlK1G5swJE4Y+\n\tgfdrC5xpLFslmy7cv4ZZfNVOdupPMxgQhSmKov4=","X-Google-Smtp-Source":"AGRyM1suR7Ttf4/DKbr7MWoR5+IYb/6EeeG8X5sDx/twq/X+ueVtlZk8WfdrTgM6wIUy8bHZbfd4pV795Lx6UMMVtIA=","X-Received":"by 2002:a25:d189:0:b0:66e:127c:8a07 with SMTP id\n\ti131-20020a25d189000000b0066e127c8a07mr33055718ybg.390.1657199389103;\n\tThu, 07 Jul 2022 06:09:49 -0700 (PDT)","MIME-Version":"1.0","References":"<20220707094402.28730-1-rishikeshdonadkar@gmail.com>\n\t<20220707094402.28730-5-rishikeshdonadkar@gmail.com>","In-Reply-To":"<20220707094402.28730-5-rishikeshdonadkar@gmail.com>","Date":"Thu, 7 Jul 2022 15:09:37 +0200","Message-ID":"<CACGrz-M1f1PWDbwLECT5ePT4jzkHVm3Wcx7cfTho+5LMtiE7aw@mail.gmail.com>","To":"Rishikesh Donadkar <rishikeshdonadkar@gmail.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v2 4/4] gstreamer: Configure the\n\tcolorSpace in the Stream configuration.","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>"}}]