Remove replaceTrack restriction about video resolution
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Jun 2017 23:10:37 +0000 (23:10 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 Jun 2017 23:10:37 +0000 (23:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173490

Patch by Youenn Fablet <youenn@apple.com> on 2017-06-16
Reviewed by Eric Carlson.

Source/WebCore:

Covered by updated tests.

* platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::setSource):

LayoutTests:

* webrtc/video-replace-track-expected.txt:
* webrtc/video-replace-track.html:

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

LayoutTests/ChangeLog
LayoutTests/webrtc/video-replace-track-expected.txt
LayoutTests/webrtc/video-replace-track.html
Source/WebCore/ChangeLog
Source/WebCore/platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp

index d3b5c47..501c2df 100644 (file)
@@ -1,3 +1,13 @@
+2017-06-16  Youenn Fablet  <youenn@apple.com>
+
+        Remove replaceTrack restriction about video resolution
+        https://bugs.webkit.org/show_bug.cgi?id=173490
+
+        Reviewed by Eric Carlson.
+
+        * webrtc/video-replace-track-expected.txt:
+        * webrtc/video-replace-track.html:
+
 2017-06-16  Matt Lewis  <jlewis3@apple.com>
 
         Marked multiple imported/w3c/web-platform-tests/IndexedDB as flaky.
index bbea763..4e1efda 100644 (file)
@@ -7,4 +7,5 @@ PASS testBackCameraImage test1
 PASS testFrontCameraImage test2 
 PASS testBackCameraImage test2 
 PASS testFrontCameraImage test3 
+PASS testBackCameraImage test4 
+
index 1272471..4f37958 100644 (file)
@@ -159,8 +159,13 @@ promise_test((test) => {
     }).then((stream) => {
         backStream = stream;
         assert_true(backStream.getVideoTracks()[0].getSettings().height === 480, "back stream should be big");
-        return promise_rejects(test, "InvalidModificationError", sender.replaceTrack(backStream.getVideoTracks()[0]));
+        return sender.replaceTrack(backStream.getVideoTracks()[0]);
+    }).then(() => {
+        return waitFor(500);
+    }).then(() => {
+        testBackCameraImage("test4");
     });
+
 }, "Switching from front to back camera, with higher resolution");
         </script>
     </body>
index 679072e..0cc4c58 100644 (file)
@@ -1,3 +1,15 @@
+2017-06-16  Youenn Fablet  <youenn@apple.com>
+
+        Remove replaceTrack restriction about video resolution
+        https://bugs.webkit.org/show_bug.cgi?id=173490
+
+        Reviewed by Eric Carlson.
+
+        Covered by updated tests.
+
+        * platform/mediastream/mac/RealtimeOutgoingVideoSource.cpp:
+        (WebCore::RealtimeOutgoingVideoSource::setSource):
+
 2017-06-16  Jeremy Jones  <jeremyj@apple.com>
 
         Handle timeout of prepareForPictureInPictureStopWithCompletionHandler.
index ec1adb6..5270c06 100644 (file)
@@ -56,11 +56,6 @@ bool RealtimeOutgoingVideoSource::setSource(Ref<RealtimeMediaSource>&& newSource
     if (!m_initialSettings)
         m_initialSettings = m_videoSource->settings();
 
-    auto newSettings = newSource->settings();
-
-    if (m_initialSettings->width() < newSettings.width() || m_initialSettings->height() < newSettings.height())
-        return false;
-
     m_videoSource->removeObserver(*this);
     m_videoSource = WTFMove(newSource);
     m_videoSource->addObserver(*this);