diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-09-28 02:45:49 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2019-10-05 20:02:51 +0300 |
commit | ecf1c2e57b357f1b843796fd9ac4c77da940a26a (patch) | |
tree | c955705f0641f26b9e53749f40756509cb7e2d16 /include | |
parent | f671d84ceb491fdb07ad39d1fe20950fd6482e4f (diff) |
libcamera: controls: Use ControlValidator to validate ControlList
Replace the manual validation of controls against a Camera with usage of
the new ControlValidator interface.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'include')
-rw-r--r-- | include/libcamera/controls.h | 6 | ||||
-rw-r--r-- | include/libcamera/request.h | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/include/libcamera/controls.h b/include/libcamera/controls.h index d3eea643..90426753 100644 --- a/include/libcamera/controls.h +++ b/include/libcamera/controls.h @@ -13,7 +13,7 @@ namespace libcamera { -class Camera; +class ControlValidator; enum ControlType { ControlTypeNone, @@ -119,7 +119,7 @@ private: using ControlListMap = std::unordered_map<const ControlId *, ControlValue>; public: - ControlList(Camera *camera); + ControlList(ControlValidator *validator); using iterator = ControlListMap::iterator; using const_iterator = ControlListMap::const_iterator; @@ -160,7 +160,7 @@ private: const ControlValue *find(const ControlId &id) const; ControlValue *find(const ControlId &id); - Camera *camera_; + ControlValidator *validator_; ControlListMap controls_; }; diff --git a/include/libcamera/request.h b/include/libcamera/request.h index 9edf1ced..e3db5243 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -19,9 +19,9 @@ namespace libcamera { class Buffer; class Camera; +class CameraControlValidator; class Stream; - class Request { public: @@ -36,7 +36,7 @@ public: Request &operator=(const Request &) = delete; ~Request(); - ControlList &controls() { return controls_; } + ControlList &controls() { return *controls_; } const std::map<Stream *, Buffer *> &buffers() const { return bufferMap_; } int addBuffer(std::unique_ptr<Buffer> buffer); Buffer *findBuffer(Stream *stream) const; @@ -56,7 +56,8 @@ private: bool completeBuffer(Buffer *buffer); Camera *camera_; - ControlList controls_; + CameraControlValidator *validator_; + ControlList *controls_; std::map<Stream *, Buffer *> bufferMap_; std::unordered_set<Buffer *> pending_; |