Patch Detail
Show a patch.
GET /api/patches/12223/?format=api
{ "id": 12223, "url": "https://patchwork.libcamera.org/api/patches/12223/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12223/", "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": "<20210507084042.31879-3-naush@raspberrypi.com>", "date": "2021-05-07T08:40:39", "name": "[libcamera-devel,v6,2/5] ipa: raspberrypi: Reformat RPiController::Metadata class header", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "2ccb47bd8deeedeeab1a54582b73be1c604db0d6", "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/12223/mbox/", "series": [ { "id": 2010, "url": "https://patchwork.libcamera.org/api/series/2010/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2010", "date": "2021-05-07T08:40:37", "name": "ipa: raspberrypi: Rate-limit the controller algorithms", "version": 6, "mbox": "https://patchwork.libcamera.org/series/2010/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12223/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12223/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 4D738BF831\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 7 May 2021 08:40:53 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B58FB6891D;\n\tFri, 7 May 2021 10:40:52 +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 696A86890C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 7 May 2021 10:40:50 +0200 (CEST)", "by mail-wr1-x431.google.com with SMTP id v12so8306986wrq.6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 07 May 2021 01:40:50 -0700 (PDT)", "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:81ab:95ee:9715:e9fb])\n\tby smtp.gmail.com with ESMTPSA id\n\tl12sm7604098wrm.76.2021.05.07.01.40.49\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 07 May 2021 01:40:49 -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=\"rGHQUzUF\"; 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=+GT3G4sPCrq9a5bQt/xmz9z6Jx7t87Z5yxPlBQqFaZM=;\n\tb=rGHQUzUFwAhLsZi6vGsK2WOzNq75nNwVNrr8cL8i+UJLIQRhurDAYKjxTG+Vx3nApE\n\tLnFzE5T5oykDfVZ6tteNhU1/K7xmWQKVuk9tvUQGbEONnOs1kR9xxuQIBnJrNyh9HgFL\n\tHpxfCG3L8yzl7KOZYXUngRicWOljBlm89Ux7QKGy+grgM/y7RvmcY5zbOyYhUDzmSBeh\n\tees3jOhN7/x5Cqwp0zalBS2MsiACPmtOgsnb8ri0M+hCprYu4qS8tJB7q6wF6Dy0cdtq\n\tnM6hv3wu31qk8QQDZDSFNJ9+0tKd+7yXlMhabPzvfuZwMSuxikVzzhoClpEHYmB0+h2/\n\tnWZw==", "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=+GT3G4sPCrq9a5bQt/xmz9z6Jx7t87Z5yxPlBQqFaZM=;\n\tb=gr+SvF53kuRY1IrF+wY+McNPwp4qpksesL/aCmwyRiroW+P9NQyu1l50PGsPVS+qaf\n\tGtM4QmNNFww622f99Clnh22HkP9buKr8I+VW5OgbcoSd6ZLGUdfDUxpw0VMoe4e52kKh\n\t0lEhdB0iloMgQsu3szX/GxUm5AdbTBsBY+q2DgiOxqjBnlXtHXsJzQdpn2yuOTrItjQL\n\tXYJJPGqzN7UcLhtVmPNd2wvRdacpZtvA8BtrLymwwKLyuYmDSGDfLvk4W7r3gDq/x+GD\n\txdWX44eUK35nfPv9K1cflls3S8uD2ltLe1fPDXbojza508nbBt4jXqFVJebGXdPCt/IE\n\tuzXw==", "X-Gm-Message-State": "AOAM533g9q/3bKBmKvkhjEhStoUUU+0kV05ImA6v98wslbFC9uFCUCTK\n\tAk8L6Dq2cLxzOoBOtxtyRptDH4VAsLw75A==", "X-Google-Smtp-Source": "ABdhPJysKxiy52NTht5ROg8unjvM6fFaKj24u4lGDNOavoP9GCRKPt+2FcXQLBeLw5/jFato3q8eiQ==", "X-Received": "by 2002:adf:ab1d:: with SMTP id\n\tq29mr10504127wrc.208.1620376849938; \n\tFri, 07 May 2021 01:40:49 -0700 (PDT)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 7 May 2021 09:40:39 +0100", "Message-Id": "<20210507084042.31879-3-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210507084042.31879-1-naush@raspberrypi.com>", "References": "<20210507084042.31879-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v6 2/5] ipa: raspberrypi: Reformat\n\tRPiController::Metadata class header", "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": "Rearrange header includes to be in alphabetical order.\nAdd whitespace to class definition to match libcamera coding guidelines.\nFix a typo in the comment showing an example of scoped locks.\n\nThere are no functional changes in this commit.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/raspberrypi/controller/metadata.hpp | 23 ++++++++++++++-------\n 1 file changed, 16 insertions(+), 7 deletions(-)", "diff": "diff --git a/src/ipa/raspberrypi/controller/metadata.hpp b/src/ipa/raspberrypi/controller/metadata.hpp\nindex 4f44ffc6771c..07dd28ed9e0a 100644\n--- a/src/ipa/raspberrypi/controller/metadata.hpp\n+++ b/src/ipa/raspberrypi/controller/metadata.hpp\n@@ -1,6 +1,6 @@\n /* SPDX-License-Identifier: BSD-2-Clause */\n /*\n- * Copyright (C) 2019, Raspberry Pi (Trading) Limited\n+ * Copyright (C) 2019-2021, Raspberry Pi (Trading) Limited\n *\n * metadata.hpp - general metadata class\n */\n@@ -9,22 +9,25 @@\n // A simple class for carrying arbitrary metadata, for example about an image.\n \n #include <any>\n-#include <string>\n-#include <mutex>\n #include <map>\n #include <memory>\n+#include <mutex>\n+#include <string>\n \n namespace RPiController {\n \n class Metadata\n {\n public:\n-\ttemplate<typename T> void Set(std::string const &tag, T const &value)\n+\ttemplate<typename T>\n+\tvoid Set(std::string const &tag, T const &value)\n \t{\n \t\tstd::lock_guard<std::mutex> lock(mutex_);\n \t\tdata_[tag] = value;\n \t}\n-\ttemplate<typename T> int Get(std::string const &tag, T &value) const\n+\n+\ttemplate<typename T>\n+\tint Get(std::string const &tag, T &value) const\n \t{\n \t\tstd::lock_guard<std::mutex> lock(mutex_);\n \t\tauto it = data_.find(tag);\n@@ -33,11 +36,13 @@ public:\n \t\tvalue = std::any_cast<T>(it->second);\n \t\treturn 0;\n \t}\n+\n \tvoid Clear()\n \t{\n \t\tstd::lock_guard<std::mutex> lock(mutex_);\n \t\tdata_.clear();\n \t}\n+\n \tMetadata &operator=(Metadata const &other)\n \t{\n \t\tstd::lock_guard<std::mutex> lock(mutex_);\n@@ -45,7 +50,9 @@ public:\n \t\tdata_ = other.data_;\n \t\treturn *this;\n \t}\n-\ttemplate<typename T> T *GetLocked(std::string const &tag)\n+\n+\ttemplate<typename T>\n+\tT *GetLocked(std::string const &tag)\n \t{\n \t\t// This allows in-place access to the Metadata contents,\n \t\t// for which you should be holding the lock.\n@@ -54,15 +61,17 @@ public:\n \t\t\treturn nullptr;\n \t\treturn std::any_cast<T>(&it->second);\n \t}\n+\n \ttemplate<typename T>\n \tvoid SetLocked(std::string const &tag, T const &value)\n \t{\n \t\t// Use this only if you're holding the lock yourself.\n \t\tdata_[tag] = value;\n \t}\n+\n \t// Note: use of (lowercase) lock and unlock means you can create scoped\n \t// locks with the standard lock classes.\n-\t// e.g. std::lock_guard<PisP::Metadata> lock(metadata)\n+\t// e.g. std::lock_guard<RPiController::Metadata> lock(metadata)\n \tvoid lock() { mutex_.lock(); }\n \tvoid unlock() { mutex_.unlock(); }\n \n", "prefixes": [ "libcamera-devel", "v6", "2/5" ] }