Patch Detail
Show a patch.
GET /api/patches/20643/?format=api
{ "id": 20643, "url": "https://patchwork.libcamera.org/api/patches/20643/?format=api", "web_url": "https://patchwork.libcamera.org/patch/20643/", "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": "<20240709202151.152289-2-umang.jain@ideasonboard.com>", "date": "2024-07-09T20:21:47", "name": "[v5,1/5] libcamera: converter: Add interface for feature flags", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "47d049c8692694c682c1d93b974a341e3f000809", "submitter": { "id": 86, "url": "https://patchwork.libcamera.org/api/people/86/?format=api", "name": "Umang Jain", "email": "umang.jain@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/20643/mbox/", "series": [ { "id": 4450, "url": "https://patchwork.libcamera.org/api/series/4450/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4450", "date": "2024-07-09T20:21:46", "name": "libcamera: rkisp1: Plumb the ConverterDW100 converter", "version": 5, "mbox": "https://patchwork.libcamera.org/series/4450/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/20643/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/20643/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 7E25FBDB1C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 9 Jul 2024 20:22:05 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 542AD63374;\n\tTue, 9 Jul 2024 22:22:03 +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 1A750619B9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 9 Jul 2024 22:22:00 +0200 (CEST)", "from fedora.local (unknown\n\t[IPv6:2405:201:2015:f873:c173:4b:4a04:3a21])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DD07D16D6;\n\tTue, 9 Jul 2024 22:21:26 +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=\"qPoChpBm\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1720556487;\n\tbh=BPKr1F4y983JHY2Sb7c4Kyq1guUN2+5QhNvwdihWwfY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=qPoChpBm2tcIWTf+LMyMtJ/bnB/pMKDj7i3XAKV4CIB3vC++K1F81dJmQFTUWxPiG\n\t6y7MpB+48N4L9B0qT7nK9/G+0K5zxr3bAzu1fJ6l6mJuKSJ5l3Lniz+2K8nl2v7oTR\n\t6wMO6O2cNgA26EyCiei4rmKoONSTuxunop9Mo3Ew=", "From": "Umang Jain <umang.jain@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Umang Jain <umang.jain@ideasonboard.com>", "Subject": "[PATCH v5 1/5] libcamera: converter: Add interface for feature flags", "Date": "Wed, 10 Jul 2024 01:51:47 +0530", "Message-ID": "<20240709202151.152289-2-umang.jain@ideasonboard.com>", "X-Mailer": "git-send-email 2.45.2", "In-Reply-To": "<20240709202151.152289-1-umang.jain@ideasonboard.com>", "References": "<20240709202151.152289-1-umang.jain@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": "This patch intends to extend the converter interface to have feature\nflags, which enables each converter to expose the set of features\nit supports.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\n---\n include/libcamera/internal/converter.h | 13 ++++++++++-\n .../internal/converter/converter_v4l2_m2m.h | 2 +-\n src/libcamera/converter.cpp | 22 ++++++++++++++++++-\n .../converter/converter_v4l2_m2m.cpp | 5 +++--\n 4 files changed, 37 insertions(+), 5 deletions(-)", "diff": "diff --git a/include/libcamera/internal/converter.h b/include/libcamera/internal/converter.h\nindex b51563d7..7e478356 100644\n--- a/include/libcamera/internal/converter.h\n+++ b/include/libcamera/internal/converter.h\n@@ -17,6 +17,7 @@\n #include <vector>\n \n #include <libcamera/base/class.h>\n+#include <libcamera/base/flags.h>\n #include <libcamera/base/signal.h>\n \n #include <libcamera/geometry.h>\n@@ -32,7 +33,13 @@ struct StreamConfiguration;\n class Converter\n {\n public:\n-\tConverter(MediaDevice *media);\n+\tenum class Feature {\n+\t\tNone = 0,\n+\t};\n+\n+\tusing Features = Flags<Feature>;\n+\n+\tConverter(MediaDevice *media, Features features = Feature::None);\n \tvirtual ~Converter();\n \n \tvirtual int loadConfiguration(const std::string &filename) = 0;\n@@ -61,8 +68,12 @@ public:\n \n \tconst std::string &deviceNode() const { return deviceNode_; }\n \n+\tFeatures getFeatures() const { return features_; }\n+\n private:\n \tstd::string deviceNode_;\n+\n+\tFeatures features_;\n };\n \n class ConverterFactoryBase\ndiff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h\nindex b9e59899..91701dbe 100644\n--- a/include/libcamera/internal/converter/converter_v4l2_m2m.h\n+++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n@@ -35,7 +35,7 @@ class V4L2M2MDevice;\n class V4L2M2MConverter : public Converter\n {\n public:\n-\tV4L2M2MConverter(MediaDevice *media);\n+\tV4L2M2MConverter(MediaDevice *media, Features features = Feature::None);\n \n \tint loadConfiguration([[maybe_unused]] const std::string &filename) { return 0; }\n \tbool isValid() const { return m2m_ != nullptr; }\ndiff --git a/src/libcamera/converter.cpp b/src/libcamera/converter.cpp\nindex 2ab46133..2c3da6d4 100644\n--- a/src/libcamera/converter.cpp\n+++ b/src/libcamera/converter.cpp\n@@ -34,14 +34,27 @@ LOG_DEFINE_CATEGORY(Converter)\n * parameters from the same input stream.\n */\n \n+/**\n+ * \\enum Converter::Feature\n+ * \\brief Specify the features supported by the converter\n+ * \\var Converter::Feature::None\n+ * \\brief No extra features supported by the converter\n+ */\n+\n+/**\n+ * \\typedef Converter::Features\n+ * \\brief A bitwise combination of features supported by the converter\n+ */\n+\n /**\n * \\brief Construct a Converter instance\n * \\param[in] media The media device implementing the converter\n+ * \\param[in] features Features flags representing supported features\n *\n * This searches for the entity implementing the data streaming function in the\n * media graph entities and use its device node as the converter device node.\n */\n-Converter::Converter(MediaDevice *media)\n+Converter::Converter(MediaDevice *media, Features features)\n {\n \tconst std::vector<MediaEntity *> &entities = media->entities();\n \tauto it = std::find_if(entities.begin(), entities.end(),\n@@ -56,6 +69,7 @@ Converter::Converter(MediaDevice *media)\n \t}\n \n \tdeviceNode_ = (*it)->deviceNode();\n+\tfeatures_ = features;\n }\n \n Converter::~Converter()\n@@ -163,6 +177,12 @@ Converter::~Converter()\n * \\return The converter device node string\n */\n \n+/**\n+ * \\fn Converter::getFeatures()\n+ * \\brief Gets the supported features by the converter\n+ * \\return The converter Features flag\n+ */\n+\n /**\n * \\class ConverterFactoryBase\n * \\brief Base class for converter factories\ndiff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp\nindex 2e77872e..4aeb7dd9 100644\n--- a/src/libcamera/converter/converter_v4l2_m2m.cpp\n+++ b/src/libcamera/converter/converter_v4l2_m2m.cpp\n@@ -191,10 +191,11 @@ void V4L2M2MConverter::V4L2M2MStream::captureBufferReady(FrameBuffer *buffer)\n * \\fn V4L2M2MConverter::V4L2M2MConverter\n * \\brief Construct a V4L2M2MConverter instance\n * \\param[in] media The media device implementing the converter\n+ * \\param[in] features Features flags representing supported features\n */\n \n-V4L2M2MConverter::V4L2M2MConverter(MediaDevice *media)\n-\t: Converter(media)\n+V4L2M2MConverter::V4L2M2MConverter(MediaDevice *media, Features features)\n+\t: Converter(media, features)\n {\n \tif (deviceNode().empty())\n \t\treturn;\n", "prefixes": [ "v5", "1/5" ] }