From a62b35b8c07ee83c4f0e9ee741f3226d47fe3f87 Mon Sep 17 00:00:00 2001 From: Naushir Patuck Date: Fri, 4 Dec 2020 15:31:19 +0000 Subject: libcamera: pipeline: Pass libcamera controls into pipeline_handler::start() Applications now have the ability to pass in controls that need to be applied on startup, rather than doing it through Request where there might be some frames of delay in getting the controls applied. This commit adds the ability to pass in a set of libcamera controls into the pipeline handlers through the pipeline_handler::start() method. These controls are provided by the application through the camera::start() public API. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman Tested-by: David Plowman Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart Signed-off-by: Laurent Pinchart --- src/libcamera/camera.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/libcamera/camera.cpp') diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp index bcb7b046..3579ba96 100644 --- a/src/libcamera/camera.cpp +++ b/src/libcamera/camera.cpp @@ -1002,10 +1002,12 @@ int Camera::queueRequest(Request *request) /** * \brief Start capture from camera + * \param[in] controls Controls to be applied before starting the Camera * - * Start the camera capture session. Once the camera is started the application - * can queue requests to the camera to process and return to the application - * until the capture session is terminated with \a stop(). + * Start the camera capture session, optionally providing a list of controls to + * apply before starting. Once the camera is started the application can queue + * requests to the camera to process and return to the application until the + * capture session is terminated with \a stop(). * * \context This function may only be called when the camera is in the * Configured state as defined in \ref camera_operation, and shall be @@ -1016,7 +1018,7 @@ int Camera::queueRequest(Request *request) * \retval -ENODEV The camera has been disconnected from the system * \retval -EACCES The camera is not in a state where it can be started */ -int Camera::start() +int Camera::start(ControlList *controls) { Private *const d = LIBCAMERA_D_PTR(); @@ -1027,7 +1029,7 @@ int Camera::start() LOG(Camera, Debug) << "Starting capture"; ret = d->pipe_->invokeMethod(&PipelineHandler::start, - ConnectionTypeBlocking, this); + ConnectionTypeBlocking, this, controls); if (ret) return ret; -- cgit v1.2.1