diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-09-24 10:46:55 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-11 11:23:30 -0200 |
commit | 66847ef013cc4ed3ae519360e7e4cbf531465ae8 (patch) | |
tree | 79651abe38091a5841e16ccbe0850834a1a9c66b /drivers/media/video/uvc/uvc_queue.c | |
parent | 25738cbd72db53ca1c326bf94915d41086cb4297 (diff) | |
download | linux-66847ef013cc4ed3ae519360e7e4cbf531465ae8.tar.bz2 |
[media] uvcvideo: Add UVC timestamps support
UVC devices transmit a device timestamp along with video frames. Convert
the timestamp to a host timestamp and use it to fill the V4L2 buffer
timestamp field.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc/uvc_queue.c')
-rw-r--r-- | drivers/media/video/uvc/uvc_queue.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/media/video/uvc/uvc_queue.c b/drivers/media/video/uvc/uvc_queue.c index 268be579aa72..518f77d3a4d8 100644 --- a/drivers/media/video/uvc/uvc_queue.c +++ b/drivers/media/video/uvc/uvc_queue.c @@ -104,10 +104,22 @@ static void uvc_buffer_queue(struct vb2_buffer *vb) spin_unlock_irqrestore(&queue->irqlock, flags); } +static int uvc_buffer_finish(struct vb2_buffer *vb) +{ + struct uvc_video_queue *queue = vb2_get_drv_priv(vb->vb2_queue); + struct uvc_streaming *stream = + container_of(queue, struct uvc_streaming, queue); + struct uvc_buffer *buf = container_of(vb, struct uvc_buffer, buf); + + uvc_video_clock_update(stream, &vb->v4l2_buf, buf); + return 0; +} + static struct vb2_ops uvc_queue_qops = { .queue_setup = uvc_queue_setup, .buf_prepare = uvc_buffer_prepare, .buf_queue = uvc_buffer_queue, + .buf_finish = uvc_buffer_finish, }; void uvc_queue_init(struct uvc_video_queue *queue, enum v4l2_buf_type type, |