Module Name: src
Committed By: drochner
Date: Thu Feb 2 17:21:18 UTC 2012
Modified Files:
src/sys/dev: video.c
Log Message:
fill in timestamps in outgoing data buffers
To generate a diff of this commit:
cvs rdiff -u -r1.27 -r1.28 src/sys/dev/video.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/video.c
diff -u src/sys/dev/video.c:1.27 src/sys/dev/video.c:1.28
--- src/sys/dev/video.c:1.27 Sat Aug 13 02:49:06 2011
+++ src/sys/dev/video.c Thu Feb 2 17:21:18 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: video.c,v 1.27 2011/08/13 02:49:06 jakllsch Exp $ */
+/* $NetBSD: video.c,v 1.28 2012/02/02 17:21:18 drochner Exp $ */
/*
* Copyright (c) 2008 Patrick Mahoney <[email protected]>
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: video.c,v 1.27 2011/08/13 02:49:06 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: video.c,v 1.28 2012/02/02 17:21:18 drochner Exp $");
#include "video.h"
#if NVIDEO > 0
@@ -2506,6 +2506,12 @@ video_stream_dequeue(struct video_stream
}
}
+static void
+v4l2buf_set_timestamp(struct v4l2_buffer *buf)
+{
+
+ getmicrotime(&buf->timestamp);
+}
/*
* write payload data to the appropriate video sample, possibly moving
@@ -2534,6 +2540,8 @@ video_stream_write(struct video_stream *
} else if (payload->size > 0) {
vb = SIMPLEQ_FIRST(&vs->vs_ingress);
buf = vb->vb_buf;
+ if (!buf->bytesused)
+ v4l2buf_set_timestamp(buf);
if (payload->size > buf->length - buf->bytesused) {
DPRINTF(("video_stream_write: "
"payload would overflow\n"));