<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>oRTP: include/ortp/rtpsession.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.6.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Data Structures</span></a></li> <li class="current"><a href="files.html"><span>Files</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>Globals</span></a></li> </ul> </div> <h1>include/ortp/rtpsession.h</h1><a href="rtpsession_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"> The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.</span> <a name="l00003"></a>00003 <span class="comment"> Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org</span> <a name="l00004"></a>00004 <span class="comment"></span> <a name="l00005"></a>00005 <span class="comment"> This library is free software; you can redistribute it and/or</span> <a name="l00006"></a>00006 <span class="comment"> modify it under the terms of the GNU Lesser General Public</span> <a name="l00007"></a>00007 <span class="comment"> License as published by the Free Software Foundation; either</span> <a name="l00008"></a>00008 <span class="comment"> version 2.1 of the License, or (at your option) any later version.</span> <a name="l00009"></a>00009 <span class="comment"></span> <a name="l00010"></a>00010 <span class="comment"> This library is distributed in the hope that it will be useful,</span> <a name="l00011"></a>00011 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00012"></a>00012 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00013"></a>00013 <span class="comment"> Lesser General Public License for more details.</span> <a name="l00014"></a>00014 <span class="comment"></span> <a name="l00015"></a>00015 <span class="comment"> You should have received a copy of the GNU Lesser General Public</span> <a name="l00016"></a>00016 <span class="comment"> License along with this library; if not, write to the Free Software</span> <a name="l00017"></a>00017 <span class="comment"> Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span> <a name="l00018"></a>00018 <span class="comment">*/</span> <a name="l00019"></a>00019 <a name="l00030"></a>00030 <span class="preprocessor">#ifndef RTPSESSION_H</span> <a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#define RTPSESSION_H</span> <a name="l00032"></a>00032 <span class="preprocessor"></span> <a name="l00033"></a>00033 <a name="l00034"></a>00034 <span class="preprocessor">#include <ortp/port.h></span> <a name="l00035"></a>00035 <span class="preprocessor">#include <ortp/rtp.h></span> <a name="l00036"></a>00036 <span class="preprocessor">#include <<a class="code" href="payloadtype_8h.html" title="Using and creating standart and custom RTP profiles.">ortp/payloadtype.h</a>></span> <a name="l00037"></a>00037 <span class="preprocessor">#include <<a class="code" href="sessionset_8h.html" title="Sending and receiving multiple streams together with only one thread.">ortp/sessionset.h</a>></span> <a name="l00038"></a>00038 <span class="preprocessor">#include <ortp/rtcp.h></span> <a name="l00039"></a>00039 <span class="preprocessor">#include <ortp/str_utils.h></span> <a name="l00040"></a>00040 <span class="preprocessor">#include <ortp/rtpsignaltable.h></span> <a name="l00041"></a>00041 <span class="preprocessor">#include <ortp/event.h></span> <a name="l00042"></a>00042 <a name="l00043"></a>00043 <a name="l00044"></a>00044 <a name="l00045"></a>00045 <span class="keyword">typedef</span> <span class="keyword">enum</span> { <a name="l00046"></a>00046 RTP_SESSION_RECVONLY, <a name="l00047"></a>00047 RTP_SESSION_SENDONLY, <a name="l00048"></a>00048 RTP_SESSION_SENDRECV <a name="l00049"></a>00049 } RtpSessionMode; <a name="l00050"></a>00050 <a name="l00051"></a>00051 <a name="l00054"></a><a class="code" href="struct__JBParameters.html">00054</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__JBParameters.html">_JBParameters</a>{ <a name="l00055"></a><a class="code" href="struct__JBParameters.html#ae1c6efc84d4b13ac7a51697cf2c3f3db">00055</a> <span class="keywordtype">int</span> <a class="code" href="struct__JBParameters.html#ae1c6efc84d4b13ac7a51697cf2c3f3db">min_size</a>; <a name="l00056"></a><a class="code" href="struct__JBParameters.html#ac2bd9139ca489e7c94850364e474c1c5">00056</a> <span class="keywordtype">int</span> <a class="code" href="struct__JBParameters.html#ac2bd9139ca489e7c94850364e474c1c5">nom_size</a>; <a name="l00057"></a><a class="code" href="struct__JBParameters.html#a043cfa8e14a392925d9f38dd59712301">00057</a> <span class="keywordtype">int</span> <a class="code" href="struct__JBParameters.html#a043cfa8e14a392925d9f38dd59712301">max_size</a>; <a name="l00058"></a>00058 bool_t adaptive; <a name="l00059"></a>00059 bool_t pad[3]; <a name="l00060"></a><a class="code" href="struct__JBParameters.html#a9e869a10b155f31e87a1974dd480e664">00060</a> <span class="keywordtype">int</span> <a class="code" href="struct__JBParameters.html#a9e869a10b155f31e87a1974dd480e664">max_packets</a>; <a name="l00061"></a>00061 } <a class="code" href="struct__JBParameters.html">JBParameters</a>; <a name="l00062"></a>00062 <a name="l00063"></a><a class="code" href="struct__JitterControl.html">00063</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__JitterControl.html">_JitterControl</a> <a name="l00064"></a>00064 { <a name="l00065"></a>00065 <span class="keywordtype">int</span> count; <a name="l00066"></a>00066 <span class="keywordtype">int</span> jitt_comp; <span class="comment">/* the user jitt_comp in miliseconds*/</span> <a name="l00067"></a>00067 <span class="keywordtype">int</span> jitt_comp_ts; <span class="comment">/* the jitt_comp converted in rtp time (same unit as timestamp) */</span> <a name="l00068"></a>00068 <span class="keywordtype">int</span> adapt_jitt_comp_ts; <a name="l00069"></a>00069 int64_t slide; <a name="l00070"></a>00070 int64_t prev_slide; <a name="l00071"></a>00071 <span class="keywordtype">float</span> jitter; <a name="l00072"></a>00072 <span class="keywordtype">int</span> olddiff; <a name="l00073"></a>00073 <span class="keywordtype">float</span> inter_jitter; <span class="comment">/* interarrival jitter as defined in the RFC */</span> <a name="l00074"></a>00074 <span class="keywordtype">int</span> corrective_step; <a name="l00075"></a>00075 <span class="keywordtype">int</span> corrective_slide; <a name="l00076"></a>00076 bool_t adaptive; <a name="l00077"></a>00077 bool_t enabled; <a name="l00078"></a>00078 } <a class="code" href="struct__JitterControl.html">JitterControl</a>; <a name="l00079"></a>00079 <a name="l00080"></a><a class="code" href="struct__WaitPoint.html">00080</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__WaitPoint.html">_WaitPoint</a> <a name="l00081"></a>00081 { <a name="l00082"></a>00082 ortp_mutex_t lock; <a name="l00083"></a>00083 ortp_cond_t cond; <a name="l00084"></a>00084 uint32_t time; <a name="l00085"></a>00085 bool_t wakeup; <a name="l00086"></a>00086 } <a class="code" href="struct__WaitPoint.html">WaitPoint</a>; <a name="l00087"></a>00087 <a name="l00088"></a><a class="code" href="struct__RtpTransport.html">00088</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__RtpTransport.html">_RtpTransport</a> <a name="l00089"></a>00089 { <a name="l00090"></a>00090 <span class="keywordtype">void</span> *data; <a name="l00091"></a>00091 ortp_socket_t (*t_getsocket)(<span class="keyword">struct </span><a class="code" href="struct__RtpTransport.html">_RtpTransport</a> *t); <a name="l00092"></a>00092 int (*t_sendto)(<span class="keyword">struct </span><a class="code" href="struct__RtpTransport.html">_RtpTransport</a> *t, <a class="code" href="structmsgb.html">mblk_t</a> *msg , <span class="keywordtype">int</span> flags, <span class="keyword">const</span> <span class="keyword">struct </span>sockaddr *to, socklen_t tolen); <a name="l00093"></a>00093 int (*t_recvfrom)(<span class="keyword">struct </span><a class="code" href="struct__RtpTransport.html">_RtpTransport</a> *t, <a class="code" href="structmsgb.html">mblk_t</a> *msg, <span class="keywordtype">int</span> flags, <span class="keyword">struct </span>sockaddr *from, socklen_t *fromlen); <a name="l00094"></a>00094 <span class="keyword">struct </span><a class="code" href="struct__RtpSession.html">_RtpSession</a> *session;<span class="comment">//<back pointer to the owning session, set by oRTP</span> <a name="l00095"></a>00095 } <a class="code" href="struct__RtpTransport.html">RtpTransport</a>; <a name="l00096"></a>00096 <a name="l00097"></a>00097 <a name="l00098"></a>00098 <a name="l00099"></a><a class="code" href="struct__RtpStream.html">00099</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__RtpStream.html">_RtpStream</a> <a name="l00100"></a>00100 { <a name="l00101"></a>00101 ortp_socket_t socket; <a name="l00102"></a>00102 <span class="keyword">struct </span><a class="code" href="struct__RtpTransport.html">_RtpTransport</a> *tr; <a name="l00103"></a>00103 <span class="keywordtype">int</span> sockfamily; <a name="l00104"></a>00104 <span class="keywordtype">int</span> max_rq_size; <a name="l00105"></a>00105 <span class="keywordtype">int</span> time_jump; <a name="l00106"></a>00106 uint32_t ts_jump; <a name="l00107"></a>00107 <a class="code" href="struct__queue.html">queue_t</a> rq; <a name="l00108"></a>00108 <a class="code" href="struct__queue.html">queue_t</a> tev_rq; <a name="l00109"></a>00109 <a class="code" href="structmsgb.html">mblk_t</a> *cached_mp; <a name="l00110"></a>00110 <span class="keywordtype">int</span> loc_port; <a name="l00111"></a>00111 <span class="preprocessor">#ifdef ORTP_INET6</span> <a name="l00112"></a>00112 <span class="preprocessor"></span> <span class="keyword">struct </span>sockaddr_storage rem_addr; <a name="l00113"></a>00113 <span class="preprocessor">#else</span> <a name="l00114"></a>00114 <span class="preprocessor"></span> <span class="keyword">struct </span>sockaddr_in rem_addr; <a name="l00115"></a>00115 <span class="preprocessor">#endif</span> <a name="l00116"></a>00116 <span class="preprocessor"></span> <span class="keywordtype">int</span> rem_addrlen; <a name="l00117"></a>00117 <a class="code" href="struct__JitterControl.html">JitterControl</a> jittctl; <a name="l00118"></a>00118 uint32_t snd_time_offset;<span class="comment">/*the scheduler time when the application send its first timestamp*/</span> <a name="l00119"></a>00119 uint32_t snd_ts_offset; <span class="comment">/* the first application timestamp sent by the application */</span> <a name="l00120"></a>00120 uint32_t snd_rand_offset; <span class="comment">/* a random number added to the user offset to make the stream timestamp*/</span> <a name="l00121"></a>00121 uint32_t snd_last_ts; <span class="comment">/* the last stream timestamp sended */</span> <a name="l00122"></a>00122 uint32_t rcv_time_offset; <span class="comment">/*the scheduler time when the application ask for its first timestamp*/</span> <a name="l00123"></a>00123 uint32_t rcv_ts_offset; <span class="comment">/* the first stream timestamp */</span> <a name="l00124"></a>00124 uint32_t rcv_query_ts_offset; <span class="comment">/* the first user timestamp asked by the application */</span> <a name="l00125"></a>00125 uint32_t rcv_last_ts; <span class="comment">/* the last stream timestamp got by the application */</span> <a name="l00126"></a>00126 uint32_t rcv_last_app_ts; <span class="comment">/* the last application timestamp asked by the application */</span> <a name="l00127"></a>00127 uint32_t rcv_last_ret_ts; <span class="comment">/* the timestamp of the last sample returned (only for continuous audio)*/</span> <a name="l00128"></a>00128 uint32_t hwrcv_extseq; <span class="comment">/* last received on socket extended sequence number */</span> <a name="l00129"></a>00129 uint32_t hwrcv_seq_at_last_SR; <a name="l00130"></a>00130 uint32_t hwrcv_since_last_SR; <a name="l00131"></a>00131 uint32_t last_rcv_SR_ts; <span class="comment">/* NTP timestamp (middle 32 bits) of last received SR */</span> <a name="l00132"></a>00132 <span class="keyword">struct </span>timeval last_rcv_SR_time; <span class="comment">/* time at which last SR was received */</span> <a name="l00133"></a>00133 uint16_t snd_seq; <span class="comment">/* send sequence number */</span> <a name="l00134"></a>00134 uint32_t last_rtcp_report_snt_r; <span class="comment">/* the time of the last rtcp report sent, in recv timestamp unit */</span> <a name="l00135"></a>00135 uint32_t last_rtcp_report_snt_s; <span class="comment">/* the time of the last rtcp report sent, in send timestamp unit */</span> <a name="l00136"></a>00136 uint32_t rtcp_report_snt_interval; <span class="comment">/* the interval in timestamp unit between rtcp report sent */</span> <a name="l00137"></a>00137 uint32_t last_rtcp_packet_count; <span class="comment">/*the sender's octet count in the last sent RTCP SR*/</span> <a name="l00138"></a>00138 uint32_t sent_payload_bytes; <span class="comment">/*used for RTCP sender reports*/</span> <a name="l00139"></a>00139 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sent_bytes; <span class="comment">/* used for bandwidth estimation */</span> <a name="l00140"></a>00140 <span class="keyword">struct </span>timeval send_bw_start; <span class="comment">/* used for bandwidth estimation */</span> <a name="l00141"></a>00141 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> recv_bytes; <span class="comment">/* used for bandwidth estimation */</span> <a name="l00142"></a>00142 <span class="keyword">struct </span>timeval recv_bw_start; <span class="comment">/* used for bandwidth estimation */</span> <a name="l00143"></a>00143 <a class="code" href="structrtp__stats.html">rtp_stats_t</a> stats; <a name="l00144"></a>00144 <span class="keywordtype">int</span> recv_errno; <a name="l00145"></a>00145 <span class="keywordtype">int</span> send_errno; <a name="l00146"></a>00146 <span class="keywordtype">int</span> snd_socket_size; <a name="l00147"></a>00147 <span class="keywordtype">int</span> rcv_socket_size; <a name="l00148"></a>00148 }<a class="code" href="struct__RtpStream.html">RtpStream</a>; <a name="l00149"></a>00149 <a name="l00150"></a><a class="code" href="struct__RtcpStream.html">00150</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__RtcpStream.html">_RtcpStream</a> <a name="l00151"></a>00151 { <a name="l00152"></a>00152 ortp_socket_t socket; <a name="l00153"></a>00153 <span class="keywordtype">int</span> sockfamily; <a name="l00154"></a>00154 <span class="keyword">struct </span><a class="code" href="struct__RtpTransport.html">_RtpTransport</a> *tr; <a name="l00155"></a>00155 <a name="l00156"></a>00156 <a class="code" href="structmsgb.html">mblk_t</a> *cached_mp; <a name="l00157"></a>00157 <span class="preprocessor">#ifdef ORTP_INET6</span> <a name="l00158"></a>00158 <span class="preprocessor"></span> <span class="keyword">struct </span>sockaddr_storage rem_addr; <a name="l00159"></a>00159 <span class="preprocessor">#else</span> <a name="l00160"></a>00160 <span class="preprocessor"></span> <span class="keyword">struct </span>sockaddr_in rem_addr; <a name="l00161"></a>00161 <span class="preprocessor">#endif</span> <a name="l00162"></a>00162 <span class="preprocessor"></span> <span class="keywordtype">int</span> rem_addrlen; <a name="l00163"></a>00163 bool_t enabled; <span class="comment">/*tells whether we can send RTCP packets */</span> <a name="l00164"></a>00164 } <a class="code" href="struct__RtcpStream.html">RtcpStream</a>; <a name="l00165"></a>00165 <a name="l00166"></a>00166 <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="struct__RtpSession.html">_RtpSession</a> <a class="code" href="struct__RtpSession.html">RtpSession</a>; <a name="l00167"></a>00167 <a name="l00168"></a>00168 <a name="l00177"></a><a class="code" href="struct__RtpSession.html">00177</a> <span class="keyword">struct </span><a class="code" href="struct__RtpSession.html">_RtpSession</a> <a name="l00178"></a>00178 { <a name="l00179"></a>00179 <a class="code" href="struct__RtpSession.html">RtpSession</a> *next; <span class="comment">/* next RtpSession, when the session are enqueued by the scheduler */</span> <a name="l00180"></a>00180 <span class="keywordtype">int</span> mask_pos; <span class="comment">/* the position in the scheduler mask of RtpSession : do not move this field: it is part of the ABI since the session_set macros use it*/</span> <a name="l00181"></a>00181 <span class="keyword">struct </span>{ <a name="l00182"></a>00182 <a class="code" href="struct__RtpProfile.html">RtpProfile</a> *profile; <a name="l00183"></a>00183 <span class="keywordtype">int</span> pt; <a name="l00184"></a>00184 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> ssrc; <a name="l00185"></a>00185 <a class="code" href="struct__WaitPoint.html">WaitPoint</a> wp; <a name="l00186"></a>00186 <span class="keywordtype">int</span> telephone_events_pt; <span class="comment">/* the payload type used for telephony events */</span> <a name="l00187"></a>00187 } snd,rcv; <a name="l00188"></a>00188 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> inc_ssrc_candidate; <a name="l00189"></a>00189 <span class="keywordtype">int</span> inc_same_ssrc_count; <a name="l00190"></a>00190 <span class="keywordtype">int</span> hw_recv_pt; <span class="comment">/* recv payload type before jitter buffer */</span> <a name="l00191"></a>00191 <span class="keywordtype">int</span> recv_buf_size; <a name="l00192"></a>00192 <a class="code" href="struct__RtpSignalTable.html">RtpSignalTable</a> on_ssrc_changed; <a name="l00193"></a>00193 <a class="code" href="struct__RtpSignalTable.html">RtpSignalTable</a> on_payload_type_changed; <a name="l00194"></a>00194 <a class="code" href="struct__RtpSignalTable.html">RtpSignalTable</a> on_telephone_event_packet; <a name="l00195"></a>00195 <a class="code" href="struct__RtpSignalTable.html">RtpSignalTable</a> on_telephone_event; <a name="l00196"></a>00196 <a class="code" href="struct__RtpSignalTable.html">RtpSignalTable</a> on_timestamp_jump; <a name="l00197"></a>00197 <a class="code" href="struct__RtpSignalTable.html">RtpSignalTable</a> on_network_error; <a name="l00198"></a>00198 <a class="code" href="struct__RtpSignalTable.html">RtpSignalTable</a> on_rtcp_bye; <a name="l00199"></a>00199 <span class="keyword">struct </span><a class="code" href="struct__OList.html">_OList</a> *signal_tables; <a name="l00200"></a>00200 <span class="keyword">struct </span><a class="code" href="struct__OList.html">_OList</a> *eventqs; <a name="l00201"></a>00201 <a class="code" href="struct__msgb__allocator.html">msgb_allocator_t</a> allocator; <a name="l00202"></a>00202 <a class="code" href="struct__RtpStream.html">RtpStream</a> rtp; <a name="l00203"></a>00203 <a class="code" href="struct__RtcpStream.html">RtcpStream</a> rtcp; <a name="l00204"></a>00204 RtpSessionMode mode; <a name="l00205"></a>00205 <span class="keyword">struct </span><a class="code" href="struct__RtpScheduler.html">_RtpScheduler</a> *sched; <a name="l00206"></a>00206 uint32_t flags; <a name="l00207"></a>00207 <span class="keywordtype">int</span> dscp; <a name="l00208"></a>00208 <span class="keywordtype">int</span> multicast_ttl; <a name="l00209"></a>00209 <span class="keywordtype">int</span> multicast_loopback; <a name="l00210"></a>00210 <span class="keywordtype">void</span> * user_data; <a name="l00211"></a>00211 <span class="comment">/* FIXME: Should be a table for all session participants. */</span> <a name="l00212"></a>00212 <span class="keyword">struct </span>timeval last_recv_time; <span class="comment">/* Time of receiving the RTP/RTCP packet. */</span> <a name="l00213"></a>00213 <a class="code" href="structmsgb.html">mblk_t</a> *pending; <a name="l00214"></a>00214 <span class="comment">/* telephony events extension */</span> <a name="l00215"></a>00215 <a class="code" href="structmsgb.html">mblk_t</a> *current_tev; <span class="comment">/* the pending telephony events */</span> <a name="l00216"></a>00216 <a class="code" href="structmsgb.html">mblk_t</a> *sd; <a name="l00217"></a>00217 <a class="code" href="struct__queue.html">queue_t</a> contributing_sources; <a name="l00218"></a>00218 bool_t symmetric_rtp; <a name="l00219"></a>00219 bool_t permissive; <span class="comment">/*use the permissive algorithm*/</span> <a name="l00220"></a>00220 bool_t use_connect; <span class="comment">/* use connect() on the socket */</span> <a name="l00221"></a>00221 bool_t ssrc_set; <a name="l00222"></a>00222 }; <a name="l00223"></a>00223 <a name="l00224"></a>00224 <a name="l00225"></a>00225 <a name="l00226"></a>00226 <a name="l00227"></a>00227 <span class="preprocessor">#ifdef __cplusplus</span> <a name="l00228"></a>00228 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> <a name="l00229"></a>00229 { <a name="l00230"></a>00230 <span class="preprocessor">#endif</span> <a name="l00231"></a>00231 <span class="preprocessor"></span> <a name="l00232"></a>00232 <span class="comment">/* public API */</span> <a name="l00233"></a>00233 <a class="code" href="struct__RtpSession.html">RtpSession</a> *rtp_session_new(<span class="keywordtype">int</span> mode); <a name="l00234"></a>00234 <span class="keywordtype">void</span> rtp_session_set_scheduling_mode(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">int</span> yesno); <a name="l00235"></a>00235 <span class="keywordtype">void</span> rtp_session_set_blocking_mode(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">int</span> yesno); <a name="l00236"></a>00236 <span class="keywordtype">void</span> rtp_session_set_profile(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <a class="code" href="struct__RtpProfile.html">RtpProfile</a> *profile); <a name="l00237"></a>00237 <span class="keywordtype">void</span> rtp_session_set_send_profile(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session,<a class="code" href="struct__RtpProfile.html">RtpProfile</a> *profile); <a name="l00238"></a>00238 <span class="keywordtype">void</span> rtp_session_set_recv_profile(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session,<a class="code" href="struct__RtpProfile.html">RtpProfile</a> *profile); <a name="l00239"></a>00239 <a class="code" href="struct__RtpProfile.html">RtpProfile</a> *rtp_session_get_profile(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00240"></a>00240 <a class="code" href="struct__RtpProfile.html">RtpProfile</a> *rtp_session_get_send_profile(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00241"></a>00241 <a class="code" href="struct__RtpProfile.html">RtpProfile</a> *rtp_session_get_recv_profile(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00242"></a>00242 <span class="keywordtype">int</span> rtp_session_signal_connect(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session,<span class="keyword">const</span> <span class="keywordtype">char</span> *signal_name, RtpCallback cb, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> user_data); <a name="l00243"></a>00243 <span class="keywordtype">int</span> rtp_session_signal_disconnect_by_callback(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session,<span class="keyword">const</span> <span class="keywordtype">char</span> *signal_name, RtpCallback cb); <a name="l00244"></a>00244 <span class="keywordtype">void</span> rtp_session_set_ssrc(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, uint32_t ssrc); <a name="l00245"></a>00245 <span class="keywordtype">void</span> rtp_session_set_seq_number(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, uint16_t seq); <a name="l00246"></a>00246 uint16_t rtp_session_get_seq_number(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00247"></a>00247 <a name="l00248"></a>00248 <span class="keywordtype">void</span> rtp_session_enable_jitter_buffer(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session , bool_t enabled); <a name="l00249"></a>00249 bool_t rtp_session_jitter_buffer_enabled(<span class="keyword">const</span> <a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00250"></a>00250 <span class="keywordtype">void</span> rtp_session_set_jitter_buffer_params(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keyword">const</span> <a class="code" href="struct__JBParameters.html">JBParameters</a> *par); <a name="l00251"></a>00251 <span class="keywordtype">void</span> rtp_session_get_jitter_buffer_params(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <a class="code" href="struct__JBParameters.html">JBParameters</a> *par); <a name="l00252"></a>00252 <a name="l00253"></a>00253 <span class="comment">/*deprecated jitter control functions*/</span> <a name="l00254"></a>00254 <span class="keywordtype">void</span> rtp_session_set_jitter_compensation(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">int</span> milisec); <a name="l00255"></a>00255 <span class="keywordtype">void</span> rtp_session_enable_adaptive_jitter_compensation(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, bool_t val); <a name="l00256"></a>00256 bool_t rtp_session_adaptive_jitter_compensation_enabled(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00257"></a>00257 <a name="l00258"></a>00258 <span class="keywordtype">void</span> rtp_session_set_time_jump_limit(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">int</span> miliseconds); <a name="l00259"></a>00259 <span class="keywordtype">int</span> rtp_session_set_local_addr(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session,<span class="keyword">const</span> <span class="keywordtype">char</span> *addr, <span class="keywordtype">int</span> port); <a name="l00260"></a>00260 <span class="keywordtype">int</span> rtp_session_get_local_port(<span class="keyword">const</span> <a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00261"></a>00261 <a name="l00262"></a>00262 <span class="keywordtype">int</span> <a name="l00263"></a>00263 rtp_session_set_remote_addr_full (<a class="code" href="struct__RtpSession.html">RtpSession</a> * session, <span class="keyword">const</span> <span class="keywordtype">char</span> * addr, <span class="keywordtype">int</span> rtp_port, <span class="keywordtype">int</span> rtcp_port); <a name="l00264"></a>00264 <span class="comment">/*same as previous function, old name:*/</span> <a name="l00265"></a>00265 <span class="keywordtype">int</span> rtp_session_set_remote_addr_and_port (<a class="code" href="struct__RtpSession.html">RtpSession</a> * session, <span class="keyword">const</span> <span class="keywordtype">char</span> * addr, <span class="keywordtype">int</span> rtp_port, <span class="keywordtype">int</span> rtcp_port); <a name="l00266"></a>00266 <span class="keywordtype">int</span> rtp_session_set_remote_addr(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session,<span class="keyword">const</span> <span class="keywordtype">char</span> *addr, <span class="keywordtype">int</span> port); <a name="l00267"></a>00267 <span class="comment">/* alternatively to the set_remote_addr() and set_local_addr(), an application can give</span> <a name="l00268"></a>00268 <span class="comment">a valid socket (potentially connect()ed )to be used by the RtpSession */</span> <a name="l00269"></a>00269 <span class="keywordtype">void</span> rtp_session_set_sockets(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">int</span> rtpfd, <span class="keywordtype">int</span> rtcpfd); <a name="l00270"></a>00270 <span class="keywordtype">void</span> rtp_session_set_transports(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <a class="code" href="struct__RtpTransport.html">RtpTransport</a> *rtptr, <a class="code" href="struct__RtpTransport.html">RtpTransport</a> *rtcptr); <a name="l00271"></a>00271 <a name="l00272"></a>00272 <span class="comment">/*those methods are provided for people who wants to send non-RTP messages using the RTP/RTCP sockets */</span> <a name="l00273"></a>00273 ortp_socket_t rtp_session_get_rtp_socket(<span class="keyword">const</span> <a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00274"></a>00274 ortp_socket_t rtp_session_get_rtcp_socket(<span class="keyword">const</span> <a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00275"></a>00275 <a name="l00276"></a>00276 <a name="l00277"></a>00277 <span class="comment">/* QOS / DSCP */</span> <a name="l00278"></a>00278 <span class="keywordtype">int</span> rtp_session_set_dscp(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">int</span> dscp); <a name="l00279"></a>00279 <span class="keywordtype">int</span> rtp_session_get_dscp(<span class="keyword">const</span> <a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00280"></a>00280 <a name="l00281"></a>00281 <a name="l00282"></a>00282 <span class="comment">/* Multicast methods */</span> <a name="l00283"></a>00283 <span class="keywordtype">int</span> rtp_session_set_multicast_ttl(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">int</span> ttl); <a name="l00284"></a>00284 <span class="keywordtype">int</span> rtp_session_get_multicast_ttl(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00285"></a>00285 <a name="l00286"></a>00286 <span class="keywordtype">int</span> rtp_session_set_multicast_loopback(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">int</span> yesno); <a name="l00287"></a>00287 <span class="keywordtype">int</span> rtp_session_get_multicast_loopback(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00288"></a>00288 <a name="l00289"></a>00289 <a name="l00290"></a>00290 <a name="l00291"></a>00291 <span class="keywordtype">int</span> rtp_session_set_send_payload_type(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">int</span> paytype); <a name="l00292"></a>00292 <span class="keywordtype">int</span> rtp_session_get_send_payload_type(<span class="keyword">const</span> <a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00293"></a>00293 <a name="l00294"></a>00294 <span class="keywordtype">int</span> rtp_session_get_recv_payload_type(<span class="keyword">const</span> <a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00295"></a>00295 <span class="keywordtype">int</span> rtp_session_set_recv_payload_type(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">int</span> pt); <a name="l00296"></a>00296 <a name="l00297"></a>00297 <span class="keywordtype">int</span> rtp_session_set_payload_type(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">int</span> pt); <a name="l00298"></a>00298 <a name="l00299"></a>00299 <span class="keywordtype">void</span> rtp_session_set_symmetric_rtp (<a class="code" href="struct__RtpSession.html">RtpSession</a> * session, bool_t yesno); <a name="l00300"></a>00300 <a name="l00301"></a>00301 <span class="keywordtype">void</span> rtp_session_set_connected_mode(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, bool_t yesno); <a name="l00302"></a>00302 <a name="l00303"></a>00303 <span class="keywordtype">void</span> rtp_session_enable_rtcp(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, bool_t yesno); <a name="l00304"></a>00304 <a name="l00305"></a>00305 <span class="comment">/*low level recv and send functions */</span> <a name="l00306"></a>00306 <a class="code" href="structmsgb.html">mblk_t</a> * rtp_session_recvm_with_ts (<a class="code" href="struct__RtpSession.html">RtpSession</a> * session, uint32_t user_ts); <a name="l00307"></a>00307 <a class="code" href="structmsgb.html">mblk_t</a> * rtp_session_create_packet(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session,<span class="keywordtype">int</span> header_size, <span class="keyword">const</span> uint8_t *payload, <span class="keywordtype">int</span> payload_size); <a name="l00308"></a>00308 <a class="code" href="structmsgb.html">mblk_t</a> * rtp_session_create_packet_with_data(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, uint8_t *payload, <span class="keywordtype">int</span> payload_size, <span class="keywordtype">void</span> (*freefn)(<span class="keywordtype">void</span>*)); <a name="l00309"></a>00309 <a class="code" href="structmsgb.html">mblk_t</a> * rtp_session_create_packet_in_place(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session,uint8_t *buffer, <span class="keywordtype">int</span> size, <span class="keywordtype">void</span> (*freefn)(<span class="keywordtype">void</span>*) ); <a name="l00310"></a>00310 <span class="keywordtype">int</span> rtp_session_sendm_with_ts (<a class="code" href="struct__RtpSession.html">RtpSession</a> * session, <a class="code" href="structmsgb.html">mblk_t</a> *mp, uint32_t userts); <a name="l00311"></a>00311 <span class="comment">/* high level recv and send functions */</span> <a name="l00312"></a>00312 <span class="keywordtype">int</span> rtp_session_recv_with_ts(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, uint8_t *buffer, <span class="keywordtype">int</span> len, uint32_t ts, <span class="keywordtype">int</span> *have_more); <a name="l00313"></a>00313 <span class="keywordtype">int</span> rtp_session_send_with_ts(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keyword">const</span> uint8_t *buffer, <span class="keywordtype">int</span> len, uint32_t userts); <a name="l00314"></a>00314 <a name="l00315"></a>00315 <span class="comment">/* event API*/</span> <a name="l00316"></a>00316 <span class="keywordtype">void</span> rtp_session_register_event_queue(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <a class="code" href="structOrtpEvQueue.html">OrtpEvQueue</a> *q); <a name="l00317"></a>00317 <span class="keywordtype">void</span> rtp_session_unregister_event_queue(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <a class="code" href="structOrtpEvQueue.html">OrtpEvQueue</a> *q); <a name="l00318"></a>00318 <a name="l00319"></a>00319 <a name="l00320"></a>00320 <span class="comment">/* IP bandwidth usage estimation functions, returning bits/s*/</span> <a name="l00321"></a>00321 <span class="keywordtype">float</span> rtp_session_compute_send_bandwidth(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00322"></a>00322 <span class="keywordtype">float</span> rtp_session_compute_recv_bandwidth(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00323"></a>00323 <a name="l00324"></a>00324 <span class="keywordtype">void</span> rtp_session_send_rtcp_APP(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, uint8_t subtype, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> uint8_t *data, <span class="keywordtype">int</span> datalen); <a name="l00325"></a>00325 <a name="l00326"></a>00326 uint32_t rtp_session_get_current_send_ts(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00327"></a>00327 uint32_t rtp_session_get_current_recv_ts(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00328"></a>00328 <span class="keywordtype">void</span> rtp_session_flush_sockets(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00329"></a>00329 <span class="keywordtype">void</span> rtp_session_release_sockets(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00330"></a>00330 <span class="keywordtype">void</span> rtp_session_resync(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00331"></a>00331 <span class="keywordtype">void</span> rtp_session_reset(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00332"></a>00332 <span class="keywordtype">void</span> rtp_session_destroy(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00333"></a>00333 <a name="l00334"></a>00334 <span class="keyword">const</span> <a class="code" href="structrtp__stats.html">rtp_stats_t</a> * rtp_session_get_stats(<span class="keyword">const</span> <a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00335"></a>00335 <span class="keywordtype">void</span> rtp_session_reset_stats(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00336"></a>00336 <a name="l00337"></a>00337 <span class="keywordtype">void</span> rtp_session_set_data(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">void</span> *data); <a name="l00338"></a>00338 <span class="keywordtype">void</span> *rtp_session_get_data(<span class="keyword">const</span> <a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00339"></a>00339 <a name="l00340"></a>00340 <span class="keywordtype">void</span> rtp_session_set_recv_buf_size(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">int</span> bufsize); <a name="l00341"></a>00341 <span class="keywordtype">void</span> rtp_session_set_rtp_socket_send_buffer_size(<a class="code" href="struct__RtpSession.html">RtpSession</a> * session, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> size); <a name="l00342"></a>00342 <span class="keywordtype">void</span> rtp_session_set_rtp_socket_recv_buffer_size(<a class="code" href="struct__RtpSession.html">RtpSession</a> * session, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> size); <a name="l00343"></a>00343 <a name="l00344"></a>00344 <span class="comment">/* in use with the scheduler to convert a timestamp in scheduler time unit (ms) */</span> <a name="l00345"></a>00345 uint32_t rtp_session_ts_to_time(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session,uint32_t timestamp); <a name="l00346"></a>00346 uint32_t rtp_session_time_to_ts(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">int</span> millisecs); <a name="l00347"></a>00347 <span class="comment">/* this function aims at simulating senders with "imprecise" clocks, resulting in </span> <a name="l00348"></a>00348 <span class="comment">rtp packets sent with timestamp uncorrelated with the system clock .</span> <a name="l00349"></a>00349 <span class="comment">This is only availlable to sessions working with the oRTP scheduler */</span> <a name="l00350"></a>00350 <span class="keywordtype">void</span> rtp_session_make_time_distorsion(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">int</span> milisec); <a name="l00351"></a>00351 <a name="l00352"></a>00352 <span class="comment">/*RTCP functions */</span> <a name="l00353"></a>00353 <span class="keywordtype">void</span> rtp_session_set_source_description(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keyword">const</span> <span class="keywordtype">char</span> *cname, <a name="l00354"></a>00354 <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *email, <span class="keyword">const</span> <span class="keywordtype">char</span> *phone, <a name="l00355"></a>00355 <span class="keyword">const</span> <span class="keywordtype">char</span> *loc, <span class="keyword">const</span> <span class="keywordtype">char</span> *tool, <span class="keyword">const</span> <span class="keywordtype">char</span> *note); <a name="l00356"></a>00356 <span class="keywordtype">void</span> rtp_session_add_contributing_source(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, uint32_t csrc, <a name="l00357"></a>00357 <span class="keyword">const</span> <span class="keywordtype">char</span> *cname, <span class="keyword">const</span> <span class="keywordtype">char</span> *name, <span class="keyword">const</span> <span class="keywordtype">char</span> *email, <span class="keyword">const</span> <span class="keywordtype">char</span> *phone, <a name="l00358"></a>00358 <span class="keyword">const</span> <span class="keywordtype">char</span> *loc, <span class="keyword">const</span> <span class="keywordtype">char</span> *tool, <span class="keyword">const</span> <span class="keywordtype">char</span> *note); <a name="l00359"></a>00359 <span class="keywordtype">void</span> rtp_session_remove_contributing_sources(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, uint32_t csrc); <a name="l00360"></a>00360 <a class="code" href="structmsgb.html">mblk_t</a>* rtp_session_create_rtcp_sdes_packet(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00361"></a>00361 <a name="l00362"></a>00362 <span class="keywordtype">void</span> rtp_session_get_last_recv_time(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keyword">struct</span> timeval *tv); <a name="l00363"></a>00363 <span class="keywordtype">int</span> rtp_session_bye(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keyword">const</span> <span class="keywordtype">char</span> *reason); <a name="l00364"></a>00364 <a name="l00365"></a>00365 <span class="keywordtype">int</span> rtp_session_get_last_send_error_code(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00366"></a>00366 <span class="keywordtype">void</span> rtp_session_clear_send_error_code(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00367"></a>00367 <span class="keywordtype">int</span> rtp_session_get_last_recv_error_code(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00368"></a>00368 <span class="keywordtype">void</span> rtp_session_clear_recv_error_code(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00369"></a>00369 <a name="l00370"></a>00370 <span class="comment">/*private */</span> <a name="l00371"></a>00371 <span class="keywordtype">void</span> rtp_session_init(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session, <span class="keywordtype">int</span> mode); <a name="l00372"></a>00372 <span class="preprocessor">#define rtp_session_set_flag(session,flag) (session)->flags|=(flag)</span> <a name="l00373"></a>00373 <span class="preprocessor"></span><span class="preprocessor">#define rtp_session_unset_flag(session,flag) (session)->flags&=~(flag)</span> <a name="l00374"></a>00374 <span class="preprocessor"></span><span class="keywordtype">void</span> rtp_session_uninit(<a class="code" href="struct__RtpSession.html">RtpSession</a> *session); <a name="l00375"></a>00375 <a name="l00376"></a>00376 <span class="preprocessor">#ifdef __cplusplus</span> <a name="l00377"></a>00377 <span class="preprocessor"></span>} <a name="l00378"></a>00378 <span class="preprocessor">#endif</span> <a name="l00379"></a>00379 <span class="preprocessor"></span> <a name="l00380"></a>00380 <span class="preprocessor">#endif</span> </pre></div></div> <hr size="1"/><address style="text-align: right;"><small>Generated on 30 Nov 2009 for oRTP by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address> </body> </html>