Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev fill in timestamps in outgoing data buffers
details: https://anonhg.NetBSD.org/src/rev/89096d3847a0
branches: trunk
changeset: 773455:89096d3847a0
user: drochner <drochner%NetBSD.org@localhost>
date: Thu Feb 02 17:21:18 2012 +0000
description:
fill in timestamps in outgoing data buffers
diffstat:
sys/dev/video.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diffs (40 lines):
diff -r d593ade83a7e -r 89096d3847a0 sys/dev/video.c
--- a/sys/dev/video.c Thu Feb 02 16:59:42 2012 +0000
+++ b/sys/dev/video.c Thu Feb 02 17:21:18 2012 +0000
@@ -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 <pat%polycrystal.org@localhost>
@@ -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 @@
}
}
+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 @@
} 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"));
Home |
Main Index |
Thread Index |
Old Index