[libcamera-devel] [PATCH 1/3] libcamera: pipeline_handler: Make cameraData() a const operation
Niklas Söderlund
niklas.soderlund at ragnatech.se
Thu Aug 6 14:53:28 CEST 2020
There is nothing blocking cameraData() from being a constant operation.
The assert already enforces that a std::map::at() operation would always
succeed. Switch to using at() and mark the method as a const operation.
Signed-off-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>
---
include/libcamera/internal/pipeline_handler.h | 2 +-
src/libcamera/pipeline_handler.cpp | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h
index 22e629a8401d1e4e..d5321ef56df358d0 100644
--- a/include/libcamera/internal/pipeline_handler.h
+++ b/include/libcamera/internal/pipeline_handler.h
@@ -96,7 +96,7 @@ protected:
virtual int queueRequestDevice(Camera *camera, Request *request) = 0;
- CameraData *cameraData(const Camera *camera);
+ CameraData *cameraData(const Camera *camera) const;
CameraManager *manager_;
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index ccd45edc847b9e3f..bc9c1d4b09c5437d 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -595,10 +595,10 @@ void PipelineHandler::disconnect()
* valid until the pipeline handler is destroyed. It shall not be deleted
* manually by the caller.
*/
-CameraData *PipelineHandler::cameraData(const Camera *camera)
+CameraData *PipelineHandler::cameraData(const Camera *camera) const
{
ASSERT(cameraData_.count(camera));
- return cameraData_[camera].get();
+ return cameraData_.at(camera).get();
}
/**
--
2.28.0
More information about the libcamera-devel
mailing list