Commit d3409a23 authored by Sergio Ammirata's avatar Sergio Ammirata

Add support for sdes and other items needed by the RIST protocol

parent 4626b9f8
......@@ -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])
{
......
#ifndef __BITSTREAM_IETF_RTCP_SDES_H__
# define __BITSTREAM_IETF_RTCP_SDES_H__
# include <inttypes.h>
# include <bitstream/ietf/rtcp.h>
# 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__ */
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment