Show a patch.

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

{
    "id": 11085,
    "url": "https://patchwork.libcamera.org/api/patches/11085/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11085/",
    "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-7-laurent.pinchart@ideasonboard.com>",
    "date": "2021-01-31T22:46:48",
    "name": "[libcamera-devel,06/20] libcamera: pipeline: simple: converter: Differentiate input and output buffers count",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "76e0c4363f5a99c8621fb93a50c85e1345f594d3",
    "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/11085/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/11085/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11085/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 C8D63BD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 31 Jan 2021 22:47:37 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 89D80683F0;\n\tSun, 31 Jan 2021 23:47:37 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 08890683E3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 31 Jan 2021 23:47:30 +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 87D53144C; \n\tSun, 31 Jan 2021 23:47:29 +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=\"rKsc6uU4\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1612133249;\n\tbh=DzYvlXA+EbM9lCOtKu+NO+jfA8Dcz6NpNaNgMQh4Nlo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=rKsc6uU4hwWRefUMHVG6cSl90EOhN1ehut/lo0Yh5c8ui8Bzy0Iy2qmFPlEJuFnVf\n\tq7VTegezOuCzmwh6qTHb3r8pD+BEqiwcV730SopDslmWwGuLFKdAgdasknVJkCa3wM\n\t9/xIvo+QvG3KEie/xf9LOxt7Qm5Hv5h1sDUVk/BU=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon,  1 Feb 2021 00:46:48 +0200",
        "Message-Id": "<20210131224702.8838-7-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 06/20] libcamera: pipeline: simple:\n\tconverter: Differentiate input and output buffers count",
        "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 number of buffers on the input and output of the converter don't\nnecessarily need to match. Use the buffer count from the input and\noutput configuration respectively. This removes the need to pass the\nbuffer count to the start() function, which brings it closer to the\npipeline handler API.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/pipeline/simple/converter.cpp | 9 ++++++---\n src/libcamera/pipeline/simple/converter.h   | 5 ++++-\n src/libcamera/pipeline/simple/simple.cpp    | 3 ++-\n 3 files changed, 12 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp\nindex 550b2bcfb001..6b3249ea92b0 100644\n--- a/src/libcamera/pipeline/simple/converter.cpp\n+++ b/src/libcamera/pipeline/simple/converter.cpp\n@@ -195,6 +195,9 @@ int SimpleConverter::configure(const StreamConfiguration &inputCfg,\n \t\treturn -EINVAL;\n \t}\n \n+\tinputBufferCount_ = inputCfg.bufferCount;\n+\toutputBufferCount_ = outputCfg.bufferCount;\n+\n \treturn 0;\n }\n \n@@ -204,13 +207,13 @@ int SimpleConverter::exportBuffers(unsigned int count,\n \treturn m2m_->capture()->exportBuffers(count, buffers);\n }\n \n-int SimpleConverter::start(unsigned int count)\n+int SimpleConverter::start()\n {\n-\tint ret = m2m_->output()->importBuffers(count);\n+\tint ret = m2m_->output()->importBuffers(inputBufferCount_);\n \tif (ret < 0)\n \t\treturn ret;\n \n-\tret = m2m_->capture()->importBuffers(count);\n+\tret = m2m_->capture()->importBuffers(outputBufferCount_);\n \tif (ret < 0) {\n \t\tstop();\n \t\treturn ret;\ndiff --git a/src/libcamera/pipeline/simple/converter.h b/src/libcamera/pipeline/simple/converter.h\nindex 47a056e582d6..a1503a6099ff 100644\n--- a/src/libcamera/pipeline/simple/converter.h\n+++ b/src/libcamera/pipeline/simple/converter.h\n@@ -43,7 +43,7 @@ public:\n \tint exportBuffers(unsigned int count,\n \t\t\t  std::vector<std::unique_ptr<FrameBuffer>> *buffers);\n \n-\tint start(unsigned int count);\n+\tint start();\n \tvoid stop();\n \n \tint queueBuffers(FrameBuffer *input, FrameBuffer *output);\n@@ -58,6 +58,9 @@ private:\n \n \tstd::queue<FrameBuffer *> captureDoneQueue_;\n \tstd::queue<FrameBuffer *> outputDoneQueue_;\n+\n+\tunsigned int inputBufferCount_;\n+\tunsigned int outputBufferCount_;\n };\n \n } /* namespace libcamera */\ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 1ed67bcec490..8c0bca36bbfb 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -607,6 +607,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n \t\tinputCfg.pixelFormat = pipeConfig.pixelFormat;\n \t\tinputCfg.size = pipeConfig.captureSize;\n \t\tinputCfg.stride = captureFormat.planes[0].bpl;\n+\t\tinputCfg.bufferCount = cfg.bufferCount;\n \n \t\tret = converter_->configure(inputCfg, cfg);\n \t\tif (ret < 0) {\n@@ -660,7 +661,7 @@ int SimplePipelineHandler::start(Camera *camera, [[maybe_unused]] ControlList *c\n \t}\n \n \tif (useConverter_) {\n-\t\tret = converter_->start(count);\n+\t\tret = converter_->start();\n \t\tif (ret < 0) {\n \t\t\tstop(camera);\n \t\t\treturn ret;\n",
    "prefixes": [
        "libcamera-devel",
        "06/20"
    ]
}