From patchwork Fri May 27 09:34:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 16067 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 BBD86BD161 for ; Fri, 27 May 2022 09:34:58 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 71C0865632; Fri, 27 May 2022 11:34:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1653644098; bh=ULliZzK0z4aEUbrgLmQxpYAzNul4FcvsIHrG/SSsrkA=; 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=JbLh8dDZfI/YBe23ut+j5Jr678Iw3WSAwpxiQdYICVRhciXqout1o60xtghpGDno5 0xx+7aMLsJjWaWBlZqmiJoQ4sWofOwaxBs72XbwefTxjS5fCxuvWrgeCpL9JD0zvpD xHwaPgkvPD66deEFlwjaO0lQ962CJIjAn7n6wXDAad8GwZ+d16Yoeqwy/oiwwfjl4Z XjwnVW2ag5RLuL3doj3OW2E5/xBn57Mdy+FeBKN2Hn3FhhZFWQg/mdELLAXA3ui6YA MIPL70hpW/foBgdsGODhApPstUx+4PFWyi02Cr9YFRLB0gXfCUj+I2lbLWd83S4ymv nMxIVEK2x14nQ== 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 0848D60415 for ; Fri, 27 May 2022 11:34:55 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="imdz+dB3"; dkim-atps=neutral Received: from pyrite.rasen.tech (softbank036240126034.bbtec.net [36.240.126.34]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A489632A; Fri, 27 May 2022 11:34:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1653644094; bh=ULliZzK0z4aEUbrgLmQxpYAzNul4FcvsIHrG/SSsrkA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=imdz+dB327Xq9is2baKdIH49f8jrHkJGvQs9y0rWOgbQlHt/OGl/u4NtVROgFuo90 jZou7VGfGzSe5W1QLQkQ/tSR+tf4cOwZHitDqQRyqxfBpU4k7tu+Yfx/nnmdA+PzV5 hTtuI7KFm2oVvVTwlJ9OeSYLpRWDDLhKvfqwd7Sc= To: libcamera-devel@lists.libcamera.org Date: Fri, 27 May 2022 18:34:37 +0900 Message-Id: <20220527093440.953377-3-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220527093440.953377-1-paul.elder@ideasonboard.com> References: <20220527093440.953377-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 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: Paul Elder via libcamera-devel From: Paul Elder Reply-To: Paul Elder Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Jacopo Mondi 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: Umang Jain Reviewed-by: Laurent Pinchart --- No change in v2 If we want to make CameraStream::mutex_ into non-pointer (as Hiro suggested), it should be done on top. Do we want to do that? (I suppose it doesn't affect this patch itself) --- 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 154e088e..045e6006 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;