From fe33e727f278123e91ce5ebe75af08dec514cc5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Tue, 10 Dec 2024 18:56:03 +0100 Subject: libcamera: virtual: Query number of planes correctly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `PixelFormatInfo::planes.size()` always returns 3 since `planes` is an array, but that is not the number of planes of the pixel format. Use the `numPlanes()` getter instead. Signed-off-by: Barnabás Pőcze Reviewed-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- src/libcamera/pipeline/virtual/virtual.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp index 62e440ae..e692a543 100644 --- a/src/libcamera/pipeline/virtual/virtual.cpp +++ b/src/libcamera/pipeline/virtual/virtual.cpp @@ -278,7 +278,7 @@ int PipelineHandlerVirtual::exportFrameBuffers([[maybe_unused]] Camera *camera, const PixelFormatInfo &info = PixelFormatInfo::info(config.pixelFormat); std::vector planeSizes; - for (size_t i = 0; i < info.planes.size(); ++i) + for (size_t i = 0; i < info.numPlanes(); ++i) planeSizes.push_back(info.planeSize(config.size, i)); return dmaBufAllocator_.exportBuffers(config.bufferCount, planeSizes, buffers); -- cgit v1.2.1