From patchwork Mon Mar 23 17:35:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3280 Return-Path: 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 2840D62CDF for ; Mon, 23 Mar 2020 18:36:21 +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 BF06C11FF for ; Mon, 23 Mar 2020 18:36:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1584984980; bh=9q3NV9u/XVH4JI9fAG4o2MP3lBe6QKic+WSF4YO7HTM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=De6UOUcLIvVuqThT2vdHhImuY0xs4ELzjC26xM3UHPPo5kyb4hMd3qcMAwU/0TP9L 8GeIqTlzd/vZqhgltzcv11SNTYgghC8NufpHno84DuFD8SV7zMR7mBg6Z1qcQNFTZW Oihn3CoJYkytVISamn3033SKsdIL+ObTrL5BBtfk= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Mon, 23 Mar 2020 19:35:52 +0200 Message-Id: <20200323173559.21109-15-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200323173559.21109-1-laurent.pinchart@ideasonboard.com> References: <20200323173559.21109-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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 17:36:26 -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 d10c542c0b6d..3711a02c7fdc 100644 --- a/src/qcam/main_window.cpp +++ b/src/qcam/main_window.cpp @@ -524,14 +524,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 71206bc96fc4..33522115b6be 100644 --- a/src/qcam/main_window.h +++ b/src/qcam/main_window.h @@ -66,7 +66,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_); /*