Add gdk_frame_timings_get_predicted_presentation_time()

For an operation like synchronizing audio to video playback, we need to
be able to predict the time that a frame will be presented. The details
of this depend on the windowing system, so make the backend predict
a presentation time for ::begin-frame and set it on the GdkFrameTimings.

The timing algorithm of GdkFrameClockIdle is adjusted to give predictable
presentation times for frames that are not throttled by the windowing
system.

Helper functions:

 gdk_frame_clock_get_current_frame_timings()
 gdk_frame_clock_get_refresh_info()

are added for operations that would otherwise be needed multiple times
in different locations.

https://bugzilla.gnome.org/show_bug.cgi?id=685460
This commit is contained in:
Owen W. Taylor
2012-11-15 14:11:41 -05:00
parent 8855bf052d
commit fb44ea8a85
9 changed files with 201 additions and 19 deletions

View File

@ -62,6 +62,10 @@ gint64 gdk_frame_timings_get_refresh_interval (GdkFrameTimings *timin
void gdk_frame_timings_set_refresh_interval (GdkFrameTimings *timings,
gint64 refresh_interval);
gint64 gdk_frame_timings_get_predicted_presentation_time (GdkFrameTimings *timings);
void gdk_frame_timings_set_predicted_presentation_time (GdkFrameTimings *timings,
gint64 predicted_presentation_time);
G_END_DECLS
#endif /* __GDK_FRAME_TIMINGS_H__ */