Show a patch.

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

{
    "id": 304,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/304/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/304/",
    "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": "<20190121172705.19985-4-jacopo@jmondi.org>",
    "date": "2019-01-21T17:27:02",
    "name": "[libcamera-devel,3/6] libcamera: v4l2_device: Identify single/multiplane",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": false,
    "hash": "89bbbaa1c51148eaa5c22e54302b5e41e5529167",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/1.1/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/304/mbox/",
    "series": [
        {
            "id": 105,
            "url": "https://patchwork.libcamera.org/api/1.1/series/105/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=105",
            "date": "2019-01-21T17:26:59",
            "name": "libcamera: Augment V4L2 device",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/105/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/304/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/304/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<jacopo@jmondi.org>",
        "Received": [
            "from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net\n\t[217.70.183.201])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CBC7760C96\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 21 Jan 2019 18:27:04 +0100 (CET)",
            "from uno.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id 5F1631BF206;\n\tMon, 21 Jan 2019 17:27:04 +0000 (UTC)"
        ],
        "X-Originating-IP": "2.224.242.101",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 21 Jan 2019 18:27:02 +0100",
        "Message-Id": "<20190121172705.19985-4-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190121172705.19985-1-jacopo@jmondi.org>",
        "References": "<20190121172705.19985-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 3/6] libcamera: v4l2_device: Identify\n\tsingle/multiplane",
        "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 17:27:05 -0000"
    },
    "content": "Add functions to V4L2Capability to identify if a V4L2 device supports\nsingle or multiplane APIs.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/include/v4l2_device.h |  6 +++--\n src/libcamera/v4l2_device.cpp       | 37 +++++++++++++++++++++++++----\n 2 files changed, 37 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\nindex 2787847..0101a4b 100644\n--- a/src/libcamera/include/v4l2_device.h\n+++ b/src/libcamera/include/v4l2_device.h\n@@ -27,8 +27,10 @@ struct V4L2Capability final : v4l2_capability {\n \t\treturn reinterpret_cast<const char *>(v4l2_capability::bus_info);\n \t}\n \n-\tbool isCapture() const { return capabilities & V4L2_CAP_VIDEO_CAPTURE; }\n-\tbool isOutput() const { return capabilities & V4L2_CAP_VIDEO_OUTPUT; }\n+\tbool isSinglePlane() const;\n+\tbool isMultiPlane() const;\n+\tbool isCapture() const;\n+\tbool isOutput() const;\n \tbool hasStreaming() const { return capabilities & V4L2_CAP_STREAMING; }\n };\n \ndiff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex aef0996..7cd89d7 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -47,17 +47,46 @@ namespace libcamera {\n  * \\return The string containing the device location\n  */\n \n+\n+/**\n+ * \\brief Identify if the device implements V4L2 single plane APIs\n+ * \\return true if the device supports single plane APIs\n+ */\n+bool V4L2Capability::isSinglePlane() const\n+{\n+\treturn (capabilities & V4L2_CAP_VIDEO_CAPTURE) ||\n+\t       (capabilities & V4L2_CAP_VIDEO_OUTPUT);\n+}\n+\n+/**\n+ * \\brief Identify if the device implements V4L2 multiplanar APIs\n+ * \\return true if the device supports multiplanar APIs\n+ */\n+bool V4L2Capability::isMultiPlane() const\n+{\n+\treturn (capabilities & V4L2_CAP_VIDEO_CAPTURE_MPLANE) ||\n+\t       (capabilities & V4L2_CAP_VIDEO_OUTPUT_MPLANE);\n+}\n+\n /**\n- * \\fn bool V4L2Capability::isCapture()\n  * \\brief Identify if the device is capable of capturing video\n- * \\return True if the device can capture video frames\n+ * \\return true if the device can capture video frames\n  */\n+bool V4L2Capability::isCapture() const\n+{\n+\treturn (capabilities & V4L2_CAP_VIDEO_CAPTURE) ||\n+\t       (capabilities & V4L2_CAP_VIDEO_CAPTURE_MPLANE);\n+}\n \n /**\n- * \\fn bool V4L2Capability::isOutput()\n  * \\brief Identify if the device is capable of outputting video\n- * \\return True if the device can output video frames\n+ * \\return true if the device can capture video frames\n  */\n+bool V4L2Capability::isOutput() const\n+{\n+\treturn (capabilities & V4L2_CAP_VIDEO_OUTPUT) ||\n+\t       (capabilities & V4L2_CAP_VIDEO_OUTPUT_MPLANE);\n+}\n \n /**\n  * \\fn bool V4L2Capability::hasStreaming()\n",
    "prefixes": [
        "libcamera-devel",
        "3/6"
    ]
}