ShaneCCC I know how to get v4l2 buffer timestamp at user space just like v4l2-ctl did.
Just like I mentioned before, after add the delta between Monotonic to REALTIME for v4l2 buffer timestamp, the result doensn’t match wit system time.
long uptime_ms = vsTime.tv_sec* 1000 + (long) round( vsTime.tv_nsec/ 1000000.0);
long epoch_ms = realTime.tv_sec* 1000 + (long) round( realTime.tv_nsec/ 1000000.0);
long epochtime_ms = epoch_ms - uptime_ms;
Then we add this delta for v4l2 buffer timestamp
ep_ts= buf.timestamp.tv_usec + buf.timestamp.tv_sec*1000000;
ep_ts = ep_ts + (epochtime_ms * 1000);
This ep_ts doesn’t match with gettimeofday, over than 12 seconds.
First question is why there are 12 seconds diff?
Second question is how can I modify vi4_fops.c to match with gettimeofday?