Show a patch.

GET /api/patches/20431/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 20431,
    "url": "https://patchwork.libcamera.org/api/patches/20431/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/20431/",
    "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": "<20240627134656.582462-2-umang.jain@ideasonboard.com>",
    "date": "2024-06-27T13:46:52",
    "name": "[v4,1/5] libcamera: converter: Add interface for feature flags",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "96f53fbf428d75197d3f327364bac091af89b26d",
    "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/20431/mbox/",
    "series": [
        {
            "id": 4425,
            "url": "https://patchwork.libcamera.org/api/series/4425/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4425",
            "date": "2024-06-27T13:46:51",
            "name": "libcamera: rkisp1: Plumb the ConverterDW100 converter",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/4425/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/20431/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/20431/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 36CA8BDB1D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 27 Jun 2024 13:47:08 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CC27362E20;\n\tThu, 27 Jun 2024 15:47:07 +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 236A862C95\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Jun 2024 15:47:04 +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 8C46C7E0;\n\tThu, 27 Jun 2024 15:46:39 +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=\"r8e1ZNJt\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1719496000;\n\tbh=kiCxZt+YqR+hG9uR+z4YXAuDO2nPQ/QHvxVq3kaAD2Q=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=r8e1ZNJtVaeoJxg/hCRcSoh5YB94j/faliQsjnxBFPSHDxrQQA9ZjW7gXgP4eAF2o\n\t26+1OcczuA7lEg6MMC1cYRqdsvS2ujjDTVqzrSkw17evwWYcUSsp99aMc8rkEbOn+B\n\tWBrB/HrRkxoBVn2biUACJ6m29UTIackmR5ATs1zs=",
        "From": "Umang Jain <umang.jain@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Umang Jain <umang.jain@ideasonboard.com>",
        "Subject": "[PATCH v4 1/5] libcamera: converter: Add interface for feature flags",
        "Date": "Thu, 27 Jun 2024 19:16:52 +0530",
        "Message-ID": "<20240627134656.582462-2-umang.jain@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.44.0",
        "In-Reply-To": "<20240627134656.582462-1-umang.jain@ideasonboard.com>",
        "References": "<20240627134656.582462-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..15bc7dca 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 = (1 << 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 c5e38937..2dc7d984 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": [
        "v4",
        "1/5"
    ]
}