Bug 1474661: Fixed bug where we were overwriting the high quality simulcast config with the next one down, and add another entry to the resolutions/bitrates table. r=ng
authorByron Campen [:bwc] <docfaraday@gmail.com>
Mon, 30 Jul 2018 22:27:27 +0000
changeset 429278 42aff55fb6d5ac0d02764fd7d18d530cd244f34f
parent 429277 932cc42e15c10e62960d9a269adcca0c36e7da6d
child 429279 f23bfde75fc5ba80ab600bea40c5c830953c62c7
push id67097
push userbcampen@mozilla.com
push dateMon, 30 Jul 2018 23:59:32 +0000
treeherderautoland@42aff55fb6d5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersng
bugs1474661
milestone63.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 1474661: Fixed bug where we were overwriting the high quality simulcast config with the next one down, and add another entry to the resolutions/bitrates table. r=ng MozReview-Commit-ID: DhPYvioLqAe Differential Revision: https://phabricator.services.mozilla.com/D2480
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
@@ -597,17 +597,16 @@ WebrtcVideoConduit::VideoStreamFactory::
 
   // XXX webrtc.org code has a restriction on simulcast layers that each
   // layer must be 1/2 the dimension of the previous layer - not sure why.
   // This means we can't use scaleResolutionBy/scaleDownBy (yet), even if
   // the user specified it.  The one exception is that we can apply it on
   // the full-resolution stream (which also happens to handle the
   // non-simulcast usage case). NOTE: we make an assumption here, not in the
   // spec, that the first stream is the full-resolution stream.
-  auto& simulcastEncoding = mConduit->mCurSendCodecConfig->mSimulcastEncodings[0];
 #if 0
   // XXX What we'd like to do for each simulcast stream...
   if (simulcastEncoding.constraints.scaleDownBy > 1.0) {
     uint32_t new_width = width / simulcastEncoding.constraints.scaleDownBy;
     uint32_t new_height = height / simulcastEncoding.constraints.scaleDownBy;
 
     if (new_width != width || new_height != height) {
       if (streamCount == 1) {
@@ -634,17 +633,17 @@ WebrtcVideoConduit::VideoStreamFactory::
 
     // width/height will be overridden on the first frame; they must be 'sane' for
     // SetSendCodec()
     video_stream.width = width >> idx;
     video_stream.height = height >> idx;
     // We want to ensure this picks up the current framerate, so indirect
     video_stream.max_framerate = mConduit->mSendingFramerate;
 
-    simulcastEncoding = mConduit->mCurSendCodecConfig->mSimulcastEncodings[idx];
+    auto& simulcastEncoding = mConduit->mCurSendCodecConfig->mSimulcastEncodings[idx];
     MOZ_ASSERT(simulcastEncoding.constraints.scaleDownBy >= 1.0);
 
     // Calculate these first
     video_stream.max_bitrate_bps = MinIgnoreZero(simulcastEncoding.constraints.maxBr,
                                                  kDefaultMaxBitrate_bps);
     video_stream.max_bitrate_bps = MinIgnoreZero((int) mConduit->mPrefMaxBitrate*1000,
                                                  video_stream.max_bitrate_bps);
     video_stream.min_bitrate_bps = (mConduit->mMinBitrate ?
@@ -1626,16 +1625,17 @@ struct ResolutionAndBitrateLimits
 // 30fps.
 
 // XXX Populate this based on a pref (which we should consider sorting because
 // people won't assume they need to).
 static ResolutionAndBitrateLimits kResolutionAndBitrateLimits[] = {
   {MB_OF(1920, 1200), KBPS(1500), KBPS(2000), KBPS(10000)}, // >HD (3K, 4K, etc)
   {MB_OF(1280, 720), KBPS(1200), KBPS(1500), KBPS(5000)}, // HD ~1080-1200
   {MB_OF(800, 480), KBPS(600), KBPS(800), KBPS(2500)}, // HD ~720
+  {MB_OF(480, 270), KBPS(300), KBPS(500), KBPS(2000)},
   {tl::Max<MB_OF(400, 240), MB_OF(352, 288)>::value, KBPS(200), KBPS(300), KBPS(1300)}, // VGA, WVGA
   {MB_OF(176, 144), KBPS(100), KBPS(150), KBPS(500)}, // WQVGA, CIF
   {0 , KBPS(40), KBPS(80), KBPS(250)} // QCIF and below
 };
 
 void
 WebrtcVideoConduit::SelectBitrates(
   unsigned short width, unsigned short height, int cap,