summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-08-06 14:36:23 +0200
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-08-16 13:50:03 +0200
commit0b9d8eb265a16a0dda650700759066b714f8fd0c (patch)
tree16ef4c028aa85cfbebeac4f8964e9f631293e4cb
parentef5f5c4db05e5d88d58b0d565f7716c59751b991 (diff)
libcamera: pipeline_handler: Mark controls() and properties() as const operations
Reading the controls and properties does not modify the pipeline's state and can be marked as const operations. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r--include/libcamera/internal/pipeline_handler.h4
-rw-r--r--src/libcamera/pipeline_handler.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h
index c1873df0..a4e1b529 100644
--- a/include/libcamera/internal/pipeline_handler.h
+++ b/include/libcamera/internal/pipeline_handler.h
@@ -68,8 +68,8 @@ public:
bool lock();
void unlock();
- const ControlInfoMap &controls(Camera *camera);
- const ControlList &properties(Camera *camera);
+ const ControlInfoMap &controls(const Camera *camera) const;
+ const ControlList &properties(const Camera *camera) const;
virtual CameraConfiguration *generateConfiguration(Camera *camera,
const StreamRoles &roles) = 0;
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index 73c51972..918aea1e 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -257,9 +257,9 @@ void PipelineHandler::unlock()
* \context This function is \threadsafe.
* \return A ControlInfoMap listing the controls support by \a camera
*/
-const ControlInfoMap &PipelineHandler::controls(Camera *camera)
+const ControlInfoMap &PipelineHandler::controls(const Camera *camera) const
{
- CameraData *data = cameraData(camera);
+ const CameraData *data = cameraData(camera);
return data->controlInfo_;
}
@@ -268,9 +268,9 @@ const ControlInfoMap &PipelineHandler::controls(Camera *camera)
* \param[in] camera The camera
* \return A ControlList of properties supported by \a camera
*/
-const ControlList &PipelineHandler::properties(Camera *camera)
+const ControlList &PipelineHandler::properties(const Camera *camera) const
{
- CameraData *data = cameraData(camera);
+ const CameraData *data = cameraData(camera);
return data->properties_;
}