libobs: Add obs_get_frame_interval_ns
Returns the current video frame interval between frames, in nanoseconds.
This commit is contained in:
parent
3a6a1a4ff8
commit
70ecbcd5d4
@ -273,6 +273,7 @@ struct obs_core_video {
|
||||
volatile bool gpu_encode_stop;
|
||||
|
||||
uint64_t video_time;
|
||||
uint64_t video_frame_interval_ns;
|
||||
uint64_t video_avg_frame_time_ns;
|
||||
double video_fps;
|
||||
video_t *video;
|
||||
|
@ -824,6 +824,7 @@ void *obs_graphics_thread(void *param)
|
||||
bool was_active = false;
|
||||
|
||||
obs->video.video_time = os_gettime_ns();
|
||||
obs->video.video_frame_interval_ns = interval;
|
||||
|
||||
os_set_thread_name("libobs: graphics thread");
|
||||
|
||||
|
@ -2144,6 +2144,11 @@ uint64_t obs_get_average_frame_time_ns(void)
|
||||
return obs ? obs->video.video_avg_frame_time_ns : 0;
|
||||
}
|
||||
|
||||
uint64_t obs_get_frame_interval_ns(void)
|
||||
{
|
||||
return obs ? obs->video.video_frame_interval_ns : 0;
|
||||
}
|
||||
|
||||
enum obs_obj_type obs_obj_get_type(void *obj)
|
||||
{
|
||||
struct obs_context_data *context = obj;
|
||||
|
@ -727,6 +727,7 @@ EXPORT uint64_t obs_get_video_frame_time(void);
|
||||
|
||||
EXPORT double obs_get_active_fps(void);
|
||||
EXPORT uint64_t obs_get_average_frame_time_ns(void);
|
||||
EXPORT uint64_t obs_get_frame_interval_ns(void);
|
||||
|
||||
EXPORT uint32_t obs_get_total_frames(void);
|
||||
EXPORT uint32_t obs_get_lagged_frames(void);
|
||||
|
Loading…
x
Reference in New Issue
Block a user