Show a patch.

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

{
    "id": 11971,
    "url": "https://patchwork.libcamera.org/api/patches/11971/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/11971/",
    "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": "<20210416222830.335755-2-nfraprado@collabora.com>",
    "date": "2021-04-16T22:28:29",
    "name": "[libcamera-devel,v2,1/2] libcamera: framebuffer_allocator: Make allocate() accept count",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "2f9a691c80315b7a49bc2454ee282032d53817af",
    "submitter": {
        "id": 84,
        "url": "https://patchwork.libcamera.org/api/people/84/?format=api",
        "name": "Nícolas F. R. A. Prado",
        "email": "nfraprado@collabora.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/11971/mbox/",
    "series": [
        {
            "id": 1943,
            "url": "https://patchwork.libcamera.org/api/series/1943/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1943",
            "date": "2021-04-16T22:28:28",
            "name": "lc-compliance: Add test to queue more requests than hardware depth",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/1943/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/11971/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/11971/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 212E7BD237\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 16 Apr 2021 22:29:21 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DF15468816;\n\tSat, 17 Apr 2021 00:29:20 +0200 (CEST)",
            "from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3EEB86880A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 17 Apr 2021 00:29:19 +0200 (CEST)",
            "from [127.0.0.1] (localhost [127.0.0.1])\n\t(Authenticated sender: nfraprado) with ESMTPSA id A00141F43A4D"
        ],
        "From": "=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 16 Apr 2021 19:28:29 -0300",
        "Message-Id": "<20210416222830.335755-2-nfraprado@collabora.com>",
        "X-Mailer": "git-send-email 2.31.1",
        "In-Reply-To": "<20210416222830.335755-1-nfraprado@collabora.com>",
        "References": "<20210416222830.335755-1-nfraprado@collabora.com>",
        "MIME-Version": "1.0",
        "Subject": "[libcamera-devel] [PATCH v2 1/2] libcamera: framebuffer_allocator:\n\tMake allocate() accept 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>",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add a 'count' argument to FrameBufferAllocator::allocate() so that a\ncustom amount of buffers can be allocated. If 0 is passed, the pipeline\nhandler allocates the default amount, which is the configured\nbufferCount.\n\nSigned-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n---\n include/libcamera/camera.h                         | 3 ++-\n include/libcamera/framebuffer_allocator.h          | 2 +-\n include/libcamera/internal/pipeline_handler.h      | 3 ++-\n src/cam/capture.cpp                                | 2 +-\n src/lc-compliance/simple_capture.cpp               | 8 ++++----\n src/lc-compliance/simple_capture.h                 | 2 +-\n src/libcamera/camera.cpp                           | 5 +++--\n src/libcamera/framebuffer_allocator.cpp            | 5 +++--\n src/libcamera/pipeline/ipu3/ipu3.cpp               | 9 ++++++---\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 9 ++++++---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp           | 9 ++++++---\n src/libcamera/pipeline/simple/simple.cpp           | 9 ++++++---\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp       | 9 ++++++---\n src/libcamera/pipeline/vimc/vimc.cpp               | 9 ++++++---\n src/libcamera/pipeline_handler.cpp                 | 1 +\n src/qcam/main_window.cpp                           | 2 +-\n test/camera/capture.cpp                            | 2 +-\n test/camera/statemachine.cpp                       | 2 +-\n test/mapped-buffer.cpp                             | 2 +-\n 19 files changed, 58 insertions(+), 35 deletions(-)",
    "diff": "diff --git a/include/libcamera/camera.h b/include/libcamera/camera.h\nindex 326b14d0ca01..ef6113113b6c 100644\n--- a/include/libcamera/camera.h\n+++ b/include/libcamera/camera.h\n@@ -116,7 +116,8 @@ private:\n \n \tfriend class FrameBufferAllocator;\n \tint exportFrameBuffers(Stream *stream,\n-\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers);\n+\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers,\n+\t\t\t       unsigned int count);\n };\n \n } /* namespace libcamera */\ndiff --git a/include/libcamera/framebuffer_allocator.h b/include/libcamera/framebuffer_allocator.h\nindex 0c85631a1da2..f1ae37288d50 100644\n--- a/include/libcamera/framebuffer_allocator.h\n+++ b/include/libcamera/framebuffer_allocator.h\n@@ -25,7 +25,7 @@ public:\n \tFrameBufferAllocator(std::shared_ptr<Camera> camera);\n \t~FrameBufferAllocator();\n \n-\tint allocate(Stream *stream);\n+\tint allocate(Stream *stream, unsigned int count);\n \tint free(Stream *stream);\n \n \tbool allocated() const { return !buffers_.empty(); }\ndiff --git a/include/libcamera/internal/pipeline_handler.h b/include/libcamera/internal/pipeline_handler.h\nindex c6454db6b2c4..37c51f3f0604 100644\n--- a/include/libcamera/internal/pipeline_handler.h\n+++ b/include/libcamera/internal/pipeline_handler.h\n@@ -76,7 +76,8 @@ public:\n \tvirtual int configure(Camera *camera, CameraConfiguration *config) = 0;\n \n \tvirtual int exportFrameBuffers(Camera *camera, Stream *stream,\n-\t\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers) = 0;\n+\t\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers,\n+\t\t\t\t       unsigned int count) = 0;\n \n \tvirtual int start(Camera *camera, const ControlList *controls) = 0;\n \tvirtual void stop(Camera *camera) = 0;\ndiff --git a/src/cam/capture.cpp b/src/cam/capture.cpp\nindex 7b55fc677022..dc24b12f4d10 100644\n--- a/src/cam/capture.cpp\n+++ b/src/cam/capture.cpp\n@@ -80,7 +80,7 @@ int Capture::capture(FrameBufferAllocator *allocator)\n \t/* Identify the stream with the least number of buffers. */\n \tunsigned int nbuffers = UINT_MAX;\n \tfor (StreamConfiguration &cfg : *config_) {\n-\t\tret = allocator->allocate(cfg.stream());\n+\t\tret = allocator->allocate(cfg.stream(), 0);\n \t\tif (ret < 0) {\n \t\t\tstd::cerr << \"Can't allocate buffers\" << std::endl;\n \t\t\treturn -ENOMEM;\ndiff --git a/src/lc-compliance/simple_capture.cpp b/src/lc-compliance/simple_capture.cpp\nindex 64e862a08e3a..42e4c9b1302d 100644\n--- a/src/lc-compliance/simple_capture.cpp\n+++ b/src/lc-compliance/simple_capture.cpp\n@@ -39,10 +39,10 @@ Results::Result SimpleCapture::configure(StreamRole role)\n \treturn { Results::Pass, \"Configure camera\" };\n }\n \n-Results::Result SimpleCapture::start()\n+Results::Result SimpleCapture::start(unsigned int numBuffers)\n {\n \tStream *stream = config_->at(0).stream();\n-\tif (allocator_->allocate(stream) < 0)\n+\tif (allocator_->allocate(stream, numBuffers) < 0)\n \t\treturn { Results::Fail, \"Failed to allocate buffers\" };\n \n \tif (camera_->start())\n@@ -73,7 +73,7 @@ SimpleCaptureBalanced::SimpleCaptureBalanced(std::shared_ptr<Camera> camera)\n \n Results::Result SimpleCaptureBalanced::capture(unsigned int numRequests)\n {\n-\tResults::Result ret = start();\n+\tResults::Result ret = start(0);\n \tif (ret.first != Results::Pass)\n \t\treturn ret;\n \n@@ -161,7 +161,7 @@ SimpleCaptureUnbalanced::SimpleCaptureUnbalanced(std::shared_ptr<Camera> camera)\n \n Results::Result SimpleCaptureUnbalanced::capture(unsigned int numRequests)\n {\n-\tResults::Result ret = start();\n+\tResults::Result ret = start(0);\n \tif (ret.first != Results::Pass)\n \t\treturn ret;\n \ndiff --git a/src/lc-compliance/simple_capture.h b/src/lc-compliance/simple_capture.h\nindex d9de53fb63a3..2b1493ecaf96 100644\n--- a/src/lc-compliance/simple_capture.h\n+++ b/src/lc-compliance/simple_capture.h\n@@ -23,7 +23,7 @@ protected:\n \tSimpleCapture(std::shared_ptr<libcamera::Camera> camera);\n \tvirtual ~SimpleCapture();\n \n-\tResults::Result start();\n+\tResults::Result start(unsigned int numBuffers);\n \tvoid stop();\n \n \tvirtual void requestComplete(libcamera::Request *request) = 0;\ndiff --git a/src/libcamera/camera.cpp b/src/libcamera/camera.cpp\nindex 763f3b9926fd..7df110ee2f52 100644\n--- a/src/libcamera/camera.cpp\n+++ b/src/libcamera/camera.cpp\n@@ -657,7 +657,8 @@ void Camera::disconnect()\n }\n \n int Camera::exportFrameBuffers(Stream *stream,\n-\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n+\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers,\n+\t\t\t       unsigned int count)\n {\n \tPrivate *const d = LIBCAMERA_D_PTR();\n \n@@ -673,7 +674,7 @@ int Camera::exportFrameBuffers(Stream *stream,\n \n \treturn d->pipe_->invokeMethod(&PipelineHandler::exportFrameBuffers,\n \t\t\t\t      ConnectionTypeBlocking, this, stream,\n-\t\t\t\t      buffers);\n+\t\t\t\t      buffers, count);\n }\n \n /**\ndiff --git a/src/libcamera/framebuffer_allocator.cpp b/src/libcamera/framebuffer_allocator.cpp\nindex 2fbba37a1b0b..6b07203017cd 100644\n--- a/src/libcamera/framebuffer_allocator.cpp\n+++ b/src/libcamera/framebuffer_allocator.cpp\n@@ -70,6 +70,7 @@ FrameBufferAllocator::~FrameBufferAllocator()\n /**\n  * \\brief Allocate buffers for a configured stream\n  * \\param[in] stream The stream to allocate buffers for\n+ * \\param[in] count The amount of buffers to allocate\n  *\n  * Allocate buffers suitable for capturing frames from the \\a stream. The Camera\n  * shall have been previously configured with Camera::configure() and shall be\n@@ -85,14 +86,14 @@ FrameBufferAllocator::~FrameBufferAllocator()\n  * not part of the active camera configuration\n  * \\retval -EBUSY Buffers are already allocated for the \\a stream\n  */\n-int FrameBufferAllocator::allocate(Stream *stream)\n+int FrameBufferAllocator::allocate(Stream *stream, unsigned int count)\n {\n \tif (buffers_.count(stream)) {\n \t\tLOG(Allocator, Error) << \"Buffers already allocated for stream\";\n \t\treturn -EBUSY;\n \t}\n \n-\tint ret = camera_->exportFrameBuffers(stream, &buffers_[stream]);\n+\tint ret = camera_->exportFrameBuffers(stream, &buffers_[stream], count);\n \tif (ret == -EINVAL)\n \t\tLOG(Allocator, Error)\n \t\t\t<< \"Stream is not part of \" << camera_->id()\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 519cad4f8148..7a44900b9fbc 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -131,7 +131,8 @@ public:\n \tint configure(Camera *camera, CameraConfiguration *config) override;\n \n \tint exportFrameBuffers(Camera *camera, Stream *stream,\n-\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;\n+\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers,\n+\t\t\t       unsigned int count) override;\n \n \tint start(Camera *camera, const ControlList *controls) override;\n \tvoid stop(Camera *camera) override;\n@@ -641,10 +642,12 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)\n }\n \n int PipelineHandlerIPU3::exportFrameBuffers(Camera *camera, Stream *stream,\n-\t\t\t\t\t    std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n+\t\t\t\t\t    std::vector<std::unique_ptr<FrameBuffer>> *buffers,\n+\t\t\t\t\t    unsigned int count)\n {\n \tIPU3CameraData *data = cameraData(camera);\n-\tunsigned int count = stream->configuration().bufferCount;\n+\tif (!count)\n+\t\tcount = stream->configuration().bufferCount;\n \n \tif (stream == &data->outStream_)\n \t\treturn data->imgu_->output_->exportBuffers(count, buffers);\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex f22e286ed87a..3ab27123b1ac 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -250,7 +250,8 @@ public:\n \tint configure(Camera *camera, CameraConfiguration *config) override;\n \n \tint exportFrameBuffers(Camera *camera, Stream *stream,\n-\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;\n+\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers,\n+\t\t\t       unsigned int count) override;\n \n \tint start(Camera *camera, const ControlList *controls) override;\n \tvoid stop(Camera *camera) override;\n@@ -786,10 +787,12 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)\n }\n \n int PipelineHandlerRPi::exportFrameBuffers([[maybe_unused]] Camera *camera, Stream *stream,\n-\t\t\t\t\t   std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n+\t\t\t\t\t   std::vector<std::unique_ptr<FrameBuffer>> *buffers,\n+\t\t\t\t\t   unsigned int count)\n {\n \tRPi::Stream *s = static_cast<RPi::Stream *>(stream);\n-\tunsigned int count = stream->configuration().bufferCount;\n+\tif (!count)\n+\t\tcount = stream->configuration().bufferCount;\n \tint ret = s->dev()->exportBuffers(count, buffers);\n \n \ts->setExportedBuffers(buffers);\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 549f4a4e61a8..4cc3c7739251 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -140,7 +140,8 @@ public:\n \tint configure(Camera *camera, CameraConfiguration *config) override;\n \n \tint exportFrameBuffers(Camera *camera, Stream *stream,\n-\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;\n+\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers,\n+\t\t\t       unsigned int count) override;\n \n \tint start(Camera *camera, const ControlList *controls) override;\n \tvoid stop(Camera *camera) override;\n@@ -666,10 +667,12 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n }\n \n int PipelineHandlerRkISP1::exportFrameBuffers([[maybe_unused]] Camera *camera, Stream *stream,\n-\t\t\t\t\t      std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n+\t\t\t\t\t      std::vector<std::unique_ptr<FrameBuffer>> *buffers,\n+\t\t\t\t\t      unsigned int count)\n {\n \tRkISP1CameraData *data = cameraData(camera);\n-\tunsigned int count = stream->configuration().bufferCount;\n+\tif (!count)\n+\t\tcount = stream->configuration().bufferCount;\n \n \tif (stream == &data->mainPathStream_)\n \t\treturn mainPath_.exportBuffers(count, buffers);\ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex f6095d38e97a..e9b0698813fc 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -223,7 +223,8 @@ public:\n \tint configure(Camera *camera, CameraConfiguration *config) override;\n \n \tint exportFrameBuffers(Camera *camera, Stream *stream,\n-\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;\n+\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers,\n+\t\t\t       unsigned int count) override;\n \n \tint start(Camera *camera, const ControlList *controls) override;\n \tvoid stop(Camera *camera) override;\n@@ -762,10 +763,12 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n }\n \n int SimplePipelineHandler::exportFrameBuffers(Camera *camera, Stream *stream,\n-\t\t\t\t\t      std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n+\t\t\t\t\t      std::vector<std::unique_ptr<FrameBuffer>> *buffers,\n+\t\t\t\t\t      unsigned int count)\n {\n \tSimpleCameraData *data = cameraData(camera);\n-\tunsigned int count = stream->configuration().bufferCount;\n+\tif (!count)\n+\t\tcount = stream->configuration().bufferCount;\n \n \t/*\n \t * Export buffers on the converter or capture video node, depending on\ndiff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex b6c6ade5ebaf..298e7031d23b 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -70,7 +70,8 @@ public:\n \tint configure(Camera *camera, CameraConfiguration *config) override;\n \n \tint exportFrameBuffers(Camera *camera, Stream *stream,\n-\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;\n+\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers,\n+\t\t\t       unsigned int count) override;\n \n \tint start(Camera *camera, const ControlList *controls) override;\n \tvoid stop(Camera *camera) override;\n@@ -224,10 +225,12 @@ int PipelineHandlerUVC::configure(Camera *camera, CameraConfiguration *config)\n }\n \n int PipelineHandlerUVC::exportFrameBuffers(Camera *camera, Stream *stream,\n-\t\t\t\t\t   std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n+\t\t\t\t\t   std::vector<std::unique_ptr<FrameBuffer>> *buffers,\n+\t\t\t\t\t   unsigned int count)\n {\n \tUVCCameraData *data = cameraData(camera);\n-\tunsigned int count = stream->configuration().bufferCount;\n+\tif (!count)\n+\t\tcount = stream->configuration().bufferCount;\n \n \treturn data->video_->exportBuffers(count, buffers);\n }\ndiff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex 8f5f4ba30953..2f889347b624 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -84,7 +84,8 @@ public:\n \tint configure(Camera *camera, CameraConfiguration *config) override;\n \n \tint exportFrameBuffers(Camera *camera, Stream *stream,\n-\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers) override;\n+\t\t\t       std::vector<std::unique_ptr<FrameBuffer>> *buffers,\n+\t\t\t       unsigned int count) override;\n \n \tint start(Camera *camera, const ControlList *controls) override;\n \tvoid stop(Camera *camera) override;\n@@ -299,10 +300,12 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)\n }\n \n int PipelineHandlerVimc::exportFrameBuffers(Camera *camera, Stream *stream,\n-\t\t\t\t\t    std::vector<std::unique_ptr<FrameBuffer>> *buffers)\n+\t\t\t\t\t    std::vector<std::unique_ptr<FrameBuffer>> *buffers,\n+\t\t\t\t\t    unsigned int count)\n {\n \tVimcCameraData *data = cameraData(camera);\n-\tunsigned int count = stream->configuration().bufferCount;\n+\tif (!count)\n+\t\tcount = stream->configuration().bufferCount;\n \n \treturn data->video_->exportBuffers(count, buffers);\n }\ndiff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex 3b3150bdbbf7..ab5f21a01438 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -323,6 +323,7 @@ const ControlList &PipelineHandler::properties(const Camera *camera) const\n  * \\param[in] camera The camera\n  * \\param[in] stream The stream to allocate buffers for\n  * \\param[out] buffers Array of buffers successfully allocated\n+ * \\param[in] count The amount of buffers to allocate\n  *\n  * This method allocates buffers for the \\a stream from the devices associated\n  * with the stream in the corresponding pipeline handler. Those buffers shall be\ndiff --git a/src/qcam/main_window.cpp b/src/qcam/main_window.cpp\nindex 39d034de6bb2..4e1dbb0656c8 100644\n--- a/src/qcam/main_window.cpp\n+++ b/src/qcam/main_window.cpp\n@@ -463,7 +463,7 @@ int MainWindow::startCapture()\n \tfor (StreamConfiguration &config : *config_) {\n \t\tStream *stream = config.stream();\n \n-\t\tret = allocator_->allocate(stream);\n+\t\tret = allocator_->allocate(stream, 0);\n \t\tif (ret < 0) {\n \t\t\tqWarning() << \"Failed to allocate capture buffers\";\n \t\t\tgoto error;\ndiff --git a/test/camera/capture.cpp b/test/camera/capture.cpp\nindex c4bc21100777..6cbca15b30bc 100644\n--- a/test/camera/capture.cpp\n+++ b/test/camera/capture.cpp\n@@ -96,7 +96,7 @@ protected:\n \n \t\tStream *stream = cfg.stream();\n \n-\t\tint ret = allocator_->allocate(stream);\n+\t\tint ret = allocator_->allocate(stream, 0);\n \t\tif (ret < 0)\n \t\t\treturn TestFail;\n \ndiff --git a/test/camera/statemachine.cpp b/test/camera/statemachine.cpp\nindex f0c3d7764027..9e076d05bc6f 100644\n--- a/test/camera/statemachine.cpp\n+++ b/test/camera/statemachine.cpp\n@@ -118,7 +118,7 @@ protected:\n \t\t/* Use internally allocated buffers. */\n \t\tallocator_ = new FrameBufferAllocator(camera_);\n \t\tStream *stream = *camera_->streams().begin();\n-\t\tif (allocator_->allocate(stream) < 0)\n+\t\tif (allocator_->allocate(stream, 0) < 0)\n \t\t\treturn TestFail;\n \n \t\tif (camera_->start())\ndiff --git a/test/mapped-buffer.cpp b/test/mapped-buffer.cpp\nindex 5de8201e45f6..f5c2e2c0169a 100644\n--- a/test/mapped-buffer.cpp\n+++ b/test/mapped-buffer.cpp\n@@ -54,7 +54,7 @@ protected:\n \n \t\tstream_ = cfg.stream();\n \n-\t\tint ret = allocator_->allocate(stream_);\n+\t\tint ret = allocator_->allocate(stream_, 0);\n \t\tif (ret < 0)\n \t\t\treturn TestFail;\n \n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "1/2"
    ]
}