[Mac] Simplify code to support media engines which do not support target playback
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Apr 2015 21:40:10 +0000 (21:40 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 28 Apr 2015 21:40:10 +0000 (21:40 +0000)
commitc7621c9fc9ca7c37a4978f073abc3f95eaff4b96
tree1d51143a3a4598a0a7c046f6aae648c2afd43e45
parentcac01cf8959b0a96a75cc83f9138e9311acf19f8
[Mac] Simplify code to support media engines which do not support target playback
https://bugs.webkit.org/show_bug.cgi?id=144332

Reviewed by Jer Noble.

* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::externalOutputDeviceAvailableDidChange): Always make client
callback, let them decide if it is significant or not.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement): m_loadTimer -> m_pendingActionTimer.
(WebCore::HTMLMediaElement::scheduleDelayedAction): Handle CheckPlaybackTargetCompatablity.
(WebCore::HTMLMediaElement::scheduleNextSourceChild): m_loadTimer -> m_pendingActionTimer.
(WebCore::HTMLMediaElement::loadTimerFired): Renamed pendingActionTimerFired.
(WebCore::HTMLMediaElement::prepareForLoad): m_loadTimer -> m_pendingActionTimer.
(WebCore::HTMLMediaElement::setDefaultPlaybackRate): Add logging.
(WebCore::HTMLMediaElement::clearMediaPlayer): m_loadTimer -> m_pendingActionTimer.
(WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsSupported): Removed.
(WebCore::HTMLMediaElement::dispatchEvent): If a 'webkitcurrentplaybacktargetiswirelesschanged'
event is dispatched when the current target is wireless but the media engine does not support
wireless playback, tell the media engine not to play to the target.
* html/HTMLMediaElement.h:
* html/HTMLMediaElement.idl:

* html/HTMLMediaSession.cpp:
(WebCore::HTMLMediaSession::showPlaybackTargetPicker): Drive-by fix to disallow audio-only files.
(WebCore::HTMLMediaSession::currentPlaybackTargetIsSupported): Deleted.
* html/HTMLMediaSession.h:

* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::isCurrentPlaybackTargetSupported): Deleted.
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget): Use a RetainPtr
to explicitly manage the lifetime of the temporary object.
(WebCore::MediaPlayerPrivateAVFoundationObjC::isPlayingToWirelessPlaybackTarget): Ditto.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setShouldPlayToPlaybackTarget):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetWireless):
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::isCurrentPlaybackTargetSupported): Deleted.

* platform/graphics/mac/MediaPlayerPrivateQTKit.h:
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::setShouldPlayToPlaybackTarget):
(WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetWireless):
(WebCore::MediaPlayerPrivateQTKit::isCurrentPlaybackTargetSupported): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@183509 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/HTMLMediaElement.idl
Source/WebCore/html/HTMLMediaSession.cpp
Source/WebCore/html/HTMLMediaSession.h
Source/WebCore/platform/graphics/MediaPlayer.cpp
Source/WebCore/platform/graphics/MediaPlayer.h
Source/WebCore/platform/graphics/MediaPlayerPrivate.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm
Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.h
Source/WebCore/platform/graphics/mac/MediaPlayerPrivateQTKit.mm