summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlfred E. Heggestad <alfred.heggestad@gmail.com>2018-03-11 21:57:09 +0100
committerAlfred E. Heggestad <alfred.heggestad@gmail.com>2018-04-07 12:25:39 +0200
commit09c1b0287be9a7c33dffb11d2bad9286142be3a2 (patch)
tree80c3fda138c96b0dcc76135bbf36134af1c0252b /test
parentb3bd9972e0633451eecff834297d3cc139d69b4b (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 'test')
-rw-r--r--test/mock/mock_vidsrc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/mock/mock_vidsrc.c b/test/mock/mock_vidsrc.c
index ad6b165..781e04a 100644
--- a/test/mock/mock_vidsrc.c
+++ b/test/mock/mock_vidsrc.c
@@ -14,6 +14,7 @@ struct vidsrc_st {
struct vidframe *frame;
struct tmr tmr;
+ uint64_t timestamp;
double fps;
vidsrc_frame_h *frameh;
void *arg;
@@ -27,7 +28,9 @@ static void tmr_handler(void *arg)
tmr_start(&st->tmr, 1000/st->fps, tmr_handler, st);
if (st->frameh)
- st->frameh(st->frame, st->arg);
+ st->frameh(st->frame, st->timestamp, st->arg);
+
+ st->timestamp += VIDEO_TIMEBASE / st->fps;
}