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/uvcvideo.h | |
parent | 25738cbd72db53ca1c326bf94915d41086cb4297 (diff) | |
download | op-kernel-dev-66847ef013cc4ed3ae519360e7e4cbf531465ae8.zip op-kernel-dev-66847ef013cc4ed3ae519360e7e4cbf531465ae8.tar.gz |
[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/uvcvideo.h')
-rw-r--r-- | drivers/media/video/uvc/uvcvideo.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h index e4d4b6d..e9c19f5 100644 --- a/drivers/media/video/uvc/uvcvideo.h +++ b/drivers/media/video/uvc/uvcvideo.h @@ -329,6 +329,8 @@ struct uvc_buffer { void *mem; unsigned int length; unsigned int bytesused; + + u32 pts; }; #define UVC_QUEUE_DISCONNECTED (1 << 0) @@ -455,6 +457,25 @@ struct uvc_streaming { struct uvc_stats_frame frame; struct uvc_stats_stream stream; } stats; + + /* Timestamps support. */ + struct uvc_clock { + struct uvc_clock_sample { + u32 dev_stc; + u16 dev_sof; + struct timespec host_ts; + u16 host_sof; + } *samples; + + unsigned int head; + unsigned int count; + unsigned int size; + + u16 last_sof; + u16 sof_offset; + + spinlock_t lock; + } clock; }; enum uvc_device_state { @@ -527,6 +548,7 @@ struct uvc_driver { #define UVC_TRACE_STATUS (1 << 9) #define UVC_TRACE_VIDEO (1 << 10) #define UVC_TRACE_STATS (1 << 11) +#define UVC_TRACE_CLOCK (1 << 12) #define UVC_WARN_MINMAX 0 #define UVC_WARN_PROBE_DEF 1 @@ -607,6 +629,9 @@ extern int uvc_probe_video(struct uvc_streaming *stream, struct uvc_streaming_control *probe); extern int uvc_query_ctrl(struct uvc_device *dev, __u8 query, __u8 unit, __u8 intfnum, __u8 cs, void *data, __u16 size); +void uvc_video_clock_update(struct uvc_streaming *stream, + struct v4l2_buffer *v4l2_buf, + struct uvc_buffer *buf); /* Status */ extern int uvc_status_init(struct uvc_device *dev); |