[bTSstream-devel] [Git][videolan/bitstream][master] 2 commits: Add support for sdes and other items needed by the RIST protocol

Rafaël Carré gitlab at videolan.org
Wed Oct 31 13:59:37 CET 2018


Rafaël Carré pushed to branch master at VideoLAN / bitstream


Commits:
d3409a23 by Sergio Ammirata at 2018-10-31T11:55:24Z
Add support for sdes and other items needed by the RIST protocol

- - - - -
66f925a6 by Rafaël Carré at 2018-10-31T12:59:35Z
Merge branch 'master' into 'master'

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

See merge request videolan/bitstream!11
- - - - -


3 changed files:

- ietf/rtcp_fb.h
- + ietf/rtcp_sdes.h
- ietf/rtp.h


Changes:

=====================================
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])
 {


=====================================
ietf/rtcp_sdes.h
=====================================
@@ -0,0 +1,37 @@
+#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__ */


=====================================
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);



View it on GitLab: https://code.videolan.org/videolan/bitstream/compare/4626b9f8f3f2b423dd2e98dc227092e9305638ed...66f925a6c7bf0879f1d942328f3b131914b94648

-- 
View it on GitLab: https://code.videolan.org/videolan/bitstream/compare/4626b9f8f3f2b423dd2e98dc227092e9305638ed...66f925a6c7bf0879f1d942328f3b131914b94648
You're receiving this email because of your account on code.videolan.org.


More information about the biTStream-devel mailing list