[libcamera-devel] [PATCH 3/3] libcamera: pipeline: Register device numbers with camera
Kieran Bingham
kieran.bingham at ideasonboard.com
Wed Apr 19 10:58:21 CEST 2023
Register the identified device numbers with each camera as the Devices
property.
This facilitates camera daemons or other systems to identify which
devices are being managed by libcamera, and can prevent duplication of
camera resources.
Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
src/libcamera/pipeline_handler.cpp | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index f72613b8e515..66e7def51cd1 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -18,6 +18,7 @@
#include <libcamera/camera.h>
#include <libcamera/camera_manager.h>
#include <libcamera/framebuffer.h>
+#include <libcamera/property_ids.h>
#include "libcamera/internal/camera.h"
#include "libcamera/internal/device_enumerator.h"
@@ -624,6 +625,13 @@ void PipelineHandler::registerCamera(std::shared_ptr<Camera> camera)
}
}
+ /*
+ * Store the associated devices as a property of the camera to allow
+ * systems to identify which devices are managed by libcamera.
+ */
+ Camera::Private *data = camera->_d();
+ data->properties_.set(properties::Devices, devnums);
+
manager_->addCamera(std::move(camera), devnums);
}
--
2.34.1
More information about the libcamera-devel
mailing list