Show a patch.

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

{
    "id": 3961,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/3961/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/3961/",
    "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": "<20200606080755.14408-1-paul.elder@ideasonboard.com>",
    "date": "2020-06-06T08:07:55",
    "name": "[libcamera-devel] v4l2: v4l2_camera_proxy: Support MJPEG",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "64bff3b1dd70f5cf4fc1276643303ef2350a7f0f",
    "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/3961/mbox/",
    "series": [
        {
            "id": 963,
            "url": "https://patchwork.libcamera.org/api/1.1/series/963/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=963",
            "date": "2020-06-06T08:07:55",
            "name": "[libcamera-devel] v4l2: v4l2_camera_proxy: Support MJPEG",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/963/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/3961/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/3961/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<paul.elder@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7FE07600F7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  6 Jun 2020 10:08:05 +0200 (CEST)",
            "from emerald.amanokami.net (fs76eef344.knge213.ap.nuro.jp\n\t[118.238.243.68])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1736127C;\n\tSat,  6 Jun 2020 10:08:03 +0200 (CEST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"JMvh5p4j\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1591430885;\n\tbh=gs+XU8cJBC+wom9GRCrZMypNIwVsHHMwbXHiu6qZKNg=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=JMvh5p4jnWAoAJABaSmLEHXc0ZxJWatrx0FCNQbrNci4d/Wq2osCjmUVkSbbT9RoZ\n\tjRXHtyxfVErsgfYSFmEYYZ5VRKHWW/rTd/+zsyx/MuJFBsC6e0rpS1QWtnHdhVwPza\n\t/eGQ8U3qSs1ABfKjsDHBElDtZrHI2O2Mg7ciJpys=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sat,  6 Jun 2020 17:07:55 +0900",
        "Message-Id": "<20200606080755.14408-1-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH] v4l2: v4l2_camera_proxy: Support MJPEG",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "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": "Sat, 06 Jun 2020 08:08:05 -0000"
    },
    "content": "Add an entry for MJPEG in V4L2CameraProxy's PixelFormatInfo list to\nallow proper calculation of sizeimage for MJPEG, such that the\nparameters to mmap can align properly instead of failing. This allows\nMJPEG to be used in the V4L2 compatibility layer.\n\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/v4l2/v4l2_camera_proxy.cpp | 8 +++++---\n 1 file changed, 5 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\nindex 059f3cbe..e4511207 100644\n--- a/src/v4l2/v4l2_camera_proxy.cpp\n+++ b/src/v4l2/v4l2_camera_proxy.cpp\n@@ -358,8 +358,8 @@ int V4L2CameraProxy::vidioc_reqbufs(struct v4l2_requestbuffers *arg)\n \t * don't support streaming mmap. Since we don't support readwrite and\n \t * userptr either, the application will get confused and think that\n \t * we don't support anything.\n-\t * On the other hand, if a format has a zero sizeimage (eg. MJPEG),\n-\t * we'll get a floating point exception when we try to stream it.\n+\t * On the other hand, if a format has a zero sizeimage we'll get a\n+\t * floating point exception when we try to stream it.\n \t */\n \tif (sizeimage_ == 0)\n \t\tLOG(V4L2Compat, Warning)\n@@ -556,7 +556,7 @@ struct PixelFormatInfo {\n \n namespace {\n \n-static const std::array<PixelFormatInfo, 13> pixelFormatInfo = {{\n+static const std::array<PixelFormatInfo, 14> pixelFormatInfo = {{\n \t/* RGB formats. */\n \t{ PixelFormat(DRM_FORMAT_RGB888),\tV4L2_PIX_FMT_BGR24,\t1, {{ { 24, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n \t{ PixelFormat(DRM_FORMAT_BGR888),\tV4L2_PIX_FMT_RGB24,\t1, {{ { 24, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n@@ -573,6 +573,8 @@ static const std::array<PixelFormatInfo, 13> pixelFormatInfo = {{\n \t{ PixelFormat(DRM_FORMAT_NV61),\t\tV4L2_PIX_FMT_NV61,\t2, {{ {  8, 1, 1 }, { 16, 2, 1 }, {  0, 0, 0 } }} },\n \t{ PixelFormat(DRM_FORMAT_NV24),\t\tV4L2_PIX_FMT_NV24,\t2, {{ {  8, 1, 1 }, { 16, 2, 1 }, {  0, 0, 0 } }} },\n \t{ PixelFormat(DRM_FORMAT_NV42),\t\tV4L2_PIX_FMT_NV42,\t2, {{ {  8, 1, 1 }, { 16, 1, 1 }, {  0, 0, 0 } }} },\n+\t/* Compressed formats. */\n+\t{ PixelFormat(DRM_FORMAT_MJPEG),\tV4L2_PIX_FMT_MJPEG,\t1, {{ { 16, 1, 1 }, {  0, 0, 0 }, {  0, 0, 0 } }} },\n }};\n \n } /* namespace */\n",
    "prefixes": [
        "libcamera-devel"
    ]
}