@@ -71,7 +71,6 @@ private:
bool completeBuffer(FrameBuffer *buffer);
Camera *camera_;
- CameraControlValidator *validator_;
ControlList *controls_;
ControlList *metadata_;
BufferMap bufferMap_;
@@ -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,9 @@ 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_);
+ const CameraControlValidator &validator = camera->_d()->validator();
+
+ controls_ = new ControlList(controls::controls, &validator);
/**
* \todo: Add a validator for metadata controls.
@@ -100,7 +98,6 @@ Request::~Request()
delete metadata_;
delete controls_;
- delete validator_;
}
/**
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. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> --- include/libcamera/request.h | 1 - src/libcamera/request.cpp | 11 ++++------- 2 files changed, 4 insertions(+), 8 deletions(-)