From b9bf9514eb7b08220763d7d72c3b1b83bdfe6ab0 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Thu, 27 Jun 2019 15:33:04 +0100 Subject: libcamera: camera: Provide a list of ControlInfo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extend the Camera class to expose the controls it supports. Each pipeline should generate a list of controls supported by each camera it creates. These are represented by a ControlInfoMap, and an associated ControlList of default values. Signed-off-by: Kieran Bingham Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi Reviewed-by: Niklas Söderlund --- src/libcamera/pipeline_handler.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/libcamera/pipeline_handler.cpp') diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp index c91ef2f7..0283e4e5 100644 --- a/src/libcamera/pipeline_handler.cpp +++ b/src/libcamera/pipeline_handler.cpp @@ -88,6 +88,14 @@ LOG_DEFINE_CATEGORY(Pipeline) * PipelineHandler::completeRequest() */ +/** + * \var CameraData::controlInfo_ + * \brief The set of controls supported by the camera + * + * The control information shall be initialised by the pipeline handler when + * creating the camera, and shall not be modified afterwards. + */ + /** * \class PipelineHandler * \brief Create and manage cameras based on a set of media devices @@ -217,6 +225,17 @@ void PipelineHandler::unlock() media->unlock(); } +/** + * \brief Retrieve the list of controls for a camera + * \param[in] camera The camera + * \return A ControlInfoMap listing the controls support by \a camera + */ +const ControlInfoMap &PipelineHandler::controls(Camera *camera) +{ + CameraData *data = cameraData(camera); + return data->controlInfo_; +} + /** * \fn PipelineHandler::generateConfiguration() * \brief Generate a camera configuration for a specified camera -- cgit v1.2.1