⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 290658 in webkit


Ignore:
Timestamp:
Mar 1, 2022, 10:34:58 AM (5 years ago)
Author:
youenn@apple.com
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 set the orientation before creating the source.
This makes sure the video frames have the expected size and rotation.

  • fast/mediastream/getUserMedia-to-canvas-1.html:
  • fast/mediastream/getUserMedia-to-canvas-2.html:
  • fast/mediastream/resources/getUserMedia-to-canvas.js:
Location:
trunk/LayoutTests
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r290648 r290658  
     12022-03-01  Youenn Fablet  <youenn@apple.com>
     2
     3        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
     4        https://bugs.webkit.org/show_bug.cgi?id=237042
     5        <rdar://problem/89298601>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Video element videoWidth/videoHeight are updated when track settings are changed,
     10        and not when video frames being received.
     11
     12        This does not guarantee that videoWidth/videoHeight (main thread) are fully in sync
     13        with the actual video frames (background thread) when there is a change of size.
     14
     15        We might be able to tighten this in MediaPlayerPrivateMediaStreamAVFObjC by only resorting on video frames.
     16        In the meantime, we update the test to set the orientation before creating the source.
     17        This makes sure the video frames have the expected size and rotation.
     18
     19        * fast/mediastream/getUserMedia-to-canvas-1.html:
     20        * fast/mediastream/getUserMedia-to-canvas-2.html:
     21        * fast/mediastream/resources/getUserMedia-to-canvas.js:
     22
    1232022-03-01  Chris Dumez  <cdumez@apple.com>
    224
  • trunk/LayoutTests/fast/mediastream/getUserMedia-to-canvas-1.html

    r290354 r290658  
    1 <!doctype html><!-- webkit-test-runner [ WebRTCRemoteVideoFrameEnabled=false ] -->
     1<!doctype html>
    22<html>
    33<head>
  • trunk/LayoutTests/fast/mediastream/getUserMedia-to-canvas-2.html

    r290354 r290658  
    1 <!doctype html><!-- webkit-test-runner [ WebRTCRemoteVideoFrameEnabled=false ] -->
     1<!doctype html>
    22<html>
    33<head>
  • trunk/LayoutTests/fast/mediastream/resources/getUserMedia-to-canvas.js

    r288315 r290658  
    1111    video.srcObject = await navigator.mediaDevices.getUserMedia({ video: { width: { exact: width } } });
    1212    await video.play();
    13     assert_equals(video.videoWidth, width);
     13    assert_true(video.videoWidth === width || video.videoHeight === width);
    1414    return video;
    1515}
    … …  
    128128async function testUserMediaToCanvas(t, subcase) {
    129129    const desc = testDescription(subcase);
     130    const [angle] = setMockCameraImageOrientation(subcase.angle);
    130131    const video = await createSourceVideo();
    131132    const debuge = document.getElementById("debuge");
    132133    debuge.append(video);
    133     const realVideoSize = [video.videoWidth, video.videoHeight];
     134    const videoSize = [video.videoWidth, video.videoHeight];
    134135    t.add_cleanup(async () => {
    135         // Reset orientation for the next test by going to 0.
    136         if (subcase.angle == 180) {
    137             // 180 -> 0 cannot detect rotation via video size change. Go via 90.
    138             const [angle, videoSize] = setMockCameraImageOrientation(90, realVideoSize);
    139             await waitForVideoSize(video, videoSize[0], videoSize[1]);
    140         }
    141136        setMockCameraImageOrientation(0);
    142         await waitForVideoSize(video, realVideoSize[0], realVideoSize[1]);
    143137        debuge.removeChild(video);
    144138    });
    145 
    146     if (subcase.angle == 180) {
    147         // 0 -> 180 cannot detect rotation via video size change. Go via 90.
    148         const [angle, videoSize] = setMockCameraImageOrientation(90, realVideoSize);
    149         await waitForVideoSize(video, videoSize[0], videoSize[1]);
    150     }
    151     const [angle, videoSize] = setMockCameraImageOrientation(subcase.angle, realVideoSize);
    152     await waitForVideoSize(video, videoSize[0], videoSize[1]);
    153139
    154140    const canvas = createVerifyCanvas(video);
Note: See TracChangeset for help on using the changeset viewer.