[v4,5/8] libcamera: camera_manager: Add LayerManager
diff mbox series

Message ID 20250825114219.562831-6-paul.elder@ideasonboard.com
State New
Headers show
Series
  • Add Layers support
Related show

Commit Message

Paul Elder Aug. 25, 2025, 11:42 a.m. UTC
Add to the CameraManager a LayerManager member. This allows us to have
one LayerManager that handles loading all the layer shared objects, and
then each Camera can access the layer via the LayerManager via through
the CameraManager.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

---
Changes in v4:
- Put LayerManager directly in CameraManager, as opposed to a unique
  pointer

No change in v3

New in v2
---
 include/libcamera/internal/camera_manager.h | 3 +++
 src/libcamera/camera_manager.cpp            | 1 +
 2 files changed, 4 insertions(+)

Patch
diff mbox series

diff --git a/include/libcamera/internal/camera_manager.h b/include/libcamera/internal/camera_manager.h
index 5dfbe1f6546c..ff4197f47acb 100644
--- a/include/libcamera/internal/camera_manager.h
+++ b/include/libcamera/internal/camera_manager.h
@@ -18,6 +18,7 @@ 
 #include <libcamera/base/thread.h>
 #include <libcamera/base/thread_annotations.h>
 
+#include "libcamera/internal/layer_manager.h"
 #include "libcamera/internal/process.h"
 
 namespace libcamera {
@@ -39,6 +40,7 @@  public:
 	void removeCamera(std::shared_ptr<Camera> camera) LIBCAMERA_TSA_EXCLUDES(mutex_);
 
 	IPAManager *ipaManager() const { return ipaManager_.get(); }
+	const LayerManager *layerManager() const { return &layerManager_; }
 
 protected:
 	void run() override;
@@ -65,6 +67,7 @@  private:
 	std::unique_ptr<DeviceEnumerator> enumerator_;
 
 	std::unique_ptr<IPAManager> ipaManager_;
+	LayerManager layerManager_;
 };
 
 } /* namespace libcamera */
diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp
index f81794bfd6fe..a2505a5a12a3 100644
--- a/src/libcamera/camera_manager.cpp
+++ b/src/libcamera/camera_manager.cpp
@@ -15,6 +15,7 @@ 
 
 #include "libcamera/internal/camera.h"
 #include "libcamera/internal/device_enumerator.h"
+#include "libcamera/internal/layer_manager.h"
 #include "libcamera/internal/ipa_manager.h"
 #include "libcamera/internal/pipeline_handler.h"