aboutsummaryrefslogtreecommitdiffstats
path: root/utils/v4l2-ctl
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2019-03-29 10:54:57 +0100
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-03-29 16:05:16 +0100
commit6b39f86bc2670c8f1b352e9d16deab428d8d014e (patch)
tree6f8b1c852be58b9a4e6e165bdcac0329885185f0 /utils/v4l2-ctl
parent0cdc407b37e1263a31b5225c9c1221b27314f75d (diff)
v4l2-ctl: bytesused was reported as 0 when logging the buffer
In do_handle_out() when the buffer information was logged the bytesused value was always 0. Move the code the clears this field to *after* the logging function so the actual values are logged. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'utils/v4l2-ctl')
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-streaming.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index 6d8e4fbc..b30565d5 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -1481,13 +1481,14 @@ static int do_handle_out(cv4l_fd &fd, cv4l_queue &q, FILE *fin, cv4l_buffer *cap
ret = fd.dqbuf(buf);
if (ret == EAGAIN)
return 0;
- for (unsigned j = 0; j < buf.g_num_planes(); j++)
- buf.s_bytesused(buf.g_length(j), j);
double ts_secs = buf.g_timestamp().tv_sec + buf.g_timestamp().tv_usec / 1000000.0;
fps_ts.add_ts(ts_secs, buf.g_sequence(), buf.g_field());
if (verbose)
print_concise_buffer(stderr, buf, fps_ts, -1);
+
+ for (unsigned j = 0; j < buf.g_num_planes(); j++)
+ buf.s_bytesused(buf.g_length(j), j);
}
if (ret) {
fprintf(stderr, "%s: failed: %s\n", "VIDIOC_DQBUF", strerror(ret));

Privacy Policy