[media] bw-qcam: fix timestamp handling
authorHans Verkuil <hverkuil@xs4all.nl>
Fri, 10 May 2013 11:06:50 +0000 (08:06 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 27 May 2013 12:30:19 +0000 (09:30 -0300)
bw-qcam didn't set the timestamp and it didn't set q->timestamp_type.

Tested-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/parport/bw-qcam.c

index 06231b8..d12bd33 100644 (file)
@@ -687,6 +687,7 @@ static int buffer_finish(struct vb2_buffer *vb)
 
        parport_release(qcam->pdev);
        mutex_unlock(&qcam->lock);
+       v4l2_get_timestamp(&vb->v4l2_buf.timestamp);
        if (len != size)
                vb->state = VB2_BUF_STATE_ERROR;
        vb2_set_plane_payload(vb, 0, len);
@@ -964,6 +965,7 @@ static struct qcam *qcam_init(struct parport *port)
        q->drv_priv = qcam;
        q->ops = &qcam_video_qops;
        q->mem_ops = &vb2_vmalloc_memops;
+       q->timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
        err = vb2_queue_init(q);
        if (err < 0) {
                v4l2_err(v4l2_dev, "couldn't init vb2_queue for %s.\n", port->name);