Bug 1307507 - Ensure that resolution is retained on multiple replaceTrack/renegotiations. r=bwc, a=ritu
authorRandell Jesup <rjesup@jesup.org>
Tue, 04 Oct 2016 13:13:01 -0400
changeset 348517 0ddf1476b34c2dbb6189556ac58810b657ece971
parent 348516 6bf136c04b47321e7360286f76d824ef6ccbe9ac
child 348518 4f4a7d3bf772f34c1b5a3f3cc722c529763dd77c
push id6462
push userryanvm@gmail.com
push dateThu, 06 Oct 2016 02:05:57 +0000
treeherdermozilla-beta@d567c7677412 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwc, ritu
bugs1307507
milestone50.0
Bug 1307507 - Ensure that resolution is retained on multiple replaceTrack/renegotiations. r=bwc, a=ritu
media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
--- a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
+++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp
@@ -716,17 +716,22 @@ WebrtcVideoConduit::ConfigureSendMediaCo
     // We could also set mLastWidth to 0, to force immediate reconfig -
     // more expensive, but perhaps less risk of missing something.  Really
     // on ReplaceTrack we should just call ConfigureCodecMode(), and if the
     // mode changed, we re-configure.
     // Do this after CodecConfigToWebRTCCodec() to avoid messing up simulcast
     video_codec.width = mSendingWidth;
     video_codec.height = mSendingHeight;
     video_codec.maxFramerate = mSendingFramerate;
+  } else {
+    mSendingWidth = 0;
+    mSendingHeight = 0;
+    mSendingFramerate = video_codec.maxFramerate;
   }
+
   video_codec.mode = mCodecMode;
 
   if(mPtrViECodec->SetSendCodec(mChannel, video_codec) == -1)
   {
     error = mPtrViEBase->LastError();
     if(error == kViECodecInvalidCodec)
     {
       CSFLogError(logTag, "%s Invalid Send Codec", __FUNCTION__);
@@ -746,20 +751,16 @@ WebrtcVideoConduit::ConfigureSendMediaCo
                                               mMinBitrateEstimate));
   }
 
   if (!mVideoCodecStat) {
     mVideoCodecStat = new VideoCodecStatistics(mChannel, mPtrViECodec);
   }
   mVideoCodecStat->Register(true);
 
-  mSendingWidth = 0;
-  mSendingHeight = 0;
-  mSendingFramerate = video_codec.maxFramerate;
-
   if (codecConfig->RtcpFbFECIsSet())
   {
     uint8_t payload_type_red = INVALID_RTP_PAYLOAD;
     uint8_t payload_type_ulpfec = INVALID_RTP_PAYLOAD;
     if (!DetermineREDAndULPFECPayloadTypes(payload_type_red, payload_type_ulpfec)) {
       CSFLogError(logTag, "%s Unable to set FEC status: could not determine"
                   "payload type: red %u ulpfec %u",
                   __FUNCTION__, payload_type_red, payload_type_ulpfec);