<!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: oqueue.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 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 List</span></a></li> <li><a href="globals.html"><span>File Members</span></a></li> </ul> </div> <h1>oqueue.h</h1><a href="oqueue_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,2005 Federico Montesino Pouzols <fedemp@altern.org>.</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_OQUEUE_H_</span> <a name="l00045"></a>00045 <span class="preprocessor"></span><span class="preprocessor">#define CCXX_RTP_OQUEUE_H_</span> <a name="l00046"></a>00046 <span class="preprocessor"></span> <a name="l00047"></a>00047 <span class="preprocessor">#include <<a class="code" href="queuebase_8h.html" title="Base classes for RTP queues.">ccrtp/queuebase.h</a>></span> <a name="l00048"></a>00048 <span class="preprocessor">#include <<a class="code" href="_crypto_context_8h.html">ccrtp/CryptoContext.h</a>></span> <a name="l00049"></a>00049 <span class="preprocessor">#include <list></span> <a name="l00050"></a>00050 <a name="l00051"></a>00051 <span class="preprocessor">#ifdef CCXX_NAMESPACES</span> <a name="l00052"></a>00052 <span class="preprocessor"></span><span class="keyword">namespace </span>ost { <a name="l00053"></a>00053 <span class="preprocessor">#endif</span> <a name="l00054"></a>00054 <span class="preprocessor"></span> <a name="l00068"></a><a class="code" href="class_destination_list_handler.html">00068</a> <span class="keyword">class </span>__EXPORT <a class="code" href="class_destination_list_handler.html" title="This class handles a list of destination addresses.">DestinationListHandler</a> <a name="l00069"></a>00069 { <a name="l00070"></a>00070 <span class="keyword">protected</span>: <a name="l00071"></a><a class="code" href="class_destination_list_handler.html#9032eb908a72145fcab9908020686d3b">00071</a> <span class="keyword">struct </span><a class="code" href="struct_destination_list_handler_1_1_transport_address.html">TransportAddress</a>; <a name="l00072"></a>00072 std::list<TransportAddress*> destList; <a name="l00073"></a>00073 <a name="l00074"></a>00074 <span class="keyword">public</span>: <a name="l00075"></a>00075 <a class="code" href="class_destination_list_handler.html" title="This class handles a list of destination addresses.">DestinationListHandler</a>(); <a name="l00076"></a>00076 <a name="l00077"></a>00077 ~<a class="code" href="class_destination_list_handler.html" title="This class handles a list of destination addresses.">DestinationListHandler</a>(); <a name="l00078"></a>00078 <a name="l00082"></a><a class="code" href="class_destination_list_handler.html#b3562903d72394a74a6edcb214303a62">00082</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> isSingleDestination()<span class="keyword"> const</span> <a name="l00083"></a>00083 <span class="keyword"> </span>{ <span class="keywordflow">return</span> (1 == destList.size()); } <a name="l00084"></a>00084 <a name="l00085"></a><a class="code" href="class_destination_list_handler.html#bb299a19878d20e3f0ee4e637d83b1b8">00085</a> <span class="keyword">inline</span> <a class="code" href="struct_destination_list_handler_1_1_transport_address.html">TransportAddress</a>* getFirstDestination()<span class="keyword"> const</span> <a name="l00086"></a>00086 <span class="keyword"> </span>{ <span class="keywordflow">return</span> destList.front(); } <a name="l00087"></a>00087 <a name="l00088"></a><a class="code" href="class_destination_list_handler.html#953e97c7387f5d81986d0ca6dcf30588">00088</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> lockDestinationList()<span class="keyword"> const</span> <a name="l00089"></a>00089 <span class="keyword"> </span>{ destinationLock.readLock(); } <a name="l00090"></a>00090 <a name="l00091"></a><a class="code" href="class_destination_list_handler.html#042b325c6a8e2d290b0c008603c79448">00091</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> unlockDestinationList()<span class="keyword"> const</span> <a name="l00092"></a>00092 <span class="keyword"> </span>{ destinationLock.unlock(); } <a name="l00093"></a>00093 <a name="l00094"></a>00094 <span class="keyword">protected</span>: <a name="l00095"></a><a class="code" href="class_destination_list_handler.html#e5d51b14f7c94a8040e3b345e4ec0854">00095</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> writeLockDestinationList()<span class="keyword"> const</span> <a name="l00096"></a>00096 <span class="keyword"> </span>{ destinationLock.writeLock(); } <a name="l00097"></a>00097 <a name="l00101"></a>00101 <span class="keywordtype">bool</span> <a name="l00102"></a>00102 addDestinationToList(<span class="keyword">const</span> InetAddress& ia, tpport_t data, <a name="l00103"></a>00103 tpport_t control); <a name="l00104"></a>00104 <a name="l00108"></a>00108 <span class="keywordtype">bool</span> removeDestinationFromList(<span class="keyword">const</span> InetAddress& ia, <a name="l00109"></a>00109 tpport_t dataPort, <a name="l00110"></a>00110 tpport_t controlPort); <a name="l00111"></a>00111 <a name="l00112"></a><a class="code" href="struct_destination_list_handler_1_1_transport_address.html">00112</a> <span class="keyword">struct </span><a class="code" href="struct_destination_list_handler_1_1_transport_address.html">TransportAddress</a> <a name="l00113"></a>00113 { <a name="l00114"></a><a class="code" href="struct_destination_list_handler_1_1_transport_address.html#60aa0ef60a9e3e2f8862d870c6f62f75">00114</a> <a class="code" href="struct_destination_list_handler_1_1_transport_address.html">TransportAddress</a>(InetAddress na, tpport_t dtp, tpport_t ctp) : <a name="l00115"></a>00115 networkAddress(na), dataTransportPort(dtp), <a name="l00116"></a>00116 controlTransportPort(ctp) <a name="l00117"></a>00117 { } <a name="l00118"></a>00118 <a name="l00119"></a><a class="code" href="struct_destination_list_handler_1_1_transport_address.html#9bdd7a4751fb3ce4fea7e4a0d91c46a2">00119</a> <span class="keyword">inline</span> <span class="keyword">const</span> InetAddress& getNetworkAddress()<span class="keyword"> const</span> <a name="l00120"></a>00120 <span class="keyword"> </span>{ <span class="keywordflow">return</span> networkAddress; } <a name="l00121"></a>00121 <a name="l00122"></a><a class="code" href="struct_destination_list_handler_1_1_transport_address.html#e227cbf2b726e722fc2d5eb8ddc67fd3">00122</a> <span class="keyword">inline</span> tpport_t getDataTransportPort()<span class="keyword"> const</span> <a name="l00123"></a>00123 <span class="keyword"> </span>{ <span class="keywordflow">return</span> dataTransportPort; } <a name="l00124"></a>00124 <a name="l00125"></a><a class="code" href="struct_destination_list_handler_1_1_transport_address.html#710d2238cffb1d5aa991b8523c33d2c4">00125</a> <span class="keyword">inline</span> tpport_t getControlTransportPort()<span class="keyword"> const</span> <a name="l00126"></a>00126 <span class="keyword"> </span>{ <span class="keywordflow">return</span> controlTransportPort; } <a name="l00127"></a>00127 <a name="l00128"></a><a class="code" href="struct_destination_list_handler_1_1_transport_address.html#42ec4db1574aa82cec065c216cd51b8d">00128</a> InetAddress networkAddress; <a name="l00129"></a><a class="code" href="struct_destination_list_handler_1_1_transport_address.html#7b30e037b2b6f73572fd34423eb31a08">00129</a> tpport_t dataTransportPort, controlTransportPort; <a name="l00130"></a>00130 }; <a name="l00131"></a>00131 <a name="l00132"></a>00132 <span class="keyword">private</span>: <a name="l00133"></a>00133 <span class="keyword">mutable</span> ThreadLock destinationLock; <a name="l00134"></a>00134 }; <a name="l00135"></a>00135 <a name="l00136"></a>00136 <span class="preprocessor">#ifdef CCXX_IPV6</span> <a name="l00137"></a>00137 <span class="preprocessor"></span> <a name="l00145"></a>00145 <span class="keyword">class </span>__EXPORT DestinationListHandlerIPV6 <a name="l00146"></a>00146 { <a name="l00147"></a>00147 <span class="keyword">protected</span>: <a name="l00148"></a>00148 <span class="keyword">struct </span>TransportAddressIPV6; <a name="l00149"></a>00149 std::list<TransportAddressIPV6*> destListIPV6; <a name="l00150"></a>00150 <a name="l00151"></a>00151 <span class="keyword">public</span>: <a name="l00152"></a>00152 DestinationListHandlerIPV6(); <a name="l00153"></a>00153 <a name="l00154"></a>00154 ~DestinationListHandlerIPV6(); <a name="l00155"></a>00155 <a name="l00159"></a>00159 <span class="keyword">inline</span> <span class="keywordtype">bool</span> isSingleDestinationIPV6()<span class="keyword"> const</span> <a name="l00160"></a>00160 <span class="keyword"> </span>{ <span class="keywordflow">return</span> (1 == destListIPV6.size()); } <a name="l00161"></a>00161 <a name="l00162"></a>00162 <span class="keyword">inline</span> TransportAddressIPV6* getFirstDestinationIPV6()<span class="keyword"> const</span> <a name="l00163"></a>00163 <span class="keyword"> </span>{ <span class="keywordflow">return</span> destListIPV6.front(); } <a name="l00164"></a>00164 <a name="l00165"></a>00165 <span class="keyword">inline</span> <span class="keywordtype">void</span> lockDestinationListIPV6()<span class="keyword"> const</span> <a name="l00166"></a>00166 <span class="keyword"> </span>{ destinationLock.readLock(); } <a name="l00167"></a>00167 <a name="l00168"></a>00168 <span class="keyword">inline</span> <span class="keywordtype">void</span> unlockDestinationListIPV6()<span class="keyword"> const</span> <a name="l00169"></a>00169 <span class="keyword"> </span>{ destinationLock.unlock(); } <a name="l00170"></a>00170 <a name="l00171"></a>00171 <span class="keyword">protected</span>: <a name="l00172"></a>00172 <span class="keyword">inline</span> <span class="keywordtype">void</span> writeLockDestinationListIPV6()<span class="keyword"> const</span> <a name="l00173"></a>00173 <span class="keyword"> </span>{ destinationLock.writeLock(); } <a name="l00174"></a>00174 <a name="l00178"></a>00178 <span class="keywordtype">bool</span> <a name="l00179"></a>00179 addDestinationToListIPV6(<span class="keyword">const</span> IPV6Address& ia, tpport_t data, <a name="l00180"></a>00180 tpport_t control); <a name="l00181"></a>00181 <a name="l00185"></a>00185 <span class="keywordtype">bool</span> removeDestinationFromListIPV6(<span class="keyword">const</span> IPV6Address& ia, <a name="l00186"></a>00186 tpport_t dataPort, <a name="l00187"></a>00187 tpport_t controlPort); <a name="l00188"></a>00188 <a name="l00189"></a>00189 <span class="keyword">struct </span>TransportAddressIPV6 <a name="l00190"></a>00190 { <a name="l00191"></a>00191 TransportAddressIPV6(IPV6Address na, tpport_t dtp, tpport_t ctp) : <a name="l00192"></a>00192 networkAddress(na), dataTransportPort(dtp), <a name="l00193"></a>00193 controlTransportPort(ctp) <a name="l00194"></a>00194 { } <a name="l00195"></a>00195 <a name="l00196"></a>00196 <span class="keyword">inline</span> <span class="keyword">const</span> IPV6Address& getNetworkAddress()<span class="keyword"> const</span> <a name="l00197"></a>00197 <span class="keyword"> </span>{ <span class="keywordflow">return</span> networkAddress; } <a name="l00198"></a>00198 <a name="l00199"></a>00199 <span class="keyword">inline</span> tpport_t getDataTransportPort()<span class="keyword"> const</span> <a name="l00200"></a>00200 <span class="keyword"> </span>{ <span class="keywordflow">return</span> dataTransportPort; } <a name="l00201"></a>00201 <a name="l00202"></a>00202 <span class="keyword">inline</span> tpport_t getControlTransportPort()<span class="keyword"> const</span> <a name="l00203"></a>00203 <span class="keyword"> </span>{ <span class="keywordflow">return</span> controlTransportPort; } <a name="l00204"></a>00204 <a name="l00205"></a>00205 IPV6Address networkAddress; <a name="l00206"></a>00206 tpport_t dataTransportPort, controlTransportPort; <a name="l00207"></a>00207 }; <a name="l00208"></a>00208 <a name="l00209"></a>00209 <span class="keyword">private</span>: <a name="l00210"></a>00210 <span class="keyword">mutable</span> ThreadLock destinationLock; <a name="l00211"></a>00211 }; <a name="l00212"></a>00212 <a name="l00213"></a>00213 <span class="preprocessor">#endif</span> <a name="l00214"></a>00214 <span class="preprocessor"></span> <a name="l00222"></a><a class="code" href="class_outgoing_data_queue.html">00222</a> <span class="keyword">class </span>__EXPORT <a class="code" href="class_outgoing_data_queue.html" title="A generic outgoing RTP data queue supporting multiple destinations.">OutgoingDataQueue</a>: <a name="l00223"></a>00223 <span class="keyword">public</span> <a class="code" href="class_outgoing_data_queue_base.html">OutgoingDataQueueBase</a>, <a name="l00224"></a>00224 #ifdef CCXX_IPV6 <a name="l00225"></a>00225 <span class="keyword">protected</span> DestinationListHandlerIPV6, <a name="l00226"></a>00226 #endif <a name="l00227"></a>00227 <span class="keyword">protected</span> <a class="code" href="class_destination_list_handler.html" title="This class handles a list of destination addresses.">DestinationListHandler</a> <a name="l00228"></a>00228 { <a name="l00229"></a>00229 <span class="keyword">public</span>: <a name="l00230"></a>00230 <span class="preprocessor">#ifdef CCXX_IPV6</span> <a name="l00231"></a>00231 <span class="preprocessor"></span> <span class="keywordtype">bool</span> <a name="l00232"></a>00232 addDestination(<span class="keyword">const</span> IPV6Address& ia, <a name="l00233"></a>00233 tpport_t dataPort = <a class="code" href="base_8h.html#d4ff4b9421fd67733fa3ee452c8ee268" title="registered default RTP data transport port">DefaultRTPDataPort</a>, <a name="l00234"></a>00234 tpport_t controlPort = 0); <a name="l00235"></a>00235 <a name="l00236"></a>00236 <span class="keywordtype">bool</span> <a name="l00237"></a>00237 forgetDestination(<span class="keyword">const</span> IPV6Address& ia, <a name="l00238"></a>00238 tpport_t dataPort = <a class="code" href="base_8h.html#d4ff4b9421fd67733fa3ee452c8ee268" title="registered default RTP data transport port">DefaultRTPDataPort</a>, <a name="l00239"></a>00239 tpport_t controlPort = 0); <a name="l00240"></a>00240 <a name="l00241"></a>00241 <span class="preprocessor">#endif</span> <a name="l00242"></a>00242 <span class="preprocessor"></span> <a name="l00243"></a>00243 <span class="keywordtype">bool</span> <a name="l00244"></a>00244 addDestination(<span class="keyword">const</span> InetHostAddress& ia, <a name="l00245"></a>00245 tpport_t dataPort = <a class="code" href="base_8h.html#d4ff4b9421fd67733fa3ee452c8ee268" title="registered default RTP data transport port">DefaultRTPDataPort</a>, <a name="l00246"></a>00246 tpport_t controlPort = 0); <a name="l00247"></a>00247 <a name="l00248"></a>00248 <span class="keywordtype">bool</span> <a name="l00249"></a>00249 addDestination(<span class="keyword">const</span> InetMcastAddress& ia, <a name="l00250"></a>00250 tpport_t dataPort = <a class="code" href="base_8h.html#d4ff4b9421fd67733fa3ee452c8ee268" title="registered default RTP data transport port">DefaultRTPDataPort</a>, <a name="l00251"></a>00251 tpport_t controlPort = 0); <a name="l00252"></a>00252 <a name="l00253"></a>00253 <span class="keywordtype">bool</span> <a name="l00254"></a>00254 forgetDestination(<span class="keyword">const</span> InetHostAddress& ia, <a name="l00255"></a>00255 tpport_t dataPort = <a class="code" href="base_8h.html#d4ff4b9421fd67733fa3ee452c8ee268" title="registered default RTP data transport port">DefaultRTPDataPort</a>, <a name="l00256"></a>00256 tpport_t controlPort = 0); <a name="l00257"></a>00257 <a name="l00258"></a>00258 <span class="keywordtype">bool</span> <a name="l00259"></a>00259 forgetDestination(<span class="keyword">const</span> InetMcastAddress& ia, <a name="l00260"></a>00260 tpport_t dataPort = <a class="code" href="base_8h.html#d4ff4b9421fd67733fa3ee452c8ee268" title="registered default RTP data transport port">DefaultRTPDataPort</a>, <a name="l00261"></a>00261 tpport_t controlPort = 0); <a name="l00262"></a>00262 <a name="l00268"></a>00268 <span class="keywordtype">void</span> <a name="l00269"></a>00269 addContributor(uint32 csrc); <a name="l00270"></a>00270 <a name="l00274"></a>00274 <span class="keywordtype">bool</span> <a name="l00275"></a>00275 removeContributor(uint32 csrc); <a name="l00276"></a>00276 <a name="l00282"></a>00282 <span class="keywordtype">bool</span> <a name="l00283"></a>00283 isSending() <span class="keyword">const</span>; <a name="l00284"></a>00284 <a name="l00285"></a>00285 <a name="l00298"></a>00298 <span class="keywordtype">void</span> <a name="l00299"></a>00299 putData(uint32 stamp, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* data = NULL, <span class="keywordtype">size_t</span> len = 0); <a name="l00300"></a>00300 <a name="l00313"></a>00313 <span class="keywordtype">void</span> <a name="l00314"></a>00314 sendImmediate(uint32 stamp, <span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* data = NULL, <span class="keywordtype">size_t</span> len = 0); <a name="l00315"></a>00315 <a name="l00316"></a>00316 <a name="l00323"></a><a class="code" href="class_outgoing_data_queue.html#774ad65daf2bcd1ecb6423036212e20d">00323</a> <span class="keywordtype">void</span> setPadding(uint8 paddinglen) <a name="l00324"></a>00324 { sendInfo.paddinglen = paddinglen; } <a name="l00325"></a>00325 <a name="l00334"></a><a class="code" href="class_outgoing_data_queue.html#d4df9079d56ce32ecbe50d17ef52743f">00334</a> <span class="keywordtype">void</span> setMark(<span class="keywordtype">bool</span> mark) <a name="l00335"></a>00335 { sendInfo.marked = mark; } <a name="l00336"></a>00336 <a name="l00340"></a><a class="code" href="class_outgoing_data_queue.html#2743c338ca9b19f4eeb4438132dd0cee">00340</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> getMark()<span class="keyword"> const</span> <a name="l00341"></a>00341 <span class="keyword"> </span>{ <span class="keywordflow">return</span> sendInfo.marked; } <a name="l00342"></a>00342 <a name="l00353"></a>00353 <span class="keywordtype">size_t</span> <a name="l00354"></a>00354 setPartial(uint32 timestamp, <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* data, <span class="keywordtype">size_t</span> offset, <span class="keywordtype">size_t</span> max); <a name="l00355"></a>00355 <a name="l00356"></a>00356 <span class="keyword">inline</span> <a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a> <a name="l00357"></a><a class="code" href="class_outgoing_data_queue.html#d7b9ea7183b6d26cff42979ee06a49ad">00357</a> getDefaultSchedulingTimeout()<span class="keyword"> const</span> <a name="l00358"></a>00358 <span class="keyword"> </span>{ <span class="keywordflow">return</span> defaultSchedulingTimeout; } <a name="l00359"></a>00359 <a name="l00366"></a>00366 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a name="l00367"></a><a class="code" href="class_outgoing_data_queue.html#a602fdcd5d4d21b54eb31c7dc526bc39">00367</a> setSchedulingTimeout(<a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a> to) <a name="l00368"></a>00368 { schedulingTimeout = to; } <a name="l00369"></a>00369 <a name="l00370"></a>00370 <span class="keyword">inline</span> <a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a> <a name="l00371"></a><a class="code" href="class_outgoing_data_queue.html#94cd08580f0146b14e43c0ed59114f27">00371</a> getDefaultExpireTimeout()<span class="keyword"> const</span> <a name="l00372"></a>00372 <span class="keyword"> </span>{ <span class="keywordflow">return</span> defaultExpireTimeout; } <a name="l00373"></a>00373 <a name="l00381"></a>00381 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a name="l00382"></a><a class="code" href="class_outgoing_data_queue.html#e35a0ebe6fd9da0f0cf9504319bd5c1c">00382</a> setExpireTimeout(<a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a> to) <a name="l00383"></a>00383 { expireTimeout = to; } <a name="l00384"></a>00384 <a name="l00385"></a><a class="code" href="class_outgoing_data_queue.html#2a79e1fa3458d3164b60b62cc9955adc">00385</a> <span class="keyword">inline</span> <a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a> getExpireTimeout()<span class="keyword"> const</span> <a name="l00386"></a>00386 <span class="keyword"> </span>{ <span class="keywordflow">return</span> expireTimeout; } <a name="l00387"></a>00387 <a name="l00393"></a>00393 <span class="keyword">inline</span> uint32 <a name="l00394"></a><a class="code" href="class_outgoing_data_queue.html#6a8ab8b1dbe72f629d7e736dc3e42a89">00394</a> getSendPacketCount()<span class="keyword"> const</span> <a name="l00395"></a>00395 <span class="keyword"> </span>{ <span class="keywordflow">return</span> sendInfo.packetCount; } <a name="l00396"></a>00396 <a name="l00402"></a>00402 <span class="keyword">inline</span> uint32 <a name="l00403"></a><a class="code" href="class_outgoing_data_queue.html#84a52a59e2ef84b6021013776efdf756">00403</a> getSendOctetCount()<span class="keyword"> const</span> <a name="l00404"></a>00404 <span class="keyword"> </span>{ <span class="keywordflow">return</span> sendInfo.octetCount; } <a name="l00405"></a>00405 <a name="l00411"></a>00411 <span class="keyword">inline</span> uint16 <a name="l00412"></a><a class="code" href="class_outgoing_data_queue.html#6352eb8f6480b25c8e338549bada0012">00412</a> getSequenceNumber()<span class="keyword"> const</span> <a name="l00413"></a>00413 <span class="keyword"> </span>{ <span class="keywordflow">return</span> sendInfo.sendSeq; } <a name="l00414"></a>00414 <a name="l00423"></a>00423 <span class="keywordtype">void</span> <a name="l00424"></a>00424 setOutQueueCryptoContext(<a class="code" href="class_crypto_context.html" title="The implementation for a SRTP cryptographic context.">CryptoContext</a>* cc); <a name="l00425"></a>00425 <a name="l00434"></a>00434 <span class="keywordtype">void</span> <a name="l00435"></a>00435 removeOutQueueCryptoContext(<a class="code" href="class_crypto_context.html" title="The implementation for a SRTP cryptographic context.">CryptoContext</a>* cc); <a name="l00436"></a>00436 <a name="l00444"></a>00444 <a class="code" href="class_crypto_context.html" title="The implementation for a SRTP cryptographic context.">CryptoContext</a>* <a name="l00445"></a>00445 getOutQueueCryptoContext(uint32 ssrc); <a name="l00446"></a>00446 <a name="l00447"></a>00447 <a name="l00448"></a>00448 <span class="keyword">protected</span>: <a name="l00449"></a>00449 <a class="code" href="class_outgoing_data_queue.html" title="A generic outgoing RTP data queue supporting multiple destinations.">OutgoingDataQueue</a>(); <a name="l00450"></a>00450 <a name="l00451"></a><a class="code" href="class_outgoing_data_queue.html#38db013dc101861a7507a008b71101e8">00451</a> <span class="keyword">virtual</span> ~<a class="code" href="class_outgoing_data_queue.html" title="A generic outgoing RTP data queue supporting multiple destinations.">OutgoingDataQueue</a>() <a name="l00452"></a>00452 { } <a name="l00453"></a>00453 <a name="l00454"></a><a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html">00454</a> <span class="keyword">struct </span><a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html">OutgoingRTPPktLink</a> <a name="l00455"></a>00455 { <a name="l00456"></a><a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#de1e485b0b7070acafeab61cbf962c3d">00456</a> <a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html">OutgoingRTPPktLink</a>(<a class="code" href="class_outgoing_r_t_p_pkt.html" title="RTP packets being sent.">OutgoingRTPPkt</a>* pkt, <a name="l00457"></a>00457 <a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html">OutgoingRTPPktLink</a>* p, <a name="l00458"></a>00458 <a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html">OutgoingRTPPktLink</a>* n) : <a name="l00459"></a>00459 packet(pkt), prev(p), next(n) { } <a name="l00460"></a>00460 <a name="l00461"></a><a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#8ebca385dd1a7b8c18bd404af72d0dc9">00461</a> <a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#8ebca385dd1a7b8c18bd404af72d0dc9">~OutgoingRTPPktLink</a>() { <span class="keyword">delete</span> packet; } <a name="l00462"></a>00462 <a name="l00463"></a><a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#bd22f40ee75b2a7474ab7f24027195b9">00463</a> <span class="keyword">inline</span> <a class="code" href="class_outgoing_r_t_p_pkt.html" title="RTP packets being sent.">OutgoingRTPPkt</a>* <a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#bd22f40ee75b2a7474ab7f24027195b9">getPacket</a>() { <span class="keywordflow">return</span> packet; } <a name="l00464"></a>00464 <a name="l00465"></a><a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#cd47fcb63e3b24d9f665425d10f4ec77">00465</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#cd47fcb63e3b24d9f665425d10f4ec77">setPacket</a>(<a class="code" href="class_outgoing_r_t_p_pkt.html" title="RTP packets being sent.">OutgoingRTPPkt</a>* pkt) { packet = pkt; } <a name="l00466"></a>00466 <a name="l00467"></a><a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#ce0c17c4e9836234c081b27bf9bfea8c">00467</a> <span class="keyword">inline</span> <a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html">OutgoingRTPPktLink</a>* <a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#ce0c17c4e9836234c081b27bf9bfea8c">getPrev</a>() { <span class="keywordflow">return</span> prev; } <a name="l00468"></a>00468 <a name="l00469"></a><a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#4d1951d3e7ac9516193b77280ddcd787">00469</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#4d1951d3e7ac9516193b77280ddcd787">setPrev</a>(<a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html">OutgoingRTPPktLink</a>* p) { prev = p; } <a name="l00470"></a>00470 <a name="l00471"></a><a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#9d354c04d3feb69d61b429c4d8af80e7">00471</a> <span class="keyword">inline</span> <a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html">OutgoingRTPPktLink</a>* <a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#9d354c04d3feb69d61b429c4d8af80e7">getNext</a>() { <span class="keywordflow">return</span> next; } <a name="l00472"></a>00472 <a name="l00473"></a><a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#69f6ec7a63f55dbd417fdcc9c61390c4">00473</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#69f6ec7a63f55dbd417fdcc9c61390c4">setNext</a>(<a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html">OutgoingRTPPktLink</a>* n) { next = n; } <a name="l00474"></a>00474 <a name="l00475"></a>00475 <span class="comment">// the packet this link refers to.</span> <a name="l00476"></a><a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#8ef435b8178abd9f495335cb2aed7b55">00476</a> <a class="code" href="class_outgoing_r_t_p_pkt.html" title="RTP packets being sent.">OutgoingRTPPkt</a>* packet; <a name="l00477"></a>00477 <span class="comment">// global outgoing packets queue.</span> <a name="l00478"></a><a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html#a9952c7dbb6a058bc97ceab4da1f7a44">00478</a> <a class="code" href="struct_outgoing_data_queue_1_1_outgoing_r_t_p_pkt_link.html">OutgoingRTPPktLink</a> * prev, * next; <a name="l00479"></a>00479 }; <a name="l00480"></a>00480 <a name="l00488"></a>00488 <span class="keywordtype">void</span> <a name="l00489"></a>00489 dispatchImmediate(<a class="code" href="class_outgoing_r_t_p_pkt.html" title="RTP packets being sent.">OutgoingRTPPkt</a> *packet); <a name="l00490"></a>00490 <a name="l00500"></a>00500 <a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a> <a name="l00501"></a>00501 getSchedulingTimeout(); <a name="l00502"></a>00502 <a name="l00509"></a>00509 <span class="keywordtype">size_t</span> <a name="l00510"></a>00510 dispatchDataPacket(); <a name="l00511"></a>00511 <a name="l00520"></a>00520 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a name="l00521"></a><a class="code" href="class_outgoing_data_queue.html#6ed1a1e41346d284bc8e0d43b5a77e8e">00521</a> setNextSeqNum(uint32 seqNum) <a name="l00522"></a>00522 { sendInfo.sendSeq = seqNum; } <a name="l00523"></a>00523 <a name="l00524"></a>00524 <span class="keyword">inline</span> uint32 <a name="l00525"></a><a class="code" href="class_outgoing_data_queue.html#29de91e1313c732f47d74cf9bd136fe3">00525</a> getCurrentSeqNum(<span class="keywordtype">void</span>) <a name="l00526"></a>00526 { <span class="keywordflow">return</span> sendInfo.sendSeq; } <a name="l00527"></a>00527 <a name="l00530"></a>00530 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a name="l00531"></a><a class="code" href="class_outgoing_data_queue.html#062033407b73fab8e40ccc9533a13957">00531</a> setInitialTimestamp(uint32 ts) <a name="l00532"></a>00532 { initialTimestamp = ts; } <a name="l00533"></a>00533 <a name="l00536"></a>00536 <span class="keyword">inline</span> uint32 <a name="l00537"></a><a class="code" href="class_outgoing_data_queue.html#2b21f2a6e408c9712fc9f087969df51f">00537</a> getInitialTimestamp() <a name="l00538"></a>00538 { <span class="keywordflow">return</span> initialTimestamp; } <a name="l00539"></a>00539 <a name="l00540"></a>00540 <span class="keywordtype">void</span> purgeOutgoingQueue(); <a name="l00541"></a>00541 <a name="l00542"></a>00542 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a name="l00543"></a><a class="code" href="class_outgoing_data_queue.html#122915159f16fa0aa269c7408b1094f7">00543</a> <a class="code" href="class_outgoing_data_queue.html#122915159f16fa0aa269c7408b1094f7">setControlPeer</a>(<span class="keyword">const</span> InetAddress &host, tpport_t port) {} <a name="l00544"></a>00544 <a name="l00545"></a>00545 <span class="preprocessor">#ifdef CCXX_IPV6</span> <a name="l00546"></a>00546 <span class="preprocessor"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a name="l00547"></a>00547 setControlPeerIPV6(<span class="keyword">const</span> IPV6Address &host, tpport_t port) {} <a name="l00548"></a>00548 <span class="preprocessor">#endif</span> <a name="l00549"></a>00549 <span class="preprocessor"></span> <a name="l00550"></a>00550 <span class="comment">// The crypto contexts for outgoing SRTP sessions.</span> <a name="l00551"></a><a class="code" href="class_outgoing_data_queue.html#5bf1a4845a5a0d029d08a40905c5d22b">00551</a> <span class="keyword">mutable</span> Mutex cryptoMutex; <a name="l00552"></a><a class="code" href="class_outgoing_data_queue.html#f73cab813f65783125b654db509799eb">00552</a> std::list<CryptoContext *> cryptoContexts; <a name="l00553"></a>00553 <a name="l00554"></a>00554 <span class="keyword">private</span>: <a name="l00560"></a>00560 <span class="keyword">inline</span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> onExpireSend(<a class="code" href="class_outgoing_r_t_p_pkt.html" title="RTP packets being sent.">OutgoingRTPPkt</a>&) <a name="l00561"></a>00561 { } <a name="l00562"></a>00562 <a name="l00563"></a>00563 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a name="l00564"></a>00564 setDataPeer(<span class="keyword">const</span> InetAddress &host, tpport_t port) {} <a name="l00565"></a>00565 <a name="l00566"></a>00566 <span class="preprocessor">#ifdef CCXX_IPV6</span> <a name="l00567"></a>00567 <span class="preprocessor"></span> <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a name="l00568"></a>00568 setDataPeerIPV6(<span class="keyword">const</span> IPV6Address &host, tpport_t port) {} <a name="l00569"></a>00569 <span class="preprocessor">#endif</span> <a name="l00570"></a>00570 <span class="preprocessor"></span> <a name="l00580"></a>00580 <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> <a name="l00581"></a>00581 sendData(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> buffer, <span class="keywordtype">size_t</span> len) {<span class="keywordflow">return</span> 0;} <a name="l00582"></a>00582 <a name="l00583"></a>00583 <span class="preprocessor">#ifdef CCXX_IPV6</span> <a name="l00584"></a>00584 <span class="preprocessor"></span> <span class="keyword">virtual</span> <span class="keywordtype">size_t</span> <a name="l00585"></a>00585 sendDataIPV6(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>* <span class="keyword">const</span> buffer, <span class="keywordtype">size_t</span> len) {<span class="keywordflow">return</span> 0;} <a name="l00586"></a>00586 <span class="preprocessor">#endif</span> <a name="l00587"></a>00587 <span class="preprocessor"></span> <a name="l00588"></a>00588 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a> defaultSchedulingTimeout; <a name="l00589"></a>00589 <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a> defaultExpireTimeout; <a name="l00590"></a>00590 <span class="keyword">mutable</span> ThreadLock sendLock; <a name="l00591"></a>00591 <span class="comment">// outgoing data packets queue</span> <a name="l00592"></a>00592 OutgoingRTPPktLink* sendFirst, * sendLast; <a name="l00593"></a>00593 uint32 initialTimestamp; <a name="l00594"></a>00594 <span class="comment">// transmission scheduling timeout for the service thread</span> <a name="l00595"></a>00595 <a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a> schedulingTimeout; <a name="l00596"></a>00596 <span class="comment">// how old a packet can reach in the sending queue before deletetion</span> <a name="l00597"></a>00597 <a class="code" href="base_8h.html#c16d853255145e6a903914eb376a84bb" title="Time interval expressed in microseconds.">microtimeout_t</a> expireTimeout; <a name="l00598"></a>00598 <a name="l00599"></a>00599 <a name="l00600"></a>00600 <span class="keyword">struct </span>{ <a name="l00601"></a>00601 <span class="comment">// number of packets sent from the beginning</span> <a name="l00602"></a><a class="code" href="class_outgoing_data_queue.html#b9fdb3961410b1697375c69cc8d73c8c">00602</a> uint32 packetCount; <a name="l00603"></a>00603 <span class="comment">// number of payload octets sent from the beginning</span> <a name="l00604"></a><a class="code" href="class_outgoing_data_queue.html#398bb8b58fa2bb0c50587fa05000c963">00604</a> uint32 octetCount; <a name="l00605"></a>00605 <span class="comment">// the sequence number of the next packet to sent</span> <a name="l00606"></a><a class="code" href="class_outgoing_data_queue.html#78d98ca365a23ca42189687fa4dacbcc">00606</a> uint16 sendSeq; <a name="l00607"></a>00607 <span class="comment">// contributing sources</span> <a name="l00608"></a><a class="code" href="class_outgoing_data_queue.html#72f53548019b51735cc5cf6cbb3e7fec">00608</a> uint32 sendSources[16]; <a name="l00609"></a>00609 <span class="comment">// how many CSRCs to send.</span> <a name="l00610"></a><a class="code" href="class_outgoing_data_queue.html#bb80d80c2d64012132033962df4cd49a">00610</a> uint16 sendCC; <a name="l00611"></a>00611 <span class="comment">// pad packets to a paddinglen multiple</span> <a name="l00612"></a><a class="code" href="class_outgoing_data_queue.html#b219ff2ba9ba7781b8e4fc80eae0d574">00612</a> uint8 paddinglen; <a name="l00613"></a>00613 <span class="comment">// This flags tells whether to set the bit M in the</span> <a name="l00614"></a>00614 <span class="comment">// RTP fixed header of the packet in which the next</span> <a name="l00615"></a>00615 <span class="comment">// provided data will be sent.</span> <a name="l00616"></a><a class="code" href="class_outgoing_data_queue.html#eb285cb0c04acaf302e481f826ac1c75">00616</a> <span class="keywordtype">bool</span> marked; <a name="l00617"></a>00617 <span class="comment">// whether there was not loss.</span> <a name="l00618"></a><a class="code" href="class_outgoing_data_queue.html#a9a056c68557ca6fc8da1d95107c6145">00618</a> <span class="keywordtype">bool</span> complete; <a name="l00619"></a>00619 <span class="comment">// ramdonly generated offset for the timestamp of sent packets</span> <a name="l00620"></a>00620 uint32 initialTimestamp; <a name="l00621"></a>00621 <span class="comment">// elapsed time accumulated through successive overflows of</span> <a name="l00622"></a>00622 <span class="comment">// the local timestamp field</span> <a name="l00623"></a><a class="code" href="class_outgoing_data_queue.html#b7ec7c4334179365fc1b4b3999ad3e34">00623</a> timeval overflowTime; <a name="l00624"></a>00624 } sendInfo; <a name="l00625"></a>00625 }; <a name="l00626"></a>00626 <span class="comment">// oqueue</span> <a name="l00628"></a>00628 <a name="l00629"></a>00629 <span class="preprocessor">#ifdef CCXX_NAMESPACES</span> <a name="l00630"></a>00630 <span class="preprocessor"></span>} <a name="l00631"></a>00631 <span class="preprocessor">#endif</span> <a name="l00632"></a>00632 <span class="preprocessor"></span> <a name="l00633"></a>00633 <span class="preprocessor">#endif //CCXX_RTP_OQUEUE_H_</span> <a name="l00634"></a>00634 <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 <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>