From patchwork Fri Jun 18 10:33:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 12641 X-Patchwork-Delegate: paul.elder@ideasonboard.com 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 AB4CDBD78E for ; Fri, 18 Jun 2021 10:34:17 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 60DCF6050D; Fri, 18 Jun 2021 12:34:17 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="j3z/HEky"; dkim-atps=neutral Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9A80768942 for ; Fri, 18 Jun 2021 12:34:15 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 300AC3E5; Fri, 18 Jun 2021 12:34:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1624012455; bh=EW0UAEsn953yfsNjHn/JEiHyaxTzFEndifV4wA/fhxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j3z/HEkyF369rLHwhQPod9Qa8euyhvIhEHWQyXVA662JqnF67tx+RucGwqWRTnW00 zuunFic1BhwxsywtITwb8zK2seYk9uWEv7nU5ck5OypCATPB2Qo2wRjGAndJeGPBIb n+vAFkn54DW7eHE4m/tysD0NYprYTeR/oD3QVix8= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Fri, 18 Jun 2021 19:33:45 +0900 Message-Id: <20210618103351.1642060-9-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210618103351.1642060-1-paul.elder@ideasonboard.com> References: <20210618103351.1642060-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 08/14] android: Plumb AwbMode control 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" Plumb the AwbMode control into the HAL for CONTROL_AWB_AVAILABLE_MODES for static metadata. Bug: https://bugs.libcamera.org/show_bug.cgi?id=44 Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart --- TODO: plumb result metadata --- src/android/camera_device.cpp | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 3add5bc6..a8b6fa38 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -985,15 +985,25 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() staticMetadata_->addEntry(ANDROID_CONTROL_AVAILABLE_VIDEO_STABILIZATION_MODES, availableStabilizationModes); - /* - * \todo Inspect the Camera capabilities to report the available - * AWB modes. Default to AUTO as CTS tests require it. - */ - std::vector availableAwbModes = { - ANDROID_CONTROL_AWB_MODE_AUTO, - }; + std::vector awbAvailableModes; + awbAvailableModes.reserve(2); + const auto &awbModesInfo = controlsInfo.find(&controls::AwbMode); + if (awbModesInfo != controlsInfo.end()) { + for (const auto &value : awbModesInfo->second.values()) + awbAvailableModes.push_back(value.get()); + } else { + awbAvailableModes.push_back(ANDROID_CONTROL_AWB_MODE_AUTO); + } + + if (std::find(awbAvailableModes.begin(), + awbAvailableModes.end(), + ANDROID_CONTROL_AWB_MODE_OFF) == awbAvailableModes.end()) { + fullSupport = false; + /* \todo Double check if this is the correct capability */ + capabilities[ANDROID_REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING] = false; + } staticMetadata_->addEntry(ANDROID_CONTROL_AWB_AVAILABLE_MODES, - availableAwbModes); + awbAvailableModes); std::vector availableMaxRegions = { 0, 0, 0,