{"id":12847,"url":"https://patchwork.libcamera.org/api/patches/12847/?format=json","web_url":"https://patchwork.libcamera.org/patch/12847/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210707094815.1500917-4-naush@raspberrypi.com>","date":"2021-07-07T09:48:10","name":"[libcamera-devel,v4,3/8] ipa: raspberrypi: Add an operator<< to struct DeviceStatus","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"28f0ccf04d5d258410500838f638755094cae776","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12847/mbox/","series":[{"id":2214,"url":"https://patchwork.libcamera.org/api/series/2214/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2214","date":"2021-07-07T09:48:07","name":"Raspberry Pi: Enable imx477 long exposure modes","version":4,"mbox":"https://patchwork.libcamera.org/series/2214/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12847/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12847/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 16F17C3224\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Jul 2021 09:48:24 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 992306851D;\n\tWed,  7 Jul 2021 11:48:23 +0200 (CEST)","from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com\n\t[IPv6:2a00:1450:4864:20::32a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 52BEC68525\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Jul 2021 11:48:20 +0200 (CEST)","by mail-wm1-x32a.google.com with SMTP id\n\tq18-20020a1ce9120000b02901f259f3a250so1261498wmc.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 07 Jul 2021 02:48:20 -0700 (PDT)","from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:f800:302e:bf7e:a06b])\n\tby smtp.gmail.com with ESMTPSA id\n\tr16sm23377836wrx.63.2021.07.07.02.48.19\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 07 Jul 2021 02:48:19 -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=\"oybOmDuS\"; 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=oybOmDuSdfjfaM6u9b7/usQANU+nsGh3ppGdZ31dXnEfRhq0gpb6MCaps9rTw+T/F1\n\teiJeYskVvr1dcEX9hVDJ/ZnBkmooVteXK7SaZ30U70JAxvnyYRI09pnMXbkJ9mDrsk+Q\n\t8rR34TB7D3bCLqFmsE9Y4WtWhyO2I+RE4kzVH6YfEeBAYNatnhanGF7eVIiEbDVykWXd\n\tnry8zwmPAXRQFTv5kq2IPKLYRKghQKWzjTu6N3FWV8jHG+KOOGSKIApswiXBF5LWq2aX\n\t3lrpzcQ9NSPZlN44gdmPfgiOtCsYYNSrz70Dqu/yKEFAVrDZC0nPZq+EYgqobnMSuh+l\n\taGAw==","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=LFdIhYvzxGc0C07Ef9dl3HmBE19zhkkemDdPFPE9bb2FjH2WZ22GqnTRkyCYQWOctX\n\tlpCzTHqIRRBBuU4iIz0e1zulUX+vZ7JqdAFtgKO8g+D7e6pCv8pijZg3Q45rGP27nCT5\n\t8bMlpP5b1r/iSR8RaeNXM7BBDNW/XU4/v0C+w9ce/82qhMOB7vowZxM8dKAAVZ6FsIpx\n\t3xopyFIeRIxC3la6GO4hnsqvZLNpyJIbjszjVmAG00cN9TovAyNkXPfL9E0tyG8GKEOI\n\tukxQi+D7y7sDgthhqPNtoIgh6/4DZX38GgA9nZMKXJuB+mbjF3zcV+uFLs3flra6MRW5\n\tx3fA==","X-Gm-Message-State":"AOAM531mtakzCiQI7/IKHRnGmmy7SWsLKfe7cv+6yMbNbLXXGSKkMWCr\n\tBpLwicOUiR95BEOV8MNDRner0aTpt7GRvA==","X-Google-Smtp-Source":"ABdhPJxQ3BtX/2CiKi7EU3Jql1VWvHu66158wERlwAVtXv9Crm570dNHfB2J/pwJze71s4iZLQcvBw==","X-Received":"by 2002:a05:600c:4143:: with SMTP id\n\th3mr5734126wmm.35.1625651299797; \n\tWed, 07 Jul 2021 02:48:19 -0700 (PDT)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed,  7 Jul 2021 10:48:10 +0100","Message-Id":"<20210707094815.1500917-4-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20210707094815.1500917-1-naush@raspberrypi.com>","References":"<20210707094815.1500917-1-naush@raspberrypi.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 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","v4","3/8"]}