[Mac] naturalSize not updated when preload=metadata
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 May 2014 21:32:11 +0000 (21:32 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 16 May 2014 21:32:11 +0000 (21:32 +0000)
commitf876662cafd3ff9b84a7dfc33cdb4fb25c0ac9ae
treef14416d418111a1a7b2704f95fbed403d2a252af
parent3a660050300ca42beb21b7e2c4607cd10277429f
[Mac] naturalSize not updated when preload=metadata
https://bugs.webkit.org/show_bug.cgi?id=132994

Reviewed by Eric Carlson.

Source/WebCore:
Test: media/video-load-preload-metadata-naturalsize.html

When preload=metadata, we never create an AVPlayerItem, and therefore never receive a
presentationSize KVO. When an AVAsset informs us that its tracks have changed, and there
is no AVPlayerItem, recalculate presentation size based on the first video track's natural
size.

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::tracksChanged):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):

LayoutTests:
* media/video-load-preload-metadata-naturalsize-expected.txt: Added.
* media/video-load-preload-metadata-naturalsize.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168979 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/video-load-preload-metadata-naturalsize-expected.txt [new file with mode: 0644]
LayoutTests/media/video-load-preload-metadata-naturalsize.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm