diff options
| author | Sakari Ailus <sakari.ailus@iki.fi> | 2012-11-27 23:57:34 +0200 | 
|---|---|---|
| committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2012-11-28 14:37:37 +0100 | 
| commit | ff770742c18f277080cd754eee48ae67aa8015b5 (patch) | |
| tree | 4f9cb2d569c6ca12572527c2b80aa2d4e381287f | |
| parent | 64fff31d7500605587d448a22d325f8f46ba1229 (diff) | |
Print v4l2_buffer timestamp type
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
| -rw-r--r-- | yavta.c | 14 | 
1 files changed, 13 insertions, 1 deletions
| @@ -464,6 +464,7 @@ static int video_alloc_buffers(struct device *dev, int nbufs,  	/* Map the buffers. */  	for (i = 0; i < rb.count; ++i) { +		const char *ts_type;  		memset(&buf, 0, sizeof buf);  		buf.index = i;  		buf.type = dev->type; @@ -474,7 +475,18 @@ static int video_alloc_buffers(struct device *dev, int nbufs,  				strerror(errno), errno);  			return ret;  		} -		printf("length: %u offset: %u\n", buf.length, buf.m.offset); +		switch (buf.flags & V4L2_BUF_FLAG_TIMESTAMP_MASK) { +		case V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN: +			ts_type = "unknown"; +			break; +		case V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC: +			ts_type = "monotonic"; +			break; +		default: +			ts_type = "invalid"; +		} +		printf("length: %u offset: %u timestamp type: %s\n", +		       buf.length, buf.m.offset, ts_type);  		switch (dev->memtype) {  		case V4L2_MEMORY_MMAP: | 
