Show a patch.

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

{
    "id": 3985,
    "url": "https://patchwork.libcamera.org/api/patches/3985/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/3985/",
    "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": "<20200608080529.7727-1-paul.elder@ideasonboard.com>",
    "date": "2020-06-08T08:05:29",
    "name": "[libcamera-devel,v2] v4l2: v4l2_camera_proxy: Support MJPEG",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "a2e4219ecb5bf9b392a76d9fd5a3b42304ffd945",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/3985/mbox/",
    "series": [
        {
            "id": 972,
            "url": "https://patchwork.libcamera.org/api/series/972/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=972",
            "date": "2020-06-08T08:05:29",
            "name": "[libcamera-devel,v2] v4l2: v4l2_camera_proxy: Support MJPEG",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/972/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/3985/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/3985/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<paul.elder@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D73A3603C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  8 Jun 2020 10:05:41 +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 580C22C9;\n\tMon,  8 Jun 2020 10:05:40 +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=\"F5SZCXAA\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1591603541;\n\tbh=iX6pspRxv2u1u41BmBgQeHT3gpV/0AHUbBIYb+RbQ24=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=F5SZCXAA5BSiuqnyWu9XqtSkm3D3l6Po6W92NFdisDHawvocCrZzDtrKmicDYPcFx\n\tqycdXUwJ+ofT+d5z9DAsdbkkzBXfmLbE85+9iD2UuURwwGsB8hsBclMtauea81ULmc\n\tI88Bz8ncVZqlePLlPVbH1rVeC/a34MUzR5vxDedA=",
        "From": "Paul Elder <paul.elder@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  8 Jun 2020 17:05:29 +0900",
        "Message-Id": "<20200608080529.7727-1-paul.elder@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2] 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": "Mon, 08 Jun 2020 08:05:42 -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>\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n---\nChanges in v2:\n- add todo for better MJPEG sizeimage estimate\n- update comment that the warning will only be printed if the set format\n  has zero sizeimage at the time of reqbufs\n---\n src/v4l2/v4l2_camera_proxy.cpp | 10 +++++++---\n 1 file changed, 7 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp\nindex 059f3cbe..07e746b4 100644\n--- a/src/v4l2/v4l2_camera_proxy.cpp\n+++ b/src/v4l2/v4l2_camera_proxy.cpp\n@@ -358,8 +358,9 @@ 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 the set format at the time of reqbufs has a\n+\t * zero sizeimage we'll get a floating point exception when we try to\n+\t * stream it.\n \t */\n \tif (sizeimage_ == 0)\n \t\tLOG(V4L2Compat, Warning)\n@@ -556,7 +557,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 +574,9 @@ 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/* \\todo Get better estimate from UVC device, via StreamConfiguration. */\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",
        "v2"
    ]
}