Show a patch.

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

{
    "id": 12335,
    "url": "https://patchwork.libcamera.org/api/patches/12335/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/12335/",
    "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": "<20210521080530.37591-4-naush@raspberrypi.com>",
    "date": "2021-05-21T08:05:29",
    "name": "[libcamera-devel,v3,3/4] ipa: raspberrypi: Switch AgcAlgorithm API to use utils::Duration",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "c7596289966317af51db4f686ab94d082bcd9688",
    "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/12335/mbox/",
    "series": [
        {
            "id": 2040,
            "url": "https://patchwork.libcamera.org/api/series/2040/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2040",
            "date": "2021-05-21T08:05:26",
            "name": "Switch RaspberryPi IPA to use std::chrono::duration",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/2040/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/12335/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/12335/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 7B2F3C31FB\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 21 May 2021 08:05:43 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3A4176891F;\n\tFri, 21 May 2021 10:05:43 +0200 (CEST)",
            "from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com\n\t[IPv6:2a00:1450:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7447F68918\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 21 May 2021 10:05:39 +0200 (CEST)",
            "by mail-wr1-x42f.google.com with SMTP id q5so20093421wrs.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 21 May 2021 01:05:39 -0700 (PDT)",
            "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:de31:dc1f:6be5:f58e])\n\tby smtp.gmail.com with ESMTPSA id\n\tq186sm5159176wme.20.2021.05.21.01.05.38\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 21 May 2021 01:05:38 -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=\"ePmoGrj6\"; 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=Jne7FFyHUXM/cwQqpyyWmcX6MOj2YSJs1V/8tN5yUEk=;\n\tb=ePmoGrj65TxtBqUY9Z2E7YAFSh0qBsVOKj2MggPXYmZJy0cEpIQyPZWL6tdqt1D3KL\n\tilbJUhwgKDkULuiQR5Gy9xgWY7pwlsiCqCCaPrWoiy2H6j2878flproDU2tcsM855D8P\n\tP+UfBdc7+JqchTV8zkb7RJVwF3LMhvCaqhL1y8oAPqRdOWeLW9/4Pmd3vQ0DfuowboOr\n\tSl56PaRctwavZ7RlxIprz/BuJwXpvsACeYoMYggVOLI+CcGNh5EYziBkzcCQ8wH+sqb4\n\tKAzS7g2ITat2D1vQHZIq5n7hMWTSNiGn44jQe5OHWKFn2jtiRO2t4cGbWtJl6nsdD+sE\n\tgT4A==",
        "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=Jne7FFyHUXM/cwQqpyyWmcX6MOj2YSJs1V/8tN5yUEk=;\n\tb=qqfOnl43wpQ9teHOV6nwh0drnQZZfMk9SwF3VdEO6Brf5CrWySHvSn/WhGyyIB4api\n\tLXLMRKfAAxIZTFrNnWPGg16H+S001d7ampAXJzwfpNBpu53W+SlSu13b0urtvv8zd9kt\n\tG1I+wZBt8U2GjUvtowo++ck1O/6K3BsgVbykijuZINULboBZZ3PcypoCkTxsWIoD/z0O\n\ttad1ew9LKG7Th9IRwaJlG4Q/aBDq1QASB9vPwMEVkWsdwYHuQ4BBSTPiAM1KvXCHqaVY\n\td+1tmZ3hGjz72XjRNFSOYmXS3b3cirvRWLcMm1rup2L5SaL9jiUZjN8TYrg8TIEL74DN\n\trTmQ==",
        "X-Gm-Message-State": "AOAM533IdTQdhOIodVSNjVzvBOj4xEqQSzs84dT6AKVe3HMTXbe8E6zc\n\tGy55vbZ348Gs5SmEA/6Uk2jFFw6OwbCxBA==",
        "X-Google-Smtp-Source": "ABdhPJzgQjoAwWS4dcolcmw9pG5CbuyBeDPJ2U7nFqkj27SdSujlQ+RBUuTkP5UuLSal/nuqwat4lQ==",
        "X-Received": "by 2002:adf:dcd2:: with SMTP id\n\tx18mr8015555wrm.202.1621584338939; \n\tFri, 21 May 2021 01:05:38 -0700 (PDT)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 21 May 2021 09:05:29 +0100",
        "Message-Id": "<20210521080530.37591-4-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210521080530.37591-1-naush@raspberrypi.com>",
        "References": "<20210521080530.37591-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 3/4] ipa: raspberrypi: Switch\n\tAgcAlgorithm API to use utils::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 utils::Duration for all\ntime based variables.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/raspberrypi/controller/agc_algorithm.hpp |  9 ++++++---\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, 18 insertions(+), 15 deletions(-)",
    "diff": "diff --git a/src/ipa/raspberrypi/controller/agc_algorithm.hpp b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\nindex f97deb0fca59..dabb814ea3dd 100644\n--- a/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n@@ -6,10 +6,13 @@\n  */\n #pragma once\n \n+#include \"libcamera/internal/utils.h\"\n #include \"algorithm.hpp\"\n \n namespace RPiController {\n \n+using libcamera::utils::Duration;\n+\n class AgcAlgorithm : public Algorithm\n {\n public:\n@@ -17,9 +20,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(const Duration &flicker_period) = 0;\n+\tvirtual void SetFixedShutter(const Duration &fixed_shutter) = 0;\n+\tvirtual void SetMaxShutter(const 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..482eb3ef962d 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(const Duration &flicker_period)\n {\n-\tflicker_period_ = flicker_period;\n+\tflicker_period_ = flicker_period.get<std::micro>();\n }\n \n-void Agc::SetMaxShutter(double max_shutter)\n+void Agc::SetMaxShutter(const Duration &max_shutter)\n {\n-\tmax_shutter_ = max_shutter;\n+\tmax_shutter_ = max_shutter.get<std::micro>();\n }\n \n-void Agc::SetFixedShutter(double fixed_shutter)\n+void Agc::SetFixedShutter(const Duration &fixed_shutter)\n {\n-\tfixed_shutter_ = fixed_shutter;\n+\tfixed_shutter_ = fixed_shutter.get<std::micro>();\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..16a65959d90e 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(const Duration &flicker_period) override;\n+\tvoid SetMaxShutter(const Duration &max_shutter) override;\n+\tvoid SetFixedShutter(const 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 e5d4c92a8e01..f8f36420b076 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -641,8 +641,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@@ -1095,7 +1095,7 @@ void IPARPi::applyFrameDurations(const Duration &minFrameDuration,\n \n \tRPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(\n \t\tcontroller_.GetAlgorithm(\"agc\"));\n-\tagc->SetMaxShutter(maxShutter.get<std::micro>());\n+\tagc->SetMaxShutter(maxShutter);\n }\n \n void IPARPi::applyAGC(const struct AgcStatus *agcStatus, ControlList &ctrls)\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "3/4"
    ]
}