Show a patch.

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

{
    "id": 13305,
    "url": "https://patchwork.libcamera.org/api/patches/13305/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13305/",
    "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": "<20210811124015.2116188-5-hiroh@chromium.org>",
    "date": "2021-08-11T12:40:14",
    "name": "[libcamera-devel,RFC,4/5] WIP: libcamera: V4L2VideoDevice: Fix a bug in CreateBuffer()",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "206e270662182d8a2a32a514c3d3f11f1ac532e4",
    "submitter": {
        "id": 63,
        "url": "https://patchwork.libcamera.org/api/people/63/?format=api",
        "name": "Hirokazu Honda",
        "email": "hiroh@chromium.org"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/13305/mbox/",
    "series": [
        {
            "id": 2339,
            "url": "https://patchwork.libcamera.org/api/series/2339/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2339",
            "date": "2021-08-11T12:40:10",
            "name": "MappedFrameBuffer::maps() returns the plane address",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/2339/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13305/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13305/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id CDF79C3241\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 11 Aug 2021 12:40:32 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8AE9668889;\n\tWed, 11 Aug 2021 14:40:32 +0200 (CEST)",
            "from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com\n\t[IPv6:2607:f8b0:4864:20::1029])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 73F0768855\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Aug 2021 14:40:31 +0200 (CEST)",
            "by mail-pj1-x1029.google.com with SMTP id\n\tw13-20020a17090aea0db029017897a5f7bcso4585433pjy.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 11 Aug 2021 05:40:31 -0700 (PDT)",
            "from hiroh2.tok.corp.google.com\n\t([2401:fa00:8f:203:ba11:c25e:242c:485d])\n\tby smtp.gmail.com with ESMTPSA id\n\tp30sm15722876pfh.116.2021.08.11.05.40.28\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 11 Aug 2021 05:40:29 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"GRtFzgKG\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=WBUGIjr+wc7ofyPPRfY1jSJxy/NlmDYAAjxmkELPkXY=;\n\tb=GRtFzgKGzQB911DjENlPHZs3p4Pdj43SOGbMmErgRaHKIycEJCxHz71HQs94YsSapK\n\tI8FwSm25CnCyS2/fsbhKJjCA97j1yR4mFsJRqQ/PP8dxAz/6zR4vj/6Yefk1ghOFaudZ\n\tb+qTIh2/M3RhUCsP+PxNaOg3Pgffe3RJXCIWQ=",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=WBUGIjr+wc7ofyPPRfY1jSJxy/NlmDYAAjxmkELPkXY=;\n\tb=YnH4urc85Ez7SFUAxeMIYGdRlrLO8PCqi4DPWVQ1FgW7I3t0vWF0Jt6BNtoBA+1QdO\n\tAL++MaNl1cBvP02KDZa2iCk1XN7tYhzujeFYzeC4+Ht0rv+9QChdJ9dm7N64xjz6mc4m\n\tOqGJUcHMa8y0E2AJ9qUrHAfEnPf13qOVRtJnUG4gBwnbJuycNS2kN7tTelaFzSF6oADl\n\tkkjYoDxulwqevyJ0a1/J0hV2EGEUYnrZyS0vTcy7oSUjHvzPCMyGMTjwkyPbQyb7g3Yq\n\tBXG+5n2I29hmwOsnodQdUXHX6grUQxhqGIXixhE2rJfJ0Dflw5P7Rcta4gFeJq0Nc50a\n\tzS2w==",
        "X-Gm-Message-State": "AOAM530/vP9XOQGwC4bQgNiVynMUm6bfWfDBP4/UCwP6/FUZLFCr1JPl\n\tnAtB5usLaPDch21DYd5lpZtWM7q8iIAaTA==",
        "X-Google-Smtp-Source": "ABdhPJwctDQaZFE/ajeV1RGtWgcRPzBoZCcp30HGWz3gt8SvQ1sWU+5Hquqfwy7dtsOlr4IWUMXJnw==",
        "X-Received": "by 2002:aa7:9f12:0:b029:3e0:3224:6cd5 with SMTP id\n\tg18-20020aa79f120000b02903e032246cd5mr1976379pfr.43.1628685629748; \n\tWed, 11 Aug 2021 05:40:29 -0700 (PDT)",
        "From": "Hirokazu Honda <hiroh@chromium.org>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 11 Aug 2021 21:40:14 +0900",
        "Message-Id": "<20210811124015.2116188-5-hiroh@chromium.org>",
        "X-Mailer": "git-send-email 2.32.0.605.g8dce9f2422-goog",
        "In-Reply-To": "<20210811124015.2116188-1-hiroh@chromium.org>",
        "References": "<20210811124015.2116188-1-hiroh@chromium.org>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [RFC PATCH 4/5] WIP: libcamera: V4L2VideoDevice:\n\tFix a bug in CreateBuffer()",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "FrameBuffer created in V4L2VideoDevice::CreateBuffer() has the same\nnumber of planes as v4l2 buffer planes. However, if the format is\na single planar format, the number of planes is one. FrameBuffer\nshould have the same number of planes as color format planes.\n\nSigned-off-by: Hirokazu Honda <hiroh@chromium.org>\n---\n src/libcamera/v4l2_videodevice.cpp | 15 ++++++++++++++-\n 1 file changed, 14 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp\nindex ce60dff6..e70076f3 100644\n--- a/src/libcamera/v4l2_videodevice.cpp\n+++ b/src/libcamera/v4l2_videodevice.cpp\n@@ -1269,7 +1269,6 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index)\n \n \tconst bool multiPlanar = V4L2_TYPE_IS_MULTIPLANAR(buf.type);\n \tconst unsigned int numPlanes = multiPlanar ? buf.length : 1;\n-\n \tif (numPlanes == 0 || numPlanes > VIDEO_MAX_PLANES) {\n \t\tLOG(V4L2, Error) << \"Invalid number of planes\";\n \t\treturn nullptr;\n@@ -1289,6 +1288,20 @@ std::unique_ptr<FrameBuffer> V4L2VideoDevice::createBuffer(unsigned int index)\n \t\tplanes.push_back(std::move(plane));\n \t}\n \n+\n+\tV4L2DeviceFormat format{};\n+\tret = getFormat(&format);\n+\tif (ret < 0) {\n+\t\tLOG(V4L2, Error) << \"Failed to get buffer format\";\n+\t\treturn nullptr;\n+\t}\n+\tif (format.fourcc == V4L2_PIX_FMT_NV12) {\n+\t\tplanes.resize(2);\n+\t\tplanes[0].length = format.size.width * format.size.height;\n+\t\tplanes[1].fd = planes[0].fd;\n+\t\tplanes[1].length = format.size.width * ((format.size.height + 1) / 2);\n+\t}\n+\n \treturn std::make_unique<FrameBuffer>(std::move(planes));\n }\n \n",
    "prefixes": [
        "libcamera-devel",
        "RFC",
        "4/5"
    ]
}