From patchwork Fri Apr 9 04:32:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 11879 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 771A9BD16B for ; Fri, 9 Apr 2021 04:32:25 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 34772687F7; Fri, 9 Apr 2021 06:32:25 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="HnxANvM/"; dkim-atps=neutral Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 917FF687F6 for ; Fri, 9 Apr 2021 06:32:22 +0200 (CEST) Received: by mail-pf1-x42e.google.com with SMTP id s11so3416993pfm.1 for ; Thu, 08 Apr 2021 21:32:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rt0niqZ40i9cEjc69uBp4Vek+/PtndSNNMtfOnooYt4=; b=HnxANvM/9MKi5Uri8y7yzZv19onvBtdHJ4hYt/Z3YAW74OVTrzjlBeB6JYmODiPM54 LSnwYvCt6qm10v8gyrrMjssM9bbST3QvTsvyszhqdjnijsskNyMPvYsta5pl9O5L3CTA fneDA6RDzzXI/O9LZgvrGgcpg2bTWMu0P/+bI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rt0niqZ40i9cEjc69uBp4Vek+/PtndSNNMtfOnooYt4=; b=BwnJSgjQ0ajw4h27cit/zXbuUZBRwYu7/sm18gSFBlTjoE2yTADPVuvhB0brdG5d7i 9mziHf626pV9LoXsV8bueGdH59wx37pZT0DXm6Q5rb2fPE9eE2dpUY9h9FfHHZSVOOgS EaJD5Yiq87me5AttxrfSRsaABpkxi/Vqmgb8EuZBVXpo4/l0fy4TpUYXytCEe0mvyhqp CO+cj0Uf7Zjf2HqfFAS0uWUlsg3pf8MmkMlT/WZ98fdk0j2UFgvQux5CICxXdHSVxuwF 9reQtUeK4s04S+3inizbRNssjJowPALHpZJlnvN282cu3Z2VxD6lAb3TIJX4fmnVppST B1MQ== X-Gm-Message-State: AOAM5300o3S7O7g7MA/oHo1ynvLLOqd2u6DUUTz56ziSq5r28dWntAAS m7aMRSrHz5BTlrf1aePtT+AlsuYSF8Y/5Q== X-Google-Smtp-Source: ABdhPJz/BJwhXy2mYFCuJiSUI9atbM+sySGSALys9PoEnfmW9szAp9nOu7YXeICD8yZ0vfbE3iEcMg== X-Received: by 2002:a63:604:: with SMTP id 4mr11261168pgg.267.1617942741087; Thu, 08 Apr 2021 21:32:21 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:7567:510e:1b47:ce92]) by smtp.gmail.com with ESMTPSA id il6sm737275pjb.56.2021.04.08.21.32.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 21:32:20 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Fri, 9 Apr 2021 13:32:08 +0900 Message-Id: <20210409043208.1823330-6-hiroh@chromium.org> X-Mailer: git-send-email 2.31.1.295.g9ea45b61b8-goog In-Reply-To: <20210409043208.1823330-1-hiroh@chromium.org> References: <20210409043208.1823330-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 5/5] android: CameraDevice: Report queried test pattern modes 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" Report test pattern modes obtained by Camera::controls(). Signed-off-by: Hirokazu Honda --- src/android/camera_device.cpp | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 89044efa..8701cc69 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1075,12 +1075,22 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() staticMetadata_->addEntry(ANDROID_SENSOR_ORIENTATION, &orientation_, 1); - std::vector testPatterModes = { - ANDROID_SENSOR_TEST_PATTERN_MODE_OFF, + const auto &sensorTestPatternsInfo = + controlsInfo.find(&controls::draft::SensorTestPatternMode); + std::vector testPatternModes = { + ANDROID_SENSOR_TEST_PATTERN_MODE_OFF }; + if (sensorTestPatternsInfo != controlsInfo.end()) { + const auto &values = sensorTestPatternsInfo->second.values(); + if (!values.empty()) { + testPatternModes.clear(); + for (const auto &value : values) + testPatternModes.push_back(value.get()); + } + } staticMetadata_->addEntry(ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES, - testPatterModes.data(), - testPatterModes.size()); + testPatternModes.data(), + testPatternModes.size()); std::vector physicalSize = { 2592, 1944,