summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2014-03-01 18:18:03 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2014-04-01 23:58:34 +0200
commitb846edc8c55db1d270b6a0e629ac5d8402480368 (patch)
treed29dd1d8c07543fdfdda2871790c4eb5559ba94d
parenta8cb48d6fa3121fdba642bbb392b8303bf432936 (diff)
Print timestamp source (start-of-exposure or end-of-frame)
Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi>
-rw-r--r--yavta.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/yavta.c b/yavta.c
index 65df57d..739463d 100644
--- a/yavta.c
+++ b/yavta.c
@@ -687,7 +687,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;
+ const char *ts_type, *ts_source;
memset(&buf, 0, sizeof buf);
memset(planes, 0, sizeof planes);
@@ -714,8 +714,18 @@ static int video_alloc_buffers(struct device *dev, int nbufs,
default:
ts_type = "invalid";
}
- printf("length: %u offset: %u timestamp type: %s\n",
- buf.length, buf.m.offset, ts_type);
+ switch (buf.flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK) {
+ case V4L2_BUF_FLAG_TSTAMP_SRC_EOF:
+ ts_source = "EoF";
+ break;
+ case V4L2_BUF_FLAG_TSTAMP_SRC_SOE:
+ ts_source = "SoE";
+ break;
+ default:
+ ts_source = "invalid";
+ }
+ printf("length: %u offset: %u timestamp type/source: %s/%s\n",
+ buf.length, buf.m.offset, ts_type, ts_source);
buffers[i].idx = i;