The video capture API includes macros to help with interval conversions.
#define CAPTURE_INTERVAL_FROM_MS ((x) * 1000000ULL)
Convert interval, argument x, from milliseconds to nanoseconds.
Required for the timeout argument of capture_get_frame().
#define CAPTURE_INTERVAL_FROM_US ((x) * 1000ULL)
Convert interval, argument x, from microseconds to nanoseconds.
Required for the timeout argument of capture_get_frame().
#define CAPTURE_INTERVAL_FROM_NS (x)
Convert interval, argument x, from nanoseconds to nanoseconds.
Required for the timeout argument of capture_get_frame().
#define CAPTURE_INTERVAL_TO_MS ((x) / 1000000ULL)
Convert interval, argument x, to milliseconds from nanoseconds.
#define CAPTURE_INTERVAL_TO_US ((x) / 1000ULL)
Convert interval, argument x, to microseconds from nanoseconds.
#define CAPTURE_INTERVAL_TO_NS (x)
Convert interval, argument x, to nanoseconds from nanoseconds.
#define CAPTURE_INTERVAL_NTSC_FIELD 16668333
Amount of time, in nanoseconds, between NTSC fields.
#define CAPTURE_INTERVAL_NTSC_FRAME (CAPTURE_INTERVAL_NTSC_FIELD * 2)
Amount of time, in nanoseconds, between NTSC frames.