From 5fe448e05d23a904401d4c40502eafab4196bd41 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 11 Mar 2014 08:34:33 +0100 Subject: [PATCH] v4l2-ctl: fix printing of buffer flags Don't include timestamp_type and src masks with the buffer flags, those are handled separately. I also made a small change when capturing: if verbose is true then also dump the contents of buffers marked with state ERROR. Signed-off-by: Hans Verkuil --- utils/v4l2-ctl/v4l2-ctl-streaming.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp index 8b16881..cf063e6 100644 --- a/utils/v4l2-ctl/v4l2-ctl-streaming.cpp +++ b/utils/v4l2-ctl/v4l2-ctl-streaming.cpp @@ -163,9 +163,11 @@ static const flag_def tc_flags_def[] = { static void print_buffer(FILE *f, struct v4l2_buffer &buf) { + const unsigned ts_flags = V4L2_BUF_FLAG_TIMESTAMP_MASK | V4L2_BUF_FLAG_TSTAMP_SRC_MASK; + fprintf(f, "\tIndex : %d\n", buf.index); fprintf(f, "\tType : %s\n", buftype2s(buf.type).c_str()); - fprintf(f, "\tFlags : %s\n", flags2s(buf.flags, flags_def).c_str()); + fprintf(f, "\tFlags : %s\n", flags2s(buf.flags & ~ts_flags, flags_def).c_str()); fprintf(f, "\tField : %s\n", field2s(buf.field).c_str()); fprintf(f, "\tSequence : %u\n", buf.sequence); fprintf(f, "\tLength : %u\n", buf.length); @@ -624,6 +626,8 @@ static int do_handle_cap(int fd, buffers &b, FILE *fout, int *index, } if (!(buf.flags & V4L2_BUF_FLAG_ERROR)) break; + if (verbose) + print_buffer(stderr, buf); test_ioctl(fd, VIDIOC_QBUF, &buf); } if (fout && (!stream_skip || ignore_count_skip) && !(buf.flags & V4L2_BUF_FLAG_ERROR)) { -- 2.7.4