Re: [PATCH v2 1/3] usb: gadget: uvc: Switch to monotonic clock for buffer timestamps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/28/2014 05:02 PM, Laurent Pinchart wrote:
> The wall time clock isn't useful for applications as it can jump around
> due to time adjustement. Switch to the monotonic clock.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>

Reviewed-by: Hans Verkuil <hans.verkuil@xxxxxxxxx>

Regards,

	Hans

> ---
>  drivers/usb/gadget/uvc_queue.c | 9 ++-------
>  1 file changed, 2 insertions(+), 7 deletions(-)
> 
> Changes since v1:
> 
> - Replace ktime_get_ts() with v4l2_get_timestamp()
> 
> diff --git a/drivers/usb/gadget/uvc_queue.c b/drivers/usb/gadget/uvc_queue.c
> index 0bb5d50..9ac4ffe1 100644
> --- a/drivers/usb/gadget/uvc_queue.c
> +++ b/drivers/usb/gadget/uvc_queue.c
> @@ -20,6 +20,7 @@
>  #include <linux/vmalloc.h>
>  #include <linux/wait.h>
>  
> +#include <media/v4l2-common.h>
>  #include <media/videobuf2-vmalloc.h>
>  
>  #include "uvc.h"
> @@ -379,14 +380,8 @@ static struct uvc_buffer *uvc_queue_next_buffer(struct uvc_video_queue *queue,
>  	else
>  		nextbuf = NULL;
>  
> -	/*
> -	 * FIXME: with videobuf2, the sequence number or timestamp fields
> -	 * are valid only for video capture devices and the UVC gadget usually
> -	 * is a video output device. Keeping these until the specs are clear on
> -	 * this aspect.
> -	 */
>  	buf->buf.v4l2_buf.sequence = queue->sequence++;
> -	do_gettimeofday(&buf->buf.v4l2_buf.timestamp);
> +	v4l2_get_timestamp(&buf->buf.v4l2_buf.timestamp);
>  
>  	vb2_set_plane_payload(&buf->buf, 0, buf->bytesused);
>  	vb2_buffer_done(&buf->buf, VB2_BUF_STATE_DONE);
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux