From 339a8756b38b9b506eccba3ac1fbbdf9d340417f Mon Sep 17 00:00:00 2001 From: Blink WPT Bot Date: Fri, 3 Sep 2021 04:08:51 +0000 Subject: [PATCH] Bug 1728088 [wpt PR 30226] - Increase bandwidth of fake video signal used for testing., a=testonly Automatic update from web-platform-tests Increase bandwidth of fake video signal used for testing. (#30226) This will increase the size of an encoded 640x480 video from approximately 8 Kbits/second to approximately 64 Kbits/second, which means that limiting the bandwidth will actually have an effect. This is done in preparation for further tests that limit the bandwidth and expect an observable result. Bug: None Change-Id: Ib3c63c4ae8c41fe7c608f1c06c8c61c2beecbe11 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3128063 Reviewed-by: Florent Castelli Commit-Queue: Harald Alvestrand Cr-Commit-Position: refs/heads/main@{#916377} Co-authored-by: Harald Alvestrand -- wpt-commits: ed9b278329b48455b62195b32be8aa0f40812de5 wpt-pr: 30226 --- .../tests/webrtc/RTCPeerConnection-helper.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/testing/web-platform/tests/webrtc/RTCPeerConnection-helper.js b/testing/web-platform/tests/webrtc/RTCPeerConnection-helper.js index 1521277418fa..ac435279bd24 100644 --- a/testing/web-platform/tests/webrtc/RTCPeerConnection-helper.js +++ b/testing/web-platform/tests/webrtc/RTCPeerConnection-helper.js @@ -407,6 +407,15 @@ const trackFactories = { ctx.fillStyle = `rgb(${count%255}, ${count*count%255}, ${count%255})`; count += 1; ctx.fillRect(0, 0, width, height); + // Add some bouncing boxes in contrast color to add a little more noise. + const contrast = count + 128; + ctx.fillStyle = `rgb(${contrast%255}, ${contrast*contrast%255}, ${contrast%255})`; + const xpos = count % (width - 20); + const ypos = count % (height - 20); + ctx.fillRect(xpos, ypos, xpos + 20, ypos + 20); + const xpos2 = (count + width / 2) % (width - 20); + const ypos2 = (count + height / 2) % (height - 20); + ctx.fillRect(xpos2, ypos2, xpos2 + 20, ypos2 + 20); // If signal is set (0-255), add a constant-color box of that luminance to // the video frame at coordinates 20 to 60 in both X and Y direction. // (big enough to avoid color bleed from surrounding video in some codecs,