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();
28 * Acknowledge frame start for timing purposes.
30 * parameter usec: Current time (relative to some unknown epoch) in microseconds.
32 void ack_frame_tick(uint64_t usec
) throw();
35 * Computes the number of microseconds to wait for next frame.
37 * parameter usec: Current time (relative to some unknown epoch) in microseconds.
38 * returns: Number of more microseconds to wait.
40 uint64_t to_wait_frame(uint64_t usec
) throw();
43 * Return microsecond-resolution time since unix epoch.
48 * Wait specified number of microseconds.
50 void wait_usec(uint64_t usec
);