<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="gdk4-GdkFrameTimings">
<refmeta>
<refentrytitle role="top_of_page" id="gdk4-GdkFrameTimings.top_of_page">Frame timings</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GDK4 Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>Frame timings</refname>
<refpurpose>Object holding timing information for a single frame</refpurpose>
</refnamediv>

<refsect1 id="gdk4-GdkFrameTimings.functions" role="functions_proto">
<title role="functions_proto.title">Functions</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="functions_proto_type" colwidth="150px"/>
<colspec colname="functions_proto_name"/>
<tbody>
<row><entry role="function_type"><link linkend="GdkFrameTimings"><returnvalue>GdkFrameTimings</returnvalue></link>&#160;*
</entry><entry role="function_name"><link linkend="gdk-frame-timings-ref">gdk_frame_timings_ref</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="void"><returnvalue>void</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-frame-timings-unref">gdk_frame_timings_unref</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-frame-timings-get-frame-counter">gdk_frame_timings_get_frame_counter</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-frame-timings-get-complete">gdk_frame_timings_get_complete</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-frame-timings-get-frame-time">gdk_frame_timings_get_frame_time</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-frame-timings-get-presentation-time">gdk_frame_timings_get_presentation_time</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-frame-timings-get-refresh-interval">gdk_frame_timings_get_refresh_interval</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>
<row><entry role="function_type"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
</entry><entry role="function_name"><link linkend="gdk-frame-timings-get-predicted-presentation-time">gdk_frame_timings_get_predicted_presentation_time</link>&#160;<phrase role="c_punctuation">()</phrase></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 id="gdk4-GdkFrameTimings.other" role="other_proto">
<title role="other_proto.title">Types and Values</title>
<informaltable pgwide="1" frame="none">
<tgroup cols="2">
<colspec colname="other_proto_type" colwidth="150px"/>
<colspec colname="other_proto_name"/>
<tbody>
<row><entry role="datatype_keyword"></entry><entry role="function_name"><link linkend="GdkFrameTimings">GdkFrameTimings</link></entry></row>

</tbody>
</tgroup>
</informaltable>
</refsect1>

<refsect1 id="gdk4-GdkFrameTimings.includes"><title>Includes</title><synopsis>#include &lt;gdk/gdk.h&gt;
</synopsis></refsect1>

<refsect1 id="gdk4-GdkFrameTimings.description" role="desc">
<title role="desc.title">Description</title>
<para>A <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> object holds timing information for a single frame
of the application’s displays. To retrieve <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> objects,
use <link linkend="gdk-frame-clock-get-timings"><function>gdk_frame_clock_get_timings()</function></link> or <link linkend="gdk-frame-clock-get-current-timings"><function>gdk_frame_clock_get_current_timings()</function></link>.
The information in <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> is useful for precise synchronization
of video with the event or audio streams, and for measuring
quality metrics for the application’s display, such as latency and jitter.</para>

</refsect1>
<refsect1 id="gdk4-GdkFrameTimings.functions_details" role="details">
<title role="details.title">Functions</title>
<refsect2 id="gdk-frame-timings-ref" role="function">
<title>gdk_frame_timings_ref&#160;()</title>
<indexterm zone="gdk-frame-timings-ref"><primary>gdk_frame_timings_ref</primary></indexterm>
<programlisting language="C"><link linkend="GdkFrameTimings"><returnvalue>GdkFrameTimings</returnvalue></link>&#160;*
gdk_frame_timings_ref (<parameter><link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> *timings</parameter>);</programlisting>
<para>Increases the reference count of <parameter>timings</parameter>
.</para>
<refsect3 id="gdk-frame-timings-ref.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>timings</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-frame-timings-ref.returns" role="returns">
<title>Returns</title>
<para> <parameter>timings</parameter>
</para>
</refsect3></refsect2>
<refsect2 id="gdk-frame-timings-unref" role="function">
<title>gdk_frame_timings_unref&#160;()</title>
<indexterm zone="gdk-frame-timings-unref"><primary>gdk_frame_timings_unref</primary></indexterm>
<programlisting language="C"><link linkend="void"><returnvalue>void</returnvalue></link>
gdk_frame_timings_unref (<parameter><link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> *timings</parameter>);</programlisting>
<para>Decreases the reference count of <parameter>timings</parameter>
. If <parameter>timings</parameter>

is no longer referenced, it will be freed.</para>
<refsect3 id="gdk-frame-timings-unref.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>timings</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3></refsect2>
<refsect2 id="gdk-frame-timings-get-frame-counter" role="function">
<title>gdk_frame_timings_get_frame_counter&#160;()</title>
<indexterm zone="gdk-frame-timings-get-frame-counter"><primary>gdk_frame_timings_get_frame_counter</primary></indexterm>
<programlisting language="C"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
gdk_frame_timings_get_frame_counter (<parameter><link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> *timings</parameter>);</programlisting>
<para>Gets the frame counter value of the <link linkend="GdkFrameClock"><type>GdkFrameClock</type></link> when this
this frame was drawn.</para>
<refsect3 id="gdk-frame-timings-get-frame-counter.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>timings</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-frame-timings-get-frame-counter.returns" role="returns">
<title>Returns</title>
<para> the frame counter value for this frame</para>
</refsect3></refsect2>
<refsect2 id="gdk-frame-timings-get-complete" role="function">
<title>gdk_frame_timings_get_complete&#160;()</title>
<indexterm zone="gdk-frame-timings-get-complete"><primary>gdk_frame_timings_get_complete</primary></indexterm>
<programlisting language="C"><link linkend="gboolean"><returnvalue>gboolean</returnvalue></link>
gdk_frame_timings_get_complete (<parameter><link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> *timings</parameter>);</programlisting>
<para>The timing information in a <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> is filled in
incrementally as the frame as drawn and passed off to the
window system for processing and display to the user. The
accessor functions for <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> can return 0 to
indicate an unavailable value for two reasons: either because
the information is not yet available, or because it isn't
available at all. Once <link linkend="gdk-frame-timings-get-complete"><function>gdk_frame_timings_get_complete()</function></link> returns
<link linkend="TRUE:CAPS"><literal>TRUE</literal></link> for a frame, you can be certain that no further values
will become available and be stored in the <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link>.</para>
<refsect3 id="gdk-frame-timings-get-complete.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>timings</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-frame-timings-get-complete.returns" role="returns">
<title>Returns</title>
<para> <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if all information that will be available
for the frame has been filled in.</para>
</refsect3></refsect2>
<refsect2 id="gdk-frame-timings-get-frame-time" role="function">
<title>gdk_frame_timings_get_frame_time&#160;()</title>
<indexterm zone="gdk-frame-timings-get-frame-time"><primary>gdk_frame_timings_get_frame_time</primary></indexterm>
<programlisting language="C"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
gdk_frame_timings_get_frame_time (<parameter><link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> *timings</parameter>);</programlisting>
<para>Returns the frame time for the frame. This is the time value
that is typically used to time animations for the frame. See
<link linkend="gdk-frame-clock-get-frame-time"><function>gdk_frame_clock_get_frame_time()</function></link>.</para>
<refsect3 id="gdk-frame-timings-get-frame-time.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>timings</para></entry>
<entry role="parameter_description"><para>A <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-frame-timings-get-frame-time.returns" role="returns">
<title>Returns</title>
<para> the frame time for the frame, in the timescale
of <link linkend="g-get-monotonic-time"><function>g_get_monotonic_time()</function></link></para>
</refsect3></refsect2>
<refsect2 id="gdk-frame-timings-get-presentation-time" role="function">
<title>gdk_frame_timings_get_presentation_time&#160;()</title>
<indexterm zone="gdk-frame-timings-get-presentation-time"><primary>gdk_frame_timings_get_presentation_time</primary></indexterm>
<programlisting language="C"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
gdk_frame_timings_get_presentation_time
                               (<parameter><link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> *timings</parameter>);</programlisting>
<para>Reurns the presentation time. This is the time at which the frame
became visible to the user.</para>
<refsect3 id="gdk-frame-timings-get-presentation-time.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>timings</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-frame-timings-get-presentation-time.returns" role="returns">
<title>Returns</title>
<para> the time the frame was displayed to the user, in the
timescale of <link linkend="g-get-monotonic-time"><function>g_get_monotonic_time()</function></link>, or 0 if no presentation
time is available. See <link linkend="gdk-frame-timings-get-complete"><function>gdk_frame_timings_get_complete()</function></link></para>
</refsect3></refsect2>
<refsect2 id="gdk-frame-timings-get-refresh-interval" role="function">
<title>gdk_frame_timings_get_refresh_interval&#160;()</title>
<indexterm zone="gdk-frame-timings-get-refresh-interval"><primary>gdk_frame_timings_get_refresh_interval</primary></indexterm>
<programlisting language="C"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
gdk_frame_timings_get_refresh_interval
                               (<parameter><link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> *timings</parameter>);</programlisting>
<para>Gets the natural interval between presentation times for
the display that this frame was displayed on. Frame presentation
usually happens during the “vertical blanking interval”.</para>
<refsect3 id="gdk-frame-timings-get-refresh-interval.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>timings</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-frame-timings-get-refresh-interval.returns" role="returns">
<title>Returns</title>
<para> the refresh interval of the display, in microseconds,
or 0 if the refresh interval is not available.
See <link linkend="gdk-frame-timings-get-complete"><function>gdk_frame_timings_get_complete()</function></link>.</para>
</refsect3></refsect2>
<refsect2 id="gdk-frame-timings-get-predicted-presentation-time" role="function">
<title>gdk_frame_timings_get_predicted_presentation_time&#160;()</title>
<indexterm zone="gdk-frame-timings-get-predicted-presentation-time"><primary>gdk_frame_timings_get_predicted_presentation_time</primary></indexterm>
<programlisting language="C"><link linkend="gint64"><returnvalue>gint64</returnvalue></link>
gdk_frame_timings_get_predicted_presentation_time
                               (<parameter><link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link> *timings</parameter>);</programlisting>
<para>Gets the predicted time at which this frame will be displayed. Although
no predicted time may be available, if one is available, it will
be available while the frame is being generated, in contrast to
<link linkend="gdk-frame-timings-get-presentation-time"><function>gdk_frame_timings_get_presentation_time()</function></link>, which is only available
after the frame has been presented. In general, if you are simply
animating, you should use <link linkend="gdk-frame-clock-get-frame-time"><function>gdk_frame_clock_get_frame_time()</function></link> rather
than this function, but this function is useful for applications
that want exact control over latency. For example, a movie player
may want this information for Audio/Video synchronization.</para>
<refsect3 id="gdk-frame-timings-get-predicted-presentation-time.parameters" role="parameters">
<title>Parameters</title>
<informaltable role="parameters_table" pgwide="1" frame="none">
<tgroup cols="3">
<colspec colname="parameters_name" colwidth="150px"/>
<colspec colname="parameters_description"/>
<colspec colname="parameters_annotations" colwidth="200px"/>
<tbody>
<row><entry role="parameter_name"><para>timings</para></entry>
<entry role="parameter_description"><para>a <link linkend="GdkFrameTimings"><type>GdkFrameTimings</type></link></para></entry>
<entry role="parameter_annotations"></entry></row>
</tbody></tgroup></informaltable>
</refsect3><refsect3 id="gdk-frame-timings-get-predicted-presentation-time.returns" role="returns">
<title>Returns</title>
<para> The predicted time at which the frame will be presented,
in the timescale of <link linkend="g-get-monotonic-time"><function>g_get_monotonic_time()</function></link>, or 0 if no predicted
presentation time is available.</para>
</refsect3></refsect2>

</refsect1>
<refsect1 id="gdk4-GdkFrameTimings.other_details" role="details">
<title role="details.title">Types and Values</title>
<refsect2 id="GdkFrameTimings" role="struct">
<title>GdkFrameTimings</title>
<indexterm zone="GdkFrameTimings"><primary>GdkFrameTimings</primary></indexterm>
<programlisting language="C">typedef struct _GdkFrameTimings GdkFrameTimings;</programlisting>
<para>The GdkFrameTimings struct contains only private fields and
should not be accessed directly.</para>
</refsect2>

</refsect1>

</refentry>
