<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>PulseAudio: pa_timing_info Struct Reference</title> <link href="doxygen.css" rel="stylesheet" type="text/css"> <link href="tabs.css" rel="stylesheet" type="text/css"> </head><body> <!-- Generated by Doxygen 1.5.5 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="main.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li class="current"><a href="classes.html"><span>Data Structures</span></a></li> <li><a href="files.html"><span>Files</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="classes.html"><span>Alphabetical List</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li><a href="functions.html"><span>Data Fields</span></a></li> </ul> </div> </div> <div class="contents"> <h1>pa_timing_info Struct Reference</h1><!-- doxytag: class="pa_timing_info" -->A structure for all kinds of timing information of a stream. <a href="#_details">More...</a> <p> <table border="0" cellpadding="0" cellspacing="0"> <tr><td></td></tr> <tr><td colspan="2"><br><h2>Data Fields</h2></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">struct timeval </td><td class="memItemRight" valign="bottom"><a class="el" href="structpa__timing__info.html#1d7bfa57c2980cb34fd535ba700057ff">timestamp</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">The time when this timing info structure was current. <a href="#1d7bfa57c2980cb34fd535ba700057ff"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structpa__timing__info.html#b1b6c3d12cca0172e5d10374cb2f322c">synchronized_clocks</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Non-zero if the local and the remote machine have synchronized clocks. <a href="#b1b6c3d12cca0172e5d10374cb2f322c"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="sample_8h.html#885df3b973773f0dccbbec6bc6777f89">pa_usec_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structpa__timing__info.html#1fa047dbabfc097c05ebc74f66a234c8">sink_usec</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Time in usecs a sample takes to be played on the sink. <a href="#1fa047dbabfc097c05ebc74f66a234c8"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="sample_8h.html#885df3b973773f0dccbbec6bc6777f89">pa_usec_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structpa__timing__info.html#d34351f6a2480aa73a1afa9f9596768c">source_usec</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Time in usecs a sample takes from being recorded to being delivered to the application. <a href="#d34351f6a2480aa73a1afa9f9596768c"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="sample_8h.html#885df3b973773f0dccbbec6bc6777f89">pa_usec_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="structpa__timing__info.html#c77f5e79645fd59640138d86e610d773">transport_usec</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Estimated time in usecs a sample takes to be transferred to/from the daemon. <a href="#c77f5e79645fd59640138d86e610d773"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structpa__timing__info.html#a2b512f984e3d24e20159f542e80549a">playing</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Non-zero when the stream is currently playing. <a href="#a2b512f984e3d24e20159f542e80549a"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structpa__timing__info.html#28e63adc8b284fb2d2e90e302ba1e6e4">write_index_corrupt</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Non-zero if write_index is not up-to-date because a local write command that corrupted it has been issued in the time since this latency info was current . <a href="#28e63adc8b284fb2d2e90e302ba1e6e4"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="structpa__timing__info.html#378893046ab19c58fdb50633c66c5d4a">write_index</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Current write index into the playback buffer in bytes. <a href="#378893046ab19c58fdb50633c66c5d4a"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="structpa__timing__info.html#b675235e605a24a7be4486beaf0c65d9">read_index_corrupt</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Non-zero if read_index is not up-to-date because a local pause or flush request that corrupted it has been issued in the time since this latency info was current. <a href="#b675235e605a24a7be4486beaf0c65d9"></a><br></td></tr> <tr><td class="memItemLeft" nowrap align="right" valign="top">int64_t </td><td class="memItemRight" valign="bottom"><a class="el" href="structpa__timing__info.html#5e04baf968cc1d53a7795a58b2e4f788">read_index</a></td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Current read index into the playback buffer in bytes. <a href="#5e04baf968cc1d53a7795a58b2e4f788"></a><br></td></tr> </table> <hr><a name="_details"></a><h2>Detailed Description</h2> A structure for all kinds of timing information of a stream. <p> See <a class="el" href="stream_8h.html#c8300aa5136a223b14a5384f44564284" title="Request a timing info structure update for a stream.">pa_stream_update_timing_info()</a> and <a class="el" href="stream_8h.html#090147751441a97e04a4acef1d6514cb" title="Return the latest raw timing data structure.">pa_stream_get_timing_info()</a>. The total output latency a sample that is written with <a class="el" href="stream_8h.html#0f6ac01f306711bd2623a073060e91bc" title="Write some data to the server (for playback sinks), if free_cb is non-NULL this routine...">pa_stream_write()</a> takes to be played may be estimated by sink_usec+buffer_usec+transport_usec. (where buffer_usec is defined as pa_bytes_to_usec(write_index-read_index)) The output buffer which buffer_usec relates to may be manipulated freely (with <a class="el" href="stream_8h.html#0f6ac01f306711bd2623a073060e91bc" title="Write some data to the server (for playback sinks), if free_cb is non-NULL this routine...">pa_stream_write()</a>'s seek argument, <a class="el" href="stream_8h.html#c9c524eb275d258b00c553409682409c" title="Flush the playback buffer of this stream.">pa_stream_flush()</a> and friends), the buffers sink_usec and source_usec relate to are first-in first-out (FIFO) buffers which cannot be flushed or manipulated in any way. The total input latency a sample that is recorded takes to be delivered to the application is: source_usec+buffer_usec+transport_usec-sink_usec. (Take care of sign issues!) When connected to a monitor source sink_usec contains the latency of the owning sink. The two latency estimations described here are implemented in <a class="el" href="stream_8h.html#a521efcc16fe2abf0f8461462432ac16" title="Return the total stream latency.">pa_stream_get_latency()</a>. <hr><h2>Field Documentation</h2> <a class="anchor" name="1d7bfa57c2980cb34fd535ba700057ff"></a><!-- doxytag: member="pa_timing_info::timestamp" ref="1d7bfa57c2980cb34fd535ba700057ff" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">struct timeval <a class="el" href="structpa__timing__info.html#1d7bfa57c2980cb34fd535ba700057ff">pa_timing_info::timestamp</a><code> [read]</code> </td> </tr> </table> </div> <div class="memdoc"> <p> The time when this timing info structure was current. <p> </div> </div><p> <a class="anchor" name="b1b6c3d12cca0172e5d10374cb2f322c"></a><!-- doxytag: member="pa_timing_info::synchronized_clocks" ref="b1b6c3d12cca0172e5d10374cb2f322c" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="structpa__timing__info.html#b1b6c3d12cca0172e5d10374cb2f322c">pa_timing_info::synchronized_clocks</a> </td> </tr> </table> </div> <div class="memdoc"> <p> Non-zero if the local and the remote machine have synchronized clocks. <p> If synchronized clocks are detected transport_usec becomes much more reliable. However, the code that detects synchronized clocks is very limited und unreliable itself. <dl class="since" compact><dt><b>Since:</b></dt><dd>0.5 </dd></dl> </div> </div><p> <a class="anchor" name="1fa047dbabfc097c05ebc74f66a234c8"></a><!-- doxytag: member="pa_timing_info::sink_usec" ref="1fa047dbabfc097c05ebc74f66a234c8" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="sample_8h.html#885df3b973773f0dccbbec6bc6777f89">pa_usec_t</a> <a class="el" href="structpa__timing__info.html#1fa047dbabfc097c05ebc74f66a234c8">pa_timing_info::sink_usec</a> </td> </tr> </table> </div> <div class="memdoc"> <p> Time in usecs a sample takes to be played on the sink. <p> For playback streams and record streams connected to a monitor source. </div> </div><p> <a class="anchor" name="d34351f6a2480aa73a1afa9f9596768c"></a><!-- doxytag: member="pa_timing_info::source_usec" ref="d34351f6a2480aa73a1afa9f9596768c" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="sample_8h.html#885df3b973773f0dccbbec6bc6777f89">pa_usec_t</a> <a class="el" href="structpa__timing__info.html#d34351f6a2480aa73a1afa9f9596768c">pa_timing_info::source_usec</a> </td> </tr> </table> </div> <div class="memdoc"> <p> Time in usecs a sample takes from being recorded to being delivered to the application. <p> Only for record streams. <dl class="since" compact><dt><b>Since:</b></dt><dd>0.5 </dd></dl> </div> </div><p> <a class="anchor" name="c77f5e79645fd59640138d86e610d773"></a><!-- doxytag: member="pa_timing_info::transport_usec" ref="c77f5e79645fd59640138d86e610d773" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="sample_8h.html#885df3b973773f0dccbbec6bc6777f89">pa_usec_t</a> <a class="el" href="structpa__timing__info.html#c77f5e79645fd59640138d86e610d773">pa_timing_info::transport_usec</a> </td> </tr> </table> </div> <div class="memdoc"> <p> Estimated time in usecs a sample takes to be transferred to/from the daemon. <p> For both playback and record streams. <dl class="since" compact><dt><b>Since:</b></dt><dd>0.5 </dd></dl> </div> </div><p> <a class="anchor" name="a2b512f984e3d24e20159f542e80549a"></a><!-- doxytag: member="pa_timing_info::playing" ref="a2b512f984e3d24e20159f542e80549a" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="structpa__timing__info.html#a2b512f984e3d24e20159f542e80549a">pa_timing_info::playing</a> </td> </tr> </table> </div> <div class="memdoc"> <p> Non-zero when the stream is currently playing. <p> Only for playback streams. </div> </div><p> <a class="anchor" name="28e63adc8b284fb2d2e90e302ba1e6e4"></a><!-- doxytag: member="pa_timing_info::write_index_corrupt" ref="28e63adc8b284fb2d2e90e302ba1e6e4" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="structpa__timing__info.html#28e63adc8b284fb2d2e90e302ba1e6e4">pa_timing_info::write_index_corrupt</a> </td> </tr> </table> </div> <div class="memdoc"> <p> Non-zero if write_index is not up-to-date because a local write command that corrupted it has been issued in the time since this latency info was current . <p> Only write commands with SEEK_RELATIVE_ON_READ and SEEK_RELATIVE_END can corrupt write_index. <dl class="since" compact><dt><b>Since:</b></dt><dd>0.8 </dd></dl> </div> </div><p> <a class="anchor" name="378893046ab19c58fdb50633c66c5d4a"></a><!-- doxytag: member="pa_timing_info::write_index" ref="378893046ab19c58fdb50633c66c5d4a" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int64_t <a class="el" href="structpa__timing__info.html#378893046ab19c58fdb50633c66c5d4a">pa_timing_info::write_index</a> </td> </tr> </table> </div> <div class="memdoc"> <p> Current write index into the playback buffer in bytes. <p> Think twice before using this for seeking purposes: it might be out of date a the time you want to use it. Consider using PA_SEEK_RELATIVE instead. <dl class="since" compact><dt><b>Since:</b></dt><dd>0.8 </dd></dl> </div> </div><p> <a class="anchor" name="b675235e605a24a7be4486beaf0c65d9"></a><!-- doxytag: member="pa_timing_info::read_index_corrupt" ref="b675235e605a24a7be4486beaf0c65d9" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int <a class="el" href="structpa__timing__info.html#b675235e605a24a7be4486beaf0c65d9">pa_timing_info::read_index_corrupt</a> </td> </tr> </table> </div> <div class="memdoc"> <p> Non-zero if read_index is not up-to-date because a local pause or flush request that corrupted it has been issued in the time since this latency info was current. <p> <dl class="since" compact><dt><b>Since:</b></dt><dd>0.8 </dd></dl> </div> </div><p> <a class="anchor" name="5e04baf968cc1d53a7795a58b2e4f788"></a><!-- doxytag: member="pa_timing_info::read_index" ref="5e04baf968cc1d53a7795a58b2e4f788" args="" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int64_t <a class="el" href="structpa__timing__info.html#5e04baf968cc1d53a7795a58b2e4f788">pa_timing_info::read_index</a> </td> </tr> </table> </div> <div class="memdoc"> <p> Current read index into the playback buffer in bytes. <p> Think twice before using this for seeking purposes: it might be out of date a the time you want to use it. Consider using PA_SEEK_RELATIVE_ON_READ instead. <dl class="since" compact><dt><b>Since:</b></dt><dd>0.8 </dd></dl> </div> </div><p> <hr>The documentation for this struct was generated from the following file:<ul> <li><a class="el" href="def_8h-source.html">def.h</a></ul> </div> <hr size="1"><address style="text-align: right;"><small>Generated on Wed Mar 26 12:02:40 2008 for PulseAudio by <a href="http://www.doxygen.org/index.html"> <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address> </body> </html>