aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-01-30 10:46:49 (GMT)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-01-30 10:46:49 (GMT)
commitdbab363a6022806d3d9568e470941e9113910b37 (patch)
tree7d374142dff9fc1f3021199f18b994c3e2c47329
parent2b3b518a68f77feb809ca383bb20bb66f6e08b36 (diff)
v4l2-ctl: check for presence of the SOURCE_CHANGE event
If this event doesn't exist, then also call capture_setup() when you start streaming. This would be the case for e.g. JPEG decoders. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-streaming.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index 33ffb2e..01097d4 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -1971,8 +1971,7 @@ static void streaming_set_m2m(cv4l_fd &fd, cv4l_fd &exp_fd)
memset(&sub, 0, sizeof(sub));
sub.type = V4L2_EVENT_SOURCE_CHANGE;
- if (fd.subscribe_event(sub) && codec_type != NOT_CODEC)
- goto done;
+ bool have_source_change = !fd.subscribe_event(sub);
file[CAP] = open_output_file(fd);
file[OUT] = open_input_file(fd, out.g_type());
@@ -1999,7 +1998,7 @@ static void streaming_set_m2m(cv4l_fd &fd, cv4l_fd &exp_fd)
if (fd.streamon(out.g_type()))
goto done;
- if (codec_type != DECODER)
+ if (codec_type != DECODER || !have_source_change)
if (capture_setup(fd, in, exp_fd_p))
goto done;

Privacy Policy