[libcamera-devel] [PATCH v2 05/10] libcamera: v4l2_controls: Store default value
Jacopo Mondi
jacopo at jmondi.org
Thu Dec 5 21:43:45 CET 2019
Store the default value for V4L2 controls as reported by the kernel when
creating ControlRange instances using information coming from
v4l2_query_ext_ctrl.
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
src/libcamera/v4l2_controls.cpp | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/libcamera/v4l2_controls.cpp b/src/libcamera/v4l2_controls.cpp
index b6547a7c627c..7446c3880330 100644
--- a/src/libcamera/v4l2_controls.cpp
+++ b/src/libcamera/v4l2_controls.cpp
@@ -121,17 +121,20 @@ V4L2ControlRange::V4L2ControlRange(const struct v4l2_query_ext_ctrl &ctrl)
switch (ctrl.type) {
case V4L2_CTRL_TYPE_BOOLEAN:
ControlRange::operator=(ControlRange(static_cast<bool>(ctrl.minimum),
- static_cast<bool>(ctrl.maximum)));
+ static_cast<bool>(ctrl.maximum),
+ static_cast<bool>(ctrl.default_value)));
break;
case V4L2_CTRL_TYPE_INTEGER64:
ControlRange::operator=(ControlRange(static_cast<int64_t>(ctrl.minimum),
- static_cast<int64_t>(ctrl.maximum)));
+ static_cast<int64_t>(ctrl.maximum),
+ static_cast<int64_t>(ctrl.default_value)));
break;
default:
ControlRange::operator=(ControlRange(static_cast<int32_t>(ctrl.minimum),
- static_cast<int32_t>(ctrl.maximum)));
+ static_cast<int32_t>(ctrl.maximum),
+ static_cast<int32_t>(ctrl.default_value)));
break;
}
}
--
2.23.0
More information about the libcamera-devel
mailing list