From patchwork Thu Oct 15 22:37:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 10063 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id A00ABBE905 for ; Thu, 15 Oct 2020 22:38:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 51F7A610C4; Fri, 16 Oct 2020 00:38:00 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Ro/AR5Xf"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 199D5600F2 for ; Fri, 16 Oct 2020 00:37:56 +0200 (CEST) Received: from Q.local (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 999D811F0; Fri, 16 Oct 2020 00:37:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1602801475; bh=eUl8J+hAKtxbT6JLkJ9Q6E9SpTEI1G2vXG+SIuUg2Bc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ro/AR5XfP1Zc2KLbSaHVZhX35FU/ifs3WZ5Aj0ENMxJXc6sI//Vc7/z7a76W5h8+/ dpQ31nqbbvd6fAOvZ4vSGgtG6sntaMUJEAj+95ESE9EYxjkRmCaXAj777C9CioWbaL EMie/vh4/ulw3Jt6j+jn8mv91z2/3MR5zsV1aEOw= From: Kieran Bingham To: libcamera devel Date: Thu, 15 Oct 2020 23:37:41 +0100 Message-Id: <20201015223750.58563-3-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201015223750.58563-1-kieran.bingham@ideasonboard.com> References: <20201015223750.58563-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 02/11] qcam: main_window: Explicitly name raw buffer X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The buffer obtained for queuing to a raw stream aliases the buffer passed in for the main view finder stream. Prevent aliasing, and explicitly name the buffer as a separate variable. Suggested-by: Niklas Söderlund Signed-off-by: Kieran Bingham Reviewed-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- 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";