[libcamera-devel] [PATCH 02/10] qcam: main_window: Re-use existing variable

Laurent Pinchart laurent.pinchart at ideasonboard.com
Tue Oct 13 20:42:40 CEST 2020


Hi Kieran,

Thank you for the patch.

On Tue, Oct 13, 2020 at 04:12:33PM +0100, Kieran Bingham wrote:
> The queueRequest function creates FrameBuffer pointer which aliases the
> existing and passed in buffer pointer.
> 
> When the captureRaw_ scope is executed, the original FrameBuffer *buffer
> is not used any more.
> 
> Re-use it rather than creating a new variable with the same name.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

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

> ---
>  src/qcam/main_window.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
> index 0cbdab9a6bce..0e50768aa386 100644
> --- a/src/qcam/main_window.cpp
> +++ b/src/qcam/main_window.cpp
> @@ -769,7 +769,7 @@ void MainWindow::queueRequest(FrameBuffer *buffer)
>  	request->addBuffer(vfStream_, buffer);
>  
>  	if (captureRaw_) {
> -		FrameBuffer *buffer = nullptr;
> +		buffer = nullptr;
>  
>  		{
>  			QMutexLocker locker(&mutex_);

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list