Patch Detail
Show a patch.
GET /api/patches/302/?format=api
{ "id": 302, "url": "https://patchwork.libcamera.org/api/patches/302/?format=api", "web_url": "https://patchwork.libcamera.org/patch/302/", "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": "<20190121172705.19985-2-jacopo@jmondi.org>", "date": "2019-01-21T17:27:00", "name": "[libcamera-devel,1/6] libcamera: v4l2_device: Add MediaEntity contructor", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "00bf4e969d7a977b9e44f3359ad7621331f6f96b", "submitter": { "id": 3, "url": "https://patchwork.libcamera.org/api/people/3/?format=api", "name": "Jacopo Mondi", "email": "jacopo@jmondi.org" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/302/mbox/", "series": [ { "id": 105, "url": "https://patchwork.libcamera.org/api/series/105/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=105", "date": "2019-01-21T17:26:59", "name": "libcamera: Augment V4L2 device", "version": 1, "mbox": "https://patchwork.libcamera.org/series/105/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/302/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/302/checks/", "tags": {}, "headers": { "Return-Path": "<jacopo@jmondi.org>", "Received": [ "from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8A64060C83\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Jan 2019 18:27:03 +0100 (CET)", "from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 0DD711BF214;\n\tMon, 21 Jan 2019 17:27:02 +0000 (UTC)" ], "X-Originating-IP": "2.224.242.101", "From": "Jacopo Mondi <jacopo@jmondi.org>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 21 Jan 2019 18:27:00 +0100", "Message-Id": "<20190121172705.19985-2-jacopo@jmondi.org>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190121172705.19985-1-jacopo@jmondi.org>", "References": "<20190121172705.19985-1-jacopo@jmondi.org>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 1/6] libcamera: v4l2_device: Add\n\tMediaEntity contructor", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.23", "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, 21 Jan 2019 17:27:03 -0000" }, "content": "Construct a V4L2Device from a MediaEntity device node path. While at\nthere mark constructor as explicit to avoid copy-construction.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/include/v4l2_device.h | 4 +++-\n src/libcamera/v4l2_device.cpp | 12 ++++++++++++\n 2 files changed, 15 insertions(+), 1 deletion(-)", "diff": "diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\nindex 474c05b..c6f3d9a 100644\n--- a/src/libcamera/include/v4l2_device.h\n+++ b/src/libcamera/include/v4l2_device.h\n@@ -32,10 +32,12 @@ struct V4L2Capability final : v4l2_capability {\n \tbool hasStreaming() const { return capabilities & V4L2_CAP_STREAMING; }\n };\n \n+class MediaEntity;\n class V4L2Device\n {\n public:\n-\tV4L2Device(const std::string &devnode);\n+\texplicit V4L2Device(const std::string &devnode);\n+\texplicit V4L2Device(const MediaEntity &entity);\n \tV4L2Device(const V4L2Device &) = delete;\n \t~V4L2Device();\n \ndiff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 54b53de..59a1ad9 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -12,6 +12,7 @@\n #include <unistd.h>\n \n #include \"log.h\"\n+#include \"media_object.h\"\n #include \"v4l2_device.h\"\n \n /**\n@@ -92,6 +93,17 @@ V4L2Device::V4L2Device(const std::string &devnode)\n {\n }\n \n+/**\n+ * \\brief Construct a V4L2Device from a MediaEntity\n+ * \\param entity The MediaEntity to build the device from\n+ *\n+ * Construct a V4L2Device from a MediaEntity's device node path.\n+ */\n+V4L2Device::V4L2Device(const MediaEntity &entity)\n+\t: V4L2Device(entity.devnode())\n+{\n+}\n+\n V4L2Device::~V4L2Device()\n {\n \tclose();\n", "prefixes": [ "libcamera-devel", "1/6" ] }