aboutsummaryrefslogtreecommitdiffstats
path: root/utils/v4l2-ctl/v4l2-ctl.cpp
diff options
context:
space:
mode:
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>2020-07-03 20:02:37 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2020-09-26 12:20:38 +0200
commitdffe31c303450f7ad03f7d208850d3ddd19aec0a (patch)
treeb91e742014cc75303183cd3235ba0b9fc5e3a1fa /utils/v4l2-ctl/v4l2-ctl.cpp
parent19be88073c416db5abe6fd0219aca00b596bea2e (diff)
v4l2: common: add the flags V4L2_FMT_FLAG_CSC* to the list that maps flags to str
Replace the array fmtdesc_def with a macro 'FMTDESC_DEF' The macro is used to to create two arrays 'fmtdesc_def_ycbcr', 'fmtdesc_def_hsv' that map the format flags to strings. The function 'fmtdesc2s' is changed to get a parameter 'is_hsv' that decides which array to use. The new CSC flags V4L2_FMT_FLAG_CSC* are added to the arries. Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'utils/v4l2-ctl/v4l2-ctl.cpp')
-rw-r--r--utils/v4l2-ctl/v4l2-ctl.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl.cpp b/utils/v4l2-ctl/v4l2-ctl.cpp
index 82d14c3c..3b30bea9 100644
--- a/utils/v4l2-ctl/v4l2-ctl.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl.cpp
@@ -608,8 +608,12 @@ void print_video_formats(cv4l_fd &fd, __u32 type, unsigned int mbus_code)
do {
printf("\t[%d]: '%s' (%s", fmt.index, fcc2s(fmt.pixelformat).c_str(),
fmt.description);
- if (fmt.flags)
- printf(", %s", fmtdesc2s(fmt.flags).c_str());
+ if (fmt.flags) {
+ bool is_hsv = fmt.pixelformat == V4L2_PIX_FMT_HSV24 ||
+ fmt.pixelformat == V4L2_PIX_FMT_HSV32;
+
+ printf(", %s", fmtdesc2s(fmt.flags, is_hsv).c_str());
+ }
printf(")\n");
} while (!fd.enum_fmt(fmt));
}
@@ -630,8 +634,12 @@ void print_video_formats_ext(cv4l_fd &fd, __u32 type, unsigned int mbus_code)
do {
printf("\t[%d]: '%s' (%s", fmt.index, fcc2s(fmt.pixelformat).c_str(),
fmt.description);
- if (fmt.flags)
- printf(", %s", fmtdesc2s(fmt.flags).c_str());
+ if (fmt.flags) {
+ bool is_hsv = fmt.pixelformat == V4L2_PIX_FMT_HSV24 ||
+ fmt.pixelformat == V4L2_PIX_FMT_HSV32;
+
+ printf(", %s", fmtdesc2s(fmt.flags, is_hsv).c_str());
+ }
printf(")\n");
if (fd.enum_framesizes(frmsize, fmt.pixelformat))
continue;

Privacy Policy