Title: [265047] trunk
Revision
265047
Author
[email protected]
Date
2020-07-29 11:11:14 -0700 (Wed, 29 Jul 2020)

Log Message

scaleResolutionDownBy has no effect on RTCRtpSender
https://bugs.webkit.org/show_bug.cgi?id=214783
<rdar://problem/66108346>

Reviewed by Eric Carlson.

Source/WebCore:

Covered by updated test.

* Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
(WebCore::updateRTCRtpSendParameters):
Allow to change scaleResolutionDownBy.

LayoutTests:

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

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (265046 => 265047)


--- trunk/LayoutTests/ChangeLog	2020-07-29 17:45:32 UTC (rev 265046)
+++ trunk/LayoutTests/ChangeLog	2020-07-29 18:11:14 UTC (rev 265047)
@@ -1,3 +1,14 @@
+2020-07-29  Youenn Fablet  <[email protected]>
+
+        scaleResolutionDownBy has no effect on RTCRtpSender
+        https://bugs.webkit.org/show_bug.cgi?id=214783
+        <rdar://problem/66108346>
+
+        Reviewed by Eric Carlson.
+
+        * webrtc/video-expected.txt:
+        * webrtc/video.html:
+
 2020-07-29  Commit Queue  <[email protected]>
 
         Unreviewed, reverting r265018.

Modified: trunk/LayoutTests/webrtc/video-expected.txt (265046 => 265047)


--- trunk/LayoutTests/webrtc/video-expected.txt	2020-07-29 17:45:32 UTC (rev 265046)
+++ trunk/LayoutTests/webrtc/video-expected.txt	2020-07-29 18:11:14 UTC (rev 265047)
@@ -3,4 +3,5 @@
 PASS Basic video exchange 
 PASS Call setParameters to disable sending a given encoding 
 PASS Call setParameters to reenable sending a given encoding 
+PASS Call setParameters to reduce size by two 
 

Modified: trunk/LayoutTests/webrtc/video.html (265046 => 265047)


--- trunk/LayoutTests/webrtc/video.html	2020-07-29 17:45:32 UTC (rev 265046)
+++ trunk/LayoutTests/webrtc/video.html	2020-07-29 18:11:14 UTC (rev 265047)
@@ -121,6 +121,24 @@
 
     await checkVideoIsUpdated(true);
 }, "Call setParameters to reenable sending a given encoding");
+
+promise_test(async (test) => {
+    const sender = pc1.getSenders()[0];
+    let p = sender.getParameters();
+    p.encodings[0].scaleResolutionDownBy = 2;
+    await sender.setParameters(p);
+
+    assert_equals(sender.getParameters().encodings[0].scaleResolutionDownBy, 2, "encodings[0].scaleResolutionDownBy should be 2");
+    assert_equals(video.videoWidth, 640);
+    assert_equals(video.videoHeight, 480);
+
+    let counter = 0;
+    while (++counter < 50 && video.videoWidth == 640)
+        await waitFor(200);
+
+    assert_equals(video.videoWidth, 320);
+    assert_equals(video.videoHeight, 240);
+}, "Call setParameters to reduce size by two");
         </script>
     </body>
 </html>

Modified: trunk/Source/WebCore/ChangeLog (265046 => 265047)


--- trunk/Source/WebCore/ChangeLog	2020-07-29 17:45:32 UTC (rev 265046)
+++ trunk/Source/WebCore/ChangeLog	2020-07-29 18:11:14 UTC (rev 265047)
@@ -1,3 +1,17 @@
+2020-07-29  Youenn Fablet  <[email protected]>
+
+        scaleResolutionDownBy has no effect on RTCRtpSender
+        https://bugs.webkit.org/show_bug.cgi?id=214783
+        <rdar://problem/66108346>
+
+        Reviewed by Eric Carlson.
+
+        Covered by updated test.
+
+        * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
+        (WebCore::updateRTCRtpSendParameters):
+        Allow to change scaleResolutionDownBy.
+
 2020-07-29  Mark Lam  <[email protected]>
 
         CodeGeneratorJS should release the throwScope before doing a void call at end of a function.

Modified: trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp (265046 => 265047)


--- trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp	2020-07-29 17:45:32 UTC (rev 265046)
+++ trunk/Source/WebCore/Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp	2020-07-29 18:11:14 UTC (rev 265047)
@@ -162,6 +162,8 @@
             rtcParameters.encodings[i].max_bitrate_bps = parameters.encodings[i].maxBitrate;
         if (parameters.encodings[i].maxFramerate)
             rtcParameters.encodings[i].max_framerate = parameters.encodings[i].maxFramerate;
+        if (parameters.encodings[i].scaleResolutionDownBy)
+            rtcParameters.encodings[i].scale_resolution_down_by = parameters.encodings[i].scaleResolutionDownBy;
     }
 
     rtcParameters.header_extensions.clear();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to