{"id":12205,"url":"https://patchwork.libcamera.org/api/patches/12205/?format=json","web_url":"https://patchwork.libcamera.org/patch/12205/","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":"<20210506075449.1761752-7-hiroh@chromium.org>","date":"2021-05-06T07:54:49","name":"[libcamera-devel,v4,6/6] 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/12205/mbox/","series":[{"id":2001,"url":"https://patchwork.libcamera.org/api/series/2001/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2001","date":"2021-05-06T07:54:43","name":"[libcamera-devel,v4,1/6] libcamera: controls: Add sensor test pattern mode","version":4,"mbox":"https://patchwork.libcamera.org/series/2001/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12205/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12205/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 5E113BDE7F\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 May 2021 07:55:09 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1FEBE6891C;\n\tThu,  6 May 2021 09:55:09 +0200 (CEST)","from mail-pl1-x631.google.com (mail-pl1-x631.google.com\n\t[IPv6:2607:f8b0:4864:20::631])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B39FC68925\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 May 2021 09:55:06 +0200 (CEST)","by mail-pl1-x631.google.com with SMTP id b3so2956849plg.11\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 06 May 2021 00:55:06 -0700 (PDT)","from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:2:ede4:ae0e:d4a4:c0d3])\n\tby smtp.gmail.com with ESMTPSA id\n\tf201sm1355546pfa.133.2021.05.06.00.55.03\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 06 May 2021 00:55: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=\"Mc1sgqIF\"; 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=PG62SFUcUT60t1iuwKKoBqdqCmkKztBSu4RhIwCnTPg=;\n\tb=Mc1sgqIF0Jyt2prbymVwrnyydiDKoPEWGB1kgxFkircXVmCRIxdDDnUVKhzJ7kRkE/\n\t85LOT7RH7ZJSZ0mn18Emgpwvq9U4d9Qufd3pfoFC94uOcdl7b1TEMgmHHMI1pCDU5nw8\n\tTGcMmOHx0FpToEETXegK8XL51+9Ztee3/hPCE=","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=PG62SFUcUT60t1iuwKKoBqdqCmkKztBSu4RhIwCnTPg=;\n\tb=Jn7uGtPEqxmH1LNdb8MyYSHcu7hOCkYY27oJHWVPsy5JUGBjqQ53zfmmzpqCqDFEBm\n\tdFYePHDqxZtq96BYa3BVfRg28PVXXvjK4qXGWdKr1zDhnOEF8aOwU+aPY7Q/5d4P91PQ\n\tSV851JBncfeT0uoJZlMy0VzhTmg8Rd9n37aMINJW9UoSIbeeVoXeEqMPMvuSTI8pjYfX\n\tV61PL/lcQZIj0xKlkhJO/RXxAvtr6u4EXfiHgMMpOOZKkP7nSrrCbzyqpw637ZX/HZGu\n\tD4IlSeNQca5sCK96LwqkAicPRtSnvxI4++e577U7Zxd7ISdeDkL9Md1WGiG5ANeftkfD\n\tHmTQ==","X-Gm-Message-State":"AOAM532wHW8USCvWA5owu5JTPL7C9tUfDUJCaVVB6/7WR908ujitDQZV\n\tvS+lCMAaRT4Tk+j1v96xCcL51yIYS7nCJg==","X-Google-Smtp-Source":"ABdhPJytg1i3PI/K/WYHBdJtmnd3fRr/VRFSuE2bOgakkqvGEN+lNTU07rAmbKOQ/ePwjQQQP9I14Q==","X-Received":"by 2002:a17:90a:ad84:: with SMTP id\n\ts4mr16499626pjq.162.1620287705058; \n\tThu, 06 May 2021 00:55:05 -0700 (PDT)","From":"Hirokazu Honda <hiroh@chromium.org>","To":"libcamera-devel@lists.libcamera.org","Date":"Thu,  6 May 2021 16:54:49 +0900","Message-Id":"<20210506075449.1761752-7-hiroh@chromium.org>","X-Mailer":"git-send-email 2.31.1.607.g51e8a6a459-goog","In-Reply-To":"<20210506075449.1761752-1-hiroh@chromium.org>","References":"<20210506075449.1761752-1-hiroh@chromium.org>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v4 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>","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","v4","6/6"]}