Show a patch.

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

{
    "id": 1350,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/1350/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1350/",
    "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": "<20190605005316.4835-3-paul.elder@ideasonboard.com>",
    "date": "2019-06-05T00:53:08",
    "name": "[libcamera-devel,v3,02/10] libcamera: pipeline: add name",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "4340b3cf3282e70b74ff7983fdb6785858b0f9d0",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/1350/mbox/",
    "series": [
        {
            "id": 336,
            "url": "https://patchwork.libcamera.org/api/1.1/series/336/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=336",
            "date": "2019-06-05T00:53:06",
            "name": "Add IPAManager and IPAInterface",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/336/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1350/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1350/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<paul.elder@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DF4D964715\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Jun 2019 02:53:28 +0200 (CEST)",
            "from localhost.localdomain (unknown [96.44.9.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3A4012D1;\n\tWed,  5 Jun 2019 02:53:28 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1559696008;\n\tbh=mkRO0aFvSt525vcU6vZxJM/oAHUmGZr2juS9gswQcck=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=OxyipHXunKP+98SFhuyARWtEfhUNmyil6ZjbpSqQt9h5TY97gqG6pa3v+cWdtoqjs\n\taryd3BOS4E7fSRiXdT1aXTH66bddL23LG4NW32Bdo8xohDob1k9cE5GlS1lc+MZFZF\n\tIC6QveVkUBFYTc+qbPUW9KUcg9UiTpmgZoBgE5e8=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue,  4 Jun 2019 20:53:08 -0400",
        "Message-Id": "<20190605005316.4835-3-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190605005316.4835-1-paul.elder@ideasonboard.com>",
        "References": "<20190605005316.4835-1-paul.elder@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 02/10] libcamera: pipeline: add name",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.23",
        "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>",
        "X-List-Received-Date": "Wed, 05 Jun 2019 00:53:29 -0000"
    },
    "content": "In order to match an IPA module with a pipeline handler, the pipeline\nhandler must have a name. Add a name attribute and getter to\nPipelineHandler such that it can automatically be defined by\nREGISTER_PIPELINE_HANDLER.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\nChanges in v3:\n- remove version completely from the pipeline hander's side, as the\n  pipeline handler will now specify its acceptable version range when it\n  asks the IPAManager for an IPAInterface (so IPAModules still need a\n  pipeline version)\n- nicer, less intrusive way of setting the pipeline names by making the\n  pipeline handler factory a friend class of pipeline handler\n\nChanges in v2:\n- make the name and version getters into methods of the base PipelineHandler\n  class, so that the specialized pipeline handlers no longer have to\n  specify overriding\n- add PIPELINE_VERSION macro to create one version number from major and\n  minor pair\n\n src/libcamera/include/pipeline_handler.h | 14 +++++++++++++-\n src/libcamera/pipeline_handler.cpp       | 17 +++++++++++++++++\n 2 files changed, 30 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\nindex 7da6df1..84307e4 100644\n--- a/src/libcamera/include/pipeline_handler.h\n+++ b/src/libcamera/include/pipeline_handler.h\n@@ -77,6 +77,8 @@ public:\n \tbool completeBuffer(Camera *camera, Request *request, Buffer *buffer);\n \tvoid completeRequest(Camera *camera, Request *request);\n \n+\tconst char *name() const { return name_; }\n+\n protected:\n \tvoid registerCamera(std::shared_ptr<Camera> camera,\n \t\t\t    std::unique_ptr<CameraData> data);\n@@ -93,6 +95,10 @@ private:\n \tstd::vector<std::shared_ptr<MediaDevice>> mediaDevices_;\n \tstd::vector<std::weak_ptr<Camera>> cameras_;\n \tstd::map<const Camera *, std::unique_ptr<CameraData>> cameraData_;\n+\n+\tconst char *name_;\n+\n+\tfriend class PipelineHandlerFactory;\n };\n \n class PipelineHandlerFactory\n@@ -108,6 +114,9 @@ public:\n \tstatic void registerType(PipelineHandlerFactory *factory);\n \tstatic std::vector<PipelineHandlerFactory *> &factories();\n \n+protected:\n+\tvoid setInfo(PipelineHandler *handler, const char *name);\n+\n private:\n \tstd::string name_;\n };\n@@ -119,7 +128,10 @@ public:\t\t\t\t\t\t\t\t\t\\\n \thandler##Factory() : PipelineHandlerFactory(#handler) {}\t\\\n \tstd::shared_ptr<PipelineHandler> create(CameraManager *manager)\t\\\n \t{\t\t\t\t\t\t\t\t\\\n-\t\treturn std::make_shared<handler>(manager);\t\t\\\n+\t\tstd::shared_ptr<handler> h =\t\t\t\t\\\n+\t\t\tstd::make_shared<handler>(manager);\t\t\\\n+\t\tsetInfo(h.get(), #handler);\t\t\t\t\\\n+\t\treturn h;\t\t\t\t\t\t\\\n \t}\t\t\t\t\t\t\t\t\\\n };\t\t\t\t\t\t\t\t\t\\\n static handler##Factory global_##handler##Factory;\ndiff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex dd56907..800931d 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -505,6 +505,12 @@ CameraData *PipelineHandler::cameraData(const Camera *camera)\n  * constant for the whole lifetime of the pipeline handler.\n  */\n \n+/**\n+ * \\fn PipelineHandler::name()\n+ * \\brief Retrieve the pipeline handler name\n+ * \\return The pipeline handler name\n+ */\n+\n /**\n  * \\class PipelineHandlerFactory\n  * \\brief Registration of PipelineHandler classes and creation of instances\n@@ -582,6 +588,17 @@ std::vector<PipelineHandlerFactory *> &PipelineHandlerFactory::factories()\n \treturn factories;\n }\n \n+/**\n+ * \\brief Set the information of a given pipeline handler\n+ * \\param[in] handler The handler whose info is to be set\n+ * \\param[in] name The name of the pipeline handler\n+ */\n+void PipelineHandlerFactory::setInfo(PipelineHandler *handler,\n+\t\t\t\t     const char *name)\n+{\n+\thandler->name_ = name;\n+}\n+\n /**\n  * \\def REGISTER_PIPELINE_HANDLER\n  * \\brief Register a pipeline handler with the pipeline handler factory\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "02/10"
    ]
}