From patchwork Fri May 28 03:05:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12463 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 07FE1C3205 for ; Fri, 28 May 2021 03:05:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 743296891D; Fri, 28 May 2021 05:05:40 +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="SLq0yNlE"; dkim-atps=neutral Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id AAC80602A8 for ; Fri, 28 May 2021 05:05:38 +0200 (CEST) Received: by mail-pf1-x434.google.com with SMTP id g18so2174766pfr.2 for ; Thu, 27 May 2021 20:05:38 -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:mime-version :content-transfer-encoding; bh=EmEFi71fdx/pdk21B+JDFadcOckyLnEZiA1WEAjXxS8=; b=SLq0yNlEd7xcj1Yq7ruIXJprrsLJTg1pt00/ZBh42FuuTeN+XHLR2pblw5XFguGC1n LNfCJ3HazpJNgilNxF/Kv39DbFGTfzign7EGrRgdXy06xiJyVZ2vEMY//v+ngJBhJ/re yuuTCJbbFPRYz/HofeTfWpwAycEAu2pIT175o= 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:mime-version :content-transfer-encoding; bh=EmEFi71fdx/pdk21B+JDFadcOckyLnEZiA1WEAjXxS8=; b=lTiePNrbYgKHnXrOcVz4eD1+HQSEVDe5fp0EylIy38hNA429OYD9aJ2EqmrN/2CCAF k/NK747T7pPmDyaUFaFH2CIbLTKJd1l8xMO/ScjcjajPnWEh0xi9FDwTD9qEKJyd/OjB Ih/GETT8MKtTbJLGIAq3jvuE5V7fmFj5N2D2qPOgpcfABTWRH2XJvgOFbFv1esE17Twa I2tLiBs4vtpKc5RD2rC5bvIR6y88FtqWfAILtY45YZ3tQoJxKe5Ods2/Hx6VRjUH36KM YcehhuTo3qVgugzTdbO5CPWCVCbL0WVW2/FArR2Yv+GfkGucc+YgYaj5RndxckDlMTr0 QkYw== X-Gm-Message-State: AOAM530WsOfOcSMskfNG8XIiZ8gj3CBzJ+vyM4MsKHiUVkoM5D+zeseN C04IdtE1qcpq9UVHvJSGGehYTPWkKsrC3g== X-Google-Smtp-Source: ABdhPJwOPiPPlKFYbvCKUVIe34Qmgug6p1+tPtO68rqULr4Gk5sqCtxHyvF8JVaqjwxgYQmGxi05wQ== X-Received: by 2002:a62:3242:0:b029:2d5:5913:7fd with SMTP id y63-20020a6232420000b02902d5591307fdmr1710951pfy.30.1622171136615; Thu, 27 May 2021 20:05:36 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:caec:ab3b:ea16:3d01]) by smtp.gmail.com with ESMTPSA id l20sm2892051pjq.38.2021.05.27.20.05.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 May 2021 20:05:36 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Fri, 28 May 2021 12:05:26 +0900 Message-Id: <20210528030531.189492-1-hiroh@chromium.org> X-Mailer: git-send-email 2.32.0.rc0.204.g9fa02ecfa5-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v6 1/6] libcamera: controls: Add sensor test pattern mode 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" The control is used to report available sensor test pattern modes and also specify the mode to sensor. Signed-off-by: Hirokazu Honda Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/control_ids.yaml | 58 ++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/src/libcamera/control_ids.yaml b/src/libcamera/control_ids.yaml index 88d81ac4..b1fe1dc6 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -615,4 +615,62 @@ controls: detection, additional format conversions etc) count as an additional pipeline stage. + - TestPatternMode: + type: int32_t + draft: true + description: | + Control to select the test pattern mode. Currently identical to + ANDROID_SENSOR_TEST_PATTERN_MODE. + enum: + - name: TestPatternModeOff + value: 0 + description: | + No test pattern mode is used. The camera device returns frames from + the image sensor. + - name: TestPatternModeSolidColor + value: 1 + description: | + Each pixel in [R, G_even, G_odd, B] is replaced by its respective + color channel provided in test pattern data. + \todo Add control for test pattern data. + - name: TestPatternModeColorBars + value: 2 + description: | + All pixel data is replaced with an 8-bar color pattern. The vertical + bars (left-to-right) are as follows; white, yellow, cyan, green, + magenta, red, blue and black. Each bar should take up 1/8 of the + sensor pixel array width. When this is not possible, the bar size + should be rounded down to the nearest integer and the pattern can + repeat on the right side. Each bar's height must always take up the + full sensor pixel array height. + - name: TestPatternModeColorBarsFadeToGray + value: 3 + description: | + The test pattern is similar to TestPatternModeColorBars, + except that each bar should start at its specified color at the top + and fade to gray at the bottom. Furthermore each bar is further + subdevided into a left and right half. The left half should have a + smooth gradient, and the right half should have a quantized + gradient. In particular, the right half's should consist of blocks + of the same color for 1/16th active sensor pixel array width. The + least significant bits in the quantized gradient should be copied + from the most significant bits of the smooth gradient. The height of + each bar should always be a multiple of 128. When this is not the + case, the pattern should repeat at the bottom of the image. + - name: TestPatternModePn9 + value: 4 + description: | + All pixel data is replaced by a pseudo-random sequence generated + from a PN9 512-bit sequence (typically implemented in hardware with + a linear feedback shift register). The generator should be reset at + the beginning of each frame, and thus each subsequent raw frame with + this test pattern should be exactly the same as the last. + - name: TestPatternModeCustom1 + value: 5 + description: | + The first custom test pattern. All custom patterns that are + available only on this camera device are at least this numeric + value. All of the custom test patterns will be static (that is the + raw image must not vary from frame to frame). + ... From patchwork Fri May 28 03:05:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12464 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 1CA15C3205 for ; Fri, 28 May 2021 03:05:42 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id D126A6891E; Fri, 28 May 2021 05:05:41 +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="acjk/D7L"; dkim-atps=neutral Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id C558B6891D for ; Fri, 28 May 2021 05:05:39 +0200 (CEST) Received: by mail-pf1-x430.google.com with SMTP id y15so2136853pfn.13 for ; Thu, 27 May 2021 20:05:39 -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=oFqBC1evGDoYaQp4OZbBwiSe0Fjh0ge5LISerDTqP00=; b=acjk/D7LLgl8i/d1XqfAxvasis026S0I3S+TlWWjdhd2ALdRVQEInMsO1iqanRizHT CUWfU3Y2CQAD2G+POeJUexCAWfFqJSI6vbOhKxRa2yjbwMUJwOdx8O3E09Ad1eN2ayi6 bTcNYeRU62RdOKzSuG20Wr9VZOd4mL18PJOuo= 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=oFqBC1evGDoYaQp4OZbBwiSe0Fjh0ge5LISerDTqP00=; b=c+Uc5Ew/t5r40hJAoKLTdshWmk+a81XCdMMEBj8vdzszhsc+Mj09hOejqiLH2RsPbd pTb4tUWgr7rUw/FE3Ih49AXRYo/L/q11hBIx4CIb/09Ag17PGsJPXrBd6WbFxD3OvvhB 4zlrmTlk0F/gUOgXS61d476g6RMFEyK5KbQf5H3WrplU/y2vTgEacr5y035GK59dqgES hnQJTgM779BM9XNhD39pO/7zFGgbLOML1WSfkVgykTnKAIrrt5uVnQIx3+nmgS1Qb56V TSSufozkFdchS26Afmad99qlZmlN4jjbwozHGpnbpFuAqHNmIXQWt/+Ky/q4uZNnKJop ys3Q== X-Gm-Message-State: AOAM532TQCIbkFoiFWB26Fdz5SpdcJTCXPHK39P0D6QNi48zL4gZMdWx 4VE/wOkgFZsU/YpxF3ZhB2RhmW0LlPuJwg== X-Google-Smtp-Source: ABdhPJzeyP/3xNelM89a/stvmQdRPU/TdbUrKXmLo2jDZIoyW/yDL1lU6myfjIs3IKmNpShLKyIwVg== X-Received: by 2002:a62:8389:0:b029:27d:28f4:d583 with SMTP id h131-20020a6283890000b029027d28f4d583mr1669540pfe.33.1622171138207; Thu, 27 May 2021 20:05:38 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:caec:ab3b:ea16:3d01]) by smtp.gmail.com with ESMTPSA id l20sm2892051pjq.38.2021.05.27.20.05.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 May 2021 20:05:37 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Fri, 28 May 2021 12:05:27 +0900 Message-Id: <20210528030531.189492-2-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 Subject: [libcamera-devel] [PATCH v6 2/6] libcamera: V4L2Device: Support v4l2 menu 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" This adds a support of v4l2 menu. The control info for v4l2 menu contains indices without names and 64bit values of querymenu. Signed-off-by: Hirokazu Honda --- include/libcamera/internal/v4l2_device.h | 2 + src/libcamera/v4l2_device.cpp | 47 ++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h index b82e2a14..687be9b2 100644 --- a/include/libcamera/internal/v4l2_device.h +++ b/include/libcamera/internal/v4l2_device.h @@ -56,6 +56,8 @@ protected: int fd() const { return fd_; } private: + ControlInfo v4l2MenuControlInfo(const v4l2_query_ext_ctrl &ctrl); + void listControls(); void updateControls(ControlList *ctrls, Span v4l2Ctrls); diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index caafbc2d..032252bb 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -530,6 +530,33 @@ int V4L2Device::ioctl(unsigned long request, void *argp) * \return The V4L2 device file descriptor, -1 if the device node is not open */ +/** + * \brief Create ControlInfo for v4l2 menu ctrl + * \param[in] ctrl The v4l2_query_ext_ctrl that represents a menu + * \param[out] ctrlInfo The created controlInfo + * + * The created ControlInfo contains indices acquired by VIDIOC_QUERYMENU. + * + * \return ControlInfo for v4l2 menu ctrl. + */ +ControlInfo V4L2Device::v4l2MenuControlInfo(const v4l2_query_ext_ctrl &ctrl) +{ + std::vector indices; + v4l2_querymenu menu; + memset(&menu, 0, sizeof(menu)); + menu.id = ctrl.id; + + for (menu.index = ctrl.minimum; + static_cast(menu.index) <= ctrl.maximum; menu.index++) { + if (ioctl(VIDIOC_QUERYMENU, &menu) != 0) + continue; + + indices.emplace_back(static_cast(menu.index)); + } + + return ControlInfo(indices); +} + /* * \brief List and store information about all controls supported by the * V4L2 device @@ -539,7 +566,6 @@ void V4L2Device::listControls() ControlInfoMap::Map ctrls; struct v4l2_query_ext_ctrl ctrl = {}; - /* \todo Add support for menu controls. */ while (1) { ctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL | V4L2_CTRL_FLAG_NEXT_COMPOUND; @@ -550,16 +576,22 @@ void V4L2Device::listControls() ctrl.flags & V4L2_CTRL_FLAG_DISABLED) continue; + ControlInfo ctrlInfo; switch (ctrl.type) { case V4L2_CTRL_TYPE_INTEGER: case V4L2_CTRL_TYPE_BOOLEAN: - case V4L2_CTRL_TYPE_MENU: case V4L2_CTRL_TYPE_BUTTON: case V4L2_CTRL_TYPE_INTEGER64: case V4L2_CTRL_TYPE_BITMASK: - case V4L2_CTRL_TYPE_INTEGER_MENU: case V4L2_CTRL_TYPE_U8: + ctrlInfo = v4l2ControlInfo(ctrl); + break; + + case V4L2_CTRL_TYPE_INTEGER_MENU: + case V4L2_CTRL_TYPE_MENU: + ctrlInfo = v4l2MenuControlInfo(ctrl); break; + /* \todo Support other control types. */ default: LOG(V4L2, Debug) @@ -568,10 +600,13 @@ void V4L2Device::listControls() continue; } + LOG(V4L2, Debug) << "Control: " << ctrl.name + << " (" << utils::hex(ctrl.id) << ")"; + controlIds_.emplace_back(v4l2ControlId(ctrl)); controlInfo_.emplace(ctrl.id, ctrl); - ctrls.emplace(controlIds_.back().get(), v4l2ControlInfo(ctrl)); + ctrls.emplace(controlIds_.back().get(), std::move(ctrlInfo)); } controls_ = std::move(ctrls); @@ -638,6 +673,10 @@ void V4L2Device::updateControls(ControlList *ctrls, value.set(v4l2Ctrl->value64); break; + case ControlTypeInteger32: + value.set(v4l2Ctrl->value); + break; + case ControlTypeByte: /* * No action required, the VIDIOC_[GS]_EXT_CTRLS ioctl From patchwork Fri May 28 03:05:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12465 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 104C1C3205 for ; Fri, 28 May 2021 03:05:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C5A8F68928; Fri, 28 May 2021 05:05:45 +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="KEudBN3m"; dkim-atps=neutral Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7C0E66891E for ; Fri, 28 May 2021 05:05:41 +0200 (CEST) Received: by mail-pf1-x42c.google.com with SMTP id g18so2174857pfr.2 for ; Thu, 27 May 2021 20:05:41 -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=1mgTVTj9HIrtZgDXP5g+nM7aA1/x6toabEVAACNVooQ=; b=KEudBN3mvZcdL5ClsxE6jEH0qdX8skJx9SFvHQBDz/aO8f4QQZJoYnlr6wZUGw9Z0n nkRdzZHQ6o7WRrMf+k5mpLtOLH0S9CPqRGVpj/4qmD3IqewdZ9I9mno1JuCB9l6ChuGH 30qzoBNvyH+APUUePb94wu75tx8gnqzt9hlMU= 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=1mgTVTj9HIrtZgDXP5g+nM7aA1/x6toabEVAACNVooQ=; b=G4ozReQ2GCeuWlnXKGn1AeFEeFPzH9l02Uw5UV7CPS5+qoyovzUk/5l2qXAqg/+vN4 U39GtVaPX9PZCTrAN+FfvNg6/X3ysZR0vO7ENLIWNKALj962jXebByanF7Ou+55R7Ksf +GL1I0q0uQ/moPJuE0+E5V8YuajT7acWE2FQSnedKWqi1hO7vXod6TdQGkwuqpomDAf8 zyZX92F3BFBQtdcnIIsdKxu8AwEkPCbJ4sq/HluHUR4fvhyqxDYxNN1x8aC/XNr74ITf HEj2CdsO9TqR7GRtaYsFh9cHq0aUuI2FFar90Te090M5R/rgTcIQm0GakhkmMDadlng3 O1HQ== X-Gm-Message-State: AOAM532L4YynzZij76MHY2ymRu5cwJGPe7MEwRDchi9fZaB8Hp9in6Ae wtNAmMHYNqj28/YPk23Im+jIN6iSPYOrMA== X-Google-Smtp-Source: ABdhPJwIEuKSsCKK3bqsGIKSgEga2J+b5337DMhUNYw0uS1IBSRbzRDZLgBojK1bVHWHfYVvh0V2rw== X-Received: by 2002:a62:fb17:0:b029:2df:b6dc:c68c with SMTP id x23-20020a62fb170000b02902dfb6dcc68cmr1579721pfm.31.1622171139675; Thu, 27 May 2021 20:05:39 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:caec:ab3b:ea16:3d01]) by smtp.gmail.com with ESMTPSA id l20sm2892051pjq.38.2021.05.27.20.05.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 May 2021 20:05:39 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Fri, 28 May 2021 12:05:28 +0900 Message-Id: <20210528030531.189492-3-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 Subject: [libcamera-devel] [PATCH v6 3/6] libcamera: CameraSensorProperties: Add table of v4l2 index and test pattern 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" The V4L2 specification defines the sensor test pattern modes through a menu control, where a numerical index is associated to a string that describes the test pattern. The index-to-pattern mapping is driver specific and requires a corresponding representation in the library. Add to the static list of CameraSensorProperties a map of indexes to libcamera::controls::TestPatternModes values to be able to map the indexes returned by the driver to the corresponding test pattern mode. Signed-off-by: Hirokazu Honda --- .../internal/camera_sensor_properties.h | 2 ++ src/libcamera/camera_sensor_properties.cpp | 32 +++++++++++++++++++ 2 files changed, 34 insertions(+) diff --git a/include/libcamera/internal/camera_sensor_properties.h b/include/libcamera/internal/camera_sensor_properties.h index f5e242cb..88ec7261 100644 --- a/include/libcamera/internal/camera_sensor_properties.h +++ b/include/libcamera/internal/camera_sensor_properties.h @@ -7,6 +7,7 @@ #ifndef __LIBCAMERA_SENSOR_CAMERA_SENSOR_PROPERTIES_H__ #define __LIBCAMERA_SENSOR_CAMERA_SENSOR_PROPERTIES_H__ +#include #include #include @@ -17,6 +18,7 @@ struct CameraSensorProperties { static const CameraSensorProperties *get(const std::string &sensor); Size unitCellSize; + std::map testPatternModeMap; }; } /* namespace libcamera */ diff --git a/src/libcamera/camera_sensor_properties.cpp b/src/libcamera/camera_sensor_properties.cpp index 2a6e97f7..841564ff 100644 --- a/src/libcamera/camera_sensor_properties.cpp +++ b/src/libcamera/camera_sensor_properties.cpp @@ -9,6 +9,8 @@ #include +#include + #include "libcamera/internal/log.h" /** @@ -34,6 +36,11 @@ LOG_DEFINE_CATEGORY(CameraSensorProperties) * * \var CameraSensorProperties::unitCellSize * \brief The physical size of a pixel, including pixel edges, in nanometers. + * + * \var CameraSensorProperties::testPatternModeMap + * \brief Map that associates the indexes of the sensor test pattern modes as + * returned by V4L2_CID_TEST_PATTERN with the corresponding TestPattern + * control value */ /** @@ -47,15 +54,40 @@ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sen static const std::map sensorProps = { { "imx219", { .unitCellSize = { 1120, 1120 }, + .testPatternModeMap = { + { 0, controls::draft::TestPatternModeOff }, + { 1, controls::draft::TestPatternModeColorBars }, + { 2, controls::draft::TestPatternModeSolidColor }, + { 3, controls::draft::TestPatternModeColorBarsFadeToGray }, + { 4, controls::draft::TestPatternModePn9 }, + }, } }, { "ov5670", { .unitCellSize = { 1120, 1120 }, + .testPatternModeMap = { + { 0, controls::draft::TestPatternModeOff }, + { 1, controls::draft::TestPatternModeColorBars }, + }, } }, { "ov13858", { .unitCellSize = { 1120, 1120 }, + .testPatternModeMap = { + { 0, controls::draft::TestPatternModeOff }, + { 1, controls::draft::TestPatternModeColorBars }, + { 2, controls::draft::TestPatternModeColorBarsFadeToGray }, + }, } }, { "ov5693", { .unitCellSize = { 1400, 1400 }, + .testPatternModeMap = { + { 0, controls::draft::TestPatternModeOff }, + { 2, controls::draft::TestPatternModeColorBars }, + /* + * No correspondence test pattern mode for + * 1: "Random data" and 3: "Colour Bars with + * Rolling Bar". + */ + }, } }, }; From patchwork Fri May 28 03:05:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12466 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 9D7CDC3207 for ; Fri, 28 May 2021 03:05:46 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5CB3268933; Fri, 28 May 2021 05:05:46 +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="n65a2hhU"; dkim-atps=neutral Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0564868929 for ; Fri, 28 May 2021 05:05:43 +0200 (CEST) Received: by mail-pg1-x531.google.com with SMTP id i5so1519963pgm.0 for ; Thu, 27 May 2021 20:05:42 -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=L7UhLYlZoGGrSQ1X2nz/Pg5KvfexOUFGt+cI8mulf+w=; b=n65a2hhUPQmec+LMBb5av2t5r8GLQMUO12/3xrFYRRNaIHaf2k0ZBErN6HXoy+XmMj 6L0cKhVVHMxBTbSuk5O6DNZrLhdxrpAFMLSukp/hsuV7kXzgTyGLET68A7YWJISQL67U CVDDgq4yPQ+5YuRS20YevOPFWxTL3dh1EjT0w= 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=L7UhLYlZoGGrSQ1X2nz/Pg5KvfexOUFGt+cI8mulf+w=; b=obLiQ/tEvGv1fhUrUFOOcYwLlpStn+gaZUmLIn0iZHbk5vEP7wc9oJ+eamZGZxsju9 c3Mj9czHycp6J802/l71xwjnC/ty8sEQ9I54Yx+jNGMIHhTr5dBRgrytFNhJb2o/jfIL EaChTnwetYNxFDPn5q+WjwSH5nFq/Fmk2gF5CyqhHTitwtHimsNxF4pia4u99dHIXgOj idrcmbZPG/oICxlX84pZ+Jxfc5paP9mLGOGVrG15BrdqWeN/rCHCc+8OHOOXQVpQkSgr IdXFVk7tfnVb3xgcqRh0g77gPv5hXph/deX9Bzg0BUPGtDk2umDL4P+OHTPKffPqZmVC Wg0Q== X-Gm-Message-State: AOAM533tSV/5WzOWGp6YRPt3s0EE9/0wNPbMDeps+BuVKRSlRZ7RZTbA sRL49sEVwufDmsfQti4u3DqnK9foftuoFg== X-Google-Smtp-Source: ABdhPJwFhRBNeAswO3LoIYStLkcINQYF4bCGLR1El/53OP39Lm68hOfSgX+HqeGeYmTMV4PpnGYjUA== X-Received: by 2002:a63:b64:: with SMTP id a36mr6758171pgl.437.1622171141361; Thu, 27 May 2021 20:05:41 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:caec:ab3b:ea16:3d01]) by smtp.gmail.com with ESMTPSA id l20sm2892051pjq.38.2021.05.27.20.05.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 May 2021 20:05:40 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Fri, 28 May 2021 12:05:29 +0900 Message-Id: <20210528030531.189492-4-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 Subject: [libcamera-devel] [PATCH v6 4/6] libcamera: CameraSensor: Enable retrieving supported 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" This enables retrieving supported test pattern modes through CameraSensorInfo. Signed-off-by: Hirokazu Honda Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- include/libcamera/internal/camera_sensor.h | 7 +++++ src/libcamera/camera_sensor.cpp | 32 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index cf6c1c1e..dcde647d 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -39,6 +39,10 @@ public: const std::vector &mbusCodes() const { return mbusCodes_; } const std::vector &sizes() const { return sizes_; } Size resolution() const; + const std::vector &testPatternModes() const + { + return testPatternModes_; + } V4L2SubdeviceFormat getFormat(const std::vector &mbusCodes, const Size &size) const; @@ -66,6 +70,8 @@ private: void initVimcDefaultProperties(); void initStaticProperties(); int initProperties(); + void initTestPatternModes( + const std::map &testPatternModeMap); const MediaEntity *entity_; std::unique_ptr subdev_; @@ -77,6 +83,7 @@ private: V4L2Subdevice::Formats formats_; std::vector mbusCodes_; std::vector sizes_; + std::vector testPatternModes_; Size pixelArraySize_; Rectangle activeArea_; diff --git a/src/libcamera/camera_sensor.cpp b/src/libcamera/camera_sensor.cpp index 0fb8a258..44dd5988 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -297,6 +297,30 @@ void CameraSensor::initVimcDefaultProperties() activeArea_ = Rectangle(pixelArraySize_); } +void CameraSensor::initTestPatternModes( + const std::map &testPatternModeMap) +{ + const auto &v4l2TestPattern = controls().find(V4L2_CID_TEST_PATTERN); + if (v4l2TestPattern == controls().end()) { + LOG(CameraSensor, Debug) << "No static test pattern map for \'" + << model() << "\'"; + return; + } + + for (const ControlValue &value : v4l2TestPattern->second.values()) { + const int32_t index = value.get(); + + const auto it = testPatternModeMap.find(index); + if (it == testPatternModeMap.end()) { + LOG(CameraSensor, Debug) + << "Test pattern mode " << index << " ignored"; + continue; + } + + testPatternModes_.push_back(it->second); + } +} + void CameraSensor::initStaticProperties() { const CameraSensorProperties *props = CameraSensorProperties::get(model_); @@ -305,6 +329,8 @@ void CameraSensor::initStaticProperties() /* Register the properties retrieved from the sensor database. */ properties_.set(properties::UnitCellSize, props->unitCellSize); + + initTestPatternModes(props->testPatternModeMap); } int CameraSensor::initProperties() @@ -469,6 +495,12 @@ Size CameraSensor::resolution() const return std::min(sizes_.back(), activeArea_.size()); } +/** + * \fn CameraSensor::testPatternModes() + * \brief Retrieve all the supported test pattern modes of the camera sensor + * \return The list of test pattern modes + */ + /** * \brief Retrieve the best sensor format for a desired output * \param[in] mbusCodes The list of acceptable media bus codes From patchwork Fri May 28 03:05:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12467 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 543EAC3205 for ; Fri, 28 May 2021 03:05:47 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EC8A46892E; Fri, 28 May 2021 05:05:46 +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="HZBCRIGJ"; dkim-atps=neutral Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9687F68925 for ; Fri, 28 May 2021 05:05:44 +0200 (CEST) Received: by mail-pl1-x62f.google.com with SMTP id h12so937084plf.11 for ; Thu, 27 May 2021 20:05:44 -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=wHSrzNuB9f7V06xtq8lyAZpgYyHA1noTd6F7pwFmqkk=; b=HZBCRIGJoQJV45ZONWqnOURBJMD416kJ6QkIBhFn7G97gtRUQcoVTvqW1aS6W/4/Fw sp4/4S6dSuR6emlRKKuFytVb+gLO5nmAMsVlyCl4TyASlga/5tV1j9iRygtxf5bdrZjp MHJPx9vhafCDwrtiM05Q1LaGxkClckAupcr/Q= 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=wHSrzNuB9f7V06xtq8lyAZpgYyHA1noTd6F7pwFmqkk=; b=moy9XMyZpyo4qxltYx2/t/OByzN3ZVRnoyo3e8XQcfcyxOmnUAHbDKEZMaFrqUODlN 3NmwOwcQWJvg2BtlZw2cpHZ/A7NSnWerSDRL0EUOTfnqjClaC5s0xx0mtVGDALvbEEv2 0B0C9jhT+7hfcDcP2fAsAIRGKZqHWV4L9G1nFSO/GPPM82//z0sH5K+aVSg0rWLhxcIG kYIaiVXhIO/zW0d/ZinGO4Se8n9K95Sw/XCuPlo3PzPSlxRCfd18xcEfDoLJqZbndlf9 4wGLD7O3SK8X46quTHwdhNeyp5ItvnFCF80v9cuVVkwTmpFirn7bAb8cnOK+Xn/8LLRi 3A6Q== X-Gm-Message-State: AOAM532/1wNu9iSKuU6j/Dm2Fj9J/McZrPXc0+o4QGwpHYRUYg8qiFz7 4GnC1yaMUKyZ+ZDcBMvZMHBk2EJkjUNuBQ== X-Google-Smtp-Source: ABdhPJx8S231A3OYPf/+9yTXfM61Dc1lV21EIr0AIR4dpNyE66ZZtyFWKAYDZdnuijH3VZ/CVQBkow== X-Received: by 2002:a17:902:9685:b029:ef:70fd:a5a2 with SMTP id n5-20020a1709029685b02900ef70fda5a2mr6031689plp.20.1622171143069; Thu, 27 May 2021 20:05:43 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:caec:ab3b:ea16:3d01]) by smtp.gmail.com with ESMTPSA id l20sm2892051pjq.38.2021.05.27.20.05.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 May 2021 20:05:42 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Fri, 28 May 2021 12:05:30 +0900 Message-Id: <20210528030531.189492-5-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 Subject: [libcamera-devel] [PATCH v6 5/6] libcamera: pipeline: ipu3: Report available sensor test pattern mode 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" PipelineHandlerIPU3 gets available test pattern modes of the sensor device and reports them to a client. Signed-off-by: Hirokazu Honda Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/pipeline/ipu3/ipu3.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 58923bc7..0e028cff 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -936,6 +936,18 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data) ControlInfoMap::Map controls = IPU3Controls; const ControlInfoMap &sensorControls = sensor->controls(); + if (const std::vector &testPatternModes = + sensor->testPatternModes(); + !testPatternModes.empty()) { + std::vector values; + values.reserve(testPatternModes.size()); + + for (uint8_t pattern : testPatternModes) + values.emplace_back(static_cast(pattern)); + + controls[&controls::draft::TestPatternMode] = ControlInfo(values); + } + /* * Compute exposure time limits. * From patchwork Fri May 28 03:05:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12468 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 39CC9C3205 for ; Fri, 28 May 2021 03:05:49 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F04D668922; Fri, 28 May 2021 05:05:48 +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="IW/ZnFkm"; dkim-atps=neutral Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3DD6F68932 for ; Fri, 28 May 2021 05:05:46 +0200 (CEST) Received: by mail-pj1-x102c.google.com with SMTP id q6so1728711pjj.2 for ; Thu, 27 May 2021 20:05:46 -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=1aFBJcr/n+ZV4L7J15RKBnyQR+JbUBqSyuBTQDCRAic=; b=IW/ZnFkmDGF9GQqiZ7koIwpnWs7QSLcu+iJjHpp/ZzPhKWNRue0zY0IEQxD30ZhSM/ r+WpYAmdJEkFAjc8gBIM08Uut1BoDOYMCrFUr0YczeH7V55k7XJdCeTY+GdcpMntil1m Z4D2HFtHbku2TxiWdQIRuCVhWbYguYKuSZ5t0= 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=1aFBJcr/n+ZV4L7J15RKBnyQR+JbUBqSyuBTQDCRAic=; b=nX6HF3Woelkv1YkpGtwKUM08JIrZ34momd9NId4FKkUW7b4ilx96gEgXavp+WGBsLO K4xcm4gqZAD8gRSNY6twD9YxMObus9FwnGA0u7fNjFyfYT7zJO50gfhzr/e2FHK2BUdg lJC7AoVXSXErGKNlo2kGKkercDkW/CXDnumBpMcw4Cvfn/dsO4omXURk/NycvQ4GW05u JGrBS6RZmEDmQ0hYu7XeQZuuCu1qyR+xCrFxueMdO38RoFdM+PLU1WC8CZA8zrueY2ZW KtOPwWGyNtveiB8IdKAMuqn2QaSC/C5mJzM1i67PrVECQe51QNRhW3h9LsB+uAJDf7IR xmcw== X-Gm-Message-State: AOAM530kmSPZwR3Wu6zvDu+FFXAolb3EeDZpjItqraJ94D0PnW4WKQRL aKw18jUnOL4t8vXLZ9Iq4ZjTUsbg/ZozdA== X-Google-Smtp-Source: ABdhPJwguB4wghh93ybEJpooXCDDu53dE8Aif+ivwLEWGbQeNytKhHKLvpHU9P+J6ezknkG8L1/+fw== X-Received: by 2002:a17:90a:6005:: with SMTP id y5mr258674pji.62.1622171144672; Thu, 27 May 2021 20:05:44 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:caec:ab3b:ea16:3d01]) by smtp.gmail.com with ESMTPSA id l20sm2892051pjq.38.2021.05.27.20.05.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 May 2021 20:05:44 -0700 (PDT) From: Hirokazu Honda 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 Subject: [libcamera-devel] [PATCH v6 6/6] 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 to the Android camera stack the list of supported test pattern modes constructed by inspecting the values reported by libcamera through the controls::draft::TestPatternMode control. Signed-off-by: Hirokazu Honda Reviewed-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/android/camera_device.cpp | 46 ++++++++++++++++++++++++++++++++--- 1 file changed, 43 insertions(+), 3 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 7fc4ddb0..d29147bc 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1082,11 +1082,51 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() staticMetadata_->addEntry(ANDROID_SENSOR_ORIENTATION, orientation_); - std::vector testPatterModes = { - ANDROID_SENSOR_TEST_PATTERN_MODE_OFF, + std::vector testPatternModes = { + ANDROID_SENSOR_TEST_PATTERN_MODE_OFF }; + if (const auto &testPatternsInfo = + controlsInfo.find(&controls::draft::TestPatternMode); + testPatternsInfo != controlsInfo.end()) { + const auto &values = testPatternsInfo->second.values(); + ASSERT(!values.empty()); + for (const auto &value : values) { + switch (value.get()) { + case controls::draft::TestPatternModeOff: + /* + * ANDROID_SENSOR_TEST_PATTERN_MODE_OFF is + * already in testPatternModes. + */ + break; + case controls::draft::TestPatternModeSolidColor: + testPatternModes.push_back( + ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR); + break; + case controls::draft::TestPatternModeColorBars: + testPatternModes.push_back( + ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS); + break; + case controls::draft::TestPatternModeColorBarsFadeToGray: + testPatternModes.push_back( + ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY); + break; + case controls::draft::TestPatternModePn9: + testPatternModes.push_back( + ANDROID_SENSOR_TEST_PATTERN_MODE_PN9); + break; + case controls::draft::TestPatternModeCustom1: + testPatternModes.push_back( + ANDROID_SENSOR_TEST_PATTERN_MODE_CUSTOM1); + break; + default: + LOG(HAL, Error) << "Unknown test pattern mode: " + << value.get(); + continue; + } + } + } staticMetadata_->addEntry(ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES, - testPatterModes); + testPatternModes); uint8_t timestampSource = ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN; staticMetadata_->addEntry(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE,