diff options
author | Jacopo Mondi <jacopo@jmondi.org> | 2019-11-19 17:18:35 +0100 |
---|---|---|
committer | Jacopo Mondi <jacopo@jmondi.org> | 2020-02-14 16:27:42 +0100 |
commit | 81563b55ed36bca67e4db3950d64438c3d16c0ac (patch) | |
tree | ba5e68416130867873a488a3fb2c8753643b5321 /include | |
parent | e5ff2c98944630dee6f2c6c57031dda2f4276cc8 (diff) |
libcamera: controls: Add default to ControlRange
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 <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/controls.h | 5 |
1 files changed, 4 insertions, 1 deletions
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<unsigned int, const ControlId *>; |