Message ID | 20241211152542.1095857-2-pobrn@protonmail.com |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
Hi Barnabás, Thank you for the patch. On Wed, Dec 11, 2024 at 03:25:50PM +0000, Barnabás Pőcze wrote: > `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> > --- > src/libcamera/pipeline/virtual/virtual.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp > index 3126bdd7d..aae94efee 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<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)); > > return dmaBufAllocator_.exportBuffers(config.bufferCount, planeSizes, buffers);
Quoting Barnabás Pőcze (2024-12-11 15:25:50) > `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: Kieran Bingham <kieran.bingham@ideasonboard.com> > --- > src/libcamera/pipeline/virtual/virtual.cpp | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp > index 3126bdd7d..aae94efee 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<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)); > > return dmaBufAllocator_.exportBuffers(config.bufferCount, planeSizes, buffers); > -- > 2.47.1 > >
diff --git a/src/libcamera/pipeline/virtual/virtual.cpp b/src/libcamera/pipeline/virtual/virtual.cpp index 3126bdd7d..aae94efee 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<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)); return dmaBufAllocator_.exportBuffers(config.bufferCount, planeSizes, buffers);
`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> --- src/libcamera/pipeline/virtual/virtual.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)