2015-08-15 23:45:31 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
struct media_frames_per_second {
|
|
|
|
uint32_t numerator;
|
|
|
|
uint32_t denominator;
|
|
|
|
};
|
|
|
|
|
2019-06-22 22:13:45 -07:00
|
|
|
static inline double
|
|
|
|
media_frames_per_second_to_frame_interval(struct media_frames_per_second fps)
|
2015-08-15 23:45:31 -07:00
|
|
|
{
|
|
|
|
return (double)fps.denominator / fps.numerator;
|
|
|
|
}
|
|
|
|
|
2019-06-22 22:13:45 -07:00
|
|
|
static inline double
|
|
|
|
media_frames_per_second_to_fps(struct media_frames_per_second fps)
|
2015-08-15 23:45:31 -07:00
|
|
|
{
|
|
|
|
return (double)fps.numerator / fps.denominator;
|
|
|
|
}
|
|
|
|
|
2019-06-22 22:13:45 -07:00
|
|
|
static inline bool
|
|
|
|
media_frames_per_second_is_valid(struct media_frames_per_second fps)
|
2015-08-15 23:45:31 -07:00
|
|
|
{
|
|
|
|
return fps.numerator && fps.denominator;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|