mbox series

[v4,0/2] Add tests compliance tests about V4L2_FMTDESC_FLAG_ENUM_ALL flag usage

Message ID 010201918fb3cf62-751d12a5-1648-45eb-9060-a9dcd60ef3ba-000000@eu-west-1.amazonses.com (mailing list archive)
Headers show
Series Add tests compliance tests about V4L2_FMTDESC_FLAG_ENUM_ALL flag usage | expand

Message

Benjamin Gaignard Aug. 26, 2024, 5:20 p.m. UTC
V4L2_FMTDESC_FLAG_ENUM_ALL flag goal is to enumerate all
possible pixel format while ignoring the current configuration.
The series add tests for v4l2-compliance and v4l2-ctl tools.

v4l2-compliance will check is the flag is supported by drivers
and verify if the enumerated list is an upperset of VIDIO_ENUM_FMT
called without the flag.

Add 'all' supoption to vidcap --list-formats(-ext) options to use
V4L2_FMTDESC_FLAG_ENUM_ALL if supported by the driver.

As example, Verisilicon driver support the flag usage and give these
results:
./v4l2-ctl --list-formats -d 1
ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture Multiplanar

	[0]: 'VT12' (Y/UV 4:2:0 (4x4 Linear))
	[1]: 'NV12' (Y/UV 4:2:0)

./v4l2-ctl --list-formats all -d 1
ioctl: VIDIOC_ENUM_FMT
	Type: Video Capture Multiplanar

	[0]: 'VT12' (Y/UV 4:2:0 (4x4 Linear))
	[1]: 'T010' (10-bit Y/UV 4:2:0 (4x4 Linear))
	[2]: 'NV12' (Y/UV 4:2:0)
	[3]: 'P010' (10-bit Y/UV 4:2:0)

so userspace can discover that it support 10-bit formats on capture
queue.

changes in v4:
- Add 'all' option in vidcap, meta and vidout.
- Make 'all' and 'mbus_code' exclusive.
- Simplify 'all' vs 'mbus_code' parsing.

Benjamin Gaignard (2):
  v4l2-compliance: Add test for V4L2_FMTDESC_FLAG_ENUM_ALL flag
  v4l2-ctl-vidcap: Add options to enumerate all pixel formats

 include/linux/videodev2.h                   |  3 ++
 utils/common/cv4l-helpers.h                 |  5 ++-
 utils/v4l2-compliance/v4l2-test-formats.cpp | 35 +++++++++++++++++++++
 utils/v4l2-ctl/v4l2-ctl-meta.cpp            | 34 ++++++++++++++------
 utils/v4l2-ctl/v4l2-ctl-overlay.cpp         |  2 +-
 utils/v4l2-ctl/v4l2-ctl-sdr.cpp             |  4 +--
 utils/v4l2-ctl/v4l2-ctl-vidcap.cpp          | 26 ++++++++++-----
 utils/v4l2-ctl/v4l2-ctl-vidout.cpp          | 27 +++++++++++-----
 utils/v4l2-ctl/v4l2-ctl.cpp                 | 16 ++++++----
 utils/v4l2-ctl/v4l2-ctl.h                   |  4 +--
 10 files changed, 119 insertions(+), 37 deletions(-)