Patch Detail
Show a patch.
GET /api/1.1/patches/12886/?format=api
{ "id": 12886, "url": "https://patchwork.libcamera.org/api/1.1/patches/12886/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12886/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20210709145825.2943443-4-naush@raspberrypi.com>", "date": "2021-07-09T14:58:20", "name": "[libcamera-devel,v6,3/8] ipa: raspberrypi: Add an operator<< to struct DeviceStatus", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "28f0ccf04d5d258410500838f638755094cae776", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/12886/mbox/", "series": [ { "id": 2223, "url": "https://patchwork.libcamera.org/api/1.1/series/2223/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2223", "date": "2021-07-09T14:58:17", "name": "ipa: raspberrypi: Allow long exposure modes for imx477.", "version": 6, "mbox": "https://patchwork.libcamera.org/series/2223/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12886/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12886/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 01337C3225\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 9 Jul 2021 14:58:35 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9689168533;\n\tFri, 9 Jul 2021 16:58:34 +0200 (CEST)", "from mail-wm1-x330.google.com (mail-wm1-x330.google.com\n\t[IPv6:2a00:1450:4864:20::330])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 70D506851B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 9 Jul 2021 16:58:32 +0200 (CEST)", "by mail-wm1-x330.google.com with SMTP id\n\tu8-20020a7bcb080000b02901e44e9caa2aso6483414wmj.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 09 Jul 2021 07:58:32 -0700 (PDT)", "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:35c2:26d3:e217:4410])\n\tby smtp.gmail.com with ESMTPSA id\n\tc2sm1480995wrn.28.2021.07.09.07.58.31\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 09 Jul 2021 07:58:31 -0700 (PDT)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"G05tTqeF\"; dkim-atps=neutral", "DKIM-Signature": "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=2MOHkI9d2JftDLF72AIP/Z1PbT5IJT/M0ZOVm45a6as=;\n\tb=G05tTqeFfQahWWCHmx76vZjNNueD6VVWKpIcs1DC3BIsMR8t48vkRrC01ecYzrsuDy\n\ti1EzPbx1WpNo5NrrZDbvkv5fF0pguAoYWqZkvAIXo20PMwr+skPgMn4CzHEAhyDCxnfr\n\tEokwAAKnVH3gvFdahXjO5SKjtSUBSg6WHyUP9rQ1+7Rwvfc2u0kB84KLkyV6BJJD3G8O\n\t7jz7iSLJiJJklrLpGMNM0ERaRYH5X7Svo6Q7GPYRsN1cKWkK3IsuZ+YaHfFtpMpAOhY2\n\t1xHHsbuq1ESTxF/7X+LVIRSjvdiIFHMIkzy2TUgUctrJoqm39ruTaQ+qXvGxhstCP+xE\n\tJiZw==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=2MOHkI9d2JftDLF72AIP/Z1PbT5IJT/M0ZOVm45a6as=;\n\tb=rN8vzsmK+MLBchE8BAueniuk4JILAsPc+v3Xwop4u9hORDZjsaiomaE7djq4thq8B4\n\tJxqpY6zu+oYtI7hp5H6P3UhUgB1SFNDwwoW9L5M/0C+5Mx/ezd5Vd7qESlk1K0LkRuM3\n\t21c31I5b6j7WL4lBzDd8oKPrsfcxdOgfEVsD/9yhSE44zPXYDni87LISDyPOZTN1fTY5\n\tE2Qq9I02SvigOon261RDNy8A2kGs1s8gauo75Dk7cyQ49dAWzS7FqoPwJJZ/6mgvbk2V\n\twmdvpqzD6XhueDuG2F1wlS4b4abWCSIEHiAZwC4dqqHg/wtIqknlG9uMH6aYV7nCyz8Z\n\tcoPw==", "X-Gm-Message-State": "AOAM532XTKT5NFmF+9vnBBTTD8ZCg3f4VOnCI8sBcgq3oxHN4vneZuA+\n\t2kt/OEP/VV1UKg6006JgcJ2o2wRxiB9bPw==", "X-Google-Smtp-Source": "ABdhPJxmwG97rw6pPRCoj+EYu41cL+Zyshoma6eJkH/xhk8bLKZzlP5Q4lpHp07mfq5wdP/c2uC93Q==", "X-Received": "by 2002:a1c:771a:: with SMTP id\n\tt26mr39781166wmi.107.1625842711985; \n\tFri, 09 Jul 2021 07:58:31 -0700 (PDT)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 9 Jul 2021 15:58:20 +0100", "Message-Id": "<20210709145825.2943443-4-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210709145825.2943443-1-naush@raspberrypi.com>", "References": "<20210709145825.2943443-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v6 3/8] ipa: raspberrypi: Add an\n\toperator<< to struct 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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Add an operator<< overload to log all fields in DeviceStatus, and remove the\nmanual logging statements in the IPA and CamHelper.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/raspberrypi/cam_helper.cpp | 5 +----\n src/ipa/raspberrypi/controller/device_status.h | 15 +++++++++++++++\n src/ipa/raspberrypi/raspberrypi.cpp | 5 +----\n 3 files changed, 17 insertions(+), 8 deletions(-)", "diff": "diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp\nindex e6d2258c66d7..1ec3f03e1aa3 100644\n--- a/src/ipa/raspberrypi/cam_helper.cpp\n+++ b/src/ipa/raspberrypi/cam_helper.cpp\n@@ -188,10 +188,7 @@ void CamHelper::parseEmbeddedData(Span<const uint8_t> buffer,\n \tdeviceStatus.shutter_speed = parsedDeviceStatus.shutter_speed;\n \tdeviceStatus.analogue_gain = parsedDeviceStatus.analogue_gain;\n \n-\tLOG(IPARPI, Debug) << \"Metadata updated - Exposure : \"\n-\t\t\t << deviceStatus.shutter_speed\n-\t\t\t << \" Gain : \"\n-\t\t\t << deviceStatus.analogue_gain;\n+\tLOG(IPARPI, Debug) << \"Metadata updated - \" << deviceStatus;\n \n \tmetadata.Set(\"device.status\", deviceStatus);\n }\ndiff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h\nindex 73df7ce228dd..e2511d19b96d 100644\n--- a/src/ipa/raspberrypi/controller/device_status.h\n+++ b/src/ipa/raspberrypi/controller/device_status.h\n@@ -6,6 +6,8 @@\n */\n #pragma once\n \n+#include <iostream>\n+\n #include <libcamera/base/utils.h>\n \n /*\n@@ -20,6 +22,19 @@ struct DeviceStatus {\n \t{\n \t}\n \n+\tfriend std::ostream &operator<<(std::ostream &out, const DeviceStatus &d)\n+\t{\n+\t\tusing namespace libcamera; /* for the Duration operator<< overload */\n+\n+\t\tout << \"Exposure: \" << d.shutter_speed\n+\t\t << \" Gain: \" << d.analogue_gain\n+\t\t << \" Aperture: \" << d.aperture\n+\t\t << \" Lens: \" << d.lens_position\n+\t\t << \" Flash: \" << d.flash_intensity;\n+\n+\t\treturn out;\n+\t}\n+\n \t/* time shutter is open */\n \tlibcamera::utils::Duration shutter_speed;\n \tdouble analogue_gain;\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 4d09a84f6532..f51c970befb5 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -1019,10 +1019,7 @@ void IPARPi::fillDeviceStatus(const ControlList &sensorControls)\n \tdeviceStatus.shutter_speed = helper_->Exposure(exposureLines);\n \tdeviceStatus.analogue_gain = helper_->Gain(gainCode);\n \n-\tLOG(IPARPI, Debug) << \"Metadata - Exposure : \"\n-\t\t\t << deviceStatus.shutter_speed\n-\t\t\t << \" Gain : \"\n-\t\t\t << deviceStatus.analogue_gain;\n+\tLOG(IPARPI, Debug) << \"Metadata - \" << deviceStatus;\n \n \trpiMetadata_.Set(\"device.status\", deviceStatus);\n }\n", "prefixes": [ "libcamera-devel", "v6", "3/8" ] }