This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/media_tree.git tree:

Subject: [media] vb2: set timestamp when using write()
Author:  Hans Verkuil <[email protected]>
Date:    Fri Apr 11 04:36:57 2014 -0300

When using write() to write data to an output video node the vb2 core
should set timestamps if V4L2_BUF_FLAG_TIMESTAMP_COPY is set. Nobody
else is able to provide this information with the write() operation.

Signed-off-by: Hans Verkuil <[email protected]>
Acked-by: Pawel Osciak <[email protected]>
Acked-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/v4l2-core/videobuf2-core.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

---

http://git.linuxtv.org/media_tree.git?a=commitdiff;h=ebd7c50510f4b56285bb9fb4ba56a501c9c8f7df

diff --git a/drivers/media/v4l2-core/videobuf2-core.c 
b/drivers/media/v4l2-core/videobuf2-core.c
index 0f495f1..07ab067 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -22,6 +22,7 @@
 #include <media/v4l2-dev.h>
 #include <media/v4l2-fh.h>
 #include <media/v4l2-event.h>
+#include <media/v4l2-common.h>
 #include <media/videobuf2-core.h>
 
 static int debug;
@@ -2800,6 +2801,14 @@ static size_t __vb2_perform_fileio(struct vb2_queue *q, 
char __user *data, size_
 {
        struct vb2_fileio_data *fileio;
        struct vb2_fileio_buf *buf;
+       /*
+        * When using write() to write data to an output video node the vb2 core
+        * should set timestamps if V4L2_BUF_FLAG_TIMESTAMP_COPY is set. Nobody
+        * else is able to provide this information with the write() operation.
+        */
+       bool set_timestamp = !read &&
+               (q->timestamp_flags & V4L2_BUF_FLAG_TIMESTAMP_MASK) ==
+               V4L2_BUF_FLAG_TIMESTAMP_COPY;
        int ret, index;
 
        dprintk(3, "mode %s, offset %ld, count %zd, %sblocking\n",
@@ -2901,6 +2910,8 @@ static size_t __vb2_perform_fileio(struct vb2_queue *q, 
char __user *data, size_
                fileio->b.memory = q->memory;
                fileio->b.index = index;
                fileio->b.bytesused = buf->pos;
+               if (set_timestamp)
+                       v4l2_get_timestamp(&fileio->b.timestamp);
                ret = vb2_internal_qbuf(q, &fileio->b);
                dprintk(5, "vb2_dbuf result: %d\n", ret);
                if (ret)

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to