From patchwork Mon Apr 28 09:02:36 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Sven_P=C3=BCschel?= X-Patchwork-Id: 23283 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 9E4FCC3324 for ; Mon, 28 Apr 2025 09:05:30 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C040868B46; Mon, 28 Apr 2025 11:05:29 +0200 (CEST) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id E006068ADE for ; Mon, 28 Apr 2025 11:05:07 +0200 (CEST) Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=peter.guest.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1u9KQF-0001au-JB; Mon, 28 Apr 2025 11:05:07 +0200 From: =?utf-8?q?Sven_P=C3=BCschel?= To: libcamera-devel@lists.libcamera.org Cc: =?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= , Paul Elder , =?utf-8?q?Sven_P=C3=BCschel?= Subject: [PATCH v11 11/19] libcamera: stream: Remove bufferCount Date: Mon, 28 Apr 2025 11:02:36 +0200 Message-ID: <20250428090413.38234-12-s.pueschel@pengutronix.de> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250428090413.38234-1-s.pueschel@pengutronix.de> References: <20250428090413.38234-1-s.pueschel@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: s.pueschel@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: libcamera-devel@lists.libcamera.org X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" From: Nícolas F. R. A. Prado Now that the number of buffers allocated by the FrameBufferAllocator helper is passed through FrameBufferAllocator::allocate() and the pipelines no longer use bufferCount for internal buffer or V4L2 buffer slots allocation, we no longer need to have bufferCount in the StreamConfiguration, so remove it. Signed-off-by: Nícolas F. R. A. Prado Reviewed-by: Paul Elder Signed-off-by: Paul Elder Signed-off-by: Sven Püschel --- Changes in v11: - add mali-c55 and virtual Changes in v10: - fix compilation error (android and pycamera) - add isi Changes in v9: - rebased Changes in v8: - Updated the pipeline-handler guide to use MinimumRequests instead of bufferCount - Removed kNumInternalBuffers as it was unused Changes in v6: - Removed IPU3_BUFFER_COUNT as it was unused --- Documentation/guides/pipeline-handler.rst | 15 +++++++++------ .../internal/converter/converter_v4l2_m2m.h | 3 --- include/libcamera/stream.h | 2 -- src/android/camera_stream.cpp | 5 ++++- src/apps/lc-compliance/helpers/capture.cpp | 14 -------------- src/libcamera/converter/converter_v4l2_m2m.cpp | 3 --- src/libcamera/pipeline/imx8-isi/imx8-isi.cpp | 2 -- src/libcamera/pipeline/ipu3/ipu3.cpp | 8 -------- src/libcamera/pipeline/mali-c55/mali-c55.cpp | 1 - src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 2 -- src/libcamera/pipeline/rkisp1/rkisp1_path.h | 2 -- src/libcamera/pipeline/simple/simple.cpp | 6 +----- src/libcamera/pipeline/uvcvideo/uvcvideo.cpp | 3 --- src/libcamera/pipeline/vimc/vimc.cpp | 3 --- src/libcamera/pipeline/virtual/virtual.cpp | 5 ----- src/libcamera/stream.cpp | 12 +++--------- src/py/libcamera/py_main.cpp | 1 - test/camera/buffer_import.cpp | 9 +++++++-- test/libtest/buffer_source.cpp | 4 ++-- test/libtest/buffer_source.h | 2 +- test/v4l2_videodevice/buffer_cache.cpp | 3 +-- 21 files changed, 28 insertions(+), 77 deletions(-) diff --git a/Documentation/guides/pipeline-handler.rst b/Documentation/guides/pipeline-handler.rst index 2e9825dc..725e35e6 100644 --- a/Documentation/guides/pipeline-handler.rst +++ b/Documentation/guides/pipeline-handler.rst @@ -882,14 +882,12 @@ As well as a list of supported StreamFormats, the StreamConfiguration is also expected to provide an initialised default configuration. This may be arbitrary, but depending on use case you may wish to select an output that matches the Sensor output, or prefer a pixelformat which might provide higher performance on -the hardware. The bufferCount represents the number of buffers required to -support functional continuous processing on this stream. +the hardware. .. code-block:: cpp cfg.pixelFormat = formats::BGR888; cfg.size = { 1280, 720 }; - cfg.bufferCount = 4; Finally add each ``StreamConfiguration`` generated to the ``CameraConfiguration``, and ensure that it has been validated before returning @@ -955,8 +953,6 @@ Add the following function implementation to your file: status = Adjusted; } - cfg.bufferCount = 4; - return status; } @@ -1200,13 +1196,20 @@ is performed by using the ``V4L2VideoDevice`` API, which provides an .. _FrameBuffer: https://libcamera.org/api-html/classlibcamera_1_1FrameBuffer.html +The number passed to ``importBuffers()`` should be at least equal to the value +of the ``MinimumRequests`` property in order to be possible to queue enough +buffers to the video device that frames won't be dropped during capture. A +bigger value can be advantageous to reduce the thrashing of dma-buf file +descriptor mappings in case the application queues more requests and therefore +improve performance, but for simplicity we'll just use ``MinimumRequests``. + Implement the pipeline handler ``start()`` function by replacing the stub version with the following code: .. code-block:: c++ VividCameraData *data = cameraData(camera); - unsigned int count = data->stream_.configuration().bufferCount; + unsigned int count = camera->properties().get(properties::MinimumRequests); int ret = data->video_->importBuffers(count); if (ret < 0) diff --git a/include/libcamera/internal/converter/converter_v4l2_m2m.h b/include/libcamera/internal/converter/converter_v4l2_m2m.h index 24997c6f..b32c338c 100644 --- a/include/libcamera/internal/converter/converter_v4l2_m2m.h +++ b/include/libcamera/internal/converter/converter_v4l2_m2m.h @@ -106,9 +106,6 @@ private: const Stream *stream_; std::unique_ptr m2m_; - unsigned int inputBufferCount_; - unsigned int outputBufferCount_; - std::pair inputCropBounds_; }; diff --git a/include/libcamera/stream.h b/include/libcamera/stream.h index b5e8f0a9..a75a82a0 100644 --- a/include/libcamera/stream.h +++ b/include/libcamera/stream.h @@ -46,8 +46,6 @@ struct StreamConfiguration { unsigned int stride; unsigned int frameSize; - unsigned int bufferCount; - std::optional colorSpace; Stream *stream() const { return stream_; } diff --git a/src/android/camera_stream.cpp b/src/android/camera_stream.cpp index 1d68540d..9b11c3fa 100644 --- a/src/android/camera_stream.cpp +++ b/src/android/camera_stream.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "jpeg/post_processor_jpeg.h" #include "yuv/post_processor_yuv.h" @@ -131,7 +132,9 @@ int CameraStream::configure() allocator_ = std::make_unique(cameraDevice_); mutex_ = std::make_unique(); - camera3Stream_->max_buffers = configuration().bufferCount; + unsigned int bufferCount = + cameraDevice_->camera()->properties().get(properties::MinimumRequests).value(); + camera3Stream_->max_buffers = bufferCount; return 0; } diff --git a/src/apps/lc-compliance/helpers/capture.cpp b/src/apps/lc-compliance/helpers/capture.cpp index 690de005..5e8b5df6 100644 --- a/src/apps/lc-compliance/helpers/capture.cpp +++ b/src/apps/lc-compliance/helpers/capture.cpp @@ -33,20 +33,6 @@ void Capture::configure(libcamera::Span roles) ASSERT_EQ(config_->size(), roles.size()) << "Unexpected number of streams in configuration"; - /* - * Set the buffers count to the largest value across all streams. - * \todo: Should all streams from a Camera have the same buffer count ? - */ - auto largest = - std::max_element(config_->begin(), config_->end(), - [](const StreamConfiguration &l, const StreamConfiguration &r) - { return l.bufferCount < r.bufferCount; }); - - assert(largest != config_->end()); - - for (auto &cfg : *config_) - cfg.bufferCount = largest->bufferCount; - if (config_->validate() != CameraConfiguration::Valid) { config_.reset(); FAIL() << "Configuration not valid"; diff --git a/src/libcamera/converter/converter_v4l2_m2m.cpp b/src/libcamera/converter/converter_v4l2_m2m.cpp index 242e0d85..3efd1f76 100644 --- a/src/libcamera/converter/converter_v4l2_m2m.cpp +++ b/src/libcamera/converter/converter_v4l2_m2m.cpp @@ -141,9 +141,6 @@ int V4L2M2MConverter::V4L2M2MStream::configure(const StreamConfiguration &inputC return -EINVAL; } - inputBufferCount_ = inputCfg.bufferCount; - outputBufferCount_ = outputCfg.bufferCount; - if (converter_->features() & Feature::InputCrop) { ret = getCropBounds(m2m_->output(), inputCropBounds_.first, inputCropBounds_.second); diff --git a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp index efb280d7..3d2e6a3d 100644 --- a/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp +++ b/src/libcamera/pipeline/imx8-isi/imx8-isi.cpp @@ -666,7 +666,6 @@ StreamConfiguration PipelineHandlerISI::generateYUVConfiguration(Camera *camera, StreamConfiguration cfg(formats); cfg.pixelFormat = pixelFormat; cfg.size = sensorSize; - cfg.bufferCount = 4; return cfg; } @@ -734,7 +733,6 @@ StreamConfiguration PipelineHandlerISI::generateRawConfiguration(Camera *camera) StreamConfiguration cfg(formats); cfg.size = sensor->resolution(); cfg.pixelFormat = pixelFormat; - cfg.bufferCount = 4; return cfg; } diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index 665466c7..c8b25913 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -97,7 +97,6 @@ private: class IPU3CameraConfiguration : public CameraConfiguration { public: - static constexpr unsigned int kBufferCount = 4; static constexpr unsigned int kMaxStreams = 3; IPU3CameraConfiguration(IPU3CameraData *data); @@ -293,7 +292,6 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate() /* Initialize the RAW stream with the CIO2 configuration. */ cfg->size = cio2Configuration_.size; cfg->pixelFormat = cio2Configuration_.pixelFormat; - cfg->bufferCount = cio2Configuration_.bufferCount; cfg->stride = info.stride(cfg->size.width, 0, 64); cfg->frameSize = info.frameSize(cfg->size, 64); cfg->setStream(const_cast(&data_->rawStream_)); @@ -337,7 +335,6 @@ CameraConfiguration::Status IPU3CameraConfiguration::validate() ImgUDevice::kOutputAlignHeight); cfg->pixelFormat = formats::NV12; - cfg->bufferCount = kBufferCount; cfg->stride = info.stride(cfg->size.width, 0, 1); cfg->frameSize = info.frameSize(cfg->size, 1); @@ -406,7 +403,6 @@ PipelineHandlerIPU3::generateConfiguration(Camera *camera, Spancio2_.sensor()->resolution(); for (const StreamRole role : roles) { std::map> streamFormats; - unsigned int bufferCount; PixelFormat pixelFormat; Size size; @@ -426,7 +422,6 @@ PipelineHandlerIPU3::generateConfiguration(Camera *camera, Spancio2_.generateConfiguration(sensorResolution); pixelFormat = cio2Config.pixelFormat; size = cio2Config.size; - bufferCount = cio2Config.bufferCount; for (const PixelFormat &format : data->cio2_.formats()) streamFormats[format] = data->cio2_.sizes(format); @@ -455,7 +449,6 @@ PipelineHandlerIPU3::generateConfiguration(Camera *camera, SpanaddConfiguration(cfg); } diff --git a/src/libcamera/pipeline/mali-c55/mali-c55.cpp b/src/libcamera/pipeline/mali-c55/mali-c55.cpp index 726d9780..0ce19b16 100644 --- a/src/libcamera/pipeline/mali-c55/mali-c55.cpp +++ b/src/libcamera/pipeline/mali-c55/mali-c55.cpp @@ -818,7 +818,6 @@ PipelineHandlerMaliC55::generateConfiguration(Camera *camera, StreamFormats streamFormats(formats); StreamConfiguration cfg(streamFormats); cfg.pixelFormat = pixelFormat; - cfg.bufferCount = 4; cfg.size = size; config->addConfiguration(cfg); diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp index 6a5b22ba..e07be15e 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp @@ -249,7 +249,6 @@ RkISP1Path::generateConfiguration(const CameraSensor *sensor, const Size &size, StreamConfiguration cfg(formats); cfg.pixelFormat = format; cfg.size = streamSize; - cfg.bufferCount = RKISP1_BUFFER_COUNT; return cfg; } @@ -383,7 +382,6 @@ RkISP1Path::validate(const CameraSensor *sensor, cfg->size.boundTo(maxResolution); cfg->size.expandTo(minResolution); - cfg->bufferCount = RKISP1_BUFFER_COUNT; V4L2DeviceFormat format; format.fourcc = video_->toV4L2PixelFormat(cfg->pixelFormat); diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.h b/src/libcamera/pipeline/rkisp1/rkisp1_path.h index 7365275d..d7c50f3a 100644 --- a/src/libcamera/pipeline/rkisp1/rkisp1_path.h +++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.h @@ -69,8 +69,6 @@ private: void populateFormats(); Size filterSensorResolution(const CameraSensor *sensor); - static constexpr unsigned int RKISP1_BUFFER_COUNT = 4; - const char *name_; bool running_; diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 4f4cba06..c49ea6f6 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -421,7 +421,6 @@ protected: int queueRequestDevice(Camera *camera, Request *request) override; private: - static constexpr unsigned int kNumInternalBuffers = 3; static constexpr unsigned int kSimpleBufferSlotCount = 16; struct EntityData { @@ -1239,7 +1238,7 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate() cfg.size != pipeConfig_->captureSize) needConversion_ = true; - /* Set the stride, frameSize and bufferCount. */ + /* Set the stride and frameSize. */ if (needConversion_) { std::tie(cfg.stride, cfg.frameSize) = data_->converter_ @@ -1261,8 +1260,6 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate() cfg.stride = format.planes[0].bpl; cfg.frameSize = format.planes[0].size; } - - cfg.bufferCount = 4; } return status; @@ -1407,7 +1404,6 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c) inputCfg.pixelFormat = pipeConfig->captureFormat; inputCfg.size = pipeConfig->captureSize; inputCfg.stride = captureFormat.planes[0].bpl; - inputCfg.bufferCount = kNumInternalBuffers; if (data->converter_) { /* diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp index e1259cf3..c3b718f9 100644 --- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp +++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp @@ -186,8 +186,6 @@ CameraConfiguration::Status UVCCameraConfiguration::validate() status = Adjusted; } - cfg.bufferCount = 4; - V4L2DeviceFormat format; format.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat); format.size = cfg.size; @@ -248,7 +246,6 @@ PipelineHandlerUVC::generateConfiguration(Camera *camera, cfg.pixelFormat = formats.pixelformats().front(); cfg.size = formats.sizes(cfg.pixelFormat).back(); - cfg.bufferCount = 4; config->addConfiguration(cfg); diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp index e66dbd78..2632a1ab 100644 --- a/src/libcamera/pipeline/vimc/vimc.cpp +++ b/src/libcamera/pipeline/vimc/vimc.cpp @@ -183,8 +183,6 @@ CameraConfiguration::Status VimcCameraConfiguration::validate() status = Adjusted; } - cfg.bufferCount = 4; - V4L2DeviceFormat format; format.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat); format.size = cfg.size; @@ -244,7 +242,6 @@ PipelineHandlerVimc::generateConfiguration(Camera *camera, cfg.pixelFormat = formats::BGR888; cfg.size = { 1920, 1080 }; - cfg.bufferCount = 4; config->addConfiguration(cfg); diff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp index ad2bdb57..60c06d4e 100644 --- a/src/libcamera/pipeline/virtual/virtual.cpp +++ b/src/libcamera/pipeline/virtual/virtual.cpp @@ -67,8 +67,6 @@ overloaded(Ts...) -> overloaded; class VirtualCameraConfiguration : public CameraConfiguration { public: - static constexpr unsigned int kBufferCount = 4; - VirtualCameraConfiguration(VirtualCameraData *data); Status validate() override; @@ -188,8 +186,6 @@ CameraConfiguration::Status VirtualCameraConfiguration::validate() const PixelFormatInfo &info = PixelFormatInfo::info(cfg.pixelFormat); cfg.stride = info.stride(cfg.size.width, 0, 1); cfg.frameSize = info.frameSize(cfg.size, 1); - - cfg.bufferCount = VirtualCameraConfiguration::kBufferCount; } return status; @@ -244,7 +240,6 @@ PipelineHandlerVirtual::generateConfiguration(Camera *camera, StreamConfiguration cfg(formats); cfg.pixelFormat = pixelFormat; cfg.size = data->config_.maxResolutionSize; - cfg.bufferCount = VirtualCameraConfiguration::kBufferCount; config->addConfiguration(cfg); } diff --git a/src/libcamera/stream.cpp b/src/libcamera/stream.cpp index 978d7275..684bc209 100644 --- a/src/libcamera/stream.cpp +++ b/src/libcamera/stream.cpp @@ -280,8 +280,7 @@ SizeRange StreamFormats::range(const PixelFormat &pixelformat) const * handlers provide StreamFormats. */ StreamConfiguration::StreamConfiguration() - : pixelFormat(0), stride(0), frameSize(0), bufferCount(0), - stream_(nullptr) + : pixelFormat(0), stride(0), frameSize(0), stream_(nullptr) { } @@ -289,8 +288,8 @@ StreamConfiguration::StreamConfiguration() * \brief Construct a configuration with stream formats */ StreamConfiguration::StreamConfiguration(const StreamFormats &formats) - : pixelFormat(0), stride(0), frameSize(0), bufferCount(0), - stream_(nullptr), formats_(formats) + : pixelFormat(0), stride(0), frameSize(0), stream_(nullptr), + formats_(formats) { } @@ -325,11 +324,6 @@ StreamConfiguration::StreamConfiguration(const StreamFormats &formats) * validating the configuration with a call to CameraConfiguration::validate(). */ -/** - * \var StreamConfiguration::bufferCount - * \brief Requested number of buffers to allocate for the stream - */ - /** * \var StreamConfiguration::colorSpace * \brief The ColorSpace for this stream diff --git a/src/py/libcamera/py_main.cpp b/src/py/libcamera/py_main.cpp index f75450ee..10e1d5cb 100644 --- a/src/py/libcamera/py_main.cpp +++ b/src/py/libcamera/py_main.cpp @@ -337,7 +337,6 @@ PYBIND11_MODULE(_libcamera, m) .def_readwrite("pixel_format", &StreamConfiguration::pixelFormat) .def_readwrite("stride", &StreamConfiguration::stride) .def_readwrite("frame_size", &StreamConfiguration::frameSize) - .def_readwrite("buffer_count", &StreamConfiguration::bufferCount) .def_property_readonly("formats", &StreamConfiguration::formats, py::return_value_policy::reference_internal) .def_readwrite("color_space", &StreamConfiguration::colorSpace); diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp index 815d1cae..47958898 100644 --- a/test/camera/buffer_import.cpp +++ b/test/camera/buffer_import.cpp @@ -16,6 +16,8 @@ #include #include +#include + #include "libcamera/internal/device_enumerator.h" #include "libcamera/internal/media_device.h" #include "libcamera/internal/v4l2_videodevice.h" @@ -97,10 +99,13 @@ protected: return TestFail; } + unsigned int bufferCount = + camera_->properties().get(properties::MinimumRequests).value(); + Stream *stream = cfg.stream(); BufferSource source; - int ret = source.allocate(cfg); + int ret = source.allocate(cfg, bufferCount); if (ret != TestPass) return ret; @@ -137,7 +142,7 @@ protected: } } - const unsigned int nFrames = cfg.bufferCount * 2; + const unsigned int nFrames = bufferCount * 2; Timer timer; timer.start(500ms * nFrames); diff --git a/test/libtest/buffer_source.cpp b/test/libtest/buffer_source.cpp index dde11f36..c1bc45db 100644 --- a/test/libtest/buffer_source.cpp +++ b/test/libtest/buffer_source.cpp @@ -26,7 +26,7 @@ BufferSource::~BufferSource() media_->release(); } -int BufferSource::allocate(const StreamConfiguration &config) +int BufferSource::allocate(const StreamConfiguration &config, unsigned int count) { /* Locate and open the video device. */ std::string videoDeviceName = "vivid-000-vid-out"; @@ -78,7 +78,7 @@ int BufferSource::allocate(const StreamConfiguration &config) return TestFail; } - if (video->allocateBuffers(config.bufferCount, &buffers_) < 0) { + if (video->allocateBuffers(count, &buffers_) < 0) { std::cout << "Failed to allocate buffers" << std::endl; return TestFail; } diff --git a/test/libtest/buffer_source.h b/test/libtest/buffer_source.h index 495da8a9..deca2aab 100644 --- a/test/libtest/buffer_source.h +++ b/test/libtest/buffer_source.h @@ -18,7 +18,7 @@ public: BufferSource(); ~BufferSource(); - int allocate(const libcamera::StreamConfiguration &config); + int allocate(const libcamera::StreamConfiguration &config, unsigned int count); const std::vector> &buffers(); private: diff --git a/test/v4l2_videodevice/buffer_cache.cpp b/test/v4l2_videodevice/buffer_cache.cpp index 5a9aa219..8d2cf6d1 100644 --- a/test/v4l2_videodevice/buffer_cache.cpp +++ b/test/v4l2_videodevice/buffer_cache.cpp @@ -174,10 +174,9 @@ public: StreamConfiguration cfg; cfg.pixelFormat = formats::YUYV; cfg.size = Size(600, 800); - cfg.bufferCount = numBuffers; BufferSource source; - int ret = source.allocate(cfg); + int ret = source.allocate(cfg, numBuffers); if (ret != TestPass) return ret;