Show a patch.

GET /api/patches/12311/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 12311,
    "url": "https://patchwork.libcamera.org/api/patches/12311/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/12311/",
    "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": "<20210518100706.578526-4-naush@raspberrypi.com>",
    "date": "2021-05-18T10:07:05",
    "name": "[libcamera-devel,3/4] ipa: raspberrypi: Switch AgcAlgorithm API to use RPiController::Duration",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "56a2298ff9551dfad00c9bebdf4aa3fad4497841",
    "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/12311/mbox/",
    "series": [
        {
            "id": 2034,
            "url": "https://patchwork.libcamera.org/api/series/2034/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2034",
            "date": "2021-05-18T10:07:02",
            "name": "Switch RaspberryPi IPA to use std::chrono::duration",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2034/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/12311/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/12311/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 40B7BC31FF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 18 May 2021 10:09:18 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D024168926;\n\tTue, 18 May 2021 12:09:17 +0200 (CEST)",
            "from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com\n\t[IPv6:2a00:1450:4864:20::42c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1852C602B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 18 May 2021 12:09:13 +0200 (CEST)",
            "by mail-wr1-x42c.google.com with SMTP id r12so9567043wrp.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 18 May 2021 03:09:13 -0700 (PDT)",
            "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:34e4:187b:f2:ed28])\n\tby smtp.gmail.com with ESMTPSA id\n\to11sm6566682wrq.93.2021.05.18.03.09.12\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 18 May 2021 03:09:12 -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=\"KSV/obGj\"; 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=Y5RXuJHyUTxuAceYnXQsVzi1M30dRbpIawpuv7wWDUM=;\n\tb=KSV/obGjDaLaXguvASYAOLMdDgKpU2zk5jyjgY8XAuCFeSOoOtGUyjXJpkh317HgpW\n\tHzs4Xd6qmGTlHitURIP2Lg5s2OAT6mgrzGJhGK+pRtVjralfdv9CoSycjggT1QypOgT4\n\trFva6Sop9InHbbOeDwuVcumDDaL9ifUoCImkCdfhcxtssqa6qNSf3L+RX9dVI4nFOHKx\n\tH18XXhm1o1Hev/4z+rxtKgs3H3u/9KMyYJkPGL61/EYLc6bVvIfOT0+SYNaQlK9sl/Ha\n\tYkcUw/7sOvz14qktpmxyR7JeYSq42de1Y6YoOiMpIvEvzE4UOTf2BXEcYVvbl00YoCHM\n\trpQQ==",
        "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=Y5RXuJHyUTxuAceYnXQsVzi1M30dRbpIawpuv7wWDUM=;\n\tb=E3sIzc5aN+XYVEoDZKlVTc+NsMXXsnZum8DWkgq6gm15qloNrMZ5MwNdeTghutNLrE\n\tjxM6iDQeTVfYNkHTuFKe9a+NAnibIAAAtTkIo0Vq41EFkbYg6MoVWSpnvvvoBWHl6ia+\n\tCd0MeX2Nw4BC47hRgv723xVaxQgw9KNBZGDwDFA0auSygr9P+mg1Y1y5qRRr8KWHaF3Y\n\t+2QD/Bw23pvqL36jvspg4tyrLP8QrGDsAXsXX66r9igUD0CE0A96RClZsRxKVFD3SCtD\n\tzRlCNSMgBH5FOf07g9lPszhpterRJKA/IiudvqoP2WgY66Yk01TVl2ovz/uNDBzJY24u\n\tX+ww==",
        "X-Gm-Message-State": "AOAM533VSmDJNW9Xn9tieeMueAvP7Kjt5Itc2lOfYQufE0RcszHFgpp7\n\t3q5kbGE5O89mcN2CEHuUMnASy2i6K7IeHA==",
        "X-Google-Smtp-Source": "ABdhPJzKq8ySsdtJbDD+kxUIQEhc5+DMKSwyqpkInYPQA06iv6vCP1wCR94EMea9oUXqR8KjDwYr+Q==",
        "X-Received": "by 2002:adf:fa45:: with SMTP id y5mr5935819wrr.311.1621332552540;\n\tTue, 18 May 2021 03:09:12 -0700 (PDT)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 18 May 2021 11:07:05 +0100",
        "Message-Id": "<20210518100706.578526-4-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210518100706.578526-1-naush@raspberrypi.com>",
        "References": "<20210518100706.578526-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 3/4] ipa: raspberrypi: Switch AgcAlgorithm\n\tAPI to use RPiController::Duration",
        "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": "Switch the AgcAlgorithm API functions to use RPiController::Duration\nfor all time based variables.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n src/ipa/raspberrypi/controller/agc_algorithm.hpp |  7 ++++---\n src/ipa/raspberrypi/controller/rpi/agc.cpp       | 12 ++++++------\n src/ipa/raspberrypi/controller/rpi/agc.hpp       |  6 +++---\n src/ipa/raspberrypi/raspberrypi.cpp              |  6 +++---\n 4 files changed, 16 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/src/ipa/raspberrypi/controller/agc_algorithm.hpp b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\nindex f97deb0fca59..668912c47388 100644\n--- a/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n@@ -7,6 +7,7 @@\n #pragma once\n \n #include \"algorithm.hpp\"\n+#include \"duration.hpp\"\n \n namespace RPiController {\n \n@@ -17,9 +18,9 @@ public:\n \t// An AGC algorithm must provide the following:\n \tvirtual unsigned int GetConvergenceFrames() const = 0;\n \tvirtual void SetEv(double ev) = 0;\n-\tvirtual void SetFlickerPeriod(double flicker_period) = 0;\n-\tvirtual void SetFixedShutter(double fixed_shutter) = 0; // microseconds\n-\tvirtual void SetMaxShutter(double max_shutter) = 0; // microseconds\n+\tvirtual void SetFlickerPeriod(Duration flicker_period) = 0;\n+\tvirtual void SetFixedShutter(Duration fixed_shutter) = 0;\n+\tvirtual void SetMaxShutter(Duration max_shutter) = 0;\n \tvirtual void SetFixedAnalogueGain(double fixed_analogue_gain) = 0;\n \tvirtual void SetMeteringMode(std::string const &metering_mode_name) = 0;\n \tvirtual void SetExposureMode(std::string const &exposure_mode_name) = 0;\ndiff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp\nindex f4cd5d26fb4e..1cb4472b2691 100644\n--- a/src/ipa/raspberrypi/controller/rpi/agc.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n@@ -222,19 +222,19 @@ void Agc::SetEv(double ev)\n \tev_ = ev;\n }\n \n-void Agc::SetFlickerPeriod(double flicker_period)\n+void Agc::SetFlickerPeriod(Duration flicker_period)\n {\n-\tflicker_period_ = flicker_period;\n+\tflicker_period_ = DurationValue<std::micro>(flicker_period);\n }\n \n-void Agc::SetMaxShutter(double max_shutter)\n+void Agc::SetMaxShutter(Duration max_shutter)\n {\n-\tmax_shutter_ = max_shutter;\n+\tmax_shutter_ = DurationValue<std::micro>(max_shutter);\n }\n \n-void Agc::SetFixedShutter(double fixed_shutter)\n+void Agc::SetFixedShutter(Duration fixed_shutter)\n {\n-\tfixed_shutter_ = fixed_shutter;\n+\tfixed_shutter_ = DurationValue<std::micro>(fixed_shutter);\n \t// Set this in case someone calls Pause() straight after.\n \tstatus_.shutter_time = clipShutter(fixed_shutter_);\n }\ndiff --git a/src/ipa/raspberrypi/controller/rpi/agc.hpp b/src/ipa/raspberrypi/controller/rpi/agc.hpp\nindex 0427fb59ec1b..cb79bf61ba42 100644\n--- a/src/ipa/raspberrypi/controller/rpi/agc.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/agc.hpp\n@@ -77,9 +77,9 @@ public:\n \tvoid Resume() override;\n \tunsigned int GetConvergenceFrames() const override;\n \tvoid SetEv(double ev) override;\n-\tvoid SetFlickerPeriod(double flicker_period) override;\n-\tvoid SetMaxShutter(double max_shutter) override; // microseconds\n-\tvoid SetFixedShutter(double fixed_shutter) override; // microseconds\n+\tvoid SetFlickerPeriod(Duration flicker_period) override;\n+\tvoid SetMaxShutter(Duration max_shutter) override;\n+\tvoid SetFixedShutter(Duration fixed_shutter) override;\n \tvoid SetFixedAnalogueGain(double fixed_analogue_gain) override;\n \tvoid SetMeteringMode(std::string const &metering_mode_name) override;\n \tvoid SetExposureMode(std::string const &exposure_mode_name) override;\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 994fb7e057a9..f080f2e53bac 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -643,8 +643,8 @@ void IPARPi::queueRequest(const ControlList &controls)\n \t\t\t\tbreak;\n \t\t\t}\n \n-\t\t\t/* This expects units of micro-seconds. */\n-\t\t\tagc->SetFixedShutter(ctrl.second.get<int32_t>());\n+\t\t\t/* The control provides units of microseconds. */\n+\t\t\tagc->SetFixedShutter(ctrl.second.get<int32_t>() * 1.0us);\n \n \t\t\tlibcameraMetadata_.set(controls::ExposureTime, ctrl.second.get<int32_t>());\n \t\t\tbreak;\n@@ -1097,7 +1097,7 @@ void IPARPi::applyFrameDurations(const Duration &minFrameDuration,\n \n \tRPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(\n \t\tcontroller_.GetAlgorithm(\"agc\"));\n-\tagc->SetMaxShutter(DurationValue<std::micro>(maxShutter));\n+\tagc->SetMaxShutter(maxShutter);\n }\n \n void IPARPi::applyAGC(const struct AgcStatus *agcStatus, ControlList &ctrls)\n",
    "prefixes": [
        "libcamera-devel",
        "3/4"
    ]
}