diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-08-10 16:59:55 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-10-25 09:56:50 +0100 |
commit | 88a90ba2a7cc64c796d48b9a8a263e4c46d0b725 (patch) | |
tree | 923452f1e59b0a9c14034c3f3663742058af109a | |
parent | 42f5a750016840a0c1722d32d8975262932f12d6 (diff) |
libcamera: request: Use external CameraControlValidator
Each Request is currently creating its own CameraControlValidator
using the Camera instance at construction.
Now that the Camera exposes its own CameraControlValidator on its
private interface, use that one on all Requests.
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
-rw-r--r-- | include/libcamera/request.h | 1 | ||||
-rw-r--r-- | src/libcamera/request.cpp | 10 |
2 files changed, 3 insertions, 8 deletions
diff --git a/include/libcamera/request.h b/include/libcamera/request.h index 2d361c9d..d16904e6 100644 --- a/include/libcamera/request.h +++ b/include/libcamera/request.h @@ -71,7 +71,6 @@ private: bool completeBuffer(FrameBuffer *buffer); Camera *camera_; - CameraControlValidator *validator_; ControlList *controls_; ControlList *metadata_; BufferMap bufferMap_; diff --git a/src/libcamera/request.cpp b/src/libcamera/request.cpp index f95ce4db..17fefab7 100644 --- a/src/libcamera/request.cpp +++ b/src/libcamera/request.cpp @@ -17,6 +17,7 @@ #include <libcamera/framebuffer.h> #include <libcamera/stream.h> +#include "libcamera/internal/camera.h" #include "libcamera/internal/camera_controls.h" #include "libcamera/internal/framebuffer.h" #include "libcamera/internal/tracepoints.h" @@ -77,12 +78,8 @@ Request::Request(Camera *camera, uint64_t cookie) : camera_(camera), sequence_(0), cookie_(cookie), status_(RequestPending), cancelled_(false) { - /** - * \todo Should the Camera expose a validator instance, to avoid - * creating a new instance for each request? - */ - validator_ = new CameraControlValidator(camera); - controls_ = new ControlList(controls::controls, validator_); + controls_ = new ControlList(controls::controls, + camera->_d()->validator()); /** * \todo: Add a validator for metadata controls. @@ -100,7 +97,6 @@ Request::~Request() delete metadata_; delete controls_; - delete validator_; } /** |