[libcamera-devel] [RFC 5/6] libcamera: v4l2_controls: Store default value
Jacopo Mondi
jacopo at jmondi.org
Tue Nov 19 17:44:20 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.
Signed-off-by: Jacopo Mondi <jacopo at jmondi.org>
---
src/libcamera/v4l2_controls.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/libcamera/v4l2_controls.cpp b/src/libcamera/v4l2_controls.cpp
index b6547a7c627c..0073d4fa4ca1 100644
--- a/src/libcamera/v4l2_controls.cpp
+++ b/src/libcamera/v4l2_controls.cpp
@@ -122,16 +122,19 @@ V4L2ControlRange::V4L2ControlRange(const struct v4l2_query_ext_ctrl &ctrl)
case V4L2_CTRL_TYPE_BOOLEAN:
ControlRange::operator=(ControlRange(static_cast<bool>(ctrl.minimum),
static_cast<bool>(ctrl.maximum)));
+ defaultValue_.set(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)));
+ defaultValue_.set(static_cast<int64_t>(ctrl.default_value));
break;
default:
ControlRange::operator=(ControlRange(static_cast<int32_t>(ctrl.minimum),
static_cast<int32_t>(ctrl.maximum)));
+ defaultValue_.set(static_cast<int32_t>(ctrl.default_value));
break;
}
}
--
2.23.0
More information about the libcamera-devel
mailing list