Revert changes to RealtimeMediaSource.cpp made in r235086
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Aug 2018 13:29:36 +0000 (13:29 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Aug 2018 13:29:36 +0000 (13:29 +0000)
https://bugs.webkit.org/show_bug.cgi?id=189046
<rdar://problem/43794875>

Unreviewed, reverting an accidental change.

* platform/mediastream/RealtimeMediaSource.cpp:
(WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235422 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp

index aa16036..cb43c3f 100644 (file)
@@ -1,3 +1,14 @@
+2018-08-28  Eric Carlson  <eric.carlson@apple.com>
+
+        Revert changes to RealtimeMediaSource.cpp made in r235086
+        https://bugs.webkit.org/show_bug.cgi?id=189046
+        <rdar://problem/43794875>
+
+        Unreviewed, reverting an accidental change.
+
+        * platform/mediastream/RealtimeMediaSource.cpp:
+        (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate): 
+
 2018-08-28  Alejandro G. Castro  <alex@igalia.com>
 
         Fix gcc compilation warnings after r235230
index bfe4d6d..cadaf75 100644 (file)
@@ -246,8 +246,10 @@ bool RealtimeMediaSource::supportsSizeAndFrameRate(std::optional<IntConstraint>
         }
 
         distance = std::min(distance, constraintDistance);
-        auto range = capabilities.width();
-        width = widthConstraint->valueForCapabilityRange(size().width(), range.rangeMin().asInt, range.rangeMax().asInt);
+        if (widthConstraint->isMandatory()) {
+            auto range = capabilities.width();
+            width = widthConstraint->valueForCapabilityRange(size().width(), range.rangeMin().asInt, range.rangeMax().asInt);
+        }
     }
 
     std::optional<int> height;
@@ -259,8 +261,10 @@ bool RealtimeMediaSource::supportsSizeAndFrameRate(std::optional<IntConstraint>
         }
 
         distance = std::min(distance, constraintDistance);
-        auto range = capabilities.height();
-        height = heightConstraint->valueForCapabilityRange(size().height(), range.rangeMin().asInt, range.rangeMax().asInt);
+        if (heightConstraint->isMandatory()) {
+            auto range = capabilities.height();
+            height = heightConstraint->valueForCapabilityRange(size().height(), range.rangeMin().asInt, range.rangeMax().asInt);
+        }
     }
 
     std::optional<double> frameRate;
@@ -272,8 +276,10 @@ bool RealtimeMediaSource::supportsSizeAndFrameRate(std::optional<IntConstraint>
         }
 
         distance = std::min(distance, constraintDistance);
-        auto range = capabilities.frameRate();
-        frameRate = frameRateConstraint->valueForCapabilityRange(this->frameRate(), range.rangeMin().asDouble, range.rangeMax().asDouble);
+        if (frameRateConstraint->isMandatory()) {
+            auto range = capabilities.frameRate();
+            frameRate = frameRateConstraint->valueForCapabilityRange(this->frameRate(), range.rangeMin().asDouble, range.rangeMax().asDouble);
+        }
     }
 
     // Each of the non-null values is supported individually, see if they all can be applied at the same time.
@@ -286,7 +292,7 @@ bool RealtimeMediaSource::supportsSizeAndFrameRate(std::optional<IntConstraint>
             badConstraint = frameRateConstraint->name();
         return false;
     }
-    
+
     return true;
 }