mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-13 15:29:45 +03:00
libcamera: virtual: Query number of planes correctly
`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 <pobrn@protonmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
This commit is contained in:
parent
277a28691c
commit
fe33e727f2
1 changed files with 1 additions and 1 deletions
|
@ -278,7 +278,7 @@ int PipelineHandlerVirtual::exportFrameBuffers([[maybe_unused]] Camera *camera,
|
||||||
const PixelFormatInfo &info = PixelFormatInfo::info(config.pixelFormat);
|
const PixelFormatInfo &info = PixelFormatInfo::info(config.pixelFormat);
|
||||||
|
|
||||||
std::vector<unsigned int> planeSizes;
|
std::vector<unsigned int> 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));
|
planeSizes.push_back(info.planeSize(config.size, i));
|
||||||
|
|
||||||
return dmaBufAllocator_.exportBuffers(config.bufferCount, planeSizes, buffers);
|
return dmaBufAllocator_.exportBuffers(config.bufferCount, planeSizes, buffers);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue