diff options
author | Matthew Waters <matthew@centricular.com> | 2021-08-31 15:31:23 +1000 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-08-31 06:09:47 +0000 |
commit | e43bbaf3d97d0d85d01371fec68ae25f64aba393 (patch) | |
tree | f2d5c959bb15ef76f154700eecd3a09bd2b8a1dd | |
parent | 75c44583eeb0013b82d3bb8d4705e7468abba489 (diff) | |
download | gstreamer-plugins-base-e43bbaf3d97d0d85d01371fec68ae25f64aba393.tar.gz |
rtp: add some additional rtcp sdes values
Matches the current list at
https://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-5
as of 2021-September.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1267>
-rw-r--r-- | gst-libs/gst/rtp/gstrtcpbuffer.c | 42 | ||||
-rw-r--r-- | gst-libs/gst/rtp/gstrtcpbuffer.h | 76 | ||||
-rw-r--r-- | tests/check/libs/rtp.c | 20 |
3 files changed, 128 insertions, 10 deletions
diff --git a/gst-libs/gst/rtp/gstrtcpbuffer.c b/gst-libs/gst/rtp/gstrtcpbuffer.c index 876c4a9ef..5b5820779 100644 --- a/gst-libs/gst/rtp/gstrtcpbuffer.c +++ b/gst-libs/gst/rtp/gstrtcpbuffer.c @@ -2211,6 +2211,27 @@ gst_rtcp_sdes_type_to_name (GstRTCPSDESType type) case GST_RTCP_SDES_PRIV: result = "priv"; break; + case GST_RTCP_SDES_H323_CADDR: + result = "h323-caddr"; + break; + case GST_RTCP_SDES_APSI: + result = "apsi"; + break; + case GST_RTCP_SDES_RGRP: + result = "rgrp"; + break; + case GST_RTCP_SDES_REPAIRED_RTP_STREAM_ID: + result = "repaired-rtp-stream-id"; + break; + case GST_RTCP_SDES_CCID: + result = "ccid"; + break; + case GST_RTCP_SDES_RTP_STREAM_ID: + result = "rtp-stream-id"; + break; + case GST_RTCP_SDES_MID: + result = "mid"; + break; default: result = NULL; break; @@ -2255,6 +2276,27 @@ gst_rtcp_sdes_name_to_type (const gchar * name) if (strcmp ("note", name) == 0) return GST_RTCP_SDES_NOTE; + if (strcmp ("h323-caddr", name) == 0) + return GST_RTCP_SDES_H323_CADDR; + + if (strcmp ("apsi", name) == 0) + return GST_RTCP_SDES_APSI; + + if (strcmp ("rgrp", name) == 0) + return GST_RTCP_SDES_RGRP; + + if (strcmp ("rtp-stream-id", name) == 0) + return GST_RTCP_SDES_RTP_STREAM_ID; + + if (strcmp ("repaired-rtp-stream-id", name) == 0) + return GST_RTCP_SDES_REPAIRED_RTP_STREAM_ID; + + if (strcmp ("ccid", name) == 0) + return GST_RTCP_SDES_CCID; + + if (strcmp ("mid", name) == 0) + return GST_RTCP_SDES_MID; + return GST_RTCP_SDES_PRIV; } diff --git a/gst-libs/gst/rtp/gstrtcpbuffer.h b/gst-libs/gst/rtp/gstrtcpbuffer.h index 32291fa9d..3681c6d95 100644 --- a/gst-libs/gst/rtp/gstrtcpbuffer.h +++ b/gst-libs/gst/rtp/gstrtcpbuffer.h @@ -126,18 +126,74 @@ typedef enum * * Different types of SDES content. */ +/** + * GST_RTCP_SDES_H323_CADDR: + * + * H.323 callable address + * + * Since: 1.20: + */ +/** + * GST_RTCP_SDES_APSI: + * + * Application Specific Identifier (RFC6776) + * + * Since: 1.20: + */ +/** + * GST_RTCP_SDES_RGRP: + * + * Reporting Group Identifier (RFC8861) + * + * Since: 1.20: + */ +/** + * GST_RTCP_SDES_RTP_STREAM_ID: + * + * RtpStreamId SDES item (RFC8852). + * + * Since: 1.20: + */ +/** + * GST_RTCP_SDES_REPAIRED_RTP_STREAM_ID: + * + * RepairedRtpStreamId SDES item (RFC8852). + * + * Since: 1.20: + */ +/** + * GST_RTCP_SDES_CCID: + * + * CLUE CaptId (RFC8849) + * + * Since: 1.20: + */ +/** + * GST_RTCP_SDES_MID: + * + * MID SDES item (RFC8843). + * + * Since: 1.20: + */ typedef enum { - GST_RTCP_SDES_INVALID = -1, - GST_RTCP_SDES_END = 0, - GST_RTCP_SDES_CNAME = 1, - GST_RTCP_SDES_NAME = 2, - GST_RTCP_SDES_EMAIL = 3, - GST_RTCP_SDES_PHONE = 4, - GST_RTCP_SDES_LOC = 5, - GST_RTCP_SDES_TOOL = 6, - GST_RTCP_SDES_NOTE = 7, - GST_RTCP_SDES_PRIV = 8 + GST_RTCP_SDES_INVALID = -1, + GST_RTCP_SDES_END = 0, + GST_RTCP_SDES_CNAME = 1, + GST_RTCP_SDES_NAME = 2, + GST_RTCP_SDES_EMAIL = 3, + GST_RTCP_SDES_PHONE = 4, + GST_RTCP_SDES_LOC = 5, + GST_RTCP_SDES_TOOL = 6, + GST_RTCP_SDES_NOTE = 7, + GST_RTCP_SDES_PRIV = 8, + GST_RTCP_SDES_H323_CADDR = 9, + GST_RTCP_SDES_APSI = 10, + GST_RTCP_SDES_RGRP = 11, + GST_RTCP_SDES_RTP_STREAM_ID = 12, + GST_RTCP_SDES_REPAIRED_RTP_STREAM_ID = 13, + GST_RTCP_SDES_CCID = 14, + GST_RTCP_SDES_MID = 15, } GstRTCPSDESType; /** diff --git a/tests/check/libs/rtp.c b/tests/check/libs/rtp.c index d5879ca6b..029260d47 100644 --- a/tests/check/libs/rtp.c +++ b/tests/check/libs/rtp.c @@ -689,6 +689,25 @@ GST_START_TEST (test_rtp_seqnum_compare) GST_END_TEST; +GST_START_TEST (test_rtcp_sdes_type) +{ + GstRTCPSDESType i; + + for (i = 1; i < GST_RTCP_SDES_MID; i++) { + GstRTCPSDESType sdes_type; + const char *sdes_name; + + sdes_name = gst_rtcp_sdes_type_to_name (i); + GST_DEBUG ("%u (0x%x) -> \'%s\'", i, i, sdes_name); + fail_unless (sdes_name != NULL); + sdes_type = gst_rtcp_sdes_name_to_type (sdes_name); + + fail_unless_equals_int (sdes_type, i); + } +} + +GST_END_TEST; + GST_START_TEST (test_rtcp_buffer) { GstBuffer *buf; @@ -2229,6 +2248,7 @@ rtp_suite (void) //tcase_add_test (tc_chain, test_rtp_buffer_list_set_extension); tcase_add_test (tc_chain, test_rtp_seqnum_compare); + tcase_add_test (tc_chain, test_rtcp_sdes_type); tcase_add_test (tc_chain, test_rtcp_buffer); tcase_add_test (tc_chain, test_rtcp_reduced_buffer); tcase_add_test (tc_chain, test_rtcp_validate_with_padding); |