oRTP 0.23.0
rtpsession.h
Go to the documentation of this file.
1 /*
2 The oRTP library is an RTP (Realtime Transport Protocol - rfc3550) stack.
3 Copyright (C) 2001 Simon MORLAT simon.morlat@linphone.org
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19
30#ifndef RTPSESSION_H
31#define RTPSESSION_H
32
33
34#include <ortp/port.h>
35#include <ortp/rtp.h>
36#include <ortp/payloadtype.h>
37#include <ortp/rtpprofile.h>
38#include <ortp/sessionset.h>
39#include <ortp/rtcp.h>
40#include <ortp/str_utils.h>
41#include <ortp/rtpsignaltable.h>
42#include <ortp/event.h>
43
44
45
46typedef enum {
47 RTP_SESSION_RECVONLY,
48 RTP_SESSION_SENDONLY,
49 RTP_SESSION_SENDRECV
50} RtpSessionMode;
51
52
55typedef struct _JBParameters{
59 bool_t adaptive;
60 bool_t pad[3];
63
64typedef struct _JitterControl
65{
66 unsigned int count;
67 int jitt_comp; /* the user jitt_comp in miliseconds*/
68 int jitt_comp_ts; /* the jitt_comp converted in rtp time (same unit as timestamp) */
69 int adapt_jitt_comp_ts;
70 int64_t slide;
71 int64_t prev_slide;
72 float jitter;
73 int olddiff;
74 float inter_jitter; /* interarrival jitter as defined in the RFC */
75 int corrective_step;
76 int corrective_slide;
77 uint64_t cum_jitter_buffer_size; /*in timestamp units*/
78 unsigned int cum_jitter_buffer_count; /*used for computation of jitter buffer size*/
79 int clock_rate;
80 bool_t adaptive;
81 bool_t enabled;
83
84typedef struct _WaitPoint
85{
86 ortp_mutex_t lock;
87 ortp_cond_t cond;
88 uint32_t time;
89 bool_t wakeup;
90} WaitPoint;
91
92typedef struct _RtpTransport
93{
94 void *data;
95 ortp_socket_t (*t_getsocket)(struct _RtpTransport *t);
96 int (*t_sendto)(struct _RtpTransport *t, mblk_t *msg , int flags, const struct sockaddr *to, socklen_t tolen);
97 int (*t_recvfrom)(struct _RtpTransport *t, mblk_t *msg, int flags, struct sockaddr *from, socklen_t *fromlen);
98 struct _RtpSession *session;//<back pointer to the owning session, set by oRTP
99 void (*t_close)(struct _RtpTransport *transport, void *userData);
101
103 int enabled;
104 float max_bandwidth; /*IP bandwidth, in bit/s*/
105 int max_buffer_size; /*Max number of bit buffered before being discarded*/
106 float loss_rate;
108
111 int bit_budget;
112 int qsize;
113 queue_t q;
114 struct timeval last_check;
116
117typedef struct _RtpStream
118{
119 ortp_socket_t socket;
120 struct _RtpTransport *tr;
121 int sockfamily;
122 int max_rq_size;
123 int time_jump;
124 uint32_t ts_jump;
125 queue_t rq;
126 queue_t tev_rq;
127 mblk_t *cached_mp;
128 int loc_port;
129#ifdef ORTP_INET6
130 struct sockaddr_storage rem_addr;
131#else
132 struct sockaddr_in rem_addr;
133#endif
134 int rem_addrlen;
135 void *QoSHandle;
136 unsigned long QoSFlowID;
137 JitterControl jittctl;
138 uint32_t snd_time_offset;/*the scheduler time when the application send its first timestamp*/
139 uint32_t snd_ts_offset; /* the first application timestamp sent by the application */
140 uint32_t snd_rand_offset; /* a random number added to the user offset to make the stream timestamp*/
141 uint32_t snd_last_ts; /* the last stream timestamp sended */
142 uint32_t rcv_time_offset; /*the scheduler time when the application ask for its first timestamp*/
143 uint32_t rcv_ts_offset; /* the first stream timestamp */
144 uint32_t rcv_query_ts_offset; /* the first user timestamp asked by the application */
145 uint32_t rcv_last_ts; /* the last stream timestamp got by the application */
146 uint32_t rcv_last_app_ts; /* the last application timestamp asked by the application */
147 uint32_t rcv_last_ret_ts; /* the timestamp of the last sample returned (only for continuous audio)*/
148 uint32_t hwrcv_extseq; /* last received on socket extended sequence number */
149 uint32_t hwrcv_seq_at_last_SR;
150 uint32_t hwrcv_since_last_SR;
151 uint32_t last_rcv_SR_ts; /* NTP timestamp (middle 32 bits) of last received SR */
152 struct timeval last_rcv_SR_time; /* time at which last SR was received */
153 uint16_t snd_seq; /* send sequence number */
154 uint32_t last_rtcp_packet_count; /*the sender's octet count in the last sent RTCP SR*/
155 uint32_t sent_payload_bytes; /*used for RTCP sender reports*/
156 unsigned int sent_bytes; /* used for bandwidth estimation */
157 struct timeval send_bw_start; /* used for bandwidth estimation */
158 unsigned int recv_bytes; /* used for bandwidth estimation */
159 struct timeval recv_bw_start; /* used for bandwidth estimation */
160 rtp_stats_t stats;
161 int recv_errno;
162 int send_errno;
163 int snd_socket_size;
164 int rcv_socket_size;
165 int ssrc_changed_thres;
167}RtpStream;
168
169typedef struct _RtcpStream
170{
171 ortp_socket_t socket;
172 int sockfamily;
173 struct _RtpTransport *tr;
174 mblk_t *cached_mp;
175 int loc_port;
176#ifdef ORTP_INET6
177 struct sockaddr_storage rem_addr;
178#else
179 struct sockaddr_in rem_addr;
180#endif
181 int rem_addrlen;
182 int interval;
183 uint32_t last_rtcp_report_snt_r; /* the time of the last rtcp report sent, in recv timestamp unit */
184 uint32_t last_rtcp_report_snt_s; /* the time of the last rtcp report sent, in send timestamp unit */
185 uint32_t rtcp_report_snt_interval_r; /* the interval in timestamp unit for receive path between rtcp report sent */
186 uint32_t rtcp_report_snt_interval_s; /* the interval in timestamp unit for send path between rtcp report sent */
187 bool_t enabled; /*tells whether we can send RTCP packets */
188} RtcpStream;
189
190typedef struct _RtpSession RtpSession;
191
192
202{
203 RtpSession *next; /* next RtpSession, when the session are enqueued by the scheduler */
204 int mask_pos; /* 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*/
205 struct {
206 RtpProfile *profile;
207 int pt;
208 unsigned int ssrc;
209 WaitPoint wp;
210 int telephone_events_pt; /* the payload type used for telephony events */
211 } snd,rcv;
212 unsigned int inc_ssrc_candidate;
213 int inc_same_ssrc_count;
214 int hw_recv_pt; /* recv payload type before jitter buffer */
215 int recv_buf_size;
216 RtpSignalTable on_ssrc_changed;
217 RtpSignalTable on_payload_type_changed;
218 RtpSignalTable on_telephone_event_packet;
219 RtpSignalTable on_telephone_event;
220 RtpSignalTable on_timestamp_jump;
221 RtpSignalTable on_network_error;
222 RtpSignalTable on_rtcp_bye;
223 struct _OList *signal_tables;
224 struct _OList *eventqs;
225 msgb_allocator_t allocator;
226 RtpStream rtp;
227 RtcpStream rtcp;
228 RtpSessionMode mode;
229 struct _RtpScheduler *sched;
230 uint32_t flags;
231 int dscp;
232 int multicast_ttl;
233 int multicast_loopback;
234 void * user_data;
235 /* FIXME: Should be a table for all session participants. */
236 struct timeval last_recv_time; /* Time of receiving the RTP/RTCP packet. */
237 mblk_t *pending;
238 /* telephony events extension */
239 mblk_t *current_tev; /* the pending telephony events */
240 mblk_t *sd;
241 queue_t contributing_sources;
242 unsigned int lost_packets_test_vector;
243 unsigned int interarrival_jitter_test_vector;
244 unsigned int delay_test_vector;
245 float rtt;/*last round trip delay calculated*/
246 OrtpNetworkSimulatorCtx *net_sim_ctx;
247 bool_t symmetric_rtp;
248 bool_t permissive; /*use the permissive algorithm*/
249 bool_t use_connect; /* use connect() on the socket */
250 bool_t ssrc_set;
251 bool_t reuseaddr; /*setsockopt SO_REUSEADDR */
252};
253
254
255
256
257#ifdef __cplusplus
258extern "C"
259{
260#endif
261
262/* public API */
263ORTP_PUBLIC RtpSession *rtp_session_new(int mode);
264ORTP_PUBLIC void rtp_session_set_scheduling_mode(RtpSession *session, int yesno);
265ORTP_PUBLIC void rtp_session_set_blocking_mode(RtpSession *session, int yesno);
266ORTP_PUBLIC void rtp_session_set_profile(RtpSession *session, RtpProfile *profile);
267ORTP_PUBLIC void rtp_session_set_send_profile(RtpSession *session,RtpProfile *profile);
268ORTP_PUBLIC void rtp_session_set_recv_profile(RtpSession *session,RtpProfile *profile);
269ORTP_PUBLIC RtpProfile *rtp_session_get_profile(RtpSession *session);
272ORTP_PUBLIC int rtp_session_signal_connect(RtpSession *session,const char *signal_name, RtpCallback cb, unsigned long user_data);
273ORTP_PUBLIC int rtp_session_signal_disconnect_by_callback(RtpSession *session,const char *signal_name, RtpCallback cb);
274ORTP_PUBLIC void rtp_session_set_ssrc(RtpSession *session, uint32_t ssrc);
275ORTP_PUBLIC uint32_t rtp_session_get_send_ssrc(RtpSession* session);
276ORTP_PUBLIC uint32_t rtp_session_get_recv_ssrc(RtpSession *session);
277ORTP_PUBLIC void rtp_session_set_seq_number(RtpSession *session, uint16_t seq);
278ORTP_PUBLIC uint16_t rtp_session_get_seq_number(RtpSession *session);
279ORTP_PUBLIC uint32_t rtp_session_get_rcv_ext_seq_number(RtpSession *session);
280
281ORTP_PUBLIC void rtp_session_enable_jitter_buffer(RtpSession *session , bool_t enabled);
282ORTP_PUBLIC bool_t rtp_session_jitter_buffer_enabled(const RtpSession *session);
283ORTP_PUBLIC void rtp_session_set_jitter_buffer_params(RtpSession *session, const JBParameters *par);
284ORTP_PUBLIC void rtp_session_get_jitter_buffer_params(RtpSession *session, JBParameters *par);
285
286/*deprecated jitter control functions*/
287ORTP_PUBLIC void rtp_session_set_jitter_compensation(RtpSession *session, int milisec);
288ORTP_PUBLIC void rtp_session_enable_adaptive_jitter_compensation(RtpSession *session, bool_t val);
289ORTP_PUBLIC bool_t rtp_session_adaptive_jitter_compensation_enabled(RtpSession *session);
290
291ORTP_PUBLIC void rtp_session_set_time_jump_limit(RtpSession *session, int miliseconds);
292ORTP_PUBLIC int rtp_session_set_local_addr(RtpSession *session,const char *addr, int rtp_port, int rtcp_port);
293ORTP_PUBLIC int rtp_session_get_local_port(const RtpSession *session);
294
295ORTP_PUBLIC int
296rtp_session_set_remote_addr_full (RtpSession * session, const char * rtp_addr, int rtp_port, const char * rtcp_addr, int rtcp_port);
297/*same as previous function, old name:*/
298ORTP_PUBLIC int rtp_session_set_remote_addr_and_port (RtpSession * session, const char * addr, int rtp_port, int rtcp_port);
299ORTP_PUBLIC int rtp_session_set_remote_addr(RtpSession *session,const char *addr, int port);
300/* alternatively to the set_remote_addr() and set_local_addr(), an application can give
301a valid socket (potentially connect()ed )to be used by the RtpSession */
302ORTP_PUBLIC void rtp_session_set_sockets(RtpSession *session, int rtpfd, int rtcpfd);
303ORTP_PUBLIC void rtp_session_set_transports(RtpSession *session, RtpTransport *rtptr, RtpTransport *rtcptr);
304
305/*those methods are provided for people who wants to send non-RTP messages using the RTP/RTCP sockets */
306ORTP_PUBLIC ortp_socket_t rtp_session_get_rtp_socket(const RtpSession *session);
307ORTP_PUBLIC ortp_socket_t rtp_session_get_rtcp_socket(const RtpSession *session);
308
309
310/* QOS / DSCP */
311ORTP_PUBLIC int rtp_session_set_dscp(RtpSession *session, int dscp);
312ORTP_PUBLIC int rtp_session_get_dscp(const RtpSession *session);
313
314
315/* Packet info */
316ORTP_PUBLIC int rtp_session_set_pktinfo(RtpSession *session, int activate);
317
318/* Multicast methods */
319ORTP_PUBLIC int rtp_session_set_multicast_ttl(RtpSession *session, int ttl);
320ORTP_PUBLIC int rtp_session_get_multicast_ttl(RtpSession *session);
321
322ORTP_PUBLIC int rtp_session_set_multicast_loopback(RtpSession *session, int yesno);
323ORTP_PUBLIC int rtp_session_get_multicast_loopback(RtpSession *session);
324
325
326
327ORTP_PUBLIC int rtp_session_set_send_payload_type(RtpSession *session, int paytype);
328ORTP_PUBLIC int rtp_session_get_send_payload_type(const RtpSession *session);
329
330ORTP_PUBLIC int rtp_session_get_recv_payload_type(const RtpSession *session);
331ORTP_PUBLIC int rtp_session_set_recv_payload_type(RtpSession *session, int pt);
332
333ORTP_PUBLIC int rtp_session_set_payload_type(RtpSession *session, int pt);
334
335ORTP_PUBLIC void rtp_session_set_symmetric_rtp (RtpSession * session, bool_t yesno);
336
337ORTP_PUBLIC void rtp_session_set_connected_mode(RtpSession *session, bool_t yesno);
338
339ORTP_PUBLIC void rtp_session_enable_rtcp(RtpSession *session, bool_t yesno);
340
341ORTP_PUBLIC void rtp_session_set_rtcp_report_interval(RtpSession *session, int value_ms);
342
343ORTP_PUBLIC void rtp_session_set_ssrc_changed_threshold(RtpSession *session, int numpackets);
344
345/*low level recv and send functions */
346ORTP_PUBLIC mblk_t * rtp_session_recvm_with_ts (RtpSession * session, uint32_t user_ts);
347ORTP_PUBLIC mblk_t * rtp_session_create_packet(RtpSession *session,int header_size, const uint8_t *payload, int payload_size);
348ORTP_PUBLIC mblk_t * rtp_session_create_packet_with_data(RtpSession *session, uint8_t *payload, int payload_size, void (*freefn)(void*));
349ORTP_PUBLIC mblk_t * rtp_session_create_packet_in_place(RtpSession *session,uint8_t *buffer, int size, void (*freefn)(void*) );
350ORTP_PUBLIC int rtp_session_sendm_with_ts (RtpSession * session, mblk_t *mp, uint32_t userts);
351/* high level recv and send functions */
352ORTP_PUBLIC int rtp_session_recv_with_ts(RtpSession *session, uint8_t *buffer, int len, uint32_t ts, int *have_more);
353ORTP_PUBLIC int rtp_session_send_with_ts(RtpSession *session, const uint8_t *buffer, int len, uint32_t userts);
354
355/* event API*/
356ORTP_PUBLIC void rtp_session_register_event_queue(RtpSession *session, OrtpEvQueue *q);
357ORTP_PUBLIC void rtp_session_unregister_event_queue(RtpSession *session, OrtpEvQueue *q);
358
359
360/* IP bandwidth usage estimation functions, returning bits/s*/
361ORTP_PUBLIC float rtp_session_compute_send_bandwidth(RtpSession *session);
362ORTP_PUBLIC float rtp_session_compute_recv_bandwidth(RtpSession *session);
363
364ORTP_PUBLIC void rtp_session_send_rtcp_APP(RtpSession *session, uint8_t subtype, const char *name, const uint8_t *data, int datalen);
365
366ORTP_PUBLIC uint32_t rtp_session_get_current_send_ts(RtpSession *session);
367ORTP_PUBLIC uint32_t rtp_session_get_current_recv_ts(RtpSession *session);
368ORTP_PUBLIC void rtp_session_flush_sockets(RtpSession *session);
369ORTP_PUBLIC void rtp_session_release_sockets(RtpSession *session);
370ORTP_PUBLIC void rtp_session_resync(RtpSession *session);
371ORTP_PUBLIC void rtp_session_reset(RtpSession *session);
372ORTP_PUBLIC void rtp_session_destroy(RtpSession *session);
373
374ORTP_PUBLIC const rtp_stats_t * rtp_session_get_stats(const RtpSession *session);
375ORTP_PUBLIC const jitter_stats_t * rtp_session_get_jitter_stats( const RtpSession *session );
376ORTP_PUBLIC void rtp_session_reset_stats(RtpSession *session);
377
378ORTP_PUBLIC void rtp_session_set_data(RtpSession *session, void *data);
379ORTP_PUBLIC void *rtp_session_get_data(const RtpSession *session);
380
381ORTP_PUBLIC void rtp_session_set_recv_buf_size(RtpSession *session, int bufsize);
382ORTP_PUBLIC void rtp_session_set_rtp_socket_send_buffer_size(RtpSession * session, unsigned int size);
383ORTP_PUBLIC void rtp_session_set_rtp_socket_recv_buffer_size(RtpSession * session, unsigned int size);
384
385/* in use with the scheduler to convert a timestamp in scheduler time unit (ms) */
386ORTP_PUBLIC uint32_t rtp_session_ts_to_time(RtpSession *session,uint32_t timestamp);
387ORTP_PUBLIC uint32_t rtp_session_time_to_ts(RtpSession *session, int millisecs);
388/* this function aims at simulating senders with "imprecise" clocks, resulting in
389rtp packets sent with timestamp uncorrelated with the system clock .
390This is only availlable to sessions working with the oRTP scheduler */
391ORTP_PUBLIC void rtp_session_make_time_distorsion(RtpSession *session, int milisec);
392
393/*RTCP functions */
394ORTP_PUBLIC void rtp_session_set_source_description(RtpSession *session, const char *cname,
395 const char *name, const char *email, const char *phone,
396 const char *loc, const char *tool, const char *note);
397ORTP_PUBLIC void rtp_session_add_contributing_source(RtpSession *session, uint32_t csrc,
398 const char *cname, const char *name, const char *email, const char *phone,
399 const char *loc, const char *tool, const char *note);
400ORTP_PUBLIC void rtp_session_remove_contributing_sources(RtpSession *session, uint32_t csrc);
401ORTP_PUBLIC mblk_t* rtp_session_create_rtcp_sdes_packet(RtpSession *session);
402
403ORTP_PUBLIC void rtp_session_get_last_recv_time(RtpSession *session, struct timeval *tv);
404ORTP_PUBLIC int rtp_session_bye(RtpSession *session, const char *reason);
405
406ORTP_PUBLIC int rtp_session_get_last_send_error_code(RtpSession *session);
407ORTP_PUBLIC void rtp_session_clear_send_error_code(RtpSession *session);
408ORTP_PUBLIC int rtp_session_get_last_recv_error_code(RtpSession *session);
409ORTP_PUBLIC void rtp_session_clear_recv_error_code(RtpSession *session);
410
411
412ORTP_PUBLIC float rtp_session_get_round_trip_propagation(RtpSession *session);
413
414
415ORTP_PUBLIC void rtp_session_enable_network_simulation(RtpSession *session, const OrtpNetworkSimulatorParams *params);
416ORTP_PUBLIC void rtp_session_rtcp_set_lost_packet_value( RtpSession *session, const unsigned int value );
417ORTP_PUBLIC void rtp_session_rtcp_set_jitter_value(RtpSession *session, const unsigned int value );
418ORTP_PUBLIC void rtp_session_rtcp_set_delay_value(RtpSession *session, const unsigned int value );
419ORTP_PUBLIC mblk_t * rtp_session_pick_with_cseq (RtpSession * session, const uint16_t sequence_number);
420/*private */
421ORTP_PUBLIC void rtp_session_init(RtpSession *session, int mode);
422#define rtp_session_set_flag(session,flag) (session)->flags|=(flag)
423#define rtp_session_unset_flag(session,flag) (session)->flags&=~(flag)
424ORTP_PUBLIC void rtp_session_uninit(RtpSession *session);
425ORTP_PUBLIC void rtp_session_dispatch_event(RtpSession *session, OrtpEvent *ev);
426
427ORTP_PUBLIC void rtp_session_set_reuseaddr(RtpSession *session, bool_t yes);
428
429#ifdef __cplusplus
430}
431#endif
432
433#endif
Definition of payload types.
Using and creating standart and custom RTP profiles.
ORTP_PUBLIC void rtp_session_rtcp_set_jitter_value(RtpSession *session, const unsigned int value)
For test purpose only, sets a constant interarrival_jitter value within all RTCP output packets....
Definition: rtpsession.c:1560
ORTP_PUBLIC int rtp_session_set_remote_addr_full(RtpSession *session, const char *rtp_addr, int rtp_port, const char *rtcp_addr, int rtcp_port)
Definition: rtpsession_inet.c:773
ORTP_PUBLIC uint32_t rtp_session_get_rcv_ext_seq_number(RtpSession *session)
Definition: rtpsession.c:622
ORTP_PUBLIC int rtp_session_sendm_with_ts(RtpSession *session, mblk_t *mp, uint32_t userts)
Definition: rtpsession.c:952
ORTP_PUBLIC void rtp_session_set_rtcp_report_interval(RtpSession *session, int value_ms)
Definition: rtpsession.c:416
ORTP_PUBLIC RtpProfile * rtp_session_get_profile(RtpSession *session)
Definition: rtpsession.c:475
ORTP_PUBLIC RtpSession * rtp_session_new(int mode)
Definition: rtpsession.c:312
ORTP_PUBLIC void rtp_session_release_sockets(RtpSession *session)
Definition: rtpsession.c:1357
ORTP_PUBLIC int rtp_session_set_multicast_loopback(RtpSession *session, int yesno)
Definition: rtpsession_inet.c:511
struct _JBParameters JBParameters
ORTP_PUBLIC int rtp_session_set_pktinfo(RtpSession *session, int activate)
Definition: rtpsession_inet.c:379
ORTP_PUBLIC void rtp_session_set_ssrc_changed_threshold(RtpSession *session, int numpackets)
Definition: rtpsession.c:1479
ORTP_PUBLIC void rtp_session_set_scheduling_mode(RtpSession *session, int yesno)
Definition: rtpsession.c:339
ORTP_PUBLIC mblk_t * rtp_session_pick_with_cseq(RtpSession *session, const uint16_t sequence_number)
Definition: rtpsession.c:1013
ORTP_PUBLIC uint16_t rtp_session_get_seq_number(RtpSession *session)
Definition: rtpsession.c:615
ORTP_PUBLIC RtpProfile * rtp_session_get_send_profile(RtpSession *session)
Definition: rtpsession.c:486
ORTP_PUBLIC const rtp_stats_t * rtp_session_get_stats(const RtpSession *session)
Definition: rtpsession.c:1530
ORTP_PUBLIC void rtp_session_set_rtp_socket_send_buffer_size(RtpSession *session, unsigned int size)
Definition: rtpsession.c:516
ORTP_PUBLIC uint32_t rtp_session_get_current_send_ts(RtpSession *session)
Definition: rtpsession.c:1293
ORTP_PUBLIC int rtp_session_set_multicast_ttl(RtpSession *session, int ttl)
Definition: rtpsession_inet.c:441
ORTP_PUBLIC int rtp_session_get_recv_payload_type(const RtpSession *session)
Definition: rtpsession.c:730
ORTP_PUBLIC void rtp_session_set_symmetric_rtp(RtpSession *session, bool_t yesno)
Definition: rtpsession.c:1623
ORTP_PUBLIC uint32_t rtp_session_get_current_recv_ts(RtpSession *session)
Definition: rtpsession.c:1319
ORTP_PUBLIC uint32_t rtp_session_get_recv_ssrc(RtpSession *session)
Definition: rtpsession.c:656
ORTP_PUBLIC mblk_t * rtp_session_create_packet_in_place(RtpSession *session, uint8_t *buffer, int size, void(*freefn)(void *))
Definition: rtpsession.c:841
ORTP_PUBLIC void rtp_session_enable_rtcp(RtpSession *session, bool_t yesno)
Definition: rtpsession.c:408
ORTP_PUBLIC void rtp_session_destroy(RtpSession *session)
Definition: rtpsession.c:1713
ORTP_PUBLIC void rtp_session_set_recv_profile(RtpSession *session, RtpProfile *profile)
Definition: rtpsession.c:462
ORTP_PUBLIC void rtp_session_get_last_recv_time(RtpSession *session, struct timeval *tv)
Definition: rtpsession.c:1804
ORTP_PUBLIC void rtp_session_set_rtp_socket_recv_buffer_size(RtpSession *session, unsigned int size)
Definition: rtpsession.c:524
ORTP_PUBLIC void rtp_session_reset(RtpSession *session)
Definition: rtpsession.c:1502
ORTP_PUBLIC int rtp_session_set_recv_payload_type(RtpSession *session, int pt)
Definition: rtpsession.c:713
ORTP_PUBLIC RtpProfile * rtp_session_get_recv_profile(RtpSession *session)
Definition: rtpsession.c:496
ORTP_PUBLIC void rtp_session_rtcp_set_delay_value(RtpSession *session, const unsigned int value)
For test purpose only, simulates a constant RTT (Round Trip Time) value by setting the LSR field with...
Definition: rtpsession.c:1586
ORTP_PUBLIC int rtp_session_signal_connect(RtpSession *session, const char *signal_name, RtpCallback cb, unsigned long user_data)
Definition: rtpsession.c:562
ORTP_PUBLIC void rtp_session_set_connected_mode(RtpSession *session, bool_t yesno)
Definition: rtpsession.c:1641
ORTP_PUBLIC void rtp_session_set_blocking_mode(RtpSession *session, int yesno)
Definition: rtpsession.c:374
ORTP_PUBLIC void rtp_session_register_event_queue(RtpSession *session, OrtpEvQueue *q)
Definition: rtpsession.c:1389
ORTP_PUBLIC void rtp_session_set_seq_number(RtpSession *session, uint16_t seq)
Definition: rtpsession.c:607
ORTP_PUBLIC void rtp_session_set_jitter_compensation(RtpSession *session, int milisec)
Definition: jitterctl.c:164
ORTP_PUBLIC void rtp_session_flush_sockets(RtpSession *session)
Definition: rtpsession_inet.c:939
ORTP_PUBLIC void * rtp_session_get_data(const RtpSession *session)
Definition: rtpsession.c:1609
ORTP_PUBLIC int rtp_session_send_with_ts(RtpSession *session, const uint8_t *buffer, int len, uint32_t userts)
Definition: rtpsession.c:972
ORTP_PUBLIC int rtp_session_get_multicast_ttl(RtpSession *session)
Definition: rtpsession_inet.c:495
ORTP_PUBLIC int rtp_session_set_local_addr(RtpSession *session, const char *addr, int rtp_port, int rtcp_port)
Definition: rtpsession_inet.c:321
ORTP_PUBLIC void rtp_session_resync(RtpSession *session)
Definition: rtpsession.c:1489
ORTP_PUBLIC int rtp_session_set_remote_addr(RtpSession *session, const char *addr, int port)
Definition: rtpsession_inet.c:753
ORTP_PUBLIC void rtp_session_set_send_profile(RtpSession *session, RtpProfile *profile)
Definition: rtpsession.c:444
ORTP_PUBLIC mblk_t * rtp_session_recvm_with_ts(RtpSession *session, uint32_t user_ts)
Definition: rtpsession.c:1056
ORTP_PUBLIC int rtp_session_recv_with_ts(RtpSession *session, uint8_t *buffer, int len, uint32_t ts, int *have_more)
Definition: rtpsession.c:1245
ORTP_PUBLIC void rtp_session_set_ssrc(RtpSession *session, uint32_t ssrc)
Definition: rtpsession.c:635
ORTP_PUBLIC uint32_t rtp_session_get_send_ssrc(RtpSession *session)
Definition: rtpsession.c:646
ORTP_PUBLIC mblk_t * rtp_session_create_packet(RtpSession *session, int header_size, const uint8_t *payload, int payload_size)
Definition: rtpsession.c:775
ORTP_PUBLIC int rtp_session_set_payload_type(RtpSession *session, int pt)
Definition: rtpsession.c:743
ORTP_PUBLIC int rtp_session_set_dscp(RtpSession *session, int dscp)
Definition: rtpsession_inet.c:586
ORTP_PUBLIC void rtp_session_set_time_jump_limit(RtpSession *session, int miliseconds)
Definition: rtpsession.c:1346
ORTP_PUBLIC mblk_t * rtp_session_create_packet_with_data(RtpSession *session, uint8_t *payload, int payload_size, void(*freefn)(void *))
Definition: rtpsession.c:809
ORTP_PUBLIC float rtp_session_get_round_trip_propagation(RtpSession *session)
Definition: rtpsession.c:1703
ORTP_PUBLIC int rtp_session_set_send_payload_type(RtpSession *session, int paytype)
Definition: rtpsession.c:686
ORTP_PUBLIC int rtp_session_get_dscp(const RtpSession *session)
Definition: rtpsession_inet.c:703
ORTP_PUBLIC void rtp_session_rtcp_set_lost_packet_value(RtpSession *session, const unsigned int value)
For test purpose only, sets a constant lost packet value within all RTCP output packets....
Definition: rtpsession.c:1548
ORTP_PUBLIC int rtp_session_get_local_port(const RtpSession *session)
Definition: rtpsession_inet.c:719
ORTP_PUBLIC int rtp_session_bye(RtpSession *session, const char *reason)
Definition: rtcp.c:468
ORTP_PUBLIC int rtp_session_get_multicast_loopback(RtpSession *session)
Definition: rtpsession_inet.c:571
ORTP_PUBLIC int rtp_session_get_send_payload_type(const RtpSession *session)
Definition: rtpsession.c:697
ORTP_PUBLIC void rtp_session_set_data(RtpSession *session, void *data)
Definition: rtpsession.c:1601
ORTP_PUBLIC int rtp_session_signal_disconnect_by_callback(RtpSession *session, const char *signal_name, RtpCallback cb)
Definition: rtpsession.c:586
ORTP_PUBLIC void rtp_session_set_profile(RtpSession *session, RtpProfile *profile)
Definition: rtpsession.c:393
ORTP_PUBLIC const jitter_stats_t * rtp_session_get_jitter_stats(const RtpSession *session)
Definition: rtpsession.c:1537
ORTP_PUBLIC void rtp_session_set_recv_buf_size(RtpSession *session, int bufsize)
Definition: rtpsession.c:508
ORTP_PUBLIC void rtp_session_set_source_description(RtpSession *session, const char *cname, const char *name, const char *email, const char *phone, const char *loc, const char *tool, const char *note)
Definition: rtcp.c:86
Sending and receiving multiple streams together with only one thread.
Definition: event.h:92
Definition: rtpsession.h:55
int max_size
Definition: rtpsession.h:58
int max_packets
Definition: rtpsession.h:61
int nom_size
Definition: rtpsession.h:57
int min_size
Definition: rtpsession.h:56
Definition: rtpsession.h:65
Definition: utils.h:32
Definition: rtpsession.h:109
Definition: rtpsession.h:102
Definition: rtpsession.h:170
Definition: rtpprofile.h:42
Definition: scheduler.h:28
Definition: rtpsession.h:202
Definition: rtpsignaltable.h:28
Definition: rtpsession.h:118
Definition: rtpsession.h:93
Definition: rtpsession.h:85
Definition: str_utils.h:149
Definition: str_utils.h:76
Definition: rtp.h:78
Definition: str_utils.h:50
Definition: rtp.h:64