mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-24 17:15:07 +03:00
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>
This commit is contained in:
parent
2e2ba223f3
commit
d54abd32af
3 changed files with 73 additions and 4 deletions
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue