#define WIDTH 640
#define HEIGHT 480
+#define FPS 50
static char buf[WIDTH * HEIGHT * 3];
static int frameno = 0;
int gettimeofday(struct timeval *tv, struct timezone *tz)
{
printf("gettimeofday frame %u\n", frameno);
- tv->tv_sec = frameno / 50;
- tv->tv_usec = ((double)(frameno % 50) / 50) * 1000000;
+ tv->tv_sec = frameno / FPS;
+ tv->tv_usec = ((double)(frameno % FPS) / FPS) * 1000000;
+ return 0;
+}
+
+int clock_gettime(clockid_t clk_id, struct timespec *tp)
+{
+ tp->tv_sec = frameno / FPS;
+ tp->tv_nsec = ((double)(frameno % FPS) / FPS) * 1e9;
+
return 0;
}