From patchwork Sun Oct 25 16:04:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10246 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 473D3BDB13 for ; Sun, 25 Oct 2020 16:04:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1E87B61EAA; Sun, 25 Oct 2020 17:04:57 +0100 (CET) Received: from relay10.mail.gandi.net (relay10.mail.gandi.net [217.70.178.230]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 156BE61DA7 for ; Sun, 25 Oct 2020 17:04:54 +0100 (CET) Received: from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 0A63C240003; Sun, 25 Oct 2020 16:04:52 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Sun, 25 Oct 2020 17:04:31 +0100 Message-Id: <20201025160434.25664-12-jacopo@jmondi.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201025160434.25664-1-jacopo@jmondi.org> References: <20201025160434.25664-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 11/14] android: camera_device: Report PIPELINE_MAX_DEPTH 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" Register the ANDROID_REQUEST_PIPELINE_MAX_DEPTH static property inspecting the value reported by the pipeline handler. If the Camera does not report any suitable value, default the static property to 2. Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham Signed-off-by: Jacopo Mondi --- src/android/camera_device.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 390f674fcb75..cc25aae96f58 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -591,6 +592,8 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() return nullptr; } + const ControlInfoMap &controlsInfo = camera_->controls(); + /* Color correction static metadata. */ std::vector aberrationModes = { ANDROID_COLOR_CORRECTION_ABERRATION_MODE_OFF, @@ -882,9 +885,15 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() staticMetadata_->addEntry(ANDROID_REQUEST_PARTIAL_RESULT_COUNT, &partialResultCount, 1); - uint8_t maxPipelineDepth = 2; - staticMetadata_->addEntry(ANDROID_REQUEST_PIPELINE_MAX_DEPTH, - &maxPipelineDepth, 1); + { + /* Default the value to 2 if not reported by the camera. */ + uint8_t maxPipelineDepth = 2; + const auto &infoMap = controlsInfo.find(&controls::draft::PipelineDepth); + if (infoMap != controlsInfo.end()) + maxPipelineDepth = infoMap->second.max().get(); + staticMetadata_->addEntry(ANDROID_REQUEST_PIPELINE_MAX_DEPTH, + &maxPipelineDepth, 1); + } /* LIMITED does not support reprocessing. */ uint32_t maxNumInputStreams = 0;