24 #include <ortp/port.h>
25 #include <ortp/str_utils.h>
28 #define UDP_MAX_SIZE 1500
29 #define RTP_FIXED_HEADER_SIZE 12
30 #define RTP_DEFAULT_JITTER_TIME 80
31 #define RTP_DEFAULT_MULTICAST_TTL 5
32 #define RTP_DEFAULT_MULTICAST_LOOPBACK 0
33 #define RTP_DEFAULT_DSCP 0x00
66 uint64_t packet_dup_sent;
69 uint64_t packet_dup_recv;
73 int64_t cum_packet_loss;
76 uint64_t sent_rtcp_packets;
84 uint64_t max_jitter_ts;
85 float jitter_buffer_size_ms;
88 #define RTP_TIMESTAMP_IS_NEWER_THAN(ts1,ts2) \
89 ((uint32_t)((uint32_t)(ts1) - (uint32_t)(ts2))< (uint32_t)(1<<31))
91 #define RTP_TIMESTAMP_IS_STRICTLY_NEWER_THAN(ts1,ts2) \
92 ( ((uint32_t)((uint32_t)(ts1) - (uint32_t)(ts2))< (uint32_t)(1<<31)) && (ts1)!=(ts2) )
94 #define RTP_SEQ_IS_STRICTLY_GREATER_THAN(seq1,seq2)\
95 (((uint16_t)((uint16_t)(seq1) - (uint16_t)(seq2))< (uint16_t)(1<<15)) && (seq1!=seq2))
97 #define TIME_IS_NEWER_THAN(t1,t2) RTP_TIMESTAMP_IS_NEWER_THAN(t1,t2)
99 #define TIME_IS_STRICTLY_NEWER_THAN(t1,t2) RTP_TIMESTAMP_IS_STRICTLY_NEWER_THAN(t1,t2)
108 #define rtp_set_markbit(mp,value) ((rtp_header_t*)((mp)->b_rptr))->markbit=(value)
109 #define rtp_set_seqnumber(mp,seq) ((rtp_header_t*)((mp)->b_rptr))->seq_number=(seq)
110 #define rtp_set_timestamp(mp,ts) ((rtp_header_t*)((mp)->b_rptr))->timestamp=(ts)
111 #define rtp_set_ssrc(mp,_ssrc) ((rtp_header_t*)((mp)->b_rptr))->ssrc=(_ssrc)
112 ORTP_PUBLIC
void rtp_add_csrc(
mblk_t *mp ,uint32_t csrc);
113 #define rtp_set_payload_type(mp,pt) ((rtp_header_t*)((mp)->b_rptr))->paytype=(pt)
115 #define rtp_get_markbit(mp) (((rtp_header_t*)((mp)->b_rptr))->markbit)
116 #define rtp_get_extbit(mp) (((rtp_header_t*)((mp)->b_rptr))->extbit)
117 #define rtp_get_timestamp(mp) (((rtp_header_t*)((mp)->b_rptr))->timestamp)
118 #define rtp_get_seqnumber(mp) (((rtp_header_t*)((mp)->b_rptr))->seq_number)
119 #define rtp_get_payload_type(mp) (((rtp_header_t*)((mp)->b_rptr))->paytype)
120 #define rtp_get_ssrc(mp) (((rtp_header_t*)((mp)->b_rptr))->ssrc)
121 #define rtp_get_cc(mp) (((rtp_header_t*)((mp)->b_rptr))->cc)
122 #define rtp_get_csrc(mp, idx) (((rtp_header_t*)((mp)->b_rptr))->csrc[idx])
124 ORTP_PUBLIC
int rtp_get_payload(
mblk_t *packet,
unsigned char **start);
125 ORTP_PUBLIC
int rtp_get_extheader(
mblk_t *packet, uint16_t *profile, uint8_t **start_ext);
Definition: str_utils.h:49