[{"id":24997,"web_url":"https://patchwork.libcamera.org/comment/24997/","msgid":"<9c9ee26d-8490-8c69-aec1-2cbe55cecd1b@ideasonboard.com>","date":"2022-09-19T05:45:09","subject":"Re: [libcamera-devel] [PATCH v6 0/1] Provide multiple colorimetry\n\tfor libcamerasrc.","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Rishi,\n\nThank you for the test results\n\nOn 9/19/22 8:27 AM, Rishikesh Donadkar wrote:\n> GStreamer pipeline supports passing multiple colorimetry as a comma\n> separated list.\n>\n> For Example :\n>\n> gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={bt2020,bt709,sRGB}\" ! glimagesink\n>\n> In this case, if supported by the camera one of bt2020, bt709, sRGB\n> should be applied.\n>\n> This series aims to adds multiple colorimetry support to the libcamera\n> gstreamer element.\n>\n> ---\n> changes from v1 to v2:\n> - Moved the function colorspace_from_colorimetry() from PATCH 1/2 to\n>    PATCH 2/2.\n>\n> changes from v2 to v3:\n> - Rebase on top of [v3 PATCH 4/4] gstreamer: Provide colorimetry <> ColorSpace mappings.\n> - Use the comparator utility function gst_video_colorimetry_is_equal()\n>    to cut down code.\n> - Rename dup_stream_cfg to pristine_stream_cfg.\n> - Log the colorimetry that is selected from the list.\n> - Change the API for the function gst_libcamera_configure_stream_from_caps()\n>    to pass pass state->config_ here instead of taking it in a holder\n>    variable reference.\n>\n> changes from v3 to v4:\n> - Discard the approach form expanding the colorimetry list through caps\n>    normalization. Instead enumerate the colorimetry list and try out the\n>    colorimetry.\n> - Add error checking for invalid colorimetry.\n>\n> changes for v4 to v5:\n> - Use gboolean instead of int. Return true/false.\n> - Add else if for the mutually exclusive conditions.\n> - Add final else to trace if anything other than a string or a list is\n>    passed in the colorimetry field by the user.\n>\n> changes from v5 to v6:\n> - Compare colorspace instead of colorimetry, this will reduce the\n>    colorimetry<->colorspace conversion.\n> - Compare the colorspace applied directly with the colorimetry requested\n>    in the caps.\n> ---\n>\n> ----\n> Test results(on RPi 4 + OV5647):\n> gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={bt2020,bt709,sRGB}\" ! glimagesink\n> Selected colorimetry bt709\n>\n> gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={sRGB,bt601,bt2020,bt709}\" ! glimagesink\n> Negotiation fails on bt601.\n>\n> gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={sRGB,bt601,bt2020,bt709,2:4:5:4}\" ! glimagesink\n> Selected colorimetry bt601.\n\nThis is confusing, are you sure this isn't a typo?\n\nThe test number results #2 and #3 have same initial colorimetry members \n(sRGB, bt601,...) , so should be parsed in the same way, how come one \nfails at bt601 and other one doesn't at bt601 ?\n\nAs mentioned earlier. bt601 doesn't have 1:1 mapping to the kernel \ncolorspace[1], hence we need to look at it separately. I would avoid \nusing that as the same for testing it, until we assess the scope of that \nwork.\n\n[1] \nhttps://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/724/diffs\n>\n> gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={sRGB,bt709,bt2020,bt601}\" ! glimagesink\n> Selected colorimetry bt709\n> ----\n>\n> Rishikesh Donadkar (1):\n>    gstreamer: Provide multiple colorimetry support for libcamerasrc\n>\n>   src/gstreamer/gstlibcamera-utils.cpp | 49 +++++++++++++++++++++++-----\n>   src/gstreamer/gstlibcamera-utils.h   |  4 ++-\n>   src/gstreamer/gstlibcamerasrc.cpp    |  2 +-\n>   3 files changed, 44 insertions(+), 11 deletions(-)\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 2E37AC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 19 Sep 2022 05:45:19 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8008D62191;\n\tMon, 19 Sep 2022 07:45:18 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1C1C061F7F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 19 Sep 2022 07:45:17 +0200 (CEST)","from [IPV6:2409:4052:e00:acfd:6ee1:c6d7:f9fa:8f26] (unknown\n\t[IPv6:2409:4052:e00:acfd:6ee1:c6d7:f9fa:8f26])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E5123576;\n\tMon, 19 Sep 2022 07:45:14 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1663566318;\n\tbh=erXRD7mpAADEAaNKmPpTAcGKZ4Q0Ppo3LOWOQfQTTxM=;\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:Cc:\n\tFrom;\n\tb=QBk7xkn290BbsswYip0zdXi50Z0I9W2dpeaA0D4rNitPYo1dbTllLM8Cyad3VUHLL\n\t/8FaGjvuV2fm96/EYml1OeeWaSFcA0qouw4YoDRhg6LXUpOqg5qU4OaDUBjqNl2Oxn\n\tb7U8VMA1zC1fb85U/y8lLAgFc6pfCErF0CsbkZ4m/R3GnhbKvBzY91PuMxXG2M+q9D\n\teS6g0U0VGEvobmcZWnlvTSw2BmHB6rK2xOWxTvNkzOoIXeoR2LlsUkItFCSW+nYqlX\n\t3OOufrxCVMuvAAXOUaRDkxLAyznbr5KmgsVufW9kF+ByUIgc1Auwg/dPLJZcXRTIp/\n\tXk9YslUor0e4g==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1663566316;\n\tbh=erXRD7mpAADEAaNKmPpTAcGKZ4Q0Ppo3LOWOQfQTTxM=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=FRBH/AiNKDR0dvRv552l/3VY1q0wOjY2paG73ciBcFSXKN3LicCPrhykpuZoohr7Q\n\tiocuaXmySfsd+J6Oo8xUoxblNURuBpTDr1l8F2hs9pfLAwNUlEe4SCuePYn1PtuM78\n\tmrfkWYwvCbqeTTSV64jci7YPMf8OBrMVJfTm9Qn4="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"FRBH/AiN\"; dkim-atps=neutral","Message-ID":"<9c9ee26d-8490-8c69-aec1-2cbe55cecd1b@ideasonboard.com>","Date":"Mon, 19 Sep 2022 11:15:09 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.2.1","Content-Language":"en-US","To":"Rishikesh Donadkar <rishikeshdonadkar@gmail.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20220919025709.34528-1-rishikeshdonadkar@gmail.com>","In-Reply-To":"<20220919025709.34528-1-rishikeshdonadkar@gmail.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH v6 0/1] Provide multiple colorimetry\n\tfor libcamerasrc.","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>","Cc":"nicolas.dufresne@collabora.com, vedantparanjape160201@gmail.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":24999,"web_url":"https://patchwork.libcamera.org/comment/24999/","msgid":"<CAEQmg0kxh1ainovJQJEDDtCdW5uuttLaLHnLkfQchwBQ-3VzMg@mail.gmail.com>","date":"2022-09-19T15:20:37","subject":"Re: [libcamera-devel] [PATCH v6 0/1] Provide multiple colorimetry\n\tfor libcamerasrc.","submitter":{"id":118,"url":"https://patchwork.libcamera.org/api/people/118/","name":"Rishikesh Donadkar","email":"rishikeshdonadkar@gmail.com"},"content":"Hello Umang,\n> The test number results #2 and #3 have same initial colorimetry members\n> (sRGB, bt601,...) , so should be parsed in the same way, how come one\n> fails at bt601 and other one doesn't at bt601 ?\n\nbt601  translates to 2:4:5:4 after conversion to colorspace,\nvalidation and conversion back to colorimetry at the time of exposing\ncaps. Gstreamer checks if the colorimetry that we are exposing is\namong the ones present in the colorimetry list, In case#3 Since\n2:4:5:4 is present in the colorimetry list, negotiation is a success.\n\n> As mentioned earlier. bt601 doesn't have 1:1 mapping to the kernel\n> colorspace[1], hence we need to look at it separately. I would avoid\n> using that as the same for testing it, until we assess the scope of that\n> work.\n\nNoted.\n\nRegards,\nRishikesh Donadkar\n\n\nOn Mon, Sep 19, 2022 at 11:15 AM Umang Jain <umang.jain@ideasonboard.com> wrote:\n>\n> Hi Rishi,\n>\n> Thank you for the test results\n>\n> On 9/19/22 8:27 AM, Rishikesh Donadkar wrote:\n> > GStreamer pipeline supports passing multiple colorimetry as a comma\n> > separated list.\n> >\n> > For Example :\n> >\n> > gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={bt2020,bt709,sRGB}\" ! glimagesink\n> >\n> > In this case, if supported by the camera one of bt2020, bt709, sRGB\n> > should be applied.\n> >\n> > This series aims to adds multiple colorimetry support to the libcamera\n> > gstreamer element.\n> >\n> > ---\n> > changes from v1 to v2:\n> > - Moved the function colorspace_from_colorimetry() from PATCH 1/2 to\n> >    PATCH 2/2.\n> >\n> > changes from v2 to v3:\n> > - Rebase on top of [v3 PATCH 4/4] gstreamer: Provide colorimetry <> ColorSpace mappings.\n> > - Use the comparator utility function gst_video_colorimetry_is_equal()\n> >    to cut down code.\n> > - Rename dup_stream_cfg to pristine_stream_cfg.\n> > - Log the colorimetry that is selected from the list.\n> > - Change the API for the function gst_libcamera_configure_stream_from_caps()\n> >    to pass pass state->config_ here instead of taking it in a holder\n> >    variable reference.\n> >\n> > changes from v3 to v4:\n> > - Discard the approach form expanding the colorimetry list through caps\n> >    normalization. Instead enumerate the colorimetry list and try out the\n> >    colorimetry.\n> > - Add error checking for invalid colorimetry.\n> >\n> > changes for v4 to v5:\n> > - Use gboolean instead of int. Return true/false.\n> > - Add else if for the mutually exclusive conditions.\n> > - Add final else to trace if anything other than a string or a list is\n> >    passed in the colorimetry field by the user.\n> >\n> > changes from v5 to v6:\n> > - Compare colorspace instead of colorimetry, this will reduce the\n> >    colorimetry<->colorspace conversion.\n> > - Compare the colorspace applied directly with the colorimetry requested\n> >    in the caps.\n> > ---\n> >\n> > ----\n> > Test results(on RPi 4 + OV5647):\n> > gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={bt2020,bt709,sRGB}\" ! glimagesink\n> > Selected colorimetry bt709\n> >\n> > gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={sRGB,bt601,bt2020,bt709}\" ! glimagesink\n> > Negotiation fails on bt601.\n> >\n> > gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={sRGB,bt601,bt2020,bt709,2:4:5:4}\" ! glimagesink\n> > Selected colorimetry bt601.\n>\n> This is confusing, are you sure this isn't a typo?\n>\n> The test number results #2 and #3 have same initial colorimetry members\n> (sRGB, bt601,...) , so should be parsed in the same way, how come one\n> fails at bt601 and other one doesn't at bt601 ?\n>\n> As mentioned earlier. bt601 doesn't have 1:1 mapping to the kernel\n> colorspace[1], hence we need to look at it separately. I would avoid\n> using that as the same for testing it, until we assess the scope of that\n> work.\n>\n> [1]\n> https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/724/diffs\n> >\n> > gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={sRGB,bt709,bt2020,bt601}\" ! glimagesink\n> > Selected colorimetry bt709\n> > ----\n> >\n> > Rishikesh Donadkar (1):\n> >    gstreamer: Provide multiple colorimetry support for libcamerasrc\n> >\n> >   src/gstreamer/gstlibcamera-utils.cpp | 49 +++++++++++++++++++++++-----\n> >   src/gstreamer/gstlibcamera-utils.h   |  4 ++-\n> >   src/gstreamer/gstlibcamerasrc.cpp    |  2 +-\n> >   3 files changed, 44 insertions(+), 11 deletions(-)\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 1EA96C0DA4\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 19 Sep 2022 15:20:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 64D3162193;\n\tMon, 19 Sep 2022 17:20:52 +0200 (CEST)","from mail-vs1-xe35.google.com (mail-vs1-xe35.google.com\n\t[IPv6:2607:f8b0:4864:20::e35])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 327C361F85\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 19 Sep 2022 17:20:51 +0200 (CEST)","by mail-vs1-xe35.google.com with SMTP id p4so12075799vsa.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 19 Sep 2022 08:20:51 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1663600852;\n\tbh=UI6soPJfeCsWR8g4N/u55LOQrwmj82SKMv40bHGLIW4=;\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=illefI17NSrrP1wmn0vXVmuhbpY+QHS3BA9cZb92heByb5xaACi7fiddIM/lB2P3s\n\tceJkJPVtFdWGSbJiUgAoT3puLEhIYRae24YoPJ1CFRUgN2kyEYzxZQAiZCF2ncgc9B\n\tsnifsSvU9R2ttcfMR69aVe22TcaWapUhbbV+1EaDVBvwjBT5/0sR/t7yYHAsME5UWp\n\t4zdMY/Ai/QYzYdz51Dqfv8JMRDl0VO15jRcucYKomBBk/YmQj8oOgikon2NJBJmuZB\n\t8LL7KI5bKpmxYUJWx/ceoPocUg4XgoLOI6MNp1Nlc1yBKIa52BqG130kzsGC3Z9V9Z\n\tKBY9+7HzB0Txg==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date;\n\tbh=g0LPpIceSWSfs74ViXMefnKg1x1GGmc+b5r0EQVLZs8=;\n\tb=bhHAV7tIudwenfyJplwPpMp1X12g/cgsnRFH4605omsmNtUMwDMJxA/QMzfCFDRt8C\n\t1Mhr8xUO1mCbL63ZbMVrIoFEoaHQQ2pMf75AgAEOwRhymGD87QM8HVMyA8rv2IoohBhC\n\trTa5zCVxsAYaQtSfv6EJrgRwg+Q3NZ7E7Ctx+nJQOZsXK13ZLajmNniA3Pcg8p7aX8Ol\n\tSH0HyV64yX8rSu8G8q1kO6DhwjxfZ1wNMW7Qi90MqOl07eSMmAigdsJ5MZ0iQ0tGaLW2\n\tgvtJ4W5vE/L/YNEP1ahWULGJpWsqARU6qolKr1LPCrWmr+/02UGxXcEKoRsvPbAIddYv\n\tt9Qw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"bhHAV7tI\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date;\n\tbh=g0LPpIceSWSfs74ViXMefnKg1x1GGmc+b5r0EQVLZs8=;\n\tb=Xa6+O4PvgdFIfk+Gjjy4+g508hx529meOPFHaYl4z4eavdMoXZXI/+RVfAV+NUEmq5\n\tkDHVGQ9tIj+EsiJJZwtpyIHsYhYTs47IEfsm+id4nT2quQ79Oz3a48ZVg7C3vyh/zG7X\n\tQOkeTcAPalLHkscaS1y+b7r/DBmwZCALxajmc62J/xH8/U5F8CYXtfhHW3YXvzB76yIY\n\tmy/+WRj3ctYQzN0hBDBMDXFHqs4I0j/dqBvXzIVuoGFq3800qqS4C4AiptFOVgVibGg8\n\tSO4xYqESpAtjpesJT/qPtlAheTD+ezkXs8SUIFtWbWrtUgijVPMdxEWTrwIXZSIAdbom\n\t3opQ==","X-Gm-Message-State":"ACrzQf2L33MQVHGTKOad29f84PjwY4wTpR6bSp0XrnXKGPu+P7vOwBvt\n\tPFEEeADWdc+JFOd+Fs+HzI0i3TLCRL7hWe9e+a2mbBTySKM8/A==","X-Google-Smtp-Source":"AMsMyM4dVfBWcVolF2tUXLvEZNx7OHGwrtrzBfIdQs4HADCJqLYFNOwicnqHsCA31v/hvlaG55FLH44gp/fcvlIDZsw=","X-Received":"by 2002:a67:7345:0:b0:398:31d7:d4e0 with SMTP id\n\to66-20020a677345000000b0039831d7d4e0mr6637524vsc.11.1663600849820;\n\tMon, 19 Sep 2022 08:20:49 -0700 (PDT)","MIME-Version":"1.0","References":"<20220919025709.34528-1-rishikeshdonadkar@gmail.com>\n\t<9c9ee26d-8490-8c69-aec1-2cbe55cecd1b@ideasonboard.com>","In-Reply-To":"<9c9ee26d-8490-8c69-aec1-2cbe55cecd1b@ideasonboard.com>","Date":"Mon, 19 Sep 2022 20:50:37 +0530","Message-ID":"<CAEQmg0kxh1ainovJQJEDDtCdW5uuttLaLHnLkfQchwBQ-3VzMg@mail.gmail.com>","To":"Umang Jain <umang.jain@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v6 0/1] Provide multiple colorimetry\n\tfor libcamerasrc.","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":"Rishikesh Donadkar via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Rishikesh Donadkar <rishikeshdonadkar@gmail.com>","Cc":"libcamera-devel@lists.libcamera.org, vedantparanjape160201@gmail.com,\n\tnicolas.dufresne@collabora.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25001,"web_url":"https://patchwork.libcamera.org/comment/25001/","msgid":"<YyiknWEW6Hcy09Lc@pendragon.ideasonboard.com>","date":"2022-09-19T17:19:25","subject":"Re: [libcamera-devel] [PATCH v6 0/1] Provide multiple colorimetry\n\tfor libcamerasrc.","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hello Rishikesh,\n\nBecause it messes up the order in which people normally read text.\nWhy is top-posting such a bad thing?\nTop-posting.\nWhat is the most annoying thing in e-mail?\n\n(https://en.wikipedia.org/wiki/Posting_style)\n\nPlease reply inline, don't copy parts of the e-mail you're replying to\nto the top.\n\nOn Mon, Sep 19, 2022 at 08:50:37PM +0530, Rishikesh Donadkar wrote:\n> Hello Umang,\n> > The test number results #2 and #3 have same initial colorimetry members\n> > (sRGB, bt601,...) , so should be parsed in the same way, how come one\n> > fails at bt601 and other one doesn't at bt601 ?\n> \n> bt601  translates to 2:4:5:4 after conversion to colorspace,\n> validation and conversion back to colorimetry at the time of exposing\n> caps. Gstreamer checks if the colorimetry that we are exposing is\n> among the ones present in the colorimetry list, In case#3 Since\n> 2:4:5:4 is present in the colorimetry list, negotiation is a success.\n> \n> > As mentioned earlier. bt601 doesn't have 1:1 mapping to the kernel\n> > colorspace[1], hence we need to look at it separately. I would avoid\n> > using that as the same for testing it, until we assess the scope of that\n> > work.\n> \n> Noted.\n> \n> On Mon, Sep 19, 2022 at 11:15 AM Umang Jain wrote:\n> >\n> > Hi Rishi,\n> >\n> > Thank you for the test results\n> >\n> > On 9/19/22 8:27 AM, Rishikesh Donadkar wrote:\n> > > GStreamer pipeline supports passing multiple colorimetry as a comma\n> > > separated list.\n> > >\n> > > For Example :\n> > >\n> > > gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={bt2020,bt709,sRGB}\" ! glimagesink\n> > >\n> > > In this case, if supported by the camera one of bt2020, bt709, sRGB\n> > > should be applied.\n\nI understand this as meaning that the first supported colorimetry among\nthe supplied list will be selected, and negotiation will fail if none of\nthose colorimetries are supported. Is that correct ? If so ... (see\nbelow)\n\n> > > This series aims to adds multiple colorimetry support to the libcamera\n> > > gstreamer element.\n> > >\n> > > ---\n> > > changes from v1 to v2:\n> > > - Moved the function colorspace_from_colorimetry() from PATCH 1/2 to\n> > >    PATCH 2/2.\n> > >\n> > > changes from v2 to v3:\n> > > - Rebase on top of [v3 PATCH 4/4] gstreamer: Provide colorimetry <> ColorSpace mappings.\n> > > - Use the comparator utility function gst_video_colorimetry_is_equal()\n> > >    to cut down code.\n> > > - Rename dup_stream_cfg to pristine_stream_cfg.\n> > > - Log the colorimetry that is selected from the list.\n> > > - Change the API for the function gst_libcamera_configure_stream_from_caps()\n> > >    to pass pass state->config_ here instead of taking it in a holder\n> > >    variable reference.\n> > >\n> > > changes from v3 to v4:\n> > > - Discard the approach form expanding the colorimetry list through caps\n> > >    normalization. Instead enumerate the colorimetry list and try out the\n> > >    colorimetry.\n> > > - Add error checking for invalid colorimetry.\n> > >\n> > > changes for v4 to v5:\n> > > - Use gboolean instead of int. Return true/false.\n> > > - Add else if for the mutually exclusive conditions.\n> > > - Add final else to trace if anything other than a string or a list is\n> > >    passed in the colorimetry field by the user.\n> > >\n> > > changes from v5 to v6:\n> > > - Compare colorspace instead of colorimetry, this will reduce the\n> > >    colorimetry<->colorspace conversion.\n> > > - Compare the colorspace applied directly with the colorimetry requested\n> > >    in the caps.\n> > > ---\n> > >\n> > > ----\n> > > Test results(on RPi 4 + OV5647):\n> > > gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={bt2020,bt709,sRGB}\" ! glimagesink\n> > > Selected colorimetry bt709\n> > >\n> > > gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={sRGB,bt601,bt2020,bt709}\" ! glimagesink\n> > > Negotiation fails on bt601.\n\n... why does this fail ? The previous test showed that bt709 can work,\nshouldn't it be selected here ?\n\n> > >\n> > > gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={sRGB,bt601,bt2020,bt709,2:4:5:4}\" ! glimagesink\n> > > Selected colorimetry bt601.\n> >\n> > This is confusing, are you sure this isn't a typo?\n> >\n> > The test number results #2 and #3 have same initial colorimetry members\n> > (sRGB, bt601,...) , so should be parsed in the same way, how come one\n> > fails at bt601 and other one doesn't at bt601 ?\n> >\n> > As mentioned earlier. bt601 doesn't have 1:1 mapping to the kernel\n> > colorspace[1], hence we need to look at it separately. I would avoid\n> > using that as the same for testing it, until we assess the scope of that\n> > work.\n> >\n> > [1]\n> > https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/724/diffs\n> > >\n> > > gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={sRGB,bt709,bt2020,bt601}\" ! glimagesink\n> > > Selected colorimetry bt709\n> > > ----\n> > >\n> > > Rishikesh Donadkar (1):\n> > >    gstreamer: Provide multiple colorimetry support for libcamerasrc\n> > >\n> > >   src/gstreamer/gstlibcamera-utils.cpp | 49 +++++++++++++++++++++++-----\n> > >   src/gstreamer/gstlibcamera-utils.h   |  4 ++-\n> > >   src/gstreamer/gstlibcamerasrc.cpp    |  2 +-\n> > >   3 files changed, 44 insertions(+), 11 deletions(-)\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 EA94CC3272\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 19 Sep 2022 17:19:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 47E8562195;\n\tMon, 19 Sep 2022 19:19:41 +0200 (CEST)","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 BF9BA61F85\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 19 Sep 2022 19:19:39 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 085FB499;\n\tMon, 19 Sep 2022 19:19:38 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1663607981;\n\tbh=64lcpAyk9ASJY7g1Ra+iZPraYfq1d2t5OJZ9bKfze+k=;\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:Cc:\n\tFrom;\n\tb=eEPEvjFDskOghQNdP8AwuewQUmfcoyN/6ucTJ6A1nZu4ODl/RuqmwbtfRcIY60ra+\n\tOein0O43elMPm5HnUmiAZlorb5719A4tAxgypRKw5I2kLtpQgIlKZtpAr545UzUjgc\n\tKQKtwlXSZzRTl2KB1YR3I6KEE0O7hrQtCDmTXDeF4OhOlCbZoxP0BLi7iIZBZ4w1SJ\n\tLhkPOSvKSUDD5EO87QmiqYJWOGagS9uUVVJG795ROm4h8qlTbMjTb2SwDb9O5ji9ix\n\tyWZ48fvKrTKcHykmQojpYA3jxMc9ceTRISDQBjNRTDHbKA8vtiFvqCkeYZiJTsqhHr\n\tO7s/BGJ5qeoHg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1663607979;\n\tbh=64lcpAyk9ASJY7g1Ra+iZPraYfq1d2t5OJZ9bKfze+k=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=I6lrkPmfZ7cL89unkZvXDxmAVjUp+zNOMAOs7XbTEGOXHTggmLB47/gVE4LLqxSyz\n\txVzr25DphtQWs4whoRL1c/j5z93H2dMy/u+d4I7e6etytpCJvHkoGDxPgqxm3ikH+O\n\tPOazBOvpACAMY41G7Cm/OAnSX0Z7uDOHazehE2hY="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"I6lrkPmf\"; dkim-atps=neutral","Date":"Mon, 19 Sep 2022 20:19:25 +0300","To":"Rishikesh Donadkar <rishikeshdonadkar@gmail.com>","Message-ID":"<YyiknWEW6Hcy09Lc@pendragon.ideasonboard.com>","References":"<20220919025709.34528-1-rishikeshdonadkar@gmail.com>\n\t<9c9ee26d-8490-8c69-aec1-2cbe55cecd1b@ideasonboard.com>\n\t<CAEQmg0kxh1ainovJQJEDDtCdW5uuttLaLHnLkfQchwBQ-3VzMg@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAEQmg0kxh1ainovJQJEDDtCdW5uuttLaLHnLkfQchwBQ-3VzMg@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v6 0/1] Provide multiple colorimetry\n\tfor libcamerasrc.","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":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org, vedantparanjape160201@gmail.com,\n\tnicolas.dufresne@collabora.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25123,"web_url":"https://patchwork.libcamera.org/comment/25123/","msgid":"<CAEQmg0k2CZs1E3vCJecmRQDV-KYHq+3nX-CfmfSWaKm4yrib6w@mail.gmail.com>","date":"2022-09-26T04:45:56","subject":"Re: [libcamera-devel] [PATCH v6 0/1] Provide multiple colorimetry\n\tfor libcamerasrc.","submitter":{"id":118,"url":"https://patchwork.libcamera.org/api/people/118/","name":"Rishikesh Donadkar","email":"rishikeshdonadkar@gmail.com"},"content":"Hello Laurent,\n\nOn Mon, Sep 19, 2022 at 10:49 PM Laurent Pinchart\n<laurent.pinchart@ideasonboard.com> wrote:\n>\n> Hello Rishikesh,\n>\n> Because it messes up the order in which people normally read text.\n> Why is top-posting such a bad thing?\n> Top-posting.\n> What is the most annoying thing in e-mail?\n>\n> (https://en.wikipedia.org/wiki/Posting_style)\n>\n> Please reply inline, don't copy parts of the e-mail you're replying to\n> to the top.\n>\nGot it.\n>\n> On Mon, Sep 19, 2022 at 08:50:37PM +0530, Rishikesh Donadkar wrote:\n> > Hello Umang,\n> > > The test number results #2 and #3 have same initial colorimetry members\n> > > (sRGB, bt601,...) , so should be parsed in the same way, how come one\n> > > fails at bt601 and other one doesn't at bt601 ?\n> >\n> > bt601  translates to 2:4:5:4 after conversion to colorspace,\n> > validation and conversion back to colorimetry at the time of exposing\n> > caps. Gstreamer checks if the colorimetry that we are exposing is\n> > among the ones present in the colorimetry list, In case#3 Since\n> > 2:4:5:4 is present in the colorimetry list, negotiation is a success.\n> >\n> > > As mentioned earlier. bt601 doesn't have 1:1 mapping to the kernel\n> > > colorspace[1], hence we need to look at it separately. I would avoid\n> > > using that as the same for testing it, until we assess the scope of that\n> > > work.\n> >\n> > Noted.\n> >\n> > On Mon, Sep 19, 2022 at 11:15 AM Umang Jain wrote:\n> > >\n> > > Hi Rishi,\n> > >\n> > > Thank you for the test results\n> > >\n> > > On 9/19/22 8:27 AM, Rishikesh Donadkar wrote:\n> > > > GStreamer pipeline supports passing multiple colorimetry as a comma\n> > > > separated list.\n> > > >\n> > > > For Example :\n> > > >\n> > > > gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={bt2020,bt709,sRGB}\" ! glimagesink\n> > > >\n> > > > In this case, if supported by the camera one of bt2020, bt709, sRGB\n> > > > should be applied.\n>\n> I understand this as meaning that the first supported colorimetry among\n> the supplied list will be selected, and negotiation will fail if none of\n> those colorimetries are supported. Is that correct ? If so ... (see\n> below)\n>\n> > > > This series aims to adds multiple colorimetry support to the libcamera\n> > > > gstreamer element.\n> > > >\n> > > > ---\n> > > > changes from v1 to v2:\n> > > > - Moved the function colorspace_from_colorimetry() from PATCH 1/2 to\n> > > >    PATCH 2/2.\n> > > >\n> > > > changes from v2 to v3:\n> > > > - Rebase on top of [v3 PATCH 4/4] gstreamer: Provide colorimetry <> ColorSpace mappings.\n> > > > - Use the comparator utility function gst_video_colorimetry_is_equal()\n> > > >    to cut down code.\n> > > > - Rename dup_stream_cfg to pristine_stream_cfg.\n> > > > - Log the colorimetry that is selected from the list.\n> > > > - Change the API for the function gst_libcamera_configure_stream_from_caps()\n> > > >    to pass pass state->config_ here instead of taking it in a holder\n> > > >    variable reference.\n> > > >\n> > > > changes from v3 to v4:\n> > > > - Discard the approach form expanding the colorimetry list through caps\n> > > >    normalization. Instead enumerate the colorimetry list and try out the\n> > > >    colorimetry.\n> > > > - Add error checking for invalid colorimetry.\n> > > >\n> > > > changes for v4 to v5:\n> > > > - Use gboolean instead of int. Return true/false.\n> > > > - Add else if for the mutually exclusive conditions.\n> > > > - Add final else to trace if anything other than a string or a list is\n> > > >    passed in the colorimetry field by the user.\n> > > >\n> > > > changes from v5 to v6:\n> > > > - Compare colorspace instead of colorimetry, this will reduce the\n> > > >    colorimetry<->colorspace conversion.\n> > > > - Compare the colorspace applied directly with the colorimetry requested\n> > > >    in the caps.\n> > > > ---\n> > > >\n> > > > ----\n> > > > Test results(on RPi 4 + OV5647):\n> > > > gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={bt2020,bt709,sRGB}\" ! glimagesink\n> > > > Selected colorimetry bt709\n> > > >\n> > > > gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={sRGB,bt601,bt2020,bt709}\" ! glimagesink\n> > > > Negotiation fails on bt601.\n>\n> ... why does this fail ? The previous test showed that bt709 can work,\n> shouldn't it be selected here ?\n\nThis happens as a result of the bt601 colorimetry. As stated by Umang\nin the initial patch email's reply, bt601 doesn't have 1:1 mapping to\nthe kernel colorspace. I now realise that the colorimetry bt601 should\nnot have been a part of the tests. bt709 would have been chosen if\nbt601 had not been on the list.\n>\n>\n> > > >\n> > > > gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={sRGB,bt601,bt2020,bt709,2:4:5:4}\" ! glimagesink\n> > > > Selected colorimetry bt601.\n> > >\n> > > This is confusing, are you sure this isn't a typo?\n> > >\n> > > The test number results #2 and #3 have same initial colorimetry members\n> > > (sRGB, bt601,...) , so should be parsed in the same way, how come one\n> > > fails at bt601 and other one doesn't at bt601 ?\n> > >\n> > > As mentioned earlier. bt601 doesn't have 1:1 mapping to the kernel\n> > > colorspace[1], hence we need to look at it separately. I would avoid\n> > > using that as the same for testing it, until we assess the scope of that\n> > > work.\n> > >\n> > > [1]\n> > > https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/724/diffs\n> > > >\n> > > > gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={sRGB,bt709,bt2020,bt601}\" ! glimagesink\n> > > > Selected colorimetry bt709\n> > > > ----\n> > > >\n> > > > Rishikesh Donadkar (1):\n> > > >    gstreamer: Provide multiple colorimetry support for libcamerasrc\n> > > >\n> > > >   src/gstreamer/gstlibcamera-utils.cpp | 49 +++++++++++++++++++++++-----\n> > > >   src/gstreamer/gstlibcamera-utils.h   |  4 ++-\n> > > >   src/gstreamer/gstlibcamerasrc.cpp    |  2 +-\n> > > >   3 files changed, 44 insertions(+), 11 deletions(-)\n> > > >\n\n\nRegards,\n\nRishikesh Donadkar","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 7ED61BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Sep 2022 04:46:11 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3ECC0603DC;\n\tMon, 26 Sep 2022 06:46:11 +0200 (CEST)","from mail-vs1-xe30.google.com (mail-vs1-xe30.google.com\n\t[IPv6:2607:f8b0:4864:20::e30])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EBED5603DC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Sep 2022 06:46:08 +0200 (CEST)","by mail-vs1-xe30.google.com with SMTP id a129so5490899vsc.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 25 Sep 2022 21:46:08 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664167571;\n\tbh=JGlP/JAWHbDJBIRdebvnHYcnUzH650Py6PAnnG1Gzuo=;\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=z/4crI2qcE7FFE+z/MPZ8lbPjHxzEMxu24wNbtP+Sdy3Px6bEK/JO5GDgmjYvnG9K\n\t+Wlz1xDEy95WKj/It+ci9YezVdmHlvyPgF6gFJjaJx3gBpvIYytOYqGgeIFhHcE9AH\n\t0k+aM9NIgbOQHAwt9duMvAdM8QFpBCpVvitWNrf6bBYdkfzYWHd4nnO0Av03y+SISJ\n\txdWHC+yyxAacrPCICWDR24jP2rvF38h4YaUJG3gHzjnfyFIrAunkcy15I1IHCCYEEB\n\tLnE81KM63YQeddHwRApcTDhq5tsp8zBLx5f5e90llZznR007Y2HnXwOR3TonlyUEsi\n\tiVb42BcDRkKmA==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date;\n\tbh=ptzLbKqrsJeFf7dpFaYyCIYKepDUiWdCxcE9sddLlhQ=;\n\tb=cdxzVAyYFm6Udp7yFwZ3m5mu5lQB3jNyfpx4ZMfFzuzvXwZJVLyLWTz32egPLDxXxh\n\tBhSeO9TIzG2ZD7ZqDh3q6+d338j6Jni6xg/nPtgssdqn+f8CdaIZ4QLvAV04gKFOA23J\n\twjqQzE/N3vjn2YVpe7083LIMEd8Mkx2cnJU+ExzxDaI+GEz7Uty+E9gScBWD6zEVDNwf\n\tLXJcjORNo1tJnZySPJBE55CXMhzhqkUz2tDg8/2Lvweoph0tiQzKLARuvF93ChW6vh2i\n\tTM1D/Xv4jGPAjuGa3qehjuf8muLN4wpPu15ExR9WXo7K11gzumcKOLVXgXhUX5sDvVVE\n\tIOdw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"cdxzVAyY\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date;\n\tbh=ptzLbKqrsJeFf7dpFaYyCIYKepDUiWdCxcE9sddLlhQ=;\n\tb=kp9sAhVjFa5DlnZHoOHcXRocfJ5vQ524aAnJeu60wsDphIQPFkJunP9f3dd+pwt3sj\n\taqfxD3R9vJjRfX4Cb2+aMmkgfekQ0nsyn3t8IcpY7NrT/36q+tZHLW6px9BvlzIXRYM+\n\tNBxffVUYl7GsbEW+no6Rf43GgI9m538k8fQBgXjbw3Rw2QQ1wj5bWmsbNUlI+TGXefYs\n\t93cvbZz53vvvH+0AszZtQR1GrWlEeh6nWSZTnmoO/KcHf0Tx/PdDRVOWOkX1UEoxA8HL\n\tos9k4TqqTiM1l03D7S+cfGEu9ruEjCwYojg0sz87xH+MAGR1KKPjIoEIqe3WGFem9GgQ\n\t4qZQ==","X-Gm-Message-State":"ACrzQf0f3TrDorDbP0tnz06gmqCLDnzZ/R/qh+IkIdK4arqqZ2/+D8P8\n\tWOFkGnx8FR8oMhCE2hmBrzlmNVx4Knulu+WFhVM=","X-Google-Smtp-Source":"AMsMyM5C6kZkZ0HznEEkvCziH5EjiGdQASgTj3kMexQxqWOo6awu0LJOB0Zxt8goEbgRpbijA4JPXr2/IUhFQn7UQyU=","X-Received":"by 2002:a67:d70d:0:b0:398:5150:3bb4 with SMTP id\n\tp13-20020a67d70d000000b0039851503bb4mr7330871vsj.13.1664167567677;\n\tSun, 25 Sep 2022 21:46:07 -0700 (PDT)","MIME-Version":"1.0","References":"<20220919025709.34528-1-rishikeshdonadkar@gmail.com>\n\t<9c9ee26d-8490-8c69-aec1-2cbe55cecd1b@ideasonboard.com>\n\t<CAEQmg0kxh1ainovJQJEDDtCdW5uuttLaLHnLkfQchwBQ-3VzMg@mail.gmail.com>\n\t<YyiknWEW6Hcy09Lc@pendragon.ideasonboard.com>","In-Reply-To":"<YyiknWEW6Hcy09Lc@pendragon.ideasonboard.com>","Date":"Mon, 26 Sep 2022 10:15:56 +0530","Message-ID":"<CAEQmg0k2CZs1E3vCJecmRQDV-KYHq+3nX-CfmfSWaKm4yrib6w@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v6 0/1] Provide multiple colorimetry\n\tfor libcamerasrc.","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":"Rishikesh Donadkar via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Rishikesh Donadkar <rishikeshdonadkar@gmail.com>","Cc":"libcamera-devel@lists.libcamera.org, vedantparanjape160201@gmail.com,\n\tnicolas.dufresne@collabora.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":25124,"web_url":"https://patchwork.libcamera.org/comment/25124/","msgid":"<82e588ca-de81-7281-241f-a2d40457d851@ideasonboard.com>","date":"2022-09-26T06:04:16","subject":"Re: [libcamera-devel] [PATCH v6 0/1] Provide multiple colorimetry\n\tfor libcamerasrc.","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Rishikesh\n\nOn 9/26/22 10:15 AM, Rishikesh Donadkar wrote:\n> Hello Laurent,\n>\n> On Mon, Sep 19, 2022 at 10:49 PM Laurent Pinchart\n> <laurent.pinchart@ideasonboard.com> wrote:\n>> Hello Rishikesh,\n>>\n>> Because it messes up the order in which people normally read text.\n>> Why is top-posting such a bad thing?\n>> Top-posting.\n>> What is the most annoying thing in e-mail?\n>>\n>> (https://en.wikipedia.org/wiki/Posting_style)\n>>\n>> Please reply inline, don't copy parts of the e-mail you're replying to\n>> to the top.\n>>\n> Got it.\n>> On Mon, Sep 19, 2022 at 08:50:37PM +0530, Rishikesh Donadkar wrote:\n>>> Hello Umang,\n>>>> The test number results #2 and #3 have same initial colorimetry members\n>>>> (sRGB, bt601,...) , so should be parsed in the same way, how come one\n>>>> fails at bt601 and other one doesn't at bt601 ?\n>>> bt601  translates to 2:4:5:4 after conversion to colorspace,\n>>> validation and conversion back to colorimetry at the time of exposing\n>>> caps. Gstreamer checks if the colorimetry that we are exposing is\n>>> among the ones present in the colorimetry list, In case#3 Since\n>>> 2:4:5:4 is present in the colorimetry list, negotiation is a success.\n>>>\n>>>> As mentioned earlier. bt601 doesn't have 1:1 mapping to the kernel\n>>>> colorspace[1], hence we need to look at it separately. I would avoid\n>>>> using that as the same for testing it, until we assess the scope of that\n>>>> work.\n>>> Noted.\n>>>\n>>> On Mon, Sep 19, 2022 at 11:15 AM Umang Jain wrote:\n>>>> Hi Rishi,\n>>>>\n>>>> Thank you for the test results\n>>>>\n>>>> On 9/19/22 8:27 AM, Rishikesh Donadkar wrote:\n>>>>> GStreamer pipeline supports passing multiple colorimetry as a comma\n>>>>> separated list.\n>>>>>\n>>>>> For Example :\n>>>>>\n>>>>> gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={bt2020,bt709,sRGB}\" ! glimagesink\n>>>>>\n>>>>> In this case, if supported by the camera one of bt2020, bt709, sRGB\n>>>>> should be applied.\n>> I understand this as meaning that the first supported colorimetry among\n>> the supplied list will be selected, and negotiation will fail if none of\n>> those colorimetries are supported. Is that correct ? If so ... (see\n>> below)\n>>\n>>>>> This series aims to adds multiple colorimetry support to the libcamera\n>>>>> gstreamer element.\n>>>>>\n>>>>> ---\n>>>>> changes from v1 to v2:\n>>>>> - Moved the function colorspace_from_colorimetry() from PATCH 1/2 to\n>>>>>     PATCH 2/2.\n>>>>>\n>>>>> changes from v2 to v3:\n>>>>> - Rebase on top of [v3 PATCH 4/4] gstreamer: Provide colorimetry <> ColorSpace mappings.\n>>>>> - Use the comparator utility function gst_video_colorimetry_is_equal()\n>>>>>     to cut down code.\n>>>>> - Rename dup_stream_cfg to pristine_stream_cfg.\n>>>>> - Log the colorimetry that is selected from the list.\n>>>>> - Change the API for the function gst_libcamera_configure_stream_from_caps()\n>>>>>     to pass pass state->config_ here instead of taking it in a holder\n>>>>>     variable reference.\n>>>>>\n>>>>> changes from v3 to v4:\n>>>>> - Discard the approach form expanding the colorimetry list through caps\n>>>>>     normalization. Instead enumerate the colorimetry list and try out the\n>>>>>     colorimetry.\n>>>>> - Add error checking for invalid colorimetry.\n>>>>>\n>>>>> changes for v4 to v5:\n>>>>> - Use gboolean instead of int. Return true/false.\n>>>>> - Add else if for the mutually exclusive conditions.\n>>>>> - Add final else to trace if anything other than a string or a list is\n>>>>>     passed in the colorimetry field by the user.\n>>>>>\n>>>>> changes from v5 to v6:\n>>>>> - Compare colorspace instead of colorimetry, this will reduce the\n>>>>>     colorimetry<->colorspace conversion.\n>>>>> - Compare the colorspace applied directly with the colorimetry requested\n>>>>>     in the caps.\n>>>>> ---\n>>>>>\n>>>>> ----\n>>>>> Test results(on RPi 4 + OV5647):\n>>>>> gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={bt2020,bt709,sRGB}\" ! glimagesink\n>>>>> Selected colorimetry bt709\n>>>>>\n>>>>> gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={sRGB,bt601,bt2020,bt709}\" ! glimagesink\n>>>>> Negotiation fails on bt601.\n>> ... why does this fail ? The previous test showed that bt709 can work,\n>> shouldn't it be selected here ?\n> This happens as a result of the bt601 colorimetry. As stated by Umang\n> in the initial patch email's reply, bt601 doesn't have 1:1 mapping to\n> the kernel colorspace. I now realise that the colorimetry bt601 should\n> not have been a part of the tests. bt709 would have been chosen if\n> bt601 had not been on the list.\n\nThat's fine, but we should atleast document the case with bt601 and what \nis the issue there so that we don't lose track? As you are the one \nleading testing with multiple-colorimetry, would you mind filing a bug ?\n\n     https://bugs.libcamera.org/enter_bug.cgi\n     (You might need to signup)\n\nI have left the gstreamer merge link for bt601 somewhere in that thread. \nPlease link it up in the bug as well (apart from other findings you find)\n\nThen we'll see how to progress on this with the concerns Laurent has \nraised on multi-stream case and then re-evaluate test results.\n>>\n>>>>> gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={sRGB,bt601,bt2020,bt709,2:4:5:4}\" ! glimagesink\n>>>>> Selected colorimetry bt601.\n>>>> This is confusing, are you sure this isn't a typo?\n>>>>\n>>>> The test number results #2 and #3 have same initial colorimetry members\n>>>> (sRGB, bt601,...) , so should be parsed in the same way, how come one\n>>>> fails at bt601 and other one doesn't at bt601 ?\n>>>>\n>>>> As mentioned earlier. bt601 doesn't have 1:1 mapping to the kernel\n>>>> colorspace[1], hence we need to look at it separately. I would avoid\n>>>> using that as the same for testing it, until we assess the scope of that\n>>>> work.\n>>>>\n>>>> [1]\n>>>> https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/724/diffs\n>>>>> gst-launch-1.0 libcamerasrc ! \"video/x-raw,colorimetry={sRGB,bt709,bt2020,bt601}\" ! glimagesink\n>>>>> Selected colorimetry bt709\n>>>>> ----\n>>>>>\n>>>>> Rishikesh Donadkar (1):\n>>>>>     gstreamer: Provide multiple colorimetry support for libcamerasrc\n>>>>>\n>>>>>    src/gstreamer/gstlibcamera-utils.cpp | 49 +++++++++++++++++++++++-----\n>>>>>    src/gstreamer/gstlibcamera-utils.h   |  4 ++-\n>>>>>    src/gstreamer/gstlibcamerasrc.cpp    |  2 +-\n>>>>>    3 files changed, 44 insertions(+), 11 deletions(-)\n>>>>>\n>\n> Regards,\n>\n> Rishikesh Donadkar","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 8A027BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 26 Sep 2022 06:04:28 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EC82E62248;\n\tMon, 26 Sep 2022 08:04:27 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 62BD3603DC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 26 Sep 2022 08:04:26 +0200 (CEST)","from [IPV6:2405:205:1089:f265:b627:9c56:fa7a:38e1] (unknown\n\t[IPv6:2405:205:1089:f265:b627:9c56:fa7a:38e1])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 49DA82B3;\n\tMon, 26 Sep 2022 08:04:22 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664172268;\n\tbh=1n06J8uYiBWLqE+gjr16s8MMYGBSuT7uNziI1FigByQ=;\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:Cc:\n\tFrom;\n\tb=wrN4S/3ZP4PHOyevzSy/uVx1ycFizTBzxT0FzXvijZN1X7hvVT+qEdofHbmMEBHlY\n\tnARVYk88JF4Vok8AhZ9k7rCPNJnCMAccmmgn1Jlpln/IfBszgHXlUhFFS25YTfuD1D\n\tNZl5XYqShiboaqcoAfmbh1t8lmJggs9YZCtkp4YK4EHLp0cq/lqjsF5Goo+VUZzRoD\n\tZMo3i5fvSW8lRY9Dhuz80IuxY66ykhamYscgeBkhMC6BueGGYnGLfinoD9uyv1lyyD\n\toGkpqMezT9bnCrYPpNoZI8OSbjjn/Z4eqZlrIPMoGxhqB75/pc8RSAGEWKt/ldallr\n\tP9zuLQRQpUgrQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1664172265;\n\tbh=1n06J8uYiBWLqE+gjr16s8MMYGBSuT7uNziI1FigByQ=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=Xc5aFDQzrMfVtvwchNA/DmGRLDQke6PnbbjlZeClbwnkHxFgv1rSk3QHQ5YQ+w6Dq\n\ttEKab0rHAbfz8n6pIpNqF18yjKo4JQJ2u4tfu5fPvkM6WTI0KsqqzJzg7pX7OgP2h3\n\tuWBXiFGVBMKeUZFxCoCidXq6fJnXsGeR9glFaUSM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Xc5aFDQz\"; dkim-atps=neutral","Message-ID":"<82e588ca-de81-7281-241f-a2d40457d851@ideasonboard.com>","Date":"Mon, 26 Sep 2022 11:34:16 +0530","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.2.1","To":"Rishikesh Donadkar <rishikeshdonadkar@gmail.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","References":"<20220919025709.34528-1-rishikeshdonadkar@gmail.com>\n\t<9c9ee26d-8490-8c69-aec1-2cbe55cecd1b@ideasonboard.com>\n\t<CAEQmg0kxh1ainovJQJEDDtCdW5uuttLaLHnLkfQchwBQ-3VzMg@mail.gmail.com>\n\t<YyiknWEW6Hcy09Lc@pendragon.ideasonboard.com>\n\t<CAEQmg0k2CZs1E3vCJecmRQDV-KYHq+3nX-CfmfSWaKm4yrib6w@mail.gmail.com>","Content-Language":"en-US","In-Reply-To":"<CAEQmg0k2CZs1E3vCJecmRQDV-KYHq+3nX-CfmfSWaKm4yrib6w@mail.gmail.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","Subject":"Re: [libcamera-devel] [PATCH v6 0/1] Provide multiple colorimetry\n\tfor libcamerasrc.","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>","Cc":"libcamera-devel@lists.libcamera.org, vedantparanjape160201@gmail.com,\n\tnicolas.dufresne@collabora.com","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]