From patchwork Mon Mar 23 14:21:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3258 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2E72862C43 for ; Mon, 23 Mar 2020 15:22:23 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C690711FF for ; Mon, 23 Mar 2020 15:22:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1584973342; bh=73DZW4P+YJYZlOKUVjd+jGYbROnoK66kdikqo+TUOnc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=mW2mhxWfKFQCF2yz7EzQw9M70W2848oOfeIMz53lpCcvbU+vaLlGhr0dQgf6JQAXj ghUzyaDHxlKCaWvvvDBP5B5asVaVDrSvkkpD1P5QnC0ddUqEgAawwuT1oULNuTVQHT MVYJuhVzXpCBDlQ4kKOnNygLgwQh6CmUIzRPWCkw= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 23 Mar 2020 16:21:58 +0200 Message-Id: <20200323142205.28342-15-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200323142205.28342-1-laurent.pinchart@ideasonboard.com> References: <20200323142205.28342-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 14/21] qcam: viewfinder: Move multi-planar check into viewfinder 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: , X-List-Received-Date: Mon, 23 Mar 2020 14:22:28 -0000 The lack of support for multiplanar buffers comes from the viewfinder. Move the corresponding check from MainWindow. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/qcam/main_window.cpp | 7 +------ src/qcam/main_window.h | 2 +- src/qcam/viewfinder.cpp | 6 ++++++ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp index c0feb91a6fb1..ad0d6bf4f3e5 100644 --- a/src/qcam/main_window.cpp +++ b/src/qcam/main_window.cpp @@ -519,14 +519,9 @@ void MainWindow::processCapture() queueRequest(buffer); } -int MainWindow::display(FrameBuffer *buffer) +void MainWindow::display(FrameBuffer *buffer) { - if (buffer->planes().size() != 1) - return -EINVAL; - viewfinder_->display(buffer, &mappedBuffers_[buffer]); - - return 0; } void MainWindow::queueRequest(FrameBuffer *buffer) diff --git a/src/qcam/main_window.h b/src/qcam/main_window.h index 0918ae5307d8..03db761b58e4 100644 --- a/src/qcam/main_window.h +++ b/src/qcam/main_window.h @@ -65,7 +65,7 @@ private: void requestComplete(Request *request); void processCapture(); - int display(FrameBuffer *buffer); + void display(FrameBuffer *buffer); void queueRequest(FrameBuffer *buffer); /* UI elements */ diff --git a/src/qcam/viewfinder.cpp b/src/qcam/viewfinder.cpp index d00edc33dfb7..b8feabd5d189 100644 --- a/src/qcam/viewfinder.cpp +++ b/src/qcam/viewfinder.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include "format_converter.h" @@ -27,6 +28,11 @@ ViewFinder::~ViewFinder() void ViewFinder::display(const libcamera::FrameBuffer *buffer, MappedBuffer *map) { + if (buffer->planes().size() != 1) { + qWarning() << "Multi-planar buffers are not supported"; + return; + } + QMutexLocker locker(&mutex_); /*