Bug 1406936 - Copy state when reusing SendStream in ConfigureSendMediaCodecs; r=pehrsons
authorDan Minor <dminor@mozilla.com>
Tue, 28 Nov 2017 14:51:53 -0500
changeset 450040 65f2fdbdf1acfd558ef9c84542c12d31246d3601
parent 450039 5d7cec759f642b56548d4ce14f56c427cec3a470
child 450041 6fe8edb39ee0545af912252c5c6ca21adfdc07b2
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspehrsons
bugs1406936
milestone59.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 1406936 - Copy state when reusing SendStream in ConfigureSendMediaCodecs; r=pehrsons This is necessary for changes to encoding constraints and simulcast encodings to be picked up. MozReview-Commit-ID: JpVN0ST70Cn
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
@@ -803,16 +803,21 @@ WebrtcVideoConduit::ConfigureSendMediaCo
   // Expected max number of encodings
   mEncoderConfig.SetMaxEncodings(codecConfig->mSimulcastEncodings.size());
 
   // If only encoder stream attibutes have been changed, there is no need to stop,
   // create a new webrtc::VideoSendStream, and restart.
   // Recreating on PayloadType change may be overkill, but is safe.
   if (mSendStream) {
     if (!RequiresNewSendStream(*codecConfig)) {
+      {
+        MutexAutoLock lock(mCodecMutex);
+        mCurSendCodecConfig->mEncodingConstraints = codecConfig->mEncodingConstraints;
+        mCurSendCodecConfig->mSimulcastEncodings = codecConfig->mSimulcastEncodings;
+      }
       mSendStream->ReconfigureVideoEncoder(mEncoderConfig.CopyConfig());
       return kMediaConduitNoError;
     }
 
     condError = StopTransmitting();
     if (condError != kMediaConduitNoError) {
       return condError;
     }