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>
This commit is contained in:
@@ -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 *>;
|
||||
|
||||
Reference in New Issue
Block a user