24 #include <ortp/port.h> 26 #define RTCP_MAX_RECV_BUFSIZE 1500 28 #define RTCP_SENDER_INFO_SIZE 20 29 #define RTCP_REPORT_BLOCK_SIZE 24 30 #define RTCP_COMMON_HEADER_SIZE 4 31 #define RTCP_SSRC_FIELD_SIZE 4 54 uint16_t packet_type:8;
59 uint16_t packet_type:8;
64 #define rtcp_common_header_set_version(ch,v) (ch)->version=v 65 #define rtcp_common_header_set_padbit(ch,p) (ch)->padbit=p 66 #define rtcp_common_header_set_rc(ch,rc) (ch)->rc=rc 67 #define rtcp_common_header_set_packet_type(ch,pt) (ch)->packet_type=pt 68 #define rtcp_common_header_set_length(ch,l) (ch)->length=htons(l) 70 #define rtcp_common_header_get_version(ch) ((ch)->version) 71 #define rtcp_common_header_get padbit(ch) ((ch)->padbit) 72 #define rtcp_common_header_get_rc(ch) ((ch)->rc) 73 #define rtcp_common_header_get_packet_type(ch) ((ch)->packet_type) 74 #define rtcp_common_header_get_length(ch) ntohs((ch)->length) 81 uint32_t ntp_timestamp_msw;
82 uint32_t ntp_timestamp_lsw;
83 uint32_t rtp_timestamp;
84 uint32_t senders_packet_count;
85 uint32_t senders_octet_count;
88 uint64_t sender_info_get_ntp_timestamp(
const sender_info_t *si);
89 #define sender_info_get_rtp_timestamp(si) ((si)->rtp_timestamp) 90 #define sender_info_get_packet_count(si) \ 91 ntohl((si)->senders_packet_count) 92 #define sender_info_get_octet_count(si) \ 93 ntohl((si)->senders_octet_count) 100 uint32_t ext_high_seq_num_rec;
101 uint32_t interarrival_jitter;
103 uint32_t delay_snc_last_sr;
106 #define report_block_get_ssrc(rb) \ 108 #define report_block_get_fraction_lost(rb) \ 109 (((uint32_t)ntohl((rb)->fl_cnpl))>>24) 110 #define report_block_get_cum_packet_loss(rb) \ 111 (((uint32_t)ntohl((rb)->fl_cnpl)) & 0xFFFFFF) 112 #define report_block_get_high_ext_seq(rb) \ 113 ntohl(((report_block_t*)(rb))->ext_high_seq_num_rec) 114 #define report_block_get_interarrival_jitter(rb) \ 115 ntohl(((report_block_t*)(rb))->interarrival_jitter) 116 #define report_block_get_last_SR_time(rb) \ 117 ntohl(((report_block_t*)(rb))->lsr) 118 #define report_block_get_last_SR_delay(rb) \ 119 ntohl(((report_block_t*)(rb))->delay_snc_last_sr) 121 #define report_block_set_fraction_lost(rb,fl)\ 122 ((rb)->fl_cnpl)=htonl( (ntohl((rb)->fl_cnpl) & 0xFFFFFF) | (((fl) & 0xFF)<<24)) 124 #define report_block_set_cum_packet_lost(rb,cpl)\ 125 ((rb)->fl_cnpl)=htonl( (ntohl((rb)->fl_cnpl) & 0xFF000000) | (((cpl) & 0xFFFFFF))) 148 #define sdes_chunk_get_csrc(c) ntohl((c)->csrc) 157 #define RTCP_SDES_MAX_STRING_SIZE 255 158 #define RTCP_SDES_ITEM_HEADER_SIZE 2 159 #define RTCP_SDES_CHUNK_DEFAULT_SIZE 1024 160 #define RTCP_SDES_CHUNK_HEADER_SIZE (sizeof(sdes_chunk_t)) 175 #define RTCP_BYE_HEADER_SIZE sizeof(rtcp_bye_t) 176 #define RTCP_BYE_REASON_MAX_STRING_SIZE 255 200 ORTP_PUBLIC
void rtp_session_rtcp_process_send(
struct _RtpSession *s);
201 ORTP_PUBLIC
void rtp_session_rtcp_process_recv(
struct _RtpSession *s);
204 #define RTCP_DEFAULT_REPORT_INTERVAL 5000 211 ORTP_PUBLIC bool_t rtcp_next_packet(
mblk_t *m);
213 ORTP_PUBLIC
void rtcp_rewind(
mblk_t *m);
219 ORTP_PUBLIC bool_t rtcp_is_SR(
const mblk_t *m);
220 ORTP_PUBLIC uint32_t rtcp_SR_get_ssrc(
const mblk_t *m);
225 ORTP_PUBLIC bool_t rtcp_is_RR(
const mblk_t *m);
226 ORTP_PUBLIC uint32_t rtcp_RR_get_ssrc(
const mblk_t *m);
230 ORTP_PUBLIC bool_t rtcp_is_SDES(
const mblk_t *m);
231 typedef void (*SdesItemFoundCallback)(
void *user_data, uint32_t csrc, rtcp_sdes_type_t t,
const char *content, uint8_t content_len);
232 ORTP_PUBLIC
void rtcp_sdes_parse(
const mblk_t *m, SdesItemFoundCallback cb,
void *user_data);
235 ORTP_PUBLIC bool_t rtcp_is_BYE(
const mblk_t *m);
236 ORTP_PUBLIC bool_t rtcp_BYE_get_ssrc(
const mblk_t *m,
int idx, uint32_t *ssrc);
237 ORTP_PUBLIC bool_t rtcp_BYE_get_reason(
const mblk_t *m,
const char **reason,
int *reason_len);
240 ORTP_PUBLIC bool_t rtcp_is_APP(
const mblk_t *m);
241 ORTP_PUBLIC
int rtcp_APP_get_subtype(
const mblk_t *m);
242 ORTP_PUBLIC uint32_t rtcp_APP_get_ssrc(
const mblk_t *m);
244 ORTP_PUBLIC
void rtcp_APP_get_name(
const mblk_t *m,
char *name);
246 ORTP_PUBLIC
void rtcp_APP_get_data(
const mblk_t *m, uint8_t **data,
int *len);
Definition: rtpsession.h:201
Definition: str_utils.h:49