summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline_handler.cpp
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2022-01-19 00:17:16 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2022-02-04 09:39:46 +0000
commit20272b9b188fb1f9c8f4125806c8a2c7f141b389 (patch)
treef2e359e7fcb6d468dfb6c357655e74263abfbf0b /src/libcamera/pipeline_handler.cpp
parentb7d48634c5d389eddd761d888663e2c01232b784 (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/pipeline_handler.cpp')
-rw-r--r--src/libcamera/pipeline_handler.cpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
index 03e4b9e6..7ebd76ad 100644
--- a/src/libcamera/pipeline_handler.cpp
+++ b/src/libcamera/pipeline_handler.cpp
@@ -338,6 +338,23 @@ bool PipelineHandler::hasPendingRequests(const Camera *camera) const
}
/**
+ * \fn PipelineHandler::registerRequest()
+ * \brief Register a request for use by the pipeline handler
+ * \param[in] request The request to register
+ *
+ * This function is called when the request is created, and allows the pipeline
+ * handler to perform any one-time initialization it requries for the request.
+ */
+void PipelineHandler::registerRequest(Request *request)
+{
+ /*
+ * Connect the request prepared signal to notify the pipeline handler
+ * when a request is ready to be processed.
+ */
+ request->_d()->prepared.connect(this, &PipelineHandler::doQueueRequests);
+}
+
+/**
* \fn PipelineHandler::queueRequest()
* \brief Queue a request
* \param[in] request The request to queue
@@ -366,9 +383,6 @@ void PipelineHandler::queueRequest(Request *request)
waitingRequests_.push(request);
- request->_d()->prepared.connect(this, [this]() {
- doQueueRequests();
- });
request->_d()->prepare(300ms);
}