|
@ -4,68 +4,24 @@ |
|
|
# include <inttypes.h> |
|
|
# include <inttypes.h> |
|
|
|
|
|
|
|
|
# define RTCP_RTP_VERSION 2 |
|
|
# define RTCP_RTP_VERSION 2 |
|
|
# define RTCP_PT_SR 200 |
|
|
|
|
|
|
|
|
|
|
|
static inline void rtcp_sr_set_rtp_version(uint8_t *p_rtcp_sr) |
|
|
|
|
|
|
|
|
static inline void rtcp_set_rtp_version(uint8_t *p_rtcp) |
|
|
{ |
|
|
{ |
|
|
p_rtcp_sr[0] = RTCP_RTP_VERSION << 6; |
|
|
|
|
|
|
|
|
p_rtcp[0] = RTCP_RTP_VERSION << 6; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static inline void rtcp_sr_set_pt(uint8_t *p_rtcp_sr) |
|
|
|
|
|
|
|
|
static inline void rtcp_set_pt(uint8_t *p_rtcp, uint8_t pt) |
|
|
{ |
|
|
{ |
|
|
p_rtcp_sr[1] = RTCP_PT_SR; |
|
|
|
|
|
|
|
|
p_rtcp[1] = pt; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static inline void rtcp_sr_set_length(uint8_t *p_rtcp_sr, |
|
|
|
|
|
|
|
|
static inline void rtcp_set_length(uint8_t *p_rtcp, |
|
|
uint16_t length) |
|
|
uint16_t length) |
|
|
{ |
|
|
{ |
|
|
p_rtcp_sr[2] = length >> 8; |
|
|
|
|
|
p_rtcp_sr[3] = length & 0xff; |
|
|
|
|
|
|
|
|
p_rtcp[2] = length >> 8; |
|
|
|
|
|
p_rtcp[3] = length & 0xff; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
static inline void rtcp_sr_set_ntp_time_msw(uint8_t *p_rtcp_sr, |
|
|
|
|
|
uint32_t ntp_time_msw) |
|
|
|
|
|
{ |
|
|
|
|
|
p_rtcp_sr[8] = (ntp_time_msw >> 24) & 0xff; |
|
|
|
|
|
p_rtcp_sr[9] = (ntp_time_msw >> 16) & 0xff; |
|
|
|
|
|
p_rtcp_sr[10] = (ntp_time_msw >> 8) & 0xff; |
|
|
|
|
|
p_rtcp_sr[11] = ntp_time_msw & 0xff; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static inline void rtcp_sr_set_ntp_time_lsw(uint8_t *p_rtcp_sr, |
|
|
|
|
|
uint32_t ntp_time_lsw) |
|
|
|
|
|
{ |
|
|
|
|
|
p_rtcp_sr[12] = (ntp_time_lsw >> 24) & 0xff; |
|
|
|
|
|
p_rtcp_sr[13] = (ntp_time_lsw >> 16) & 0xff; |
|
|
|
|
|
p_rtcp_sr[14] = (ntp_time_lsw >> 8) & 0xff; |
|
|
|
|
|
p_rtcp_sr[15] = ntp_time_lsw & 0xff; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static inline void rtcp_sr_set_rtp_time(uint8_t *p_rtcp_sr, |
|
|
|
|
|
uint32_t rtp_time) |
|
|
|
|
|
{ |
|
|
|
|
|
p_rtcp_sr[16] = (rtp_time >> 24) & 0xff; |
|
|
|
|
|
p_rtcp_sr[17] = (rtp_time >> 16) & 0xff; |
|
|
|
|
|
p_rtcp_sr[18] = (rtp_time >> 8) & 0xff; |
|
|
|
|
|
p_rtcp_sr[19] = rtp_time & 0xff; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static inline void rtcp_sr_set_packet_count(uint8_t *p_rtcp_sr, |
|
|
|
|
|
uint32_t packet_count) |
|
|
|
|
|
{ |
|
|
|
|
|
p_rtcp_sr[20] = (packet_count >> 24) & 0xff; |
|
|
|
|
|
p_rtcp_sr[21] = (packet_count >> 16) & 0xff; |
|
|
|
|
|
p_rtcp_sr[22] = (packet_count >> 8) & 0xff; |
|
|
|
|
|
p_rtcp_sr[23] = packet_count & 0xff; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static inline void rtcp_sr_set_octet_count(uint8_t *p_rtcp_sr, |
|
|
|
|
|
uint32_t octet_count) |
|
|
|
|
|
{ |
|
|
|
|
|
p_rtcp_sr[24] = (octet_count >> 24) & 0xff; |
|
|
|
|
|
p_rtcp_sr[25] = (octet_count >> 16) & 0xff; |
|
|
|
|
|
p_rtcp_sr[26] = (octet_count >> 8) & 0xff; |
|
|
|
|
|
p_rtcp_sr[27] = octet_count & 0xff; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
# include <bitstream/ietf/rtcp_sr.h> |
|
|
|
|
|
|
|
|
#endif /* !__BITSTREAM_IETF_RTCP_H__ */ |
|
|
#endif /* !__BITSTREAM_IETF_RTCP_H__ */ |