Show a patch.

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

{
    "id": 8543,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/8543/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/8543/",
    "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": "<20200701125021.1388-1-david.plowman@raspberrypi.com>",
    "date": "2020-07-01T12:50:21",
    "name": "[libcamera-devel,v2] libcamera: ipa: raspberrypi: Enable focus measure without recompile",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "31fd4071d14c1f7cb5dc497aaa62b220f04aa259",
    "submitter": {
        "id": 42,
        "url": "https://patchwork.libcamera.org/api/1.1/people/42/?format=api",
        "name": "David Plowman",
        "email": "david.plowman@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/8543/mbox/",
    "series": [
        {
            "id": 1067,
            "url": "https://patchwork.libcamera.org/api/1.1/series/1067/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1067",
            "date": "2020-07-01T12:50:21",
            "name": "[libcamera-devel,v2] libcamera: ipa: raspberrypi: Enable focus measure without recompile",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/1067/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/8543/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/8543/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 DA9DDBE905\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  1 Jul 2020 12:50:31 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 66BFE60C58;\n\tWed,  1 Jul 2020 14:50:31 +0200 (CEST)",
            "from mail-wr1-x431.google.com (mail-wr1-x431.google.com\n\t[IPv6:2a00:1450:4864:20::431])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F0E06603B4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  1 Jul 2020 14:50:29 +0200 (CEST)",
            "by mail-wr1-x431.google.com with SMTP id a6so23682377wrm.4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 01 Jul 2020 05:50:29 -0700 (PDT)",
            "from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\tg14sm2950029wrw.83.2020.07.01.05.50.28\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 01 Jul 2020 05:50:28 -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=\"Q7jsFKFX\"; 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:mime-version\n\t:content-transfer-encoding;\n\tbh=/ruwLN1bKzrJGDtGxsf8sj5mp/DyO3tRSKj/vQWJgV0=;\n\tb=Q7jsFKFXkflCAXdK+alCESp//Nmwc9hIk8nPlMfiUUjZBWUc9/50hylO7MrVhoo01E\n\t3x7/2opEBsxGWN+r/xds8yh7PZUcYUNfZM/niix8iSERTy9F9xCU9rGHSt9gq3n1HEYw\n\tPMlurMhFsfTOAeUgBqBgKdgt6KE0oiCIYgCrZ9ws6rjOvXAjcEEAZ3xHta5M1CHgnwFD\n\t3GGhKukB/Bw0FGu6vxgaf5SodgYBxTW6kXeCbl7Wzx5b7SfzYpwYSSQXD7PKaAzw6Kiv\n\tnmLC3tWldXWtfKbXIhabHFeEdZ4BELRHrUlTvk3PkDkXbLaD9fMUWV2B9gAIbR4Thc81\n\tY6AQ==",
        "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:mime-version\n\t:content-transfer-encoding;\n\tbh=/ruwLN1bKzrJGDtGxsf8sj5mp/DyO3tRSKj/vQWJgV0=;\n\tb=L3KyprkOaOtYmFIjH1h8S2Ly7PifJfTp1avBtsd16IG+CkqoDEyIljPqkaYcn+6vca\n\tvyBy7vxIsoYM4DzLNt2UvKQ7cycBcqnBAg8d6i5OH/5s66A/HGQyz3eml5lkOsAOGase\n\tDseJin2aRGpyAmtdldikm3Rha+uygZsLuq2PyhjSI48RVSiN1QhJmaWg2hS+Q6r+HJ3Y\n\tdXMuZEpSwBpv/F40lzjzJOCoc15XGRZ47zwYHJknKBvwcK+0BmD8LfV6q8sk0IYExZha\n\tFcJmU3OAUnyyQh53MRR71FN5ZFy+eNW6k5g27y92xv4Bg5pt43sw0Yllq2PAsUBZyH3V\n\tB98w==",
        "X-Gm-Message-State": "AOAM530tfCK4k8AYfPVF7zfNEI/T2tyj70sb+LAYxEvRLhWCYgz8rHgW\n\tLWBlGhbUHtXDa9EytNP5gDIyA8pBGUg=",
        "X-Google-Smtp-Source": "ABdhPJxHy6YAgeC1pxPep445sP0890Q0srNMppdhL2BNhlUgVALxNbdULpaEjQ99oer70erOWxRa0w==",
        "X-Received": "by 2002:adf:ec42:: with SMTP id\n\tw2mr26898588wrn.269.1593607829205; \n\tWed, 01 Jul 2020 05:50:29 -0700 (PDT)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  1 Jul 2020 13:50:21 +0100",
        "Message-Id": "<20200701125021.1388-1-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v2] libcamera: ipa: raspberrypi: Enable\n\tfocus measure without recompile",
        "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>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Previously, output of the focus measure could not be enabled without\nrecompiling (because of the RPI_LOGGING_ENABLE macro). This uses the\nlibcamera logging mechanism instead, so can be enabled/disabled at\nruntime.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/raspberrypi/controller/rpi/focus.cpp | 16 ++++++----------\n src/ipa/raspberrypi/controller/rpi/focus.hpp |  3 ---\n src/ipa/raspberrypi/data/imx477.json         |  2 +-\n 3 files changed, 7 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/src/ipa/raspberrypi/controller/rpi/focus.cpp b/src/ipa/raspberrypi/controller/rpi/focus.cpp\nindex 1e2b649..573831b 100644\n--- a/src/ipa/raspberrypi/controller/rpi/focus.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/focus.cpp\n@@ -6,11 +6,15 @@\n  */\n #include <stdint.h>\n \n+#include \"libcamera/internal/log.h\"\n+\n #include \"../focus_status.h\"\n-#include \"../logging.hpp\"\n #include \"focus.hpp\"\n \n using namespace RPi;\n+using namespace libcamera;\n+\n+LOG_DEFINE_CATEGORY(RPI_FOCUS)\n \n #define NAME \"rpi.focus\"\n \n@@ -24,11 +28,6 @@ char const *Focus::Name() const\n \treturn NAME;\n }\n \n-void Focus::Read(boost::property_tree::ptree const &params)\n-{\n-\tprint_ = params.get<int>(\"print\", 0);\n-}\n-\n void Focus::Process(StatisticsPtr &stats, Metadata *image_metadata)\n {\n \tFocusStatus status;\n@@ -37,10 +36,7 @@ void Focus::Process(StatisticsPtr &stats, Metadata *image_metadata)\n \t\tstatus.focus_measures[i] = stats->focus_stats[i].contrast_val[1][1] / 1000;\n \tstatus.num = i;\n \timage_metadata->Set(\"focus.status\", status);\n-\tif (print_) {\n-\t\tuint32_t value = (status.focus_measures[5] + status.focus_measures[6]) / 10;\n-\t\tRPI_LOG(\"Focus contrast measure: \" << value);\n-\t}\n+\tLOG(RPI_FOCUS, Debug) << \"Focus contrast measure: \" << (status.focus_measures[5] + status.focus_measures[6]) / 10;\n }\n \n /* Register algorithm with the system. */\ndiff --git a/src/ipa/raspberrypi/controller/rpi/focus.hpp b/src/ipa/raspberrypi/controller/rpi/focus.hpp\nindex d53401f..a9756ea 100644\n--- a/src/ipa/raspberrypi/controller/rpi/focus.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/focus.hpp\n@@ -22,10 +22,7 @@ class Focus : public Algorithm\n public:\n \tFocus(Controller *controller);\n \tchar const *Name() const override;\n-\tvoid Read(boost::property_tree::ptree const &params) override;\n \tvoid Process(StatisticsPtr &stats, Metadata *image_metadata) override;\n-private:\n-\tbool print_;\n };\n \n } /* namespace RPi */\ndiff --git a/src/ipa/raspberrypi/data/imx477.json b/src/ipa/raspberrypi/data/imx477.json\nindex 389e8ce..747cd8d 100644\n--- a/src/ipa/raspberrypi/data/imx477.json\n+++ b/src/ipa/raspberrypi/data/imx477.json\n@@ -415,6 +415,6 @@\n     },\n     \"rpi.focus\":\n     {\n-\t\"print\": 1\n+\n     }\n }\n",
    "prefixes": [
        "libcamera-devel",
        "v2"
    ]
}