Add encoders for MediaPlayerEnum enums
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Dec 2019 22:24:57 +0000 (22:24 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 11 Dec 2019 22:24:57 +0000 (22:24 +0000)
https://bugs.webkit.org/show_bug.cgi?id=205125
<rdar://problem/57842985>

Reviewed by Dean Jackson.

No new tests, no functional change.

* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::setPrivateAndOpen):
(WebCore::MediaSource::seekToTime):
(WebCore::MediaSource::monitorSourceBuffers):
(WebCore::MediaSource::streamEndedWithError):
(WebCore::MediaSource::isTypeSupported):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::removeCodedFrames):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::parseAttribute):
(WebCore::HTMLMediaElement::canPlayType const):
(WebCore::HTMLMediaElement::selectMediaResource):
(WebCore::HTMLMediaElement::loadResource):
(WebCore::HTMLMediaElement::mediaLoadingFailedFatally):
(WebCore::HTMLMediaElement::mediaLoadingFailed):
(WebCore::HTMLMediaElement::setNetworkState):
(WebCore::HTMLMediaElement::seekWithTolerance):
(WebCore::HTMLMediaElement::movieLoadType const):
(WebCore::HTMLMediaElement::preload const):
(WebCore::HTMLMediaElement::selectNextSourceChild):
(WebCore::HTMLMediaElement::mediaPlayerResourceNotSupported):
(WebCore::stringForNetworkState): Deleted.
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::videoFullscreenGravity const):
(WebCore::HTMLMediaElement::preloadValue const):
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::effectivePreloadForElement const):
* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(WebCore::VideoFullscreenModelVideoElement::requestFullscreenMode):
(WebCore::VideoFullscreenModelVideoElement::setVideoLayerGravity):
* platform/graphics/MediaPlayer.cpp:
(WebCore::bestMediaEngineForSupportParameters):
(WebCore::MediaPlayer::supportsType):
(WebCore::MediaPlayer::networkStateChanged):
(WebCore::convertEnumerationToString):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerEnums.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::hasAvailableVideoFrame const):
(WebCore::MediaPlayerPrivateInterface::movieLoadType const):
* platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType):
(WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
(WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
(WebCore::MediaPlayerPrivateAVFoundation::load):
(WebCore::MediaPlayerPrivateAVFoundation::prepareToPlay):
(WebCore::MediaPlayerPrivateAVFoundation::isReadyForVideoSetup const):
(WebCore::MediaPlayerPrivateAVFoundation::updateStates):
(WebCore::MediaPlayerPrivateAVFoundation::movieLoadType const):
(WebCore::MediaPlayerPrivateAVFoundation::setPreload):
* platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
(WebCore::MediaPlayerPrivateAVFoundation::metaDataAvailable const):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::MediaPlayerPrivateAVFoundationCF::supportsType):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity):
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
(WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::movieLoadType const):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::shouldBePlaying const):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsType):
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load):
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
(WebCore::MediaSourcePrivateAVFObjC::markEndOfStream):
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::readyState const):
(WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):
* platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
(WebCore::createMediaPlayerDecodingConfigurationCocoa):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::loadFull):
(WebCore::MediaPlayerPrivateGStreamer::load):
(WebCore::MediaPlayerPrivateGStreamer::cancelLoad):
(WebCore::MediaPlayerPrivateGStreamer::prepareToPlay):
(WebCore::MediaPlayerPrivateGStreamer::play):
(WebCore::MediaPlayerPrivateGStreamer::setPreload):
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
(WebCore::MediaPlayerPrivateGStreamer::updateStates):
(WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
(WebCore::MediaPlayerPrivateGStreamer::supportsType):
(WebCore::MediaPlayerPrivateGStreamer::updateDownloadBufferingFlag):
(WebCore::MediaPlayerPrivateGStreamer::movieLoadType const):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(dumpReadyState):
(WebCore::MediaPlayerPrivateGStreamerMSE::load):
(WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
(WebCore::MediaPlayerPrivateGStreamerMSE::setReadyState):
(WebCore::MediaPlayerPrivateGStreamerMSE::seekCompleted):
(WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):
(WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
(WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime const):
* platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp:
(WebCore::MediaPlayerPrivateHolePunch::supportsType):
* platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h:
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
(WebCore::MediaPlayerPrivateMediaFoundation::supportsType):
(WebCore::MediaPlayerPrivateMediaFoundation::load):
(WebCore::MediaPlayerPrivateMediaFoundation::updateReadyState):
(WebCore::MediaPlayerPrivateMediaFoundation::onSessionEnded):
* platform/ios/VideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerLayer setVideoGravity:]):
* platform/mac/VideoFullscreenInterfaceMac.mm:
(-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
(-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
* platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
(WebCore::MockMediaPlayerMediaSource::supportsType):
(WebCore::MockMediaPlayerMediaSource::MockMediaPlayerMediaSource):
* platform/mock/mediasource/MockMediaSourcePrivate.cpp:
(WebCore::MockMediaSourcePrivate::addSourceBuffer):
(WebCore::MockMediaSourcePrivate::markEndOfStream):
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
(WebCore::MockSourceBufferPrivate::readyState const):
(WebCore::MockSourceBufferPrivate::canSwitchToType):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253397 268f45cc-cd09-0410-ab3c-d52691b4dbfc

36 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/encryptedmedia/CDM.cpp
Source/WebCore/Modules/mediasource/MediaSource.cpp
Source/WebCore/Modules/mediasource/SourceBuffer.cpp
Source/WebCore/dom/DOMImplementation.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/MediaElementSession.cpp
Source/WebCore/platform/cocoa/VideoFullscreenModelVideoElement.mm
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/CDMPrivateMediaSourceAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp
Source/WebCore/platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h
Source/WebCore/platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm
Source/WebCore/platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h
Source/WebCore/platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp
Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp
Source/WebCore/platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h
Source/WebCore/platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp
Source/WebCore/platform/ios/VideoFullscreenInterfaceAVKit.mm
Source/WebCore/platform/mac/VideoFullscreenInterfaceMac.mm
Source/WebCore/platform/mock/mediasource/MockMediaPlayerMediaSource.cpp
Source/WebCore/platform/mock/mediasource/MockMediaSourcePrivate.cpp
Source/WebCore/platform/mock/mediasource/MockSourceBufferPrivate.cpp

index fe7e5d3..e94fd4e 100644 (file)
@@ -1,3 +1,146 @@
+2019-12-11  Eric Carlson  <eric.carlson@apple.com>
+
+        Add encoders for MediaPlayerEnum enums
+        https://bugs.webkit.org/show_bug.cgi?id=205125
+        <rdar://problem/57842985>
+
+        Reviewed by Dean Jackson.
+
+        No new tests, no functional change.
+
+        * Modules/encryptedmedia/CDM.cpp:
+        (WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
+        * Modules/mediasource/MediaSource.cpp:
+        (WebCore::MediaSource::setPrivateAndOpen):
+        (WebCore::MediaSource::seekToTime):
+        (WebCore::MediaSource::monitorSourceBuffers):
+        (WebCore::MediaSource::streamEndedWithError):
+        (WebCore::MediaSource::isTypeSupported):
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::removeCodedFrames):
+        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
+        * dom/DOMImplementation.cpp:
+        (WebCore::DOMImplementation::createDocument):
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::parseAttribute):
+        (WebCore::HTMLMediaElement::canPlayType const):
+        (WebCore::HTMLMediaElement::selectMediaResource):
+        (WebCore::HTMLMediaElement::loadResource):
+        (WebCore::HTMLMediaElement::mediaLoadingFailedFatally):
+        (WebCore::HTMLMediaElement::mediaLoadingFailed):
+        (WebCore::HTMLMediaElement::setNetworkState):
+        (WebCore::HTMLMediaElement::seekWithTolerance):
+        (WebCore::HTMLMediaElement::movieLoadType const):
+        (WebCore::HTMLMediaElement::preload const):
+        (WebCore::HTMLMediaElement::selectNextSourceChild):
+        (WebCore::HTMLMediaElement::mediaPlayerResourceNotSupported):
+        (WebCore::stringForNetworkState): Deleted.
+        * html/HTMLMediaElement.h:
+        (WebCore::HTMLMediaElement::videoFullscreenGravity const):
+        (WebCore::HTMLMediaElement::preloadValue const):
+        * html/MediaElementSession.cpp:
+        (WebCore::MediaElementSession::effectivePreloadForElement const):
+        * platform/cocoa/VideoFullscreenModelVideoElement.mm:
+        (WebCore::VideoFullscreenModelVideoElement::requestFullscreenMode):
+        (WebCore::VideoFullscreenModelVideoElement::setVideoLayerGravity):
+        * platform/graphics/MediaPlayer.cpp:
+        (WebCore::bestMediaEngineForSupportParameters):
+        (WebCore::MediaPlayer::supportsType):
+        (WebCore::MediaPlayer::networkStateChanged):
+        (WebCore::convertEnumerationToString):
+        * platform/graphics/MediaPlayer.h:
+        * platform/graphics/MediaPlayerEnums.h:
+        * platform/graphics/MediaPlayerPrivate.h:
+        (WebCore::MediaPlayerPrivateInterface::hasAvailableVideoFrame const):
+        (WebCore::MediaPlayerPrivateInterface::movieLoadType const):
+        * platform/graphics/avfoundation/CDMPrivateMediaSourceAVFObjC.mm:
+        (WebCore::CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType):
+        (WebCore::CDMPrivateMediaSourceAVFObjC::supportsMIMEType):
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation):
+        (WebCore::MediaPlayerPrivateAVFoundation::load):
+        (WebCore::MediaPlayerPrivateAVFoundation::prepareToPlay):
+        (WebCore::MediaPlayerPrivateAVFoundation::isReadyForVideoSetup const):
+        (WebCore::MediaPlayerPrivateAVFoundation::updateStates):
+        (WebCore::MediaPlayerPrivateAVFoundation::movieLoadType const):
+        (WebCore::MediaPlayerPrivateAVFoundation::setPreload):
+        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
+        (WebCore::MediaPlayerPrivateAVFoundation::metaDataAvailable const):
+        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
+        (WebCore::MediaPlayerPrivateAVFoundationCF::supportsType):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsType):
+        (WebCore::MediaPlayerPrivateAVFoundationObjC::supportsKeySystem):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::supportsType):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::load):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::movieLoadType const):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::shouldBePlaying const):
+        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setReadyState):
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
+        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
+        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsType):
+        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load):
+        * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
+        (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer):
+        (WebCore::MediaSourcePrivateAVFObjC::markEndOfStream):
+        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
+        (WebCore::SourceBufferPrivateAVFObjC::readyState const):
+        (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):
+        * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp:
+        (WebCore::createMediaPlayerDecodingConfigurationCocoa):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::loadFull):
+        (WebCore::MediaPlayerPrivateGStreamer::load):
+        (WebCore::MediaPlayerPrivateGStreamer::cancelLoad):
+        (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay):
+        (WebCore::MediaPlayerPrivateGStreamer::play):
+        (WebCore::MediaPlayerPrivateGStreamer::setPreload):
+        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
+        (WebCore::MediaPlayerPrivateGStreamer::updateStates):
+        (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation):
+        (WebCore::MediaPlayerPrivateGStreamer::supportsType):
+        (WebCore::MediaPlayerPrivateGStreamer::updateDownloadBufferingFlag):
+        (WebCore::MediaPlayerPrivateGStreamer::movieLoadType const):
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
+        (dumpReadyState):
+        (WebCore::MediaPlayerPrivateGStreamerMSE::load):
+        (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
+        (WebCore::MediaPlayerPrivateGStreamerMSE::setReadyState):
+        (WebCore::MediaPlayerPrivateGStreamerMSE::seekCompleted):
+        (WebCore::MediaPlayerPrivateGStreamerMSE::updateStates):
+        (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType):
+        (WebCore::MediaPlayerPrivateGStreamerMSE::currentMediaTime const):
+        * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.cpp:
+        (WebCore::MediaPlayerPrivateHolePunch::supportsType):
+        * platform/graphics/holepunch/MediaPlayerPrivateHolePunch.h:
+        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
+        (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation):
+        (WebCore::MediaPlayerPrivateMediaFoundation::supportsType):
+        (WebCore::MediaPlayerPrivateMediaFoundation::load):
+        (WebCore::MediaPlayerPrivateMediaFoundation::updateReadyState):
+        (WebCore::MediaPlayerPrivateMediaFoundation::onSessionEnded):
+        * platform/ios/VideoFullscreenInterfaceAVKit.mm:
+        (-[WebAVPlayerLayer setVideoGravity:]):
+        * platform/mac/VideoFullscreenInterfaceMac.mm:
+        (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]):
+        (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
+        * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
+        (WebCore::MockMediaPlayerMediaSource::supportsType):
+        (WebCore::MockMediaPlayerMediaSource::MockMediaPlayerMediaSource):
+        * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
+        (WebCore::MockMediaSourcePrivate::addSourceBuffer):
+        (WebCore::MockMediaSourcePrivate::markEndOfStream):
+        * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
+        (WebCore::MockSourceBufferPrivate::readyState const):
+        (WebCore::MockSourceBufferPrivate::canSwitchToType):
+
 2019-12-11  Sihui Liu  <sihui_liu@apple.com>
 
         IndexedDB: Introduce WebIDBServer class
index 6038add..4bbb2bc 100644 (file)
@@ -468,10 +468,11 @@ Optional<Vector<MediaKeySystemMediaCapability>> CDM::getSupportedCapabilitiesFor
         //       with restrictions:
         MediaEngineSupportParameters parameters;
         parameters.type = ContentType(contentType->mimeType());
-        if (!MediaPlayer::supportsType(parameters)) {
+        if (MediaPlayer::supportsType(parameters) == MediaPlayer::SupportsType::IsNotSupported) {
+
             // Try with Media Source:
             parameters.isMediaSource = true;
-            if (!MediaPlayer::supportsType(parameters))
+            if (MediaPlayer::supportsType(parameters) == MediaPlayer::SupportsType::IsNotSupported)
                 continue;
         }
 
index f4558c7..2a5adb7 100644 (file)
@@ -130,7 +130,7 @@ void MediaSource::setPrivateAndOpen(Ref<MediaSourcePrivate>&& mediaSourcePrivate
     //    Run the "If the media data cannot be fetched at all, due to network errors, causing the user agent to give up trying
     //    to fetch the resource" steps of the resource fetch algorithm's media data processing steps list.
     if (!isClosed()) {
-        m_mediaElement->mediaLoadingFailedFatally(MediaPlayer::NetworkError);
+        m_mediaElement->mediaLoadingFailedFatally(MediaPlayer::NetworkState::NetworkError);
         return;
     }
 
@@ -243,7 +243,7 @@ void MediaSource::seekToTime(const MediaTime& time)
     if (!hasBufferedTime(time)) {
         // 1. If the HTMLMediaElement.readyState attribute is greater than HAVE_METADATA,
         // then set the HTMLMediaElement.readyState attribute to HAVE_METADATA.
-        m_private->setReadyState(MediaPlayer::HaveMetadata);
+        m_private->setReadyState(MediaPlayer::ReadyState::HaveMetadata);
 
         // 2. The media element waits until an appendBuffer() or an appendStream() call causes the coded
         // frame processing algorithm to set the HTMLMediaElement.readyState attribute to a value greater
@@ -426,7 +426,7 @@ void MediaSource::monitorSourceBuffers()
 
     // Note, the behavior if activeSourceBuffers is empty is undefined.
     if (!m_activeSourceBuffers) {
-        m_private->setReadyState(MediaPlayer::HaveNothing);
+        m_private->setReadyState(MediaPlayer::ReadyState::HaveNothing);
         return;
     }
 
@@ -441,7 +441,7 @@ void MediaSource::monitorSourceBuffers()
         // 1. Set the HTMLMediaElement.readyState attribute to HAVE_METADATA.
         // 2. If this is the first transition to HAVE_METADATA, then queue a task to fire a simple event
         // named loadedmetadata at the media element.
-        m_private->setReadyState(MediaPlayer::HaveMetadata);
+        m_private->setReadyState(MediaPlayer::ReadyState::HaveMetadata);
 
         // 3. Abort these steps.
         return;
@@ -456,7 +456,7 @@ void MediaSource::monitorSourceBuffers()
         // 1. Set the HTMLMediaElement.readyState attribute to HAVE_ENOUGH_DATA.
         // 2. Queue a task to fire a simple event named canplaythrough at the media element.
         // 3. Playback may resume at this point if it was previously suspended by a transition to HAVE_CURRENT_DATA.
-        m_private->setReadyState(MediaPlayer::HaveEnoughData);
+        m_private->setReadyState(MediaPlayer::ReadyState::HaveEnoughData);
 
         if (m_pendingSeekTime.isValid())
             completeSeek();
@@ -471,7 +471,7 @@ void MediaSource::monitorSourceBuffers()
         // 1. Set the HTMLMediaElement.readyState attribute to HAVE_FUTURE_DATA.
         // 2. If the previous value of HTMLMediaElement.readyState was less than HAVE_FUTURE_DATA, then queue a task to fire a simple event named canplay at the media element.
         // 3. Playback may resume at this point if it was previously suspended by a transition to HAVE_CURRENT_DATA.
-        m_private->setReadyState(MediaPlayer::HaveFutureData);
+        m_private->setReadyState(MediaPlayer::ReadyState::HaveFutureData);
 
         if (m_pendingSeekTime.isValid())
             completeSeek();
@@ -488,7 +488,7 @@ void MediaSource::monitorSourceBuffers()
     // event named loadeddata at the media element.
     // 3. Playback is suspended at this point since the media element doesn't have enough data to
     // advance the media timeline.
-    m_private->setReadyState(MediaPlayer::HaveCurrentData);
+    m_private->setReadyState(MediaPlayer::ReadyState::HaveCurrentData);
 
     if (m_pendingSeekTime.isValid())
         completeSeek();
@@ -637,13 +637,13 @@ void MediaSource::streamEndedWithError(Optional<EndOfStreamError> error)
             //    Run the "If the media data cannot be fetched at all, due to network errors, causing
             //    the user agent to give up trying to fetch the resource" steps of the resource fetch algorithm.
             //    NOTE: This step is handled by HTMLMediaElement::mediaLoadingFailed().
-            m_mediaElement->mediaLoadingFailed(MediaPlayer::NetworkError);
+            m_mediaElement->mediaLoadingFailed(MediaPlayer::NetworkState::NetworkError);
         } else {
             //  ↳ If the HTMLMediaElement.readyState attribute is greater than HAVE_NOTHING
             //    Run the "If the connection is interrupted after some media data has been received, causing the
             //    user agent to give up trying to fetch the resource" steps of the resource fetch algorithm.
             //    NOTE: This step is handled by HTMLMediaElement::mediaLoadingFailedFatally().
-            m_mediaElement->mediaLoadingFailedFatally(MediaPlayer::NetworkError);
+            m_mediaElement->mediaLoadingFailedFatally(MediaPlayer::NetworkState::NetworkError);
         }
     } else {
         // ↳ If error is set to "decode"
@@ -654,12 +654,12 @@ void MediaSource::streamEndedWithError(Optional<EndOfStreamError> error)
             //    Run the "If the media data can be fetched but is found by inspection to be in an unsupported
             //    format, or can otherwise not be rendered at all" steps of the resource fetch algorithm.
             //    NOTE: This step is handled by HTMLMediaElement::mediaLoadingFailed().
-            m_mediaElement->mediaLoadingFailed(MediaPlayer::FormatError);
+            m_mediaElement->mediaLoadingFailed(MediaPlayer::NetworkState::FormatError);
         } else {
             //  ↳ If the HTMLMediaElement.readyState attribute is greater than HAVE_NOTHING
             //    Run the media data is corrupted steps of the resource fetch algorithm.
             //    NOTE: This step is handled by HTMLMediaElement::mediaLoadingFailedFatally().
-            m_mediaElement->mediaLoadingFailedFatally(MediaPlayer::DecodeError);
+            m_mediaElement->mediaLoadingFailedFatally(MediaPlayer::NetworkState::DecodeError);
         }
     }
 }
@@ -894,9 +894,9 @@ bool MediaSource::isTypeSupported(const String& type)
     MediaPlayer::SupportsType supported = MediaPlayer::supportsType(parameters);
 
     if (codecs.isEmpty())
-        return supported != MediaPlayer::IsNotSupported;
+        return supported != MediaPlayer::SupportsType::IsNotSupported;
 
-    return supported == MediaPlayer::IsSupported;
+    return supported == MediaPlayer::SupportsType::IsSupported;
 }
 
 bool MediaSource::isOpen() const
index 07fb0de..b9d4005 100644 (file)
@@ -883,8 +883,8 @@ void SourceBuffer::removeCodedFrames(const MediaTime& start, const MediaTime& en
         // 3.4 If this object is in activeSourceBuffers, the current playback position is greater than or equal to start
         // and less than the remove end timestamp, and HTMLMediaElement.readyState is greater than HAVE_METADATA, then set
         // the HTMLMediaElement.readyState attribute to HAVE_METADATA and stall playback.
-        if (m_active && currentMediaTime >= start && currentMediaTime < end && m_private->readyState() > MediaPlayer::HaveMetadata)
-            m_private->setReadyState(MediaPlayer::HaveMetadata);
+        if (m_active && currentMediaTime >= start && currentMediaTime < end && m_private->readyState() > MediaPlayer::ReadyState::HaveMetadata)
+            m_private->setReadyState(MediaPlayer::ReadyState::HaveMetadata);
     }
     
     updateBufferedFromTrackBuffers();
@@ -1285,7 +1285,7 @@ void SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment(const Init
     m_pendingInitializationSegmentForChangeType = false;
 
     // 6. If the HTMLMediaElement.readyState attribute is HAVE_NOTHING, then run the following steps:
-    if (m_private->readyState() == MediaPlayer::HaveNothing) {
+    if (m_private->readyState() == MediaPlayer::ReadyState::HaveNothing) {
         // 6.1 If one or more objects in sourceBuffers have first initialization segment flag set to false, then abort these steps.
         for (auto& sourceBuffer : *m_source->sourceBuffers()) {
             if (!sourceBuffer->m_receivedFirstInitializationSegment)
@@ -1294,14 +1294,14 @@ void SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment(const Init
 
         // 6.2 Set the HTMLMediaElement.readyState attribute to HAVE_METADATA.
         // 6.3 Queue a task to fire a simple event named loadedmetadata at the media element.
-        m_private->setReadyState(MediaPlayer::HaveMetadata);
+        m_private->setReadyState(MediaPlayer::ReadyState::HaveMetadata);
     }
 
     // 7. If the active track flag equals true and the HTMLMediaElement.readyState
     // attribute is greater than HAVE_CURRENT_DATA, then set the HTMLMediaElement.readyState
     // attribute to HAVE_METADATA.
-    if (activeTrackFlag && m_private->readyState() > MediaPlayer::HaveCurrentData)
-        m_private->setReadyState(MediaPlayer::HaveMetadata);
+    if (activeTrackFlag && m_private->readyState() > MediaPlayer::ReadyState::HaveCurrentData)
+        m_private->setReadyState(MediaPlayer::ReadyState::HaveMetadata);
 }
 
 bool SourceBuffer::validateInitializationSegment(const InitializationSegment& segment)
index 1466eaa..7a8af82 100644 (file)
@@ -159,7 +159,7 @@ Ref<Document> DOMImplementation::createDocument(const String& type, Frame* frame
     MediaEngineSupportParameters parameters;
     parameters.type = ContentType { type };
     parameters.url = url;
-    if (MediaPlayer::supportsType(parameters))
+    if (MediaPlayer::supportsType(parameters) != MediaPlayer::SupportsType::IsNotSupported)
         return MediaDocument::create(frame, url);
 #endif
 
index 8a9aa59..eb5ff56 100644 (file)
@@ -817,13 +817,13 @@ void HTMLMediaElement::parseAttribute(const QualifiedName& name, const AtomStrin
         updateSleepDisabling();
     else if (name == preloadAttr) {
         if (equalLettersIgnoringASCIICase(value, "none"))
-            m_preload = MediaPlayer::None;
+            m_preload = MediaPlayer::Preload::None;
         else if (equalLettersIgnoringASCIICase(value, "metadata"))
-            m_preload = MediaPlayer::MetaData;
+            m_preload = MediaPlayer::Preload::MetaData;
         else {
             // The spec does not define an "invalid value default" but "auto" is suggested as the
             // "missing value default", so use it for everything except "none" and "metadata"
-            m_preload = MediaPlayer::Auto;
+            m_preload = MediaPlayer::Preload::Auto;
         }
 
         // The attribute must be ignored if the autoplay attribute is present
@@ -1156,13 +1156,13 @@ String HTMLMediaElement::canPlayType(const String& mimeType) const
     // 4.8.10.3
     switch (support)
     {
-        case MediaPlayer::IsNotSupported:
+        case MediaPlayer::SupportsType::IsNotSupported:
             canPlay = emptyString();
             break;
-        case MediaPlayer::MayBeSupported:
+        case MediaPlayer::SupportsType::MayBeSupported:
             canPlay = "maybe"_s;
             break;
-        case MediaPlayer::IsSupported:
+        case MediaPlayer::SupportsType::IsSupported:
             canPlay = "probably"_s;
             break;
     }
@@ -1447,13 +1447,13 @@ void HTMLMediaElement::selectMediaResource()
             //    attribute was last changed.
             URL absoluteURL = getNonEmptyURLAttribute(srcAttr);
             if (absoluteURL.isEmpty()) {
-                mediaLoadingFailed(MediaPlayer::FormatError);
+                mediaLoadingFailed(MediaPlayer::NetworkState::FormatError);
                 ALWAYS_LOG(logSiteIdentifier, "empty 'src'");
                 return;
             }
 
             if (!isSafeToLoadURL(absoluteURL, Complain) || !dispatchBeforeLoadEvent(absoluteURL.string())) {
-                mediaLoadingFailed(MediaPlayer::FormatError);
+                mediaLoadingFailed(MediaPlayer::NetworkState::FormatError);
                 return;
             }
 
@@ -1509,26 +1509,26 @@ void HTMLMediaElement::loadResource(const URL& initialURL, ContentType& contentT
 
     RefPtr<Frame> frame = document().frame();
     if (!frame) {
-        mediaLoadingFailed(MediaPlayer::FormatError);
+        mediaLoadingFailed(MediaPlayer::NetworkState::FormatError);
         return;
     }
 
     Page* page = frame->page();
     if (!page) {
-        mediaLoadingFailed(MediaPlayer::FormatError);
+        mediaLoadingFailed(MediaPlayer::NetworkState::FormatError);
         return;
     }
 
     URL url = initialURL;
     if (!url.isEmpty() && !frame->loader().willLoadMediaElementURL(url, *this)) {
-        mediaLoadingFailed(MediaPlayer::FormatError);
+        mediaLoadingFailed(MediaPlayer::NetworkState::FormatError);
         return;
     }
 
 #if ENABLE(CONTENT_EXTENSIONS)
     if (auto documentLoader = makeRefPtr(frame->loader().documentLoader())) {
         if (page->userContentProvider().processContentRuleListsForLoad(url, ContentExtensions::ResourceType::Media, *documentLoader).summary.blockedLoad) {
-            mediaLoadingFailed(MediaPlayer::FormatError);
+            mediaLoadingFailed(MediaPlayer::NetworkState::FormatError);
             return;
         }
     }
@@ -1543,7 +1543,7 @@ void HTMLMediaElement::loadResource(const URL& initialURL, ContentType& contentT
         // Resources that are not present in the manifest will always fail to load (at least, after the
         // cache has been primed the first time), making the testing of offline applications simpler.
         if (!resource || resource->path().isEmpty()) {
-            mediaLoadingFailed(MediaPlayer::NetworkError);
+            mediaLoadingFailed(MediaPlayer::NetworkState::NetworkError);
             return;
         }
     }
@@ -1597,7 +1597,7 @@ void HTMLMediaElement::loadResource(const URL& initialURL, ContentType& contentT
             // Forget our reference to the MediaSource, so we leave it alone
             // while processing remainder of load failure.
             m_mediaSource = nullptr;
-            mediaLoadingFailed(MediaPlayer::FormatError);
+            mediaLoadingFailed(MediaPlayer::NetworkState::FormatError);
         }
     }
 #endif
@@ -1606,7 +1606,7 @@ void HTMLMediaElement::loadResource(const URL& initialURL, ContentType& contentT
         loadAttempted = true;
         ALWAYS_LOG(LOGIDENTIFIER, "loading media stream blob");
         if (!m_player->load(m_mediaStreamSrcObject->privateStream()))
-            mediaLoadingFailed(MediaPlayer::FormatError);
+            mediaLoadingFailed(MediaPlayer::NetworkState::FormatError);
     }
 #endif
 
@@ -1614,11 +1614,11 @@ void HTMLMediaElement::loadResource(const URL& initialURL, ContentType& contentT
         loadAttempted = true;
         ALWAYS_LOG(LOGIDENTIFIER, "loading generic blob");
         if (!m_player->load(m_blob->url(), contentType, keySystem))
-            mediaLoadingFailed(MediaPlayer::FormatError);
+            mediaLoadingFailed(MediaPlayer::NetworkState::FormatError);
     }
 
     if (!loadAttempted && !m_player->load(url, contentType, keySystem))
-        mediaLoadingFailed(MediaPlayer::FormatError);
+        mediaLoadingFailed(MediaPlayer::NetworkState::FormatError);
 
     // If there is no poster to display, allow the media engine to render video frames as soon as
     // they are available.
@@ -2214,9 +2214,9 @@ void HTMLMediaElement::mediaLoadingFailedFatally(MediaPlayer::NetworkState error
 
     // 2 - Set the error attribute to a new MediaError object whose code attribute is
     // set to MEDIA_ERR_NETWORK/MEDIA_ERR_DECODE.
-    if (error == MediaPlayer::NetworkError)
+    if (error == MediaPlayer::NetworkState::NetworkError)
         m_error = MediaError::create(MediaError::MEDIA_ERR_NETWORK);
-    else if (error == MediaPlayer::DecodeError)
+    else if (error == MediaPlayer::NetworkState::DecodeError)
         m_error = MediaError::create(MediaError::MEDIA_ERR_DECODE);
     else
         ASSERT_NOT_REACHED();
@@ -2285,20 +2285,6 @@ static void logMediaLoadRequest(Page* page, const String& mediaEngine, const Str
     page->sawMediaEngine(mediaEngine);
 }
 
-static String stringForNetworkState(MediaPlayer::NetworkState state)
-{
-    switch (state) {
-    case MediaPlayer::Empty: return "Empty"_s;
-    case MediaPlayer::Idle: return "Idle"_s;
-    case MediaPlayer::Loading: return "Loading"_s;
-    case MediaPlayer::Loaded: return "Loaded"_s;
-    case MediaPlayer::FormatError: return "FormatError"_s;
-    case MediaPlayer::NetworkError: return "NetworkError"_s;
-    case MediaPlayer::DecodeError: return "DecodeError"_s;
-    default: return emptyString();
-    }
-}
-
 void HTMLMediaElement::mediaLoadingFailed(MediaPlayer::NetworkState error)
 {
     stopPeriodicTimers();
@@ -2330,9 +2316,9 @@ void HTMLMediaElement::mediaLoadingFailed(MediaPlayer::NetworkState error)
         return;
     }
 
-    if ((error == MediaPlayer::NetworkError && m_readyState >= HAVE_METADATA) || error == MediaPlayer::DecodeError)
+    if ((error == MediaPlayer::NetworkState::NetworkError && m_readyState >= HAVE_METADATA) || error == MediaPlayer::NetworkState::DecodeError)
         mediaLoadingFailedFatally(error);
-    else if ((error == MediaPlayer::FormatError || error == MediaPlayer::NetworkError) && m_loadState == LoadingFromSrcAttr)
+    else if ((error == MediaPlayer::NetworkState::FormatError || error == MediaPlayer::NetworkState::NetworkError) && m_loadState == LoadingFromSrcAttr)
         noneSupported();
 
     updateDisplayState();
@@ -2343,7 +2329,7 @@ void HTMLMediaElement::mediaLoadingFailed(MediaPlayer::NetworkState error)
 
     ERROR_LOG(LOGIDENTIFIER, "error = ", static_cast<int>(error));
 
-    logMediaLoadRequest(document().page(), String(), stringForNetworkState(error), false);
+    logMediaLoadRequest(document().page(), String(), convertEnumerationToString(error), false);
 
     m_mediaSession->clientCharacteristicsChanged();
 }
@@ -2353,18 +2339,18 @@ void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
     if (static_cast<int>(state) != static_cast<int>(m_networkState))
         ALWAYS_LOG(LOGIDENTIFIER, "new state = ", state, ", current state = ", m_networkState);
 
-    if (state == MediaPlayer::Empty) {
+    if (state == MediaPlayer::NetworkState::Empty) {
         // Just update the cached state and leave, we can't do anything.
         m_networkState = NETWORK_EMPTY;
         return;
     }
 
-    if (state == MediaPlayer::FormatError || state == MediaPlayer::NetworkError || state == MediaPlayer::DecodeError) {
+    if (state == MediaPlayer::NetworkState::FormatError || state == MediaPlayer::NetworkState::NetworkError || state == MediaPlayer::NetworkState::DecodeError) {
         mediaLoadingFailed(state);
         return;
     }
 
-    if (state == MediaPlayer::Idle) {
+    if (state == MediaPlayer::NetworkState::Idle) {
         if (m_networkState > NETWORK_IDLE) {
             changeNetworkStateFromLoadingToIdle();
             setShouldDelayLoadEvent(false);
@@ -2373,13 +2359,13 @@ void HTMLMediaElement::setNetworkState(MediaPlayer::NetworkState state)
         }
     }
 
-    if (state == MediaPlayer::Loading) {
+    if (state == MediaPlayer::NetworkState::Loading) {
         if (m_networkState < NETWORK_LOADING || m_networkState == NETWORK_NO_SOURCE)
             startProgressEventTimer();
         m_networkState = NETWORK_LOADING;
     }
 
-    if (state == MediaPlayer::Loaded) {
+    if (state == MediaPlayer::NetworkState::Loaded) {
         if (m_networkState != NETWORK_IDLE)
             changeNetworkStateFromLoadingToIdle();
         m_completelyLoaded = true;
@@ -3026,7 +3012,7 @@ void HTMLMediaElement::seekWithTolerance(const MediaTime& inTime, const MediaTim
         return;
 
     // If the media engine has been told to postpone loading data, let it go ahead now.
-    if (m_preload < MediaPlayer::Auto && m_readyState < HAVE_FUTURE_DATA)
+    if (m_preload < MediaPlayer::Preload::Auto && m_readyState < HAVE_FUTURE_DATA)
         prepareToPlay();
 
     // Get the current time before setting m_seeking, m_lastSeekTime is returned once it is set.
@@ -3198,7 +3184,7 @@ HTMLMediaElement::ReadyState HTMLMediaElement::readyState() const
 
 MediaPlayer::MovieLoadType HTMLMediaElement::movieLoadType() const
 {
-    return m_player ? m_player->movieLoadType() : MediaPlayer::Unknown;
+    return m_player ? m_player->movieLoadType() : MediaPlayer::MovieLoadType::Unknown;
 }
 
 bool HTMLMediaElement::hasAudio() const
@@ -3494,11 +3480,11 @@ String HTMLMediaElement::preload() const
 #endif
 
     switch (m_preload) {
-    case MediaPlayer::None:
+    case MediaPlayer::Preload::None:
         return "none"_s;
-    case MediaPlayer::MetaData:
+    case MediaPlayer::Preload::MetaData:
         return "metadata"_s;
-    case MediaPlayer::Auto:
+    case MediaPlayer::Preload::Auto:
         return "auto"_s;
     }
 
@@ -4733,7 +4719,7 @@ URL HTMLMediaElement::selectNextSourceChild(ContentType* contentType, String* ke
             if (!document().settings().allowMediaContentTypesRequiringHardwareSupportAsFallback() || Traversal<HTMLSourceElement>::nextSkippingChildren(source))
                 parameters.contentTypesRequiringHardwareSupport = mediaContentTypesRequiringHardwareSupport();
 
-            if (!MediaPlayer::supportsType(parameters))
+            if (MediaPlayer::supportsType(parameters) == MediaPlayer::SupportsType::IsNotSupported)
                 goto CheckAgain;
         }
 
@@ -5070,7 +5056,7 @@ void HTMLMediaElement::mediaPlayerResourceNotSupported()
     INFO_LOG(LOGIDENTIFIER);
 
     // The MediaPlayer came across content which no installed engine supports.
-    mediaLoadingFailed(MediaPlayer::FormatError);
+    mediaLoadingFailed(MediaPlayer::NetworkState::FormatError);
 }
 
 // MediaPlayerPresentation methods
index f882753..a5f187b 100644 (file)
@@ -188,8 +188,8 @@ public:
     PlatformLayer* videoFullscreenLayer() const { return m_videoFullscreenLayer.get(); }
 #endif
     virtual void setVideoFullscreenFrame(FloatRect);
-    void setVideoFullscreenGravity(MediaPlayerEnums::VideoGravity);
-    MediaPlayerEnums::VideoGravity videoFullscreenGravity() const { return m_videoFullscreenGravity; }
+    void setVideoFullscreenGravity(MediaPlayer::VideoGravity);
+    MediaPlayer::VideoGravity videoFullscreenGravity() const { return m_videoFullscreenGravity; }
 #endif
 
     void scheduleCheckPlaybackTargetCompatability();
@@ -202,7 +202,7 @@ public:
     void scheduleNotifyAboutPlaying();
     void notifyAboutPlaying(PlayPromiseVector&&);
     
-    MediaPlayerEnums::MovieLoadType movieLoadType() const;
+    MediaPlayer::MovieLoadType movieLoadType() const;
     
     bool inActiveDocument() const { return m_inActiveDocument; }
 
@@ -496,8 +496,8 @@ public:
 
     unsigned long long fileSize() const;
 
-    void mediaLoadingFailed(MediaPlayerEnums::NetworkState);
-    void mediaLoadingFailedFatally(MediaPlayerEnums::NetworkState);
+    void mediaLoadingFailed(MediaPlayer::NetworkState);
+    void mediaLoadingFailedFatally(MediaPlayer::NetworkState);
 
 #if ENABLE(MEDIA_SESSION)
     WEBCORE_EXPORT double playerVolume() const;
@@ -516,7 +516,7 @@ public:
 
     RefPtr<VideoPlaybackQuality> getVideoPlaybackQuality();
 
-    MediaPlayerEnums::Preload preloadValue() const { return m_preload; }
+    MediaPlayer::Preload preloadValue() const { return m_preload; }
     MediaElementSession& mediaSession() const { return *m_mediaSession; }
 
 #if ENABLE(MEDIA_CONTROLS_SCRIPT)
@@ -651,8 +651,8 @@ private:
 
     virtual void updateDisplayState() { }
     
-    void setReadyState(MediaPlayerEnums::ReadyState);
-    void setNetworkState(MediaPlayerEnums::NetworkState);
+    void setReadyState(MediaPlayer::ReadyState);
+    void setNetworkState(MediaPlayer::NetworkState);
 
     double effectivePlaybackRate() const;
     double requestedPlaybackRate() const;
@@ -866,7 +866,7 @@ private:
     bool isBlocked() const;
     bool isBlockedOnMediaController() const;
     bool hasCurrentSrc() const override { return !m_currentSrc.isEmpty(); }
-    bool isLiveStream() const override { return movieLoadType() == MediaPlayerEnums::LiveStream; }
+    bool isLiveStream() const override { return movieLoadType() == MovieLoadType::LiveStream; }
 
     void updateSleepDisabling();
     enum class SleepType { None, Display, System };
@@ -1041,12 +1041,12 @@ private:
 #if PLATFORM(IOS_FAMILY) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     RetainPtr<PlatformLayer> m_videoFullscreenLayer;
     FloatRect m_videoFullscreenFrame;
-    MediaPlayerEnums::VideoGravity m_videoFullscreenGravity { MediaPlayer::VideoGravityResizeAspect };
+    MediaPlayer::VideoGravity m_videoFullscreenGravity { MediaPlayer::VideoGravity::ResizeAspect };
 #endif
 
     RefPtr<MediaPlayer> m_player;
 
-    MediaPlayerEnums::Preload m_preload { MediaPlayer::Auto };
+    MediaPlayer::Preload m_preload { Preload::Auto };
 
     DisplayMode m_displayMode { Unknown };
 
index 4c17268..de5ff37 100644 (file)
@@ -703,8 +703,8 @@ MediaPlayer::Preload MediaElementSession::effectivePreloadForElement() const
         return preload;
 
     if (m_restrictions & AutoPreloadingNotPermitted) {
-        if (preload > MediaPlayer::MetaData)
-            return MediaPlayer::MetaData;
+        if (preload > MediaPlayer::Preload::MetaData)
+            return MediaPlayer::Preload::MetaData;
     }
 
     return preload;
index 7b504c3..eb7f267 100644 (file)
@@ -148,7 +148,7 @@ void VideoFullscreenModelVideoElement::requestFullscreenMode(HTMLMediaElementEnu
     if (m_videoElement && m_videoElement->fullscreenMode() != mode)
         m_videoElement->setFullscreenMode(mode);
 
-    if (m_videoElement && finishedWithMedia && mode == MediaPlayerEnums::VideoFullscreenModeNone) {
+    if (m_videoElement && finishedWithMedia && mode == MediaPlayer::VideoFullscreenModeNone) {
         if (m_videoElement->document().isMediaDocument()) {
             if (auto* window = m_videoElement->document().domWindow())
                 window->history().back();
@@ -164,7 +164,7 @@ void VideoFullscreenModelVideoElement::setVideoLayerFrame(FloatRect rect)
         m_videoElement->setVideoFullscreenFrame(rect);
 }
 
-void VideoFullscreenModelVideoElement::setVideoLayerGravity(MediaPlayerEnums::VideoGravity gravity)
+void VideoFullscreenModelVideoElement::setVideoLayerGravity(MediaPlayer::VideoGravity gravity)
 {
     m_videoElement->setVideoFullscreenGravity(gravity);
 }
index 7d5bccd..ce23ab7 100644 (file)
@@ -143,8 +143,8 @@ public:
     bool hasClosedCaptions() const final { return false; }
     void setClosedCaptionsVisible(bool) final { };
 
-    MediaPlayer::NetworkState networkState() const final { return MediaPlayer::Empty; }
-    MediaPlayer::ReadyState readyState() const final { return MediaPlayer::HaveNothing; }
+    MediaPlayer::NetworkState networkState() const final { return MediaPlayer::NetworkState::Empty; }
+    MediaPlayer::ReadyState readyState() const final { return MediaPlayer::ReadyState::HaveNothing; }
 
     float maxTimeSeekable() const final { return 0; }
     double minTimeSeekable() const final { return 0; }
@@ -312,7 +312,7 @@ static const MediaPlayerFactory* bestMediaEngineForSupportParameters(const Media
     }
 
     const MediaPlayerFactory* foundEngine = nullptr;
-    MediaPlayer::SupportsType supported = MediaPlayer::IsNotSupported;
+    MediaPlayer::SupportsType supported = MediaPlayer::SupportsType::IsNotSupported;
     for (auto& engine : installedMediaEngines()) {
         if (current) {
             if (current == &engine)
@@ -916,11 +916,11 @@ MediaPlayer::SupportsType MediaPlayer::supportsType(const MediaEngineSupportPara
     // user agent knows it cannot render or is the type "application/octet-stream"
     AtomString containerType = parameters.type.containerType();
     if (containerType == applicationOctetStream())
-        return IsNotSupported;
+        return SupportsType::IsNotSupported;
 
     const MediaPlayerFactory* engine = bestMediaEngineForSupportParameters(parameters);
     if (!engine)
-        return IsNotSupported;
+        return SupportsType::IsNotSupported;
 
     return engine->supportsTypeAndCodecs(parameters);
 }
@@ -1170,7 +1170,7 @@ void MediaPlayer::networkStateChanged()
 {
     // If more than one media engine is installed and this one failed before finding metadata,
     // let the next engine try.
-    if (m_private->networkState() >= FormatError && m_private->readyState() < HaveMetadata) {
+    if (m_private->networkState() >= MediaPlayer::NetworkState::FormatError && m_private->readyState() < MediaPlayer::ReadyState::HaveMetadata) {
         client().mediaPlayerEngineFailedToLoad();
         if (installedMediaEngines().size() > 1 && (m_contentType.isEmpty() || nextBestMediaEngine(m_currentMediaEngine))) {
             m_reloadTimer.startOneShot(0_s);
@@ -1566,7 +1566,7 @@ const Logger& MediaPlayer::mediaPlayerLogger()
 }
 #endif
 
-String convertEnumerationToString(MediaPlayerEnums::ReadyState enumerationValue)
+String convertEnumerationToString(MediaPlayer::ReadyState enumerationValue)
 {
     static const NeverDestroyed<String> values[] = {
         MAKE_STATIC_STRING_IMPL("HaveNothing"),
@@ -1575,16 +1575,16 @@ String convertEnumerationToString(MediaPlayerEnums::ReadyState enumerationValue)
         MAKE_STATIC_STRING_IMPL("HaveFutureData"),
         MAKE_STATIC_STRING_IMPL("HaveEnoughData"),
     };
-    static_assert(static_cast<size_t>(MediaPlayerEnums::HaveNothing) == 0, "MediaPlayerEnums::HaveNothing is not 0 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::HaveMetadata) == 1, "MediaPlayerEnums::HaveMetadata is not 1 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::HaveCurrentData) == 2, "MediaPlayerEnums::HaveCurrentData is not 2 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::HaveFutureData) == 3, "MediaPlayerEnums::HaveFutureData is not 3 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::HaveEnoughData) == 4, "MediaPlayerEnums::HaveEnoughData is not 4 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::ReadyState::HaveNothing) == 0, "MediaPlayer::ReadyState::HaveNothing is not 0 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::ReadyState::HaveMetadata) == 1, "MediaPlayer::ReadyState::HaveMetadata is not 1 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::ReadyState::HaveCurrentData) == 2, "MediaPlayer::ReadyState::HaveCurrentData is not 2 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::ReadyState::HaveFutureData) == 3, "MediaPlayer::ReadyState::HaveFutureData is not 3 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::ReadyState::HaveEnoughData) == 4, "MediaPlayer::ReadyState::HaveEnoughData is not 4 as expected");
     ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values));
     return values[static_cast<size_t>(enumerationValue)];
 }
 
-String convertEnumerationToString(MediaPlayerEnums::NetworkState enumerationValue)
+String convertEnumerationToString(MediaPlayer::NetworkState enumerationValue)
 {
     static const NeverDestroyed<String> values[] = {
         MAKE_STATIC_STRING_IMPL("Empty"),
@@ -1595,46 +1595,46 @@ String convertEnumerationToString(MediaPlayerEnums::NetworkState enumerationValu
         MAKE_STATIC_STRING_IMPL("NetworkError"),
         MAKE_STATIC_STRING_IMPL("DecodeError"),
     };
-    static_assert(static_cast<size_t>(MediaPlayerEnums::Empty) == 0, "MediaPlayerEnums::Empty is not 0 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::Idle) == 1, "MediaPlayerEnums::Idle is not 1 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::Loading) == 2, "MediaPlayerEnums::Loading is not 2 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::Loaded) == 3, "MediaPlayerEnums::Loaded is not 3 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::FormatError) == 4, "MediaPlayerEnums::FormatError is not 4 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::NetworkError) == 5, "MediaPlayerEnums::NetworkError is not 5 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::DecodeError) == 6, "MediaPlayerEnums::DecodeError is not 6 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::NetworkState::Empty) == 0, "MediaPlayer::NetworkState::Empty is not 0 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::NetworkState::Idle) == 1, "MediaPlayer::NetworkState::Idle is not 1 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::NetworkState::Loading) == 2, "MediaPlayer::NetworkState::Loading is not 2 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::NetworkState::Loaded) == 3, "MediaPlayer::NetworkState::Loaded is not 3 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::NetworkState::FormatError) == 4, "MediaPlayer::NetworkState::FormatError is not 4 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::NetworkState::NetworkError) == 5, "MediaPlayer::NetworkError is not 5 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::NetworkState::DecodeError) == 6, "MediaPlayer::NetworkState::DecodeError is not 6 as expected");
     ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values));
     return values[static_cast<size_t>(enumerationValue)];
 }
 
-String convertEnumerationToString(MediaPlayerEnums::Preload enumerationValue)
+String convertEnumerationToString(MediaPlayer::Preload enumerationValue)
 {
     static const NeverDestroyed<String> values[] = {
         MAKE_STATIC_STRING_IMPL("None"),
         MAKE_STATIC_STRING_IMPL("MetaData"),
         MAKE_STATIC_STRING_IMPL("Auto"),
     };
-    static_assert(!static_cast<size_t>(MediaPlayerEnums::None), "MediaPlayerEnums::None is not 0 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::MetaData) == 1, "MediaPlayerEnums::MetaData is not 1 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::Auto) == 2, "MediaPlayerEnums::Auto is not 2 as expected");
+    static_assert(!static_cast<size_t>(MediaPlayer::Preload::None), "MediaPlayer::Preload::None is not 0 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::Preload::MetaData) == 1, "MediaPlayer::Preload::MetaData is not 1 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::Preload::Auto) == 2, "MediaPlayer::Preload::Auto is not 2 as expected");
     ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values));
     return values[static_cast<size_t>(enumerationValue)];
 }
 
-String convertEnumerationToString(MediaPlayerEnums::SupportsType enumerationValue)
+String convertEnumerationToString(MediaPlayer::SupportsType enumerationValue)
 {
     static const NeverDestroyed<String> values[] = {
         MAKE_STATIC_STRING_IMPL("IsNotSupported"),
         MAKE_STATIC_STRING_IMPL("IsSupported"),
         MAKE_STATIC_STRING_IMPL("MayBeSupported"),
     };
-    static_assert(!static_cast<size_t>(MediaPlayerEnums::IsNotSupported), "MediaPlayerEnums::IsNotSupported is not 0 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::IsSupported) == 1, "MediaPlayerEnums::IsSupported is not 1 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::MayBeSupported) == 2, "MediaPlayerEnums::MayBeSupported is not 2 as expected");
+    static_assert(!static_cast<size_t>(MediaPlayer::SupportsType::IsNotSupported), "MediaPlayer::SupportsType::IsNotSupported is not 0 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::SupportsType::IsSupported) == 1, "MediaPlayer::SupportsType::IsSupported is not 1 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::SupportsType::MayBeSupported) == 2, "MediaPlayer::SupportsType::MayBeSupported is not 2 as expected");
     ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values));
     return values[static_cast<size_t>(enumerationValue)];
 }
 
-String convertEnumerationToString(MediaPlayerEnums::BufferingPolicy enumerationValue)
+String convertEnumerationToString(MediaPlayer::BufferingPolicy enumerationValue)
 {
     static const NeverDestroyed<String> values[] = {
         MAKE_STATIC_STRING_IMPL("Default"),
@@ -1642,10 +1642,10 @@ String convertEnumerationToString(MediaPlayerEnums::BufferingPolicy enumerationV
         MAKE_STATIC_STRING_IMPL("MakeResourcesPurgeable"),
         MAKE_STATIC_STRING_IMPL("PurgeResources"),
     };
-    static_assert(!static_cast<size_t>(MediaPlayerEnums::BufferingPolicy::Default), "MediaPlayerEnums::Default is not 0 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::BufferingPolicy::LimitReadAhead) == 1, "MediaPlayerEnums::LimitReadAhead is not 1 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::BufferingPolicy::MakeResourcesPurgeable) == 2, "MediaPlayerEnums::MakeResourcesPurgeable is not 2 as expected");
-    static_assert(static_cast<size_t>(MediaPlayerEnums::BufferingPolicy::PurgeResources) == 3, "MediaPlayerEnums::PurgeResources is not 3 as expected");
+    static_assert(!static_cast<size_t>(MediaPlayer::BufferingPolicy::Default), "MediaPlayer::Default is not 0 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::BufferingPolicy::LimitReadAhead) == 1, "MediaPlayer::LimitReadAhead is not 1 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::BufferingPolicy::MakeResourcesPurgeable) == 2, "MediaPlayer::MakeResourcesPurgeable is not 2 as expected");
+    static_assert(static_cast<size_t>(MediaPlayer::BufferingPolicy::PurgeResources) == 3, "MediaPlayer::PurgeResources is not 3 as expected");
     ASSERT(static_cast<size_t>(enumerationValue) < WTF_ARRAY_LENGTH(values));
     return values[static_cast<size_t>(enumerationValue)];
 }
index fb9eba0..8a7b1e9 100644 (file)
@@ -253,7 +253,6 @@ public:
     void invalidate();
 
     // Media engine support.
-    using MediaPlayerEnums::SupportsType;
     static SupportsType supportsType(const MediaEngineSupportParameters&);
     static void getSupportedTypes(HashSet<String, ASCIICaseInsensitiveHash>&);
     static bool isAvailable();
@@ -611,7 +610,7 @@ private:
     ContentType m_contentType;
     String m_keySystem;
     IntSize m_size;
-    Preload m_preload { Auto };
+    Preload m_preload { Preload::Auto };
     double m_volume { 1 };
     bool m_visible { false };
     bool m_muted { false };
index 0195c69..4b10f04 100644 (file)
@@ -31,12 +31,49 @@ namespace WebCore {
 
 class MediaPlayerEnums {
 public:
-    enum NetworkState { Empty, Idle, Loading, Loaded, FormatError, NetworkError, DecodeError };
-    enum ReadyState  { HaveNothing, HaveMetadata, HaveCurrentData, HaveFutureData, HaveEnoughData };
-    enum MovieLoadType { Unknown, Download, StoredStream, LiveStream };
-    enum Preload { None, MetaData, Auto };
-    enum VideoGravity { VideoGravityResize, VideoGravityResizeAspect, VideoGravityResizeAspectFill };
-    enum SupportsType { IsNotSupported, IsSupported, MayBeSupported };
+    enum class NetworkState : uint8_t {
+        Empty,
+        Idle,
+        Loading,
+        Loaded,
+        FormatError,
+        NetworkError,
+        DecodeError
+    };
+
+    enum class ReadyState : uint8_t {
+        HaveNothing,
+        HaveMetadata,
+        HaveCurrentData,
+        HaveFutureData,
+        HaveEnoughData
+    };
+
+    enum class MovieLoadType : uint8_t {
+        Unknown,
+        Download,
+        StoredStream,
+        LiveStream
+    };
+
+    enum class Preload : uint8_t {
+        None,
+        MetaData,
+        Auto
+    };
+
+    enum class VideoGravity : uint8_t {
+        Resize,
+        ResizeAspect,
+        ResizeAspectFill
+    };
+
+    enum class SupportsType : uint8_t {
+        IsNotSupported,
+        IsSupported,
+        MayBeSupported
+    };
+
     enum {
         VideoFullscreenModeNone = 0,
         VideoFullscreenModeStandard = 1 << 0,
@@ -44,7 +81,7 @@ public:
     };
     typedef uint32_t VideoFullscreenMode;
 
-    enum class BufferingPolicy {
+    enum class BufferingPolicy : uint8_t {
         Default,
         LimitReadAhead,
         MakeResourcesPurgeable,
@@ -90,4 +127,76 @@ struct LogArgument<WebCore::MediaPlayerEnums::BufferingPolicy> {
     }
 };
 
+template<> struct EnumTraits<WebCore::MediaPlayerEnums::NetworkState> {
+    using values = EnumValues<
+        WebCore::MediaPlayerEnums::NetworkState,
+        WebCore::MediaPlayerEnums::NetworkState::Empty,
+        WebCore::MediaPlayerEnums::NetworkState::Idle,
+        WebCore::MediaPlayerEnums::NetworkState::Loading,
+        WebCore::MediaPlayerEnums::NetworkState::Loaded,
+        WebCore::MediaPlayerEnums::NetworkState::FormatError,
+        WebCore::MediaPlayerEnums::NetworkState::NetworkError,
+        WebCore::MediaPlayerEnums::NetworkState::DecodeError
+    >;
+};
+
+
+template<> struct EnumTraits<WebCore::MediaPlayerEnums::ReadyState> {
+    using values = EnumValues<
+        WebCore::MediaPlayerEnums::ReadyState,
+        WebCore::MediaPlayerEnums::ReadyState::HaveNothing,
+        WebCore::MediaPlayerEnums::ReadyState::HaveMetadata,
+        WebCore::MediaPlayerEnums::ReadyState::HaveCurrentData,
+        WebCore::MediaPlayerEnums::ReadyState::HaveFutureData,
+        WebCore::MediaPlayerEnums::ReadyState::HaveEnoughData
+    >;
+};
+
+template<> struct EnumTraits<WebCore::MediaPlayerEnums::MovieLoadType> {
+    using values = EnumValues<
+        WebCore::MediaPlayerEnums::MovieLoadType,
+        WebCore::MediaPlayerEnums::MovieLoadType::Unknown,
+        WebCore::MediaPlayerEnums::MovieLoadType::Download,
+        WebCore::MediaPlayerEnums::MovieLoadType::StoredStream,
+        WebCore::MediaPlayerEnums::MovieLoadType::LiveStream
+    >;
+};
+
+template<> struct EnumTraits<WebCore::MediaPlayerEnums::Preload> {
+    using values = EnumValues<
+        WebCore::MediaPlayerEnums::Preload,
+        WebCore::MediaPlayerEnums::Preload::None,
+        WebCore::MediaPlayerEnums::Preload::MetaData,
+        WebCore::MediaPlayerEnums::Preload::Auto
+    >;
+};
+
+template<> struct EnumTraits<WebCore::MediaPlayerEnums::VideoGravity> {
+    using values = EnumValues<
+        WebCore::MediaPlayerEnums::VideoGravity,
+        WebCore::MediaPlayerEnums::VideoGravity::Resize,
+        WebCore::MediaPlayerEnums::VideoGravity::ResizeAspect,
+        WebCore::MediaPlayerEnums::VideoGravity::ResizeAspectFill
+    >;
+};
+
+template<> struct EnumTraits<WebCore::MediaPlayerEnums::SupportsType> {
+    using values = EnumValues<
+        WebCore::MediaPlayerEnums::SupportsType,
+        WebCore::MediaPlayerEnums::SupportsType::IsNotSupported,
+        WebCore::MediaPlayerEnums::SupportsType::IsSupported,
+        WebCore::MediaPlayerEnums::SupportsType::MayBeSupported
+    >;
+};
+
+template<> struct EnumTraits<WebCore::MediaPlayerEnums::BufferingPolicy> {
+    using values = EnumValues<
+        WebCore::MediaPlayerEnums::BufferingPolicy,
+        WebCore::MediaPlayerEnums::BufferingPolicy::Default,
+        WebCore::MediaPlayerEnums::BufferingPolicy::LimitReadAhead,
+        WebCore::MediaPlayerEnums::BufferingPolicy::MakeResourcesPurgeable,
+        WebCore::MediaPlayerEnums::BufferingPolicy::PurgeResources
+    >;
+};
+
 }; // namespace WTF
index 1d2fc00..dbcc05f 100644 (file)
@@ -151,7 +151,7 @@ public:
 
     virtual void setPreload(MediaPlayer::Preload) { }
 
-    virtual bool hasAvailableVideoFrame() const { return readyState() >= MediaPlayer::HaveCurrentData; }
+    virtual bool hasAvailableVideoFrame() const { return readyState() >= MediaPlayer::ReadyState::HaveCurrentData; }
 
     virtual bool canLoadPoster() const { return false; }
     virtual void setPoster(const String&) { }
@@ -192,7 +192,7 @@ public:
     virtual bool didPassCORSAccessCheck() const { return false; }
     virtual Optional<bool> wouldTaintOrigin(const SecurityOrigin&) const { return WTF::nullopt; }
 
-    virtual MediaPlayer::MovieLoadType movieLoadType() const { return MediaPlayer::Unknown; }
+    virtual MediaPlayer::MovieLoadType movieLoadType() const { return MediaPlayer::MovieLoadType::Unknown; }
 
     virtual void prepareForRendering() { }
 
index 0cd0129..e8d1260 100644 (file)
@@ -114,7 +114,7 @@ bool CDMPrivateMediaSourceAVFObjC::supportsKeySystemAndMimeType(const String& ke
     parameters.isMediaSource = true;
     parameters.type = ContentType(mimeType);
 
-    return MediaPlayerPrivateMediaSourceAVFObjC::supportsType(parameters) != MediaPlayer::IsNotSupported;
+    return MediaPlayerPrivateMediaSourceAVFObjC::supportsType(parameters) != MediaPlayer::SupportsType::IsNotSupported;
 }
 
 bool CDMPrivateMediaSourceAVFObjC::supportsMIMEType(const String& mimeType)
@@ -127,7 +127,7 @@ bool CDMPrivateMediaSourceAVFObjC::supportsMIMEType(const String& mimeType)
     parameters.isMediaSource = true;
     parameters.type = ContentType(mimeType);
 
-    return MediaPlayerPrivateMediaSourceAVFObjC::supportsType(parameters) != MediaPlayer::IsNotSupported;
+    return MediaPlayerPrivateMediaSourceAVFObjC::supportsType(parameters) != MediaPlayer::SupportsType::IsNotSupported;
 }
 
 std::unique_ptr<LegacyCDMSession> CDMPrivateMediaSourceAVFObjC::createSession(LegacyCDMSessionClient* client)
index a7d0470..a7df43f 100644 (file)
@@ -58,9 +58,9 @@ MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation(MediaPlayer* play
     : m_player(player)
     , m_queuedNotifications()
     , m_queueMutex()
-    , m_networkState(MediaPlayer::Empty)
-    , m_readyState(MediaPlayer::HaveNothing)
-    , m_preload(MediaPlayer::Auto)
+    , m_networkState(MediaPlayer::NetworkState::Empty)
+    , m_readyState(MediaPlayer::ReadyState::HaveNothing)
+    , m_preload(MediaPlayer::Preload::Auto)
 #if !RELEASE_LOG_DISABLED
     , m_logger(player->mediaPlayerLogger())
     , m_logIdentifier(player->mediaPlayerLogIdentifier())
@@ -168,8 +168,8 @@ void MediaPlayerPrivateAVFoundation::load(const String& url)
 {
     ALWAYS_LOG(LOGIDENTIFIER);
 
-    setNetworkState(m_preload == MediaPlayer::None ? MediaPlayer::Idle : MediaPlayer::Loading);
-    setReadyState(MediaPlayer::HaveNothing);
+    setNetworkState(m_preload == MediaPlayer::Preload::None ? MediaPlayer::NetworkState::Idle : MediaPlayer::NetworkState::Loading);
+    setReadyState(MediaPlayer::ReadyState::HaveNothing);
 
     m_assetURL = URL({ }, url);
     m_requestedOrigin = SecurityOrigin::create(m_assetURL);
@@ -184,7 +184,7 @@ void MediaPlayerPrivateAVFoundation::load(const String& url)
 #if ENABLE(MEDIA_SOURCE)
 void MediaPlayerPrivateAVFoundation::load(const String&, MediaSourcePrivateClient*)
 {
-    setNetworkState(MediaPlayer::FormatError);
+    setNetworkState(MediaPlayer::NetworkState::FormatError);
 }
 #endif
 
@@ -210,7 +210,7 @@ void MediaPlayerPrivateAVFoundation::playabilityKnown()
 void MediaPlayerPrivateAVFoundation::prepareToPlay()
 {
     ALWAYS_LOG(LOGIDENTIFIER);
-    setPreload(MediaPlayer::Auto);
+    setPreload(MediaPlayer::Preload::Auto);
 }
 
 void MediaPlayerPrivateAVFoundation::play()
@@ -440,7 +440,7 @@ bool MediaPlayerPrivateAVFoundation::isReadyForVideoSetup() const
     // AVFoundation will not return true for firstVideoFrameAvailable until
     // an AVPlayerLayer has been added to the AVPlayerItem, so allow video setup
     // here if a video track to trigger allocation of a AVPlayerLayer.
-    return (m_isAllowedToRender || m_cachedHasVideo) && m_readyState >= MediaPlayer::HaveMetadata && m_player->visible();
+    return (m_isAllowedToRender || m_cachedHasVideo) && m_readyState >= MediaPlayer::ReadyState::HaveMetadata && m_player->visible();
 }
 
 void MediaPlayerPrivateAVFoundation::prepareForRendering()
@@ -491,30 +491,30 @@ void MediaPlayerPrivateAVFoundation::updateStates()
     MediaPlayer::ReadyState newReadyState = m_readyState;
 
     if (m_loadingMetadata)
-        newNetworkState = MediaPlayer::Loading;
+        newNetworkState = MediaPlayer::NetworkState::Loading;
     else {
         // -loadValuesAsynchronouslyForKeys:completionHandler: has invoked its handler; test status of keys and determine state.
         AssetStatus assetStatus = this->assetStatus();
         ItemStatus itemStatus = playerItemStatus();
         
         m_assetIsPlayable = (assetStatus == MediaPlayerAVAssetStatusPlayable);
-        if (m_readyState < MediaPlayer::HaveMetadata && assetStatus > MediaPlayerAVAssetStatusLoading) {
+        if (m_readyState < MediaPlayer::ReadyState::HaveMetadata && assetStatus > MediaPlayerAVAssetStatusLoading) {
             if (m_assetIsPlayable) {
                 if (assetStatus >= MediaPlayerAVAssetStatusLoaded)
-                    newReadyState = MediaPlayer::HaveMetadata;
+                    newReadyState = MediaPlayer::ReadyState::HaveMetadata;
                 if (itemStatus <= MediaPlayerAVPlayerItemStatusUnknown) {
-                    if (assetStatus == MediaPlayerAVAssetStatusFailed || m_preload > MediaPlayer::MetaData || isLiveStream()) {
+                    if (assetStatus == MediaPlayerAVAssetStatusFailed || m_preload > MediaPlayer::Preload::MetaData || isLiveStream()) {
                         // The asset is playable but doesn't support inspection prior to playback (eg. streaming files),
                         // or we are supposed to prepare for playback immediately, so create the player item now.
-                        newNetworkState = MediaPlayer::Loading;
+                        newNetworkState = MediaPlayer::NetworkState::Loading;
                         prepareToPlay();
                     } else
-                        newNetworkState = MediaPlayer::Idle;
+                        newNetworkState = MediaPlayer::NetworkState::Idle;
                 }
             } else {
                 // FIX ME: fetch the error associated with the @"playable" key to distinguish between format 
                 // and network errors.
-                newNetworkState = MediaPlayer::FormatError;
+                newNetworkState = MediaPlayer::NetworkState::FormatError;
             }
         }
         
@@ -530,25 +530,25 @@ void MediaPlayerPrivateAVFoundation::updateStates()
                 // If the status becomes PlaybackBufferFull, loading stops and the status will not
                 // progress to LikelyToKeepUp. Set the readyState to  HAVE_ENOUGH_DATA, on the
                 // presumption that if the playback buffer is full, playback will probably not stall.
-                newReadyState = MediaPlayer::HaveEnoughData;
+                newReadyState = MediaPlayer::ReadyState::HaveEnoughData;
                 break;
 
             case MediaPlayerAVPlayerItemStatusReadyToPlay:
-                if (m_readyState != MediaPlayer::HaveEnoughData && maxTimeLoaded() > currentMediaTime())
-                    newReadyState = MediaPlayer::HaveFutureData;
+                if (m_readyState != MediaPlayer::ReadyState::HaveEnoughData && maxTimeLoaded() > currentMediaTime())
+                    newReadyState = MediaPlayer::ReadyState::HaveFutureData;
                 break;
 
             case MediaPlayerAVPlayerItemStatusPlaybackBufferEmpty:
-                newReadyState = MediaPlayer::HaveCurrentData;
+                newReadyState = MediaPlayer::ReadyState::HaveCurrentData;
                 break;
             }
 
             if (itemStatus == MediaPlayerAVPlayerItemStatusPlaybackBufferFull)
-                newNetworkState = MediaPlayer::Idle;
+                newNetworkState = MediaPlayer::NetworkState::Idle;
             else if (itemStatus == MediaPlayerAVPlayerItemStatusFailed)
-                newNetworkState = MediaPlayer::DecodeError;
+                newNetworkState = MediaPlayer::NetworkState::DecodeError;
             else if (itemStatus != MediaPlayerAVPlayerItemStatusPlaybackBufferFull && itemStatus >= MediaPlayerAVPlayerItemStatusReadyToPlay)
-                newNetworkState = (maxTimeLoaded() == durationMediaTime()) ? MediaPlayer::Loaded : MediaPlayer::Loading;
+                newNetworkState = (maxTimeLoaded() == durationMediaTime()) ? MediaPlayer::NetworkState::Loaded : MediaPlayer::NetworkState::Loading;
         }
     }
 
@@ -556,8 +556,8 @@ void MediaPlayerPrivateAVFoundation::updateStates()
         setUpVideoRendering();
 
     if (!m_haveReportedFirstVideoFrame && m_cachedHasVideo && hasAvailableVideoFrame()) {
-        if (m_readyState < MediaPlayer::HaveCurrentData)
-            newReadyState = MediaPlayer::HaveCurrentData;
+        if (m_readyState < MediaPlayer::ReadyState::HaveCurrentData)
+            newReadyState = MediaPlayer::ReadyState::HaveCurrentData;
         m_haveReportedFirstVideoFrame = true;
         m_player->firstVideoFrameAvailable();
     } else if (!hasAvailableVideoFrame())
@@ -693,12 +693,12 @@ void MediaPlayerPrivateAVFoundation::repaint()
 MediaPlayer::MovieLoadType MediaPlayerPrivateAVFoundation::movieLoadType() const
 {
     if (!metaDataAvailable() || assetStatus() == MediaPlayerAVAssetStatusUnknown)
-        return MediaPlayer::Unknown;
+        return MediaPlayer::MovieLoadType::Unknown;
 
     if (isLiveStream())
-        return MediaPlayer::LiveStream;
+        return MediaPlayer::MovieLoadType::LiveStream;
 
-    return MediaPlayer::Download;
+    return MediaPlayer::MovieLoadType::Download;
 }
 
 void MediaPlayerPrivateAVFoundation::setPreload(MediaPlayer::Preload preload)
@@ -710,14 +710,14 @@ void MediaPlayerPrivateAVFoundation::setPreload(MediaPlayer::Preload preload)
 
     setDelayCallbacks(true);
 
-    if (m_preload >= MediaPlayer::MetaData && assetStatus() == MediaPlayerAVAssetStatusDoesNotExist) {
+    if (m_preload >= MediaPlayer::Preload::MetaData && assetStatus() == MediaPlayerAVAssetStatusDoesNotExist) {
         createAVAssetForURL(m_assetURL);
         checkPlayability();
     }
 
     // Don't force creation of the player and player item unless we already know that the asset is playable. If we aren't
     // there yet, or if we already know it is not playable, creating them now won't help.
-    if (m_preload == MediaPlayer::Auto && m_assetIsPlayable) {
+    if (m_preload == MediaPlayer::Preload::Auto && m_assetIsPlayable) {
         createAVPlayerItem();
         createAVPlayer();
     }
index 0453244..6a20a2f 100644 (file)
@@ -166,7 +166,7 @@ protected:
     void load(const String&, MediaSourcePrivateClient*) override;
 #endif
 #if ENABLE(MEDIA_STREAM)
-    void load(MediaStreamPrivate&) override { setNetworkState(MediaPlayer::FormatError); }
+    void load(MediaStreamPrivate&) override { setNetworkState(MediaPlayer::NetworkState::FormatError); }
 #endif
     void cancelLoad() override = 0;
 
@@ -295,7 +295,7 @@ protected:
     MediaRenderingMode currentRenderingMode() const;
     MediaRenderingMode preferredRenderingMode() const;
 
-    bool metaDataAvailable() const { return m_readyState >= MediaPlayer::HaveMetadata; }
+    bool metaDataAvailable() const { return m_readyState >= MediaPlayer::ReadyState::HaveMetadata; }
     double requestedRate() const;
     MediaTime maxTimeLoaded() const;
     bool isReadyForVideoSetup() const;
index 0ce8ceb..8562e84 100644 (file)
@@ -907,24 +907,24 @@ MediaPlayer::SupportsType MediaPlayerPrivateAVFoundationCF::supportsType(const M
 {
     auto containerType = parameters.type.containerType();
     if (isUnsupportedMIMEType(containerType))
-        return MediaPlayer::IsNotSupported;
+        return MediaPlayer::SupportsType::IsNotSupported;
 
     if (!staticMIMETypeList().contains(containerType) && !avfMIMETypes().contains(containerType))
-        return MediaPlayer::IsNotSupported;
+        return MediaPlayer::SupportsType::IsNotSupported;
 
     auto codecs = parameters.type.parameter(ContentType::codecsParameter());
 #if HAVE(AVCFURL_PLAYABLE_MIMETYPE)
     // The spec says:
     // "Implementors are encouraged to return "maybe" unless the type can be confidently established as being supported or not."
     if (codecs.isEmpty())
-        return MediaPlayer::MayBeSupported;
+        return MediaPlayer::SupportsType::MayBeSupported;
 
     String typeString = containerType + "; codecs=\"" + codecs + "\"";
-    return AVCFURLAssetIsPlayableExtendedMIMEType(typeString.createCFString().get()) ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported;
+    return AVCFURLAssetIsPlayableExtendedMIMEType(typeString.createCFString().get()) ? MediaPlayer::SupportsType::IsSupported : MediaPlayer::SupportsType::MayBeSupported;
 #else
     if (avfMIMETypes().contains(containerType))
-        return codecs.isEmpty() ? MediaPlayer::MayBeSupported : MediaPlayer::IsSupported;
-    return MediaPlayer::IsNotSupported;
+        return codecs.isEmpty() ? MediaPlayer::SupportsType::MayBeSupported : MediaPlayer::SupportsType::IsSupported;
+    return MediaPlayer::SupportsType::IsNotSupported;
 #endif
 }
 
index e98d8ea..cada231 100644 (file)
@@ -125,7 +125,7 @@ public:
     void canPlayFastReverseDidChange(bool);
     void canPlayFastForwardDidChange(bool);
 
-    void setBufferingPolicy(MediaPlayerEnums::BufferingPolicy) override;
+    void setBufferingPolicy(MediaPlayer::BufferingPolicy) override;
 
 #if HAVE(AVFOUNDATION_VIDEO_OUTPUT)
     void outputMediaDataWillChange(AVPlayerItemVideoOutput*);
index 5410391..718929c 100644 (file)
@@ -369,7 +369,7 @@ void MediaPlayerPrivateAVFoundationObjC::clearMediaCacheForOrigins(const String&
 MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC(MediaPlayer* player)
     : MediaPlayerPrivateAVFoundation(player)
     , m_videoFullscreenLayerManager(makeUnique<VideoFullscreenLayerManagerObjC>())
-    , m_videoFullscreenGravity(MediaPlayer::VideoGravityResizeAspect)
+    , m_videoFullscreenGravity(MediaPlayer::VideoGravity::ResizeAspect)
     , m_objcObserver(adoptNS([[WebCoreAVFMovieObserver alloc] initWithPlayer:makeWeakPtr(*this)]))
     , m_videoFrameHasDrawn(false)
     , m_haveCheckedPlayability(false)
@@ -1091,11 +1091,11 @@ void MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenGravity(MediaPlayer::
         return;
 
     NSString *videoGravity = AVLayerVideoGravityResizeAspect;
-    if (gravity == MediaPlayer::VideoGravityResize)
+    if (gravity == MediaPlayer::VideoGravity::Resize)
         videoGravity = AVLayerVideoGravityResize;
-    else if (gravity == MediaPlayer::VideoGravityResizeAspect)
+    else if (gravity == MediaPlayer::VideoGravity::ResizeAspect)
         videoGravity = AVLayerVideoGravityResizeAspect;
-    else if (gravity == MediaPlayer::VideoGravityResizeAspectFill)
+    else if (gravity == MediaPlayer::VideoGravity::ResizeAspectFill)
         videoGravity = AVLayerVideoGravityResizeAspectFill;
     else
         ASSERT_NOT_REACHED();
@@ -1592,30 +1592,30 @@ MediaPlayer::SupportsType MediaPlayerPrivateAVFoundationObjC::supportsType(const
 {
 #if ENABLE(MEDIA_SOURCE)
     if (parameters.isMediaSource)
-        return MediaPlayer::IsNotSupported;
+        return MediaPlayer::SupportsType::IsNotSupported;
 #endif
 #if ENABLE(MEDIA_STREAM)
     if (parameters.isMediaStream)
-        return MediaPlayer::IsNotSupported;
+        return MediaPlayer::SupportsType::IsNotSupported;
 #endif
 
     auto containerType = parameters.type.containerType();
     if (isUnsupportedMIMEType(containerType))
-        return MediaPlayer::IsNotSupported;
+        return MediaPlayer::SupportsType::IsNotSupported;
 
     if (!staticMIMETypeList().contains(containerType) && !AVAssetMIMETypeCache::singleton().canDecodeType(containerType))
-        return MediaPlayer::IsNotSupported;
+        return MediaPlayer::SupportsType::IsNotSupported;
 
     // The spec says:
     // "Implementors are encouraged to return "maybe" unless the type can be confidently established as being supported or not."
     if (parameters.type.codecs().isEmpty())
-        return MediaPlayer::MayBeSupported;
+        return MediaPlayer::SupportsType::MayBeSupported;
 
     if (!contentTypeMeetsHardwareDecodeRequirements(parameters.type, parameters.contentTypesRequiringHardwareSupport))
-        return MediaPlayer::IsNotSupported;
+        return MediaPlayer::SupportsType::IsNotSupported;
 
     NSString *typeString = [NSString stringWithFormat:@"%@; codecs=\"%@\"", (NSString *)containerType, (NSString *)parameters.type.parameter(ContentType::codecsParameter())];
-    return [PAL::getAVURLAssetClass() isPlayableExtendedMIMEType:typeString] ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported;
+    return [PAL::getAVURLAssetClass() isPlayableExtendedMIMEType:typeString] ? MediaPlayer::SupportsType::IsSupported : MediaPlayer::SupportsType::MayBeSupported;
 }
 
 bool MediaPlayerPrivateAVFoundationObjC::supportsKeySystem(const String& keySystem, const String& mimeType)
@@ -1624,7 +1624,7 @@ bool MediaPlayerPrivateAVFoundationObjC::supportsKeySystem(const String& keySyst
     if (!keySystem.isEmpty()) {
         // "Clear Key" is only supported with HLS:
         if (equalIgnoringASCIICase(keySystem, "org.w3c.clearkey") && !mimeType.isEmpty() && !equalIgnoringASCIICase(mimeType, "application/x-mpegurl"))
-            return MediaPlayer::IsNotSupported;
+            return false;
 
         if (!keySystemIsSupported(keySystem))
             return false;
index 71528c9..dff3e24 100644 (file)
@@ -131,8 +131,8 @@ MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC(Media
     : m_player(player)
     , m_synchronizer(adoptNS([PAL::allocAVSampleBufferRenderSynchronizerInstance() init]))
     , m_seekTimer(*this, &MediaPlayerPrivateMediaSourceAVFObjC::seekInternal)
-    , m_networkState(MediaPlayer::Empty)
-    , m_readyState(MediaPlayer::HaveNothing)
+    , m_networkState(MediaPlayer::NetworkState::Empty)
+    , m_readyState(MediaPlayer::ReadyState::HaveNothing)
     , m_rate(1)
     , m_playing(0)
     , m_seeking(false)
@@ -233,41 +233,41 @@ MediaPlayer::SupportsType MediaPlayerPrivateMediaSourceAVFObjC::supportsType(con
 {
     // This engine does not support non-media-source sources.
     if (!parameters.isMediaSource)
-        return MediaPlayer::IsNotSupported;
+        return MediaPlayer::SupportsType::IsNotSupported;
 #if ENABLE(MEDIA_STREAM)
     if (parameters.isMediaStream)
-        return MediaPlayer::IsNotSupported;
+        return MediaPlayer::SupportsType::IsNotSupported;
 #endif
 
     if (parameters.type.isEmpty())
-        return MediaPlayer::IsNotSupported;
+        return MediaPlayer::SupportsType::IsNotSupported;
 
     if (AVStreamDataParserMIMETypeCache::singleton().isAvailable()) {
         if (!AVStreamDataParserMIMETypeCache::singleton().supportsContentType(parameters.type))
-            return MediaPlayer::IsNotSupported;
+            return MediaPlayer::SupportsType::IsNotSupported;
     } else if (AVAssetMIMETypeCache::singleton().isAvailable()) {
         if (!AVAssetMIMETypeCache::singleton().supportsContentType(parameters.type))
-            return MediaPlayer::IsNotSupported;
+            return MediaPlayer::SupportsType::IsNotSupported;
     } else
-        return MediaPlayer::IsNotSupported;
+        return MediaPlayer::SupportsType::IsNotSupported;
 
     // The spec says:
     // "Implementors are encouraged to return "maybe" unless the type can be confidently established as being supported or not."
     auto codecs = parameters.type.parameter(ContentType::codecsParameter());
     if (codecs.isEmpty())
-        return MediaPlayer::MayBeSupported;
+        return MediaPlayer::SupportsType::MayBeSupported;
 
     String outputCodecs = codecs;
     if ([PAL::getAVStreamDataParserClass() respondsToSelector:@selector(outputMIMECodecParameterForInputMIMECodecParameter:)])
         outputCodecs = [PAL::getAVStreamDataParserClass() outputMIMECodecParameterForInputMIMECodecParameter:outputCodecs];
 
     if (!contentTypeMeetsHardwareDecodeRequirements(parameters.type, parameters.contentTypesRequiringHardwareSupport))
-        return MediaPlayer::IsNotSupported;
+        return MediaPlayer::SupportsType::IsNotSupported;
 
     String type = makeString(parameters.type.containerType(), "; codecs=\"", outputCodecs, "\"");
     if (AVStreamDataParserMIMETypeCache::singleton().isAvailable())
-        return AVStreamDataParserMIMETypeCache::singleton().canDecodeType(type) ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported;
-    return AVAssetMIMETypeCache::singleton().canDecodeType(type) ? MediaPlayer::IsSupported : MediaPlayer::MayBeSupported;
+        return AVStreamDataParserMIMETypeCache::singleton().canDecodeType(type) ? MediaPlayer::SupportsType::IsSupported : MediaPlayer::SupportsType::MayBeSupported;
+    return AVAssetMIMETypeCache::singleton().canDecodeType(type) ? MediaPlayer::SupportsType::IsSupported : MediaPlayer::SupportsType::MayBeSupported;
 }
 
 #pragma mark -
@@ -276,7 +276,7 @@ MediaPlayer::SupportsType MediaPlayerPrivateMediaSourceAVFObjC::supportsType(con
 void MediaPlayerPrivateMediaSourceAVFObjC::load(const String&)
 {
     // This media engine only supports MediaSource URLs.
-    m_networkState = MediaPlayer::FormatError;
+    m_networkState = MediaPlayer::NetworkState::FormatError;
     m_player->networkStateChanged();
 }
 
@@ -294,7 +294,7 @@ void MediaPlayerPrivateMediaSourceAVFObjC::load(const String&, MediaSourcePrivat
 #if ENABLE(MEDIA_STREAM)
 void MediaPlayerPrivateMediaSourceAVFObjC::load(MediaStreamPrivate&)
 {
-    setNetworkState(MediaPlayer::FormatError);
+    setNetworkState(MediaPlayer::NetworkState::FormatError);
 }
 #endif
 
@@ -682,7 +682,7 @@ void MediaPlayerPrivateMediaSourceAVFObjC::notifyActiveSourceBuffersChanged()
 
 MediaPlayer::MovieLoadType MediaPlayerPrivateMediaSourceAVFObjC::movieLoadType() const
 {
-    return MediaPlayer::StoredStream;
+    return MediaPlayer::MovieLoadType::StoredStream;
 }
 
 void MediaPlayerPrivateMediaSourceAVFObjC::prepareForRendering()
@@ -754,7 +754,7 @@ void MediaPlayerPrivateMediaSourceAVFObjC::ensureLayer()
     ASSERT(m_sampleBufferDisplayLayer);
     if (!m_sampleBufferDisplayLayer) {
         ERROR_LOG(LOGIDENTIFIER, "Failed to create AVSampleBufferDisplayLayer");
-        setNetworkState(MediaPlayer::DecodeError);
+        setNetworkState(MediaPlayer::NetworkState::DecodeError);
         return;
     }
 
@@ -815,7 +815,7 @@ void MediaPlayerPrivateMediaSourceAVFObjC::destroyDecompressionSession()
 
 bool MediaPlayerPrivateMediaSourceAVFObjC::shouldBePlaying() const
 {
-    return m_playing && !seeking() && allRenderersHaveAvailableSamples() && m_readyState >= MediaPlayer::HaveFutureData;
+    return m_playing && !seeking() && allRenderersHaveAvailableSamples() && m_readyState >= MediaPlayer::ReadyState::HaveFutureData;
 }
 
 void MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableVideoFrame(bool flag)
@@ -1098,7 +1098,7 @@ void MediaPlayerPrivateMediaSourceAVFObjC::setReadyState(MediaPlayer::ReadyState
     else
         [m_synchronizer setRate:0];
 
-    if (m_readyState >= MediaPlayerEnums::HaveCurrentData && hasVideo() && !m_hasAvailableVideoFrame) {
+    if (m_readyState >= MediaPlayer::ReadyState::HaveCurrentData && hasVideo() && !m_hasAvailableVideoFrame) {
         m_readyStateIsWaitingForAvailableFrame = true;
         return;
     }
index 740e96c..fe69fac 100644 (file)
@@ -158,14 +158,14 @@ private:
 
     void paint(GraphicsContext&, const FloatRect&) override;
     void paintCurrentFrameInContext(GraphicsContext&, const FloatRect&) override;
-    bool metaDataAvailable() const { return m_mediaStreamPrivate && m_readyState >= MediaPlayer::HaveMetadata; }
+    bool metaDataAvailable() const { return m_mediaStreamPrivate && m_readyState >= MediaPlayer::ReadyState::HaveMetadata; }
 
     void acceleratedRenderingStateChanged() override;
     bool supportsAcceleratedRendering() const override { return true; }
 
     bool hasSingleSecurityOrigin() const override { return true; }
 
-    MediaPlayer::MovieLoadType movieLoadType() const override { return MediaPlayer::LiveStream; }
+    MediaPlayer::MovieLoadType movieLoadType() const override { return MediaPlayer::MovieLoadType::LiveStream; }
 
     String engineDescription() const override;
 
@@ -255,8 +255,8 @@ private:
     HashMap<String, RefPtr<VideoTrackPrivateMediaStream>> m_videoTrackMap;
     PendingSampleQueue m_pendingVideoSampleQueue;
 
-    MediaPlayer::NetworkState m_networkState { MediaPlayer::Empty };
-    MediaPlayer::ReadyState m_readyState { MediaPlayer::HaveNothing };
+    MediaPlayer::NetworkState m_networkState { MediaPlayer::NetworkState::Empty };
+    MediaPlayer::ReadyState m_readyState { MediaPlayer::ReadyState::HaveNothing };
     FloatSize m_intrinsicSize;
     float m_volume { 1 };
     DisplayMode m_displayMode { None };
index 6314814..2519c11 100644 (file)
@@ -240,7 +240,7 @@ void MediaPlayerPrivateMediaStreamAVFObjC::getSupportedTypes(HashSet<String, ASC
 
 MediaPlayer::SupportsType MediaPlayerPrivateMediaStreamAVFObjC::supportsType(const MediaEngineSupportParameters& parameters)
 {
-    return parameters.isMediaStream ? MediaPlayer::IsSupported : MediaPlayer::IsNotSupported;
+    return parameters.isMediaStream ? MediaPlayer::SupportsType::IsSupported : MediaPlayer::SupportsType::IsNotSupported;
 }
 
 #pragma mark -
@@ -526,7 +526,7 @@ void MediaPlayerPrivateMediaStreamAVFObjC::load(const String&)
 {
     // This media engine only supports MediaStream URLs.
     scheduleDeferredTask([this] {
-        setNetworkState(MediaPlayer::FormatError);
+        setNetworkState(MediaPlayer::NetworkState::FormatError);
     });
 }
 
@@ -535,7 +535,7 @@ void MediaPlayerPrivateMediaStreamAVFObjC::load(const String&, MediaSourcePrivat
 {
     // This media engine only supports MediaStream URLs.
     scheduleDeferredTask([this] {
-        setNetworkState(MediaPlayer::FormatError);
+        setNetworkState(MediaPlayer::NetworkState::FormatError);
     });
 }
 #endif
@@ -552,7 +552,7 @@ void MediaPlayerPrivateMediaStreamAVFObjC::load(MediaStreamPrivate& stream)
 
     scheduleDeferredTask([this] {
         updateTracks();
-        setNetworkState(MediaPlayer::Idle);
+        setNetworkState(MediaPlayer::NetworkState::Idle);
         updateReadyState();
     });
 }
index 4da09d2..0e7ae05 100644 (file)
@@ -82,7 +82,7 @@ MediaSourcePrivate::AddStatus MediaSourcePrivateAVFObjC::addSourceBuffer(const C
     MediaEngineSupportParameters parameters;
     parameters.isMediaSource = true;
     parameters.type = contentType;
-    if (MediaPlayerPrivateMediaSourceAVFObjC::supportsType(parameters) == MediaPlayer::IsNotSupported)
+    if (MediaPlayerPrivateMediaSourceAVFObjC::supportsType(parameters) == MediaPlayer::SupportsType::IsNotSupported)
         return NotSupported;
 
     auto newSourceBuffer = SourceBufferPrivateAVFObjC::create(this);
@@ -131,7 +131,7 @@ void MediaSourcePrivateAVFObjC::durationChanged()
 void MediaSourcePrivateAVFObjC::markEndOfStream(EndOfStreamStatus status)
 {
     if (status == EosNoError)
-        m_player->setNetworkState(MediaPlayer::Loaded);
+        m_player->setNetworkState(MediaPlayer::NetworkState::Loaded);
     m_isEnded = true;
 }
 
index 311dbf4..5a561c3 100644 (file)
@@ -814,7 +814,7 @@ void SourceBufferPrivateAVFObjC::removedFromMediaSource()
 
 MediaPlayer::ReadyState SourceBufferPrivateAVFObjC::readyState() const
 {
-    return m_mediaSource ? m_mediaSource->player()->readyState() : MediaPlayer::HaveNothing;
+    return m_mediaSource ? m_mediaSource->player()->readyState() : MediaPlayer::ReadyState::HaveNothing;
 }
 
 void SourceBufferPrivateAVFObjC::setReadyState(MediaPlayer::ReadyState readyState)
@@ -1289,7 +1289,7 @@ bool SourceBufferPrivateAVFObjC::canSwitchToType(const ContentType& contentType)
     MediaEngineSupportParameters parameters;
     parameters.isMediaSource = true;
     parameters.type = contentType;
-    return MediaPlayerPrivateMediaSourceAVFObjC::supportsType(parameters) != MediaPlayer::IsNotSupported;
+    return MediaPlayerPrivateMediaSourceAVFObjC::supportsType(parameters) != MediaPlayer::SupportsType::IsNotSupported;
 }
 
 void SourceBufferPrivateAVFObjC::setVideoLayer(AVSampleBufferDisplayLayer* layer)
index 2ee3827..98a53c4 100644 (file)
@@ -57,7 +57,7 @@ void createMediaPlayerDecodingConfigurationCocoa(MediaDecodingConfiguration&& co
         MediaEngineSupportParameters parameters { };
         parameters.type = ContentType(videoConfiguration.contentType);
         parameters.isMediaSource = configuration.type == MediaDecodingType::MediaSource;
-        if (MediaPlayer::supportsType(parameters) != MediaPlayer::IsSupported) {
+        if (MediaPlayer::supportsType(parameters) != MediaPlayer::SupportsType::IsSupported) {
             callback({{ }, WTFMove(configuration)});
             return;
         }
@@ -108,7 +108,7 @@ void createMediaPlayerDecodingConfigurationCocoa(MediaDecodingConfiguration&& co
         MediaEngineSupportParameters parameters { };
         parameters.type = ContentType(configuration.audio.value().contentType);
         parameters.isMediaSource = configuration.type == MediaDecodingType::MediaSource;
-        if (MediaPlayer::supportsType(parameters) != MediaPlayer::IsSupported) {
+        if (MediaPlayer::supportsType(parameters) != MediaPlayer::SupportsType::IsSupported) {
             callback({{ }, WTFMove(configuration)});
             return;
         }
index 0127c57..d488542 100644 (file)
@@ -477,13 +477,13 @@ void MediaPlayerPrivateGStreamer::registerMediaEngine(MediaEngineRegistrar regis
 void MediaPlayerPrivateGStreamer::loadFull(const String& urlString, const String& pipelineName)
 {
     if (m_player->contentMIMEType() == "image/gif") {
-        loadingFailed(MediaPlayer::FormatError, MediaPlayer::HaveNothing, true);
+        loadingFailed(MediaPlayer::NetworkState::FormatError, MediaPlayer::ReadyState::HaveNothing, true);
         return;
     }
 
     URL url(URL(), urlString);
     if (url.protocolIsAbout()) {
-        loadingFailed(MediaPlayer::FormatError, MediaPlayer::HaveNothing, true);
+        loadingFailed(MediaPlayer::NetworkState::FormatError, MediaPlayer::ReadyState::HaveNothing, true);
         return;
     }
 
@@ -498,16 +498,16 @@ void MediaPlayerPrivateGStreamer::loadFull(const String& urlString, const String
     setPlaybinURL(url);
 
     GST_DEBUG_OBJECT(pipeline(), "preload: %s", convertEnumerationToString(m_preload).utf8().data());
-    if (m_preload == MediaPlayer::None) {
+    if (m_preload == MediaPlayer::Preload::None) {
         GST_INFO_OBJECT(pipeline(), "Delaying load.");
         m_isDelayingLoad = true;
     }
 
     // Reset network and ready states. Those will be set properly once
     // the pipeline pre-rolled.
-    m_networkState = MediaPlayer::Loading;
+    m_networkState = MediaPlayer::NetworkState::Loading;
     m_player->networkStateChanged();
-    m_readyState = MediaPlayer::HaveNothing;
+    m_readyState = MediaPlayer::ReadyState::HaveNothing;
     m_player->readyStateChanged();
     m_areVolumeAndMuteInitialized = false;
     m_hasTaintedOrigin = WTF::nullopt;
@@ -525,7 +525,7 @@ void MediaPlayerPrivateGStreamer::load(const String& urlString)
 void MediaPlayerPrivateGStreamer::load(const String&, MediaSourcePrivateClient*)
 {
     // Properly fail so the global MediaPlayer tries to fallback to the next MediaPlayerPrivate.
-    m_networkState = MediaPlayer::FormatError;
+    m_networkState = MediaPlayer::NetworkState::FormatError;
     m_player->networkStateChanged();
 }
 #endif
@@ -546,7 +546,7 @@ void MediaPlayerPrivateGStreamer::load(MediaStreamPrivate& stream)
 
 void MediaPlayerPrivateGStreamer::cancelLoad()
 {
-    if (m_networkState < MediaPlayer::Loading || m_networkState == MediaPlayer::Loaded)
+    if (m_networkState < MediaPlayer::NetworkState::Loading || m_networkState == MediaPlayer::NetworkState::Loaded)
         return;
 
     if (m_pipeline)
@@ -556,7 +556,7 @@ void MediaPlayerPrivateGStreamer::cancelLoad()
 void MediaPlayerPrivateGStreamer::prepareToPlay()
 {
     GST_DEBUG_OBJECT(pipeline(), "Prepare to play");
-    m_preload = MediaPlayer::Auto;
+    m_preload = MediaPlayer::Preload::Auto;
     if (m_isDelayingLoad) {
         m_isDelayingLoad = false;
         commitLoad();
@@ -573,11 +573,11 @@ void MediaPlayerPrivateGStreamer::play()
     if (changePipelineState(GST_STATE_PLAYING)) {
         m_isEndReached = false;
         m_isDelayingLoad = false;
-        m_preload = MediaPlayer::Auto;
+        m_preload = MediaPlayer::Preload::Auto;
         updateDownloadBufferingFlag();
         GST_INFO_OBJECT(pipeline(), "Play");
     } else
-        loadingFailed(MediaPlayer::Empty);
+        loadingFailed(MediaPlayer::NetworkState::Empty);
 }
 
 void MediaPlayerPrivateGStreamer::pause()
@@ -591,7 +591,7 @@ void MediaPlayerPrivateGStreamer::pause()
     if (changePipelineState(GST_STATE_PAUSED))
         GST_INFO_OBJECT(pipeline(), "Pause");
     else
-        loadingFailed(MediaPlayer::Empty);
+        loadingFailed(MediaPlayer::NetworkState::Empty);
 }
 
 bool MediaPlayerPrivateGStreamer::paused() const
@@ -676,7 +676,7 @@ void MediaPlayerPrivateGStreamer::seek(const MediaTime& mediaTime)
             GST_DEBUG_OBJECT(pipeline(), "[Seek] reset pipeline");
             m_shouldResetPipeline = true;
             if (!changePipelineState(GST_STATE_PAUSED))
-                loadingFailed(MediaPlayer::Empty);
+                loadingFailed(MediaPlayer::NetworkState::Empty);
         }
     } else {
         // We can seek now.
@@ -808,13 +808,13 @@ void MediaPlayerPrivateGStreamer::setPreservesPitch(bool preservesPitch)
 void MediaPlayerPrivateGStreamer::setPreload(MediaPlayer::Preload preload)
 {
     GST_DEBUG_OBJECT(pipeline(), "Setting preload to %s", convertEnumerationToString(preload).utf8().data());
-    if (preload == MediaPlayer::Auto && m_isLiveStream)
+    if (preload == MediaPlayer::Preload::Auto && m_isLiveStream)
         return;
 
     m_preload = preload;
     updateDownloadBufferingFlag();
 
-    if (m_isDelayingLoad && m_preload != MediaPlayer::None) {
+    if (m_isDelayingLoad && m_preload != MediaPlayer::Preload::None) {
         m_isDelayingLoad = false;
         commitLoad();
     }
@@ -1982,23 +1982,23 @@ void MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message)
 
         GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS(GST_BIN(m_pipeline.get()), GST_DEBUG_GRAPH_SHOW_ALL, "webkit-video.error");
 
-        error = MediaPlayer::Empty;
+        error = MediaPlayer::NetworkState::Empty;
         if (g_error_matches(err.get(), GST_STREAM_ERROR, GST_STREAM_ERROR_CODEC_NOT_FOUND)
             || g_error_matches(err.get(), GST_STREAM_ERROR, GST_STREAM_ERROR_WRONG_TYPE)
             || g_error_matches(err.get(), GST_STREAM_ERROR, GST_STREAM_ERROR_FAILED)
             || g_error_matches(err.get(), GST_CORE_ERROR, GST_CORE_ERROR_MISSING_PLUGIN)
             || g_error_matches(err.get(), GST_RESOURCE_ERROR, GST_RESOURCE_ERROR_NOT_FOUND))
-            error = MediaPlayer::FormatError;
+            error = MediaPlayer::NetworkState::FormatError;
         else if (g_error_matches(err.get(), GST_STREAM_ERROR, GST_STREAM_ERROR_TYPE_NOT_FOUND)) {
             // Let the mediaPlayerClient handle the stream error, in this case the HTMLMediaElement will emit a stalled event.
             GST_ERROR("Decode error, let the Media element emit a stalled event.");
             m_loadingStalled = true;
             break;
         } else if (err->domain == GST_STREAM_ERROR) {
-            error = MediaPlayer::DecodeError;
+            error = MediaPlayer::NetworkState::DecodeError;
             attemptNextLocation = true;
         } else if (err->domain == GST_RESOURCE_ERROR)
-            error = MediaPlayer::NetworkError;
+            error = MediaPlayer::NetworkState::NetworkError;
 
         if (attemptNextLocation)
             issueError = !loadNextLocation();
@@ -2048,7 +2048,7 @@ void MediaPlayerPrivateGStreamer::handleMessage(GstMessage* message)
                 gst_element_state_get_name(requestedState));
             m_requestedState = requestedState;
             if (!changePipelineState(requestedState))
-                loadingFailed(MediaPlayer::Empty);
+                loadingFailed(MediaPlayer::NetworkState::Empty);
         }
         break;
     case GST_MESSAGE_CLOCK_LOST:
@@ -2531,12 +2531,12 @@ void MediaPlayerPrivateGStreamer::updateStates()
         // Update ready and network states.
         switch (m_currentState) {
         case GST_STATE_NULL:
-            m_readyState = MediaPlayer::HaveNothing;
-            m_networkState = MediaPlayer::Empty;
+            m_readyState = MediaPlayer::ReadyState::HaveNothing;
+            m_networkState = MediaPlayer::NetworkState::Empty;
             break;
         case GST_STATE_READY:
-            m_readyState = MediaPlayer::HaveMetadata;
-            m_networkState = MediaPlayer::Empty;
+            m_readyState = MediaPlayer::ReadyState::HaveMetadata;
+            m_networkState = MediaPlayer::NetworkState::Empty;
             break;
         case GST_STATE_PAUSED:
         case GST_STATE_PLAYING:
@@ -2544,18 +2544,18 @@ void MediaPlayerPrivateGStreamer::updateStates()
                 if (m_bufferingPercentage == 100) {
                     GST_DEBUG_OBJECT(pipeline(), "[Buffering] Complete.");
                     m_isBuffering = false;
-                    m_readyState = MediaPlayer::HaveEnoughData;
-                    m_networkState = m_didDownloadFinish ? MediaPlayer::Idle : MediaPlayer::Loading;
+                    m_readyState = MediaPlayer::ReadyState::HaveEnoughData;
+                    m_networkState = m_didDownloadFinish ? MediaPlayer::NetworkState::Idle : MediaPlayer::NetworkState::Loading;
                 } else {
-                    m_readyState = MediaPlayer::HaveCurrentData;
-                    m_networkState = MediaPlayer::Loading;
+                    m_readyState = MediaPlayer::ReadyState::HaveCurrentData;
+                    m_networkState = MediaPlayer::NetworkState::Loading;
                 }
             } else if (m_didDownloadFinish) {
-                m_readyState = MediaPlayer::HaveEnoughData;
-                m_networkState = MediaPlayer::Loaded;
+                m_readyState = MediaPlayer::ReadyState::HaveEnoughData;
+                m_networkState = MediaPlayer::NetworkState::Loaded;
             } else {
-                m_readyState = MediaPlayer::HaveFutureData;
-                m_networkState = MediaPlayer::Loading;
+                m_readyState = MediaPlayer::ReadyState::HaveFutureData;
+                m_networkState = MediaPlayer::NetworkState::Loading;
             }
 
             break;
@@ -2619,9 +2619,9 @@ void MediaPlayerPrivateGStreamer::updateStates()
         updateDownloadBufferingFlag();
 
         if (m_currentState == GST_STATE_READY)
-            m_readyState = MediaPlayer::HaveNothing;
+            m_readyState = MediaPlayer::ReadyState::HaveNothing;
         else if (m_currentState == GST_STATE_PAUSED) {
-            m_readyState = MediaPlayer::HaveEnoughData;
+            m_readyState = MediaPlayer::ReadyState::HaveEnoughData;
             m_isPaused = true;
         } else if (m_currentState == GST_STATE_PLAYING)
             m_isPaused = false;
@@ -2629,7 +2629,7 @@ void MediaPlayerPrivateGStreamer::updateStates()
         if (!m_isPaused && m_playbackRate)
             changePipelineState(GST_STATE_PLAYING);
 
-        m_networkState = MediaPlayer::Loading;
+        m_networkState = MediaPlayer::NetworkState::Loading;
         break;
     default:
         GST_DEBUG_OBJECT(pipeline(), "Else : %d", getStateResult);
@@ -2741,9 +2741,9 @@ bool MediaPlayerPrivateGStreamer::loadNextLocation()
             GST_INFO_OBJECT(pipeline(), "New media url: %s", newUrl.string().utf8().data());
 
             // Reset player states.
-            m_networkState = MediaPlayer::Loading;
+            m_networkState = MediaPlayer::NetworkState::Loading;
             m_player->networkStateChanged();
-            m_readyState = MediaPlayer::HaveNothing;
+            m_readyState = MediaPlayer::ReadyState::HaveNothing;
             m_player->readyStateChanged();
 
             // Reset pipeline state.
@@ -2796,7 +2796,7 @@ void MediaPlayerPrivateGStreamer::getSupportedTypes(HashSet<String, ASCIICaseIns
 
 MediaPlayer::SupportsType MediaPlayerPrivateGStreamer::supportsType(const MediaEngineSupportParameters& parameters)
 {
-    MediaPlayer::SupportsType result = MediaPlayer::IsNotSupported;
+    MediaPlayer::SupportsType result = MediaPlayer::SupportsType::IsNotSupported;
 #if ENABLE(MEDIA_SOURCE)
     // MediaPlayerPrivateGStreamerMSE is in charge of mediasource playback, not us.
     if (parameters.isMediaSource)
@@ -2817,7 +2817,7 @@ MediaPlayer::SupportsType MediaPlayerPrivateGStreamer::supportsType(const MediaE
     if (gstRegistryScanner.isContainerTypeSupported(containerType)) {
         // Spec says we should not return "probably" if the codecs string is empty.
         Vector<String> codecs = parameters.type.codecs();
-        result = codecs.isEmpty() ? MediaPlayer::MayBeSupported : (gstRegistryScanner.areAllCodecsSupported(codecs) ? MediaPlayer::IsSupported : MediaPlayer::IsNotSupported);
+        result = codecs.isEmpty() ? MediaPlayer::SupportsType::MayBeSupported : (gstRegistryScanner.areAllCodecsSupported(codecs) ? MediaPlayer::SupportsType::IsSupported : MediaPlayer::SupportsType::IsNotSupported);
     }
 
     auto finalResult = extendedSupportsType(parameters, result);
@@ -2836,12 +2836,12 @@ void MediaPlayerPrivateGStreamer::updateDownloadBufferingFlag()
     unsigned flagDownload = getGstPlayFlag("download");
 
     // We don't want to stop downloading if we already started it.
-    if (flags & flagDownload && m_readyState > MediaPlayer::HaveNothing && !m_shouldResetPipeline) {
+    if (flags & flagDownload && m_readyState > MediaPlayer::ReadyState::HaveNothing && !m_shouldResetPipeline) {
         GST_DEBUG_OBJECT(pipeline(), "Download already started, not starting again");
         return;
     }
 
-    bool shouldDownload = !m_isLiveStream && m_preload == MediaPlayer::Auto;
+    bool shouldDownload = !m_isLiveStream && m_preload == MediaPlayer::Preload::Auto;
     if (shouldDownload) {
         GST_INFO_OBJECT(pipeline(), "Enabling on-disk buffering");
         g_object_set(m_pipeline.get(), "flags", flags | flagDownload, nullptr);
@@ -3373,13 +3373,13 @@ bool MediaPlayerPrivateGStreamer::supportsFullscreen() const
 
 MediaPlayer::MovieLoadType MediaPlayerPrivateGStreamer::movieLoadType() const
 {
-    if (m_readyState == MediaPlayer::HaveNothing)
-        return MediaPlayer::Unknown;
+    if (m_readyState == MediaPlayer::ReadyState::HaveNothing)
+        return MediaPlayer::MovieLoadType::Unknown;
 
     if (m_isLiveStream)
-        return MediaPlayer::LiveStream;
+        return MediaPlayer::MovieLoadType::LiveStream;
 
-    return MediaPlayer::Download;
+    return MediaPlayer::MovieLoadType::Download;
 }
 
 #if USE(GSTREAMER_GL)
index 152c093..f9c47a1 100644 (file)
@@ -309,7 +309,7 @@ protected:
 #endif
 
     void timeChanged();
-    void loadingFailed(MediaPlayer::NetworkState, MediaPlayer::ReadyState = MediaPlayer::HaveNothing, bool forceNotifications = false);
+    void loadingFailed(MediaPlayer::NetworkState, MediaPlayer::ReadyState = MediaPlayer::ReadyState::HaveNothing, bool forceNotifications = false);
     void loadStateChanged();
 
 #if USE(TEXTURE_MAPPER_GL)
@@ -347,8 +347,8 @@ protected:
     GRefPtr<GstElement> m_pipeline;
     IntSize m_size;
 
-    MediaPlayer::ReadyState m_readyState { MediaPlayer::HaveNothing };
-    mutable MediaPlayer::NetworkState m_networkState { MediaPlayer::Empty };
+    MediaPlayer::ReadyState m_readyState { MediaPlayer::ReadyState::HaveNothing };
+    mutable MediaPlayer::NetworkState m_networkState { MediaPlayer::NetworkState::Empty };
 
     mutable Lock m_sampleMutex;
     GRefPtr<GstSample> m_sample;
index dc245b4..820155e 100644 (file)
 static const char* dumpReadyState(WebCore::MediaPlayer::ReadyState readyState)
 {
     switch (readyState) {
-    case WebCore::MediaPlayer::HaveNothing: return "HaveNothing";
-    case WebCore::MediaPlayer::HaveMetadata: return "HaveMetadata";
-    case WebCore::MediaPlayer::HaveCurrentData: return "HaveCurrentData";
-    case WebCore::MediaPlayer::HaveFutureData: return "HaveFutureData";
-    case WebCore::MediaPlayer::HaveEnoughData: return "HaveEnoughData";
+    case WebCore::MediaPlayer::ReadyState::HaveNothing: return "HaveNothing";
+    case WebCore::MediaPlayer::ReadyState::HaveMetadata: return "HaveMetadata";
+    case WebCore::MediaPlayer::ReadyState::HaveCurrentData: return "HaveCurrentData";
+    case WebCore::MediaPlayer::ReadyState::HaveFutureData: return "HaveFutureData";
+    case WebCore::MediaPlayer::ReadyState::HaveEnoughData: return "HaveEnoughData";
     default: return "(unknown)";
     }
 }
@@ -113,7 +113,7 @@ void MediaPlayerPrivateGStreamerMSE::load(const String& urlString)
 {
     if (!urlString.startsWith("mediasource")) {
         // Properly fail so the global MediaPlayer tries to fallback to the next MediaPlayerPrivate.
-        m_networkState = MediaPlayer::FormatError;
+        m_networkState = MediaPlayer::NetworkState::FormatError;
         m_player->networkStateChanged();
         return;
     }
@@ -270,7 +270,7 @@ bool MediaPlayerPrivateGStreamerMSE::doSeek()
             m_shouldResetPipeline = true;
             m_isSeeking = false;
             if (!changePipelineState(GST_STATE_PAUSED))
-                loadingFailed(MediaPlayer::Empty);
+                loadingFailed(MediaPlayer::NetworkState::Empty);
             else
                 m_isSeeking = true;
         }
@@ -304,7 +304,7 @@ bool MediaPlayerPrivateGStreamerMSE::doSeek()
             m_isSeeking = false;
             return false;
         }
-        m_readyState = MediaPlayer::HaveMetadata;
+        m_readyState = MediaPlayer::ReadyState::HaveMetadata;
         notifySeekNeedsDataForTime(seekTime);
         ASSERT(!m_mseSeekCompleted);
         return true;
@@ -405,12 +405,12 @@ void MediaPlayerPrivateGStreamerMSE::setReadyState(MediaPlayer::ReadyState ready
         return;
     }
 
-    GST_DEBUG("Ready State Changed manually from %u to %u", m_readyState, readyState);
+    GST_DEBUG("Ready State Changed manually from %u to %u", static_cast<unsigned>(m_readyState), static_cast<unsigned>(readyState));
     MediaPlayer::ReadyState oldReadyState = m_readyState;
     m_readyState = readyState;
     GST_DEBUG("m_readyState: %s -> %s", dumpReadyState(oldReadyState), dumpReadyState(m_readyState));
 
-    if (oldReadyState < MediaPlayer::HaveCurrentData && m_readyState >= MediaPlayer::HaveCurrentData) {
+    if (oldReadyState < MediaPlayer::ReadyState::HaveCurrentData && m_readyState >= MediaPlayer::ReadyState::HaveCurrentData) {
         GST_DEBUG("[Seek] Reporting load state changed to trigger seek continuation");
         loadStateChanged();
     }
@@ -420,7 +420,7 @@ void MediaPlayerPrivateGStreamerMSE::setReadyState(MediaPlayer::ReadyState ready
     GstStateChangeReturn getStateResult = gst_element_get_state(m_pipeline.get(), &pipelineState, nullptr, 250 * GST_NSECOND);
     bool isPlaying = (getStateResult == GST_STATE_CHANGE_SUCCESS && pipelineState == GST_STATE_PLAYING);
 
-    if (m_readyState == MediaPlayer::HaveMetadata && oldReadyState > MediaPlayer::HaveMetadata && isPlaying) {
+    if (m_readyState == MediaPlayer::ReadyState::HaveMetadata && oldReadyState > MediaPlayer::ReadyState::HaveMetadata && isPlaying) {
         GST_TRACE("Changing pipeline to PAUSED...");
         bool ok = changePipelineState(GST_STATE_PAUSED);
         GST_TRACE("Changed pipeline to PAUSED: %s", ok ? "Success" : "Error");
@@ -446,7 +446,7 @@ void MediaPlayerPrivateGStreamerMSE::seekCompleted()
 
     doSeek();
 
-    if (!seeking() && m_readyState >= MediaPlayer::HaveFutureData)
+    if (!seeking() && m_readyState >= MediaPlayer::ReadyState::HaveFutureData)
         changePipelineState(GST_STATE_PLAYING);
 
     if (!seeking())
@@ -506,26 +506,26 @@ void MediaPlayerPrivateGStreamerMSE::updateStates()
         // Update ready and network states.
         switch (state) {
         case GST_STATE_NULL:
-            m_readyState = MediaPlayer::HaveNothing;
+            m_readyState = MediaPlayer::ReadyState::HaveNothing;
             GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState));
-            m_networkState = MediaPlayer::Empty;
+            m_networkState = MediaPlayer::NetworkState::Empty;
             break;
         case GST_STATE_READY:
-            m_readyState = MediaPlayer::HaveMetadata;
+            m_readyState = MediaPlayer::ReadyState::HaveMetadata;
             GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState));
-            m_networkState = MediaPlayer::Empty;
+            m_networkState = MediaPlayer::NetworkState::Empty;
             break;
         case GST_STATE_PAUSED:
         case GST_STATE_PLAYING:
             if (seeking()) {
-                m_readyState = MediaPlayer::HaveMetadata;
+                m_readyState = MediaPlayer::ReadyState::HaveMetadata;
                 // FIXME: Should we manage NetworkState too?
                 GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState));
             } else {
-                if (m_readyState < MediaPlayer::HaveFutureData)
-                    m_readyState = MediaPlayer::HaveFutureData;
+                if (m_readyState < MediaPlayer::ReadyState::HaveFutureData)
+                    m_readyState = MediaPlayer::ReadyState::HaveFutureData;
                 GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState));
-                m_networkState = MediaPlayer::Loading;
+                m_networkState = MediaPlayer::NetworkState::Loading;
             }
 
             if (m_eosMarked && state == GST_STATE_PLAYING)
@@ -581,10 +581,10 @@ void MediaPlayerPrivateGStreamerMSE::updateStates()
         m_isLiveStream = true;
 
         if (state == GST_STATE_READY) {
-            m_readyState = MediaPlayer::HaveNothing;
+            m_readyState = MediaPlayer::ReadyState::HaveNothing;
             GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState));
         } else if (state == GST_STATE_PAUSED) {
-            m_readyState = MediaPlayer::HaveEnoughData;
+            m_readyState = MediaPlayer::ReadyState::HaveEnoughData;
             GST_DEBUG("m_readyState=%s", dumpReadyState(m_readyState));
             m_isPaused = true;
         } else if (state == GST_STATE_PLAYING)
@@ -593,7 +593,7 @@ void MediaPlayerPrivateGStreamerMSE::updateStates()
         if (!m_isPaused && m_playbackRate)
             changePipelineState(GST_STATE_PLAYING);
 
-        m_networkState = MediaPlayer::Loading;
+        m_networkState = MediaPlayer::NetworkState::Loading;
         break;
     default:
         GST_DEBUG("Else : %d", getStateResult);
@@ -606,11 +606,11 @@ void MediaPlayerPrivateGStreamerMSE::updateStates()
         m_player->playbackStateChanged();
 
     if (m_networkState != oldNetworkState) {
-        GST_DEBUG("Network State Changed from %u to %u", oldNetworkState, m_networkState);
+        GST_DEBUG("Network State Changed from %u to %u", static_cast<unsigned>(oldNetworkState), static_cast<unsigned>(m_networkState));
         m_player->networkStateChanged();
     }
     if (m_readyState != oldReadyState) {
-        GST_DEBUG("Ready State Changed from %u to %u", oldReadyState, m_readyState);
+        GST_DEBUG("Ready State Changed from %u to %u", static_cast<unsigned>(oldReadyState), static_cast<unsigned>(m_readyState));
         m_player->readyStateChanged();
     }
 
@@ -719,7 +719,7 @@ void MediaPlayerPrivateGStreamerMSE::getSupportedTypes(HashSet<String, ASCIICase
 
 MediaPlayer::SupportsType MediaPlayerPrivateGStreamerMSE::supportsType(const MediaEngineSupportParameters& parameters)
 {
-    MediaPlayer::SupportsType result = MediaPlayer::IsNotSupported;
+    MediaPlayer::SupportsType result = MediaPlayer::SupportsType::IsNotSupported;
     if (!parameters.isMediaSource)
         return result;
 
@@ -727,7 +727,7 @@ MediaPlayer::SupportsType MediaPlayerPrivateGStreamerMSE::supportsType(const Med
 
     // YouTube TV provides empty types for some videos and we want to be selected as best media engine for them.
     if (containerType.isEmpty()) {
-        result = MediaPlayer::MayBeSupported;
+        result = MediaPlayer::SupportsType::MayBeSupported;
         GST_DEBUG("mime-type \"%s\" supported: %s", parameters.type.raw().utf8().data(), convertEnumerationToString(result).utf8().data());
         return result;
     }
@@ -737,7 +737,7 @@ MediaPlayer::SupportsType MediaPlayerPrivateGStreamerMSE::supportsType(const Med
     // Spec says we should not return "probably" if the codecs string is empty.
     if (gstRegistryScanner.isContainerTypeSupported(containerType)) {
         Vector<String> codecs = parameters.type.codecs();
-        result = codecs.isEmpty() ? MediaPlayer::MayBeSupported : (gstRegistryScanner.areAllCodecsSupported(codecs) ? MediaPlayer::IsSupported : MediaPlayer::IsNotSupported);
+        result = codecs.isEmpty() ? MediaPlayer::SupportsType::MayBeSupported : (gstRegistryScanner.areAllCodecsSupported(codecs) ? MediaPlayer::SupportsType::IsSupported : MediaPlayer::SupportsType::IsNotSupported);
     }
 
     auto finalResult = extendedSupportsType(parameters, result);
@@ -760,8 +760,8 @@ MediaTime MediaPlayerPrivateGStreamerMSE::currentMediaTime() const
     MediaTime position = MediaPlayerPrivateGStreamer::currentMediaTime();
 
     if (m_eosPending && position >= durationMediaTime()) {
-        if (m_networkState != MediaPlayer::Loaded) {
-            m_networkState = MediaPlayer::Loaded;
+        if (m_networkState != MediaPlayer::NetworkState::Loaded) {
+            m_networkState = MediaPlayer::NetworkState::Loaded;
             m_player->networkStateChanged();
         }
 
index 0f08c19..b8c4e01 100644 (file)
@@ -131,12 +131,12 @@ MediaPlayer::SupportsType MediaPlayerPrivateHolePunch::supportsType(const MediaE
     // Spec says we should not return "probably" if the codecs string is empty.
     if (!containerType.isEmpty() && mimeTypeCache().contains(containerType)) {
         if (parameters.type.codecs().isEmpty())
-            return MediaPlayer::MayBeSupported;
+            return MediaPlayer::SupportsType::MayBeSupported;
 
-        return MediaPlayer::IsSupported;
+        return MediaPlayer::SupportsType::IsSupported;
     }
 
-    return MediaPlayer::IsNotSupported;
+    return MediaPlayer::SupportsType::IsNotSupported;
 }
 
 void MediaPlayerPrivateHolePunch::registerMediaEngine(MediaEngineRegistrar registrar)
index 8bf7213..9a1087d 100644 (file)
@@ -76,8 +76,8 @@ public:
 
     bool paused() const final { return false; };
 
-    MediaPlayer::NetworkState networkState() const final { return MediaPlayer::Empty; };
-    MediaPlayer::ReadyState readyState() const final { return MediaPlayer::HaveMetadata; };
+    MediaPlayer::NetworkState networkState() const final { return MediaPlayer::NetworkState::Empty; };
+    MediaPlayer::ReadyState readyState() const final { return MediaPlayer::ReadyState::HaveMetadata; };
 
     std::unique_ptr<PlatformTimeRanges> buffered() const final { return makeUnique<PlatformTimeRanges>(); };
 
index 6d64ae9..bbbb432 100644 (file)
@@ -67,8 +67,8 @@ MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation(MediaPlayer
     , m_hasVideo(false)
     , m_preparingToPlay(false)
     , m_volume(1.0)
-    , m_networkState(MediaPlayer::Empty)
-    , m_readyState(MediaPlayer::HaveNothing)
+    , m_networkState(MediaPlayer::NetworkState::Empty)
+    , m_readyState(MediaPlayer::ReadyState::HaveNothing)
 {
     createSession();
 }
@@ -126,12 +126,12 @@ void MediaPlayerPrivateMediaFoundation::getSupportedTypes(HashSet<String, ASCIIC
 MediaPlayer::SupportsType MediaPlayerPrivateMediaFoundation::supportsType(const MediaEngineSupportParameters& parameters)
 {
     if (parameters.type.isEmpty())
-        return MediaPlayer::IsNotSupported;
+        return MediaPlayer::SupportsType::IsNotSupported;
 
     if (mimeTypeCache().contains(parameters.type.containerType()))
-        return MediaPlayer::IsSupported;
+        return MediaPlayer::SupportsType::IsSupported;
 
-    return MediaPlayer::IsNotSupported;
+    return MediaPlayer::SupportsType::IsNotSupported;
 }
 
 void MediaPlayerPrivateMediaFoundation::load(const String& url)
@@ -143,9 +143,9 @@ void MediaPlayerPrivateMediaFoundation::load(const String& url)
 
     startCreateMediaSource(url);
 
-    m_networkState = MediaPlayer::Loading;
+    m_networkState = MediaPlayer::NetworkState::Loading;
     m_player->networkStateChanged();
-    m_readyState = MediaPlayer::HaveNothing;
+    m_readyState = MediaPlayer::ReadyState::HaveNothing;
     m_player->readyStateChanged();
 }
 
@@ -731,15 +731,15 @@ void MediaPlayerPrivateMediaFoundation::updateReadyState()
 
     MediaPlayer::ReadyState oldReadyState = m_readyState;
     if (percentageOfPlaybackBufferFilled >= 100) {
-        m_readyState = MediaPlayer::HaveEnoughData;
+        m_readyState = MediaPlayer::ReadyState::HaveEnoughData;
         if (m_preparingToPlay) {
             pause();
             m_preparingToPlay = false;
         }
     } else if (percentageOfPlaybackBufferFilled > 0)
-        m_readyState = MediaPlayer::HaveFutureData;
+        m_readyState = MediaPlayer::ReadyState::HaveFutureData;
     else
-        m_readyState = MediaPlayer::HaveCurrentData;
+        m_readyState = MediaPlayer::ReadyState::HaveCurrentData;
 
     if (m_readyState != oldReadyState)
         m_player->readyStateChanged();
@@ -799,7 +799,7 @@ void MediaPlayerPrivateMediaFoundation::onSessionStarted()
 
 void MediaPlayerPrivateMediaFoundation::onSessionEnded()
 {
-    m_networkState = MediaPlayer::Loaded;
+    m_networkState = MediaPlayer::NetworkState::Loaded;
     m_player->networkStateChanged();
 
     m_paused = true;
index 600e6b3..494b3ee 100644 (file)
@@ -334,13 +334,13 @@ static VideoFullscreenInterfaceAVKit::ExitFullScreenReason convertToExitFullScre
     if (![_avPlayerController delegate])
         return;
 
-    WebCore::MediaPlayerEnums::VideoGravity gravity = WebCore::MediaPlayerEnums::VideoGravityResizeAspect;
+    MediaPlayerEnums::VideoGravity gravity = MediaPlayerEnums::VideoGravity::ResizeAspect;
     if (videoGravity == AVLayerVideoGravityResize)
-        gravity = WebCore::MediaPlayerEnums::VideoGravityResize;
+        gravity = MediaPlayerEnums::VideoGravity::Resize;
     if (videoGravity == AVLayerVideoGravityResizeAspect)
-        gravity = WebCore::MediaPlayerEnums::VideoGravityResizeAspect;
+        gravity = MediaPlayerEnums::VideoGravity::ResizeAspect;
     else if (videoGravity == AVLayerVideoGravityResizeAspectFill)
-        gravity = WebCore::MediaPlayerEnums::VideoGravityResizeAspectFill;
+        gravity = MediaPlayerEnums::VideoGravity::ResizeAspectFill;
     else
         ASSERT_NOT_REACHED();
     
index 15571cd..85c70b2 100644 (file)
@@ -195,7 +195,7 @@ enum class PIPState {
     [_pipViewController setPlaying:_playing];
     [self setVideoDimensions:NSEqualSizes(_videoDimensions, NSZeroSize) ? frame.size : _videoDimensions];
     if (_videoFullscreenInterfaceMac && _videoFullscreenInterfaceMac->videoFullscreenModel())
-        _videoFullscreenInterfaceMac->videoFullscreenModel()->setVideoLayerGravity(MediaPlayerEnums::VideoGravityResizeAspectFill);
+        _videoFullscreenInterfaceMac->videoFullscreenModel()->setVideoLayerGravity(MediaPlayerEnums::VideoGravity::ResizeAspectFill);
 
     _videoViewContainer = adoptNS([[WebVideoViewContainer alloc] initWithFrame:frame]);
     [_videoViewContainer setVideoViewContainerDelegate:self];
@@ -302,7 +302,7 @@ enum class PIPState {
             context.allowsImplicitAnimation = NO;
             [_videoViewContainer setFrame:_returningRect];
             _videoFullscreenInterfaceMac->videoFullscreenModel()->setVideoLayerFrame([_videoViewContainer bounds]);
-            _videoFullscreenInterfaceMac->videoFullscreenModel()->setVideoLayerGravity(MediaPlayerEnums::VideoGravityResizeAspect);
+            _videoFullscreenInterfaceMac->videoFullscreenModel()->setVideoLayerGravity(MediaPlayerEnums::VideoGravity::ResizeAspect);
 
             [[_returningWindow contentView] addSubview:_videoViewContainer.get() positioned:NSWindowAbove relativeTo:nil];
         } completionHandler:nil];
@@ -311,7 +311,7 @@ enum class PIPState {
     if (!self.isExitingToStandardFullscreen) {
         if (VideoFullscreenModel* videoFullscreenModel = _videoFullscreenInterfaceMac->videoFullscreenModel()) {
             videoFullscreenModel->didExitPictureInPicture();
-            videoFullscreenModel->setVideoLayerGravity(MediaPlayerEnums::VideoGravityResizeAspect);
+            videoFullscreenModel->setVideoLayerGravity(MediaPlayerEnums::VideoGravity::ResizeAspect);
         }
     }
 
index 387a21d..01a6a00 100644 (file)
@@ -62,27 +62,27 @@ void MockMediaPlayerMediaSource::getSupportedTypes(HashSet<String, ASCIICaseInse
 MediaPlayer::SupportsType MockMediaPlayerMediaSource::supportsType(const MediaEngineSupportParameters& parameters)
 {
     if (!parameters.isMediaSource)
-        return MediaPlayer::IsNotSupported;
+        return MediaPlayer::SupportsType::IsNotSupported;
 
     auto containerType = parameters.type.containerType();
     if (containerType.isEmpty() || !mimeTypeCache().contains(containerType))
-        return MediaPlayer::IsNotSupported;
+        return MediaPlayer::SupportsType::IsNotSupported;
 
     auto codecs = parameters.type.parameter(ContentType::codecsParameter());
     if (codecs.isEmpty())
-        return MediaPlayer::MayBeSupported;
+        return MediaPlayer::SupportsType::MayBeSupported;
 
     if (codecs == "mock" || codecs == "kcom")
-        return MediaPlayer::IsSupported;
+        return MediaPlayer::SupportsType::IsSupported;
 
-    return MediaPlayer::MayBeSupported;
+    return MediaPlayer::SupportsType::MayBeSupported;
 }
 
 MockMediaPlayerMediaSource::MockMediaPlayerMediaSource(MediaPlayer* player)
     : m_player(player)
     , m_currentTime(MediaTime::zeroTime())
-    , m_readyState(MediaPlayer::HaveNothing)
-    , m_networkState(MediaPlayer::Empty)
+    , m_readyState(MediaPlayer::ReadyState::HaveNothing)
+    , m_networkState(MediaPlayer::NetworkState::Empty)
     , m_playing(false)
     , m_seekCompleted(true)
 {
index 7dcc964..6e21b5d 100644 (file)
@@ -62,7 +62,7 @@ MediaSourcePrivate::AddStatus MockMediaSourcePrivate::addSourceBuffer(const Cont
     MediaEngineSupportParameters parameters;
     parameters.isMediaSource = true;
     parameters.type = contentType;
-    if (MockMediaPlayerMediaSource::supportsType(parameters) == MediaPlayer::IsNotSupported)
+    if (MockMediaPlayerMediaSource::supportsType(parameters) == MediaPlayer::SupportsType::IsNotSupported)
         return NotSupported;
 
     m_sourceBuffers.append(MockSourceBufferPrivate::create(this));
@@ -96,7 +96,7 @@ void MockMediaSourcePrivate::durationChanged()
 void MockMediaSourcePrivate::markEndOfStream(EndOfStreamStatus status)
 {
     if (status == EosNoError)
-        m_player.setNetworkState(MediaPlayer::Loaded);
+        m_player.setNetworkState(MediaPlayer::NetworkState::Loaded);
     m_isEnded = true;
 }
 
index 6b1373e..3286915 100644 (file)
@@ -220,7 +220,7 @@ void MockSourceBufferPrivate::removedFromMediaSource()
 
 MediaPlayer::ReadyState MockSourceBufferPrivate::readyState() const
 {
-    return m_mediaSource ? m_mediaSource->player().readyState() : MediaPlayer::HaveNothing;
+    return m_mediaSource ? m_mediaSource->player().readyState() : MediaPlayer::ReadyState::HaveNothing;
 }
 
 void MockSourceBufferPrivate::setReadyState(MediaPlayer::ReadyState readyState)
@@ -270,7 +270,7 @@ bool MockSourceBufferPrivate::canSwitchToType(const ContentType& contentType)
     MediaEngineSupportParameters parameters;
     parameters.isMediaSource = true;
     parameters.type = contentType;
-    return MockMediaPlayerMediaSource::supportsType(parameters) != MediaPlayer::IsNotSupported;
+    return MockMediaPlayerMediaSource::supportsType(parameters) != MediaPlayer::SupportsType::IsNotSupported;
 }
 
 void MockSourceBufferPrivate::enqueueSample(Ref<MediaSample>&& sample, const AtomString&)