Sophie

Sophie

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

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: ioqueue.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>ioqueue.h</h1><a href="ioqueue_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,2002,2004 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="l00044"></a>00044 <span class="preprocessor">#ifndef CCXX_RTP_IOQUEUE_H_</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#define CCXX_RTP_IOQUEUE_H_</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span>
<a name="l00047"></a>00047 <span class="preprocessor">#include &lt;<a class="code" href="iqueue_8h.html" title="Generic RTP input queues.">ccrtp/iqueue.h</a>&gt;</span>
<a name="l00048"></a>00048 <span class="preprocessor">#include &lt;<a class="code" href="oqueue_8h.html" title="Generic RTP output queues.">ccrtp/oqueue.h</a>&gt;</span>
<a name="l00049"></a>00049 
<a name="l00050"></a>00050 <span class="preprocessor">#ifdef  CCXX_NAMESPACES</span>
<a name="l00051"></a>00051 <span class="preprocessor"></span><span class="keyword">namespace </span>ost {
<a name="l00052"></a>00052 <span class="preprocessor">#endif</span>
<a name="l00053"></a>00053 <span class="preprocessor"></span>
<a name="l00077"></a><a class="code" href="class_r_t_p_data_queue.html">00077</a> <span class="keyword">class </span>__EXPORT <a class="code" href="class_r_t_p_data_queue.html" title="A packet queue handler for building different kinds of RTP protocol systems.">RTPDataQueue</a> :
<a name="l00078"></a>00078         <span class="keyword">public</span> <a class="code" href="class_incoming_data_queue.html" title="Queue for incoming RTP data packets in an RTP session.">IncomingDataQueue</a>,
<a name="l00079"></a>00079         <span class="keyword">public</span> <a class="code" href="class_outgoing_data_queue.html" title="A generic outgoing RTP data queue supporting multiple destinations.">OutgoingDataQueue</a>
<a name="l00080"></a>00080 {
<a name="l00081"></a>00081 <span class="keyword">public</span>:
<a name="l00101"></a><a class="code" href="class_r_t_p_data_queue.html#fa5169fe853e891b04897fab6f8efca1">00101</a>         <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00102"></a><a class="code" href="class_r_t_p_data_queue.html#fa5169fe853e891b04897fab6f8efca16dc3c20fe1dd9d54192e897866e3768a">00102</a>                 tosBestEffort,      
<a name="l00103"></a><a class="code" href="class_r_t_p_data_queue.html#fa5169fe853e891b04897fab6f8efca1e36023f8f3626a08e501ba65e4fefc24">00103</a>                 tosEnhanced         
<a name="l00104"></a>00104         }       Tos;
<a name="l00105"></a>00105 
<a name="l00118"></a>00118         <span class="keyword">inline</span> <span class="keywordtype">void</span>
<a name="l00119"></a><a class="code" href="class_r_t_p_data_queue.html#0edd2b1a8a22780b60da8eb05921ad16">00119</a>         setTypeOfService(<a class="code" href="class_r_t_p_data_queue.html#fa5169fe853e891b04897fab6f8efca1" title="rtp.h cc++/rtp.h">Tos</a> tos)
<a name="l00120"></a>00120         { typeOfService = tos; }
<a name="l00121"></a>00121 
<a name="l00126"></a><a class="code" href="class_r_t_p_data_queue.html#fee8bf2e2943d8785352eef2b804a91d">00126</a>         <span class="keyword">inline</span> <span class="keywordtype">void</span> enableStack()
<a name="l00127"></a>00127         { dataServiceActive = <span class="keyword">true</span>; }
<a name="l00128"></a>00128 
<a name="l00132"></a><a class="code" href="class_r_t_p_data_queue.html#a68b9d380c05c3c2c18ad6920aab9179">00132</a>         <span class="keyword">inline</span> <span class="keywordtype">void</span> disableStack()
<a name="l00133"></a>00133         { dataServiceActive = <span class="keyword">false</span>; }
<a name="l00134"></a>00134 
<a name="l00140"></a>00140         <span class="keyword">inline</span> <span class="keywordtype">bool</span>
<a name="l00141"></a><a class="code" href="class_r_t_p_data_queue.html#3d2531b75d7c79d815cff5c487d4ecc8">00141</a>         isActive()<span class="keyword"> const</span>
<a name="l00142"></a>00142 <span class="keyword">        </span>{ <span class="keywordflow">return</span> dataServiceActive; }
<a name="l00143"></a>00143 
<a name="l00203"></a>00203         uint32
<a name="l00204"></a>00204         getCurrentTimestamp() <span class="keyword">const</span>;
<a name="l00205"></a>00205 
<a name="l00213"></a>00213         <span class="keywordtype">void</span>
<a name="l00214"></a><a class="code" href="class_r_t_p_data_queue.html#fa51bc8859fd4c7e5460caa31d8c518b">00214</a>         setSessionBandwidth(uint32 bw)
<a name="l00215"></a>00215         { sessionBw = bw; }
<a name="l00216"></a>00216 
<a name="l00217"></a>00217         uint32
<a name="l00218"></a><a class="code" href="class_r_t_p_data_queue.html#ed0854a61cdd61dc2c6915d81da44d88">00218</a>         getDefaultSessionBandwidth()<span class="keyword"> const</span>
<a name="l00219"></a>00219 <span class="keyword">        </span>{ <span class="keywordflow">return</span> defaultSessionBw; }
<a name="l00220"></a>00220 
<a name="l00221"></a>00221         uint32
<a name="l00222"></a><a class="code" href="class_r_t_p_data_queue.html#90a9016c723622f778aa9b078f400ab2">00222</a>         getSessionBandwidth()<span class="keyword"> const</span>
<a name="l00223"></a>00223 <span class="keyword">        </span>{ <span class="keywordflow">return</span> sessionBw; }
<a name="l00224"></a>00224 
<a name="l00228"></a>00228         <span class="keyword">inline</span> <span class="keywordtype">void</span>
<a name="l00229"></a><a class="code" href="class_r_t_p_data_queue.html#3c16280cc4b45de49acd61d0dc1f53b8">00229</a>         setTimeclock()
<a name="l00230"></a>00230         { timeclock.setTimer(); }
<a name="l00231"></a>00231 
<a name="l00237"></a>00237         <span class="keyword">inline</span> timeout_t
<a name="l00238"></a><a class="code" href="class_r_t_p_data_queue.html#1007b5aceb1feb516cdd5bdd34318b6b">00238</a>         getTimeclock()<span class="keyword"> const</span>
<a name="l00239"></a>00239 <span class="keyword">        </span>{ <span class="keywordflow">return</span> timeclock.getElapsed(); }
<a name="l00240"></a>00240 
<a name="l00241"></a>00241 <span class="keyword">protected</span>:
<a name="l00242"></a>00242 
<a name="l00250"></a>00250         <a class="code" href="class_r_t_p_data_queue.html" title="A packet queue handler for building different kinds of RTP protocol systems.">RTPDataQueue</a>(uint32 size = defaultMembersHashSize);
<a name="l00251"></a>00251 
<a name="l00267"></a>00267         <a class="code" href="class_r_t_p_data_queue.html" title="A packet queue handler for building different kinds of RTP protocol systems.">RTPDataQueue</a>(uint32* ssrc, uint32 size = defaultMembersHashSize);
<a name="l00268"></a>00268 
<a name="l00273"></a>00273         <span class="keyword">inline</span> <span class="keyword">virtual</span>
<a name="l00274"></a><a class="code" href="class_r_t_p_data_queue.html#15ff7c0ccea0eb5749b60c4ef7d08f0d">00274</a>         ~<a class="code" href="class_r_t_p_data_queue.html" title="A packet queue handler for building different kinds of RTP protocol systems.">RTPDataQueue</a>()
<a name="l00275"></a>00275         { endQueue(); }
<a name="l00276"></a>00276 
<a name="l00280"></a>00280         <span class="keyword">inline</span> <span class="keyword">virtual</span> <span class="keywordtype">void</span>
<a name="l00281"></a><a class="code" href="class_r_t_p_data_queue.html#e9f0d6236da0cee4c6b5189c0daa633d">00281</a>         timerTick()
<a name="l00282"></a>00282         { <span class="keywordflow">return</span>; }
<a name="l00283"></a>00283 
<a name="l00284"></a><a class="code" href="class_r_t_p_data_queue.html#3cda7f313b23c9e00df8e54ed091e6a7">00284</a>         <span class="keywordtype">void</span> renewLocalSSRC()
<a name="l00285"></a>00285                 {<a class="code" href="class_incoming_data_queue.html#7a8b5c6c0e3c934cece8e909a499efd6">IncomingDataQueue::renewLocalSSRC</a>();}
<a name="l00286"></a>00286 
<a name="l00287"></a>00287 <span class="keyword">private</span>:
<a name="l00288"></a>00288         <a class="code" href="class_r_t_p_data_queue.html" title="A packet queue handler for building different kinds of RTP protocol systems.">RTPDataQueue</a>(<span class="keyword">const</span> <a class="code" href="class_r_t_p_data_queue.html" title="A packet queue handler for building different kinds of RTP protocol systems.">RTPDataQueue</a> &amp;o);
<a name="l00289"></a>00289 
<a name="l00290"></a>00290         <a class="code" href="class_r_t_p_data_queue.html" title="A packet queue handler for building different kinds of RTP protocol systems.">RTPDataQueue</a>&amp;
<a name="l00291"></a>00291         operator=(<span class="keyword">const</span> <a class="code" href="class_r_t_p_data_queue.html" title="A packet queue handler for building different kinds of RTP protocol systems.">RTPDataQueue</a> &amp;o);
<a name="l00292"></a>00292 
<a name="l00298"></a>00298         <span class="keywordtype">void</span>
<a name="l00299"></a>00299         initQueue();
<a name="l00300"></a>00300 
<a name="l00301"></a>00301 <span class="keyword">protected</span>:
<a name="l00305"></a>00305         <span class="keywordtype">void</span>
<a name="l00306"></a>00306         endQueue();
<a name="l00307"></a>00307 
<a name="l00315"></a>00315         <span class="keyword">virtual</span> <span class="keywordtype">bool</span>
<a name="l00316"></a>00316         isPendingData(<a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a> timeout) = 0;
<a name="l00317"></a>00317 
<a name="l00318"></a>00318 <span class="keyword">private</span>:
<a name="l00319"></a>00319         <span class="comment">// true if connection "active"</span>
<a name="l00320"></a>00320         <span class="keyword">volatile</span> <span class="keywordtype">bool</span> dataServiceActive;
<a name="l00321"></a>00321         Tos typeOfService;
<a name="l00322"></a>00322         TimerPort timeclock;
<a name="l00323"></a>00323         <span class="comment">/* RTP session bandwidth control */</span>
<a name="l00324"></a>00324         <span class="keyword">static</span> <span class="keyword">const</span> uint32 defaultSessionBw;
<a name="l00325"></a>00325         uint32 sessionBw;
<a name="l00326"></a>00326 
<a name="l00327"></a>00327 
<a name="l00328"></a>00328 };
<a name="l00329"></a>00329  <span class="comment">// ioqueue</span>
<a name="l00331"></a>00331 
<a name="l00332"></a>00332 <span class="preprocessor">#ifdef  CCXX_NAMESPACES</span>
<a name="l00333"></a>00333 <span class="preprocessor"></span>}
<a name="l00334"></a>00334 <span class="preprocessor">#endif</span>
<a name="l00335"></a>00335 <span class="preprocessor"></span>
<a name="l00336"></a>00336 <span class="preprocessor">#endif  //CCXX_RTP_IOQUEUE_H_</span>
<a name="l00337"></a>00337 <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>