Show a patch.

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

{
    "id": 297,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/297/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/297/",
    "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": "<20190121153005.19110-2-niklas.soderlund@ragnatech.se>",
    "date": "2019-01-21T15:30:04",
    "name": "[libcamera-devel,1/2] libcamera: media_device: expose media graph model name",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "4fa9c6527f1f2e45fd82f0504dc9732fe5976587",
    "submitter": {
        "id": 5,
        "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api",
        "name": "Niklas Söderlund",
        "email": "niklas.soderlund@ragnatech.se"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/297/mbox/",
    "series": [
        {
            "id": 103,
            "url": "https://patchwork.libcamera.org/api/1.1/series/103/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=103",
            "date": "2019-01-21T15:30:04",
            "name": "libcamera: add basic uvcvideo pipeline handler",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/103/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/297/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/297/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<niklas.soderlund@ragnatech.se>",
        "Received": [
            "from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ACEE060C78\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Jan 2019 16:30:45 +0100 (CET)",
            "from bismarck.berto.se (unknown [89.233.230.99])\n\tby bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid 82bee41e-1d91-11e9-9adf-005056917a89;\n\tMon, 21 Jan 2019 16:30:41 +0100 (CET)"
        ],
        "X-Halon-ID": "82bee41e-1d91-11e9-9adf-005056917a89",
        "Authorized-sender": "niklas@soderlund.pp.se",
        "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 21 Jan 2019 16:30:04 +0100",
        "Message-Id": "<20190121153005.19110-2-niklas.soderlund@ragnatech.se>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190121153005.19110-1-niklas.soderlund@ragnatech.se>",
        "References": "<20190121153005.19110-1-niklas.soderlund@ragnatech.se>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 1/2] libcamera: media_device: expose media\n\tgraph model 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": "Mon, 21 Jan 2019 15:30:46 -0000"
    },
    "content": "Pipeline handlers such as the upcoming ucvideo handler needs the model\nname to properly name the Camera object it creates. Store the model name\nwhen querying the media device info and handle it in a similar fashion\nas the driver name which is already retrieved.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/include/media_device.h | 2 ++\n src/libcamera/media_device.cpp       | 7 +++++++\n 2 files changed, 9 insertions(+)",
    "diff": "diff --git a/src/libcamera/include/media_device.h b/src/libcamera/include/media_device.h\nindex a8dec0d3347bd5fc..d96b8ec718427011 100644\n--- a/src/libcamera/include/media_device.h\n+++ b/src/libcamera/include/media_device.h\n@@ -36,6 +36,7 @@ public:\n \n \tconst std::string driver() const { return driver_; }\n \tconst std::string devnode() const { return devnode_; }\n+\tconst std::string model() const { return model_; }\n \n \tconst std::vector<MediaEntity *> &entities() const { return entities_; }\n \tMediaEntity *getEntityByName(const std::string &name) const;\n@@ -50,6 +51,7 @@ public:\n private:\n \tstd::string driver_;\n \tstd::string devnode_;\n+\tstd::string model_;\n \tint fd_;\n \tbool valid_;\n \tbool acquired_;\ndiff --git a/src/libcamera/media_device.cpp b/src/libcamera/media_device.cpp\nindex a346296bc38e8f3d..b315e4f383b3bbb1 100644\n--- a/src/libcamera/media_device.cpp\n+++ b/src/libcamera/media_device.cpp\n@@ -162,6 +162,7 @@ int MediaDevice::open()\n \t}\n \n \tdriver_ = info.driver;\n+\tmodel_ = info.model;\n \n \treturn 0;\n }\n@@ -285,6 +286,12 @@ int MediaDevice::populate()\n  * \\return The MediaDevice devnode path\n  */\n \n+/**\n+ * \\fn MediaDevice::model()\n+ * \\brief Retrieve the media device model name\n+ * \\return The MediaDevice model name\n+ */\n+\n /**\n  * \\fn MediaDevice::entities()\n  * \\brief Retrieve the list of entities in the media graph\n",
    "prefixes": [
        "libcamera-devel",
        "1/2"
    ]
}