Patch Detail
Show a patch.
GET /api/patches/21281/?format=api
{ "id": 21281, "url": "https://patchwork.libcamera.org/api/patches/21281/?format=api", "web_url": "https://patchwork.libcamera.org/patch/21281/", "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": "<20240916140241.47845-2-kieran.bingham@ideasonboard.com>", "date": "2024-09-16T14:02:38", "name": "[1/4] libcamera: media_device: Add helper to return matching entities", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "d8da3c15ac92d26001c9e55969cbedb6c1176301", "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/21281/mbox/", "series": [ { "id": 4601, "url": "https://patchwork.libcamera.org/api/series/4601/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4601", "date": "2024-09-16T14:02:37", "name": "MediaPipeline: Complex input device support", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4601/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/21281/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/21281/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 B44D7C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 16 Sep 2024 14:02:54 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 93941634FF;\n\tMon, 16 Sep 2024 16:02:51 +0200 (CEST)", "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 CC7A5634FC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 16 Sep 2024 16:02:48 +0200 (CEST)", "from charm.lan (unknown\n\t[IPv6:2001:4bc9:a45:b0af:726e:a88f:9f07:34be])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A325582A;\n\tMon, 16 Sep 2024 16:01:27 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"qcBXRs1b\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1726495287;\n\tbh=uiBSR0tOq4Y0tvXZp5jRAZLAjaMTGxsDzQBGB7knc9s=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=qcBXRs1bcdyUCByUrZopEXojRDCMcZ1xKFtBe58XCCRtEyy8sDqV9+X/DhsG36CUi\n\tk/dUGTI6bIblEbxFkJH4s8t6Q7IjO6B9ZVDla1k+SYlzv4aD9PCCsMIHpkyeCnakxr\n\thFCejMd+uGU1uNw82HMLqrlKqM58563BzGx51x8g=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "libcamera devel <libcamera-devel@lists.libcamera.org>", "Cc": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "Subject": "[PATCH 1/4] libcamera: media_device: Add helper to return matching\n\tentities", "Date": "Mon, 16 Sep 2024 16:02:38 +0200", "Message-ID": "<20240916140241.47845-2-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.46.0", "In-Reply-To": "<20240916140241.47845-1-kieran.bingham@ideasonboard.com>", "References": "<20240916140241.47845-1-kieran.bingham@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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": "Provide a helper on the MediaDevice to return a list of all\navailable entities which match a given function in the graph.\n\nAs a drive by, also fix a whitespace error in the documentation of\nMediaDevice::setupLink.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n include/libcamera/internal/media_device.h | 2 ++\n src/libcamera/media_device.cpp | 24 ++++++++++++++++++++++-\n 2 files changed, 25 insertions(+), 1 deletion(-)", "diff": "diff --git a/include/libcamera/internal/media_device.h b/include/libcamera/internal/media_device.h\nindex e412d3a0b7e3..b3a48b98d64b 100644\n--- a/include/libcamera/internal/media_device.h\n+++ b/include/libcamera/internal/media_device.h\n@@ -55,6 +55,8 @@ public:\n \n \tSignal<> disconnected;\n \n+\tstd::vector<MediaEntity *> locateEntities(unsigned int function);\n+\n protected:\n \tstd::string logPrefix() const override;\n \ndiff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp\nindex d71dad74df70..d1e0dee2ff0f 100644\n--- a/src/libcamera/media_device.cpp\n+++ b/src/libcamera/media_device.cpp\n@@ -793,7 +793,7 @@ void MediaDevice::fixupEntityFlags(struct media_v2_entity *entity)\n * low-level link setup as it performs no checks on the validity of the \\a\n * flags, and assumes that the supplied \\a flags are valid for the link (e.g.\n * immutable links cannot be disabled).\n-*\n+ *\n * \\sa MediaLink::setEnabled(bool enable)\n *\n * \\return 0 on success or a negative error code otherwise\n@@ -828,4 +828,26 @@ int MediaDevice::setupLink(const MediaLink *link, unsigned int flags)\n \treturn 0;\n }\n \n+/**\n+ * \\brief Identify all entities of a common function in the MediaDevice\n+ * \\param[in] function The entity function to search for\n+ *\n+ * Search all entities within the graph of the MediaDevice and return\n+ * a vector of those which match the given function.\n+ *\n+ * \\return A vector of matching entities\n+ */\n+std::vector<MediaEntity *> MediaDevice::locateEntities(unsigned int function)\n+{\n+\tstd::vector<MediaEntity *> found;\n+\n+\t/* Gather all the entities matching the function they expose. */\n+\tfor (MediaEntity *entity : entities()) {\n+\t\tif (entity->function() == function)\n+\t\t\tfound.push_back(entity);\n+\t}\n+\n+\treturn found;\n+}\n+\n } /* namespace libcamera */\n", "prefixes": [ "1/4" ] }