[{"id":27543,"web_url":"https://patchwork.libcamera.org/comment/27543/","msgid":"<CAEmqJPp_RFinDkeigg0J9n8zTw=7XX=be-oxf_o-QPrcSoyG2Q@mail.gmail.com>","date":"2023-07-12T10:56:16","subject":"Re: [libcamera-devel] [PATCH v1 1/3] libcamera: rpi: pipeline_base:\n\tRemove populateSensorFormats()","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi Jacopo,\n\nThank you for your work.\n\nOn Wed, 12 Jul 2023 at 11:55, Naushir Patuck <naush@raspberrypi.com> wrote:\n>\n> From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n>\n> populateSensorFormats() is a static helper that is called from a single\n> place and performs a simple loop over the sensor camera formats.\n>\n> Remove it and in-line it in the caller to remove one static helper from\n> the pipeline_base.cpp file.\n>\n> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\n> ---\n>  .../pipeline/rpi/common/pipeline_base.cpp         | 15 ++++-----------\n>  1 file changed, 4 insertions(+), 11 deletions(-)\n>\n> diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> index 179a5b81a516..fb3756a47590 100644\n> --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> @@ -66,16 +66,6 @@ PixelFormat mbusCodeToPixelFormat(unsigned int mbus_code,\n>         return pix;\n>  }\n>\n> -SensorFormats populateSensorFormats(std::unique_ptr<CameraSensor> &sensor)\n> -{\n> -       SensorFormats formats;\n> -\n> -       for (auto const mbusCode : sensor->mbusCodes())\n> -               formats.emplace(mbusCode, sensor->sizes(mbusCode));\n> -\n> -       return formats;\n> -}\n> -\n>  bool isMonoSensor(std::unique_ptr<CameraSensor> &sensor)\n>  {\n>         unsigned int mbusCode = sensor->mbusCodes()[0];\n> @@ -804,7 +794,10 @@ int PipelineHandlerBase::registerCamera(std::unique_ptr<RPi::CameraData> &camera\n>         if (data->sensor_->init())\n>                 return -EINVAL;\n>\n> -       data->sensorFormats_ = populateSensorFormats(data->sensor_);\n> +       /* Populate the map of sensor supported formats and sizes. */\n> +       for (auto const mbusCode : data->sensor_->mbusCodes())\n> +               data->sensorFormats_.emplace(mbusCode,\n> +                                            data->sensor_->sizes(mbusCode));\n>\n>         /*\n>          * Enumerate all the Video Mux/Bridge devices across the sensor -> Fr\n> --\n> 2.34.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 3BF31BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 12 Jul 2023 10:56:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E88D2628BC;\n\tWed, 12 Jul 2023 12:56:34 +0200 (CEST)","from mail-yw1-x1133.google.com (mail-yw1-x1133.google.com\n\t[IPv6:2607:f8b0:4864:20::1133])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 34822628BB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 12 Jul 2023 12:56:33 +0200 (CEST)","by mail-yw1-x1133.google.com with SMTP id\n\t00721157ae682-56fff21c2ebso76226047b3.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 12 Jul 2023 03:56:33 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1689159394;\n\tbh=J3L8sMbTw5K4q2q6dTTnRp99lJyXHDYiy45VX7IAcaE=;\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=SgE13fCaluqM8OePWDVuGbFK/o/XGrfzyIaT/7kFHttq/2GVhjQRBDDaMJC3osCq3\n\t2g6UfSlOs/uCYRQIYXNawckk/NnYN/vqccIMUAYJl7IO/DaT4zjRS7hbeQMUC9joFt\n\tTw/v/Mix7FW0JdtQc/IhBkwFHM1Fb0KOP8yKAPvBMLJxTZ0XI7mbER4GKERNm3Ytwj\n\tcAbhgB1rZqD0VT53rSZ0IHiPUZfJXCY2TwyhheVVWGyWf5stm/LpZBsh+ysT0iD3YM\n\tLuMEZ+ENt6wwFrvzX4rmmDOPtbWsI6oZTykQ+v43rpHZaFsVuhylPDuijYf+h4PBbQ\n\tdvYjLiTeBf0Zg==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1689159392; x=1691751392;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=eFahkOzh4NS2iScCYDr+1xuD218PXis2QdGNa6iM2R8=;\n\tb=osXv/Q12/e4X4pqX8uaf2zHG9cQCiTlAkdZx89c+PVukdKSJUuEThQSR6SB9RgZz/4\n\t2VAccz1CeiR/3O2nmWJv6VE1zfPtZ1V+LWd28Um5NdYnb325rML40i8iKqX8PHSqoy0N\n\tLzyfZLhK+TMTjnWehP1+PdjVOUnWo3Lu4jpuguWdJW2PueH6HFAgqJGNCvOQ0eXMMA/C\n\tVsTORqEaM8KkwVGp3pQMDLn5q5pyutWSbb3KqYon09F0lVt39jcPmeMr9cLFkBgTN9si\n\t3az4t7ZsnYxEc2yH4NHlcj2tlHLjb1XcxVwQ/wvyvtpdSPJi/f898+D2myC5eIvkn0hU\n\tRULw=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"osXv/Q12\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20221208; t=1689159392; x=1691751392;\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:message-id\n\t:reply-to;\n\tbh=eFahkOzh4NS2iScCYDr+1xuD218PXis2QdGNa6iM2R8=;\n\tb=cSeFkAZfjwUjCXh3weh4UNER1eILvBk+0cbxoKXNWgEMs0Q4mLXK7ltv0FbiwQ7mpR\n\taKCVaanefdKRD92FO0b6+BTpvh87i+KiSKK6wgIoFhMEMkUWsiYTgOa2X01jznRi87Id\n\tUlMve3frifp0QBmStG0f8SNEzXR/QD2lMNhu82Wh/XVMo4PVf8dSNUdqRVShRYJM4H0/\n\tBhujs98n0//3DONolouJZB+hTxB4xDekxpwGFA6HkYt0Mr0mjeqwG5hFHT7dqZ2gdJaq\n\txdUJkppLHK5RsMUd2c11hMVIjUS7S1gX9awIpDwSLXJJHMGFzeMiG7rsnKsGVuW+sQto\n\tX+qw==","X-Gm-Message-State":"ABy/qLY1jxR8VG0jNRi944Dj4RGM3+0JztIQ5mX49zDMESuOkXMMpejS\n\t6DlVfwg2Wqiezr8JcbE8L9xyUPMs4GWFzY6KRJKZJPVOK1uo5AlnMEA=","X-Google-Smtp-Source":"APBJJlGenPBNZ5X4aNjtQ5eIp8o17r9PfRdkOu8NIOsqYLpWeV3zVf8hRDQ6OxS16t4iJHYAlXROyO7+LsNraUWDb+k=","X-Received":"by 2002:a81:6ec1:0:b0:576:82d7:7a with SMTP id\n\tj184-20020a816ec1000000b0057682d7007amr17769746ywc.43.1689159391863; \n\tWed, 12 Jul 2023 03:56:31 -0700 (PDT)","MIME-Version":"1.0","References":"<20230712105510.14658-1-naush@raspberrypi.com>\n\t<20230712105510.14658-2-naush@raspberrypi.com>","In-Reply-To":"<20230712105510.14658-2-naush@raspberrypi.com>","Date":"Wed, 12 Jul 2023 11:56:16 +0100","Message-ID":"<CAEmqJPp_RFinDkeigg0J9n8zTw=7XX=be-oxf_o-QPrcSoyG2Q@mail.gmail.com>","To":"libcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v1 1/3] libcamera: rpi: pipeline_base:\n\tRemove populateSensorFormats()","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":"Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":27551,"web_url":"https://patchwork.libcamera.org/comment/27551/","msgid":"<168934073108.137962.13479981758265796121@Monstersaurus>","date":"2023-07-14T13:18:51","subject":"Re: [libcamera-devel] [PATCH v1 1/3] libcamera: rpi: pipeline_base:\n\tRemove populateSensorFormats()","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Naushir Patuck via libcamera-devel (2023-07-12 11:56:16)\n> Hi Jacopo,\n> \n> Thank you for your work.\n> \n> On Wed, 12 Jul 2023 at 11:55, Naushir Patuck <naush@raspberrypi.com> wrote:\n> >\n> > From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> >\n> > populateSensorFormats() is a static helper that is called from a single\n> > place and performs a simple loop over the sensor camera formats.\n> >\n> > Remove it and in-line it in the caller to remove one static helper from\n> > the pipeline_base.cpp file.\n> >\n> > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> \n> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> > ---\n> >  .../pipeline/rpi/common/pipeline_base.cpp         | 15 ++++-----------\n> >  1 file changed, 4 insertions(+), 11 deletions(-)\n> >\n> > diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> > index 179a5b81a516..fb3756a47590 100644\n> > --- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> > +++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp\n> > @@ -66,16 +66,6 @@ PixelFormat mbusCodeToPixelFormat(unsigned int mbus_code,\n> >         return pix;\n> >  }\n> >\n> > -SensorFormats populateSensorFormats(std::unique_ptr<CameraSensor> &sensor)\n> > -{\n> > -       SensorFormats formats;\n> > -\n> > -       for (auto const mbusCode : sensor->mbusCodes())\n> > -               formats.emplace(mbusCode, sensor->sizes(mbusCode));\n> > -\n> > -       return formats;\n> > -}\n> > -\n> >  bool isMonoSensor(std::unique_ptr<CameraSensor> &sensor)\n> >  {\n> >         unsigned int mbusCode = sensor->mbusCodes()[0];\n> > @@ -804,7 +794,10 @@ int PipelineHandlerBase::registerCamera(std::unique_ptr<RPi::CameraData> &camera\n> >         if (data->sensor_->init())\n> >                 return -EINVAL;\n> >\n> > -       data->sensorFormats_ = populateSensorFormats(data->sensor_);\n> > +       /* Populate the map of sensor supported formats and sizes. */\n> > +       for (auto const mbusCode : data->sensor_->mbusCodes())\n> > +               data->sensorFormats_.emplace(mbusCode,\n> > +                                            data->sensor_->sizes(mbusCode));\n> >\n> >         /*\n> >          * Enumerate all the Video Mux/Bridge devices across the sensor -> Fr\n> > --\n> > 2.34.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 2F7A3BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 14 Jul 2023 13:18:57 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 47C10628C0;\n\tFri, 14 Jul 2023 15:18:56 +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 77AE160382\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 14 Jul 2023 15:18:54 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4D3087F3;\n\tFri, 14 Jul 2023 15:18:03 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1689340736;\n\tbh=LDCWR29WMLdABNJgGeKn9D+mWjxgOhrXnJKD1q1BrEs=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=WWyqRGK7Plyrlgtq+v1xr1LzHHAlh6r1MOOK0xDFwh1WkZsf7e7BRkZVGyBMRHhXr\n\t8x/ZOyuxWO21TJ5O+4L5ieVybrp3SxC3OSYLaGGlz754j5w//gKqjoR7g9c+Z3PzPk\n\t7iAuxxLE4ibY+r+W0MNIGEJL/6OM2kDsabR9OAYTY8AfLoDL9CV8Ez52+wJgLguxxH\n\t8ar2AZtOr4BVFCX1IpO4Aom/oFzKmImbQdpRllamg8+1WAvLhSTbt872CZiktu6/LU\n\tcpOrMyMiug0GiXyzizybATZuhyvBal1wodFwT5xmbaWKHc3gltzjQf6jilK3Z0kC1L\n\tONiwE/n9yRIjQ==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1689340683;\n\tbh=LDCWR29WMLdABNJgGeKn9D+mWjxgOhrXnJKD1q1BrEs=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=nUeu/499n0Dx6rx1jRJzBz/Oxewlf9j+hBxjqCM/8cftpAKQ+e7mS0qgVG+5rPaFQ\n\t4qBIjXZ+uDZadF+a+Xuyc7NvOemSHr/8BRKuzasUDcnWZFHSCv2qqrntWfgGhHNtYg\n\t7TyK1e9q6rqThSDmzAfD1lPZUq8FqAZSk6YaIXlQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"nUeu/499\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<CAEmqJPp_RFinDkeigg0J9n8zTw=7XX=be-oxf_o-QPrcSoyG2Q@mail.gmail.com>","References":"<20230712105510.14658-1-naush@raspberrypi.com>\n\t<20230712105510.14658-2-naush@raspberrypi.com>\n\t<CAEmqJPp_RFinDkeigg0J9n8zTw=7XX=be-oxf_o-QPrcSoyG2Q@mail.gmail.com>","To":"Naushir Patuck <naush@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Fri, 14 Jul 2023 14:18:51 +0100","Message-ID":"<168934073108.137962.13479981758265796121@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH v1 1/3] libcamera: rpi: pipeline_base:\n\tRemove populateSensorFormats()","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":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]