Title: [290819] trunk/LayoutTests
Revision
290819
Author
[email protected]
Date
2022-03-03 23:55:10 -0800 (Thu, 03 Mar 2022)

Log Message

fast/mediastream/getUserMedia-to-canvas-1.html and fast/mediastream/getUserMedia-to-canvas-2.html are failing on MacOS when remote video frame flag is enabled
https://bugs.webkit.org/show_bug.cgi?id=237042
<rdar://problem/89298601>

Reviewed by Eric Carlson.

Video element videoWidth/videoHeight are updated when track settings are changed,
and not when video frames being received.

This does not guarantee that videoWidth/videoHeight (main thread) are fully in sync
with the actual video frames (background thread) when there is a change of size.

We might be able to tighten this in MediaPlayerPrivateMediaStreamAVFObjC by only resorting on video frames.
In the meantime, we update the test to use requestVideoFrameCallback which provides accurate per frame metadata.

* fast/mediastream/getUserMedia-to-canvas-1.html:
* fast/mediastream/getUserMedia-to-canvas-2.html:
* webrtc/routines.js:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (290818 => 290819)


--- trunk/LayoutTests/ChangeLog	2022-03-04 06:58:01 UTC (rev 290818)
+++ trunk/LayoutTests/ChangeLog	2022-03-04 07:55:10 UTC (rev 290819)
@@ -1,3 +1,24 @@
+2022-03-03  Youenn Fablet  <[email protected]>
+
+        fast/mediastream/getUserMedia-to-canvas-1.html and fast/mediastream/getUserMedia-to-canvas-2.html are failing on MacOS when remote video frame flag is enabled
+        https://bugs.webkit.org/show_bug.cgi?id=237042
+        <rdar://problem/89298601>
+
+        Reviewed by Eric Carlson.
+
+        Video element videoWidth/videoHeight are updated when track settings are changed,
+        and not when video frames being received.
+
+        This does not guarantee that videoWidth/videoHeight (main thread) are fully in sync
+        with the actual video frames (background thread) when there is a change of size.
+
+        We might be able to tighten this in MediaPlayerPrivateMediaStreamAVFObjC by only resorting on video frames.
+        In the meantime, we update the test to use requestVideoFrameCallback which provides accurate per frame metadata.
+
+        * fast/mediastream/getUserMedia-to-canvas-1.html:
+        * fast/mediastream/getUserMedia-to-canvas-2.html:
+        * webrtc/routines.js:
+
 2022-03-03  Kimmo Kinnunen  <[email protected]>
 
         WebGL context count is not limited for GPU process

Modified: trunk/LayoutTests/fast/mediastream/getUserMedia-to-canvas-1.html (290818 => 290819)


--- trunk/LayoutTests/fast/mediastream/getUserMedia-to-canvas-1.html	2022-03-04 06:58:01 UTC (rev 290818)
+++ trunk/LayoutTests/fast/mediastream/getUserMedia-to-canvas-1.html	2022-03-04 07:55:10 UTC (rev 290819)
@@ -1,4 +1,4 @@
-<!doctype html><!-- webkit-test-runner [ WebRTCRemoteVideoFrameEnabled=false ] -->
+<!doctype html>
 <html>
 <head>
     <meta name="timeout" content="long">

Modified: trunk/LayoutTests/fast/mediastream/getUserMedia-to-canvas-2.html (290818 => 290819)


--- trunk/LayoutTests/fast/mediastream/getUserMedia-to-canvas-2.html	2022-03-04 06:58:01 UTC (rev 290818)
+++ trunk/LayoutTests/fast/mediastream/getUserMedia-to-canvas-2.html	2022-03-04 07:55:10 UTC (rev 290819)
@@ -1,4 +1,4 @@
-<!doctype html><!-- webkit-test-runner [ WebRTCRemoteVideoFrameEnabled=false ] -->
+<!doctype html>
 <html>
 <head>
     <meta name="timeout" content="long">

Modified: trunk/LayoutTests/webrtc/routines.js (290818 => 290819)


--- trunk/LayoutTests/webrtc/routines.js	2022-03-04 06:58:01 UTC (rev 290818)
+++ trunk/LayoutTests/webrtc/routines.js	2022-03-04 07:55:10 UTC (rev 290819)
@@ -150,9 +150,16 @@
     return new Promise((resolve) => setTimeout(resolve, duration));
 }
 
-function waitForVideoSize(video, width, height, count)
+async function waitForVideoSize(video, width, height, count)
 {
-    if (video.videoWidth === width && video.videoHeight === height)
+    if (video.requestVideoFrameCallback) {
+        const frameMetadata = await new Promise(resolve => video.requestVideoFrameCallback((now, metadata) => {
+            resolve(metadata);
+        }));
+
+        if (frameMetadata.width === width && frameMetadata.height === height)
+            return Promise.resolve("video has expected size");
+    } else if (video.videoWidth === width && video.videoHeight === height)
         return Promise.resolve("video has expected size");
 
     if (count === undefined)
@@ -160,9 +167,8 @@
     if (++count > 20)
         return Promise.reject("waitForVideoSize timed out, expected " + width + "x"+ height + " but got " + video.videoWidth + "x" + video.videoHeight);
 
-    return waitFor(100).then(() => {
-        return waitForVideoSize(video, width, height, count);
-    });
+    await waitFor(100);
+    return waitForVideoSize(video, width, height, count);
 }
 
 async function doHumAnalysis(stream, expected)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to