Show a patch.

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

{
    "id": 476,
    "url": "https://patchwork.libcamera.org/api/patches/476/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/476/",
    "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": "<20190201154248.15006-5-jacopo@jmondi.org>",
    "date": "2019-02-01T15:42:45",
    "name": "[libcamera-devel,4/7] libcamera: v4l2_device: Rename plane format fields",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "38549ec965fff5e26e1ec690c3b67dd216d1cf3b",
    "submitter": {
        "id": 3,
        "url": "https://patchwork.libcamera.org/api/people/3/?format=api",
        "name": "Jacopo Mondi",
        "email": "jacopo@jmondi.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/476/mbox/",
    "series": [
        {
            "id": 162,
            "url": "https://patchwork.libcamera.org/api/series/162/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=162",
            "date": "2019-02-01T15:42:41",
            "name": "libcamera: v4l2_device: Address comments for s/g_fmt",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/162/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/476/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/476/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 20F3660DB5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  1 Feb 2019 16:42:41 +0100 (CET)",
            "from uno.localdomain (unknown [91.183.179.147])\n\t(Authenticated sender: jacopo@jmondi.org)\n\tby relay8-d.mail.gandi.net (Postfix) with ESMTPSA id D4C531BF219;\n\tFri,  1 Feb 2019 15:42:40 +0000 (UTC)"
        ],
        "X-Originating-IP": "91.183.179.147",
        "From": "Jacopo Mondi <jacopo@jmondi.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  1 Feb 2019 16:42:45 +0100",
        "Message-Id": "<20190201154248.15006-5-jacopo@jmondi.org>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190201154248.15006-1-jacopo@jmondi.org>",
        "References": "<20190201154248.15006-1-jacopo@jmondi.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 4/7] libcamera: v4l2_device: Rename plane\n\tformat fields",
        "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": "Fri, 01 Feb 2019 15:42:41 -0000"
    },
    "content": "Rename the number of valid plane formats to 'planesCount' and the actual\nper-plane size information array to 'planes'.\n\nSigned-off-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/libcamera/include/v4l2_device.h |  4 ++--\n src/libcamera/v4l2_device.cpp       | 29 ++++++++++++++---------------\n 2 files changed, 16 insertions(+), 17 deletions(-)",
    "diff": "diff --git a/src/libcamera/include/v4l2_device.h b/src/libcamera/include/v4l2_device.h\nindex e65a540..4ff48fb 100644\n--- a/src/libcamera/include/v4l2_device.h\n+++ b/src/libcamera/include/v4l2_device.h\n@@ -63,8 +63,8 @@ public:\n \tstruct {\n \t\tuint32_t size;\n \t\tuint32_t bpl;\n-\t} planesFmt[3];\n-\tunsigned int planes;\n+\t} planes[3];\n+\tunsigned int planesCount;\n };\n \n class MediaEntity;\ndiff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 8cf566c..0d4d60f 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -92,7 +92,7 @@ LOG_DEFINE_CATEGORY(V4L2)\n  *\n  * Formats defined as 'single planar' by the V4L2 APIs are represented with\n  * V4L2DeviceFormat instances with a single plane\n- * (V4L2DeviceFormat::planes = 1). Semi-planar and multiplanar formats use\n+ * (V4L2DeviceFormat::planesCount = 1). Semi-planar and multiplanar formats use\n  * 2 and 3 planes respectively.\n  *\n  * V4L2DeviceFormat defines the exchange format between components that\n@@ -120,19 +120,18 @@ LOG_DEFINE_CATEGORY(V4L2)\n  */\n \n /**\n- * \\var V4L2DeviceFormat::planesFmt\n+ * \\var V4L2DeviceFormat::planes\n  * \\brief The per-plane size information\n  *\n  * Images are stored in memory in one or more data planes. Each data plane\n  * has a specific size and line length, which could differ from the image\n  * visible sizes to accommodate line or plane padding data.\n  *\n- * Only the first V4L2DeviceFormat::planes entries are considered valid.\n- *\n+ * Only the first \\ref planesCount entries are considered valid.\n  */\n \n /**\n- * \\var V4L2DeviceFormat::planes\n+ * \\var V4L2DeviceFormat::planesCount\n  * \\brief The number of valid data planes\n  */\n \n@@ -315,9 +314,9 @@ int V4L2Device::getFormatSingleplane(V4L2DeviceFormat *format)\n \tformat->width = pix->width;\n \tformat->height = pix->height;\n \tformat->fourcc = pix->pixelformat;\n-\tformat->planes = 1;\n-\tformat->planesFmt[0].bpl = pix->bytesperline;\n-\tformat->planesFmt[0].size = pix->sizeimage;\n+\tformat->planesCount = 1;\n+\tformat->planes[0].bpl = pix->bytesperline;\n+\tformat->planes[0].size = pix->sizeimage;\n \n \treturn 0;\n }\n@@ -360,11 +359,11 @@ int V4L2Device::getFormatMultiplane(V4L2DeviceFormat *format)\n \tformat->width = pix->width;\n \tformat->height = pix->height;\n \tformat->fourcc = pix->pixelformat;\n-\tformat->planes = pix->num_planes;\n+\tformat->planesCount = pix->num_planes;\n \n-\tfor (unsigned int i = 0; i < format->planes; ++i) {\n-\t\tformat->planesFmt[i].bpl = pix->plane_fmt[i].bytesperline;\n-\t\tformat->planesFmt[i].size = pix->plane_fmt[i].sizeimage;\n+\tfor (unsigned int i = 0; i < format->planesCount; ++i) {\n+\t\tformat->planes[i].bpl = pix->plane_fmt[i].bytesperline;\n+\t\tformat->planes[i].size = pix->plane_fmt[i].sizeimage;\n \t}\n \n \treturn 0;\n@@ -380,11 +379,11 @@ int V4L2Device::setFormatMultiplane(V4L2DeviceFormat *format)\n \tpix->width = format->width;\n \tpix->height = format->height;\n \tpix->pixelformat = format->fourcc;\n-\tpix->num_planes = format->planes;\n+\tpix->num_planes = format->planesCount;\n \n \tfor (unsigned int i = 0; i < pix->num_planes; ++i) {\n-\t\tpix->plane_fmt[i].bytesperline = format->planesFmt[i].bpl;\n-\t\tpix->plane_fmt[i].sizeimage = format->planesFmt[i].size;\n+\t\tpix->plane_fmt[i].bytesperline = format->planes[i].bpl;\n+\t\tpix->plane_fmt[i].sizeimage = format->planes[i].size;\n \t}\n \n \tret = ioctl(fd_, VIDIOC_S_FMT, &v4l2Format);\n",
    "prefixes": [
        "libcamera-devel",
        "4/7"
    ]
}