oRTP  0.23.0
rtpsession_priv.h
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 
20 #ifndef rtpsession_priv_h
21 #define rtpsession_priv_h
22 
23 #include "ortp/rtpsession.h"
24 
25 typedef enum {
26  RTP_SESSION_RECV_SYNC=1, /* the rtp session is synchronising in the incoming stream */
27  RTP_SESSION_FIRST_PACKET_DELIVERED=1<<1,
28  RTP_SESSION_SCHEDULED=1<<2,/* the scheduler controls this session*/
29  RTP_SESSION_BLOCKING_MODE=1<<3, /* in blocking mode */
30  RTP_SESSION_RECV_NOT_STARTED=1<<4, /* the application has not started to try to recv */
31  RTP_SESSION_SEND_NOT_STARTED=1<<5, /* the application has not started to send something */
32  RTP_SESSION_IN_SCHEDULER=1<<6, /* the rtp session is in the scheduler list */
33  RTP_SESSION_USING_EXT_SOCKETS=1<<7, /* the session is using externaly supplied sockets */
34  RTP_SOCKET_CONNECTED=1<<8,
35  RTCP_SOCKET_CONNECTED=1<<9,
36  RTP_SESSION_USING_TRANSPORT=1<<10,
37  RTCP_OVERRIDE_LOST_PACKETS=1<11,
38  RTCP_OVERRIDE_JITTER=1<<12,
39  RTCP_OVERRIDE_DELAY=1<<13
40 }RtpSessionFlags;
41 
42 #define rtp_session_using_transport(s, stream) (((s)->flags & RTP_SESSION_USING_TRANSPORT) && (s->stream.tr != 0))
43 
44 int rtp_session_rtp_recv_abstract(ortp_socket_t socket, mblk_t *msg, int flags, struct sockaddr *from, socklen_t *fromlen);
45 
46 void rtp_session_update_payload_type(RtpSession * session, int pt);
47 void rtp_putq(queue_t *q, mblk_t *mp);
48 mblk_t * rtp_getq(queue_t *q, uint32_t ts, int *rejected);
49 int rtp_session_rtp_recv(RtpSession * session, uint32_t ts);
50 int rtp_session_rtcp_recv(RtpSession * session);
51 int rtp_session_rtp_send (RtpSession * session, mblk_t * m);
52 int rtp_session_rtcp_send (RtpSession * session, mblk_t * m);
53 
54 void rtp_session_rtp_parse(RtpSession *session, mblk_t *mp, uint32_t local_str_ts, struct sockaddr *addr, socklen_t addrlen);
55 void rtp_session_rtcp_parse(RtpSession *session, mblk_t *mp);
56 
57 mblk_t * rtp_session_network_simulate(RtpSession *session, mblk_t *input);
58 void ortp_network_simulator_destroy(OrtpNetworkSimulatorCtx *sim);
59 
60 #endif
_PayloadType::channels
int channels
Definition: payloadtype.h:63
rtp_session_get_recv_payload_type
ORTP_PUBLIC int rtp_session_get_recv_payload_type(const RtpSession *session)
Definition: rtpsession.c:730
_OrtpMemoryFunctions
Definition: port.h:274
rtp_session_enable_rtcp
ORTP_PUBLIC void rtp_session_enable_rtcp(RtpSession *session, bool_t yesno)
Definition: rtpsession.c:408
_queue
Definition: str_utils.h:75
rtp_session_get_recv_ssrc
ORTP_PUBLIC uint32_t rtp_session_get_recv_ssrc(RtpSession *session)
Definition: rtpsession.c:656
rtp_session_resync
ORTP_PUBLIC void rtp_session_resync(RtpSession *session)
Definition: rtpsession.c:1489
rtcp_app
Definition: rtcp.h:193
rtcp_common_header
Definition: rtcp.h:48
rtp_session_reset
ORTP_PUBLIC void rtp_session_reset(RtpSession *session)
Definition: rtpsession.c:1502
rtp_session_set_multicast_ttl
ORTP_PUBLIC int rtp_session_set_multicast_ttl(RtpSession *session, int ttl)
Definition: rtpsession_inet.c:441
rtp_session_get_multicast_loopback
ORTP_PUBLIC int rtp_session_get_multicast_loopback(RtpSession *session)
Definition: rtpsession_inet.c:571
rtp_session_signal_disconnect_by_callback
ORTP_PUBLIC int rtp_session_signal_disconnect_by_callback(RtpSession *session, const char *signal_name, RtpCallback cb)
Definition: rtpsession.c:586
rtp_session_set_seq_number
ORTP_PUBLIC void rtp_session_set_seq_number(RtpSession *session, uint16_t seq)
Definition: rtpsession.c:607
rtp_session_set_profile
ORTP_PUBLIC void rtp_session_set_profile(RtpSession *session, RtpProfile *profile)
Definition: rtpsession.c:393
rtp_session_pick_with_cseq
ORTP_PUBLIC mblk_t * rtp_session_pick_with_cseq(RtpSession *session, const uint16_t sequence_number)
Definition: rtpsession.c:1013
_OList
Definition: utils.h:32
ortp_min_version_required
ORTP_PUBLIC bool_t ortp_min_version_required(int major, int minor, int micro)
Definition: ortp.c:201
rtp_session_set_pktinfo
ORTP_PUBLIC int rtp_session_set_pktinfo(RtpSession *session, int activate)
Definition: rtpsession_inet.c:379
rtp_session_get_send_payload_type
ORTP_PUBLIC int rtp_session_get_send_payload_type(const RtpSession *session)
Definition: rtpsession.c:697
rtp_stats_display
ORTP_PUBLIC void rtp_stats_display(const rtp_stats_t *stats, const char *header)
Definition: ortp.c:166
sdes_chunk
Definition: rtcp.h:142
rtp_session_set_symmetric_rtp
ORTP_PUBLIC void rtp_session_set_symmetric_rtp(RtpSession *session, bool_t yesno)
Definition: rtpsession.c:1623
ortp.h
General purpose library functions.
rtp_session_rtcp_set_lost_packet_value
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
ortpTimeSpec
Definition: port.h:258
payloadtype.h
Definition of payload types.
rtp_profile_clear_all
ORTP_PUBLIC void rtp_profile_clear_all(RtpProfile *prof)
Definition: rtpprofile.c:166
rtp_session_send_telephone_events_supported
ORTP_PUBLIC int rtp_session_send_telephone_events_supported(RtpSession *session)
Definition: telephonyevents.c:61
ortp_global_stats_display
ORTP_PUBLIC void ortp_global_stats_display(void)
Definition: ortp.c:155
rtp_session_get_current_recv_ts
ORTP_PUBLIC uint32_t rtp_session_get_current_recv_ts(RtpSession *session)
Definition: rtpsession.c:1319
rtp_session_set_scheduling_mode
ORTP_PUBLIC void rtp_session_set_scheduling_mode(RtpSession *session, int yesno)
Definition: rtpsession.c:339
msgb
Definition: str_utils.h:49
rtp_session_get_multicast_ttl
ORTP_PUBLIC int rtp_session_get_multicast_ttl(RtpSession *session)
Definition: rtpsession_inet.c:495
rtcp_rr
Definition: rtcp.h:187
rtp_session_get_rcv_ext_seq_number
ORTP_PUBLIC uint32_t rtp_session_get_rcv_ext_seq_number(RtpSession *session)
Definition: rtpsession.c:622
rtp_session_sendm_with_ts
ORTP_PUBLIC int rtp_session_sendm_with_ts(RtpSession *session, mblk_t *mp, uint32_t userts)
Definition: rtpsession.c:952
_RtpTransport
Definition: rtpsession.h:92
_RtcpStream
Definition: rtpsession.h:169
rtp_session_rtcp_set_jitter_value
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
rtp_session_get_recv_profile
ORTP_PUBLIC RtpProfile * rtp_session_get_recv_profile(RtpSession *session)
Definition: rtpsession.c:496
payload_type_set_recv_fmtp
ORTP_PUBLIC void payload_type_set_recv_fmtp(PayloadType *pt, const char *fmtp)
Definition: payloadtype.c:73
rtp_session_set_recv_buf_size
ORTP_PUBLIC void rtp_session_set_recv_buf_size(RtpSession *session, int bufsize)
Definition: rtpsession.c:508
_PayloadType::clock_rate
int clock_rate
Definition: payloadtype.h:56
rtp_session_set_payload_type
ORTP_PUBLIC int rtp_session_set_payload_type(RtpSession *session, int pt)
Definition: rtpsession.c:743
rtp_session_create_packet
ORTP_PUBLIC mblk_t * rtp_session_create_packet(RtpSession *session, int header_size, const uint8_t *payload, int payload_size)
Definition: rtpsession.c:775
rtp_session_set_remote_addr_full
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
rtp_session_get_round_trip_propagation
ORTP_PUBLIC float rtp_session_get_round_trip_propagation(RtpSession *session)
Definition: rtpsession.c:1703
session_set_clr
#define session_set_clr(ss, rtpsession)
Definition: sessionset.h:121
rtp_session_set_remote_addr
ORTP_PUBLIC int rtp_session_set_remote_addr(RtpSession *session, const char *addr, int port)
Definition: rtpsession_inet.c:753
rtp_session_bye
ORTP_PUBLIC int rtp_session_bye(RtpSession *session, const char *reason)
Definition: rtcp.c:468
payload_type_set_send_fmtp
ORTP_PUBLIC void payload_type_set_send_fmtp(PayloadType *pt, const char *fmtp)
Definition: payloadtype.c:86
_JBParameters::nom_size
int nom_size
Definition: rtpsession.h:57
jitter_stats
Definition: rtp.h:77
rtp_session_set_ssrc
ORTP_PUBLIC void rtp_session_set_ssrc(RtpSession *session, uint32_t ssrc)
Definition: rtpsession.c:635
rtp_session_get_send_profile
ORTP_PUBLIC RtpProfile * rtp_session_get_send_profile(RtpSession *session)
Definition: rtpsession.c:486
rtpsession.h
The RtpSession api.
rtp_session_set_local_addr
ORTP_PUBLIC int rtp_session_set_local_addr(RtpSession *session, const char *addr, int rtp_port, int rtcp_port)
Definition: rtpsession_inet.c:321
rtp_session_set_send_payload_type
ORTP_PUBLIC int rtp_session_set_send_payload_type(RtpSession *session, int paytype)
Definition: rtpsession.c:686
rtp_session_set_multicast_loopback
ORTP_PUBLIC int rtp_session_set_multicast_loopback(RtpSession *session, int yesno)
Definition: rtpsession_inet.c:511
rtp_session_get_local_port
ORTP_PUBLIC int rtp_session_get_local_port(const RtpSession *session)
Definition: rtpsession_inet.c:719
_JBParameters::min_size
int min_size
Definition: rtpsession.h:56
rtp_session_set_rtp_socket_recv_buffer_size
ORTP_PUBLIC void rtp_session_set_rtp_socket_recv_buffer_size(RtpSession *session, unsigned int size)
Definition: rtpsession.c:524
_PayloadType
Definition: payloadtype.h:53
_PayloadType::mime_type
char * mime_type
Definition: payloadtype.h:62
rtp_session_set_source_description
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
_RtpScheduler
Definition: scheduler.h:28
rtp_session_get_profile
ORTP_PUBLIC RtpProfile * rtp_session_get_profile(RtpSession *session)
Definition: rtpsession.c:475
rtp_profile_set_name
ORTP_PUBLIC void rtp_profile_set_name(RtpProfile *prof, const char *name)
Definition: rtpprofile.c:180
_JBParameters
Definition: rtpsession.h:55
rtp_session_set_ssrc_changed_threshold
ORTP_PUBLIC void rtp_session_set_ssrc_changed_threshold(RtpSession *session, int numpackets)
Definition: rtpsession.c:1479
rtp_session_rtcp_set_delay_value
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
telephonyevents.h
Receiving and sending telephone events (RFC2833)
ortp_scheduler_init
ORTP_PUBLIC void ortp_scheduler_init(void)
Definition: ortp.c:104
_JBParameters::max_packets
int max_packets
Definition: rtpsession.h:61
sender_info
Definition: rtcp.h:79
_RtpSession
Definition: rtpsession.h:201
rtp_session_telephone_events_supported
ORTP_PUBLIC int rtp_session_telephone_events_supported(RtpSession *session)
Definition: telephonyevents.c:44
_PayloadType::type
int type
Definition: payloadtype.h:55
payload_type_destroy
ORTP_PUBLIC void payload_type_destroy(PayloadType *pt)
Definition: payloadtype.c:124
rtp_stats
Definition: rtp.h:63
rtp_session_set_recv_profile
ORTP_PUBLIC void rtp_session_set_recv_profile(RtpSession *session, RtpProfile *profile)
Definition: rtpsession.c:462
_RtpTimer
Definition: rtptimer.h:35
poly32_t
Definition: utils.h:62
report_block
Definition: rtcp.h:96
_OrtpEventData
Definition: event.h:44
rtp_session_get_data
ORTP_PUBLIC void * rtp_session_get_data(const RtpSession *session)
Definition: rtpsession.c:1609
b64_decode
size_t b64_decode(char const *src, size_t srcLen, void *dest, size_t destSize)
Decodes a sequence of Base-64 into a block of binary data.
Definition: b64.c:477
session_set_set
#define session_set_set(ss, rtpsession)
Definition: sessionset.h:104
rtp_session_get_send_ssrc
ORTP_PUBLIC uint32_t rtp_session_get_send_ssrc(RtpSession *session)
Definition: rtpsession.c:646
OrtpEvQueue
Definition: event.h:92
rtp_session_get_current_send_ts
ORTP_PUBLIC uint32_t rtp_session_get_current_send_ts(RtpSession *session)
Definition: rtpsession.c:1293
rtp_session_set_recv_payload_type
ORTP_PUBLIC int rtp_session_set_recv_payload_type(RtpSession *session, int pt)
Definition: rtpsession.c:713
rtp_session_signal_connect
ORTP_PUBLIC int rtp_session_signal_connect(RtpSession *session, const char *signal_name, RtpCallback cb, unsigned long user_data)
Definition: rtpsession.c:562
rtp_session_new
ORTP_PUBLIC RtpSession * rtp_session_new(int mode)
Definition: rtpsession.c:312
rtp_session_set_connected_mode
ORTP_PUBLIC void rtp_session_set_connected_mode(RtpSession *session, bool_t yesno)
Definition: rtpsession.c:1641
ortp_init
ORTP_PUBLIC void ortp_init(void)
Definition: ortp.c:80
rtp_session_recvm_with_ts
ORTP_PUBLIC mblk_t * rtp_session_recvm_with_ts(RtpSession *session, uint32_t user_ts)
Definition: rtpsession.c:1056
rtp_session_get_seq_number
ORTP_PUBLIC uint16_t rtp_session_get_seq_number(RtpSession *session)
Definition: rtpsession.c:615
rtp_session_get_last_recv_time
ORTP_PUBLIC void rtp_session_get_last_recv_time(RtpSession *session, struct timeval *tv)
Definition: rtpsession.c:1804
logging.h
Logging API.
rtp_session_set_rtcp_report_interval
ORTP_PUBLIC void rtp_session_set_rtcp_report_interval(RtpSession *session, int value_ms)
Definition: rtpsession.c:416
rtp_session_get_stats
const ORTP_PUBLIC rtp_stats_t * rtp_session_get_stats(const RtpSession *session)
Definition: rtpsession.c:1530
rtp_session_recv_with_ts
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
rtp_session_destroy
ORTP_PUBLIC void rtp_session_destroy(RtpSession *session)
Definition: rtpsession.c:1713
_RtpStream
Definition: rtpsession.h:117
rtcp_bye
Definition: rtcp.h:170
rtp_session_create_packet_with_data
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
rtcp_sr
Definition: rtcp.h:180
rtp_profile_set_payload
ORTP_PUBLIC void rtp_profile_set_payload(RtpProfile *prof, int idx, PayloadType *pt)
Definition: rtpprofile.c:153
sdes_item
Definition: rtcp.h:150
_OrtpNetworkSimulatorCtx
Definition: rtpsession.h:109
rtp_session_release_sockets
ORTP_PUBLIC void rtp_session_release_sockets(RtpSession *session)
Definition: rtpsession.c:1357
rtp_session_set_time_jump_limit
ORTP_PUBLIC void rtp_session_set_time_jump_limit(RtpSession *session, int miliseconds)
Definition: rtpsession.c:1346
ortp_exit
ORTP_PUBLIC void ortp_exit(void)
Definition: ortp.c:129
_WaitPoint
Definition: rtpsession.h:84
rtp_session_get_dscp
ORTP_PUBLIC int rtp_session_get_dscp(const RtpSession *session)
Definition: rtpsession_inet.c:703
_RtpSignalTable
Definition: rtpsignaltable.h:27
rtp_session_register_event_queue
ORTP_PUBLIC void rtp_session_register_event_queue(RtpSession *session, OrtpEvQueue *q)
Definition: rtpsession.c:1389
rtp_session_recv_telephone_events_supported
ORTP_PUBLIC int rtp_session_recv_telephone_events_supported(RtpSession *session)
Definition: telephonyevents.c:75
fmtp_get_value
ORTP_PUBLIC bool_t fmtp_get_value(const char *fmtp, const char *param_name, char *result, size_t result_len)
Definition: payloadtype.c:143
rtp_session_set_send_profile
ORTP_PUBLIC void rtp_session_set_send_profile(RtpSession *session, RtpProfile *profile)
Definition: rtpsession.c:444
rtp_session_set_rtp_socket_send_buffer_size
ORTP_PUBLIC void rtp_session_set_rtp_socket_send_buffer_size(RtpSession *session, unsigned int size)
Definition: rtpsession.c:516
rtp_session_flush_sockets
ORTP_PUBLIC void rtp_session_flush_sockets(RtpSession *session)
Definition: rtpsession_inet.c:939
rtp_session_create_packet_in_place
ORTP_PUBLIC mblk_t * rtp_session_create_packet_in_place(RtpSession *session, uint8_t *buffer, int size, void(*freefn)(void *))
Definition: rtpsession.c:841
rtp_session_get_jitter_stats
const ORTP_PUBLIC jitter_stats_t * rtp_session_get_jitter_stats(const RtpSession *session)
Definition: rtpsession.c:1537
rtp_session_set_dscp
ORTP_PUBLIC int rtp_session_set_dscp(RtpSession *session, int dscp)
Definition: rtpsession_inet.c:586
rtp_session_set_data
ORTP_PUBLIC void rtp_session_set_data(RtpSession *session, void *data)
Definition: rtpsession.c:1601
rtp_header
Definition: rtp.h:37
rtp_session_send_with_ts
ORTP_PUBLIC int rtp_session_send_with_ts(RtpSession *session, const uint8_t *buffer, int len, uint32_t userts)
Definition: rtpsession.c:972
_RtpProfile
Definition: rtpprofile.h:41
rtp_session_set_blocking_mode
ORTP_PUBLIC void rtp_session_set_blocking_mode(RtpSession *session, int yesno)
Definition: rtpsession.c:374
_JBParameters::max_size
int max_size
Definition: rtpsession.h:58