[{"id":35052,"web_url":"https://patchwork.libcamera.org/comment/35052/","msgid":"<175328934850.50296.3946719835093095636@ping.linuxembedded.co.uk>","date":"2025-07-23T16:49:08","subject":"Re: [PATCH v2 5/8] libcamera: camera_manager: Add LayerManager","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Paul Elder (2025-07-03 12:42:20)\n> Add to the CameraManager a LayerManager member. This allows us to have\n> one LayerManager that handles loading all the layer shared objects, and\n> then each Camera can access the layer via the LayerManager via through\n> the CameraManager.\n\nI'm not sure if that's right ? Wouldn't each Camera be able to decide to\nhave different layers enabled (perhaps as part of the configuration\nfile).\n\nI.e. ... should we enable layers per-camera ?\n\nFor instance - a sync algo layer - would be per camera with specific\noptions on each camera instance.\n\nAlthough - we likely want to only load the shared objects once - and\nthen use them on a configurable basis in the camera object...\n\nSo I think the LayerManager is probably accurate for being the loading\nmechanism - and that indeed can be part of the CameraManager as they\nhave to be loaded before the Cameras are constructed...\n\nSo I think this patch indeed is suitable... but I wonder how the other\npatches might adapt around it or later.\n\n\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n> \n> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> \n> ---\n> New in v2\n> ---\n>  include/libcamera/internal/camera_manager.h | 3 +++\n>  src/libcamera/camera_manager.cpp            | 2 ++\n>  2 files changed, 5 insertions(+)\n> \n> diff --git a/include/libcamera/internal/camera_manager.h b/include/libcamera/internal/camera_manager.h\n> index 0150ca61f7de..ef5b0688de23 100644\n> --- a/include/libcamera/internal/camera_manager.h\n> +++ b/include/libcamera/internal/camera_manager.h\n> @@ -25,6 +25,7 @@ namespace libcamera {\n>  class Camera;\n>  class DeviceEnumerator;\n>  class IPAManager;\n> +class LayerManager;\n>  class PipelineHandlerFactoryBase;\n>  \n>  class CameraManager::Private : public Extensible::Private, public Thread\n> @@ -39,6 +40,7 @@ public:\n>         void removeCamera(std::shared_ptr<Camera> camera) LIBCAMERA_TSA_EXCLUDES(mutex_);\n>  \n>         IPAManager *ipaManager() const { return ipaManager_.get(); }\n> +       LayerManager *layerManager() const { return layerManager_.get(); }\n>  \n>  protected:\n>         void run() override;\n> @@ -66,6 +68,7 @@ private:\n>  \n>         std::unique_ptr<IPAManager> ipaManager_;\n>         ProcessManager processManager_;\n> +       std::unique_ptr<LayerManager> layerManager_;\n>  };\n>  \n>  } /* namespace libcamera */\n> diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp\n> index e62e7193cfdc..0f202fc6314e 100644\n> --- a/src/libcamera/camera_manager.cpp\n> +++ b/src/libcamera/camera_manager.cpp\n> @@ -15,6 +15,7 @@\n>  \n>  #include \"libcamera/internal/camera.h\"\n>  #include \"libcamera/internal/device_enumerator.h\"\n> +#include \"libcamera/internal/layer_manager.h\"\n>  #include \"libcamera/internal/ipa_manager.h\"\n>  #include \"libcamera/internal/pipeline_handler.h\"\n>  \n> @@ -41,6 +42,7 @@ CameraManager::Private::Private()\n>         : initialized_(false)\n>  {\n>         ipaManager_ = std::make_unique<IPAManager>();\n> +       layerManager_ = std::make_unique<LayerManager>();\n>  }\n>  \n>  int CameraManager::Private::start()\n> -- \n> 2.47.2\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 1C4EBBDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 23 Jul 2025 16:49:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C1EAE69064;\n\tWed, 23 Jul 2025 18:49:13 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2D8AF69057\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 23 Jul 2025 18:49:12 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B0CA5DF3;\n\tWed, 23 Jul 2025 18:48:33 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"EUc34w4s\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1753289313;\n\tbh=x015qh5yivVAsDrQVG7ycvgrVNXEf1qIZVnuAoTr26g=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=EUc34w4sIHWtWHB2qZL2MoH4UiaA60K4+Z1py+S0tmFZr6p6442Q1ZPYBmxlzrNf0\n\toWKNsWOJmXcCB5CwHsa0dE1PfLLR9ZPHA5QPKxUWdPQF3VWUw7nORdJzq1ptQQL2Z0\n\tR3Ag++DJ9/xh99f8X7O5t8VJRM684hRbP3kCSj2M=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250703114225.2074071-6-paul.elder@ideasonboard.com>","References":"<20250703114225.2074071-1-paul.elder@ideasonboard.com>\n\t<20250703114225.2074071-6-paul.elder@ideasonboard.com>","Subject":"Re: [PATCH v2 5/8] libcamera: camera_manager: Add LayerManager","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Paul Elder <paul.elder@ideasonboard.com>, barnabas.pocze@ideasonboard.com","To":"Paul Elder <paul.elder@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Wed, 23 Jul 2025 17:49:08 +0100","Message-ID":"<175328934850.50296.3946719835093095636@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":35078,"web_url":"https://patchwork.libcamera.org/comment/35078/","msgid":"<175334355322.774292.18294892456977516630@neptunite.rasen.tech>","date":"2025-07-24T07:52:33","subject":"Re: [PATCH v2 5/8] libcamera: camera_manager: Add LayerManager","submitter":{"id":17,"url":"https://patchwork.libcamera.org/api/people/17/","name":"Paul Elder","email":"paul.elder@ideasonboard.com"},"content":"Quoting Kieran Bingham (2025-07-24 01:49:08)\n> Quoting Paul Elder (2025-07-03 12:42:20)\n> > Add to the CameraManager a LayerManager member. This allows us to have\n> > one LayerManager that handles loading all the layer shared objects, and\n> > then each Camera can access the layer via the LayerManager via through\n> > the CameraManager.\n> \n> I'm not sure if that's right ? Wouldn't each Camera be able to decide to\n> have different layers enabled (perhaps as part of the configuration\n> file).\n\nWe'd need the configuration file for that. For the time being it's by\nenvironment variable, so all layers will be enabled for all cameras.\n\n> \n> I.e. ... should we enable layers per-camera ?\n\nAfter we get configuration file support, yes.\n\n> \n> For instance - a sync algo layer - would be per camera with specific\n> options on each camera instance.\n\nThis also needs configuration file support. At the moment (also how Raspberry\nPi does it), there's a control to tell the sync algo whether it's server or\nclient, but all the other sync algo parameters are hardcoded and need\nconfiguration file support to support configuration.\n\n> \n> Although - we likely want to only load the shared objects once - and\n> then use them on a configurable basis in the camera object...\n\nYes.\n\n> \n> So I think the LayerManager is probably accurate for being the loading\n> mechanism - and that indeed can be part of the CameraManager as they\n> have to be loaded before the Cameras are constructed...\n> \n> So I think this patch indeed is suitable... but I wonder how the other\n> patches might adapt around it or later.\n> \n> \n> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n\nThanks,\n\nPaul\n\n> \n> > \n> > Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>\n> > \n> > ---\n> > New in v2\n> > ---\n> >  include/libcamera/internal/camera_manager.h | 3 +++\n> >  src/libcamera/camera_manager.cpp            | 2 ++\n> >  2 files changed, 5 insertions(+)\n> > \n> > diff --git a/include/libcamera/internal/camera_manager.h b/include/libcamera/internal/camera_manager.h\n> > index 0150ca61f7de..ef5b0688de23 100644\n> > --- a/include/libcamera/internal/camera_manager.h\n> > +++ b/include/libcamera/internal/camera_manager.h\n> > @@ -25,6 +25,7 @@ namespace libcamera {\n> >  class Camera;\n> >  class DeviceEnumerator;\n> >  class IPAManager;\n> > +class LayerManager;\n> >  class PipelineHandlerFactoryBase;\n> >  \n> >  class CameraManager::Private : public Extensible::Private, public Thread\n> > @@ -39,6 +40,7 @@ public:\n> >         void removeCamera(std::shared_ptr<Camera> camera) LIBCAMERA_TSA_EXCLUDES(mutex_);\n> >  \n> >         IPAManager *ipaManager() const { return ipaManager_.get(); }\n> > +       LayerManager *layerManager() const { return layerManager_.get(); }\n> >  \n> >  protected:\n> >         void run() override;\n> > @@ -66,6 +68,7 @@ private:\n> >  \n> >         std::unique_ptr<IPAManager> ipaManager_;\n> >         ProcessManager processManager_;\n> > +       std::unique_ptr<LayerManager> layerManager_;\n> >  };\n> >  \n> >  } /* namespace libcamera */\n> > diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp\n> > index e62e7193cfdc..0f202fc6314e 100644\n> > --- a/src/libcamera/camera_manager.cpp\n> > +++ b/src/libcamera/camera_manager.cpp\n> > @@ -15,6 +15,7 @@\n> >  \n> >  #include \"libcamera/internal/camera.h\"\n> >  #include \"libcamera/internal/device_enumerator.h\"\n> > +#include \"libcamera/internal/layer_manager.h\"\n> >  #include \"libcamera/internal/ipa_manager.h\"\n> >  #include \"libcamera/internal/pipeline_handler.h\"\n> >  \n> > @@ -41,6 +42,7 @@ CameraManager::Private::Private()\n> >         : initialized_(false)\n> >  {\n> >         ipaManager_ = std::make_unique<IPAManager>();\n> > +       layerManager_ = std::make_unique<LayerManager>();\n> >  }\n> >  \n> >  int CameraManager::Private::start()\n> > -- \n> > 2.47.2\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 733C0BDCC1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 24 Jul 2025 07:52:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 21BCF690AA;\n\tThu, 24 Jul 2025 09:52:41 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4DC1E6909B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Jul 2025 09:52:39 +0200 (CEST)","from neptunite.rasen.tech (unknown\n\t[IPv6:2404:7a81:160:2100:be7f:7fca:78b4:1343])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id 0AD0DC79;\n\tThu, 24 Jul 2025 09:51:59 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"WDWdTeus\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1753343520;\n\tbh=eWQE8c+63Tl4Ta/KXPYq4794fiZ1H4PlYbW3qagbreo=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=WDWdTeuscMgWNyKU/fHwDI20q/2oHI9SZG+qL65O91SQY1CUdFwm7LCAzDECKgEJu\n\tIYDGvoWmKhLlcdhE7uhR8+wNGaR/yTCdv+NVIPxEVzg7n335g0J2dMcUoZM4DHHN50\n\trgEcgTa/CAxTJZ8qu1z+KW/QCsEmUaucIsPcbwfw=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<175328934850.50296.3946719835093095636@ping.linuxembedded.co.uk>","References":"<20250703114225.2074071-1-paul.elder@ideasonboard.com>\n\t<20250703114225.2074071-6-paul.elder@ideasonboard.com>\n\t<175328934850.50296.3946719835093095636@ping.linuxembedded.co.uk>","Subject":"Re: [PATCH v2 5/8] libcamera: camera_manager: Add LayerManager","From":"Paul Elder <paul.elder@ideasonboard.com>","Cc":"barnabas.pocze@ideasonboard.com","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Thu, 24 Jul 2025 16:52:33 +0900","Message-ID":"<175334355322.774292.18294892456977516630@neptunite.rasen.tech>","User-Agent":"alot/0.0.0","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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]