[v1] libcamera: v4l2_videodevice: Use `VIDEO_MAX_PLANES`
diff mbox series

Message ID 20260727110852.260904-1-barnabas.pocze@ideasonboard.com
State New
Headers show
Series
  • [v1] libcamera: v4l2_videodevice: Use `VIDEO_MAX_PLANES`
Related show

Commit Message

Barnabás Pőcze July 27, 2026, 11:08 a.m. UTC
The `V4L2DeviceFormat` type is directly initialized from `v4l2_pix_format_mplane`
in `V4L2VideoDevice::getFormatMultiplane()`. That type can store a maxumim
of 8 planes. So adjust the number of planes that `V4L2DeviceFormat` supports
to match the V4L2 limit.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 include/libcamera/internal/v4l2_videodevice.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Kieran Bingham July 27, 2026, 11:32 a.m. UTC | #1
Quoting Barnabás Pőcze (2026-07-27 12:08:52)
> The `V4L2DeviceFormat` type is directly initialized from `v4l2_pix_format_mplane`
> in `V4L2VideoDevice::getFormatMultiplane()`. That type can store a maxumim

s/maxumim/maximum/

> of 8 planes. So adjust the number of planes that `V4L2DeviceFormat` supports
> to match the V4L2 limit.

Have we already hit a device trying to use more than 3 planes?

Anyway, this seems accurate for the V4L2 device level and the
allocation cost is cheap so:

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> 
> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> ---
>  include/libcamera/internal/v4l2_videodevice.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h
> index 10367e4e17..f63d74879f 100644
> --- a/include/libcamera/internal/v4l2_videodevice.h
> +++ b/include/libcamera/internal/v4l2_videodevice.h
> @@ -176,7 +176,7 @@ public:
>         Size size;
>         std::optional<ColorSpace> colorSpace;
>  
> -       std::array<Plane, 3> planes;
> +       std::array<Plane, VIDEO_MAX_PLANES> planes;
>         unsigned int planesCount = 0;
>  
>         std::string toString() const;
> -- 
> 2.55.0
>

Patch
diff mbox series

diff --git a/include/libcamera/internal/v4l2_videodevice.h b/include/libcamera/internal/v4l2_videodevice.h
index 10367e4e17..f63d74879f 100644
--- a/include/libcamera/internal/v4l2_videodevice.h
+++ b/include/libcamera/internal/v4l2_videodevice.h
@@ -176,7 +176,7 @@  public:
 	Size size;
 	std::optional<ColorSpace> colorSpace;
 
-	std::array<Plane, 3> planes;
+	std::array<Plane, VIDEO_MAX_PLANES> planes;
 	unsigned int planesCount = 0;
 
 	std::string toString() const;