Bug 1639377 - Do not offer RRID header extension if RTX is disabled; r=drno
authorDan Minor <dminor@mozilla.com>
Tue, 26 May 2020 20:49:29 +0000
changeset 532499 50d550c87f07e3fec8e2128f69b749a07b2cf18f
parent 532498 d8e996aa9cf098f69612a642ab76c25ea30ce363
child 532500 43f4185c1299afac3a4f864d01e01734b4b844d0
push id37455
push userapavel@mozilla.com
push dateWed, 27 May 2020 21:33:21 +0000
treeherdermozilla-central@50d550c87f07 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdrno
bugs1639377
milestone78.0a1
first release with
nightly linux32
50d550c87f07 / 78.0a1 / 20200527213321 / files
nightly linux64
50d550c87f07 / 78.0a1 / 20200527213321 / files
nightly mac
50d550c87f07 / 78.0a1 / 20200527213321 / files
nightly win32
50d550c87f07 / 78.0a1 / 20200527213321 / files
nightly win64
50d550c87f07 / 78.0a1 / 20200527213321 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1639377 - Do not offer RRID header extension if RTX is disabled; r=drno Differential Revision: https://phabricator.services.mozilla.com/D76890
dom/media/tests/mochitest/sdpUtils.js
media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
--- a/dom/media/tests/mochitest/sdpUtils.js
+++ b/dom/media/tests/mochitest/sdpUtils.js
@@ -267,22 +267,23 @@ var sdputils = {
     new_answer_sdp =
       new_answer_sdp +
       "a=extmap:" +
       extmap_id[1] +
       "/recvonly urn:ietf:params:rtp-hdrext:sdes:rtp-stream-id\r\n";
     var extmap_id = offer_sdp.match(
       "a=extmap:([0-9+])/sendonly urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id"
     );
-    ok(extmap_id != null, "Offer contains RID RTP header extension");
-    new_answer_sdp =
-      new_answer_sdp +
-      "a=extmap:" +
-      extmap_id[1] +
-      "/recvonly urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id\r\n";
+    if (extmap_id != null) {
+      new_answer_sdp =
+        new_answer_sdp +
+        "a=extmap:" +
+        extmap_id[1] +
+        "/recvonly urn:ietf:params:rtp-hdrext:sdes:repaired-rtp-stream-id\r\n";
+    }
 
     return new_answer_sdp;
   },
 
   verifySdp(
     desc,
     expectedType,
     offerConstraintsList,
--- a/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
+++ b/media/webrtc/signaling/src/jsep/JsepSessionImpl.cpp
@@ -401,18 +401,21 @@ std::vector<SdpExtmapAttributeList::Extm
     case SdpMediaSection::kVideo:
       mediaType = JsepMediaType::kVideo;
       if (msection.GetAttributeList().HasAttribute(
               SdpAttribute::kRidAttribute)) {
         // We need RID support
         // TODO: Would it be worth checking that the direction is sane?
         AddVideoRtpExtension(webrtc::RtpExtension::kRtpStreamIdUri,
                              SdpDirectionAttribute::kSendonly);
-        AddVideoRtpExtension(webrtc::RtpExtension::kRepairedRtpStreamIdUri,
-                             SdpDirectionAttribute::kSendonly);
+
+        if (Preferences::GetBool("media.peerconnection.video.use_rtx", false)) {
+          AddVideoRtpExtension(webrtc::RtpExtension::kRepairedRtpStreamIdUri,
+                               SdpDirectionAttribute::kSendonly);
+        }
       }
       break;
     default:;
   }
   if (mediaType != JsepMediaType::kNone) {
     for (auto ext = mRtpExtensions.begin(); ext != mRtpExtensions.end();
          ++ext) {
       if (ext->mMediaType == mediaType ||