diff options
author | Stefan Klug <stefan.klug@ideasonboard.com> | 2024-03-07 11:27:38 +0100 |
---|---|---|
committer | Stefan Klug <stefan.klug@ideasonboard.com> | 2024-03-12 17:04:28 +0100 |
commit | d54abd32affdb7d7458cd2a0889a7afe6a5a5d33 (patch) | |
tree | 1df71fcee4f7383ae75898ce408ca492c05b5347 /include | |
parent | 2e2ba223f3a249f1c04fe88c2709ca6e7d42c242 (diff) |
libcamera: controls: Add policy parameter to ControlList::merge()
This is useful in many cases although not included in the stl.
Note: This is an ABI incompatible change.
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/controls.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index cf942055..82b95599 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -352,6 +352,11 @@ private: using ControlListMap = std::unordered_map<unsigned int, ControlValue>; public: + enum class MergePolicy { + KeepExisting = 0, + OverwriteExisting, + }; + ControlList(); ControlList(const ControlIdMap &idmap, const ControlValidator *validator = nullptr); ControlList(const ControlInfoMap &infoMap, const ControlValidator *validator = nullptr); @@ -368,7 +373,7 @@ public: std::size_t size() const { return controls_.size(); } void clear() { controls_.clear(); } - void merge(const ControlList &source); + void merge(const ControlList &source, MergePolicy policy = MergePolicy::KeepExisting); bool contains(unsigned int id) const; |