Patch Detail
Show a patch.
GET /api/patches/2846/?format=api
{ "id": 2846, "url": "https://patchwork.libcamera.org/api/patches/2846/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2846/", "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": "<20200217234841.16390-1-kieran.bingham@ideasonboard.com>", "date": "2020-02-17T23:48:41", "name": "[libcamera-devel] libcamera: media_device: Use Loggable interface", "commit_ref": "b0f1307fcfbb95519cdf19ac63dfd650d3fe5256", "pull_url": null, "state": "accepted", "archived": false, "hash": "acb33ce0f3d34e88e993e55ffc78b223ff3a7b95", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2846/mbox/", "series": [ { "id": 682, "url": "https://patchwork.libcamera.org/api/series/682/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=682", "date": "2020-02-17T23:48:41", "name": "[libcamera-devel] libcamera: media_device: Use Loggable interface", "version": 1, "mbox": "https://patchwork.libcamera.org/series/682/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2846/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2846/checks/", "tags": {}, "headers": { "Return-Path": "<kieran.bingham@ideasonboard.com>", "Received": [ "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BD94860438\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 18 Feb 2020 00:48:45 +0100 (CET)", "from localhost.localdomain\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 42C941220;\n\tTue, 18 Feb 2020 00:48:45 +0100 (CET)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1581983325;\n\tbh=SzCyLoPsyF6IG+LfUI08UblQFptGhyVVlIPnwm7fqa4=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=XPtVhtlMxNcby+gQyMaCRKv+c0++1k4wjHXsiBxSTxMD3ePRmzt/kw8l588OD/tUL\n\tecC1NPS2Q1QXIQAthx/aEg/Dh5g/1AGAriE46U/SOasOOiLArBvTk5p7mqKGq/o1vr\n\tqvcUbGyZcANdQ/TbowkbDcfB+9wrujkb+xOorK8o=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "libcamera devel <libcamera-devel@lists.libcamera.org>", "Date": "Mon, 17 Feb 2020 23:48:41 +0000", "Message-Id": "<20200217234841.16390-1-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.20.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] libcamera: media_device: Use Loggable\n\tinterface", "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>", "X-List-Received-Date": "Mon, 17 Feb 2020 23:48:45 -0000" }, "content": "Extend MediaDevice to inherit from the Loggable interface to support a\nlogPrefix which presents the device node path, and the driver name.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/libcamera/include/media_device.h | 6 +++++-\n src/libcamera/media_device.cpp | 5 +++++\n 2 files changed, 10 insertions(+), 1 deletion(-)", "diff": "diff --git a/src/libcamera/include/media_device.h b/src/libcamera/include/media_device.h\nindex 7b88e2875d59..44a59e70139e 100644\n--- a/src/libcamera/include/media_device.h\n+++ b/src/libcamera/include/media_device.h\n@@ -16,11 +16,12 @@\n \n #include <libcamera/signal.h>\n \n+#include \"log.h\"\n #include \"media_object.h\"\n \n namespace libcamera {\n \n-class MediaDevice\n+class MediaDevice : protected Loggable\n {\n public:\n \tMediaDevice(const std::string &deviceNode);\n@@ -52,6 +53,9 @@ public:\n \n \tSignal<MediaDevice *> disconnected;\n \n+protected:\n+\tstd::string logPrefix() const;\n+\n private:\n \tstd::string driver_;\n \tstd::string deviceNode_;\ndiff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp\nindex e1ae34f88455..fad475b9ac76 100644\n--- a/src/libcamera/media_device.cpp\n+++ b/src/libcamera/media_device.cpp\n@@ -74,6 +74,11 @@ MediaDevice::~MediaDevice()\n \tclear();\n }\n \n+std::string MediaDevice::logPrefix() const\n+{\n+\treturn deviceNode() + \"[\" + driver() + \"]\";\n+}\n+\n /**\n * \\brief Claim a device for exclusive use\n *\n", "prefixes": [ "libcamera-devel" ] }