Patch Detail
Show a patch.
GET /api/1.1/patches/18024/?format=api
{ "id": 18024, "url": "https://patchwork.libcamera.org/api/1.1/patches/18024/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18024/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20221216122939.256534-11-paul.elder@ideasonboard.com>", "date": "2022-12-16T12:29:31", "name": "[libcamera-devel,v9,10/18] libcamera: stream: Remove bufferCount", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "e38ad5e35d3f1012b421172843569d15f04760ab", "submitter": { "id": 17, "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api", "name": "Paul Elder", "email": "paul.elder@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/18024/mbox/", "series": [ { "id": 3675, "url": "https://patchwork.libcamera.org/api/1.1/series/3675/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3675", "date": "2022-12-16T12:29:21", "name": "lc-compliance: Add test to queue more requests than hardware depth", "version": 9, "mbox": "https://patchwork.libcamera.org/series/3675/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18024/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18024/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 1A5FBC31E9\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 16 Dec 2022 12:30:22 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id DBE1F633AF;\n\tFri, 16 Dec 2022 13:30:21 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 74D79633A6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 16 Dec 2022 13:30:19 +0100 (CET)", "from pyrite.tail37cf.ts.net (h175-177-042-159.catv02.itscom.jp\n\t[175.177.42.159])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 10FE2A31;\n\tFri, 16 Dec 2022 13:30:17 +0100 (CET)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1671193821;\n\tbh=5rn9glm+9fKtsqHbxX63cFSTkAujYcQgl49gioiLolo=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=Bis2gH9T32lzobJpTi/XG5e0tcGHyfmrCSzHgaUrWhtKqwCm2ROtr2BcanlmjFSi2\n\t9rgqas8mxxA10qEmE/BW8+0DNKY/SFMKmIyVBKny8UUrAhFWxZnWcYImtwXbCdw2AT\n\tMBogy9+Xe1RKdTQU/N3c+CK58uZThEPJDPCId3pwZPMMkTCuYcO6/NN+y+gFjsV+Vz\n\tR+eNAJfC6EGDdVQbldIFhlqqBl3l1LIFUKxXEeRDZE1CN5niVG+00tyqvx43htrzso\n\td9nUgdDUJx2ftk0CDNg5NtmrdmcJpqPZQDrANdTccu0mKOcA2IXQ0q68R9+NBoEbvH\n\tzdp8G2ZUNM0Ag==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1671193819;\n\tbh=5rn9glm+9fKtsqHbxX63cFSTkAujYcQgl49gioiLolo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=UiZm1M28w3NV2Llaqe18ULdAekx+W0unOm89NgJWQeI4NzLSap/UTt3D1+zfz+mgx\n\tyG7z9YzSQcq+LMTdAJDeBqrRF5XUCiwJ3m3CeegkatFSTDzgYqawgaMjzPbzQL2F72\n\t1KJGVnukKTiFqbqqh99ZyiZaV6igtuio7WRv531c=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"UiZm1M28\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 16 Dec 2022 21:29:31 +0900", "Message-Id": "<20221216122939.256534-11-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.35.1", "In-Reply-To": "<20221216122939.256534-1-paul.elder@ideasonboard.com>", "References": "<20221216122939.256534-1-paul.elder@ideasonboard.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v9 10/18] libcamera: stream: Remove\n\tbufferCount", "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>", "From": "Paul Elder via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Reply-To": "Paul Elder <paul.elder@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "From: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n\nNow that the number of buffers allocated by the FrameBufferAllocator\nhelper is passed through FrameBufferAllocator::allocate() and the\npipelines no longer use bufferCount for internal buffer or V4L2 buffer\nslots allocation, we no longer need to have bufferCount in the\nStreamConfiguration, so remove it.\n\nSigned-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nChanges in v9:\n- rebased\n\nChanges in v8:\n- Updated the pipeline-handler guide to use MinimumRequests instead of\n bufferCount\n- Removed kNumInternalBuffers as it was unused\n\nChanges in v6:\n- Removed IPU3_BUFFER_COUNT as it was unused\n---\n Documentation/guides/pipeline-handler.rst | 15 +++++++++------\n .../internal/converter/converter_v4l2_m2m.h | 3 ---\n include/libcamera/stream.h | 2 --\n src/android/camera_stream.cpp | 2 +-\n src/libcamera/converter/converter_v4l2_m2m.cpp | 3 ---\n src/libcamera/pipeline/ipu3/cio2.cpp | 1 -\n src/libcamera/pipeline/ipu3/ipu3.cpp | 8 --------\n .../pipeline/raspberrypi/raspberrypi.cpp | 6 ------\n src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 2 --\n src/libcamera/pipeline/rkisp1/rkisp1_path.h | 2 --\n src/libcamera/pipeline/simple/simple.cpp | 6 +-----\n src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 3 ---\n src/libcamera/pipeline/vimc/vimc.cpp | 3 ---\n src/libcamera/stream.cpp | 12 +++---------\n test/camera/buffer_import.cpp | 11 ++++++++---\n test/libtest/buffer_source.cpp | 4 ++--\n test/libtest/buffer_source.h | 2 +-\n test/v4l2_videodevice/buffer_cache.cpp | 3 +--\n 18 files changed, 26 insertions(+), 62 deletions(-)", "diff": "diff --git a/Documentation/guides/pipeline-handler.rst b/Documentation/guides/pipeline-handler.rst\nindex 70de82af..1d4314bb 100644\n--- a/Documentation/guides/pipeline-handler.rst\n+++ b/Documentation/guides/pipeline-handler.rst\n@@ -827,14 +827,12 @@ As well as a list of supported StreamFormats, the StreamConfiguration is also\n expected to provide an initialised default configuration. This may be arbitrary,\n but depending on use case you may wish to select an output that matches the\n Sensor output, or prefer a pixelformat which might provide higher performance on\n-the hardware. The bufferCount represents the number of buffers required to\n-support functional continuous processing on this stream.\n+the hardware.\n \n .. code-block:: cpp\n \n cfg.pixelFormat = formats::BGR888;\n cfg.size = { 1280, 720 };\n- cfg.bufferCount = 4;\n \n Finally add each ``StreamConfiguration`` generated to the\n ``CameraConfiguration``, and ensure that it has been validated before returning\n@@ -900,8 +898,6 @@ Add the following function implementation to your file:\n status = Adjusted;\n }\n \n- cfg.bufferCount = 4;\n-\n return status;\n }\n \n@@ -1145,13 +1141,20 @@ is performed by using the ``V4L2VideoDevice`` API, which provides an\n \n .. _FrameBuffer: https://libcamera.org/api-html/classlibcamera_1_1FrameBuffer.html\n \n+The number passed to ``importBuffers()`` should be at least equal to the value\n+of the ``MinimumRequests`` property in order to be possible to queue enough\n+buffers to the video device that frames won't be dropped during capture. A\n+bigger value can be advantageous to reduce the thrashing of dma-buf file\n+descriptor mappings in case the application queues more requests and therefore\n+improve performance, but for simplicity we'll just use ``MinimumRequests``.\n+\n Implement the pipeline handler ``start()`` function by replacing the stub\n version with the following code:\n \n .. code-block:: c++\n \n VividCameraData *data = cameraData(camera);\n- unsigned int count = data->stream_.configuration().bufferCount;\n+ unsigned int count = camera->properties().get(properties::MinimumRequests);\n \n int ret = data->video_->importBuffers(count);\n if (ret < 0)\ndiff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h\nindex 1f471071..bcc03347 100644\n--- a/include/libcamera/internal/converter/converter_v4l2_m2m.h\n+++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h\n@@ -86,9 +86,6 @@ private:\n \t\tV4L2M2MConverter *converter_;\n \t\tunsigned int index_;\n \t\tstd::unique_ptr<V4L2M2MDevice> m2m_;\n-\n-\t\tunsigned int inputBufferCount_;\n-\t\tunsigned int outputBufferCount_;\n \t};\n \n \tstd::unique_ptr<V4L2M2MDevice> m2m_;\ndiff --git a/include/libcamera/stream.h b/include/libcamera/stream.h\nindex 29235ddf..dba9b453 100644\n--- a/include/libcamera/stream.h\n+++ b/include/libcamera/stream.h\n@@ -47,8 +47,6 @@ struct StreamConfiguration {\n \tunsigned int stride;\n \tunsigned int frameSize;\n \n-\tunsigned int bufferCount;\n-\n \tstd::optional<ColorSpace> colorSpace;\n \n \tStream *stream() const { return stream_; }\ndiff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp\nindex 045e6006..f51f0c3a 100644\n--- a/src/android/camera_stream.cpp\n+++ b/src/android/camera_stream.cpp\n@@ -131,7 +131,7 @@ int CameraStream::configure()\n \tallocator_ = std::make_unique<PlatformFrameBufferAllocator>(cameraDevice_);\n \tmutex_ = std::make_unique<Mutex>();\n \n-\tcamera3Stream_->max_buffers = configuration().bufferCount;\n+\tcamera3Stream_->max_buffers = bufferCount;\n \n \treturn 0;\n }\ndiff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp\nindex 9d25f25a..b9372804 100644\n--- a/src/libcamera/converter/converter_v4l2_m2m.cpp\n+++ b/src/libcamera/converter/converter_v4l2_m2m.cpp\n@@ -95,9 +95,6 @@ int V4L2M2MConverter::Stream::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 \ndiff --git a/src/libcamera/pipeline/ipu3/cio2.cpp b/src/libcamera/pipeline/ipu3/cio2.cpp\nindex feb69991..02dc9406 100644\n--- a/src/libcamera/pipeline/ipu3/cio2.cpp\n+++ b/src/libcamera/pipeline/ipu3/cio2.cpp\n@@ -234,7 +234,6 @@ StreamConfiguration CIO2Device::generateConfiguration(Size size) const\n \n \tcfg.size = sensorFormat.size;\n \tcfg.pixelFormat = mbusCodesToPixelFormat.at(sensorFormat.mbus_code);\n-\tcfg.bufferCount = kBufferCount;\n \n \treturn cfg;\n }\ndiff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp\nindex 4d8fcfeb..4511adde 100644\n--- a/src/libcamera/pipeline/ipu3/ipu3.cpp\n+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp\n@@ -98,7 +98,6 @@ private:\n class IPU3CameraConfiguration : public CameraConfiguration\n {\n public:\n-\tstatic constexpr unsigned int kBufferCount = 4;\n \tstatic constexpr unsigned int kMaxStreams = 3;\n \n \tIPU3CameraConfiguration(IPU3CameraData *data);\n@@ -326,7 +325,6 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \t\t\t/* Initialize the RAW stream with the CIO2 configuration. */\n \t\t\tcfg->size = cio2Configuration_.size;\n \t\t\tcfg->pixelFormat = cio2Configuration_.pixelFormat;\n-\t\t\tcfg->bufferCount = cio2Configuration_.bufferCount;\n \t\t\tcfg->stride = info.stride(cfg->size.width, 0, 64);\n \t\t\tcfg->frameSize = info.frameSize(cfg->size, 64);\n \t\t\tcfg->setStream(const_cast<Stream *>(&data_->rawStream_));\n@@ -370,7 +368,6 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate()\n \t\t\t\t\t ImgUDevice::kOutputAlignHeight);\n \n \t\t\tcfg->pixelFormat = formats::NV12;\n-\t\t\tcfg->bufferCount = kBufferCount;\n \t\t\tcfg->stride = info.stride(cfg->size.width, 0, 1);\n \t\t\tcfg->frameSize = info.frameSize(cfg->size, 1);\n \n@@ -439,7 +436,6 @@ PipelineHandlerIPU3::generateConfiguration(Camera *camera, const StreamRoles &ro\n \tSize sensorResolution = data->cio2_.sensor()->resolution();\n \tfor (const StreamRole role : roles) {\n \t\tstd::map<PixelFormat, std::vector<SizeRange>> streamFormats;\n-\t\tunsigned int bufferCount;\n \t\tPixelFormat pixelFormat;\n \t\tSize size;\n \n@@ -459,7 +455,6 @@ PipelineHandlerIPU3::generateConfiguration(Camera *camera, const StreamRoles &ro\n \t\t\t\t\t .alignedDownTo(ImgUDevice::kOutputMarginWidth,\n \t\t\t\t\t\t\t ImgUDevice::kOutputMarginHeight);\n \t\t\tpixelFormat = formats::NV12;\n-\t\t\tbufferCount = IPU3CameraConfiguration::kBufferCount;\n \t\t\tstreamFormats[pixelFormat] = { { ImgUDevice::kOutputMinSize, size } };\n \n \t\t\tbreak;\n@@ -469,7 +464,6 @@ PipelineHandlerIPU3::generateConfiguration(Camera *camera, const StreamRoles &ro\n \t\t\t\tdata->cio2_.generateConfiguration(sensorResolution);\n \t\t\tpixelFormat = cio2Config.pixelFormat;\n \t\t\tsize = cio2Config.size;\n-\t\t\tbufferCount = cio2Config.bufferCount;\n \n \t\t\tfor (const PixelFormat &format : data->cio2_.formats())\n \t\t\t\tstreamFormats[format] = data->cio2_.sizes(format);\n@@ -488,7 +482,6 @@ PipelineHandlerIPU3::generateConfiguration(Camera *camera, const StreamRoles &ro\n \t\t\t\t\t .alignedDownTo(ImgUDevice::kOutputAlignWidth,\n \t\t\t\t\t\t\t ImgUDevice::kOutputAlignHeight);\n \t\t\tpixelFormat = formats::NV12;\n-\t\t\tbufferCount = IPU3CameraConfiguration::kBufferCount;\n \t\t\tstreamFormats[pixelFormat] = { { ImgUDevice::kOutputMinSize, size } };\n \n \t\t\tbreak;\n@@ -504,7 +497,6 @@ PipelineHandlerIPU3::generateConfiguration(Camera *camera, const StreamRoles &ro\n \t\tStreamConfiguration cfg(formats);\n \t\tcfg.size = size;\n \t\tcfg.pixelFormat = pixelFormat;\n-\t\tcfg.bufferCount = bufferCount;\n \t\tconfig->addConfiguration(cfg);\n \t}\n \ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 72502c36..c0d96024 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -591,7 +591,6 @@ PipelineHandlerRPi::generateConfiguration(Camera *camera, const StreamRoles &rol\n \tstd::unique_ptr<CameraConfiguration> config =\n \t\tstd::make_unique<RPiCameraConfiguration>(data);\n \tV4L2SubdeviceFormat sensorFormat;\n-\tunsigned int bufferCount;\n \tPixelFormat pixelFormat;\n \tV4L2VideoDevice::Formats fmts;\n \tSize size;\n@@ -612,7 +611,6 @@ PipelineHandlerRPi::generateConfiguration(Camera *camera, const StreamRoles &rol\n \t\t\t\t\t\t\t BayerFormat::Packing::CSI2);\n \t\t\tASSERT(pixelFormat.isValid());\n \t\t\tcolorSpace = ColorSpace::Raw;\n-\t\t\tbufferCount = 2;\n \t\t\trawCount++;\n \t\t\tbreak;\n \n@@ -627,7 +625,6 @@ PipelineHandlerRPi::generateConfiguration(Camera *camera, const StreamRoles &rol\n \t\t\tcolorSpace = ColorSpace::Sycc;\n \t\t\t/* Return the largest sensor resolution. */\n \t\t\tsize = sensorSize;\n-\t\t\tbufferCount = 1;\n \t\t\toutCount++;\n \t\t\tbreak;\n \n@@ -648,7 +645,6 @@ PipelineHandlerRPi::generateConfiguration(Camera *camera, const StreamRoles &rol\n \t\t\t */\n \t\t\tcolorSpace = ColorSpace::Rec709;\n \t\t\tsize = { 1920, 1080 };\n-\t\t\tbufferCount = 4;\n \t\t\toutCount++;\n \t\t\tbreak;\n \n@@ -657,7 +653,6 @@ PipelineHandlerRPi::generateConfiguration(Camera *camera, const StreamRoles &rol\n \t\t\tpixelFormat = formats::ARGB8888;\n \t\t\tcolorSpace = ColorSpace::Sycc;\n \t\t\tsize = { 800, 600 };\n-\t\t\tbufferCount = 4;\n \t\t\toutCount++;\n \t\t\tbreak;\n \n@@ -704,7 +699,6 @@ PipelineHandlerRPi::generateConfiguration(Camera *camera, const StreamRoles &rol\n \t\tcfg.size = size;\n \t\tcfg.pixelFormat = pixelFormat;\n \t\tcfg.colorSpace = colorSpace;\n-\t\tcfg.bufferCount = bufferCount;\n \t\tconfig->addConfiguration(cfg);\n \t}\n \ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\nindex a168e0ad..9ef9c3e2 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp\n@@ -190,7 +190,6 @@ RkISP1Path::generateConfiguration(const CameraSensor *sensor, StreamRole role)\n \tStreamConfiguration cfg(formats);\n \tcfg.pixelFormat = format;\n \tcfg.size = maxResolution;\n-\tcfg.bufferCount = RKISP1_BUFFER_COUNT;\n \n \treturn cfg;\n }\n@@ -280,7 +279,6 @@ CameraConfiguration::Status RkISP1Path::validate(const CameraSensor *sensor,\n \n \tcfg->size.boundTo(maxResolution);\n \tcfg->size.expandTo(minResolution);\n-\tcfg->bufferCount = RKISP1_BUFFER_COUNT;\n \n \tV4L2DeviceFormat format;\n \tformat.fourcc = video_->toV4L2PixelFormat(cfg->pixelFormat);\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\nindex 5b53783c..366720de 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h\n@@ -63,8 +63,6 @@ public:\n private:\n \tvoid populateFormats();\n \n-\tstatic constexpr unsigned int RKISP1_BUFFER_COUNT = 4;\n-\n \tconst char *name_;\n \tbool running_;\n \ndiff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp\nindex 196e5252..5d309777 100644\n--- a/src/libcamera/pipeline/simple/simple.cpp\n+++ b/src/libcamera/pipeline/simple/simple.cpp\n@@ -338,7 +338,6 @@ protected:\n \tint queueRequestDevice(Camera *camera, Request *request) override;\n \n private:\n-\tstatic constexpr unsigned int kNumInternalBuffers = 3;\n \tstatic constexpr unsigned int kSimpleBufferSlotCount = 16;\n \n \tstruct EntityData {\n@@ -1010,7 +1009,7 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()\n \t\t cfg.size != pipeConfig_->captureSize)\n \t\t\tneedConversion_ = true;\n \n-\t\t/* Set the stride, frameSize and bufferCount. */\n+\t\t/* Set the stride and frameSize. */\n \t\tif (needConversion_) {\n \t\t\tstd::tie(cfg.stride, cfg.frameSize) =\n \t\t\t\tdata_->converter_->strideAndFrameSize(cfg.pixelFormat,\n@@ -1029,8 +1028,6 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()\n \t\t\tcfg.stride = format.planes[0].bpl;\n \t\t\tcfg.frameSize = format.planes[0].size;\n \t\t}\n-\n-\t\tcfg.bufferCount = 3;\n \t}\n \n \treturn status;\n@@ -1174,7 +1171,6 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)\n \tinputCfg.pixelFormat = pipeConfig->captureFormat;\n \tinputCfg.size = pipeConfig->captureSize;\n \tinputCfg.stride = captureFormat.planes[0].bpl;\n-\tinputCfg.bufferCount = kNumInternalBuffers;\n \n \t/* Set the MinimumRequests property. */\n \tunsigned int minimumRequests;\ndiff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\nindex 18966d01..5d88e6f3 100644\n--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp\n@@ -154,8 +154,6 @@ CameraConfiguration::Status UVCCameraConfiguration::validate()\n \t\tstatus = Adjusted;\n \t}\n \n-\tcfg.bufferCount = 4;\n-\n \tV4L2DeviceFormat format;\n \tformat.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n \tformat.size = cfg.size;\n@@ -196,7 +194,6 @@ PipelineHandlerUVC::generateConfiguration(Camera *camera,\n \n \tcfg.pixelFormat = formats.pixelformats().front();\n \tcfg.size = formats.sizes(cfg.pixelFormat).back();\n-\tcfg.bufferCount = 4;\n \n \tconfig->addConfiguration(cfg);\n \ndiff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp\nindex eaa6ebf7..ef5146f9 100644\n--- a/src/libcamera/pipeline/vimc/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc/vimc.cpp\n@@ -171,8 +171,6 @@ CameraConfiguration::Status VimcCameraConfiguration::validate()\n \t\tstatus = Adjusted;\n \t}\n \n-\tcfg.bufferCount = 4;\n-\n \tV4L2DeviceFormat format;\n \tformat.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);\n \tformat.size = cfg.size;\n@@ -230,7 +228,6 @@ PipelineHandlerVimc::generateConfiguration(Camera *camera,\n \n \tcfg.pixelFormat = formats::BGR888;\n \tcfg.size = { 1920, 1080 };\n-\tcfg.bufferCount = 4;\n \n \tconfig->addConfiguration(cfg);\n \ndiff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp\nindex 67f30815..aa61c855 100644\n--- a/src/libcamera/stream.cpp\n+++ b/src/libcamera/stream.cpp\n@@ -280,8 +280,7 @@ SizeRange StreamFormats::range(const PixelFormat &pixelformat) const\n * handlers provide StreamFormats.\n */\n StreamConfiguration::StreamConfiguration()\n-\t: pixelFormat(0), stride(0), frameSize(0), bufferCount(0),\n-\t stream_(nullptr)\n+\t: pixelFormat(0), stride(0), frameSize(0), stream_(nullptr)\n {\n }\n \n@@ -289,8 +288,8 @@ StreamConfiguration::StreamConfiguration()\n * \\brief Construct a configuration with stream formats\n */\n StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n-\t: pixelFormat(0), stride(0), frameSize(0), bufferCount(0),\n-\t stream_(nullptr), formats_(formats)\n+\t: pixelFormat(0), stride(0), frameSize(0), stream_(nullptr),\n+\t formats_(formats)\n {\n }\n \n@@ -324,11 +323,6 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats)\n * validating the configuration with a call to CameraConfiguration::validate().\n */\n \n-/**\n- * \\var StreamConfiguration::bufferCount\n- * \\brief Requested number of buffers to allocate for the stream\n- */\n-\n /**\n * \\var StreamConfiguration::colorSpace\n * \\brief The ColorSpace for this stream\ndiff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp\nindex 92884004..cb7a0cef 100644\n--- a/test/camera/buffer_import.cpp\n+++ b/test/camera/buffer_import.cpp\n@@ -16,6 +16,8 @@\n #include <libcamera/base/thread.h>\n #include <libcamera/base/timer.h>\n \n+#include <libcamera/property_ids.h>\n+\n #include \"libcamera/internal/device_enumerator.h\"\n #include \"libcamera/internal/media_device.h\"\n #include \"libcamera/internal/v4l2_videodevice.h\"\n@@ -93,10 +95,13 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n+\t\tunsigned int bufferCount =\n+\t\t\tcamera_->properties().get(properties::MinimumRequests).value();\n+\n \t\tStream *stream = cfg.stream();\n \n \t\tBufferSource source;\n-\t\tint ret = source.allocate(cfg);\n+\t\tint ret = source.allocate(cfg, bufferCount);\n \t\tif (ret != TestPass)\n \t\t\treturn ret;\n \n@@ -140,10 +145,10 @@ protected:\n \t\twhile (timer.isRunning())\n \t\t\tdispatcher->processEvents();\n \n-\t\tif (completeRequestsCount_ < cfg.bufferCount * 2) {\n+\t\tif (completeRequestsCount_ < bufferCount * 2) {\n \t\t\tstd::cout << \"Failed to capture enough frames (got \"\n \t\t\t\t << completeRequestsCount_ << \" expected at least \"\n-\t\t\t\t << cfg.bufferCount * 2 << \")\" << std::endl;\n+\t\t\t\t << bufferCount * 2 << \")\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \ndiff --git a/test/libtest/buffer_source.cpp b/test/libtest/buffer_source.cpp\nindex dde11f36..c1bc45db 100644\n--- a/test/libtest/buffer_source.cpp\n+++ b/test/libtest/buffer_source.cpp\n@@ -26,7 +26,7 @@ BufferSource::~BufferSource()\n \t\tmedia_->release();\n }\n \n-int BufferSource::allocate(const StreamConfiguration &config)\n+int BufferSource::allocate(const StreamConfiguration &config, unsigned int count)\n {\n \t/* Locate and open the video device. */\n \tstd::string videoDeviceName = \"vivid-000-vid-out\";\n@@ -78,7 +78,7 @@ int BufferSource::allocate(const StreamConfiguration &config)\n \t\treturn TestFail;\n \t}\n \n-\tif (video->allocateBuffers(config.bufferCount, &buffers_) < 0) {\n+\tif (video->allocateBuffers(count, &buffers_) < 0) {\n \t\tstd::cout << \"Failed to allocate buffers\" << std::endl;\n \t\treturn TestFail;\n \t}\ndiff --git a/test/libtest/buffer_source.h b/test/libtest/buffer_source.h\nindex 0cc71aa5..f430a7f3 100644\n--- a/test/libtest/buffer_source.h\n+++ b/test/libtest/buffer_source.h\n@@ -18,7 +18,7 @@ public:\n \tBufferSource();\n \t~BufferSource();\n \n-\tint allocate(const libcamera::StreamConfiguration &config);\n+\tint allocate(const libcamera::StreamConfiguration &config, unsigned int count);\n \tconst std::vector<std::unique_ptr<libcamera::FrameBuffer>> &buffers();\n \n private:\ndiff --git a/test/v4l2_videodevice/buffer_cache.cpp b/test/v4l2_videodevice/buffer_cache.cpp\nindex 5a9aa219..8d2cf6d1 100644\n--- a/test/v4l2_videodevice/buffer_cache.cpp\n+++ b/test/v4l2_videodevice/buffer_cache.cpp\n@@ -174,10 +174,9 @@ public:\n \t\tStreamConfiguration cfg;\n \t\tcfg.pixelFormat = formats::YUYV;\n \t\tcfg.size = Size(600, 800);\n-\t\tcfg.bufferCount = numBuffers;\n \n \t\tBufferSource source;\n-\t\tint ret = source.allocate(cfg);\n+\t\tint ret = source.allocate(cfg, numBuffers);\n \t\tif (ret != TestPass)\n \t\t\treturn ret;\n \n", "prefixes": [ "libcamera-devel", "v9", "10/18" ] }