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>
This commit is contained in:
Laurent Pinchart
2020-04-26 02:08:37 +03:00
parent d4680c8ca2
commit 79ab0e925a
5 changed files with 62 additions and 61 deletions
+1 -1
View File
@@ -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_; }