{"id":12468,"url":"https://patchwork.libcamera.org/api/patches/12468/?format=json","web_url":"https://patchwork.libcamera.org/patch/12468/","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":"<20210528030531.189492-6-hiroh@chromium.org>","date":"2021-05-28T03:05:31","name":"[libcamera-devel,v6,6/6] android: CameraDevice: Report queried test pattern modes","commit_ref":null,"pull_url":null,"state":"changes-requested","archived":false,"hash":"aa78abbb58925e97abd3d8f24d5def8512a8df83","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/12468/mbox/","series":[{"id":2089,"url":"https://patchwork.libcamera.org/api/series/2089/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2089","date":"2021-05-28T03:05:26","name":"[libcamera-devel,v6,1/6] libcamera: controls: Add sensor test pattern mode","version":6,"mbox":"https://patchwork.libcamera.org/series/2089/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12468/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12468/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 39CC9C3205\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 28 May 2021 03:05:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F04D668922;\n\tFri, 28 May 2021 05:05:48 +0200 (CEST)","from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com\n\t[IPv6:2607:f8b0:4864:20::102c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3DD6F68932\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 28 May 2021 05:05:46 +0200 (CEST)","by mail-pj1-x102c.google.com with SMTP id q6so1728711pjj.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 May 2021 20:05:46 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:caec:ab3b:ea16:3d01])\n\tby smtp.gmail.com with ESMTPSA id\n\tl20sm2892051pjq.38.2021.05.27.20.05.43\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 27 May 2021 20:05:44 -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=\"IW/ZnFkm\"; 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=1aFBJcr/n+ZV4L7J15RKBnyQR+JbUBqSyuBTQDCRAic=;\n\tb=IW/ZnFkmDGF9GQqiZ7koIwpnWs7QSLcu+iJjHpp/ZzPhKWNRue0zY0IEQxD30ZhSM/\n\tr+WpYAmdJEkFAjc8gBIM08Uut1BoDOYMCrFUr0YczeH7V55k7XJdCeTY+GdcpMntil1m\n\tZ4D2HFtHbku2TxiWdQIRuCVhWbYguYKuSZ5t0=","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=1aFBJcr/n+ZV4L7J15RKBnyQR+JbUBqSyuBTQDCRAic=;\n\tb=nX6HF3Woelkv1YkpGtwKUM08JIrZ34momd9NId4FKkUW7b4ilx96gEgXavp+WGBsLO\n\tK4xcm4gqZAD8gRSNY6twD9YxMObus9FwnGA0u7fNjFyfYT7zJO50gfhzr/e2FHK2BUdg\n\tlJC7AoVXSXErGKNlo2kGKkercDkW/CXDnumBpMcw4Cvfn/dsO4omXURk/NycvQ4GW05u\n\tJGrBS6RZmEDmQ0hYu7XeQZuuCu1qyR+xCrFxueMdO38RoFdM+PLU1WC8CZA8zrueY2ZW\n\tKtOPwWGyNtveiB8IdKAMuqn2QaSC/C5mJzM1i67PrVECQe51QNRhW3h9LsB+uAJDf7IR\n\txmcw==","X-Gm-Message-State":"AOAM530kmSPZwR3Wu6zvDu+FFXAolb3EeDZpjItqraJ94D0PnW4WKQRL\n\taKw18jUnOL4t8vXLZ9Iq4ZjTUsbg/ZozdA==","X-Google-Smtp-Source":"ABdhPJwguB4wghh93ybEJpooXCDDu53dE8Aif+ivwLEWGbQeNytKhHKLvpHU9P+J6ezknkG8L1/+fw==","X-Received":"by 2002:a17:90a:6005:: with SMTP id\n\ty5mr258674pji.62.1622171144672; \n\tThu, 27 May 2021 20:05:44 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 28 May 2021 12:05:31 +0900","Message-Id":"<20210528030531.189492-6-hiroh@chromium.org>","X-Mailer":"git-send-email 2.32.0.rc0.204.g9fa02ecfa5-goog","In-Reply-To":"<20210528030531.189492-1-hiroh@chromium.org>","References":"<20210528030531.189492-1-hiroh@chromium.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v6 6/6] 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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"Report to the Android camera stack the list of supported test\npattern modes constructed by inspecting the values reported\nby libcamera through the controls::draft::TestPatternMode control.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/android/camera_device.cpp | 46 ++++++++++++++++++++++++++++++++---\n 1 file changed, 43 insertions(+), 3 deletions(-)","diff":"diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp\nindex 7fc4ddb0..d29147bc 100644\n--- a/src/android/camera_device.cpp\n+++ b/src/android/camera_device.cpp\n@@ -1082,11 +1082,51 @@ const camera_metadata_t *CameraDevice::getStaticMetadata()\n \n \tstaticMetadata_->addEntry(ANDROID_SENSOR_ORIENTATION, orientation_);\n \n-\tstd::vector<int32_t> testPatterModes = {\n-\t\tANDROID_SENSOR_TEST_PATTERN_MODE_OFF,\n+\tstd::vector<int32_t> testPatternModes = {\n+\t\tANDROID_SENSOR_TEST_PATTERN_MODE_OFF\n \t};\n+\tif (const auto &testPatternsInfo =\n+\t\t    controlsInfo.find(&controls::draft::TestPatternMode);\n+\t    testPatternsInfo != controlsInfo.end()) {\n+\t\tconst auto &values = testPatternsInfo->second.values();\n+\t\tASSERT(!values.empty());\n+\t\tfor (const auto &value : values) {\n+\t\t\tswitch (value.get<int32_t>()) {\n+\t\t\tcase controls::draft::TestPatternModeOff:\n+\t\t\t\t/*\n+\t\t\t\t * ANDROID_SENSOR_TEST_PATTERN_MODE_OFF is\n+\t\t\t\t * already in testPatternModes.\n+\t\t\t\t */\n+\t\t\t\tbreak;\n+\t\t\tcase controls::draft::TestPatternModeSolidColor:\n+\t\t\t\ttestPatternModes.push_back(\n+\t\t\t\t\tANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR);\n+\t\t\t\tbreak;\n+\t\t\tcase controls::draft::TestPatternModeColorBars:\n+\t\t\t\ttestPatternModes.push_back(\n+\t\t\t\t\tANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS);\n+\t\t\t\tbreak;\n+\t\t\tcase controls::draft::TestPatternModeColorBarsFadeToGray:\n+\t\t\t\ttestPatternModes.push_back(\n+\t\t\t\t\tANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY);\n+\t\t\t\tbreak;\n+\t\t\tcase controls::draft::TestPatternModePn9:\n+\t\t\t\ttestPatternModes.push_back(\n+\t\t\t\t\tANDROID_SENSOR_TEST_PATTERN_MODE_PN9);\n+\t\t\t\tbreak;\n+\t\t\tcase controls::draft::TestPatternModeCustom1:\n+\t\t\t\ttestPatternModes.push_back(\n+\t\t\t\t\tANDROID_SENSOR_TEST_PATTERN_MODE_CUSTOM1);\n+\t\t\t\tbreak;\n+\t\t\tdefault:\n+\t\t\t\tLOG(HAL, Error) << \"Unknown test pattern mode: \"\n+\t\t\t\t\t\t<< value.get<int32_t>();\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t}\n+\t}\n \tstaticMetadata_->addEntry(ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES,\n-\t\t\t\t  testPatterModes);\n+\t\t\t\t  testPatternModes);\n \n \tuint8_t timestampSource = ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN;\n \tstaticMetadata_->addEntry(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE,\n","prefixes":["libcamera-devel","v6","6/6"]}