diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2022-01-19 00:17:16 +0000 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2022-02-04 09:39:46 +0000 |
commit | 20272b9b188fb1f9c8f4125806c8a2c7f141b389 (patch) | |
tree | f2e359e7fcb6d468dfb6c357655e74263abfbf0b /src/libcamera/camera.cpp | |
parent | b7d48634c5d389eddd761d888663e2c01232b784 (diff) |
libcamera: pipeline_handler: Register requests
Provide a call allowing requests to be registered and associated with
the pipeline handler after being constructed by the camera.
This provides an opportunity for the PipelineHandler to connect any
signals it may be interested in receiving for the request such as
getting notifications when the request is ready for processing when
using a fence.
While here, update the existing usage of the d pointer in
Camera::createRequest() to match the style of other functions.
Bug: https://github.com/raspberrypi/libcamera-apps/issues/217
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/camera.cpp')
-rw-r--r-- | src/libcamera/camera.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp index 86d84ac0..bb856d60 100644 --- a/src/libcamera/camera.cpp +++ b/src/libcamera/camera.cpp @@ -1074,12 +1074,19 @@ int Camera::configure(CameraConfiguration *config) */ std::unique_ptr<Request> Camera::createRequest(uint64_t cookie) { - int ret = _d()->isAccessAllowed(Private::CameraConfigured, - Private::CameraRunning); + Private *const d = _d(); + + int ret = d->isAccessAllowed(Private::CameraConfigured, + Private::CameraRunning); if (ret < 0) return nullptr; - return std::make_unique<Request>(this, cookie); + std::unique_ptr<Request> request = std::make_unique<Request>(this, cookie); + + /* Associate the request with the pipeline handler. */ + d->pipe_->registerRequest(request.get()); + + return request; } /** |