yolobs-studio/libobs/media-io/frame-rate.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
593 B
C
Raw Permalink Normal View History

2016-02-23 23:16:51 +00:00
#pragma once
#ifdef __cplusplus
extern "C" {
#endif
struct media_frames_per_second {
uint32_t numerator;
uint32_t denominator;
};
2019-09-22 21:19:10 +00:00
static inline double
media_frames_per_second_to_frame_interval(struct media_frames_per_second fps)
2016-02-23 23:16:51 +00:00
{
return (double)fps.denominator / fps.numerator;
}
2019-09-22 21:19:10 +00:00
static inline double
media_frames_per_second_to_fps(struct media_frames_per_second fps)
2016-02-23 23:16:51 +00:00
{
return (double)fps.numerator / fps.denominator;
}
2019-09-22 21:19:10 +00:00
static inline bool
media_frames_per_second_is_valid(struct media_frames_per_second fps)
2016-02-23 23:16:51 +00:00
{
return fps.numerator && fps.denominator;
}
#ifdef __cplusplus
}
#endif