Show a patch.

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

{
    "id": 21169,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/21169/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/21169/",
    "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": "<20240906063444.32772-2-umang.jain@ideasonboard.com>",
    "date": "2024-09-06T06:34:41",
    "name": "[v7,1/4] libcamera: converter: Add interface for feature flags",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "4fbb105a2700f364b803570974086418ee09571b",
    "submitter": {
        "id": 86,
        "url": "https://patchwork.libcamera.org/api/1.1/people/86/?format=api",
        "name": "Umang Jain",
        "email": "umang.jain@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/21169/mbox/",
    "series": [
        {
            "id": 4565,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4565/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4565",
            "date": "2024-09-06T06:34:40",
            "name": "libcamera: rkisp1: Plumb the ConverterDW100 converter",
            "version": 7,
            "mbox": "https://patchwork.libcamera.org/series/4565/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/21169/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/21169/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 72EBAC324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  6 Sep 2024 06:35:01 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 49271634EB;\n\tFri,  6 Sep 2024 08:35:00 +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 42B91634CB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Sep 2024 08:34:56 +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 99273EF3;\n\tFri,  6 Sep 2024 08:33:41 +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=\"CFJgk0KS\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1725604422;\n\tbh=S99GqCK6+UJwt8YdATcB/WOR56/UU/5GwdyfW01ZR4o=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=CFJgk0KSwBRu7/xpJdc7I7ROkkuie6OUdOW72Ucbvqsvh6SeId7EOlbyT18uOsfix\n\tJ9V4V6sKLaP4W8LS2R6UlT11wjXWx+NXWHTIcNcUkMXgSURHmierEV9wyL8pRroi22\n\tU0x64cUCEgke2MesoSgpzrCS1cUe8Bp6gIa8ZSFw=",
        "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>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "Subject": "[PATCH v7 1/4] libcamera: converter: Add interface for feature flags",
        "Date": "Fri,  6 Sep 2024 12:04:41 +0530",
        "Message-ID": "<20240906063444.32772-2-umang.jain@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.45.0",
        "In-Reply-To": "<20240906063444.32772-1-umang.jain@ideasonboard.com>",
        "References": "<20240906063444.32772-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>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/internal/converter.h        | 14 +++++++++-\n src/libcamera/converter.cpp                   | 27 ++++++++++++++++++-\n .../converter/converter_v4l2_m2m.cpp          |  4 +++\n 3 files changed, 43 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/include/libcamera/internal/converter.h b/include/libcamera/internal/converter.h\nindex b51563d7..6623de4d 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,6 +68,11 @@ public:\n \n \tconst std::string &deviceNode() const { return deviceNode_; }\n \n+\tFeatures features() const { return features_; }\n+\n+protected:\n+\tFeatures features_;\n+\n private:\n \tstd::string deviceNode_;\n };\ndiff --git a/src/libcamera/converter.cpp b/src/libcamera/converter.cpp\nindex 8237998f..d7bb7273 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@@ -157,12 +171,23 @@ Converter::~Converter()\n  * \\brief A signal emitted on each frame buffer completion of the output queue\n  */\n \n+/**\n+ * \\var Converter::features_\n+ * \\brief Stores the features supported by the converter\n+ */\n+\n /**\n  * \\fn Converter::deviceNode()\n  * \\brief The converter device node attribute accessor\n  * \\return The converter device node string\n  */\n \n+/**\n+ * \\fn Converter::features()\n+ * \\brief Retrieve the features supported 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 e4f656da..4f3e8ce4 100644\n--- a/src/libcamera/converter/converter_v4l2_m2m.cpp\n+++ b/src/libcamera/converter/converter_v4l2_m2m.cpp\n@@ -446,6 +446,10 @@ int V4L2M2MConverter::queueBuffers(FrameBuffer *input,\n \treturn 0;\n }\n \n+/*\n+ * \\todo: This should be extended to include Feature::Flag to denote\n+ * what each converter supports feature-wise.\n+ */\n static std::initializer_list<std::string> compatibles = {\n \t\"mtk-mdp\",\n \t\"pxp\",\n",
    "prefixes": [
        "v7",
        "1/4"
    ]
}