From patchwork Wed May 19 07:59:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12315 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 3E4FFC31FF for ; Wed, 19 May 2021 07:59:50 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A032A6891F; Wed, 19 May 2021 09:59:49 +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="NzZyyiwH"; dkim-atps=neutral Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0A0BE68911 for ; Wed, 19 May 2021 09:59:49 +0200 (CEST) Received: by mail-pg1-x52f.google.com with SMTP id m124so8859746pgm.13 for ; Wed, 19 May 2021 00:59:48 -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=rZY8DWTjixH7//Sjj6F+LoSU9ppcv0QEp9yeRAYlczY=; b=NzZyyiwHllr6iqaqRVdGbme/8Uwiijm/s/EzRxhmd1WATu1H1aQUnXKmL3H/tia8Dm JJh93JdOE5W42HUjAPM1TLyHvcA13uzNmtY13MHs/Z+reqncXjicMM4oqedxs4EZ5qTL ieAxMETbP16i8V63wVn0fi8770C0SiEm6XAkI= 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=rZY8DWTjixH7//Sjj6F+LoSU9ppcv0QEp9yeRAYlczY=; b=tnBkf97y8DtU4SVabNcq+eqTJLs/qddHY8c2PN4fC3WyQB57eyF862pM+I75snRfNM OzqNO8KuDon3isi3lMs+mivPNjRpeU3cWBVlbNMO/UmVQSqrdhIgTfR4DSNb+HoaJn+n OtXRcOf6PdQhigewlQoYvUfqC+3GhGB5ytGZfyrwEwjOE7XiW0B2JtaFyh0yv7AtIobU zgC/61vu3DbucbexqMu5bjKoxesxhZwheU8MwQNeuS39K6NfugGoiyDOtJscPFVhbxZ2 aEwAllf/uvfx5SP65J4FrLm2qvIHDIx6PTqKoZ8D5/6Nnoao03TNy+Oa//WueX1bKl32 +FiA== X-Gm-Message-State: AOAM5300+J87Q54uXZXPJFK6yKDrOzIWH1JUFd71Cn8BD6zn5svPEGk6 +khpL99VQchCFHXXqnx0NDzM9oJ9iSrbYw== X-Google-Smtp-Source: ABdhPJx7sajd7E7ixvd3MySbysuaMF6iP+odHKHH4xxz+Fpb/PsF1Ll4THbBjspy32OeMIxzVqFDUQ== X-Received: by 2002:a63:6784:: with SMTP id b126mr9553085pgc.209.1621411187258; Wed, 19 May 2021 00:59:47 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:3948:91a2:b8ec:1976]) by smtp.gmail.com with ESMTPSA id 80sm1160847pfw.200.2021.05.19.00.59.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 00:59:46 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Wed, 19 May 2021 16:59:36 +0900 Message-Id: <20210519075941.1337388-1-hiroh@chromium.org> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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 --- 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 Wed May 19 07:59:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12316 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 456DAC31FF for ; Wed, 19 May 2021 07:59:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0600C68923; Wed, 19 May 2021 09:59:52 +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="g05lM9Hh"; dkim-atps=neutral Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 86DEB68919 for ; Wed, 19 May 2021 09:59:50 +0200 (CEST) Received: by mail-pj1-x1029.google.com with SMTP id n6-20020a17090ac686b029015d2f7aeea8so3068726pjt.1 for ; Wed, 19 May 2021 00:59:50 -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=XvpU9XSIklCLusLhGV0gcYd6hZ2nh7eCwQ9FWr7nZx8=; b=g05lM9HhDD/FOJV0y1DdtA3XJVmdufOpXgRoDenyrL0AWc4HlVlsFSNwtaf2DELiNy N2+YdxV/0zZ19nAqzoWzEd+TZv8zk20X9QlPYcvRibu7480glmnw+xwiOYnXb8QXPyo3 nQKaqVVKArv3tk2QQiayNSAvLlp8Q0OC+Q/8o= 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=XvpU9XSIklCLusLhGV0gcYd6hZ2nh7eCwQ9FWr7nZx8=; b=IJQQpoSrlChi8tTb9hdS5DXUlF1br+yseVTeQd2tSCZCkX+ucDA28H0pDqqAqU2uVs tx8C3AfuxoUMCCfTLjX+9ZsHp1rBCmfU17JGUJecKUtWGS+GnKZTEuPki+H5R8jzLC4A X7jRVKkB2kqZE9Maq7aL5d3q9gmAZOZGpnWtSs6hs6O6SZGFiT8cGIYS3vB8dC7yRRbT +K7aFhSHCKufiY3arZYG8epPp7XERFcoffxv8SZgdQPPoVBpC/kqklTzsBOp2bD+zUdw DQ3ylxMEm++qokANpLIQw4NRuiMonGnvp4eRIQhNa/pwkP/He5p9rH7acX0rzQ4Lkbmy FkPQ== X-Gm-Message-State: AOAM531YnTfLlxCFd2kcitkHvpnDPnmJWyLQ0RivPIZYowih+q2hB4A+ FSgnF1jjBZJZ8hYNvp9VeJnG2s1gGEG+qQ== X-Google-Smtp-Source: ABdhPJwF9VBs94sy+iOo9XykSWn698oAJpK0Rp+zKzPP9hrnwwFw8HT0HUIct4mv1B7pczJr2uD9pA== X-Received: by 2002:a17:902:8a8a:b029:ec:857a:4d51 with SMTP id p10-20020a1709028a8ab02900ec857a4d51mr9375219plo.68.1621411188894; Wed, 19 May 2021 00:59:48 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:3948:91a2:b8ec:1976]) by smtp.gmail.com with ESMTPSA id 80sm1160847pfw.200.2021.05.19.00.59.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 00:59:48 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Wed, 19 May 2021 16:59:37 +0900 Message-Id: <20210519075941.1337388-2-hiroh@chromium.org> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog In-Reply-To: <20210519075941.1337388-1-hiroh@chromium.org> References: <20210519075941.1337388-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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 | 3 ++ src/libcamera/v4l2_device.cpp | 64 ++++++++++++++++++++++-- 2 files changed, 63 insertions(+), 4 deletions(-) diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h index 5ba9b23b..34080b07 100644 --- a/include/libcamera/internal/v4l2_device.h +++ b/include/libcamera/internal/v4l2_device.h @@ -56,6 +56,9 @@ protected: int fd() const { return fd_; } private: + bool createControlInfoForMenu(const v4l2_query_ext_ctrl &ctrl, + ControlInfo &ctrlInfo); + void listControls(); void updateControls(ControlList *ctrls, Span v4l2Ctrls); diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 515cbdfe..9f7873f1 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -464,6 +464,49 @@ 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 not only values and also extra values, which + * are indices and name/value acquired by VIDIOC_QUERYMENU, respectively. The + * extra values contains std::string if the type of \a ctrl is + * V4L2_CTRL_TYPE_MENU or int64_t otherwise. + * + * \return True on success or false otherwise + */ +bool V4L2Device::createControlInfoForMenu(const v4l2_query_ext_ctrl &ctrl, + ControlInfo &ctrlInfo) +{ + ASSERT(ctrl.type == V4L2_CTRL_TYPE_MENU || + ctrl.type == V4L2_CTRL_TYPE_INTEGER_MENU); + + 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)); + } + + if (indices.empty()) { + LOG(V4L2, Error) + << "No applicable value: " << utils::hex(ctrl.id); + + return false; + } + + ctrlInfo = ControlInfo(indices); + + return true; +} + /* * \brief List and store information about all controls supported by the * V4L2 device @@ -473,7 +516,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; @@ -484,15 +526,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: + if (!createControlInfoForMenu(ctrl, ctrlInfo)) + continue; + break; /* \todo Support other control types. */ default: @@ -502,10 +551,13 @@ void V4L2Device::listControls() continue; } + LOG(V4L2, Debug) << "Control: " << ctrl.name + << " (" << utils::hex(ctrl.id) << ")"; + controlIds_.emplace_back(std::make_unique(ctrl)); controlInfo_.emplace(ctrl.id, ctrl); - ctrls.emplace(controlIds_.back().get(), V4L2ControlInfo(ctrl)); + ctrls.emplace(controlIds_.back().get(), ctrlInfo); } controls_ = std::move(ctrls); @@ -572,6 +624,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 Wed May 19 07:59:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12317 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 E97D1C31FF for ; Wed, 19 May 2021 07:59:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A294168924; Wed, 19 May 2021 09:59:53 +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="SnIzc8Fo"; dkim-atps=neutral Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 13EA068924 for ; Wed, 19 May 2021 09:59:52 +0200 (CEST) Received: by mail-pj1-x1029.google.com with SMTP id ot16so4986529pjb.3 for ; Wed, 19 May 2021 00:59:52 -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=/E0wEK/zI0Rft4ntRt5zbETRBVUgI5OUGySgUQg3I+s=; b=SnIzc8FoV+9xv0uwlt6aIZ9RkUfwNFCcMzwLMklggyXugr+pOFhtifiHfdFhGS6kgx ZJh5ogO/7AiKXE4QNRvQusIuG9t1BhgDtBmZ8ZzZW7sLKT6NBgqsilUYm4XDJsyWCxTl sOKkx63PCibv1yXhiD2dPWTzBiJynunMa2Ldg= 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=/E0wEK/zI0Rft4ntRt5zbETRBVUgI5OUGySgUQg3I+s=; b=MUx8AIDmBAmKIesCshmi7VZPLwP3txrpG8FkUIyKtomZcnB+EM82pGe+HSgVa5loh2 x4H+6nNchshVq2Nz61GBfHG3vnJmRazXsunBi1Pk2PiLGh+TAeHevo325E98rWqmkOCG CwFMyUtQ3RADwsc5nCuXUY3zpsRxSTQvbI7EP1VB56WafbebUPu6+Cr98UGxhquaf5jJ yG+Ijxb7fNmbaxw10g4wjNJ128olzUXTwBYRMQfhj0rj8ltm7p9zBETGs8clvBLxQd1x uiEki1fS/0D1E7vGv99reGjf5+VUXPph8sdXE42S1/rZugd+J1UfaezCqnsvsmexYWOJ Idaw== X-Gm-Message-State: AOAM5319pA993G4tM73Va5iZMgUwlsuXnTgu4AjpHvOz9iK94LWV/ZsV rV3tojHpPUVDbYv2NbiFlULrgPs3fZlb+Q== X-Google-Smtp-Source: ABdhPJxAmvyVUuMqW8F5WbuEHc+cqglEVPYBQJDmHmjN5PZLaZNy9NtmPfUYaQnDFseT5AzDBsAKpA== X-Received: by 2002:a17:902:b412:b029:ef:1737:ed with SMTP id x18-20020a170902b412b02900ef173700edmr9682110plr.43.1621411190514; Wed, 19 May 2021 00:59:50 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:3948:91a2:b8ec:1976]) by smtp.gmail.com with ESMTPSA id 80sm1160847pfw.200.2021.05.19.00.59.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 00:59:50 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Wed, 19 May 2021 16:59:38 +0900 Message-Id: <20210519075941.1337388-3-hiroh@chromium.org> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog In-Reply-To: <20210519075941.1337388-1-hiroh@chromium.org> References: <20210519075941.1337388-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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 | 22 +++++++++++++++++++ 2 files changed, 24 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 6ded31dc..3bf8e500 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,10 @@ LOG_DEFINE_CATEGORY(CameraSensorProperties) * * \var CameraSensorProperties::unitCellSize * \brief The physical size of a pixel, including pixel edges, in nanometers. + * + * \var CameraSensorProperties::testPatternModeMap + * \brief The table from a v4l2 menu index for V4L2_CID_TEST_PATTERN to the + * control value of libcamera test pattern mode. */ /** @@ -47,12 +53,28 @@ 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 }, + }, } }, }; From patchwork Wed May 19 07:59:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12318 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 4E6D4C31FF for ; Wed, 19 May 2021 07:59:56 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0D9B068922; Wed, 19 May 2021 09:59:56 +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="Xr1YNuIE"; dkim-atps=neutral Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 0A90668911 for ; Wed, 19 May 2021 09:59:54 +0200 (CEST) Received: by mail-pl1-x636.google.com with SMTP id t4so6561684plc.6 for ; Wed, 19 May 2021 00:59:53 -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=ca7p7pwmIpKOHnXcAv//FM45O9IVcfFgEJGNcZtP60A=; b=Xr1YNuIEUV4IGFyro8BbVnhfRu+bYZ337eb+CMaP8G2kjyrK3QbOdWpWp59NJxIw4u mgvnxY85H42yfPfTRdjPisWg8KXiinPyNLx4/XCdCt0r2fRf/REptnwNeXIM86KJQ+GD dfrDysIRxBcJeGElMxwR9V9iODExET9sOXfkU= 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=ca7p7pwmIpKOHnXcAv//FM45O9IVcfFgEJGNcZtP60A=; b=Yo8OXhpo/OtD6ozlUVSjWcAa1vxdLRq4Z6TN4Dp13K+cZkxFV5hGX/rEdkhh9pqxLJ A8liouOy1vG56/N7RbIng73EkskoSQlXhRJpc8QTnU9UmcsqFoWDx2HlyW8tta+DiU/r 6iM9JRPGIk2ZiJzx3Yi5sa2RyY2ksom4HKuTLwx+8HO0lIR+2s/sb/MgMHCtV3CRh+xc 7sA/eFsriKipb1Fz1beqt5/JYQgueava3JikwHPgJ51YotqUwwlujma3BfdD3YpFZfD3 f2JJ78/krgYlGHifYmn5q1Sdt14cnrrAqLolDMB+OGCZT2e7SHbk7w/CtoUqI5DCAfDY qJ0A== X-Gm-Message-State: AOAM533Ywaj6Wk7yHw3pdbrTPzQugHGPpT3uaOYsb7gdUkz1843NNaQC ClV70/VgyrTRZ0Ax/ipQo4q74DT3OwPmcQ== X-Google-Smtp-Source: ABdhPJzhq3ceDaJyuQWBlGNsQKQpRUD61Pw7l6JZ4N66LiBd9ZUiW+AIudIHEoUfa+ntQ1y8wYS/xg== X-Received: by 2002:a17:902:854a:b029:ef:3f99:91a7 with SMTP id d10-20020a170902854ab02900ef3f9991a7mr9628927plo.74.1621411192184; Wed, 19 May 2021 00:59:52 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:3948:91a2:b8ec:1976]) by smtp.gmail.com with ESMTPSA id 80sm1160847pfw.200.2021.05.19.00.59.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 00:59:51 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Wed, 19 May 2021 16:59:39 +0900 Message-Id: <20210519075941.1337388-4-hiroh@chromium.org> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog In-Reply-To: <20210519075941.1337388-1-hiroh@chromium.org> References: <20210519075941.1337388-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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 --- include/libcamera/internal/camera_sensor.h | 7 +++++ src/libcamera/camera_sensor.cpp | 34 ++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index 2a5c51a1..59d1188f 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -58,6 +58,10 @@ public: V4L2SubdeviceFormat getFormat(const std::vector &mbusCodes, const Size &size) const; int setFormat(V4L2SubdeviceFormat *format); + const std::vector &testPatternModes() const + { + return testPatternModes_; + } const ControlInfoMap &controls() const; ControlList getControls(const std::vector &ids); @@ -81,6 +85,8 @@ private: void initVimcDefaultProperties(); void initStaticProperties(); int initProperties(); + void initTestPatternModes( + const std::map &testPatternModeMap); const MediaEntity *entity_; std::unique_ptr subdev_; @@ -92,6 +98,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 eb84d9eb..a6aed417 100644 --- a/src/libcamera/camera_sensor.cpp +++ b/src/libcamera/camera_sensor.cpp @@ -408,6 +408,32 @@ 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=" + << index << ") ignored"; + continue; + } + + LOG(CameraSensor, Debug) << "Test pattern mode (index=" + << index << ") added"; + testPatternModes_.push_back(it->second); + } +} + void CameraSensor::initStaticProperties() { const CameraSensorProperties *props = CameraSensorProperties::get(model_); @@ -416,6 +442,8 @@ void CameraSensor::initStaticProperties() /* Register the properties retrieved from the sensor database. */ properties_.set(properties::UnitCellSize, props->unitCellSize); + + initTestPatternModes(props->testPatternModeMap); } int CameraSensor::initProperties() @@ -767,6 +795,12 @@ int CameraSensor::setControls(ControlList *ctrls) * \return The list of camera sensor properties */ +/** + * \fn CameraSensor::testPatternModes() + * \brief Retrieve all the supported test pattern modes of the camera sensor + * \return The list of test pattern modes. + */ + /** * \brief Assemble and return the camera sensor info * \param[out] info The camera sensor info From patchwork Wed May 19 07:59:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12319 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 B5E08C31FF for ; Wed, 19 May 2021 08:00:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 73D636891E; Wed, 19 May 2021 10:00:00 +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="mjsQ0ELA"; dkim-atps=neutral Received: from mail-pf1-x429.google.com (mail-pf1-x429.google.com [IPv6:2607:f8b0:4864:20::429]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9F88E6891C for ; Wed, 19 May 2021 09:59:55 +0200 (CEST) Received: by mail-pf1-x429.google.com with SMTP id x188so9330498pfd.7 for ; Wed, 19 May 2021 00:59:55 -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=wgvL7+yR5w/TCnatKYLUR5ZoG1ezPhhfr6ubaG6Qn+0=; b=mjsQ0ELANVG+RfiVvVtLNTU3O7hFVBiO2PopLy95crymcofbkvDb9onU2cYrMfrY/R 8vX73jvxDYHzb2bXWLVn9gYvWrLvjtzMXSCboHSaQO30ogih9+6YNlicxB/Km6teM+By srIp68hxgUnBTxyyusF3ZDHsUFXeDJkAJb8as= 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=wgvL7+yR5w/TCnatKYLUR5ZoG1ezPhhfr6ubaG6Qn+0=; b=lAegFHgPOMz7zCuf6LuEBsk66dltJaRUf9fJIY2QcsF9Z9WsW5mNdU9J8q/YWeGUWZ i7tXY16mVnr39WYpbpRS7vs6MmhK6PAmIeqezayz5r71CrEUAz0+Lc6bOsj+1FMbp+Ba uBtid2PDAi7GFGs6nWiW5kz7HZmOBzl3QneQVkPFDvDUHEC1rg9exn0oo4iO3PTKNUf+ esG3OgHCwTm9rUihSw6NKuAb+J0iwMOeF2ZxpGr02/dAbBcjDvmdsEtQ36zL2xIAAfbV SpBoO4QVMoye5q2G78PO+ELmmGuFxyBHR2wgDmNDnMWiW3XrneRjEddOH6kxl3k6+6jT /+EQ== X-Gm-Message-State: AOAM532jRvO9xFMZtZLljnlugr8IJS3QemElouVZY1xo25m4rl9ts9S9 NrwWUi7shyCJLqF3K8qdygWHG1He6jgwRQ== X-Google-Smtp-Source: ABdhPJwYXUhtQGOdU1dX8V1NuwbyReVintzYe1qEumdbalBfs9GaEWbJCEDgby1qPAr8MKbcBq8X4g== X-Received: by 2002:a63:7204:: with SMTP id n4mr9832439pgc.78.1621411194109; Wed, 19 May 2021 00:59:54 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:3948:91a2:b8ec:1976]) by smtp.gmail.com with ESMTPSA id 80sm1160847pfw.200.2021.05.19.00.59.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 00:59:53 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Wed, 19 May 2021 16:59:40 +0900 Message-Id: <20210519075941.1337388-5-hiroh@chromium.org> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog In-Reply-To: <20210519075941.1337388-1-hiroh@chromium.org> References: <20210519075941.1337388-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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 --- 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 ade8ffbd..c1d1d937 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -891,6 +891,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 Wed May 19 07:59:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12320 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 1AA60C3200 for ; Wed, 19 May 2021 08:00:01 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CAC6368926; Wed, 19 May 2021 10:00:00 +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="m3L/ZrIf"; 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 814356891C for ; Wed, 19 May 2021 09:59:57 +0200 (CEST) Received: by mail-pf1-x42e.google.com with SMTP id e19so9344538pfv.3 for ; Wed, 19 May 2021 00:59:57 -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=QZsnwxA2ke1bJ5i7sxS/mzf7jGdB3f5iGqyBHXj/sFc=; b=m3L/ZrIf10uDbuSYPJbsz9qfnKUKx/MNcfJRpgeHymaKVCi1odrvjMBXogdIgO5XCf YPIshZzduFcS/jU56xhbPw6lgu2neWe5KyxXlRNbILaKUCrXWHwS4F3DbvmyAP7qkcDr 67laSNq566sykHjNHXDP4TdkbaQx3uzJGqB6Y= 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=QZsnwxA2ke1bJ5i7sxS/mzf7jGdB3f5iGqyBHXj/sFc=; b=e/xfn+l4VDy5HpMZTSzz0ixTxysqFo0g9HBYWy56tDXjHX7Nds8D07/IgdrfXpfppB neB0PyN9OV6aVFCgVN7blp97DGyqWdtRCiJcilc82DYQzBE/x6+zzovs+W+kHTA5Y194 Pp78des/C0Mz8bMWDDYrBlKIyYtMcF2BwXD17VFD2f52vB7V9Z3CUCVMfrnRP6kbNtx4 5s0NIpfQ4kf1qIOYAmEnsfR9K1hBmHOLsrUKWWtsvLUL4ApmfuL0zbE/7r1lasU1Bdre jaV4dcFiaQqXuobDyq8VoBoSs3usaZPapy4UgGNNhCnzHYV+r6PBKT5GbUtp+XNUN08x mupQ== X-Gm-Message-State: AOAM533duqghcAPknVS2uRHLL9eCpDm+EQIPPupwVvD8BUuHO4BcIHdy HH4V3DT9dqjVwFFJhJzGo6C0ptTYL1tH6w== X-Google-Smtp-Source: ABdhPJyxj5KP4tTuV9CNxtdRjRzWQHdYB6OQQpLeYwHMP2X4zuwVZ/cTBRg3MF2CaJ699y2Mn9jTUg== X-Received: by 2002:a63:e952:: with SMTP id q18mr9579721pgj.430.1621411195873; Wed, 19 May 2021 00:59:55 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:3948:91a2:b8ec:1976]) by smtp.gmail.com with ESMTPSA id 80sm1160847pfw.200.2021.05.19.00.59.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 May 2021 00:59:55 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Wed, 19 May 2021 16:59:41 +0900 Message-Id: <20210519075941.1337388-6-hiroh@chromium.org> X-Mailer: git-send-email 2.31.1.751.gd2f1c929bd-goog In-Reply-To: <20210519075941.1337388-1-hiroh@chromium.org> References: <20210519075941.1337388-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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 --- src/android/camera_device.cpp | 47 ++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index b32e8be5..a07679a3 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1035,11 +1035,52 @@ 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,