Patch Detail
Show a patch.
GET /api/patches/20710/?format=api
{ "id": 20710, "url": "https://patchwork.libcamera.org/api/patches/20710/?format=api", "web_url": "https://patchwork.libcamera.org/patch/20710/", "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": "<20240726114715.226468-2-umang.jain@ideasonboard.com>", "date": "2024-07-26T11:47:11", "name": "[v6,1/5] libcamera: converter: Add interface for feature flags", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "4b38ebb8cfa1ef7c08f4e98d09aac9c25ae711b7", "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/20710/mbox/", "series": [ { "id": 4462, "url": "https://patchwork.libcamera.org/api/series/4462/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4462", "date": "2024-07-26T11:47:10", "name": "libcamera: rkisp1: Plumb the ConverterDW100 converter", "version": 6, "mbox": "https://patchwork.libcamera.org/series/4462/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/20710/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/20710/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 3B0BDBDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 26 Jul 2024 11:47:32 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C6D2C63373;\n\tFri, 26 Jul 2024 13:47:31 +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 12E6163369\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 26 Jul 2024 13:47:28 +0200 (CEST)", "from localhost.localdomain (unknown\n\t[IPv6:2405:201:2015:f873:55f8:639e:8e9f:12ec])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B3D1383F;\n\tFri, 26 Jul 2024 13:46:42 +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=\"Gl9HeMPr\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1721994403;\n\tbh=rc0UIFtaBBkpr1PAft53WyM0kK/fASh5evObxVEuVMA=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=Gl9HeMPrzUnDXlGXPlI7QwbliUioy8DSqjgru3yyF6qw+WSFFatUgoKV2DV6AYoOZ\n\tpsByjmZm+00j0/ZTpRMWfNJz341b3CYV+ka5XFVOgVMW4+ZLV/J9Dn68NsFrxYi5np\n\tJ7j/mrRK/Xey70d6WS85sx2Wy4rXl8nQZ3onJnXo=", "From": "Umang Jain <umang.jain@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Umang Jain <umang.jain@ideasonboard.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>", "Subject": "[PATCH v6 1/5] libcamera: converter: Add interface for feature flags", "Date": "Fri, 26 Jul 2024 17:17:11 +0530", "Message-ID": "<20240726114715.226468-2-umang.jain@ideasonboard.com>", "X-Mailer": "git-send-email 2.45.0", "In-Reply-To": "<20240726114715.226468-1-umang.jain@ideasonboard.com>", "References": "<20240726114715.226468-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>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@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..652ff519 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 features() 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..e2dbf5e0 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::features()\n+ * \\brief Gets the supported features by the converter\n+ * \\return The converter Features flags\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": [ "v6", "1/5" ] }