[libcamera-devel] libcamera: v4l2_subdevice: Set format field to V4L2_FIELD_NONE
diff mbox series

Message ID 20211012001325.1952-1-laurent.pinchart@ideasonboard.com
State Accepted
Commit 2f75a7e5b8c6258dc12e9e3128cb30133f66b4f9
Headers show
Series
  • [libcamera-devel] libcamera: v4l2_subdevice: Set format field to V4L2_FIELD_NONE
Related show

Commit Message

Laurent Pinchart Oct. 12, 2021, 12:13 a.m. UTC
libcamera doesn't support interlaced formats, set the field to
V4L2_FIELD_NONE explicitly instead of relying on drivers to interpret
V4L2_FIELD_ANY the way we want it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/v4l2_subdevice.cpp | 1 +
 1 file changed, 1 insertion(+)


base-commit: fa7a95bf32c6a8ee87b67159d4238cbc8e6dc3a9

Comments

Kieran Bingham Oct. 12, 2021, 11:28 a.m. UTC | #1
Quoting Laurent Pinchart (2021-10-12 01:13:25)
> libcamera doesn't support interlaced formats, set the field to
> V4L2_FIELD_NONE explicitly instead of relying on drivers to interpret
> V4L2_FIELD_ANY the way we want it.
> 

And what about v4l2_videodevice.cpp: <git greps> Ah it's already there.

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

> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  src/libcamera/v4l2_subdevice.cpp | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp
> index 8fe5e45b31ee..023e2328893d 100644
> --- a/src/libcamera/v4l2_subdevice.cpp
> +++ b/src/libcamera/v4l2_subdevice.cpp
> @@ -425,6 +425,7 @@ int V4L2Subdevice::setFormat(unsigned int pad, V4L2SubdeviceFormat *format,
>         subdevFmt.format.width = format->size.width;
>         subdevFmt.format.height = format->size.height;
>         subdevFmt.format.code = format->mbus_code;
> +       subdevFmt.format.field = V4L2_FIELD_NONE;
>  
>         int ret = ioctl(VIDIOC_SUBDEV_S_FMT, &subdevFmt);
>         if (ret) {
> 
> base-commit: fa7a95bf32c6a8ee87b67159d4238cbc8e6dc3a9
> -- 
> Regards,
> 
> Laurent Pinchart
>

Patch
diff mbox series

diff --git a/src/libcamera/v4l2_subdevice.cpp b/src/libcamera/v4l2_subdevice.cpp
index 8fe5e45b31ee..023e2328893d 100644
--- a/src/libcamera/v4l2_subdevice.cpp
+++ b/src/libcamera/v4l2_subdevice.cpp
@@ -425,6 +425,7 @@  int V4L2Subdevice::setFormat(unsigned int pad, V4L2SubdeviceFormat *format,
 	subdevFmt.format.width = format->size.width;
 	subdevFmt.format.height = format->size.height;
 	subdevFmt.format.code = format->mbus_code;
+	subdevFmt.format.field = V4L2_FIELD_NONE;
 
 	int ret = ioctl(VIDIOC_SUBDEV_S_FMT, &subdevFmt);
 	if (ret) {