aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-01-30 11:27:13 (GMT)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-01-30 11:27:13 (GMT)
commite4b30f3aee9540eefb7ab450424dc31b90816d4c (patch)
tree37b0273f086e22878cb9058ba14817f9a0047a98
parentdbab363a6022806d3d9568e470941e9113910b37 (diff)
v4l2-ctl: fix codec type detection for multiplanar drivers
If the m2m driver is multiplanar, then enum_fmt would fail due to the hardcoded VIDEO_CAPTURE/OUTPUT buffer type. Query the buffer type instead of hardcoding it. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-streaming.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index 01097d4..d6c3f6a 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -352,7 +352,7 @@ static enum codec_type get_codec_type(cv4l_fd &fd)
if (!fd.has_vid_m2m())
return NOT_CODEC;
- if (fd.enum_fmt(fmt_desc, true, 0, V4L2_BUF_TYPE_VIDEO_CAPTURE))
+ if (fd.enum_fmt(fmt_desc, true, 0, fd.g_type()))
return NOT_CODEC;
do {
@@ -362,7 +362,7 @@ static enum codec_type get_codec_type(cv4l_fd &fd)
} while (!fd.enum_fmt(fmt_desc));
- if (fd.enum_fmt(fmt_desc, true, 0, V4L2_BUF_TYPE_VIDEO_OUTPUT))
+ if (fd.enum_fmt(fmt_desc, true, 0, v4l_type_invert(fd.g_type())))
return NOT_CODEC;
do {

Privacy Policy