[libcamera-devel,3/5] cam: Queue requests through CameraSession::queueRequest()
diff mbox series

Message ID 20220518171921.244168-4-jacopo@jmondi.org
State Accepted
Headers show
Series
  • cam: Add support for capture scripts
Related show

Commit Message

Jacopo Mondi May 18, 2022, 5:19 p.m. UTC
The CameraSession::processRequest() frame completion handler currently
re-queues completed requests by calling Camera::queueRequests()
explicitely.

In order to maintain the CameraSession::queuedRequest_ counter up to
date with the actual number of queued requests, call the
CameraSession::queueRequest() instead of operating the Camera directly.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 src/cam/camera_session.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Laurent Pinchart May 20, 2022, 10:22 a.m. UTC | #1
Hi Jacopo,

Thank you for the patch.

On Wed, May 18, 2022 at 07:19:19PM +0200, Jacopo Mondi via libcamera-devel wrote:
> The CameraSession::processRequest() frame completion handler currently
> re-queues completed requests by calling Camera::queueRequests()
> explicitely.
> 
> In order to maintain the CameraSession::queuedRequest_ counter up to
> date with the actual number of queued requests, call the
> CameraSession::queueRequest() instead of operating the Camera directly.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

This looks right.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/cam/camera_session.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/cam/camera_session.cpp b/src/cam/camera_session.cpp
> index 186072817367..a1b447235009 100644
> --- a/src/cam/camera_session.cpp
> +++ b/src/cam/camera_session.cpp
> @@ -423,7 +423,7 @@ void CameraSession::processRequest(Request *request)
>  		return;
>  
>  	request->reuse(Request::ReuseBuffers);
> -	camera_->queueRequest(request);
> +	queueRequest(request);
>  }
>  
>  void CameraSession::sinkRelease(Request *request)

Patch
diff mbox series

diff --git a/src/cam/camera_session.cpp b/src/cam/camera_session.cpp
index 186072817367..a1b447235009 100644
--- a/src/cam/camera_session.cpp
+++ b/src/cam/camera_session.cpp
@@ -423,7 +423,7 @@  void CameraSession::processRequest(Request *request)
 		return;
 
 	request->reuse(Request::ReuseBuffers);
-	camera_->queueRequest(request);
+	queueRequest(request);
 }
 
 void CameraSession::sinkRelease(Request *request)