From patchwork Mon Jan 10 16:55:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 15267 X-Patchwork-Delegate: jacopo@jmondi.org 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 0393CBE080 for ; Mon, 10 Jan 2022 16:54:35 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6395F6021A; Mon, 10 Jan 2022 17:54:35 +0100 (CET) Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 65A4A60931 for ; Mon, 10 Jan 2022 17:54:30 +0100 (CET) Received: (Authenticated sender: jacopo@jmondi.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id C0AA7240007; Mon, 10 Jan 2022 16:54:29 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Mon, 10 Jan 2022 17:55:21 +0100 Message-Id: <20220110165524.72978-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220110165524.72978-1-jacopo@jmondi.org> References: <20220110165524.72978-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/5] android: camera_stream: Create allocator unconditionally 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" With the introduction of PlatformBufferAllocator all CameraStream can be used to allocate buffers on-demand. Create CameraStream::allocator_ and the associated mutex for all types of stream. Signed-off-by: Jacopo Mondi Reviewed-by: Hirokazu Honda --- src/android/camera_stream.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp index 032b0407bd32..eeeb238f395c 100644 --- a/src/android/camera_stream.cpp +++ b/src/android/camera_stream.cpp @@ -128,10 +128,8 @@ int CameraStream::configure() worker_->start(); } - if (type_ == Type::Internal) { - allocator_ = std::make_unique(cameraDevice_); - mutex_ = std::make_unique(); - } + allocator_ = std::make_unique(cameraDevice_); + mutex_ = std::make_unique(); camera3Stream_->max_buffers = configuration().bufferCount;