diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2019-06-12 18:25:19 +0200 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2019-06-25 14:01:37 +0200 |
commit | eb068f4e67eedacd5c6dcc559c3554317be45c31 (patch) | |
tree | 3721bb08c3e0dcbc3f750537ce00927617f5a841 /src/libcamera/include/v4l2_device.h | |
parent | 030ce6491ed3d4c827a6ef4aa5c7e706867ded7b (diff) |
libcamera: v4l2_device: Implement get and set controls
Implement getControls() and setControls() operations in V4L2Device class.
Both operations take a V4L2Controls instance and read or write the V4L2
controls on the V4L2 device.
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/include/v4l2_device.h')
-rw-r--r-- | src/libcamera/include/v4l2_device.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h index 55696046..24a0134a 100644 --- a/src/libcamera/include/v4l2_device.h +++ b/src/libcamera/include/v4l2_device.h @@ -10,11 +10,14 @@ #include <map> #include <string> +#include <linux/videodev2.h> + #include "log.h" namespace libcamera { class V4L2ControlInfo; +class V4L2ControlList; class V4L2Device : protected Loggable { @@ -23,6 +26,8 @@ public: bool isOpen() const { return fd_ != -1; } const V4L2ControlInfo *getControlInfo(unsigned int id) const; + int getControls(V4L2ControlList *ctrls); + int setControls(V4L2ControlList *ctrls); const std::string &deviceNode() const { return deviceNode_; } @@ -38,6 +43,10 @@ protected: private: void listControls(); + void updateControls(V4L2ControlList *ctrls, + const V4L2ControlInfo **controlInfo, + const struct v4l2_ext_control *v4l2Ctrls, + unsigned int count); std::map<unsigned int, V4L2ControlInfo> controls_; std::string deviceNode_; |