[Mac] The first software paint of a <video> element takes up to 2.5s.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Oct 2014 16:04:26 +0000 (16:04 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Oct 2014 16:04:26 +0000 (16:04 +0000)
commit7e37e2d1f511919630f553dca34cbc7a9bef628e
tree16cd4dfd02c2fe4a0295b58922d94f60d5abb9d9
parentedf3c5233fbcd20b637d27909e326d3050bd4e6d
[Mac] The first software paint of a <video> element takes up to 2.5s.
https://bugs.webkit.org/show_bug.cgi?id=137754

Reviewed by Brent Fulgham.

It turns out that, if you pass nil to -[AVPlayerItemVideoOutput initWithPixelBufferAttributes:]
the video output will not attempt to conform the resulting pixel buffers into a particular format.
This means that adding such a video output to a AVPlayerItem should have almost no performance
penalty, since the video output does not even copy the resulting buffers, but rather just retains
and returns the ones from the AVPlayerLayer.

Create and attach an AVPlayerItemVideoOutput after creating the AVPlayerItem, but before attaching
the player item to the AVPlayer. This eliminates the reconfigure step which occurs after attaching
a video output to an already attached AVPlayerItem.

When creating the AVPlayerItemVideoOutput, pass in `nil` for the pixelBufferAttributes parameter.

Instead of blocking waiting for output from the AVPlayerItemVideoOutput during creating, block and
whait when asked to paint with the video output.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
(WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoOutput):
(WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@175251 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm