Browse Source

libobs: Add function to get current video time (in nanosec)

Allows getting the timestamp for the video frame currently being
rendered.
jp9000 9 years ago
parent
commit
9c5f95d823
2 changed files with 7 additions and 0 deletions
  1. 5 0
      libobs/obs.c
  2. 2 0
      libobs/obs.h

+ 5 - 0
libobs/obs.c

@@ -1753,3 +1753,8 @@ profiler_name_store_t *obs_get_profiler_name_store(void)
 
 	return obs->name_store;
 }
+
+uint64_t obs_get_video_frame_time(void)
+{
+	return obs ? obs->video.video_time : 0;
+}

+ 2 - 0
libobs/obs.h

@@ -590,6 +590,8 @@ EXPORT obs_source_t *obs_view_get_source(obs_view_t *view,
 /** Renders the sources of this view context */
 EXPORT void obs_view_render(obs_view_t *view);
 
+EXPORT uint64_t obs_get_video_frame_time(void);
+
 
 /* ------------------------------------------------------------------------- */
 /* Display context */