Patch Detail
Show a patch.
GET /api/1.1/patches/21547/?format=api
{ "id": 21547, "url": "https://patchwork.libcamera.org/api/1.1/patches/21547/?format=api", "web_url": "https://patchwork.libcamera.org/patch/21547/", "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": "<20241008231314.744556-2-kieran.bingham@ideasonboard.com>", "date": "2024-10-08T23:13:11", "name": "[v3,1/4] libcamera: media_device: Add helper to return matching entities", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "c37b49e72d5214594347ce6398749dcced43a4ef", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/21547/mbox/", "series": [ { "id": 4668, "url": "https://patchwork.libcamera.org/api/1.1/series/4668/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4668", "date": "2024-10-08T23:13:10", "name": "MediaPipeline: Complex input device support", "version": 3, "mbox": "https://patchwork.libcamera.org/series/4668/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/21547/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/21547/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 C8CC0C32DE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 8 Oct 2024 23:13:37 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1F5E56536C;\n\tWed, 9 Oct 2024 01:13:36 +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 E02476353A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 9 Oct 2024 01:13:22 +0200 (CEST)", "from Monstersaurus.tail69b4.ts.net\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 91F8282A;\n\tWed, 9 Oct 2024 01:11:45 +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=\"AH626oe7\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1728429105;\n\tbh=RqzSxwqprrcsw057g2saUwu1P2u9vHUaa9Y5qzMfFNU=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=AH626oe77q90at7XaDG5a8MmAwsc4uiefiqEmog/yYzvb9YDWf12pz4JjF8rBETSf\n\tA55mCG9llkybLq2rPl/pGzBjRF7RqyOWjv3GBM2C7ih+8lT8RVPOiyr9Wfle87weed\n\ti9eAZNT8JbakZ1ZWL071MMT6AlgMY5a8y5JAMPQU=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "libcamera devel <libcamera-devel@lists.libcamera.org>", "Cc": "Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tUmang Jain <umang.jain@ideasonboard.com>,\n\tJacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tDaniel Scally <dan.scally@ideasonboard.com>", "Subject": "[PATCH v3 1/4] libcamera: media_device: Add helper to return\n\tmatching entities", "Date": "Wed, 9 Oct 2024 00:13:11 +0100", "Message-Id": "<20241008231314.744556-2-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.34.1", "In-Reply-To": "<20241008231314.744556-1-kieran.bingham@ideasonboard.com>", "References": "<20241008231314.744556-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\nReviewed-by: Umang Jain <umang.jain@ideasonboard.com>\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\nReviewed-by: Daniel Scally <dan.scally@ideasonboard.com>\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n include/libcamera/internal/media_device.h | 2 ++\n src/libcamera/media_device.cpp | 25 ++++++++++++++++++++++-\n 2 files changed, 26 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..65080a4afdca 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,27 @@ 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 as defined by the\n+ * MEDIA_ENT_F_* macros of the Media Controller API.\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": [ "v3", "1/4" ] }