summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/libcamera/internal/camera.h5
-rw-r--r--src/libcamera/camera.cpp8
2 files changed, 13 insertions, 0 deletions
diff --git a/include/libcamera/internal/camera.h b/include/libcamera/internal/camera.h
index 1a08da0c..9f5adac1 100644
--- a/include/libcamera/internal/camera.h
+++ b/include/libcamera/internal/camera.h
@@ -19,6 +19,7 @@
namespace libcamera {
+class CameraControlValidator;
class PipelineHandler;
class Stream;
@@ -38,6 +39,8 @@ public:
uint32_t requestSequence_;
+ const CameraControlValidator *validator() const { return validator_.get(); }
+
private:
enum State {
CameraAvailable,
@@ -64,6 +67,8 @@ private:
bool disconnected_;
std::atomic<State> state_;
+
+ std::unique_ptr<CameraControlValidator> validator_;
};
} /* namespace libcamera */
diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
index 71809bcd..400a7cf0 100644
--- a/src/libcamera/camera.cpp
+++ b/src/libcamera/camera.cpp
@@ -19,6 +19,7 @@
#include <libcamera/stream.h>
#include "libcamera/internal/camera.h"
+#include "libcamera/internal/camera_controls.h"
#include "libcamera/internal/pipeline_handler.h"
/**
@@ -367,6 +368,12 @@ Camera::Private::~Private()
*/
/**
+ * \fn Camera::Private::validator()
+ * \brief Retrieve the control validator related to this camera
+ * \return The control validator associated with this camera
+ */
+
+/**
* \var Camera::Private::queuedRequests_
* \brief The list of queued and not yet completed requests
*
@@ -665,6 +672,7 @@ Camera::Camera(std::unique_ptr<Private> d, const std::string &id,
{
_d()->id_ = id;
_d()->streams_ = streams;
+ _d()->validator_ = std::make_unique<CameraControlValidator>(this);
}
Camera::~Camera()