summaryrefslogtreecommitdiff
path: root/gdk/gdkframetimings.c
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2012-11-15 14:11:41 -0500
committerOwen W. Taylor <otaylor@fishsoup.net>2013-02-14 17:19:51 -0500
commitfb44ea8a85db3e41f10304f559772f2c10d28c29 (patch)
treee05881074a4aa92e186fe25ffa756fb5d16391b4 /gdk/gdkframetimings.c
parent8855bf052d8bbbd8fdfce1cd5f4a3540661a9c8e (diff)
downloadgtk+-fb44ea8a85db3e41f10304f559772f2c10d28c29.tar.gz
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
Diffstat (limited to 'gdk/gdkframetimings.c')
-rw-r--r--gdk/gdkframetimings.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdk/gdkframetimings.c b/gdk/gdkframetimings.c
index 08130015fd..ad9ec2e527 100644
--- a/gdk/gdkframetimings.c
+++ b/gdk/gdkframetimings.c
@@ -29,6 +29,7 @@ struct _GdkFrameTimings
gint64 drawn_time;
gint64 presentation_time;
gint64 refresh_interval;
+ gint64 predicted_presentation_time;
#ifdef G_ENABLE_DEBUG
gint64 layout_start_time;
@@ -188,6 +189,23 @@ gdk_frame_timings_set_presentation_time (GdkFrameTimings *timings,
}
gint64
+gdk_frame_timings_get_predicted_presentation_time (GdkFrameTimings *timings)
+{
+ g_return_val_if_fail (timings != NULL, 0);
+
+ return timings->predicted_presentation_time;
+}
+
+void
+gdk_frame_timings_set_predicted_presentation_time (GdkFrameTimings *timings,
+ gint64 predicted_presentation_time)
+{
+ g_return_if_fail (timings != NULL);
+
+ timings->predicted_presentation_time = predicted_presentation_time;
+}
+
+gint64
gdk_frame_timings_get_refresh_interval (GdkFrameTimings *timings)
{
g_return_val_if_fail (timings != NULL, 0);