Title: [203839] trunk
Revision
203839
Author
[email protected]
Date
2016-07-28 14:02:30 -0700 (Thu, 28 Jul 2016)

Log Message

Unreviewed, rolling out r203826.
https://bugs.webkit.org/show_bug.cgi?id=160314

The test added with this change fails on El Capitan WK2.
(Requested by ryanhaddad on #webkit).

Reverted changeset:

"HTMLVideoElement with MediaStream src shows paused image when
all video tracks are disabled"
https://bugs.webkit.org/show_bug.cgi?id=160222
http://trac.webkit.org/changeset/203826

Patch by Commit Queue <[email protected]> on 2016-07-28

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (203838 => 203839)


--- trunk/LayoutTests/ChangeLog	2016-07-28 20:56:59 UTC (rev 203838)
+++ trunk/LayoutTests/ChangeLog	2016-07-28 21:02:30 UTC (rev 203839)
@@ -1,3 +1,18 @@
+2016-07-28  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r203826.
+        https://bugs.webkit.org/show_bug.cgi?id=160314
+
+        The test added with this change fails on El Capitan WK2.
+        (Requested by ryanhaddad on #webkit).
+
+        Reverted changeset:
+
+        "HTMLVideoElement with MediaStream src shows paused image when
+        all video tracks are disabled"
+        https://bugs.webkit.org/show_bug.cgi?id=160222
+        http://trac.webkit.org/changeset/203826
+
 2016-07-28  Alexey Proskuryakov  <[email protected]>
 
         macOS Sierra test result gardening.

Deleted: trunk/LayoutTests/fast/mediastream/MediaStream-video-element-video-tracks-disabled-expected.html (203838 => 203839)


--- trunk/LayoutTests/fast/mediastream/MediaStream-video-element-video-tracks-disabled-expected.html	2016-07-28 20:56:59 UTC (rev 203838)
+++ trunk/LayoutTests/fast/mediastream/MediaStream-video-element-video-tracks-disabled-expected.html	2016-07-28 21:02:30 UTC (rev 203839)
@@ -1,36 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<head>
-    <style>
-        .video {
-            position: absolute;
-            left: 10px;
-            top: 50px;
-            height: 360px;
-            width: 680px;
-            background-color: black;
-            will-change: transform;
-        }
-        
-        .masker {
-            position: absolute;
-            left: 10px;
-            top: 50px;
-            height: 360px;
-            width: 680px;
-            border-top: 50px solid white;
-            border-right: 300px solid white;
-            border-bottom: 50px solid white;
-            border-left: 300px solid white;
-            box-sizing: border-box;
-        }
-    </style>
-</head>
-<body>
-<p>Tests that the video frames of an HTMLVideoElement are black if no video MediaStreamTrack is enabled.</p>
-<div class="video"></div>
-<div class="masker"></div>
-
-</body>
-</html>

Deleted: trunk/LayoutTests/fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled-expected.txt (203838 => 203839)


--- trunk/LayoutTests/fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled-expected.txt	2016-07-28 20:56:59 UTC (rev 203838)
+++ trunk/LayoutTests/fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled-expected.txt	2016-07-28 21:02:30 UTC (rev 203839)
@@ -1,32 +0,0 @@
-Tests that re-enabling a video MediaStreamTrack when all tracks were previously disabled causes captured media to display.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-
-PASS mediaDevices.getUserMedia generated a stream successfully.
-video.src = ""
-
- === beginning round of pixel tests ===
-PASS pixel was white
-
- === all video tracks disabled ===
-PASS pixel was black.
-
- === video track reenabled ===
-PASS pixel was white.
-
- ===== play video =====
-video.play()
-
- === beginning round of pixel tests ===
-PASS pixel was white
-
- === all video tracks disabled ===
-PASS pixel was black.
-
- === video track reenabled ===
-PASS pixel was white.
-PASS successfullyParsed is true
-
-TEST COMPLETE
- 

Deleted: trunk/LayoutTests/fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html (203838 => 203839)


--- trunk/LayoutTests/fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html	2016-07-28 20:56:59 UTC (rev 203838)
+++ trunk/LayoutTests/fast/mediastream/MediaStream-video-element-video-tracks-disabled-then-enabled.html	2016-07-28 21:02:30 UTC (rev 203839)
@@ -1,128 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <script src=""
-    <script src=""
-</head>
-<body _onload_="start()">
-<p id="description"></p>
-<div id="console"></div>
-<video controls width="680" height="360"></video>
-<canvas width="680" height="360"></canvas>
-<script>
-    let canvas;
-    let context;
-    let mediaStream;
-    let video;
-    
-    let buffer;
-
-    function isPixelBlack(pixel)
-    {
-        return pixel[0] === 0 && pixel[1] === 0 && pixel[2] === 0 && pixel[3] === 255;
-    }
-
-    function isPixelTransparent(pixel)
-    {
-        return pixel[0] === 0 && pixel[1] === 0 && pixel[2] === 0 && pixel[3] === 0;
-    }
-
-    function isPixelWhite(pixel)
-    {
-        return pixel[0] === 255 && pixel[1] === 255 && pixel[2] === 255 && pixel[3] === 255;
-    }
-
-    function attempt(numberOfTries, call, callback, successMessage)
-    {
-        if (numberOfTries <= 0) {
-            testFailed('Pixel check did not succeed after multiple tries.');
-            return;
-        }
-
-        let attemptSucceeded = call();
-        if (attemptSucceeded) {
-            testPassed(successMessage);
-            callback();
-
-            return;
-        }
-        
-        setTimeout(() => { attempt(--numberOfTries, call, callback, successMessage); }, 50);
-    }
-
-    function repeatWithVideoPlayingAndFinishTest()
-    {
-        if (video.paused) {
-            debug('<br> ===== play video =====');
-            evalAndLog('video.play()');
-            beginTestRound();
-        } else
-            finishJSTest();
-    }
-
-    function reenableTrack()
-    {
-        mediaStream.getVideoTracks()[0].enabled = true;
-        debug('<br> === video track reenabled ===');
-
-        // The video is not guaranteed to render non-black frames before the canvas is drawn to and the pixels are checked.
-        // A timeout is used to ensure that the pixel check is done after the video renders non-black frames.
-        attempt(10, checkPixels, repeatWithVideoPlayingAndFinishTest, 'pixel was white.');
-    }
-
-    function checkPixels()
-    {
-        context.clearRect(0, 0, canvas.width, canvas.height);
-        buffer = context.getImageData(30, 242, 1, 1).data;
-        if(!isPixelTransparent(buffer)) {
-            testFailed('pixel was not transparent after clearing canvas.');
-        }
-
-        context.drawImage(video, 0, 0, canvas.width, canvas.height);
-        buffer = context.getImageData(30, 242, 1, 1).data;
-
-        if (mediaStream.getVideoTracks()[0].enabled)
-            return isPixelWhite(buffer);
-        else
-            return isPixelBlack(buffer);
-    }
-
-    function disableAllTracks()
-    {
-        mediaStream.getVideoTracks()[0].enabled = false;
-        debug('<br> === all video tracks disabled ===');
-        
-        // The video is not guaranteed to render black frames before the canvas is drawn to and the pixels are checked.
-        // A timeout is used to ensure that the pixel check is done after the video renders black frames.
-        attempt(10, checkPixels, reenableTrack, 'pixel was black.');
-    }
-
-    function beginTestRound()
-    {
-        debug('<br> === beginning round of pixel tests ===');
-        attempt(1, checkPixels, disableAllTracks, 'pixel was white');
-    }
-
-    function canplay()
-    {
-        canvas = document.querySelector('canvas');
-        context = canvas.getContext('2d');
-
-        beginTestRound();
-    }
-
-    function start()
-    {
-        description("Tests that re-enabling a video MediaStreamTrack when all tracks were previously disabled causes captured media to display.");
-
-        video = document.querySelector('video');
-        video.addEventListener('canplay', canplay);
-
-        getUserMedia("allow", {video:true}, setupVideoElementWithStream);
-    }
-
-    window.jsTestIsAsync = true;
-</script>
-<script src=""
-</body>
-</html>
\ No newline at end of file

Deleted: trunk/LayoutTests/fast/mediastream/MediaStream-video-element-video-tracks-disabled.html (203838 => 203839)


--- trunk/LayoutTests/fast/mediastream/MediaStream-video-element-video-tracks-disabled.html	2016-07-28 20:56:59 UTC (rev 203838)
+++ trunk/LayoutTests/fast/mediastream/MediaStream-video-element-video-tracks-disabled.html	2016-07-28 21:02:30 UTC (rev 203839)
@@ -1,81 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-    <style>
-        video {
-            position: absolute;
-            left: 10px;
-            top: 50px;
-        }
-        
-        .masker {
-            position: absolute;
-            left: 10px;
-            top: 50px;
-            height: 360px;
-            width: 680px;
-            border-top: 50px solid white;
-            border-right: 300px solid white;
-            border-bottom: 50px solid white;
-            border-left: 300px solid white;
-            box-sizing: border-box;
-        }
-    </style>
-</head>
-
-<body>
-<p>Tests that the video frames of an HTMLVideoElement are black if no video MediaStreamTrack is enabled.</p>
-<video controls width="680" height="360"></video>
-<div class="masker"></div>
-
-<script>
-    let mediaStream;
-    let video;
-
-    function debug(msg)
-    {
-        let span = document.createElement('span');
-        document.body.appendChild(span);
-        span.innerHTML = `${msg} <br />`;
-    }
-
-    function canplaythrough()
-    {    
-        mediaStream.getVideoTracks()[0].enabled = false;
-        window.testRunner.notifyDone();
-    }
-
-    function canplay()
-    {
-        video.play();
-    }
-
-    function setupStream(stream)
-    {
-        mediaStream = stream;
-        video.src = ""
-    }
-
-    function failedToSetupStream()
-    {
-        debug('Failed to setup stream');
-    }
-
-    function start()
-    {
-        video = document.querySelector('video');
-        video.addEventListener('canplay', canplay, false);
-        video.addEventListener('canplaythrough', canplaythrough, false);
-        navigator.mediaDevices.getUserMedia({video:true})
-            .then(setupStream)
-            .catch(failedToSetupStream);
-    }
-
-    if (window.testRunner) {
-        window.testRunner.waitUntilDone();
-        window.testRunner.setUserMediaPermission(true);
-        start();
-    }
-</script>
-</body>
-</html>

Modified: trunk/Source/WebCore/ChangeLog (203838 => 203839)


--- trunk/Source/WebCore/ChangeLog	2016-07-28 20:56:59 UTC (rev 203838)
+++ trunk/Source/WebCore/ChangeLog	2016-07-28 21:02:30 UTC (rev 203839)
@@ -1,3 +1,18 @@
+2016-07-28  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r203826.
+        https://bugs.webkit.org/show_bug.cgi?id=160314
+
+        The test added with this change fails on El Capitan WK2.
+        (Requested by ryanhaddad on #webkit).
+
+        Reverted changeset:
+
+        "HTMLVideoElement with MediaStream src shows paused image when
+        all video tracks are disabled"
+        https://bugs.webkit.org/show_bug.cgi?id=160222
+        http://trac.webkit.org/changeset/203826
+
 2016-07-28  Chris Dumez  <[email protected]>
 
         2 first parameters to input.setSelectionRange() should be mandatory

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h (203838 => 203839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h	2016-07-28 20:56:59 UTC (rev 203838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h	2016-07-28 21:02:30 UTC (rev 203839)
@@ -124,8 +124,6 @@
 
     void enqueueAudioSampleBufferFromTrack(MediaStreamTrackPrivate&, PlatformSample);
     void enqueueVideoSampleBufferFromTrack(MediaStreamTrackPrivate&, PlatformSample);
-    bool shouldEnqueueVideoSampleBuffer() const;
-    void flushAndRemoveVideoSampleBuffers();
 
     void paint(GraphicsContext&, const FloatRect&) override;
     void paintCurrentFrameInContext(GraphicsContext&, const FloatRect&) override;
@@ -163,7 +161,6 @@
     };
     DisplayMode currentDisplayMode() const;
     void updateDisplayMode();
-    void updatePausedImage();
 
     // MediaStreamPrivate::Observer
     void activeStatusChanged() override;
@@ -204,7 +201,6 @@
     bool m_ended { false };
     bool m_hasEverEnqueuedVideoFrame { false };
     bool m_hasReceivedMedia { false };
-    bool m_isFrameDisplayed { false };
 
 #if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
     std::unique_ptr<VideoFullscreenLayerManager> m_videoFullscreenLayerManager;

Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm (203838 => 203839)


--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm	2016-07-28 20:56:59 UTC (rev 203838)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm	2016-07-28 21:02:30 UTC (rev 203839)
@@ -129,39 +129,16 @@
     if (&track != m_mediaStreamPrivate->activeVideoTrack())
         return;
 
-    if (shouldEnqueueVideoSampleBuffer()) {
+    if (m_displayMode == LivePreview && [m_sampleBufferDisplayLayer isReadyForMoreMediaData]) {
         [m_sampleBufferDisplayLayer enqueueSampleBuffer:platformSample.sample.cmSampleBuffer];
-        m_isFrameDisplayed = true;
         
         if (!m_hasEverEnqueuedVideoFrame) {
             m_hasEverEnqueuedVideoFrame = true;
             m_player->firstVideoFrameAvailable();
-
-            updatePausedImage();
         }
     }
 }
 
-bool MediaPlayerPrivateMediaStreamAVFObjC::shouldEnqueueVideoSampleBuffer() const
-{
-    if (![m_sampleBufferDisplayLayer isReadyForMoreMediaData])
-        return false;
-
-    if (m_displayMode == LivePreview)
-        return true;
-
-    if (m_displayMode == PausedImage && !m_isFrameDisplayed)
-        return true;
-
-    return false;
-}
-
-void MediaPlayerPrivateMediaStreamAVFObjC::flushAndRemoveVideoSampleBuffers()
-{
-    [m_sampleBufferDisplayLayer flushAndRemoveImage];
-    m_isFrameDisplayed = false;
-}
-
 void MediaPlayerPrivateMediaStreamAVFObjC::ensureLayer()
 {
     if (m_sampleBufferDisplayLayer)
@@ -171,7 +148,6 @@
 #ifndef NDEBUG
     [m_sampleBufferDisplayLayer setName:@"MediaPlayerPrivateMediaStreamAVFObjC AVSampleBufferDisplayLayer"];
 #endif
-    m_sampleBufferDisplayLayer.get().backgroundColor = cachedCGColor(Color::black);
     
     renderingModeChanged();
     
@@ -281,24 +257,8 @@
         return;
     m_displayMode = displayMode;
 
-    if (m_displayMode < PausedImage && m_sampleBufferDisplayLayer)
-        flushAndRemoveVideoSampleBuffers();
-}
-
-void MediaPlayerPrivateMediaStreamAVFObjC::updatePausedImage()
-{
-    ASSERT(m_displayMode == currentDisplayMode());
-
-    if (m_displayMode < PausedImage)
+    if (m_displayMode == None)
         return;
-
-    RefPtr<Image> image = m_mediaStreamPrivate->currentFrameImage();
-    ASSERT(image);
-    if (!image)
-        return;
-
-    m_pausedImage = image->getCGImageRef();
-    ASSERT(m_pausedImage);
 }
 
 void MediaPlayerPrivateMediaStreamAVFObjC::play()
@@ -326,7 +286,6 @@
     m_clock->stop();
     m_playing = false;
     updateDisplayMode();
-    updatePausedImage();
 }
 
 bool MediaPlayerPrivateMediaStreamAVFObjC::paused() const
@@ -618,9 +577,10 @@
 
 void MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext(GraphicsContext& context, const FloatRect& rect)
 {
-    if (m_displayMode == None || !metaDataAvailable() || context.paintingDisabled())
+    if (m_displayMode == None || !metaDataAvailable() || context.paintingDisabled() || !m_haveEverPlayed)
         return;
 
+
     if (m_displayMode == LivePreview)
         m_mediaStreamPrivate->paintCurrentFrameInContext(context, rect);
     else {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to