1 #ifndef _framerate__hpp__included__
2 #define _framerate__hpp__included__
7 * Number clocks per field/frame on NTSC/PAL
9 #define DURATION_NTSC_FRAME 357366
10 #define DURATION_NTSC_FIELD 357368
11 #define DURATION_PAL_FRAME 425568
12 #define DURATION_PAL_FIELD 425568
15 * Sets the nominal frame rate. Framerate limiting tries to maintain the nominal framerate when there is no other
16 * explict framerate to maintain.
18 void set_nominal_framerate(double fps
) throw();
21 * Returns the current realized framerate.
23 * returns: The framerate the system is currently archiving.
25 double get_framerate() throw();
30 * Parameter usec: Current time in microseconds.
32 void freeze_time(uint64_t usec
);
37 * Parameter usec: Current time in microseconds.
39 void unfreeze_time(uint64_t usec
);
42 * Acknowledge frame start for timing purposes. If time is frozen, it is automatically unfrozen.
44 * parameter usec: Current time (relative to some unknown epoch) in microseconds.
46 void ack_frame_tick(uint64_t usec
) throw();
49 * Computes the number of microseconds to wait for next frame.
51 * parameter usec: Current time (relative to some unknown epoch) in microseconds.
52 * returns: Number of more microseconds to wait.
54 uint64_t to_wait_frame(uint64_t usec
) throw();
57 * Return microsecond-resolution time since unix epoch.
62 * Wait specified number of microseconds.
64 void wait_usec(uint64_t usec
);