[libcamera-devel] [PATCH 1/3] libcamera: PipelineHandler: Make queueRequest() void function

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Mar 29 06:39:48 CEST 2021


Hi Hiro,

Thank you for the patch.

On Mon, Mar 29, 2021 at 09:27:13AM +0900, Hirokazu Honda wrote:
> PipelineHandler::queueRequest() is asynchronously invoked in
> Camera::queueRequest(). Therefore the return value of
> PipelineHandler::queueRequest() is useless. This changes the
> function to a void function.
> 
> Signed-off-by: Hirokazu Honda <hiroh at chromium.org>
> ---
>  include/libcamera/internal/pipeline_handler.h | 2 +-
>  src/libcamera/camera.cpp                      | 6 ++++--
>  src/libcamera/pipeline_handler.cpp            | 4 +---
>  3 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h
> index 6aca0b46..093b94c6 100644
> --- a/include/libcamera/internal/pipeline_handler.h
> +++ b/include/libcamera/internal/pipeline_handler.h
> @@ -79,7 +79,7 @@ public:
>  	virtual int start(Camera *camera, const ControlList *controls) = 0;
>  	virtual void stop(Camera *camera) = 0;
>  
> -	int queueRequest(Request *request);
> +	void queueRequest(Request *request);
>  
>  	bool completeBuffer(Request *request, FrameBuffer *buffer);
>  	void completeRequest(Request *request);
> diff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp
> index 84edbb8f..2611c701 100644
> --- a/src/libcamera/camera.cpp
> +++ b/src/libcamera/camera.cpp
> @@ -996,8 +996,10 @@ int Camera::queueRequest(Request *request)
>  		}
>  	}
>  
> -	return d->pipe_->invokeMethod(&PipelineHandler::queueRequest,
> -				      ConnectionTypeQueued, request);
> +	d->pipe_->invokeMethod(&PipelineHandler::queueRequest,
> +			       ConnectionTypeQueued, request);
> +
> +	return 0;
>  }
>  
>  /**
> diff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp
> index d22991d3..05b807d6 100644
> --- a/src/libcamera/pipeline_handler.cpp
> +++ b/src/libcamera/pipeline_handler.cpp
> @@ -374,7 +374,7 @@ const ControlList &PipelineHandler::properties(const Camera *camera) const
>   *
>   * \return 0 on success or a negative error code otherwise

Not anymore :-) You can just drop this line.

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

>   */
> -int PipelineHandler::queueRequest(Request *request)
> +void PipelineHandler::queueRequest(Request *request)
>  {
>  	LIBCAMERA_TRACEPOINT(request_queue, request);
>  
> @@ -385,8 +385,6 @@ int PipelineHandler::queueRequest(Request *request)
>  	int ret = queueRequestDevice(camera, request);
>  	if (ret)
>  		data->queuedRequests_.remove(request);
> -
> -	return ret;
>  }
>  
>  /**

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list