From 79ab0e925a782a6781d38237435fcfc29ddd2e20 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sun, 26 Apr 2020 02:08:37 +0300 Subject: libcamera: v4l2_device: Simplify usage of getControls() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The V4L2Device::getControls() function takes a ControlList that needs to be pre-populated with dummy entries for the controls that need to be read. This is a cumbersome API, especially when reading a single control. Make it nicer by passing the list of V4L2 controls as a vector of control IDs, and returning a ControlList. Signed-off-by: Laurent Pinchart Reviewed-by: Jacopo Mondi Reviewed-by: Niklas Söderlund --- src/libcamera/include/camera_sensor.h | 2 +- src/libcamera/include/v4l2_device.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/libcamera/include') diff --git a/src/libcamera/include/camera_sensor.h b/src/libcamera/include/camera_sensor.h index 99cff981..5277f7f7 100644 --- a/src/libcamera/include/camera_sensor.h +++ b/src/libcamera/include/camera_sensor.h @@ -43,7 +43,7 @@ public: int setFormat(V4L2SubdeviceFormat *format); const ControlInfoMap &controls() const; - int getControls(ControlList *ctrls); + ControlList getControls(const std::vector &ids); int setControls(ControlList *ctrls); const ControlList &properties() const { return properties_; } diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h index ce8edd98..e604a40d 100644 --- a/src/libcamera/include/v4l2_device.h +++ b/src/libcamera/include/v4l2_device.h @@ -26,7 +26,7 @@ public: const ControlInfoMap &controls() const { return controls_; } - int getControls(ControlList *ctrls); + ControlList getControls(const std::vector &ids); int setControls(ControlList *ctrls); const std::string &deviceNode() const { return deviceNode_; } -- cgit v1.2.1