From f8951ee720a817c4802189ee3a5bc26a2fc5794d Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Wed, 20 Nov 2019 16:36:34 +0100 Subject: libcamera: camera: Add Camera properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a method to the Camera class to retrieve the Camera properties registered by the pipeline handler. While at it, reword the Camera::controls() operation documentation to specify that the camera control information are constant during the camera lifetime not their value, while the camera properties value are the actually static information. Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Signed-off-by: Jacopo Mondi --- include/libcamera/camera.h | 1 + src/libcamera/camera.cpp | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h index c37319ed..c453b952 100644 --- a/include/libcamera/camera.h +++ b/include/libcamera/camera.h @@ -86,6 +86,7 @@ public: int release(); const ControlInfoMap &controls(); + const ControlList &properties(); const std::set &streams() const; std::unique_ptr generateConfiguration(const StreamRoles &roles); diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp index 44f2d71b..63b1f772 100644 --- a/src/libcamera/camera.cpp +++ b/src/libcamera/camera.cpp @@ -652,7 +652,8 @@ int Camera::release() /** * \brief Retrieve the list of controls supported by the camera * - * Camera controls remain constant through the lifetime of the camera. + * The list of controls supported by the camera and their associated + * constraints remain constant through the lifetime of the Camera object. * * \context This function is \threadsafe. * @@ -663,6 +664,19 @@ const ControlInfoMap &Camera::controls() return p_->pipe_->controls(this); } +/** + * \brief Retrieve the list of properties of the camera + * + * Camera properties are static information that describe the capabilities of + * the camera. They remain constant through the lifetime of the Camera object. + * + * \return A ControlList of properties supported by the camera + */ +const ControlList &Camera::properties() +{ + return p_->pipe_->properties(this); +} + /** * \brief Retrieve all the camera's stream information * -- cgit v1.2.1