| Index: Source/core/html/HTMLMediaElement.h
|
| diff --git a/Source/core/html/HTMLMediaElement.h b/Source/core/html/HTMLMediaElement.h
|
| index 6749d07d3465b3053d65296d1043b9749a3befe8..8827531a397cc6bb33cfe30c4d90506159778e86 100644
|
| --- a/Source/core/html/HTMLMediaElement.h
|
| +++ b/Source/core/html/HTMLMediaElement.h
|
| @@ -32,7 +32,8 @@
|
| #include "core/html/HTMLElement.h"
|
| #include "core/html/track/TextTrack.h"
|
| #include "platform/Supplementable.h"
|
| -#include "platform/graphics/media/MediaPlayer.h"
|
| +#include "platform/audio/AudioSourceProvider.h"
|
| +#include "public/platform/WebAudioSourceProviderClient.h"
|
| #include "public/platform/WebMediaPlayerClient.h"
|
| #include "public/platform/WebMimeRegistry.h"
|
|
|
| @@ -69,7 +70,7 @@ class VideoTrackList;
|
| // But it can't be until the Chromium WebMediaPlayerClientImpl class is fixed so it
|
| // no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement.
|
|
|
| -class CORE_EXPORT HTMLMediaElement : public HTMLElement, public WillBeHeapSupplementable<HTMLMediaElement>, public MediaPlayerClient, public ActiveDOMObject {
|
| +class CORE_EXPORT HTMLMediaElement : public HTMLElement, public WillBeHeapSupplementable<HTMLMediaElement>, public WebMediaPlayerClient, public ActiveDOMObject {
|
| DEFINE_WRAPPERTYPEINFO();
|
| WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement);
|
| public:
|
| @@ -82,7 +83,7 @@ public:
|
| #if ENABLE(WEB_AUDIO)
|
| void clearWeakMembers(Visitor*);
|
| #endif
|
| - blink::WebMediaPlayer* webMediaPlayer() const { return m_player ? m_player->webMediaPlayer() : 0; }
|
| + blink::WebMediaPlayer* webMediaPlayer() const { return m_webMediaPlayer.get(); }
|
|
|
| virtual bool hasVideo() const { return false; }
|
| bool hasAudio() const;
|
| @@ -112,7 +113,7 @@ public:
|
| NetworkState networkState() const;
|
|
|
| String preload() const;
|
| - MediaPlayer::Preload preloadType() const { return m_preload; }
|
| + WebMediaPlayer::Preload preloadType() const { return m_preload; }
|
| void setPreload(const AtomicString&);
|
|
|
| PassRefPtrWillBeRawPtr<TimeRanges> buffered() const;
|
| @@ -151,7 +152,36 @@ public:
|
|
|
| // media source extensions
|
| void closeMediaSource();
|
| - void durationChanged(double duration, bool requestSeek);
|
| + void mediaPlayerDurationChanged(double duration, bool requestSeek);
|
| +
|
| + virtual void networkStateChanged() override final;
|
| + virtual void readyStateChanged() override final;
|
| + virtual void timeChanged() override final;
|
| + virtual void repaint() override final;
|
| + virtual void durationChanged() override final;
|
| + virtual void sizeChanged() override final;
|
| + virtual void playbackStateChanged() override final;
|
| +
|
| + virtual void keyAdded(const WebString& keySystem, const WebString& sessionId) override final;
|
| + virtual void keyError(const WebString& keySystem, const WebString& sessionId, MediaKeyErrorCode, unsigned short systemCode) override final;
|
| + virtual void keyMessage(const WebString& keySystem, const WebString& sessionId, const unsigned char* message, unsigned messageLength, const WebURL& defaultURL) override final;
|
| + virtual void encrypted(WebEncryptedMediaInitDataType, const unsigned char* initData, unsigned initDataLength) override final;
|
| + virtual void didBlockPlaybackWaitingForKey() override final;
|
| + virtual void didResumePlaybackBlockedForKey() override final;
|
| + virtual void setWebLayer(blink::WebLayer*) override final;
|
| + virtual blink::WebMediaPlayer::TrackId addAudioTrack(const WebString&, blink::WebMediaPlayerClient::AudioTrackKind, const WebString&, const WebString&, bool) override final;
|
| + virtual void removeAudioTrack(blink::WebMediaPlayer::TrackId) override final;
|
| + virtual blink::WebMediaPlayer::TrackId addVideoTrack(const WebString&, blink::WebMediaPlayerClient::VideoTrackKind, const WebString&, const WebString&, bool) override final;
|
| + virtual void removeVideoTrack(blink::WebMediaPlayer::TrackId) override final;
|
| + virtual void addTextTrack(blink::WebInbandTextTrack*) override final;
|
| + virtual void removeTextTrack(blink::WebInbandTextTrack*) override final;
|
| + virtual void mediaSourceOpened(blink::WebMediaSource*) override final;
|
| + virtual void requestFullscreen() override final;
|
| + virtual void requestSeek(double) override final;
|
| + virtual void remoteRouteAvailabilityChanged(bool) override final;
|
| + virtual void connectedToRemoteDevice() override final;
|
| + virtual void disconnectedFromRemoteDevice() override final;
|
| +
|
|
|
| // controls
|
| bool shouldShowControls() const;
|
| @@ -176,8 +206,8 @@ public:
|
| TextTrackList* textTracks();
|
| CueTimeline& cueTimeline();
|
|
|
| - void addTextTrack(TextTrack*);
|
| - void removeTextTrack(TextTrack*);
|
| + void mediaPlayerAddTextTrack(TextTrack*);
|
| + void mediaPlayerRemoveTextTrack(TextTrack*);
|
| void textTracksChanged();
|
| void notifyMediaPlayerOfTextTrackChanges();
|
|
|
| @@ -187,15 +217,9 @@ public:
|
| void didAddTrackElement(HTMLTrackElement*);
|
| void didRemoveTrackElement(HTMLTrackElement*);
|
|
|
| - blink::WebMediaPlayer::TrackId addAudioTrack(const String& id, blink::WebMediaPlayerClient::AudioTrackKind, const AtomicString& label, const AtomicString& language, bool enabled);
|
| - void removeAudioTrack(blink::WebMediaPlayer::TrackId);
|
| - blink::WebMediaPlayer::TrackId addVideoTrack(const String& id, blink::WebMediaPlayerClient::VideoTrackKind, const AtomicString& label, const AtomicString& language, bool selected);
|
| - void removeVideoTrack(blink::WebMediaPlayer::TrackId);
|
| -
|
| - virtual void mediaPlayerDidAddTextTrack(blink::WebInbandTextTrack*) override final;
|
| - virtual void mediaPlayerDidRemoveTextTrack(blink::WebInbandTextTrack*) override final;
|
| + // cleanup
|
| // FIXME: Remove this when WebMediaPlayerClientImpl::loadInternal does not depend on it.
|
| - virtual KURL mediaPlayerPosterURL() override { return KURL(); }
|
| + virtual KURL mediaPlayerPosterURL() { return KURL(); }
|
|
|
| void honorUserPreferencesForAutomaticTextTrackSelection();
|
|
|
| @@ -218,7 +242,7 @@ public:
|
| // of one of them here.
|
| using HTMLElement::executionContext;
|
|
|
| - bool hasSingleSecurityOrigin() const { return !m_player || (webMediaPlayer() && webMediaPlayer()->hasSingleSecurityOrigin()); }
|
| + bool hasSingleSecurityOrigin() const { return webMediaPlayer() && webMediaPlayer()->hasSingleSecurityOrigin(); }
|
|
|
| bool isFullscreen() const;
|
| void enterFullscreen();
|
| @@ -228,10 +252,6 @@ public:
|
| bool closedCaptionsVisible() const;
|
| void setClosedCaptionsVisible(bool);
|
|
|
| - void remoteRouteAvailabilityChanged(bool);
|
| - void connectedToRemoteDevice();
|
| - void disconnectedFromRemoteDevice();
|
| -
|
| // Returns the MediaControls, or null if they have not been added yet.
|
| // Note that this can be non-null even if there is no controls attribute.
|
| MediaControls* mediaControls() const;
|
| @@ -330,7 +350,8 @@ private:
|
| void setReadyState(ReadyState);
|
| void setNetworkState(blink::WebMediaPlayer::NetworkState);
|
|
|
| - virtual void mediaPlayerNetworkStateChanged() override final;
|
| + // cleanup
|
| + /*virtual void mediaPlayerNetworkStateChanged() override final;
|
| virtual void mediaPlayerReadyStateChanged() override final;
|
| virtual void mediaPlayerTimeChanged() override final;
|
| virtual void mediaPlayerDurationChanged() override final;
|
| @@ -340,7 +361,7 @@ private:
|
| virtual void mediaPlayerRepaint() override final;
|
| virtual void mediaPlayerSizeChanged() override final;
|
| virtual void mediaPlayerSetWebLayer(blink::WebLayer*) override final;
|
| - virtual void mediaPlayerMediaSourceOpened(blink::WebMediaSource*) override final;
|
| + virtual void mediaPlayerMediaSourceOpened(blink::WebMediaSource*) override final;*/
|
|
|
| void loadTimerFired(Timer<HTMLMediaElement>*);
|
| void progressEventTimerFired(Timer<HTMLMediaElement>*);
|
| @@ -452,6 +473,9 @@ private:
|
|
|
| void audioTracksTimerFired(Timer<HTMLMediaElement>*);
|
|
|
| + PassOwnPtr<WebMediaPlayer> createWebMediaPlayer(const WebURL&);
|
| + void loadMediaPlayer(const WTF::String& url);
|
| +
|
| Timer<HTMLMediaElement> m_loadTimer;
|
| Timer<HTMLMediaElement> m_progressEventTimer;
|
| Timer<HTMLMediaElement> m_playbackProgressTimer;
|
| @@ -507,10 +531,9 @@ private:
|
| DeferredLoadState m_deferredLoadState;
|
| Timer<HTMLMediaElement> m_deferredLoadTimer;
|
|
|
| - OwnPtr<MediaPlayer> m_player;
|
| blink::WebLayer* m_webLayer;
|
|
|
| - MediaPlayer::Preload m_preload;
|
| + WebMediaPlayer::Preload m_preload;
|
|
|
| DisplayMode m_displayMode;
|
|
|
| @@ -571,10 +594,59 @@ private:
|
| // FIXME: Oilpan: Consider making this a strongly traced pointer with oilpan where strong cycles are not a problem.
|
| GC_PLUGIN_IGNORE("http://crbug.com/404577")
|
| RawPtrWillBeWeakMember<AudioSourceProviderClient> m_audioSourceNode;
|
| +
|
| + // AudioClientImpl wraps an AudioSourceProviderClient.
|
| + // When the audio format is known, Chromium calls setFormat().
|
| +
|
| + class AudioClientImpl final : public GarbageCollectedFinalized<AudioClientImpl>, public WebAudioSourceProviderClient {
|
| + public:
|
| + explicit AudioClientImpl(AudioSourceProviderClient* client)
|
| + : m_client(client)
|
| + {
|
| + }
|
| +
|
| + virtual ~AudioClientImpl() { }
|
| +
|
| + // WebAudioSourceProviderClient
|
| + virtual void setFormat(size_t numberOfChannels, float sampleRate) override;
|
| +
|
| + DECLARE_TRACE();
|
| +
|
| + private:
|
| + Member<AudioSourceProviderClient> m_client;
|
| + };
|
| +
|
| + // AudioSourceProviderImpl wraps a WebAudioSourceProvider.
|
| + // provideInput() calls into Chromium to get a rendered audio stream.
|
| +
|
| + class AudioSourceProviderImpl final : public AudioSourceProvider {
|
| + public:
|
| + AudioSourceProviderImpl()
|
| + : m_webAudioSourceProvider(0)
|
| + {
|
| + }
|
| +
|
| + virtual ~AudioSourceProviderImpl() { }
|
| +
|
| + // Wraps the given WebAudioSourceProvider.
|
| + void wrap(WebAudioSourceProvider*);
|
| +
|
| + // AudioSourceProvider
|
| + virtual void setClient(AudioSourceProviderClient*) override;
|
| + virtual void provideInput(AudioBus*, size_t framesToProcess) override;
|
| +
|
| + private:
|
| + WebAudioSourceProvider* m_webAudioSourceProvider;
|
| + Persistent<AudioClientImpl> m_client;
|
| + Mutex provideInputLock;
|
| + };
|
| +
|
| + AudioSourceProviderImpl m_audioSourceProvider;
|
| #endif
|
|
|
| friend class MediaController;
|
| RefPtrWillBeMember<MediaController> m_mediaController;
|
| + OwnPtr<WebMediaPlayer> m_webMediaPlayer;
|
|
|
| friend class Internals;
|
| friend class TrackDisplayUpdateScope;
|
|
|