Show a patch.

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

{
    "id": 1690,
    "url": "https://patchwork.libcamera.org/api/patches/1690/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1690/",
    "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": "<20190713172351.25452-10-laurent.pinchart@ideasonboard.com>",
    "date": "2019-07-13T17:23:44",
    "name": "[libcamera-devel,v2,09/16] libcamera: Stop using Stream::bufferPool to get the number of buffers",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "4207167e8be72624ddc966bc66902360a3b301d6",
    "submitter": {
        "id": 2,
        "url": "https://patchwork.libcamera.org/api/people/2/?format=api",
        "name": "Laurent Pinchart",
        "email": "laurent.pinchart@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/1690/mbox/",
    "series": [
        {
            "id": 430,
            "url": "https://patchwork.libcamera.org/api/series/430/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=430",
            "date": "2019-07-13T17:23:35",
            "name": "Add support for external buffers",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/430/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1690/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1690/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<laurent.pinchart@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 4757660C23\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Jul 2019 19:24:40 +0200 (CEST)",
            "from pendragon.ideasonboard.com (softbank126209254147.bbtec.net\n\t[126.209.254.147])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id ED33E2B2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 13 Jul 2019 19:24:38 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1563038680;\n\tbh=AQnkuXuCVS9ffEDIOY8qsL428MAKHXoik31YeXIxO6Y=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=TM58QijIc5HsOH222DxNQX73ZcWeAf/kas5OJXDaxhRpsIA93TbNtZUtjFTmjokLD\n\tAeEm3lTFbnN6hPKdUhJtobaP6CU8+O9ZAbUHEGTRfhpak/C3Wrv5v++qecTrlnwpUa\n\tp/GuovPWeMgokAiIkzjMuB7fOY31BCIfwsr2rVu0=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Sat, 13 Jul 2019 20:23:44 +0300",
        "Message-Id": "<20190713172351.25452-10-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.21.0",
        "In-Reply-To": "<20190713172351.25452-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20190713172351.25452-1-laurent.pinchart@ideasonboard.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 09/16] libcamera: Stop using\n\tStream::bufferPool to get the number of buffers",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.23",
        "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, 13 Jul 2019 17:24:40 -0000"
    },
    "content": "The cam and qcam applications, as well as the camera capture test case,\naccess the Stream::bufferPool in order to know how many requests to\ninitially queue. As part of an effort to remove access to the buffer\npool from applications, use the buffer count from the stream\nconfiguration instead.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/cam/capture.cpp      | 6 ++----\n src/qcam/main_window.cpp | 3 +--\n test/camera/capture.cpp  | 3 +--\n 3 files changed, 4 insertions(+), 8 deletions(-)",
    "diff": "diff --git a/src/cam/capture.cpp b/src/cam/capture.cpp\nindex 1cf59063c93b..66ec1abaa5ac 100644\n--- a/src/cam/capture.cpp\n+++ b/src/cam/capture.cpp\n@@ -74,10 +74,8 @@ int Capture::capture(EventLoop *loop)\n \n \t/* Identify the stream with the least number of buffers. */\n \tunsigned int nbuffers = UINT_MAX;\n-\tfor (StreamConfiguration &cfg : *config_) {\n-\t\tStream *stream = cfg.stream();\n-\t\tnbuffers = std::min(nbuffers, stream->bufferPool().count());\n-\t}\n+\tfor (StreamConfiguration &cfg : *config_)\n+\t\tnbuffers = std::min(nbuffers, cfg.bufferCount);\n \n \t/*\n \t * TODO: make cam tool smarter to support still capture by for\ndiff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\nindex 6ecf30e33bcf..7023e1158fb6 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -140,9 +140,8 @@ int MainWindow::startCapture()\n \t\treturn ret;\n \t}\n \n-\tBufferPool &pool = stream->bufferPool();\n \tstd::vector<Request *> requests;\n-\tfor (unsigned int i = 0; i < pool.count(); ++i) {\n+\tfor (unsigned int i = 0; i < cfg.bufferCount; ++i) {\n \t\tRequest *request = camera_->createRequest();\n \t\tif (!request) {\n \t\t\tstd::cerr << \"Can't create request\" << std::endl;\ndiff --git a/test/camera/capture.cpp b/test/camera/capture.cpp\nindex ff1cbd6cbac0..e6bf7a8d9ebb 100644\n--- a/test/camera/capture.cpp\n+++ b/test/camera/capture.cpp\n@@ -80,9 +80,8 @@ protected:\n \t\t}\n \n \t\tStream *stream = cfg.stream();\n-\t\tBufferPool &pool = stream->bufferPool();\n \t\tstd::vector<Request *> requests;\n-\t\tfor (unsigned int i = 0; i < pool.count(); ++i) {\n+\t\tfor (unsigned int i = 0; i < cfg.bufferCount; ++i) {\n \t\t\tRequest *request = camera_->createRequest();\n \t\t\tif (!request) {\n \t\t\t\tcout << \"Failed to create request\" << endl;\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "09/16"
    ]
}