Patch Detail
Show a patch.
GET /api/patches/16364/?format=api
{ "id": 16364, "url": "https://patchwork.libcamera.org/api/patches/16364/?format=api", "web_url": "https://patchwork.libcamera.org/patch/16364/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20220624073528.26670-3-naush@raspberrypi.com>", "date": "2022-06-24T07:35:26", "name": "[libcamera-devel,v2,2/4] ipa: raspberrypi: Add sensor temperature to DeviceStatus", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "0bda18121fe1c905edcc02a4ac9c0ec89388a494", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/16364/mbox/", "series": [ { "id": 3217, "url": "https://patchwork.libcamera.org/api/series/3217/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3217", "date": "2022-06-24T07:35:24", "name": "Add SensorTemperature control", "version": 2, "mbox": "https://patchwork.libcamera.org/series/3217/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/16364/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/16364/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id E6002BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Jun 2022 07:35:36 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8DE0165642;\n\tFri, 24 Jun 2022 09:35:36 +0200 (CEST)", "from mail-wm1-x334.google.com (mail-wm1-x334.google.com\n\t[IPv6:2a00:1450:4864:20::334])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A1C2665631\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Jun 2022 09:35:32 +0200 (CEST)", "by mail-wm1-x334.google.com with SMTP id e5so804335wma.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Jun 2022 00:35:32 -0700 (PDT)", "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tf13-20020a05600c154d00b0039ee391a024sm6695195wmg.14.2022.06.24.00.35.31\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 24 Jun 2022 00:35:31 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656056136;\n\tbh=JnEWMYEe4ljQSpx/EsezHbYzmULN6aQP59WhNtfitPs=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=uy65H+0EX4dyIVkXTK2nIGwhTJQyXgG+b/0O6S/GI40JJHVZStXh8gccK54UZyJA1\n\tFRtvPVlt1MwQo3YH4fXdWNNjDCjP70RmtZBBnv3ikIQUaYx8UT/rYdOj0TL0J/71SM\n\tJ71lD9vy6LNzaMnze0sloL5XvqCbzFbCgSjeeIWl4Tgq7baOteG5rB/CqJ1pm/QCTO\n\teC+f/5OC4i7ENFgNZWsKw1JnBCI9ZlHCWDaJLznvQcqkySunu8MyH6Ddbyf+OHznbm\n\tKsnAHjbFKRpHXiD5oKJRr8YalxHv0jk2MA4B5JfEaUt51GWeuHUDgVfXp9Mw19DhBo\n\tTRO2cEhE4wEOg==", "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=TKXSDlXgMKHxKCr92d20eztm199M5cveMVtTrE2BYsA=;\n\tb=en4gQ38iGiQb9sIZ0/u9rXAidC5wPC3ivyxwMapzKkyPk2SIombamJSyclXE6fV2H2\n\tq7D5lKAxw/zLXgD4/Pmlw32F5XggDBK47t2HXHAdwLLwh5AmZqCvbxNYvIV2xz2jOTm9\n\tARCiualzja16apyaB9hqbQeG7zZSxIKF/E4gAGusnZ+RVXfKhLMEIOZvxXxvi9THk189\n\taZtTYC8LIBmN6lOEpmiPENBpX5wRhm5t9KfAfpuDEa6W10qC9nVsjhHtQD8ajKYMpXWW\n\tnjA0qP+R6xUalNfOkB9Vzd8CNJo0UCR9XVsZAQF6YbKZ7qif33J2n5++u1Qv79jV6UV+\n\t6dVQ==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"en4gQ38i\"; dkim-atps=neutral", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=TKXSDlXgMKHxKCr92d20eztm199M5cveMVtTrE2BYsA=;\n\tb=vytZontXCNEd0mS0aJ3D2qKgjMHMdFwXRhNJckYTjW9RxjbcipE4rmJeYgNEPXvdlY\n\t4pMFYUwKoOm7VWaCUdUwbuGUCjjTRILJaDZPLi5DHKU+OhN7aVi/harHcdEbJKi7lnS3\n\tabrneyg+NMMEuClnQzCY5TGK2rDNpAo3ke6tmVAZ3Ba/OIDwWt7oxk7m3pieVmzfDNmj\n\tuXhfA9o2DSg5pB3Om8IghGAaOhPL7BL2MZ4IlOXO1dyTXZh6oODdWj7YC9HG5wdlsa0J\n\taXvHmx70fZkbhCQ7IE5NpOUhuVNtZjeGKheRwyiwRypfdbkOY86JAzZXuiLonkXFcxo2\n\tY2zA==", "X-Gm-Message-State": "AJIora/k+0uaFhNJGXSuQABZASYqpXTtAZ45L6Z0jIfDR1PvTtRBw32t\n\tq+NJZZfUrAAsh2I+YRwcFJTtnFbZZOQ9PIL6", "X-Google-Smtp-Source": "AGRyM1tUlDX64Qypgw3i7IzH2JEPPHN74KIKWK7YzyiGbmkBiOMdzVGbY3xGnZ/k5/74EtY6S4UXJA==", "X-Received": "by 2002:a05:600c:354c:b0:39c:7e86:6ff5 with SMTP id\n\ti12-20020a05600c354c00b0039c7e866ff5mr2037678wmq.145.1656056131731; \n\tFri, 24 Jun 2022 00:35:31 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 24 Jun 2022 08:35:26 +0100", "Message-Id": "<20220624073528.26670-3-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220624073528.26670-1-naush@raspberrypi.com>", "References": "<20220624073528.26670-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 2/4] ipa: raspberrypi: Add sensor\n\ttemperature to DeviceStatus", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "From": "Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Naushir Patuck <naush@raspberrypi.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Add an optional sensor_temperature field to the DeviceStatus structure. If a\ntemperature measurement is available for a frame, the value is returned out\nthrough the SensorTemperature control in the Request metadata.\n\nAdditionally, provide the sensor temperature value from the std::ostream &operator<<\noverload.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/ipa/raspberrypi/cam_helper.cpp | 8 +++++---\n src/ipa/raspberrypi/controller/device_status.cpp | 3 +++\n src/ipa/raspberrypi/controller/device_status.h | 3 +++\n src/ipa/raspberrypi/raspberrypi.cpp | 2 ++\n 4 files changed, 13 insertions(+), 3 deletions(-)", "diff": "diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp\nindex 74179399e86a..3f81d4187d4d 100644\n--- a/src/ipa/raspberrypi/cam_helper.cpp\n+++ b/src/ipa/raspberrypi/cam_helper.cpp\n@@ -185,9 +185,9 @@ void CamHelper::parseEmbeddedData(Span<const uint8_t> buffer,\n \tmetadata.Merge(parsedMetadata);\n \n \t/*\n-\t * Overwrite the exposure/gain values in the existing DeviceStatus with\n-\t * values from the parsed embedded buffer. Fetch it first in case any\n-\t * other fields were set meaningfully.\n+\t * Overwrite the exposure/gain, frame length and sensor temperature values\n+\t * in the existing DeviceStatus with values from the parsed embedded buffer.\n+\t * Fetch it first in case any other fields were set meaningfully.\n \t */\n \tDeviceStatus deviceStatus, parsedDeviceStatus;\n \tif (metadata.Get(\"device.status\", deviceStatus) ||\n@@ -199,6 +199,8 @@ void CamHelper::parseEmbeddedData(Span<const uint8_t> buffer,\n \tdeviceStatus.shutter_speed = parsedDeviceStatus.shutter_speed;\n \tdeviceStatus.analogue_gain = parsedDeviceStatus.analogue_gain;\n \tdeviceStatus.frame_length = parsedDeviceStatus.frame_length;\n+\tif (parsedDeviceStatus.sensor_temperature)\n+\t\tdeviceStatus.sensor_temperature = parsedDeviceStatus.sensor_temperature;\n \n \tLOG(IPARPI, Debug) << \"Metadata updated - \" << deviceStatus;\n \ndiff --git a/src/ipa/raspberrypi/controller/device_status.cpp b/src/ipa/raspberrypi/controller/device_status.cpp\nindex f052ea8b7bed..05897fc15b50 100644\n--- a/src/ipa/raspberrypi/controller/device_status.cpp\n+++ b/src/ipa/raspberrypi/controller/device_status.cpp\n@@ -17,5 +17,8 @@ std::ostream &operator<<(std::ostream &out, const DeviceStatus &d)\n \t << \" Lens: \" << d.lens_position\n \t << \" Flash: \" << d.flash_intensity;\n \n+\tif (d.sensor_temperature)\n+\t\tout << \" Temperature: \" << *d.sensor_temperature;\n+\n \treturn out;\n }\ndiff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h\nindex c4a5d9c8e8c7..eca3bf4b042e 100644\n--- a/src/ipa/raspberrypi/controller/device_status.h\n+++ b/src/ipa/raspberrypi/controller/device_status.h\n@@ -7,6 +7,7 @@\n #pragma once\n \n #include <iostream>\n+#include <optional>\n \n #include <libcamera/base/utils.h>\n \n@@ -36,4 +37,6 @@ struct DeviceStatus {\n \tdouble aperture;\n \t/* proportional to brightness with 0 = no flash, 1 = maximum flash */\n \tdouble flash_intensity;\n+\t/* Sensor reported temperature value (in degrees) */\n+\tstd::optional<double> sensor_temperature;\n };\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 3b126bb5175e..cb0025a17aff 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -491,6 +491,8 @@ void IPARPi::reportMetadata()\n \t\tlibcameraMetadata_.set(controls::AnalogueGain, deviceStatus->analogue_gain);\n \t\tlibcameraMetadata_.set(controls::FrameDuration,\n \t\t\t\t helper_->Exposure(deviceStatus->frame_length).get<std::micro>());\n+\t\tif (deviceStatus->sensor_temperature)\n+\t\t\tlibcameraMetadata_.set(controls::SensorTemperature, *deviceStatus->sensor_temperature);\n \t}\n \n \tAgcStatus *agcStatus = rpiMetadata_.GetLocked<AgcStatus>(\"agc.status\");\n", "prefixes": [ "libcamera-devel", "v2", "2/4" ] }