Show a patch.

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

{
    "id": 11081,
    "url": "https://patchwork.libcamera.org/api/patches/11081/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11081/",
    "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": "<20210131224702.8838-3-laurent.pinchart@ideasonboard.com>",
    "date": "2021-01-31T22:46:44",
    "name": "[libcamera-devel,02/20] libcamera: pipeline: simple: Don't override stride at configure time",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "54fe8668d92abf9f8c53cca12023034314adcbf5",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": {
        "id": 14,
        "url": "https://patchwork.libcamera.org/api/users/14/?format=api",
        "username": "pinchartl",
        "first_name": "Laurent",
        "last_name": "Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "mbox": "https://patchwork.libcamera.org/patch/11081/mbox/",
    "series": [
        {
            "id": 1633,
            "url": "https://patchwork.libcamera.org/api/series/1633/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1633",
            "date": "2021-01-31T22:46:42",
            "name": "[libcamera-devel,01/20] libcamera: pipeline: simple: Manage converter with std::unique_ptr<>",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/1633/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11081/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11081/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 7DEABBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 31 Jan 2021 22:47:32 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 71DF9683EC;\n\tSun, 31 Jan 2021 23:47:31 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4CC2E683D0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 31 Jan 2021 23:47:28 +0100 (CET)",
            "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id CC7F08AF;\n\tSun, 31 Jan 2021 23:47:27 +0100 (CET)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"SP5vf8NK\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1612133248;\n\tbh=VXW0sCd0H3wsxlM+tWRBZQt27Lwk6A0o5hrdjQFGq/o=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=SP5vf8NK5yQN5on+Mptx4ND25oPuAfwN7jyiOdqADLiRmtY4oyV1CL+xXmhVeJNP3\n\tq6KN/yCOjKGUpRW61EkOigTVAmXYSbtvsuNlYwKR/DXQcGWVWDZLhNn5Njg/VIZCu9\n\tDiMJGZZuubVx5Z0+Xiza6cvk+VY2ybVt04Y8M7mM=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  1 Feb 2021 00:46:44 +0200",
        "Message-Id": "<20210131224702.8838-3-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.28.0",
        "In-Reply-To": "<20210131224702.8838-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20210131224702.8838-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH 02/20] libcamera: pipeline: simple: Don't\n\toverride stride at configure time",
        "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>",
        "Cc": "Phi-Bang Nguyen <pnguyen@baylibre.com>",
        "Content-Type": "text/plain; charset=\"us-ascii\"",
        "Content-Transfer-Encoding": "7bit",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "The stride (and frame size) calculation has been moved from configure\ntime to configuration validate time by commit 89fb1efac240 (\"libcamera: simple:\nFill stride and frameSize at config validation\"). This change has\nhowever left one stray setting of the stride when configuring the\nconverter. Fix it.\n\nWhile at it, turn the SimpleConverter::configure() output configuration\nargument to a const reference to emphasize it can't be null and isn't\nmodified by the function, and rename it from cfg to outputCfg to make\nits purpose clearer.\n\nFixes: 89fb1efac240 (\"libcamera: simple: Fill stride and frameSize at config validation\")\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/simple/converter.cpp | 10 ++++------\n src/libcamera/pipeline/simple/converter.h   |  2 +-\n src/libcamera/pipeline/simple/simple.cpp    |  2 +-\n 3 files changed, 6 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp\nindex a6a8e139cb3e..87d15c781ed8 100644\n--- a/src/libcamera/pipeline/simple/converter.cpp\n+++ b/src/libcamera/pipeline/simple/converter.cpp\n@@ -134,7 +134,7 @@ SizeRange SimpleConverter::sizes(const Size &input)\n }\n \n int SimpleConverter::configure(PixelFormat inputFormat, const Size &inputSize,\n-\t\t\t       StreamConfiguration *cfg)\n+\t\t\t       const StreamConfiguration &outputCfg)\n {\n \tV4L2DeviceFormat format;\n \tint ret;\n@@ -157,10 +157,10 @@ int SimpleConverter::configure(PixelFormat inputFormat, const Size &inputSize,\n \t}\n \n \t/* Set the pixel format and size on the output. */\n-\tvideoFormat = m2m_->capture()->toV4L2PixelFormat(cfg->pixelFormat);\n+\tvideoFormat = m2m_->capture()->toV4L2PixelFormat(outputCfg.pixelFormat);\n \tformat = {};\n \tformat.fourcc = videoFormat;\n-\tformat.size = cfg->size;\n+\tformat.size = outputCfg.size;\n \n \tret = m2m_->capture()->setFormat(&format);\n \tif (ret < 0) {\n@@ -169,14 +169,12 @@ int SimpleConverter::configure(PixelFormat inputFormat, const Size &inputSize,\n \t\treturn ret;\n \t}\n \n-\tif (format.fourcc != videoFormat || format.size != cfg->size) {\n+\tif (format.fourcc != videoFormat || format.size != outputCfg.size) {\n \t\tLOG(SimplePipeline, Error)\n \t\t\t<< \"Output format not supported\";\n \t\treturn -EINVAL;\n \t}\n \n-\tcfg->stride = format.planes[0].bpl;\n-\n \treturn 0;\n }\n \ndiff --git a/src/libcamera/pipeline/simple/converter.h b/src/libcamera/pipeline/simple/converter.h\nindex a3c4d899cfc8..06d66f8caba7 100644\n--- a/src/libcamera/pipeline/simple/converter.h\n+++ b/src/libcamera/pipeline/simple/converter.h\n@@ -37,7 +37,7 @@ public:\n \tSizeRange sizes(const Size &input);\n \n \tint configure(PixelFormat inputFormat, const Size &inputSize,\n-\t\t      StreamConfiguration *cfg);\n+\t\t      const StreamConfiguration &outputCfg);\n \tint exportBuffers(unsigned int count,\n \t\t\t  std::vector<std::unique_ptr<FrameBuffer>> *buffers);\n \ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex b7aa3d034568..a97b8442d9a4 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -604,7 +604,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n \n \tif (useConverter_) {\n \t\tret = converter_->configure(pipeConfig.pixelFormat,\n-\t\t\t\t\t    pipeConfig.captureSize, &cfg);\n+\t\t\t\t\t    pipeConfig.captureSize, cfg);\n \t\tif (ret < 0) {\n \t\t\tLOG(SimplePipeline, Error)\n \t\t\t\t<< \"Unable to configure converter\";\n",
    "prefixes": [
        "libcamera-devel",
        "02/20"
    ]
}