diff options
author | Alfred E. Heggestad <alfred.heggestad@gmail.com> | 2018-03-11 21:57:09 +0100 |
---|---|---|
committer | Alfred E. Heggestad <alfred.heggestad@gmail.com> | 2018-04-07 12:25:39 +0200 |
commit | 09c1b0287be9a7c33dffb11d2bad9286142be3a2 (patch) | |
tree | 80c3fda138c96b0dcc76135bbf36134af1c0252b /modules/rst | |
parent | b3bd9972e0633451eecff834297d3cc139d69b4b (diff) |
vidsrc: add timestamp to the frame API
timestamps for v4l and v4l2
test: add timestamp to vidsrc mock
v4l2: print framerate
vidloop: save timestamps and print duration
test with timebase of 65536
v4l2: scale timestamp to VIDEO_TIMEBASE
minor fixes
Diffstat (limited to 'modules/rst')
-rw-r--r-- | modules/rst/video.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/rst/video.c b/modules/rst/video.c index bf59daf..c12ca0a 100644 --- a/modules/rst/video.c +++ b/modules/rst/video.c @@ -62,6 +62,8 @@ static void *video_thread(void *arg) while (st->run) { + uint64_t timestamp; + sys_msleep(4); now = tmr_jiffies(); @@ -69,8 +71,10 @@ static void *video_thread(void *arg) if (ts > now) continue; + timestamp = ts * VIDEO_TIMEBASE / 1000; + pthread_mutex_lock(&st->mutex); - st->frameh(st->frame, st->arg); + st->frameh(st->frame, timestamp, st->arg); pthread_mutex_unlock(&st->mutex); ts += 1000/st->prm.fps; |