aboutsummaryrefslogtreecommitdiffstats
path: root/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
diff options
context:
space:
mode:
authorVandana BN <bnvandana@gmail.com>2019-09-24 16:34:26 +0530
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2019-09-24 13:50:57 +0200
commit892eeb0a15f47db8da81841d937314b02dad2897 (patch)
tree3e4fe316cdbcd4af5d750290c2487628afa602e6 /utils/v4l2-ctl/v4l2-ctl-streaming.cpp
parent2321cb9c418eb237b8cf1c301c0aa61bdd3d721d (diff)
v4l2-ctl: Print UVC meta info
Print UVC Metadata information in verbose mode. Signed-off-by: Vandana BN <bnvandana@gmail.com> 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.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
index 11157434..47b7d3f8 100644
--- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp
@@ -540,9 +540,9 @@ static void print_buffer(FILE *f, struct v4l2_buffer &buf)
fprintf(f, "\n");
}
-static void print_concise_buffer(FILE *f, cv4l_buffer &buf,
- fps_timestamps &fps_ts, int comp_perc,
- bool skip_ts = false)
+static void print_concise_buffer(FILE *f, cv4l_buffer &buf, cv4l_fmt &fmt,
+ cv4l_queue &q, fps_timestamps &fps_ts,
+ int comp_perc, bool skip_ts = false)
{
static double last_ts;
@@ -592,6 +592,9 @@ static void print_concise_buffer(FILE *f, cv4l_buffer &buf,
if (fl)
fprintf(f, " (%s)", bufferflags2s(fl).c_str());
fprintf(f, "\n");
+ if (v4l_type_is_meta(buf.g_type()) && buf.g_bytesused(0) &&
+ !(buf.g_flags() & V4L2_BUF_FLAG_ERROR))
+ print_meta_buffer(f, buf, fmt, q);
}
static void stream_buf_caps(cv4l_fd &fd, unsigned buftype)
@@ -1390,7 +1393,7 @@ static int do_handle_cap(cv4l_fd &fd, cv4l_queue &q, FILE *fout, int *index,
if (!(buf.g_flags() & V4L2_BUF_FLAG_ERROR))
break;
if (verbose)
- print_concise_buffer(stderr, buf, fps_ts, -1);
+ print_concise_buffer(stderr, buf, fmt, q, fps_ts, -1);
if (fd.qbuf(buf))
return QUEUE_ERROR;
}
@@ -1412,7 +1415,7 @@ static int do_handle_cap(cv4l_fd &fd, cv4l_queue &q, FILE *fout, int *index,
else if (buf.g_flags() & V4L2_BUF_FLAG_BFRAME)
ch = 'B';
if (verbose) {
- print_concise_buffer(stderr, buf, fps_ts,
+ print_concise_buffer(stderr, buf, fmt, q, fps_ts,
host_fd_to >= 0 ? 100 - comp_perc / comp_perc_count : -1);
comp_perc_count = comp_perc = 0;
}
@@ -1502,7 +1505,7 @@ static int do_handle_out(cv4l_fd &fd, cv4l_queue &q, FILE *fin, cv4l_buffer *cap
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);
+ print_concise_buffer(stderr, buf, fmt, q, fps_ts, -1);
for (unsigned j = 0; j < buf.g_num_planes(); j++)
buf.s_bytesused(buf.g_length(j), j);

Privacy Policy