Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: d0b6e889f00ee859d4f9ed8f7119a3ed3f5ad7cf
      
https://github.com/WebKit/WebKit/commit/d0b6e889f00ee859d4f9ed8f7119a3ed3f5ad7cf
  Author: Andy Estes <[email protected]>
  Date:   2023-10-23 (Mon, 23 Oct 2023)

  Changed paths:
    M LayoutTests/TestExpectations
    A 
LayoutTests/fast/canvas/webgl/texImage2D-mse-in-dom-flipY-false-expected.txt
    A LayoutTests/fast/canvas/webgl/texImage2D-mse-in-dom-flipY-false.html
    A 
LayoutTests/fast/canvas/webgl/texImage2D-mse-in-dom-flipY-true-expected.txt
    A LayoutTests/fast/canvas/webgl/texImage2D-mse-in-dom-flipY-true.html
    A 
LayoutTests/media/media-source/media-source-first-sample-pts-non-zero-canplay-expected.txt
    A 
LayoutTests/media/media-source/media-source-first-sample-pts-non-zero-canplay-without-renderer-expected.txt
    A 
LayoutTests/media/media-source/media-source-first-sample-pts-non-zero-canplay-without-renderer.html
    A 
LayoutTests/media/media-source/media-source-first-sample-pts-non-zero-canplay.html
    A LayoutTests/media/media-source/resources/first-sample-pts-non-zero/LICENSE
    A 
LayoutTests/media/media-source/resources/first-sample-pts-non-zero/first-sample-pts-non-zero.mp4
    M LayoutTests/platform/ios/TestExpectations
    M LayoutTests/platform/wincairo/TestExpectations
    M 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm

  Log Message:
  -----------
  [MediaSource] canplay event does not fire for video elements with renderers 
when first sample has a pts greater than 0
https://bugs.webkit.org/show_bug.cgi?id=263415
rdar://105169372

Reviewed by Jer Noble.

Some MediaSource content adds a source buffer where the first decoded sample 
has a presentation
start time that is slightly greater than 0. This exposes a bug in 
WebCoreDecompressionSession where
the "canplay" event is never dispatched because a sample whose pts matches the 
playback
synchronizer's current time is never decoded. This bug is tracked by 
webkit.org/b/263413.

Instead of addressing the issue in WebCoreDecompressionSession, this commit 
addresses the reason
why WebCoreDecompressionSession was being used to begin with for video elements 
with renderers.
In 252183@main, MediaPlayerPrivateMediaSourceAVFObjC::shouldEnsureLayer() was 
modified to return
false when a video element's bounds were empty to address a failure in
fast/canvas/webgl/texImage2D-mse-flipY-false.html, but this turned out to be 
overly restrictive.
-[AVSampleBufferDisplayLayer copyDisplayedPixelBuffer] actually does work 
properly when its bounds
are empty; it merely fails when the video element does not have a renderer. 
266162@main later added
a renderer check to MediaPlayerPrivateMediaSourceAVFObjC::shouldEnsureLayer(), 
making the
empty-bounds checks unnecessary.

This commit removes the empty-bounds checks from
MediaPlayerPrivateMediaSourceAVFObjC::shouldEnsureLayer(), ensuring we use an
AVSampleBufferDisplayLayer for decoding (which is not tripped up by the pts 
issue described above)
in all situations where the video element has a renderer.

Added tests to verify the following behaviors for video elements with renderers:
- video-in-canvas rendering continues to work via AVSampleBufferDisplayLayer 
with zero-sized video elements
- "canplay" event is dispatched for zero-sized video elements

Also added a failing test for the issue tracked in webkit.org/b/263413 and 
marked it as such in
TestExpectations.

* LayoutTests/TestExpectations:
* LayoutTests/fast/canvas/webgl/texImage2D-mse-in-dom-flipY-false-expected.txt: 
Added.
* LayoutTests/fast/canvas/webgl/texImage2D-mse-in-dom-flipY-false.html: Added.
* LayoutTests/fast/canvas/webgl/texImage2D-mse-in-dom-flipY-true-expected.txt: 
Added.
* LayoutTests/fast/canvas/webgl/texImage2D-mse-in-dom-flipY-true.html: Added.
* 
LayoutTests/media/media-source/media-source-first-sample-pts-non-zero-canplay-expected.txt:
 Added.
* 
LayoutTests/media/media-source/media-source-first-sample-pts-non-zero-canplay-without-renderer-expected.txt:
 Added.
* 
LayoutTests/media/media-source/media-source-first-sample-pts-non-zero-canplay-without-renderer.html:
 Added.
* 
LayoutTests/media/media-source/media-source-first-sample-pts-non-zero-canplay.html:
 Added.
* LayoutTests/media/media-source/resources/first-sample-pts-non-zero/LICENSE: 
Added.
* 
LayoutTests/media/media-source/resources/first-sample-pts-non-zero/first-sample-pts-non-zero.mp4:
 Added.
* LayoutTests/platform/ios/TestExpectations:
* LayoutTests/platform/wincairo/TestExpectations:
* 
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::shouldEnsureLayer const):

Canonical link: https://commits.webkit.org/269689@main


_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to