aboutsummaryrefslogtreecommitdiffstats
path: root/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-07-10 14:14:55 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-07-10 14:14:55 +0200
commit1b961f5e82b0805faea0ba68bfa8037213a02351 (patch)
tree3715fa2cab4be0e16314cf89aae8d19502bbaf97 /utils/v4l2-ctl/v4l2-ctl-streaming.cpp
parent7dc0eab5a54fedc9d31336891de15a1fe0b96a07 (diff)
v4l2-ctl: let capture_setup return the updated format
Just getting the new format after a source change event isn't enough in the case that -v option was specified by the user. Instead let capture_setup optionally return the new format after any '-v' changes are applied. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reported-by: Dafna Hirschfeld <dafna3@gmail.com>
Diffstat (limited to 'utils/v4l2-ctl/v4l2-ctl-streaming.cpp')
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-streaming.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index 28b2b3b9..470fa766 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -2146,7 +2146,7 @@ enum stream_type {
OUT,
};
-static int capture_setup(cv4l_fd &fd, cv4l_queue &in, cv4l_fd *exp_fd)
+static int capture_setup(cv4l_fd &fd, cv4l_queue &in, cv4l_fd *exp_fd, cv4l_fmt *new_fmt = NULL)
{
if (fd.streamoff(in.g_type())) {
fprintf(stderr, "%s: fd.streamoff error\n", __func__);
@@ -2168,6 +2168,10 @@ static int capture_setup(cv4l_fd &fd, cv4l_queue &in, cv4l_fd *exp_fd)
return -1;
}
fd.s_fmt(fmt, in.g_type());
+ if (new_fmt)
+ *new_fmt = fmt;
+ } else if (new_fmt) {
+ fd.g_fmt(*new_fmt, in.g_type());
}
get_cap_compose_rect(fd);
@@ -2367,8 +2371,7 @@ static void stateful_m2m(cv4l_fd &fd, cv4l_queue &in, cv4l_queue &out,
if (in_source_change_event) {
in_source_change_event = false;
last_buffer = false;
- fd.g_fmt(fmt_in, in.g_type());
- if (capture_setup(fd, in, exp_fd_p))
+ if (capture_setup(fd, in, exp_fd_p, &fmt_in))
return;
fps_ts[CAP].reset();
fps_ts[OUT].reset();

Privacy Policy