Bug 1225877 - Part 1: Parse simulcast without rid= or pt= r=mjf
authorByron Campen [:bwc] <docfaraday@gmail.com>
Tue, 23 Apr 2019 12:43:21 +0000
changeset 470477 1fb8d0d598d0c4c681320bb0ee0dfafecb3caad9
parent 470476 17c6c03c439e2e4b99dbe53414a4c96c56741528
child 470478 f987a04773cf19f1f8acf0d87c36dc45e44f586c
push id35906
push useraciure@mozilla.com
push dateTue, 23 Apr 2019 22:14:56 +0000
treeherdermozilla-central@0ce3633f8b80 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmjf
bugs1225877
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1225877 - Part 1: Parse simulcast without rid= or pt= r=mjf Differential Revision: https://phabricator.services.mozilla.com/D28244
media/webrtc/signaling/src/sdp/SdpAttribute.cpp
media/webrtc/signaling/src/sdp/SdpAttribute.h
--- a/media/webrtc/signaling/src/sdp/SdpAttribute.cpp
+++ b/media/webrtc/signaling/src/sdp/SdpAttribute.cpp
@@ -1124,19 +1124,23 @@ void SdpSimulcastAttribute::Versions::Se
     }
     os << semic;
     version.Serialize(os);
   }
 }
 
 bool SdpSimulcastAttribute::Versions::Parse(std::istream& is,
                                             std::string* error) {
+  int startPos = is.tellg();
   std::string rawType = ParseKey(is, error);
   if (rawType.empty()) {
-    return false;
+    // New simulcast format does not have pt= or rid=, it is always rid
+    rawType = "rid";
+    is.clear();
+    is.seekg(startPos);
   }
 
   if (rawType == "pt") {
     type = kPt;
   } else if (rawType == "rid") {
     type = kRid;
   } else {
     *error = "Unknown simulcast identification type ";
--- a/media/webrtc/signaling/src/sdp/SdpAttribute.h
+++ b/media/webrtc/signaling/src/sdp/SdpAttribute.h
@@ -1500,26 +1500,39 @@ inline std::ostream& operator<<(std::ost
       break;
     default:
       MOZ_ASSERT(false);
       os << "?";
   }
   return os;
 }
 
+// Old draft-04
 // sc-attr     = "a=simulcast:" 1*2( WSP sc-str-list ) [WSP sc-pause-list]
 // sc-str-list = sc-dir WSP sc-id-type "=" sc-alt-list *( ";" sc-alt-list )
 // sc-pause-list = "paused=" sc-alt-list
 // sc-dir      = "send" / "recv"
 // sc-id-type  = "pt" / "rid" / token
 // sc-alt-list = sc-id *( "," sc-id )
 // sc-id       = fmt / rid-identifier / token
 // ; WSP defined in [RFC5234]
 // ; fmt, token defined in [RFC4566]
 // ; rid-identifier defined in [I-D.pthatcher-mmusic-rid]
+//
+// New draft 14, need to parse this for now, will eventually emit it
+// sc-value     = ( sc-send [SP sc-recv] ) / ( sc-recv [SP sc-send] )
+// sc-send      = %s"send" SP sc-str-list
+// sc-recv      = %s"recv" SP sc-str-list
+// sc-str-list  = sc-alt-list *( ";" sc-alt-list )
+// sc-alt-list  = sc-id *( "," sc-id )
+// sc-id-paused = "~"
+// sc-id        = [sc-id-paused] rid-id
+// ; SP defined in [RFC5234]
+// ; rid-id defined in [I-D.ietf-mmusic-rid]
+
 class SdpSimulcastAttribute : public SdpAttribute {
  public:
   SdpSimulcastAttribute() : SdpAttribute(kSimulcastAttribute) {}
 
   void Serialize(std::ostream& os) const override;
   bool Parse(std::istream& is, std::string* error);
 
   class Version {