v4l2 subdev format and interval

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

v4l2 subdev format and interval

跳至解决方案
1,548 次查看
MicMoba
Contributor V

Hi I have a question to the v4l2 experts.

I have a chip that converts analog video to BT601/BT656. This chip has two modes

1) PAL with 768x576@25fps (progressive)
2) NTSC with 640x480@30fps (progressive)

The chip is configurable by I2C. So I create a v4l2 subdevice driver based on the ov5640 driver. Now I am a bit confused because of the formats and intervals.

In my understanding the 4vl2_subdev_pad_ops are for getting information and setting formats of the subdevice. I implemented the enum_frame_size and enum_frame_interval functions and I can list the formats with:
v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
       Type: Video Capture Multiplanar

       [0]: 'GREY' (8-bit Greyscale)
               Size: Discrete 768x576
                       Interval: Discrete 0.040s (25.000 fps)
               Size: Discrete 640x480
                       Interval: Discrete 0.033s (30.000 fps)

I am not sure if this is correct. The format (with, height and fps) depends on the video standard I set up (PAL/NTSC). Because of that I think maybe it is better to list only the format that is choosen by the video standard, isn't it?
And how is the right way to set the video standard? By VIDIOC_S_STD or VIDIOC_SUBDEV_S_FMT?

Another miracle is the line  [0]: 'GREY' (8-bit Greyscale)? I set the colorspace to  V4L2_COLORSPACE_SRGB and the media bus format to MEDIA_BUS_FMT_UYVY8_2X8. I don't know where the 'GREY' is comming from.

 

Thanks

 

[Edit 2021-06-14]

I found out why the formats-list always show 'GREY'. The Media-Bus color code have to match with a color code of imx-isi-cap module. Now I take MEDIA_BUS_FMT_YUYV8_1X16 and the format-list-ext show: [0]: 'YUYV' (YUYV 4:2:2)


标签 (2)
0 项奖励
1 解答
1,500 次查看
MicMoba
Contributor V

I solved my issue with setting the format over a v4l2-control.

在原帖中查看解决方案

0 项奖励
3 回复数
1,501 次查看
MicMoba
Contributor V

I solved my issue with setting the format over a v4l2-control.

0 项奖励
1,512 次查看
joanxie
NXP TechSupport
NXP TechSupport

pls add your board and bsp information here, otherwise I don't know how to give you any suggestion

0 项奖励
1,507 次查看
MicMoba
Contributor V

Hi joanxie,

I use a phyBOARD pollux i.MX 8M Plus with a Linux kernel 5.4.70.

0 项奖励