summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2021-08-10 16:59:55 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-10-25 09:56:50 +0100
commit88a90ba2a7cc64c796d48b9a8a263e4c46d0b725 (patch)
tree923452f1e59b0a9c14034c3f3663742058af109a /src
parent42f5a750016840a0c1722d32d8975262932f12d6 (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>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/request.cpp10
1 files changed, 3 insertions, 7 deletions
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_;
}
/**