Bug 1403714 - Only regard max_fs when set explicitly. r?dminor draft
authorAndreas Pehrson <pehrsons@mozilla.com>
Thu, 28 Sep 2017 18:34:36 +0200
changeset 672055 ced44670485962680dc9889e3563566272890868
parent 670875 70158e4e215d784d1391db5e517b18727f4b3683
child 733706 4a7b0dc4e6954d56ae657b3105cd725034ed6d72
push id82141
push userbmo:apehrson@mozilla.com
push dateThu, 28 Sep 2017 17:28:58 +0000
reviewersdminor
bugs1403714
milestone58.0a1
Bug 1403714 - Only regard max_fs when set explicitly. r?dminor MozReview-Commit-ID: DczP0bq96AW
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
@@ -1904,22 +1904,26 @@ WebrtcVideoConduit::OnSinkWantsChanged(
   if (!mLockScaling) {
     mLastSinkWanted = wants;
 
     // limit sink wants based upon max-fs constraint
     int max_fs = mCurSendCodecConfig->mEncodingConstraints.maxFs*(16*16);
     rtc::Optional<int> max_pixel_count = wants.max_pixel_count;
     rtc::Optional<int> max_pixel_count_step_up = wants.max_pixel_count_step_up;
 
-    if (max_pixel_count.value_or(max_fs) > max_fs) {
-      max_pixel_count = rtc::Optional<int>(max_fs);
-    }
+    if (max_fs > 0) {
+      // max_fs was explicitly set by signaling and needs to be accounted for
 
-    if (max_pixel_count_step_up.value_or(max_fs) > max_fs) {
-      max_pixel_count_step_up = rtc::Optional<int>(max_fs);
+      if (max_pixel_count.value_or(max_fs) > max_fs) {
+        max_pixel_count = rtc::Optional<int>(max_fs);
+      }
+
+      if (max_pixel_count_step_up.value_or(max_fs) > max_fs) {
+        max_pixel_count_step_up = rtc::Optional<int>(max_fs);
+      }
     }
 
     mVideoAdapter.OnResolutionRequest(max_pixel_count,
                                       max_pixel_count_step_up);
   }
 }
 
 MediaConduitErrorCode