Define media buffering policy
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 May 2019 22:00:32 +0000 (22:00 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 7 May 2019 22:00:32 +0000 (22:00 +0000)
commit754266d1b0f3712cf525b0386aef17eba17515a4
tree57828e9518277f9c5337a9dab5f88681ca6b9cee
parentbc3f6b475999d59cc891e4dcf59d38e5982f494e
Define media buffering policy
https://bugs.webkit.org/show_bug.cgi?id=196979
<rdar://problem/28383861>

Reviewed by Jer Noble.

Source/WebCore:

Test: MediaBufferingPolicy API test.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::suspend):
(WebCore::HTMLMediaElement::resume):
(WebCore::HTMLMediaElement::createMediaPlayer):
(WebCore::HTMLMediaElement::setBufferingPolicy):
(WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
(WebCore::HTMLMediaElement::bufferingPolicy const):
(WebCore::HTMLMediaElement::setShouldBufferData): Deleted.
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::shouldBufferData const): Deleted.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::updateClientDataBuffering):
(WebCore::MediaElementSession::preferredBufferingPolicy const):
(WebCore::MediaElementSession::dataBufferingPermitted const): Deleted.
* html/MediaElementSession.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::setBufferingPolicy):
(WebCore::convertEnumerationToString):
(WebCore::MediaPlayer::setShouldBufferData): Deleted.
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerEnums.h:
(WTF::LogArgument<WebCore::MediaPlayerEnums::BufferingPolicy>::toString):
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::setBufferingPolicy):
(WebCore::MediaPlayerPrivateInterface::setShouldBufferData): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setBufferingPolicy):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldBufferData): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setBufferingPolicy):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::flushAndRemoveVideoSampleBuffers): Deleted.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setShouldBufferData): Deleted.
* testing/Internals.cpp:
(WebCore::Internals::elementShouldBufferData):
(WebCore::Internals::elementBufferingPolicy):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebCore/PAL:

* pal/spi/mac/AVFoundationSPI.h:

Source/WTF:

* wtf/Platform.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/MediaBufferingPolicy.mm: Added.
(waitUntilBufferingPolicyIsEqualTo):
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/Platform.h
Source/WebCore/ChangeLog
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/pal/spi/mac/AVFoundationSPI.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/MediaElementSession.cpp
Source/WebCore/html/MediaElementSession.h
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/MediaPlayer.h
Source/WebCore/platform/graphics/MediaPlayerEnums.h
Source/WebCore/platform/graphics/MediaPlayerPrivate.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Tools/ChangeLog
Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj
Tools/TestWebKitAPI/Tests/WebKitCocoa/MediaBufferingPolicy.mm [new file with mode: 0644]