[libcamera-devel] [PATCH v2 02/11] qcam: main_window: Explicitly name raw buffer

Laurent Pinchart laurent.pinchart at ideasonboard.com
Fri Oct 16 03:12:12 CEST 2020


Hi Kieran,

Thank you for the patch.

On Thu, Oct 15, 2020 at 11:37:41PM +0100, Kieran Bingham wrote:
> The buffer obtained for queuing to a raw stream aliases the buffer

s/aliases/shadows/

> passed in for the main view finder stream.
> 
> Prevent aliasing, and explicitly name the buffer as a separate variable.

s/aliasing/shadowing/

Could you double-check that no other patch in this series needs a
similar fix in its commit message ?

> Suggested-by: Niklas Söderlund <niklas.soderlund at ragnatech.se>

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

> ---
>  src/qcam/main_window.cpp | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp
> index 0cbdab9a6bce..f140313ede8d 100644
> --- a/src/qcam/main_window.cpp
> +++ b/src/qcam/main_window.cpp
> @@ -769,16 +769,16 @@ void MainWindow::queueRequest(FrameBuffer *buffer)
>  	request->addBuffer(vfStream_, buffer);
>  
>  	if (captureRaw_) {
> -		FrameBuffer *buffer = nullptr;
> +		FrameBuffer *rawBuffer = nullptr;
>  
>  		{
>  			QMutexLocker locker(&mutex_);
>  			if (!freeBuffers_[rawStream_].isEmpty())
> -				buffer = freeBuffers_[rawStream_].dequeue();
> +				rawBuffer = freeBuffers_[rawStream_].dequeue();
>  		}
>  
> -		if (buffer) {
> -			request->addBuffer(rawStream_, buffer);
> +		if (rawBuffer) {
> +			request->addBuffer(rawStream_, rawBuffer);
>  			captureRaw_ = false;
>  		} else {
>  			qWarning() << "No free buffer available for RAW capture";

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list