Bug 1474711: Added C++/Rust glue code for rtcp-fb transport-cc, r=bwc draft
authorJohannes Willbold <j.willbold@mozilla.com>
Wed, 11 Jul 2018 10:49:17 -0700
changeset 818876 1615700ac62ee5d61a26ad7234d42b82e4151109
parent 818682 2ed1506d1dc7db3d70a3feed95f1456bce05bbee
push id116385
push userbmo:johannes.willbold@rub.de
push dateMon, 16 Jul 2018 19:29:27 +0000
reviewersbwc
bugs1474711
milestone63.0a1
Bug 1474711: Added C++/Rust glue code for rtcp-fb transport-cc, r=bwc Added the C++/Rust glue code for the rtcp-fb transport-cc type. Extended the C++ unit test CheckRtcpFb Extended the Rust unit tests for rtcp-fb. MozReview-Commit-ID: 26hAexM0QeV
media/webrtc/signaling/gtest/sdp_unittests.cpp
media/webrtc/signaling/src/sdp/SdpAttribute.h
--- a/media/webrtc/signaling/gtest/sdp_unittests.cpp
+++ b/media/webrtc/signaling/gtest/sdp_unittests.cpp
@@ -3040,16 +3040,17 @@ const std::string kBasicAudioVideoDataOf
 "a=rtcp-fb:120 foo" CRLF // Should be ignored
 "a=rtcp-fb:126 nack" CRLF
 "a=rtcp-fb:126 nack pli" CRLF
 "a=rtcp-fb:126 ccm fir" CRLF
 "a=rtcp-fb:97 nack" CRLF
 "a=rtcp-fb:97 nack pli" CRLF
 "a=rtcp-fb:97 ccm fir" CRLF
 "a=rtcp-fb:* ccm tmmbr" CRLF
+"a=rtcp-fb:120 transport-cc" CRLF
 "a=setup:actpass" CRLF
 "a=rtcp-mux" CRLF
 "m=application 9 DTLS/SCTP 5000" CRLF
 "c=IN IP4 0.0.0.0" CRLF
 "a=sctpmap:5000 webrtc-datachannel 16" CRLF
 "a=setup:actpass" CRLF;
 
 TEST_P(NewSdpTest, BasicAudioVideoDataSdpParse) {
@@ -3126,17 +3127,23 @@ TEST_P(NewSdpTest, CheckExtmap) {
 TEST_P(NewSdpTest, CheckRtcpFb) {
   ParseSdp(kBasicAudioVideoDataOffer);
   ASSERT_TRUE(!!mSdp);
   ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections";
 
   auto& video_attrs = mSdp->GetMediaSection(1).GetAttributeList();
   ASSERT_TRUE(video_attrs.HasAttribute(SdpAttribute::kRtcpFbAttribute));
   auto& rtcpfbs = video_attrs.GetRtcpFb().mFeedbacks;
-  ASSERT_EQ(20U, rtcpfbs.size());
+
+  if (IsParsingWithSipccParser()) {
+    ASSERT_EQ(20U, rtcpfbs.size());
+  } else {
+    ASSERT_EQ(21U, rtcpfbs.size());
+  }
+
   CheckRtcpFb(rtcpfbs[0], "120", SdpRtcpFbAttributeList::kAck, "rpsi");
   CheckRtcpFb(rtcpfbs[1], "120", SdpRtcpFbAttributeList::kAck, "app", "foo");
   CheckRtcpFb(rtcpfbs[2], "120", SdpRtcpFbAttributeList::kNack, "");
   CheckRtcpFb(rtcpfbs[3], "120", SdpRtcpFbAttributeList::kNack, "sli");
   CheckRtcpFb(rtcpfbs[4], "120", SdpRtcpFbAttributeList::kNack, "pli");
   CheckRtcpFb(rtcpfbs[5], "120", SdpRtcpFbAttributeList::kNack, "rpsi");
   CheckRtcpFb(rtcpfbs[6], "120", SdpRtcpFbAttributeList::kNack, "app", "foo");
   CheckRtcpFb(rtcpfbs[7], "120", SdpRtcpFbAttributeList::kCcm, "fir");
@@ -3147,16 +3154,20 @@ TEST_P(NewSdpTest, CheckRtcpFb) {
   CheckRtcpFb(rtcpfbs[12], "120", SdpRtcpFbAttributeList::kRemb, "");
   CheckRtcpFb(rtcpfbs[13], "126", SdpRtcpFbAttributeList::kNack, "");
   CheckRtcpFb(rtcpfbs[14], "126", SdpRtcpFbAttributeList::kNack, "pli");
   CheckRtcpFb(rtcpfbs[15], "126", SdpRtcpFbAttributeList::kCcm, "fir");
   CheckRtcpFb(rtcpfbs[16], "97",  SdpRtcpFbAttributeList::kNack, "");
   CheckRtcpFb(rtcpfbs[17], "97",  SdpRtcpFbAttributeList::kNack, "pli");
   CheckRtcpFb(rtcpfbs[18], "97", SdpRtcpFbAttributeList::kCcm, "fir");
   CheckRtcpFb(rtcpfbs[19], "*", SdpRtcpFbAttributeList::kCcm, "tmmbr");
+
+  if (!IsParsingWithSipccParser()) {
+    CheckRtcpFb(rtcpfbs[20], "120", SdpRtcpFbAttributeList::kTransCC, "");
+  }
 }
 
 TEST_P(NewSdpTest, CheckRtcp) {
   ParseSdp(kBasicAudioVideoOffer);
   ASSERT_TRUE(!!mSdp);
   ASSERT_EQ(3U, mSdp->GetMediaSectionCount()) << "Wrong number of media sections";
 
   ASSERT_FALSE(mSdp->GetAttributeList().HasAttribute(
--- a/media/webrtc/signaling/src/sdp/SdpAttribute.h
+++ b/media/webrtc/signaling/src/sdp/SdpAttribute.h
@@ -1057,17 +1057,17 @@ public:
 //                       / SP token [SP byte-string]
 //                       / ; empty
 //
 class SdpRtcpFbAttributeList : public SdpAttribute
 {
 public:
   SdpRtcpFbAttributeList() : SdpAttribute(kRtcpFbAttribute) {}
 
-  enum Type { kAck, kApp, kCcm, kNack, kTrrInt, kRemb };
+  enum Type { kAck, kApp, kCcm, kNack, kTrrInt, kRemb, kTransCC };
 
   static const char* pli;
   static const char* sli;
   static const char* rpsi;
   static const char* app;
 
   static const char* fir;
   static const char* tmmbr;
@@ -1111,16 +1111,19 @@ inline std::ostream& operator<<(std::ost
       os << "nack";
       break;
     case SdpRtcpFbAttributeList::kTrrInt:
       os << "trr-int";
       break;
     case SdpRtcpFbAttributeList::kRemb:
       os << "goog-remb";
       break;
+    case SdpRtcpFbAttributeList::kTransCC:
+      os << "transport-cc";
+      break;
     default:
       MOZ_ASSERT(false);
       os << "?";
   }
   return os;
 }
 
 ///////////////////////////////////////////////////////////////////////////