aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core/videobuf2-core.c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@iki.fi>2013-08-25 16:57:03 -0400
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-05 14:34:49 -0500
commit872484ce40881e295b046adf21f7211306477751 (patch)
treedc03c8c8dd72be2354cc7e70da8d7db687c9595a /drivers/media/v4l2-core/videobuf2-core.c
parentc57ff79270ceef426734b3c6b4874c3e415aa743 (diff)
[media] v4l: Add timestamp source flags, mask and document them
Some devices do not produce timestamps that correspond to the end of the frame. The user space should be informed on the matter. This patch achieves that by adding buffer flags (and a mask) for timestamp sources since more possible timestamping points are expected than just two. A three-bit mask is defined (V4L2_BUF_FLAG_TSTAMP_SRC_MASK) and two of the eight possible values is are defined V4L2_BUF_FLAG_TSTAMP_SRC_EOF for end of frame (value zero) V4L2_BUF_FLAG_TSTAMP_SRC_SOE for start of exposure (next value). Signed-off-by: Sakari Ailus <sakari.ailus@iki.fi> Acked-by: Kamil Debski <k.debski@samsung.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers/media/v4l2-core/videobuf2-core.c')
-rw-r--r--drivers/media/v4l2-core/videobuf2-core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index 521350a74c46..42a856813d06 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -2227,7 +2227,9 @@ int vb2_queue_init(struct vb2_queue *q)
2227 WARN_ON(!q->io_modes) || 2227 WARN_ON(!q->io_modes) ||
2228 WARN_ON(!q->ops->queue_setup) || 2228 WARN_ON(!q->ops->queue_setup) ||
2229 WARN_ON(!q->ops->buf_queue) || 2229 WARN_ON(!q->ops->buf_queue) ||
2230 WARN_ON(q->timestamp_flags & ~V4L2_BUF_FLAG_TIMESTAMP_MASK)) 2230 WARN_ON(q->timestamp_flags &
2231 ~(V4L2_BUF_FLAG_TIMESTAMP_MASK |
2232 V4L2_BUF_FLAG_TSTAMP_SRC_MASK)))
2231 return -EINVAL; 2233 return -EINVAL;
2232 2234
2233 /* Warn that the driver should choose an appropriate timestamp type */ 2235 /* Warn that the driver should choose an appropriate timestamp type */