Show a patch.

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

{
    "id": 368,
    "url": "https://patchwork.libcamera.org/api/patches/368/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/368/",
    "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": "<20190124113000.7142-3-jacopo@jmondi.org>",
    "date": "2019-01-24T11:30:00",
    "name": "[libcamera-devel,v2,2/2] libcamera: v4l2_device: Add stubs to set/get format",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "2be969cb4bc63efa214886b19a647fec22bc2943",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": {
        "id": 15,
        "url": "https://patchwork.libcamera.org/api/users/15/?format=api",
        "username": "jmondi",
        "first_name": "Jacopo",
        "last_name": "Mondi",
        "email": "jacopo@jmondi.org"
    },
    "mbox": "https://patchwork.libcamera.org/patch/368/mbox/",
    "series": [
        {
            "id": 126,
            "url": "https://patchwork.libcamera.org/api/series/126/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=126",
            "date": "2019-01-24T11:29:58",
            "name": "Add mplane support to V4L2 device",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/126/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/368/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/368/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<jacopo@jmondi.org>",
        "Received": [
            "from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net\n\t[217.70.183.196])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BCD4560C80\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 24 Jan 2019 12:29:52 +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 relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 5593FE0007;\n\tThu, 24 Jan 2019 11:29:52 +0000 (UTC)"
        ],
        "X-Originating-IP": "2.224.242.101",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 24 Jan 2019 12:30:00 +0100",
        "Message-Id": "<20190124113000.7142-3-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190124113000.7142-1-jacopo@jmondi.org>",
        "References": "<20190124113000.7142-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 2/2] libcamera: v4l2_device: Add stubs\n\tto set/get format",
        "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": "Thu, 24 Jan 2019 11:29:53 -0000"
    },
    "content": "Add function stubs for set/get format to V4L2Device.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/include/v4l2_device.h |  9 ++++++\n src/libcamera/v4l2_device.cpp       | 49 +++++++++++++++++++++++++++++\n 2 files changed, 58 insertions(+)",
    "diff": "diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\nindex 413bb7f..2da30d1 100644\n--- a/src/libcamera/include/v4l2_device.h\n+++ b/src/libcamera/include/v4l2_device.h\n@@ -72,10 +72,19 @@ public:\n \tconst char *deviceName() const { return caps_.card(); }\n \tconst char *busName() const { return caps_.bus_info(); }\n \n+\tint format();\n+\tint setFormat();\n+\n private:\n \tstd::string deviceNode_;\n \tint fd_;\n \tV4L2Capability caps_;\n+\n+\tint getFormatSingleplane();\n+\tint setFormatSingleplane();\n+\n+\tint getFormatMultiplane();\n+\tint setFormatMultiplane();\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 9cb504d..2ddb800 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -213,4 +213,53 @@ void V4L2Device::close()\n  * \\return The string containing the device location\n  */\n \n+/**\n+ * \\brief Retrieve the image format set on the V4L2 device\n+ *\n+ * TODO: define how the image format is encoded\n+ * FIXME: this function is a stub at the moment\n+ *\n+ * \\return 0 for success, a negative error code otherwise\n+ */\n+int V4L2Device::format()\n+{\n+\treturn caps_.isMultiplanar() ? getFormatMultiplane() :\n+\t\t\t\t       getFormatSingleplane();\n+}\n+\n+/**\n+ * \\brief Program an image format on the V4L2 device\n+ *\n+ * TODO: define how the image format is encoded\n+ * FIXME: this function is a stub at the moment\n+ *\n+ * \\return 0 for success, a negative error code otherwise\n+ */\n+int V4L2Device::setFormat()\n+{\n+\treturn caps_.isMultiplanar() ? setFormatMultiplane() :\n+\t\t\t\t       setFormatSingleplane();\n+}\n+\n+/* FIXME: these functions are stubs at the moment. */\n+int V4L2Device::getFormatSingleplane()\n+{\n+\treturn 0;\n+}\n+\n+int V4L2Device::setFormatSingleplane()\n+{\n+\treturn 0;\n+}\n+\n+int V4L2Device::getFormatMultiplane()\n+{\n+\treturn 0;\n+}\n+\n+int V4L2Device::setFormatMultiplane()\n+{\n+\treturn 0;\n+}\n+\n } /* namespace libcamera */\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "2/2"
    ]
}