<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> <title>jrtplib: src/rtpudpv4transmitter.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"> <link href="jrtplib.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="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</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> <div class="navpath"><a class="el" href="dir_e5298977290e638844c8018a73ab0caf.html">src</a> </div> </div> <div class="contents"> <h1>rtpudpv4transmitter.h</h1><a href="rtpudpv4transmitter_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"></span> <a name="l00003"></a>00003 <span class="comment"> This file is a part of JRTPLIB</span> <a name="l00004"></a>00004 <span class="comment"> Copyright (c) 1999-2007 Jori Liesenborgs</span> <a name="l00005"></a>00005 <span class="comment"></span> <a name="l00006"></a>00006 <span class="comment"> Contact: jori.liesenborgs@gmail.com</span> <a name="l00007"></a>00007 <span class="comment"></span> <a name="l00008"></a>00008 <span class="comment"> This library was developed at the "Expertisecentrum Digitale Media"</span> <a name="l00009"></a>00009 <span class="comment"> (http://www.edm.uhasselt.be), a research center of the Hasselt University</span> <a name="l00010"></a>00010 <span class="comment"> (http://www.uhasselt.be). The library is based upon work done for </span> <a name="l00011"></a>00011 <span class="comment"> my thesis at the School for Knowledge Technology (Belgium/The Netherlands).</span> <a name="l00012"></a>00012 <span class="comment"></span> <a name="l00013"></a>00013 <span class="comment"> Permission is hereby granted, free of charge, to any person obtaining a</span> <a name="l00014"></a>00014 <span class="comment"> copy of this software and associated documentation files (the "Software"),</span> <a name="l00015"></a>00015 <span class="comment"> to deal in the Software without restriction, including without limitation</span> <a name="l00016"></a>00016 <span class="comment"> the rights to use, copy, modify, merge, publish, distribute, sublicense,</span> <a name="l00017"></a>00017 <span class="comment"> and/or sell copies of the Software, and to permit persons to whom the</span> <a name="l00018"></a>00018 <span class="comment"> Software is furnished to do so, subject to the following conditions:</span> <a name="l00019"></a>00019 <span class="comment"></span> <a name="l00020"></a>00020 <span class="comment"> The above copyright notice and this permission notice shall be included</span> <a name="l00021"></a>00021 <span class="comment"> in all copies or substantial portions of the Software.</span> <a name="l00022"></a>00022 <span class="comment"></span> <a name="l00023"></a>00023 <span class="comment"> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS</span> <a name="l00024"></a>00024 <span class="comment"> OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span> <a name="l00025"></a>00025 <span class="comment"> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL</span> <a name="l00026"></a>00026 <span class="comment"> THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span> <a name="l00027"></a>00027 <span class="comment"> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span> <a name="l00028"></a>00028 <span class="comment"> FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS</span> <a name="l00029"></a>00029 <span class="comment"> IN THE SOFTWARE.</span> <a name="l00030"></a>00030 <span class="comment"></span> <a name="l00031"></a>00031 <span class="comment">*/</span> <a name="l00032"></a>00032 <a name="l00037"></a>00037 <span class="preprocessor">#ifndef RTPUDPV4TRANSMITTER_H</span> <a name="l00038"></a>00038 <span class="preprocessor"></span> <a name="l00039"></a>00039 <span class="preprocessor">#define RTPUDPV4TRANSMITTER_H</span> <a name="l00040"></a>00040 <span class="preprocessor"></span> <a name="l00041"></a>00041 <span class="preprocessor">#include "rtpconfig.h"</span> <a name="l00042"></a>00042 <span class="preprocessor">#include "<a class="code" href="rtptransmitter_8h.html">rtptransmitter.h</a>"</span> <a name="l00043"></a>00043 <span class="preprocessor">#include "<a class="code" href="rtpipv4destination_8h.html">rtpipv4destination.h</a>"</span> <a name="l00044"></a>00044 <span class="preprocessor">#include "<a class="code" href="rtphashtable_8h.html">rtphashtable.h</a>"</span> <a name="l00045"></a>00045 <span class="preprocessor">#include "<a class="code" href="rtpkeyhashtable_8h.html">rtpkeyhashtable.h</a>"</span> <a name="l00046"></a>00046 <span class="preprocessor">#include <list></span> <a name="l00047"></a>00047 <a name="l00048"></a>00048 <span class="preprocessor">#ifdef RTP_SUPPORT_THREAD</span> <a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor"> #include <jmutex.h></span> <a name="l00050"></a>00050 <span class="preprocessor">#endif // RTP_SUPPORT_THREAD</span> <a name="l00051"></a>00051 <span class="preprocessor"></span> <a name="l00052"></a>00052 <span class="preprocessor">#define RTPUDPV4TRANS_HASHSIZE 8317</span> <a name="l00053"></a>00053 <span class="preprocessor"></span><span class="preprocessor">#define RTPUDPV4TRANS_DEFAULTPORTBASE 5000</span> <a name="l00054"></a>00054 <span class="preprocessor"></span> <a name="l00055"></a>00055 <span class="preprocessor">#define RTPUDPV4TRANS_RTPRECEIVEBUFFER 32768</span> <a name="l00056"></a>00056 <span class="preprocessor"></span><span class="preprocessor">#define RTPUDPV4TRANS_RTCPRECEIVEBUFFER 32768</span> <a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#define RTPUDPV4TRANS_RTPTRANSMITBUFFER 32768</span> <a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor">#define RTPUDPV4TRANS_RTCPTRANSMITBUFFER 32768</span> <a name="l00059"></a>00059 <span class="preprocessor"></span> <a name="l00061"></a><a class="code" href="classRTPUDPv4TransmissionParams.html">00061</a> <span class="keyword">class </span><a class="code" href="classRTPUDPv4TransmissionParams.html" title="Parameters for the UDP over IPv4 transmitter.">RTPUDPv4TransmissionParams</a> : <span class="keyword">public</span> <a class="code" href="classRTPTransmissionParams.html" title="Base class for transmission parameters.">RTPTransmissionParams</a> <a name="l00062"></a>00062 { <a name="l00063"></a>00063 <span class="keyword">public</span>: <a name="l00064"></a>00064 <a class="code" href="classRTPUDPv4TransmissionParams.html" title="Parameters for the UDP over IPv4 transmitter.">RTPUDPv4TransmissionParams</a>():<a class="code" href="classRTPTransmissionParams.html" title="Base class for transmission parameters.">RTPTransmissionParams</a>(<a class="code" href="classRTPTransmitter.html#00529bcf331e3d3dc57c4ebb476f1fd2430dce496268bd29e79f32fd91d576ff" title="Specifies the internal UDP over IPv4 transmitter.">RTPTransmitter::IPv4UDPProto</a>) { portbase = RTPUDPV4TRANS_DEFAULTPORTBASE; bindIP = 0; multicastTTL = 1; mcastifaceIP = 0; rtpsendbuf = RTPUDPV4TRANS_RTPTRANSMITBUFFER; rtprecvbuf= RTPUDPV4TRANS_RTPRECEIVEBUFFER; rtcpsendbuf = RTPUDPV4TRANS_RTCPTRANSMITBUFFER; rtcprecvbuf = RTPUDPV4TRANS_RTCPRECEIVEBUFFER; } <a name="l00065"></a>00065 <a name="l00067"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#020d757327b1d2f32692c5a5e867ade7">00067</a> <span class="keywordtype">void</span> <a class="code" href="classRTPUDPv4TransmissionParams.html#020d757327b1d2f32692c5a5e867ade7" title="Sets the IP address which is used to bind the sockets to ip.">SetBindIP</a>(uint32_t ip) { bindIP = ip; } <a name="l00068"></a>00068 <a name="l00070"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#446db3414f95184dd258fcbac8925e97">00070</a> <span class="keywordtype">void</span> <a class="code" href="classRTPUDPv4TransmissionParams.html#446db3414f95184dd258fcbac8925e97" title="Sets the multicast interface IP address.">SetMulticastInterfaceIP</a>(uint32_t ip) { mcastifaceIP = ip; } <a name="l00071"></a>00071 <a name="l00073"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#a8f9e29f0a0380a3b0334d873b558895">00073</a> <span class="keywordtype">void</span> <a class="code" href="classRTPUDPv4TransmissionParams.html#a8f9e29f0a0380a3b0334d873b558895" title="Sets the RTP portbase to pbase.">SetPortbase</a>(uint16_t pbase) { portbase = pbase; } <a name="l00074"></a>00074 <a name="l00076"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#76f4a69c6eb1d11e20ba136a3ba876db">00076</a> <span class="keywordtype">void</span> <a class="code" href="classRTPUDPv4TransmissionParams.html#76f4a69c6eb1d11e20ba136a3ba876db" title="Sets the multicast TTL to be used to mcastTTL.">SetMulticastTTL</a>(uint8_t mcastTTL) { multicastTTL = mcastTTL; } <a name="l00077"></a>00077 <a name="l00079"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#ad51f50f727bb43371df9194537bb78d">00079</a> <span class="keywordtype">void</span> <a class="code" href="classRTPUDPv4TransmissionParams.html#ad51f50f727bb43371df9194537bb78d" title="Passes a list of IP addresses which will be used as the local IP addresses.">SetLocalIPList</a>(std::list<uint32_t> &iplist) { localIPs = iplist; } <a name="l00080"></a>00080 <a name="l00085"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#a19d5f29c0e1b5f66221e8c1ff363276">00085</a> <span class="keywordtype">void</span> <a class="code" href="classRTPUDPv4TransmissionParams.html#a19d5f29c0e1b5f66221e8c1ff363276" title="Clears the list of local IP addresses.">ClearLocalIPList</a>() { localIPs.clear(); } <a name="l00086"></a>00086 <a name="l00088"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#1b408e3c211ff9a88eccf02ec5801f8b">00088</a> uint32_t <a class="code" href="classRTPUDPv4TransmissionParams.html#1b408e3c211ff9a88eccf02ec5801f8b" title="Returns the IP address which will be used to bind the sockets.">GetBindIP</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> bindIP; } <a name="l00089"></a>00089 <a name="l00091"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#d503605517082a72ab0b4584cea4c4c9">00091</a> uint32_t <a class="code" href="classRTPUDPv4TransmissionParams.html#d503605517082a72ab0b4584cea4c4c9" title="Returns the multicast interface IP address.">GetMulticastInterfaceIP</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mcastifaceIP; } <a name="l00092"></a>00092 <a name="l00094"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#315ef64b9bee76d07d17bff3a37ac77c">00094</a> uint16_t <a class="code" href="classRTPUDPv4TransmissionParams.html#315ef64b9bee76d07d17bff3a37ac77c" title="Returns the RTP portbase which will be used (default is 5000).">GetPortbase</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> portbase; } <a name="l00095"></a>00095 <a name="l00097"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#0b1eab8ee1438550afacb8b11474fd6e">00097</a> uint8_t <a class="code" href="classRTPUDPv4TransmissionParams.html#0b1eab8ee1438550afacb8b11474fd6e" title="Returns the multicast TTL which will be used (default is 1).">GetMulticastTTL</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> multicastTTL; } <a name="l00098"></a>00098 <a name="l00100"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#ba6a1eb007f700ff8c93a1fc32611dd3">00100</a> <span class="keyword">const</span> std::list<uint32_t> &<a class="code" href="classRTPUDPv4TransmissionParams.html#ba6a1eb007f700ff8c93a1fc32611dd3" title="Returns the list of local IP addresses.">GetLocalIPList</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> localIPs; } <a name="l00101"></a>00101 <a name="l00103"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#1e17dc35bcce6bca4757be79ef89cf68">00103</a> <span class="keywordtype">void</span> <a class="code" href="classRTPUDPv4TransmissionParams.html#1e17dc35bcce6bca4757be79ef89cf68" title="Sets the RTP socket&#39;s send buffer size.">SetRTPSendBuffer</a>(<span class="keywordtype">int</span> s) { rtpsendbuf = s; } <a name="l00104"></a>00104 <a name="l00106"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#690d73d7b452ff3f225554983797e2ed">00106</a> <span class="keywordtype">void</span> <a class="code" href="classRTPUDPv4TransmissionParams.html#690d73d7b452ff3f225554983797e2ed" title="Sets the RTP socket&#39;s receive buffer size.">SetRTPReceiveBuffer</a>(<span class="keywordtype">int</span> s) { rtprecvbuf = s; } <a name="l00107"></a>00107 <a name="l00109"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#79bfd874762eff9aa85a4ce749ddf551">00109</a> <span class="keywordtype">void</span> <a class="code" href="classRTPUDPv4TransmissionParams.html#79bfd874762eff9aa85a4ce749ddf551" title="Sets the RTCP socket&#39;s send buffer size.">SetRTCPSendBuffer</a>(<span class="keywordtype">int</span> s) { rtcpsendbuf = s; } <a name="l00110"></a>00110 <a name="l00112"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#86cb1438c9f676760687b1bd6147af09">00112</a> <span class="keywordtype">void</span> <a class="code" href="classRTPUDPv4TransmissionParams.html#86cb1438c9f676760687b1bd6147af09" title="Sets the RTCP socket&#39;s receive buffer size.">SetRTCPReceiveBuffer</a>(<span class="keywordtype">int</span> s) { rtcprecvbuf = s; } <a name="l00113"></a>00113 <a name="l00115"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#d8e2cbb82d23c7bde8c2ff43de1bf25d">00115</a> <span class="keywordtype">int</span> <a class="code" href="classRTPUDPv4TransmissionParams.html#d8e2cbb82d23c7bde8c2ff43de1bf25d" title="Returns the RTP socket&#39;s send buffer size.">GetRTPSendBuffer</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rtpsendbuf; } <a name="l00116"></a>00116 <a name="l00118"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#399b4aabcbc9008de4eddef00a8a8d1c">00118</a> <span class="keywordtype">int</span> <a class="code" href="classRTPUDPv4TransmissionParams.html#399b4aabcbc9008de4eddef00a8a8d1c" title="Returns the RTP socket&#39;s receive buffer size.">GetRTPReceiveBuffer</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rtprecvbuf; } <a name="l00119"></a>00119 <a name="l00121"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#ef407cc26d1af24d58a814cc35cbb5fb">00121</a> <span class="keywordtype">int</span> <a class="code" href="classRTPUDPv4TransmissionParams.html#ef407cc26d1af24d58a814cc35cbb5fb" title="Returns the RTCP socket&#39;s send buffer size.">GetRTCPSendBuffer</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rtcpsendbuf; } <a name="l00122"></a>00122 <a name="l00124"></a><a class="code" href="classRTPUDPv4TransmissionParams.html#5d1447236cd1c3362b61b35f83aee6aa">00124</a> <span class="keywordtype">int</span> <a class="code" href="classRTPUDPv4TransmissionParams.html#5d1447236cd1c3362b61b35f83aee6aa" title="Returns the RTCP socket&#39;s receive buffer size.">GetRTCPReceiveBuffer</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rtcprecvbuf; } <a name="l00125"></a>00125 <span class="keyword">private</span>: <a name="l00126"></a>00126 uint16_t portbase; <a name="l00127"></a>00127 uint32_t bindIP, mcastifaceIP; <a name="l00128"></a>00128 std::list<uint32_t> localIPs; <a name="l00129"></a>00129 uint8_t multicastTTL; <a name="l00130"></a>00130 <span class="keywordtype">int</span> rtpsendbuf, rtprecvbuf; <a name="l00131"></a>00131 <span class="keywordtype">int</span> rtcpsendbuf, rtcprecvbuf; <a name="l00132"></a>00132 }; <a name="l00133"></a>00133 <a name="l00135"></a><a class="code" href="classRTPUDPv4TransmissionInfo.html">00135</a> <span class="keyword">class </span><a class="code" href="classRTPUDPv4TransmissionInfo.html" title="Additional information about the UDP over IPv4 transmitter.">RTPUDPv4TransmissionInfo</a> : <span class="keyword">public</span> <a class="code" href="classRTPTransmissionInfo.html" title="Base class for additional information about the transmitter.">RTPTransmissionInfo</a> <a name="l00136"></a>00136 { <a name="l00137"></a>00137 <span class="keyword">public</span>: <a name="l00138"></a>00138 <span class="preprocessor">#if ! (defined(WIN32) || defined(_WIN32_WCE))</span> <a name="l00139"></a>00139 <span class="preprocessor"></span> <a class="code" href="classRTPUDPv4TransmissionInfo.html" title="Additional information about the UDP over IPv4 transmitter.">RTPUDPv4TransmissionInfo</a>(std::list<uint32_t> iplist,<span class="keywordtype">int</span> rtpsock,<span class="keywordtype">int</span> rtcpsock) : <a class="code" href="classRTPTransmissionInfo.html" title="Base class for additional information about the transmitter.">RTPTransmissionInfo</a>(<a class="code" href="classRTPTransmitter.html#00529bcf331e3d3dc57c4ebb476f1fd2430dce496268bd29e79f32fd91d576ff" title="Specifies the internal UDP over IPv4 transmitter.">RTPTransmitter::IPv4UDPProto</a>) <a name="l00140"></a>00140 <span class="preprocessor">#else</span> <a name="l00141"></a>00141 <span class="preprocessor"></span> <a class="code" href="classRTPUDPv4TransmissionInfo.html" title="Additional information about the UDP over IPv4 transmitter.">RTPUDPv4TransmissionInfo</a>(std::list<uint32_t> iplist,SOCKET rtpsock,SOCKET rtcpsock) : <a class="code" href="classRTPTransmissionInfo.html" title="Base class for additional information about the transmitter.">RTPTransmissionInfo</a>(<a class="code" href="classRTPTransmitter.html#00529bcf331e3d3dc57c4ebb476f1fd2430dce496268bd29e79f32fd91d576ff" title="Specifies the internal UDP over IPv4 transmitter.">RTPTransmitter::IPv4UDPProto</a>) <a name="l00142"></a>00142 <span class="preprocessor">#endif // WIN32</span> <a name="l00143"></a>00143 <span class="preprocessor"></span> { localIPlist = iplist; rtpsocket = rtpsock; rtcpsocket = rtcpsock; } <a name="l00144"></a>00144 <a name="l00145"></a>00145 ~RTPUDPv4TransmissionInfo() { } <a name="l00146"></a>00146 <a name="l00148"></a><a class="code" href="classRTPUDPv4TransmissionInfo.html#7a1474921591458d89b50ac500c820d8">00148</a> std::list<uint32_t> <a class="code" href="classRTPUDPv4TransmissionInfo.html#7a1474921591458d89b50ac500c820d8" title="Returns the list of IPv4 addresses the transmitter considers to be the local IP addresses...">GetLocalIPList</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> localIPlist; } <a name="l00149"></a>00149 <span class="preprocessor">#if ! (defined(WIN32) || defined(_WIN32_WCE))</span> <a name="l00150"></a>00150 <span class="preprocessor"></span> <a name="l00151"></a><a class="code" href="classRTPUDPv4TransmissionInfo.html#8e9bc196a0d39377f2514bb67a72ad18">00151</a> <span class="keywordtype">int</span> <a class="code" href="classRTPUDPv4TransmissionInfo.html#8e9bc196a0d39377f2514bb67a72ad18" title="Returns the socket descriptor used for receiving and transmitting RTP packets.">GetRTPSocket</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rtpsocket; } <a name="l00152"></a>00152 <a name="l00154"></a><a class="code" href="classRTPUDPv4TransmissionInfo.html#bd0297d5d06a517151e3adf351cfd584">00154</a> <span class="keywordtype">int</span> <a class="code" href="classRTPUDPv4TransmissionInfo.html#bd0297d5d06a517151e3adf351cfd584" title="Returns the socket descriptor used for receiving and transmitting RTCP packets.">GetRTCPSocket</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rtcpsocket; } <a name="l00155"></a>00155 <span class="preprocessor">#else</span> <a name="l00156"></a>00156 <span class="preprocessor"></span> SOCKET <a class="code" href="classRTPUDPv4TransmissionInfo.html#8e9bc196a0d39377f2514bb67a72ad18" title="Returns the socket descriptor used for receiving and transmitting RTP packets.">GetRTPSocket</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rtpsocket; } <a name="l00157"></a>00157 SOCKET <a class="code" href="classRTPUDPv4TransmissionInfo.html#bd0297d5d06a517151e3adf351cfd584" title="Returns the socket descriptor used for receiving and transmitting RTCP packets.">GetRTCPSocket</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> rtcpsocket; } <a name="l00158"></a>00158 <span class="preprocessor">#endif // WIN32</span> <a name="l00159"></a>00159 <span class="preprocessor"></span><span class="keyword">private</span>: <a name="l00160"></a>00160 std::list<uint32_t> localIPlist; <a name="l00161"></a>00161 <span class="preprocessor">#if ! (defined(WIN32) || defined(_WIN32_WCE))</span> <a name="l00162"></a>00162 <span class="preprocessor"></span> <span class="keywordtype">int</span> rtpsocket,rtcpsocket; <a name="l00163"></a>00163 <span class="preprocessor">#else</span> <a name="l00164"></a>00164 <span class="preprocessor"></span> SOCKET rtpsocket,rtcpsocket; <a name="l00165"></a>00165 <span class="preprocessor">#endif // WIN32</span> <a name="l00166"></a>00166 <span class="preprocessor"></span>}; <a name="l00167"></a>00167 <a name="l00168"></a>00168 <span class="keyword">class </span>RTPUDPv4Trans_GetHashIndex_IPv4Dest <a name="l00169"></a>00169 { <a name="l00170"></a>00170 <span class="keyword">public</span>: <a name="l00171"></a>00171 <span class="keyword">static</span> <span class="keywordtype">int</span> GetIndex(<span class="keyword">const</span> RTPIPv4Destination &d) { <span class="keywordflow">return</span> d.GetIP()%RTPUDPV4TRANS_HASHSIZE; } <a name="l00172"></a>00172 }; <a name="l00173"></a>00173 <a name="l00174"></a>00174 <span class="keyword">class </span>RTPUDPv4Trans_GetHashIndex_uint32_t <a name="l00175"></a>00175 { <a name="l00176"></a>00176 <span class="keyword">public</span>: <a name="l00177"></a>00177 <span class="keyword">static</span> <span class="keywordtype">int</span> GetIndex(<span class="keyword">const</span> uint32_t &k) { <span class="keywordflow">return</span> k%RTPUDPV4TRANS_HASHSIZE; } <a name="l00178"></a>00178 }; <a name="l00179"></a>00179 <a name="l00180"></a>00180 <span class="preprocessor">#define RTPUDPV4TRANS_HEADERSIZE (20+8)</span> <a name="l00181"></a>00181 <span class="preprocessor"></span> <a name="l00189"></a><a class="code" href="classRTPUDPv4Transmitter.html">00189</a> <span class="keyword">class </span><a class="code" href="classRTPUDPv4Transmitter.html" title="An UDP over IPv4 transmission component.">RTPUDPv4Transmitter</a> : <span class="keyword">public</span> <a class="code" href="classRTPTransmitter.html" title="Abstract class from which actual transmission components should be derived.">RTPTransmitter</a> <a name="l00190"></a>00190 { <a name="l00191"></a>00191 <span class="keyword">public</span>: <a name="l00192"></a>00192 <a class="code" href="classRTPUDPv4Transmitter.html" title="An UDP over IPv4 transmission component.">RTPUDPv4Transmitter</a>(<a class="code" href="classRTPMemoryManager.html" title="A memory manager.">RTPMemoryManager</a> *mgr); <a name="l00193"></a>00193 ~<a class="code" href="classRTPUDPv4Transmitter.html" title="An UDP over IPv4 transmission component.">RTPUDPv4Transmitter</a>(); <a name="l00194"></a>00194 <a name="l00195"></a>00195 <span class="keywordtype">int</span> Init(<span class="keywordtype">bool</span> treadsafe); <a name="l00196"></a>00196 <span class="keywordtype">int</span> Create(<span class="keywordtype">size_t</span> maxpacksize,<span class="keyword">const</span> <a class="code" href="classRTPTransmissionParams.html" title="Base class for transmission parameters.">RTPTransmissionParams</a> *transparams); <a name="l00197"></a>00197 <span class="keywordtype">void</span> Destroy(); <a name="l00198"></a>00198 <a class="code" href="classRTPTransmissionInfo.html" title="Base class for additional information about the transmitter.">RTPTransmissionInfo</a> *GetTransmissionInfo(); <a name="l00199"></a>00199 <a name="l00200"></a>00200 <span class="keywordtype">int</span> GetLocalHostName(uint8_t *buffer,<span class="keywordtype">size_t</span> *bufferlength); <a name="l00201"></a>00201 <span class="keywordtype">bool</span> ComesFromThisTransmitter(<span class="keyword">const</span> <a class="code" href="classRTPAddress.html" title="This class is an abstract class which is used to specify destinations, multicast...">RTPAddress</a> *addr); <a name="l00202"></a>00202 <span class="keywordtype">size_t</span> GetHeaderOverhead() { <span class="keywordflow">return</span> RTPUDPV4TRANS_HEADERSIZE; } <a name="l00203"></a>00203 <a name="l00204"></a>00204 <span class="keywordtype">int</span> Poll(); <a name="l00205"></a>00205 <span class="keywordtype">int</span> WaitForIncomingData(<span class="keyword">const</span> <a class="code" href="classRTPTime.html" title="This class is used to specify wallclock time, delay intervals etc.">RTPTime</a> &delay,<span class="keywordtype">bool</span> *dataavailable = 0); <a name="l00206"></a>00206 <span class="keywordtype">int</span> AbortWait(); <a name="l00207"></a>00207 <a name="l00208"></a>00208 <span class="keywordtype">int</span> SendRTPData(<span class="keyword">const</span> <span class="keywordtype">void</span> *data,<span class="keywordtype">size_t</span> len); <a name="l00209"></a>00209 <span class="keywordtype">int</span> SendRTCPData(<span class="keyword">const</span> <span class="keywordtype">void</span> *data,<span class="keywordtype">size_t</span> len); <a name="l00210"></a>00210 <a name="l00211"></a>00211 <span class="keywordtype">int</span> AddDestination(<span class="keyword">const</span> <a class="code" href="classRTPAddress.html" title="This class is an abstract class which is used to specify destinations, multicast...">RTPAddress</a> &addr); <a name="l00212"></a>00212 <span class="keywordtype">int</span> DeleteDestination(<span class="keyword">const</span> <a class="code" href="classRTPAddress.html" title="This class is an abstract class which is used to specify destinations, multicast...">RTPAddress</a> &addr); <a name="l00213"></a>00213 <span class="keywordtype">void</span> ClearDestinations(); <a name="l00214"></a>00214 <a name="l00215"></a>00215 <span class="keywordtype">bool</span> SupportsMulticasting(); <a name="l00216"></a>00216 <span class="keywordtype">int</span> JoinMulticastGroup(<span class="keyword">const</span> <a class="code" href="classRTPAddress.html" title="This class is an abstract class which is used to specify destinations, multicast...">RTPAddress</a> &addr); <a name="l00217"></a>00217 <span class="keywordtype">int</span> LeaveMulticastGroup(<span class="keyword">const</span> <a class="code" href="classRTPAddress.html" title="This class is an abstract class which is used to specify destinations, multicast...">RTPAddress</a> &addr); <a name="l00218"></a>00218 <span class="keywordtype">void</span> LeaveAllMulticastGroups(); <a name="l00219"></a>00219 <a name="l00220"></a>00220 <span class="keywordtype">int</span> SetReceiveMode(<a class="code" href="classRTPTransmitter.html#bae77e9adf52db77f5ea29757dfa6386" title="Three kind of receive modes can be specified.">RTPTransmitter::ReceiveMode</a> m); <a name="l00221"></a>00221 <span class="keywordtype">int</span> AddToIgnoreList(<span class="keyword">const</span> <a class="code" href="classRTPAddress.html" title="This class is an abstract class which is used to specify destinations, multicast...">RTPAddress</a> &addr); <a name="l00222"></a>00222 <span class="keywordtype">int</span> DeleteFromIgnoreList(<span class="keyword">const</span> <a class="code" href="classRTPAddress.html" title="This class is an abstract class which is used to specify destinations, multicast...">RTPAddress</a> &addr); <a name="l00223"></a>00223 <span class="keywordtype">void</span> ClearIgnoreList(); <a name="l00224"></a>00224 <span class="keywordtype">int</span> AddToAcceptList(<span class="keyword">const</span> <a class="code" href="classRTPAddress.html" title="This class is an abstract class which is used to specify destinations, multicast...">RTPAddress</a> &addr); <a name="l00225"></a>00225 <span class="keywordtype">int</span> DeleteFromAcceptList(<span class="keyword">const</span> <a class="code" href="classRTPAddress.html" title="This class is an abstract class which is used to specify destinations, multicast...">RTPAddress</a> &addr); <a name="l00226"></a>00226 <span class="keywordtype">void</span> ClearAcceptList(); <a name="l00227"></a>00227 <span class="keywordtype">int</span> SetMaximumPacketSize(<span class="keywordtype">size_t</span> s); <a name="l00228"></a>00228 <a name="l00229"></a>00229 <span class="keywordtype">bool</span> NewDataAvailable(); <a name="l00230"></a>00230 <a class="code" href="classRTPRawPacket.html" title="This class is used by the transmission component to store the incoming RTP and RTCP...">RTPRawPacket</a> *GetNextPacket(); <a name="l00231"></a>00231 <span class="preprocessor">#ifdef RTPDEBUG</span> <a name="l00232"></a>00232 <span class="preprocessor"></span> <span class="keywordtype">void</span> Dump(); <a name="l00233"></a>00233 <span class="preprocessor">#endif // RTPDEBUG</span> <a name="l00234"></a>00234 <span class="preprocessor"></span><span class="keyword">private</span>: <a name="l00235"></a>00235 <span class="keywordtype">int</span> CreateLocalIPList(); <a name="l00236"></a>00236 <span class="keywordtype">bool</span> GetLocalIPList_Interfaces(); <a name="l00237"></a>00237 <span class="keywordtype">void</span> GetLocalIPList_DNS(); <a name="l00238"></a>00238 <span class="keywordtype">void</span> AddLoopbackAddress(); <a name="l00239"></a>00239 <span class="keywordtype">void</span> FlushPackets(); <a name="l00240"></a>00240 <span class="keywordtype">int</span> PollSocket(<span class="keywordtype">bool</span> rtp); <a name="l00241"></a>00241 <span class="keywordtype">int</span> ProcessAddAcceptIgnoreEntry(uint32_t ip,uint16_t port); <a name="l00242"></a>00242 <span class="keywordtype">int</span> ProcessDeleteAcceptIgnoreEntry(uint32_t ip,uint16_t port); <a name="l00243"></a>00243 <span class="preprocessor">#ifdef RTP_SUPPORT_IPV4MULTICAST</span> <a name="l00244"></a>00244 <span class="preprocessor"></span> <span class="keywordtype">bool</span> SetMulticastTTL(uint8_t ttl); <a name="l00245"></a>00245 <span class="preprocessor">#endif // RTP_SUPPORT_IPV4MULTICAST</span> <a name="l00246"></a>00246 <span class="preprocessor"></span> <span class="keywordtype">bool</span> ShouldAcceptData(uint32_t srcip,uint16_t srcport); <a name="l00247"></a>00247 <span class="keywordtype">void</span> ClearAcceptIgnoreInfo(); <a name="l00248"></a>00248 <a name="l00249"></a>00249 <span class="keywordtype">bool</span> init; <a name="l00250"></a>00250 <span class="keywordtype">bool</span> created; <a name="l00251"></a>00251 <span class="keywordtype">bool</span> waitingfordata; <a name="l00252"></a>00252 <span class="preprocessor">#if (defined(WIN32) || defined(_WIN32_WCE))</span> <a name="l00253"></a>00253 <span class="preprocessor"></span> SOCKET rtpsock,rtcpsock; <a name="l00254"></a>00254 <span class="preprocessor">#else // not using winsock</span> <a name="l00255"></a>00255 <span class="preprocessor"></span> <span class="keywordtype">int</span> rtpsock,rtcpsock; <a name="l00256"></a>00256 <span class="preprocessor">#endif // WIN32</span> <a name="l00257"></a>00257 <span class="preprocessor"></span> uint32_t bindIP, mcastifaceIP; <a name="l00258"></a>00258 std::list<uint32_t> localIPs; <a name="l00259"></a>00259 uint16_t portbase; <a name="l00260"></a>00260 uint8_t multicastTTL; <a name="l00261"></a>00261 <a class="code" href="classRTPTransmitter.html#bae77e9adf52db77f5ea29757dfa6386" title="Three kind of receive modes can be specified.">RTPTransmitter::ReceiveMode</a> receivemode; <a name="l00262"></a>00262 <a name="l00263"></a>00263 uint8_t *localhostname; <a name="l00264"></a>00264 <span class="keywordtype">size_t</span> localhostnamelength; <a name="l00265"></a>00265 <a name="l00266"></a>00266 RTPHashTable<const RTPIPv4Destination,RTPUDPv4Trans_GetHashIndex_IPv4Dest,RTPUDPV4TRANS_HASHSIZE> destinations; <a name="l00267"></a>00267 <span class="preprocessor">#ifdef RTP_SUPPORT_IPV4MULTICAST</span> <a name="l00268"></a>00268 <span class="preprocessor"></span> RTPHashTable<const uint32_t,RTPUDPv4Trans_GetHashIndex_uint32_t,RTPUDPV4TRANS_HASHSIZE> multicastgroups; <a name="l00269"></a>00269 <span class="preprocessor">#endif // RTP_SUPPORT_IPV4MULTICAST</span> <a name="l00270"></a>00270 <span class="preprocessor"></span> std::list<RTPRawPacket*> rawpacketlist; <a name="l00271"></a>00271 <a name="l00272"></a>00272 <span class="keywordtype">bool</span> supportsmulticasting; <a name="l00273"></a>00273 <span class="keywordtype">size_t</span> maxpacksize; <a name="l00274"></a>00274 <a name="l00275"></a>00275 <span class="keyword">class </span>PortInfo <a name="l00276"></a>00276 { <a name="l00277"></a>00277 <span class="keyword">public</span>: <a name="l00278"></a>00278 PortInfo() { all = <span class="keyword">false</span>; } <a name="l00279"></a>00279 <a name="l00280"></a>00280 <span class="keywordtype">bool</span> all; <a name="l00281"></a>00281 std::list<uint16_t> portlist; <a name="l00282"></a>00282 }; <a name="l00283"></a>00283 <a name="l00284"></a>00284 RTPKeyHashTable<const uint32_t,PortInfo*,RTPUDPv4Trans_GetHashIndex_uint32_t,RTPUDPV4TRANS_HASHSIZE> acceptignoreinfo; <a name="l00285"></a>00285 <a name="l00286"></a>00286 <span class="comment">// notification descriptors for AbortWait (0 is for reading, 1 for writing)</span> <a name="l00287"></a>00287 <span class="preprocessor">#if (defined(WIN32) || defined(_WIN32_WCE))</span> <a name="l00288"></a>00288 <span class="preprocessor"></span> SOCKET abortdesc[2]; <a name="l00289"></a>00289 <span class="preprocessor">#else</span> <a name="l00290"></a>00290 <span class="preprocessor"></span> <span class="keywordtype">int</span> abortdesc[2]; <a name="l00291"></a>00291 <span class="preprocessor">#endif // WIN32</span> <a name="l00292"></a>00292 <span class="preprocessor"></span> <span class="keywordtype">int</span> CreateAbortDescriptors(); <a name="l00293"></a>00293 <span class="keywordtype">void</span> DestroyAbortDescriptors(); <a name="l00294"></a>00294 <span class="keywordtype">void</span> AbortWaitInternal(); <a name="l00295"></a>00295 <span class="preprocessor">#ifdef RTP_SUPPORT_THREAD</span> <a name="l00296"></a>00296 <span class="preprocessor"></span> JMutex mainmutex,waitmutex; <a name="l00297"></a>00297 <span class="keywordtype">int</span> threadsafe; <a name="l00298"></a>00298 <span class="preprocessor">#endif // RTP_SUPPORT_THREAD</span> <a name="l00299"></a>00299 <span class="preprocessor"></span>}; <a name="l00300"></a>00300 <a name="l00301"></a>00301 <span class="preprocessor">#endif // RTPUDPV4TRANSMITTER_H</span> <a name="l00302"></a>00302 <span class="preprocessor"></span> </pre></div></div> <hr size="1"><address style="text-align: right;"><small>Generated on Sun Jul 26 09:42:08 2009 for jrtplib 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>