diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-04-26 02:08:37 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-04-28 20:44:48 +0300 |
commit | 79ab0e925a782a6781d38237435fcfc29ddd2e20 (patch) | |
tree | b6dea7352f9ce9d544c15fde6bd1727076ed927a /src/libcamera/include | |
parent | d4680c8ca2b5cac4f723ec869b297099000b1100 (diff) |
libcamera: v4l2_device: Simplify usage of getControls()
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 <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src/libcamera/include')
-rw-r--r-- | src/libcamera/include/camera_sensor.h | 2 | ||||
-rw-r--r-- | src/libcamera/include/v4l2_device.h | 2 |
2 files changed, 2 insertions, 2 deletions
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<uint32_t> &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<uint32_t> &ids); int setControls(ControlList *ctrls); const std::string &deviceNode() const { return deviceNode_; } |