From patchwork Sat Jun 4 09:30:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 16151 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 3F989C3273 for ; Sat, 4 Jun 2022 09:30:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6998B6563A; Sat, 4 Jun 2022 11:30:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1654335036; bh=m55zw6+OuVmZDmbJYonbQJ8SdqYMrIlcQKVrlLKGfdo=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=LoDAqo/di+EmhGifDzgz/QsjP3ER/+YaG68jUcloV2ZkOyIAadepaZVIaOJJWPMxc 2XBp/H1GQwI+14vqYSoKydGkT9XZBcM5nzL5RLMBfn6/tQpNbTCsRyl/lAmmM5ACGy noj5qDuB1Np9UL3IYasNMkpsmBKbmA9CBF9a2cXWc4m4FNZeybVvrNVr6R1FmWW/OU BK6Dj15oTk4zZjfv9nY/PBUwd9amc6KS4xeoDbisipDJ5YWd9F5vXBkHSfutVTgPyY NznHL95kndKlVvQl4z+g75VlBrxTUcP501kEct5x9BvOggCSibaDK5gzorUX8F7rs5 wIG+lVn5DeoMw== Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id CA54B65631 for ; Sat, 4 Jun 2022 11:30:34 +0200 (CEST) Received: (Authenticated sender: jacopo@jmondi.org) by mail.gandi.net (Postfix) with ESMTPSA id E828DE000D; Sat, 4 Jun 2022 09:30:33 +0000 (UTC) To: libcamera-devel@lists.libcamera.org Date: Sat, 4 Jun 2022 11:30:22 +0200 Message-Id: <20220604093025.77737-3-jacopo@jmondi.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220604093025.77737-1-jacopo@jmondi.org> References: <20220604093025.77737-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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: , X-Patchwork-Original-From: Jacopo Mondi via libcamera-devel From: Jacopo Mondi Reply-To: Jacopo Mondi Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Originally buffer allocation was only required for Internal streams which are not backed by a frame buffer provided by the Android framework. Now that mapped streams can be generated without the corresponding source stream being part of the Android's provided stream list, also buffers of type Mapped can be required to allocate buffers on demand. Create CameraStream::allocator_ and the associated mutex unconditionally for all types of stream. Signed-off-by: Jacopo Mondi Reviewed-by: Umang Jain Reviewed-by: Laurent Pinchart --- 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 154e088e1b86..045e60061a20 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;