summaryrefslogtreecommitdiff
path: root/src/libcamera/camera_sensor.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-06-30 15:24:08 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-07-02 16:59:19 +0300
commita110cc94ab5dfb26bf6a5eae61ea5ba2deb6d3f3 (patch)
tree60979b897f51e184cc4f2618312d696056682bc4 /src/libcamera/camera_sensor.cpp
parentbd0245a0dc6ff036dc25dee1f776e03e84c02953 (diff)
libcamera: v4l2_device: Add method to retrieve all supported controls
Add a new controls() method to the V4L2Device class to retrieve the map of all supported controls. This is needed in order to dynamically query the supported controls, for instance for drivers that support different sets of controls depending on the device model. To make the API easier to use, create a type alias for the control ID to ControlInfo and use it. Remove the getControlInfo() method that is not used externally, as it can now be replaced by accessing the full list of controls. Update the CameraSensor API accordingly. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/libcamera/camera_sensor.cpp')
-rw-r--r--src/libcamera/camera_sensor.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp
index 471c3e2e..a7670b44 100644
--- a/src/libcamera/camera_sensor.cpp
+++ b/src/libcamera/camera_sensor.cpp
@@ -248,14 +248,12 @@ int CameraSensor::setFormat(V4L2SubdeviceFormat *format)
}
/**
- * \brief Retrieve information about a control
- * \param[in] id The control ID
- * \return A pointer to the V4L2ControlInfo for control \a id, or nullptr
- * if the sensor doesn't have such a control
+ * \brief Retrieve the supported V4L2 controls and their information
+ * \return A map of the V4L2 controls supported by the sensor
*/
-const V4L2ControlInfo *CameraSensor::getControlInfo(unsigned int id) const
+const V4L2ControlInfoMap &CameraSensor::controls() const
{
- return subdev_->getControlInfo(id);
+ return subdev_->controls();
}
/**