Sophie

Sophie

distrib > Fedora > 14 > i386 > by-pkgid > 598246a3099b0106d22dd5249478d3b7 > files > 28

ccrtp-devel-1.7.1-2.fc12.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>ccRTP: base.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><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="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
    </ul>
  </div>
<h1>base.h</h1><a href="base_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (C) 2001-2005 Federico Montesino Pouzols &lt;fedemp@altern.org&gt;.</span>
<a name="l00002"></a>00002 <span class="comment">// </span>
<a name="l00003"></a>00003 <span class="comment">// This program is free software; you can redistribute it and/or modify</span>
<a name="l00004"></a>00004 <span class="comment">// it under the terms of the GNU General Public License as published by</span>
<a name="l00005"></a>00005 <span class="comment">// the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00006"></a>00006 <span class="comment">// (at your option) any later version.</span>
<a name="l00007"></a>00007 <span class="comment">// </span>
<a name="l00008"></a>00008 <span class="comment">// This program is distributed in the hope that it will be useful,</span>
<a name="l00009"></a>00009 <span class="comment">// but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00010"></a>00010 <span class="comment">// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00011"></a>00011 <span class="comment">// GNU General Public License for more details.</span>
<a name="l00012"></a>00012 <span class="comment">// </span>
<a name="l00013"></a>00013 <span class="comment">// You should have received a copy of the GNU General Public License</span>
<a name="l00014"></a>00014 <span class="comment">// along with this program; if not, write to the Free Software </span>
<a name="l00015"></a>00015 <span class="comment">// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.</span>
<a name="l00016"></a>00016 <span class="comment">// </span>
<a name="l00017"></a>00017 <span class="comment">// As a special exception, you may use this file as part of a free software</span>
<a name="l00018"></a>00018 <span class="comment">// library without restriction.  Specifically, if other files instantiate</span>
<a name="l00019"></a>00019 <span class="comment">// templates or use macros or inline functions from this file, or you compile</span>
<a name="l00020"></a>00020 <span class="comment">// this file and link it with other files to produce an executable, this</span>
<a name="l00021"></a>00021 <span class="comment">// file does not by itself cause the resulting executable to be covered by</span>
<a name="l00022"></a>00022 <span class="comment">// the GNU General Public License.  This exception does not however    </span>
<a name="l00023"></a>00023 <span class="comment">// invalidate any other reasons why the executable file might be covered by</span>
<a name="l00024"></a>00024 <span class="comment">// the GNU General Public License.    </span>
<a name="l00025"></a>00025 <span class="comment">//</span>
<a name="l00026"></a>00026 <span class="comment">// This exception applies only to the code released under the name GNU</span>
<a name="l00027"></a>00027 <span class="comment">// ccRTP.  If you copy code from other releases into a copy of GNU</span>
<a name="l00028"></a>00028 <span class="comment">// ccRTP, as the General Public License permits, the exception does</span>
<a name="l00029"></a>00029 <span class="comment">// not apply to the code that you add in this way.  To avoid misleading</span>
<a name="l00030"></a>00030 <span class="comment">// anyone as to the status of such modified files, you must delete</span>
<a name="l00031"></a>00031 <span class="comment">// this exception notice from them.</span>
<a name="l00032"></a>00032 <span class="comment">//</span>
<a name="l00033"></a>00033 <span class="comment">// If you write modifications of your own for GNU ccRTP, it is your choice</span>
<a name="l00034"></a>00034 <span class="comment">// whether to permit this exception to apply to your modifications.</span>
<a name="l00035"></a>00035 <span class="comment">// If you do not wish that, delete this exception notice.</span>
<a name="l00036"></a>00036 <span class="comment">//</span>
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="preprocessor">#ifndef CCXX_RTP_BASE_H_</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define CCXX_RTP_BASE_H_</span>
<a name="l00040"></a>00040 <span class="preprocessor"></span>
<a name="l00041"></a>00041 <span class="preprocessor">#ifndef CCXX_SOCKET_H_</span>
<a name="l00042"></a>00042 <span class="preprocessor"></span><span class="preprocessor">#include &lt;cc++/config.h&gt;</span>
<a name="l00043"></a>00043 <span class="preprocessor">#include &lt;cc++/socket.h&gt;</span>
<a name="l00044"></a>00044 <span class="preprocessor">#endif</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span>
<a name="l00046"></a>00046 <span class="preprocessor">#ifndef CCXX_PACKING</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#if defined(__GNUC__)</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#define CCXX_PACKED</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#elif !defined(__hpux) &amp;&amp; !defined(_AIX)</span>
<a name="l00050"></a><a class="code" href="base_8h.html#2d5d6a19f6c727b9e318292caa8b7f4d">00050</a> <span class="preprocessor"></span><span class="preprocessor">#define CCXX_PACKED        </span>
<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="preprocessor">#endif </span>
<a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00053"></a>00053 <span class="preprocessor"></span>
<a name="l00054"></a>00054 <span class="preprocessor">#ifdef CCXX_NAMESPACES</span>
<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="keyword">namespace </span>ost {
<a name="l00056"></a>00056 <span class="preprocessor">#endif</span>
<a name="l00057"></a>00057 <span class="preprocessor"></span>
<a name="l00065"></a>00065 
<a name="l00066"></a><a class="code" href="base_8h.html#e51107daaafb77e69490355fcf0d350d">00066</a> <span class="keyword">const</span> uint8 <a class="code" href="base_8h.html#e51107daaafb77e69490355fcf0d350d" title="RTP protocol version supported.">CCRTP_VERSION</a> = 2;
<a name="l00067"></a>00067 
<a name="l00069"></a><a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb">00069</a> <span class="keyword">typedef</span> uint32 <a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a>;
<a name="l00070"></a>00070 
<a name="l00072"></a><a class="code" href="base_8h.html#93f41c0edc861f8d71e3793dcf498640">00072</a> <span class="keyword">typedef</span> uint32 <a class="code" href="base_8h.html#93f41c0edc861f8d71e3793dcf498640" title="Time interval expressed in nanoseconds.">nanotimeout_t</a>;
<a name="l00073"></a>00073 
<a name="l00081"></a>00081 __EXPORT timeval 
<a name="l00082"></a>00082 <a class="code" href="base_8h.html#7550b21b18b5ae7b471ac9e9df16e7b9" title="Convert a time interval, expressed as a microtimeout_t (number of microseconds),...">microtimeout2Timeval</a>(<a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a> to);
<a name="l00083"></a>00083 
<a name="l00091"></a>00091 <span class="keyword">inline</span> <a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a>
<a name="l00092"></a><a class="code" href="base_8h.html#004964b34cd778d02d1c156ac6e96f3b">00092</a> <a class="code" href="base_8h.html#004964b34cd778d02d1c156ac6e96f3b" title="Convert a time interval, expressed as a timeval value into a microseconds counter...">timeval2microtimeout</a>(<span class="keyword">const</span> timeval&amp; t)
<a name="l00093"></a>00093 { <span class="keywordflow">return</span> ((t.tv_sec * 1000000ul) + t.tv_usec); }
<a name="l00094"></a>00094 
<a name="l00103"></a>00103 <span class="keyword">inline</span> <a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a>
<a name="l00104"></a><a class="code" href="base_8h.html#1d6634b4a03bdcc49ae13746222b12d8">00104</a> <a class="code" href="base_8h.html#1d6634b4a03bdcc49ae13746222b12d8" title="Convert a time interval, expressed as the difference between two timeval values (t1-t2)...">timevalDiff2microtimeout</a>(<span class="keyword">const</span> timeval&amp; t1, <span class="keyword">const</span> timeval&amp; t2)
<a name="l00105"></a>00105 {
<a name="l00106"></a>00106         <span class="keywordflow">return</span> ((t1.tv_sec - t2.tv_sec) * 1000000ul) + 
<a name="l00107"></a>00107                 (t1.tv_usec - t2.tv_usec);
<a name="l00108"></a>00108 }
<a name="l00109"></a>00109 
<a name="l00111"></a><a class="code" href="base_8h.html#d4ff4b9421fd67733fa3ee452c8ee268">00111</a> <span class="keyword">const</span> tpport_t <a class="code" href="base_8h.html#d4ff4b9421fd67733fa3ee452c8ee268" title="registered default RTP data transport port">DefaultRTPDataPort</a> = 5004;
<a name="l00112"></a>00112 
<a name="l00114"></a><a class="code" href="base_8h.html#a7e942a274981fd84a470b9c3ae7077d">00114</a> <span class="keyword">const</span> tpport_t <a class="code" href="base_8h.html#a7e942a274981fd84a470b9c3ae7077d" title="registered default RTCP transport port">DefaultRTCPPort</a> = 5005;
<a name="l00115"></a>00115 
<a name="l00116"></a>00116 <span class="preprocessor">#ifndef HAVE_GETTIMEOFDAY</span>
<a name="l00117"></a>00117 <span class="preprocessor"></span><span class="preprocessor">#ifdef  WIN32</span>
<a name="l00118"></a>00118 <span class="preprocessor"></span>__EXPORT <span class="keywordtype">int</span>
<a name="l00119"></a>00119 gettimeofday(<span class="keyword">struct</span> timeval *tv_, <span class="keywordtype">void</span> *tz_);
<a name="l00120"></a>00120 <span class="preprocessor">#endif</span>
<a name="l00121"></a>00121 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00122"></a>00122 <span class="preprocessor"></span>
<a name="l00123"></a>00123 <span class="preprocessor">#ifdef  CCXX_NAMESPACES</span>
<a name="l00124"></a>00124 <span class="preprocessor"></span>}
<a name="l00125"></a>00125 <span class="preprocessor">#endif</span>
<a name="l00126"></a>00126 <span class="preprocessor"></span>
<a name="l00127"></a>00127 <span class="preprocessor">#endif  // ndef CCXX_RTP_BASE_H_</span>
<a name="l00128"></a>00128 <span class="preprocessor"></span>
</pre></div></div>
<hr size="1"><address style="text-align: right;"><small>Generated on Fri Jul 24 21:42:25 2009 for ccRTP by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.9 </small></address>
</body>
</html>