Bug 1191301 - Re-enable the use of media.navigator.video.use_tmmbr pref. r=bwc
authorEthan Hugg <ethanhugg@gmail.com>
Mon, 24 Aug 2015 09:31:38 -0700
changeset 259100 ce1bba4455defefd9b58d57917add82837724f72
parent 259099 da1c20faa1d3f78101b6bddfca9486296a4117b4
child 259101 435e936e3d01a4af7e00738d05341d58622a13a1
push id29268
push userryanvm@gmail.com
push dateTue, 25 Aug 2015 00:37:23 +0000
treeherdermozilla-central@08015770c9d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc
bugs1191301
milestone43.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 1191301 - Re-enable the use of media.navigator.video.use_tmmbr pref. r=bwc
media/webrtc/signaling/src/jsep/JsepCodecDescription.h
media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
--- a/media/webrtc/signaling/src/jsep/JsepCodecDescription.h
+++ b/media/webrtc/signaling/src/jsep/JsepCodecDescription.h
@@ -199,26 +199,27 @@ struct JsepVideoCodecDescription : publi
       : JsepCodecDescription(mozilla::SdpMediaSection::kVideo, defaultPt, name,
                              clock, 0, enabled),
         mMaxFs(0),
         mMaxFr(0),
         mPacketizationMode(0),
         mMaxMbps(0),
         mMaxCpb(0),
         mMaxDpb(0),
-        mMaxBr(0),
-        mUseTmmbr(false)
+        mMaxBr(0)
   {
     // Add supported rtcp-fb types
     mNackFbTypes.push_back("");
     mNackFbTypes.push_back(SdpRtcpFbAttributeList::pli);
     mCcmFbTypes.push_back(SdpRtcpFbAttributeList::fir);
-    if (mUseTmmbr) {
-      mCcmFbTypes.push_back(SdpRtcpFbAttributeList::tmmbr);
-    }
+  }
+
+  virtual void
+  EnableTmmbr() {
+    mCcmFbTypes.push_back(SdpRtcpFbAttributeList::tmmbr);
   }
 
   virtual void
   AddFmtps(SdpFmtpAttributeList& fmtp) const override
   {
     if (mName == "H264") {
       UniquePtr<SdpFmtpAttributeList::H264Parameters> params =
           MakeUnique<SdpFmtpAttributeList::H264Parameters>();
@@ -591,17 +592,16 @@ struct JsepVideoCodecDescription : publi
   // H264-specific stuff
   uint32_t mProfileLevelId;
   uint32_t mMaxFr;
   uint32_t mPacketizationMode;
   uint32_t mMaxMbps;
   uint32_t mMaxCpb;
   uint32_t mMaxDpb;
   uint32_t mMaxBr;
-  bool     mUseTmmbr;
   std::string mSpropParameterSets;
 };
 
 struct JsepApplicationCodecDescription : public JsepCodecDescription {
   JsepApplicationCodecDescription(const std::string& defaultPt,
                                   const std::string& name,
                                   uint16_t channels,
                                   bool enabled = true)
--- a/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/PeerConnectionImpl.cpp
@@ -1054,19 +1054,23 @@ PeerConnectionImpl::ConfigureJsepSession
             branch->GetIntPref("media.navigator.video.max_fr", &maxFr);
             if (maxFr <= 0) {
               maxFr = 60; // We must specify something other than 0
             }
             videoCodec.mMaxFr = maxFr;
 
           }
 
-          videoCodec.mUseTmmbr = false;
+          // TMMBR is enabled from a pref in about:config
+          bool useTmmbr = false;
           branch->GetBoolPref("media.navigator.video.use_tmmbr",
-            &videoCodec.mUseTmmbr);
+            &useTmmbr);
+          if (useTmmbr) {
+            videoCodec.EnableTmmbr();
+          }
         }
         break;
       case SdpMediaSection::kText:
       case SdpMediaSection::kApplication:
       case SdpMediaSection::kMessage:
         {} // Nothing to configure for these.
     }
   }