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] mem2mem_testdev: fix field, sequence and time copying
Author:  Hans Verkuil <hans.verk...@cisco.com>
Date:    Mon Mar 10 10:58:28 2014 -0300

- Set the sequence counters correctly.
- Copy timestamps, timecode, relevant buffer flags and field from
  the received buffer to the outgoing buffer.

Signed-off-by: Hans Verkuil <hans.verk...@cisco.com>
Signed-off-by: Kamil Debski <k.deb...@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.che...@samsung.com>

 drivers/media/platform/mem2mem_testdev.c |   27 ++++++++++++++++++++++++---
 1 files changed, 24 insertions(+), 3 deletions(-)

---

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

diff --git a/drivers/media/platform/mem2mem_testdev.c 
b/drivers/media/platform/mem2mem_testdev.c
index 1ba1a83..dec8092 100644
--- a/drivers/media/platform/mem2mem_testdev.c
+++ b/drivers/media/platform/mem2mem_testdev.c
@@ -112,6 +112,7 @@ struct m2mtest_q_data {
        unsigned int            width;
        unsigned int            height;
        unsigned int            sizeimage;
+       unsigned int            sequence;
        struct m2mtest_fmt      *fmt;
 };
 
@@ -234,12 +235,21 @@ static int device_process(struct m2mtest_ctx *ctx,
        bytes_left = bytesperline - tile_w * MEM2MEM_NUM_TILES;
        w = 0;
 
+       out_vb->v4l2_buf.sequence = get_q_data(ctx, 
V4L2_BUF_TYPE_VIDEO_CAPTURE)->sequence++;
+       in_vb->v4l2_buf.sequence = q_data->sequence++;
        memcpy(&out_vb->v4l2_buf.timestamp,
                        &in_vb->v4l2_buf.timestamp,
                        sizeof(struct timeval));
-       out_vb->v4l2_buf.flags &= ~V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
-       out_vb->v4l2_buf.flags |=
-               in_vb->v4l2_buf.flags & V4L2_BUF_FLAG_TSTAMP_SRC_MASK;
+       if (in_vb->v4l2_buf.flags & V4L2_BUF_FLAG_TIMECODE)
+               memcpy(&out_vb->v4l2_buf.timecode, &in_vb->v4l2_buf.timecode,
+                       sizeof(struct v4l2_timecode));
+       out_vb->v4l2_buf.field = in_vb->v4l2_buf.field;
+       out_vb->v4l2_buf.flags = in_vb->v4l2_buf.flags &
+               (V4L2_BUF_FLAG_TIMECODE |
+                V4L2_BUF_FLAG_KEYFRAME |
+                V4L2_BUF_FLAG_PFRAME |
+                V4L2_BUF_FLAG_BFRAME |
+                V4L2_BUF_FLAG_TSTAMP_SRC_MASK);
 
        switch (ctx->mode) {
        case MEM2MEM_HFLIP | MEM2MEM_VFLIP:
@@ -765,9 +775,19 @@ static int m2mtest_buf_prepare(struct vb2_buffer *vb)
 static void m2mtest_buf_queue(struct vb2_buffer *vb)
 {
        struct m2mtest_ctx *ctx = vb2_get_drv_priv(vb->vb2_queue);
+
        v4l2_m2m_buf_queue(ctx->fh.m2m_ctx, vb);
 }
 
+static int m2mtest_start_streaming(struct vb2_queue *q, unsigned count)
+{
+       struct m2mtest_ctx *ctx = vb2_get_drv_priv(q);
+       struct m2mtest_q_data *q_data = get_q_data(ctx, q->type);
+
+       q_data->sequence = 0;
+       return 0;
+}
+
 static int m2mtest_stop_streaming(struct vb2_queue *q)
 {
        struct m2mtest_ctx *ctx = vb2_get_drv_priv(q);
@@ -792,6 +812,7 @@ static struct vb2_ops m2mtest_qops = {
        .queue_setup     = m2mtest_queue_setup,
        .buf_prepare     = m2mtest_buf_prepare,
        .buf_queue       = m2mtest_buf_queue,
+       .start_streaming = m2mtest_start_streaming,
        .stop_streaming  = m2mtest_stop_streaming,
        .wait_prepare    = vb2_ops_wait_prepare,
        .wait_finish     = vb2_ops_wait_finish,

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to