mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-24 00:55:07 +03:00
libcamera: camera: Create a CameraControlValidator
Create a Camera-specific CameraControlValidator for the Camera instance. This will allow requests to use a single validator instance without having to construct their own. 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>
This commit is contained in:
parent
1402152ad3
commit
42f5a75001
2 changed files with 13 additions and 0 deletions
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
namespace libcamera {
|
namespace libcamera {
|
||||||
|
|
||||||
|
class CameraControlValidator;
|
||||||
class PipelineHandler;
|
class PipelineHandler;
|
||||||
class Stream;
|
class Stream;
|
||||||
|
|
||||||
|
@ -38,6 +39,8 @@ public:
|
||||||
|
|
||||||
uint32_t requestSequence_;
|
uint32_t requestSequence_;
|
||||||
|
|
||||||
|
const CameraControlValidator *validator() const { return validator_.get(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum State {
|
enum State {
|
||||||
CameraAvailable,
|
CameraAvailable,
|
||||||
|
@ -64,6 +67,8 @@ private:
|
||||||
|
|
||||||
bool disconnected_;
|
bool disconnected_;
|
||||||
std::atomic<State> state_;
|
std::atomic<State> state_;
|
||||||
|
|
||||||
|
std::unique_ptr<CameraControlValidator> validator_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace libcamera */
|
} /* namespace libcamera */
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include <libcamera/stream.h>
|
#include <libcamera/stream.h>
|
||||||
|
|
||||||
#include "libcamera/internal/camera.h"
|
#include "libcamera/internal/camera.h"
|
||||||
|
#include "libcamera/internal/camera_controls.h"
|
||||||
#include "libcamera/internal/pipeline_handler.h"
|
#include "libcamera/internal/pipeline_handler.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -366,6 +367,12 @@ Camera::Private::~Private()
|
||||||
* \return The pipeline handler that created this camera
|
* \return The pipeline handler that created this camera
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* \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_
|
* \var Camera::Private::queuedRequests_
|
||||||
* \brief The list of queued and not yet completed requests
|
* \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()->id_ = id;
|
||||||
_d()->streams_ = streams;
|
_d()->streams_ = streams;
|
||||||
|
_d()->validator_ = std::make_unique<CameraControlValidator>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
Camera::~Camera()
|
Camera::~Camera()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue