From patchwork Thu May 6 07:54:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12200 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 90D46BDE7F for ; Thu, 6 May 2021 07:55:00 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5262E6891D; Thu, 6 May 2021 09:55: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="Ol5jBS7x"; dkim-atps=neutral Received: from mail-pg1-x529.google.com (mail-pg1-x529.google.com [IPv6:2607:f8b0:4864:20::529]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id BB1766890E for ; Thu, 6 May 2021 09:54:58 +0200 (CEST) Received: by mail-pg1-x529.google.com with SMTP id m12so4143261pgr.9 for ; Thu, 06 May 2021 00:54:58 -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=Krzn6mw8SbjmKOeNdoZjZqHeYTQu5C67qgFMCmk9PL4=; b=Ol5jBS7xppgGSckNL5N1pCwJDpuBqht+fxmmzUmCiPjBHqzU2UEj5HSak62K37SYGA co6u5Ni0PykwDuUfSACFIs+KhCr1vwbsdwdjHpESOgl0P081OsFCD9N1lEI4rXwPR3mh 2o1VZ2zQMc6X3QddJMetVZlYWxexnWPTyQOpM= 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=Krzn6mw8SbjmKOeNdoZjZqHeYTQu5C67qgFMCmk9PL4=; b=uIZ7a/6Ed0svLvB3YB0xlsUfLmTdojJNxjiiRRfEyzkfRnzAbsEkufywr2aRg/T8jC /zWUBCOeXHykKl8fW5qFTfppZ42ujnTFsSgSWuCt2v3hmhbzVbjoSc/lXBqw+uKN/PbP S71yy4GdSZ2nVwsgFatYwRcK2YB8RVf1Dp8jZkULhPqvDOz9XpYAadnQ3K2YgX/7kX5i C5spCzUFjbP0Js62jQNQPMv/Ty+2+Wsj6cTpUaonUwY4N6+b6JLASeLZL0FQapWbjUiQ bUce7p9K192Q5025HkRE17qNs5IVGPNMNn5y64VCcBaAM1l6I7kD0sNLX6TbcyTyxCPC nLLQ== X-Gm-Message-State: AOAM531abzMHnf24FTeUBpPd2SEKTqekYNCo7pUg2xPl0GjzBtDkTpFH CSc+xD7WmNxzOh7yZsOZZILLSIiwxHowmg== X-Google-Smtp-Source: ABdhPJysu4rCUWUZesAVPisWJim9uuZ/pwTo9hYeEU/xuEf1StocanvMr5zYGcrEYulc62qJnS7o/w== X-Received: by 2002:a63:a547:: with SMTP id r7mr3000425pgu.7.1620287697178; Thu, 06 May 2021 00:54:57 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:ede4:ae0e:d4a4:c0d3]) by smtp.gmail.com with ESMTPSA id f201sm1355546pfa.133.2021.05.06.00.54.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 00:54:56 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Thu, 6 May 2021 16:54:44 +0900 Message-Id: <20210506075449.1761752-2-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 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 b4771f9d..cc472863 100644 --- a/src/libcamera/control_ids.yaml +++ b/src/libcamera/control_ids.yaml @@ -608,4 +608,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 Thu May 6 07:54:45 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12201 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 66A38BDE7F for ; Thu, 6 May 2021 07:55:03 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0739568922; Thu, 6 May 2021 09:55:03 +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="m1ZaEHBe"; dkim-atps=neutral Received: from mail-pg1-x533.google.com (mail-pg1-x533.google.com [IPv6:2607:f8b0:4864:20::533]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 89A3068920 for ; Thu, 6 May 2021 09:55:00 +0200 (CEST) Received: by mail-pg1-x533.google.com with SMTP id y30so4148951pgl.7 for ; Thu, 06 May 2021 00:55:00 -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=vm6DZPElqUWcJh+QMJO2afXSbmkGZ/M93CLmkyHXhNY=; b=m1ZaEHBeu1VZS3yo0iRyFdisSTo1QExcRSyGjdvvufR9JMIqthLXf3eXoaQk+Ob+h/ Q2lGmkOqmXy+GFpcFaN139eGvFkubwBKw/BcqVC2gQIACpjWT/N2zOSW1RL8KYgC3hd1 9bHldDfZxp6bFXfKg8lcvDPcGWrYe9x4gowps= 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=vm6DZPElqUWcJh+QMJO2afXSbmkGZ/M93CLmkyHXhNY=; b=Ug6BcZymk76RnvKw7U2G0CGO37mg3rEioF+KVFFnHG8+tVKVOZ/vX8wVd7PTnBSi/g S+dW/Gf8uxRO2VZeYf1QVgGPNAIi5u4b0TTXZj2MP9BEWTt1KCNnkf9StTmU9AhTBb51 21+K/L6hsTyC3wiQtvzlqjrcxHN+0dRsriQtlU+lgT7MJEUpnSscaAdUbsGtbfDbQuhR grqB+LatkRJOlQi0zg8fdXrt/W4M93Nw2xKUh4Ocf7uOcYdTBvWY9U49PEGu/vNdRKSo gj5YJEIg4GismrJEg+MvOT32hjXjuUSLkWBGTi8KM21DO30FOPapDF6lrFGpzYohIXFd 4/zA== X-Gm-Message-State: AOAM5325OSaMizDcgVnw3tB8k5/LUfF8Os3JZ5oLlJ2CF1knPWDEDkUO LVykFFw7atucaKPiNbmggSjSDL3bzgXoBA== X-Google-Smtp-Source: ABdhPJzY+MGgdFk2ondpyNAAUe5+VkcnL/sylVGx7LNESWkVvSVZEMFyWi9J+dCjE2UkXoFyUDmI9A== X-Received: by 2002:a62:75c3:0:b029:27c:d30f:66a6 with SMTP id q186-20020a6275c30000b029027cd30f66a6mr3399930pfc.0.1620287698837; Thu, 06 May 2021 00:54:58 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:ede4:ae0e:d4a4:c0d3]) by smtp.gmail.com with ESMTPSA id f201sm1355546pfa.133.2021.05.06.00.54.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 00:54:58 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Thu, 6 May 2021 16:54:45 +0900 Message-Id: <20210506075449.1761752-3-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 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 | 65 +++++++++++++++++++++--- 2 files changed, 61 insertions(+), 7 deletions(-) diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h index 087f07e7..c7a2539c 100644 --- a/include/libcamera/internal/v4l2_device.h +++ b/include/libcamera/internal/v4l2_device.h @@ -54,6 +54,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 397029ac..7056c71a 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -452,6 +452,7 @@ int V4L2Device::ioctl(unsigned long request, void *argp) return 0; } + /** * \fn V4L2Device::deviceNode() * \brief Retrieve the device node path @@ -459,10 +460,47 @@ int V4L2Device::ioctl(unsigned long request, void *argp) */ /** - * \fn V4L2Device::fd() - * \brief Retrieve the V4L2 device file descriptor - * \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 @@ -473,7 +511,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 +521,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 +546,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); @@ -535,6 +582,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 Thu May 6 07:54:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12202 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 E6CDFBDE7F for ; Thu, 6 May 2021 07:55:04 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9414D68909; Thu, 6 May 2021 09:55:04 +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="NxtnGyfG"; 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 1656B68918 for ; Thu, 6 May 2021 09:55:02 +0200 (CEST) Received: by mail-pf1-x434.google.com with SMTP id b15so4540834pfl.4 for ; Thu, 06 May 2021 00:55:02 -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=xpgFNDTtg0oyYyVSA6cWMojJgJgBPhdh7V3DPsi5GIo=; b=NxtnGyfGIOgIKSdR8ZmFOK89xpSRUM7RwlepHtQI5IkA+EpvZT4QEHPx70dfZv2PUC EKi8RiSAb3trFhSE0uV3gOvNjRig+d8WPg4K93FQt6xvSKQa5tfGMDYKkANdfre5Iex/ nKE6lfCrn6jxTkoSNO5pPIpFwo5lBLWKsdPO0= 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=xpgFNDTtg0oyYyVSA6cWMojJgJgBPhdh7V3DPsi5GIo=; b=sHgIS5Ev+u4Bvy1ebbxOOOGIW2D2w1cZNkeoxk73dD51fxcQYWV7VJxK8rvUjvUnrO 6QGLHMBiHG3Eh+rHMue7TLAEWvkkyuM8o4ERqsoDzqCLPvFPg82eEGiplW05c878FBxN T5zgAvsamTE8xVww6eS3VJKZauSQ+UKqOU0i+jrzZ5OtlZ9/i0Ifhf7qVBp/qGRwcz2I XtNVR56yJI81AEAJmpeIHz9OC4uaoKUq7+cu8BLHPAi0aXDvfxyqZG6aObsqBCdn907I V4/pxHSLsuTIvv05VQYENFpnPHBe7uEqgQEirassgB1WHgpUu+9O9k4Mlk/xvBh5/HpB 4Wvg== X-Gm-Message-State: AOAM531geyC8NeKfMf0jmEBi7IHlkTiNAOrcg+m/9tubFOHh/una4oOH euBZ45t5wNM/t3+f5Sja/cYvlRSFfurVIA== X-Google-Smtp-Source: ABdhPJyu/GvUJdO/bo1NfPHM9Wmcuxo8xUZvXY6qbHxNKDslFXB4KyzSALLY1zr1uZw4aAbyO9j6MQ== X-Received: by 2002:a05:6a00:1588:b029:272:f5b1:c96c with SMTP id u8-20020a056a001588b0290272f5b1c96cmr3212239pfk.47.1620287700320; Thu, 06 May 2021 00:55:00 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:ede4:ae0e:d4a4:c0d3]) by smtp.gmail.com with ESMTPSA id f201sm1355546pfa.133.2021.05.06.00.54.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 00:54:59 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Thu, 6 May 2021 16:54:46 +0900 Message-Id: <20210506075449.1761752-4-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 3/6] libcamera: CameraSensorProperties: Adds 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" In V4L2 API, a driver returns an index (also with a name) to represent a test pattern, but it is a driver specific what test pattern is represented by the index. Therefore, this adds a mapping table from the index and a test pattern into a static configuration of a sensor. Signed-off-by: Hirokazu Honda --- .../internal/camera_sensor_properties.h | 2 ++ src/libcamera/camera_sensor_properties.cpp | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/include/libcamera/internal/camera_sensor_properties.h b/include/libcamera/internal/camera_sensor_properties.h index f5e242cb..f52890b4 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..89eaf9f8 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" /** @@ -44,15 +46,33 @@ LOG_DEFINE_CATEGORY(CameraSensorProperties) */ const CameraSensorProperties *CameraSensorProperties::get(const std::string &sensor) { + 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 Thu May 6 07:54:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12203 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 3F537BDE7F for ; Thu, 6 May 2021 07:55:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 03EFD6891A; Thu, 6 May 2021 09:55:06 +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="Ilmu2rLk"; dkim-atps=neutral Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 083DC68909 for ; Thu, 6 May 2021 09:55:04 +0200 (CEST) Received: by mail-pl1-x631.google.com with SMTP id e2so2963928plh.8 for ; Thu, 06 May 2021 00:55:03 -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=Nnxe3t/m2aQ4jveD/IHf+jGScVBJRRDKzf8zxTd2kDs=; b=Ilmu2rLkjHDIXUntkC/LGsUU+2KzTdL8vVyX2/PWmaXqF5DxtL6d4guO0rjkNRBzzp Gm6VcdTsw2h2FFqPpYEK7Icwf9dUjpnTjhdkKuGqZOqjFhNcJmBwuPlM4b6cg38clGaN 7O00piwp7gXw88MbnzqwpH5ASrRarYc6UbiNw= 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=Nnxe3t/m2aQ4jveD/IHf+jGScVBJRRDKzf8zxTd2kDs=; b=TOaCxy2+/F5TjUZ1xLwkX57pYAEZDLWJ42eidjmC1rR/e1jxqnlMr0ahE5mFgR2tF2 hS5eHdnkpzHB5Bq2DeVqc5G2HqunU1E4bDM4DzBiLyQxLwGsLn6fGBLMH0O7EqH0Hcxd k19v8xmicJB9W9AOMecyGRb0CxWZfwJLc8ZaE2413nDGIX/EFj+mPekcawxmovSLyr25 Exld0qN/PjhztzkNWn13yyPDcaAyEOULTVhXLHw/FhunQKabNpgEuelVHbgPofJZ/J9o nNhsItgyMbNyW0GTYIV8c3LR72N04Ac5yceuU9V9p2HNtR3KQowzkv4oVpADOe04+Ljq qSGw== X-Gm-Message-State: AOAM533XD6//XxK4Tc2NNcRrNshR3ABxv73QCSHJxLSZxoCh+bA7nLm1 0VPw4oKVZufHvLZ8GymHdyJtCdUwvwlsRw== X-Google-Smtp-Source: ABdhPJy53gPvbfGJhsPbWH1pGxLJDyGGhDCljoNxcaqo1GsGYJ8p40E0ICKLFK6Jm5ZlzbN1K3MY1A== X-Received: by 2002:a17:902:778d:b029:ee:f821:f56d with SMTP id o13-20020a170902778db02900eef821f56dmr3285525pll.79.1620287701793; Thu, 06 May 2021 00:55:01 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:ede4:ae0e:d4a4:c0d3]) by smtp.gmail.com with ESMTPSA id f201sm1355546pfa.133.2021.05.06.00.55.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 00:55:01 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Thu, 6 May 2021 16:54:47 +0900 Message-Id: <20210506075449.1761752-5-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 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 --- include/libcamera/internal/camera_sensor.h | 5 ++++ src/libcamera/camera_sensor.cpp | 28 ++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/include/libcamera/internal/camera_sensor.h b/include/libcamera/internal/camera_sensor.h index 3fa3a419..115e266d 100644 --- a/include/libcamera/internal/camera_sensor.h +++ b/include/libcamera/internal/camera_sensor.h @@ -38,6 +38,8 @@ struct CameraSensorInfo { uint32_t minFrameLength; uint32_t maxFrameLength; + + std::vector testPatternModes; }; class CameraSensor : protected Loggable @@ -79,6 +81,8 @@ private: void initVimcDefaultProperties(); void initStaticProperties(); int initProperties(); + void initTestPatternModes( + const std::map &testPatternModeMap); const MediaEntity *entity_; std::unique_ptr subdev_; @@ -90,6 +94,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 1db263cf..eedd2f89 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() From patchwork Thu May 6 07:54:48 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12204 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 BEA97BDE7F for ; Thu, 6 May 2021 07:55:06 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 63B4E68918; Thu, 6 May 2021 09:55:06 +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="beBaDUSb"; dkim-atps=neutral Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 586116890E for ; Thu, 6 May 2021 09:55:05 +0200 (CEST) Received: by mail-pj1-x102a.google.com with SMTP id j6-20020a17090adc86b02900cbfe6f2c96so3015854pjv.1 for ; Thu, 06 May 2021 00:55:05 -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=VtbKXhukIcnDCQR37kiMKwtZ+jMQ3n+IXsG2+YQduf4=; b=beBaDUSbRiIBZbzrwFoO+iN945MXlsQ0y22PzdpmHxCmq/sJRoYe9mn86BjXR7xOGr 1t4ByEXtbkWiJwH2Ur+FN3idueRdKMW5XG8/GeUsE3DnGH61AcjoDF6BmbaL1/O0KW32 41BXjZhLcMSjnKnqVFw+m3BKb2e+w/8dJwtd0= 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=VtbKXhukIcnDCQR37kiMKwtZ+jMQ3n+IXsG2+YQduf4=; b=SzyCUo+rPIo86FgIXpcR4KsomM5UK/0aTpQ+wmK7AhBI9Ym1tZpkLoKTGc0kPcVGVf xiHVpw1NTpNq+yMC+fBD9nvPWksse1C4kxLTxZDnvkcb0ORVCvtwxb+8C5P5vKflsmJF GA6ZLsE6bU8aG+RHUv5uBdq+eK/vfFSnZY4QDHl/arPoDdsc5AAfYcUMdvXRplQ5hAhD gh8UopBxKPvUFvdBLrtUyNfJGmWFn0GSsdgu9Q14UwP3dPeF7NPdlvsRgGvYsH1M54C8 WHf2XtWdj16/zcfCiaDsATKzloQtLbbq95BP9z1qgAcSnVov/Z9kXfBsMVAh0bvemGFl 2o+w== X-Gm-Message-State: AOAM530N+yK20zrbfEfRL0B+lHdZzqKP3tp3q6g+Q3HRaNscRJN3nJEC pU+j70uBDtj+cWMZ+wPR2FRdMxPlyTeG+Q== X-Google-Smtp-Source: ABdhPJzOVYumu6218ZzumNiIAMkmYUXVtYSlgsMg2GqRGlsfQy3TqX2Iz++Fjn0sEMyzWxONXSaA4w== X-Received: by 2002:a17:902:d386:b029:ee:bf5f:c037 with SMTP id e6-20020a170902d386b02900eebf5fc037mr3121729pld.31.1620287703552; Thu, 06 May 2021 00:55:03 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:ede4:ae0e:d4a4:c0d3]) by smtp.gmail.com with ESMTPSA id f201sm1355546pfa.133.2021.05.06.00.55.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 00:55:02 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Thu, 6 May 2021 16:54:48 +0900 Message-Id: <20210506075449.1761752-6-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 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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 73306cea..b4d4b97d 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -891,6 +891,16 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data) ControlInfoMap::Map controls = IPU3Controls; const ControlInfoMap &sensorControls = sensor->controls(); + if (!sensorInfo.testPatternModes.empty()) { + std::vector values; + values.reserve(sensorInfo.testPatternModes.size()); + + for (int32_t pattern : sensorInfo.testPatternModes) + values.emplace_back(pattern); + + controls[&controls::draft::TestPatternMode] = ControlInfo(values); + } + /* * Compute exposure time limits. * From patchwork Thu May 6 07:54:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 12205 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 5E113BDE7F for ; Thu, 6 May 2021 07:55:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1FEBE6891C; Thu, 6 May 2021 09:55:09 +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="Mc1sgqIF"; dkim-atps=neutral Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B39FC68925 for ; Thu, 6 May 2021 09:55:06 +0200 (CEST) Received: by mail-pl1-x631.google.com with SMTP id b3so2956849plg.11 for ; Thu, 06 May 2021 00:55:06 -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=PG62SFUcUT60t1iuwKKoBqdqCmkKztBSu4RhIwCnTPg=; b=Mc1sgqIF0Jyt2prbymVwrnyydiDKoPEWGB1kgxFkircXVmCRIxdDDnUVKhzJ7kRkE/ 85LOT7RH7ZJSZ0mn18Emgpwvq9U4d9Qufd3pfoFC94uOcdl7b1TEMgmHHMI1pCDU5nw8 TGcMmOHx0FpToEETXegK8XL51+9Ztee3/hPCE= 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=PG62SFUcUT60t1iuwKKoBqdqCmkKztBSu4RhIwCnTPg=; b=Jn7uGtPEqxmH1LNdb8MyYSHcu7hOCkYY27oJHWVPsy5JUGBjqQ53zfmmzpqCqDFEBm dFYePHDqxZtq96BYa3BVfRg28PVXXvjK4qXGWdKr1zDhnOEF8aOwU+aPY7Q/5d4P91PQ SV851JBncfeT0uoJZlMy0VzhTmg8Rd9n37aMINJW9UoSIbeeVoXeEqMPMvuSTI8pjYfX V61PL/lcQZIj0xKlkhJO/RXxAvtr6u4EXfiHgMMpOOZKkP7nSrrCbzyqpw637ZX/HZGu D4IlSeNQca5sCK96LwqkAicPRtSnvxI4++e577U7Zxd7ISdeDkL9Md1WGiG5ANeftkfD HmTQ== X-Gm-Message-State: AOAM532wHW8USCvWA5owu5JTPL7C9tUfDUJCaVVB6/7WR908ujitDQZV vS+lCMAaRT4Tk+j1v96xCcL51yIYS7nCJg== X-Google-Smtp-Source: ABdhPJytg1i3PI/K/WYHBdJtmnd3fRr/VRFSuE2bOgakkqvGEN+lNTU07rAmbKOQ/ePwjQQQP9I14Q== X-Received: by 2002:a17:90a:ad84:: with SMTP id s4mr16499626pjq.162.1620287705058; Thu, 06 May 2021 00:55:05 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:2:ede4:ae0e:d4a4:c0d3]) by smtp.gmail.com with ESMTPSA id f201sm1355546pfa.133.2021.05.06.00.55.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 May 2021 00:55:04 -0700 (PDT) From: Hirokazu Honda 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 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 test pattern modes obtained by Camera::controls(). Signed-off-by: Hirokazu Honda --- src/android/camera_device.cpp | 46 ++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp index 3d5b5f24..a96bc09b 100644 --- a/src/android/camera_device.cpp +++ b/src/android/camera_device.cpp @@ -1090,12 +1090,50 @@ const camera_metadata_t *CameraDevice::getStaticMetadata() staticMetadata_->addEntry(ANDROID_SENSOR_ORIENTATION, &orientation_, 1); - std::vector testPatterModes = { - ANDROID_SENSOR_TEST_PATTERN_MODE_OFF, + const auto &testPatternsInfo = + controlsInfo.find(&controls::draft::TestPatternMode); + std::vector testPatternModes = { + ANDROID_SENSOR_TEST_PATTERN_MODE_OFF }; + if (testPatternsInfo != controlsInfo.end()) { + const auto &values = testPatternsInfo->second.values(); + if (!values.empty()) { + testPatternModes.clear(); + for (const auto &value : values) { + int aValue = -1; + switch (value.get()) { + case controls::draft::TestPatternModeOff: + aValue = ANDROID_SENSOR_TEST_PATTERN_MODE_OFF; + break; + case controls::draft::TestPatternModeSolidColor: + aValue = ANDROID_SENSOR_TEST_PATTERN_MODE_SOLID_COLOR; + break; + case controls::draft::TestPatternModeColorBars: + aValue = ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS; + break; + case controls::draft::TestPatternModeColorBarsFadeToGray: + aValue = ANDROID_SENSOR_TEST_PATTERN_MODE_COLOR_BARS_FADE_TO_GRAY; + break; + case controls::draft::TestPatternModePn9: + aValue = ANDROID_SENSOR_TEST_PATTERN_MODE_PN9; + break; + case controls::draft::TestPatternModeCustom1: + aValue = ANDROID_SENSOR_TEST_PATTERN_MODE_CUSTOM1; + break; + default: + LOG(HAL, Error) + << "Unknown test pattern mode: " + << value.get(); + continue; + } + + testPatternModes.push_back(aValue); + } + } + } staticMetadata_->addEntry(ANDROID_SENSOR_AVAILABLE_TEST_PATTERN_MODES, - testPatterModes.data(), - testPatterModes.size()); + testPatternModes.data(), + testPatternModes.size()); uint8_t timestampSource = ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE_UNKNOWN; staticMetadata_->addEntry(ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE,