diff --git a/ietf/rtcp_fb.h b/ietf/rtcp_fb.h index 9ac5ebc..25a16a7 100644 --- a/ietf/rtcp_fb.h +++ b/ietf/rtcp_fb.h @@ -30,6 +30,19 @@ static inline void rtcp_fb_set_ssrc_pkt_sender(uint8_t *p_rtcp_fb, p_rtcp_fb[7] = pi_ssrc[3]; } +static inline void rtcp_fb_set_int_ssrc_pkt_sender(uint8_t *p_rtcp_fb, uint32_t i_ssrc) +{ + p_rtcp_fb[4] = (i_ssrc >> 24) & 0xff; + p_rtcp_fb[5] = (i_ssrc >> 16) & 0xff; + p_rtcp_fb[6] = (i_ssrc >> 8) & 0xff; + p_rtcp_fb[7] = i_ssrc & 0xff; +} + +static inline uint32_t rtcp_fb_get_int_ssrc_pkt_sender(const uint8_t *p_rtcp_fb) +{ + return (p_rtcp_fb[4] << 24) | (p_rtcp_fb[5] << 16) | (p_rtcp_fb[6] << 8) | p_rtcp_fb[7]; +} + static inline void rtcp_fb_set_ssrc_media_src(uint8_t *p_rtcp_fb, const uint8_t pi_ssrc[4]) { diff --git a/ietf/rtcp_sdes.h b/ietf/rtcp_sdes.h new file mode 100644 index 0000000..9061c96 --- /dev/null +++ b/ietf/rtcp_sdes.h @@ -0,0 +1,37 @@ +#ifndef __BITSTREAM_IETF_RTCP_SDES_H__ +# define __BITSTREAM_IETF_RTCP_SDES_H__ + +# include +# include + +# define RTCP_SDES_SIZE 10 + +# define RTCP_PT_SDES 202 + +static inline void rtcp_sdes_set_pt(uint8_t *p_rtcp_rr) +{ + rtcp_set_pt(p_rtcp_rr, RTCP_PT_SDES); +} + +static inline uint8_t rtcp_sdes_get_cname(const uint8_t *p_rtcp_sdes) +{ + return p_rtcp_sdes[8]; +} + +static inline void rtcp_sdes_set_cname(uint8_t *p_rtcp_sdes, uint8_t cname) +{ + p_rtcp_sdes[8] = cname; +} + +static inline int8_t rtcp_sdes_get_name_length(const uint8_t *p_rtcp_sdes) +{ + return p_rtcp_sdes[9]; +} + +static inline void rtcp_sdes_set_name_length(uint8_t *p_rtcp_sdes, + int8_t name_length) +{ + p_rtcp_sdes[9] = name_length; +} + +#endif /* !__BITSTREAM_IETF_RTCP_SDES_H__ */ diff --git a/ietf/rtp.h b/ietf/rtp.h index 88cd2a8..6c69015 100644 --- a/ietf/rtp.h +++ b/ietf/rtp.h @@ -168,6 +168,19 @@ static inline void rtp_get_ssrc(const uint8_t *p_rtp, uint8_t pi_ssrc[4]) pi_ssrc[3] = p_rtp[11]; } +static inline void rtp_set_int_ssrc(uint8_t *p_rtp, uint32_t i_ssrc) +{ + p_rtp[8] = (i_ssrc >> 24) & 0xff; + p_rtp[9] = (i_ssrc >> 16) & 0xff; + p_rtp[10] = (i_ssrc >> 8) & 0xff; + p_rtp[11] = i_ssrc & 0xff; +} + +static inline uint32_t rtp_get_int_ssrc(const uint8_t *p_rtp) +{ + return (p_rtp[8] << 24) | (p_rtp[9] << 16) | (p_rtp[10] << 8) | p_rtp[11]; +} + static inline uint8_t *rtp_extension(uint8_t *p_rtp) { return p_rtp + RTP_HEADER_SIZE + 4 * rtp_get_cc(p_rtp);