{"id":12024,"url":"https://patchwork.libcamera.org/api/patches/12024/?format=json","web_url":"https://patchwork.libcamera.org/patch/12024/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210421042346.312854-8-hiroh@chromium.org>","date":"2021-04-21T04:23:46","name":"[libcamera-devel,v2,7/7] android: CameraDevice: Report queried test pattern modes","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"4745e9547f5557c4b647c8f7512bf8f8ffb60361","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/?format=json","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12024/mbox/","series":[{"id":1953,"url":"https://patchwork.libcamera.org/api/series/1953/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1953","date":"2021-04-21T04:23:39","name":"Report Android HAL client test pattern modes","version":2,"mbox":"https://patchwork.libcamera.org/series/1953/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12024/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12024/checks/","tags":{},"headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 83D89BDB17\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 21 Apr 2021 04:24:08 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 424D068856;\n\tWed, 21 Apr 2021 06:24:08 +0200 (CEST)","from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com\n\t[IPv6:2607:f8b0:4864:20::42e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 86626602C3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 21 Apr 2021 06:24:06 +0200 (CEST)","by mail-pf1-x42e.google.com with SMTP id p67so22523014pfp.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 20 Apr 2021 21:24:06 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:7aaa:cbeb:5d87:4ab6])\n\tby smtp.gmail.com with ESMTPSA id\n\tz18sm461316pfa.39.2021.04.20.21.24.03\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 20 Apr 2021 21:24:04 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"We9cpFK0\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=2ahqEEkbk0IO54qh9kBPBbYxJzeWa4xWg0+E7yMfngo=;\n\tb=We9cpFK0U/7LdWasytMKLoX1Gy0+j0JUEAmPdFT4rn43Vpa5ynER8uUEC7NvqAWW7y\n\tNhd7JA3MMYaIWtzDFY/zQmxUI8Kp++MTJzGyuWLjWwECaJ6eA8w1UQOXJo+oITzmvtyG\n\t7LuE8bhHsp5JWIv7UHZTKR2DM4ePK0OHrtxsc=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=2ahqEEkbk0IO54qh9kBPBbYxJzeWa4xWg0+E7yMfngo=;\n\tb=PL7IfAty3AoFP7ffUiPXQx5FbQ0QRTSqJgVvhhXvW+gXxs0bKPuqKgRDsyG3CLGFuv\n\tGbXp2nGWCmiujLygSk+OjVOhvFHpEJ84YAk7qcf1VGTgxmGATsBIXH/km960MiIiVsAq\n\tJQesfiuGfCovGICmlO+ZKTAk+zwdlXlFsrVL3EjGgfE6emGX2K5okdT8hOsSgQbd7qEX\n\tPgwFRNF9GE7D+3XjalFdYbv6Eys8uk8Bnd/7GqK/onXTZc9xJ/YW+dvmGeCMGyGk6RNL\n\tbBmGIVV2BD8SJt4ZREN7VRaM5KlXshKoIxUQo2JEczeNdCTft2mqQaoDVZ9PLEUNVefq\n\tk5Lw==","X-Gm-Message-State":"AOAM533/p6CpVSmHGXxMIGs2nuxduPUQbPIenFnef/gmnx/ramLaOwDe\n\tdtxjt2I/eMczwWnwVjXi5PbmrxGm+lhBtw==","X-Google-Smtp-Source":"ABdhPJw5G9yb8tGK3V8PZYLmr0o56+um0LdVyF0UWHJiHfq3AhwqjNpruxvwoQv+XyPbxnGu497ZDA==","X-Received":"by 2002:a17:90b:302:: with SMTP id\n\tay2mr8796379pjb.84.1618979044956; \n\tTue, 20 Apr 2021 21:24:04 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 21 Apr 2021 13:23:46 +0900","Message-Id":"<20210421042346.312854-8-hiroh@chromium.org>","X-Mailer":"git-send-email 2.31.1.368.gbe11c130af-goog","In-Reply-To":"<20210421042346.312854-1-hiroh@chromium.org>","References":"<20210421042346.312854-1-hiroh@chromium.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v2 7/7] android: CameraDevice: Report\n\tqueried test pattern modes","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Report test pattern modes obtained by Camera::controls().\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n src/android/camera_device.cpp | 46 ++++++++++++++++++++++++++++++++---\n 1 file changed, 42 insertions(+), 4 deletions(-)","diff":"diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 3d5b5f24..a96bc09b 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -1090,12 +1090,50 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n \n \tstaticMetadata_->addEntry(ANDROID_SENSOR_ORIENTATION, &orientation_, 1);\n \n-\tstd::vector<int32_t> testPatterModes = {\n-\t\tANDROID_SENSOR_TEST_PATTERN_MODE_OFF,\n+\tconst auto &testPatternsInfo =\n+\t\tcontrolsInfo.find(&controls::draft::TestPatternMode);\n+\tstd::vector<int32_t> testPatternModes = {\n+\t\tANDROID_SENSOR_TEST_PATTERN_MODE_OFF\n \t};\n+\tif (testPatternsInfo != controlsInfo.end()) {\n+\t\tconst auto &values = testPatternsInfo->second.values();\n+\t\tif (!values.empty()) {\n+\t\t\ttestPatternModes.clear();\n+\t\t\tfor (const auto &value : values) {\n+\t\t\t\tint aValue = -1;\n+\t\t\t\tswitch (value.get<int32_t>()) {\n+\t\t\t\tcase controls::draft::TestPatternModeOff:\n+\t\t\t\t\taValue = ANDROID_SENSOR_TEST_PATTERN_MODE_OFF;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase controls::draft::TestPatternModeSolidColor:\n+\t\t\t\t\taValue = ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase controls::draft::TestPatternModeColorBars:\n+\t\t\t\t\taValue = ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase controls::draft::TestPatternModeColorBarsFadeToGray:\n+\t\t\t\t\taValue = ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase controls::draft::TestPatternModePn9:\n+\t\t\t\t\taValue = ANDROID_SENSOR_TEST_PATTERN_MODE_PN9;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase controls::draft::TestPatternModeCustom1:\n+\t\t\t\t\taValue = ANDROID_SENSOR_TEST_PATTERN_MODE_CUSTOM1;\n+\t\t\t\t\tbreak;\n+\t\t\t\tdefault:\n+\t\t\t\t\tLOG(HAL, Error)\n+\t\t\t\t\t\t<< \"Unknown test pattern mode: \"\n+\t\t\t\t\t\t<< value.get<int32_t>();\n+\t\t\t\t\tcontinue;\n+\t\t\t\t}\n+\n+\t\t\t\ttestPatternModes.push_back(aValue);\n+\t\t\t}\n+\t\t}\n+\t}\n \tstaticMetadata_->addEntry(ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES,\n-\t\t\t\t  testPatterModes.data(),\n-\t\t\t\t  testPatterModes.size());\n+\t\t\t\t  testPatternModes.data(),\n+\t\t\t\t  testPatternModes.size());\n \n \tuint8_t timestampSource = ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN;\n \tstaticMetadata_->addEntry(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE,\n","prefixes":["libcamera-devel","v2","7/7"]}