From 81563b55ed36bca67e4db3950d64438c3d16c0ac Mon Sep 17 00:00:00 2001 From: Jacopo Mondi Date: Tue, 19 Nov 2019 17:18:35 +0100 Subject: libcamera: controls: Add default to ControlRange MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Augment the the ControlRange class to store the control default value. This is particularly relevant for v4l2 controls used to create Camera properties, which are constructed using immutable video device properties, whose value won't change at runtime. Reviewed-by: Laurent Pinchart Reviewed-by: Niklas Söderlund Signed-off-by: Jacopo Mondi --- include/libcamera/controls.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/libcamera/controls.h') diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index b1b73367..458b84e8 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -114,10 +114,12 @@ class ControlRange { public: explicit ControlRange(const ControlValue &min = 0, - const ControlValue &max = 0); + const ControlValue &max = 0, + const ControlValue &def = 0); const ControlValue &min() const { return min_; } const ControlValue &max() const { return max_; } + const ControlValue &def() const { return def_; } std::string toString() const; @@ -134,6 +136,7 @@ public: private: ControlValue min_; ControlValue max_; + ControlValue def_; }; using ControlIdMap = std::unordered_map; -- cgit v1.2.1