summaryrefslogtreecommitdiff
path: root/src/libcamera/include/v4l2_controls.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-09-28 05:16:26 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2019-10-05 20:02:51 +0300
commit186ae04c0cdf5eb7d7afcd55d4b6a7b69e47f4ae (patch)
tree2113af83817c3231fe601123c062808e8f224986 /src/libcamera/include/v4l2_controls.h
parentace50f75a4d4c10c0deb90fc857525b565cdd8c9 (diff)
libcamera: v4l2_controls: Use the ControlValue class for data storage
Use the ControlValue class to replace the manually crafted data storage in V4L2Control. This will help sharing code when more data types will be supported. 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/v4l2_controls.h')
-rw-r--r--src/libcamera/include/v4l2_controls.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/libcamera/include/v4l2_controls.h b/src/libcamera/include/v4l2_controls.h
index 10b72650..f2b67c5d 100644
--- a/src/libcamera/include/v4l2_controls.h
+++ b/src/libcamera/include/v4l2_controls.h
@@ -16,6 +16,8 @@
#include <linux/v4l2-controls.h>
#include <linux/videodev2.h>
+#include <libcamera/controls.h>
+
namespace libcamera {
class V4L2ControlInfo
@@ -46,17 +48,18 @@ using V4L2ControlInfoMap = std::map<unsigned int, V4L2ControlInfo>;
class V4L2Control
{
public:
- V4L2Control(unsigned int id, int value = 0)
- : id_(id), value_(value) {}
-
- int64_t value() const { return value_; }
- void setValue(int64_t value) { value_ = value; }
+ V4L2Control(unsigned int id, const ControlValue &value = ControlValue())
+ : id_(id), value_(value)
+ {
+ }
unsigned int id() const { return id_; }
+ const ControlValue &value() const { return value_; }
+ ControlValue &value() { return value_; }
private:
unsigned int id_;
- int64_t value_;
+ ControlValue value_;
};
class V4L2ControlList