summaryrefslogtreecommitdiff
path: root/src/libcamera/v4l2_device.cpp
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/v4l2_device.cpp
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/v4l2_device.cpp')
-rw-r--r--src/libcamera/v4l2_device.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp
index 349bf2d2..fd4b9c6d 100644
--- a/src/libcamera/v4l2_device.cpp
+++ b/src/libcamera/v4l2_device.cpp
@@ -264,14 +264,14 @@ int V4L2Device::setControls(V4L2ControlList *ctrls)
/* Set the v4l2_ext_control value for the write operation. */
switch (info->type()) {
case V4L2_CTRL_TYPE_INTEGER64:
- v4l2Ctrls[i].value64 = ctrl->value();
+ v4l2Ctrls[i].value64 = ctrl->value().get<int64_t>();
break;
default:
/*
* \todo To be changed when support for string and
* compound controls will be added.
*/
- v4l2Ctrls[i].value = ctrl->value();
+ v4l2Ctrls[i].value = ctrl->value().get<int32_t>();
break;
}
}
@@ -393,14 +393,14 @@ void V4L2Device::updateControls(V4L2ControlList *ctrls,
switch (info->type()) {
case V4L2_CTRL_TYPE_INTEGER64:
- ctrl->setValue(v4l2Ctrl->value64);
+ ctrl->value().set<int64_t>(v4l2Ctrl->value64);
break;
default:
/*
* \todo To be changed when support for string and
* compound controls will be added.
*/
- ctrl->setValue(v4l2Ctrl->value);
+ ctrl->value().set<int32_t>(v4l2Ctrl->value);
break;
}
}