summaryrefslogtreecommitdiff
path: root/src/libcamera/camera.cpp
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2020-12-04 15:31:19 +0000
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-12-08 14:28:51 +0200
commita62b35b8c07ee83c4f0e9ee741f3226d47fe3f87 (patch)
tree1b41de47e8ea2842f4259952adfc48b9da633059 /src/libcamera/camera.cpp
parentee477efde8e49e26cc02437fd50a45cd439ee65e (diff)
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 <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Tested-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/camera.cpp')
-rw-r--r--src/libcamera/camera.cpp12
1 files changed, 7 insertions, 5 deletions
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;