aboutsummaryrefslogtreecommitdiffstats
path: root/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-03-29 10:59:35 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-03-29 16:05:18 +0100
commit708fcea9090314f9a74543749238285f0536ffca (patch)
treebf3dff98f5cccc34091f88e9e2658170d39ef76f /utils/v4l2-ctl/v4l2-ctl-streaming.cpp
parent6b39f86bc2670c8f1b352e9d16deab428d8d014e (diff)
v4l2-ctl: reset internal counters after a source change
If a source change events arrives, then streaming stops, all buffers are reallocated and streaming restarts, but then various internal counters have to be reset since streaming starts with a clean slate. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'utils/v4l2-ctl/v4l2-ctl-streaming.cpp')
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-streaming.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index b30565d5..f882a799 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -119,6 +119,10 @@ private:
public:
fps_timestamps()
{
+ reset();
+ }
+
+ void reset() {
idx = 0;
full = false;
first = sum = 0;
@@ -2354,6 +2358,8 @@ static void stateful_m2m(cv4l_fd &fd, cv4l_queue &in, cv4l_queue &out,
last_buffer = false;
if (capture_setup(fd, in, exp_fd_p))
return;
+ fps_ts[CAP].reset();
+ fps_ts[OUT].reset();
fd.g_fmt(fmt_out, out.g_type());
fd.g_fmt(fmt_in, in.g_type());
cap_streaming = true;

Privacy Policy