From ec5d4acfcaacc687c6bcb9b3c32325c210c4a0f0 Mon Sep 17 00:00:00 2001 From: Kieran Bingham Date: Wed, 24 Mar 2021 11:11:21 +0000 Subject: libcamera: camera: Assert pipelines complete all requests When the camera manager calls stop on a pipeline, it is expected that the pipeline handler guarantees all requests are returned back to the application before the camera has stopped. Ensure that this guarantee is met by providing an accessor on the pipeline handler to validate that all pending requests are removed. Reviewed-by: Jean-Michel Hautbois Reviewed-by: Laurent Pinchart Signed-off-by: Kieran Bingham --- src/libcamera/camera.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libcamera/camera.cpp') diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp index 763f3b99..1340c266 100644 --- a/src/libcamera/camera.cpp +++ b/src/libcamera/camera.cpp @@ -1084,6 +1084,8 @@ int Camera::stop() d->pipe_->invokeMethod(&PipelineHandler::stop, ConnectionTypeBlocking, this); + ASSERT(!d->pipe_->hasPendingRequests(this)); + d->setState(Private::CameraConfigured); return 0; -- cgit v1.2.1