f53df7da64
Code submissions have continually suffered from formatting inconsistencies that constantly have to be addressed. Using clang-format simplifies this by making code formatting more consistent, and allows automation of the code formatting so that maintainers can focus more on the code itself instead of code formatting.
33 lines
593 B
C
33 lines
593 B
C
#pragma once
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
struct media_frames_per_second {
|
|
uint32_t numerator;
|
|
uint32_t denominator;
|
|
};
|
|
|
|
static inline double
|
|
media_frames_per_second_to_frame_interval(struct media_frames_per_second fps)
|
|
{
|
|
return (double)fps.denominator / fps.numerator;
|
|
}
|
|
|
|
static inline double
|
|
media_frames_per_second_to_fps(struct media_frames_per_second fps)
|
|
{
|
|
return (double)fps.numerator / fps.denominator;
|
|
}
|
|
|
|
static inline bool
|
|
media_frames_per_second_is_valid(struct media_frames_per_second fps)
|
|
{
|
|
return fps.numerator && fps.denominator;
|
|
}
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|