Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 | 25 |
| 26 #ifndef HTMLMediaElement_h | 26 #ifndef HTMLMediaElement_h |
| 27 #define HTMLMediaElement_h | 27 #define HTMLMediaElement_h |
| 28 | 28 |
| 29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
| 30 #include "core/dom/ActiveDOMObject.h" | 30 #include "core/dom/ActiveDOMObject.h" |
| 31 #include "core/events/GenericEventQueue.h" | 31 #include "core/events/GenericEventQueue.h" |
| 32 #include "core/html/HTMLElement.h" | 32 #include "core/html/HTMLElement.h" |
| 33 #include "core/html/track/TextTrack.h" | 33 #include "core/html/track/TextTrack.h" |
| 34 #include "platform/Supplementable.h" | 34 #include "platform/Supplementable.h" |
| 35 #include "platform/graphics/media/MediaPlayer.h" | 35 #include "platform/audio/AudioSourceProvider.h" |
| 36 #include "public/platform/WebAudioSourceProviderClient.h" | |
| 36 #include "public/platform/WebMediaPlayerClient.h" | 37 #include "public/platform/WebMediaPlayerClient.h" |
| 37 #include "public/platform/WebMimeRegistry.h" | 38 #include "public/platform/WebMimeRegistry.h" |
| 38 | 39 |
| 39 namespace blink { | 40 namespace blink { |
| 40 class WebInbandTextTrack; | 41 class WebInbandTextTrack; |
| 41 class WebLayer; | 42 class WebLayer; |
| 42 } | 43 } |
| 43 | 44 |
| 44 namespace blink { | 45 namespace blink { |
| 45 | 46 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 58 class MediaController; | 59 class MediaController; |
| 59 class MediaControls; | 60 class MediaControls; |
| 60 class MediaError; | 61 class MediaError; |
| 61 class HTMLMediaSource; | 62 class HTMLMediaSource; |
| 62 class TextTrackContainer; | 63 class TextTrackContainer; |
| 63 class TextTrackList; | 64 class TextTrackList; |
| 64 class TimeRanges; | 65 class TimeRanges; |
| 65 class URLRegistry; | 66 class URLRegistry; |
| 66 class VideoTrackList; | 67 class VideoTrackList; |
| 67 | 68 |
| 68 // FIXME: The inheritance from MediaPlayerClient here should be private inherita nce. | 69 class CORE_EXPORT HTMLMediaElement : public HTMLElement, public WillBeHeapSupple mentable<HTMLMediaElement>, public WebMediaPlayerClient, public ActiveDOMObject { |
|
ddorwin
2015/07/06 20:43:01
Can WebMediaPlayerClient be private (similar to th
Srirama
2015/07/09 15:19:37
It is giving problem in frameloaderclientimpl whil
ddorwin
2015/07/09 18:37:42
I don't see such a cast (or even "webmediaplayercl
philipj_slow
2015/07/09 19:50:15
It's the implicit cast from HTMLMediaElement* to W
ddorwin
2015/07/09 21:15:11
Ah, thanks. I'm not an expert in where to put such
philipj_slow
2015/07/09 21:41:03
I think it would be OK to leave this as
// TODO(s
Srirama
2015/07/15 13:25:24
Done. Added TODO for now.
| |
| 69 // But it can't be until the Chromium WebMediaPlayerClientImpl class is fixed so it | |
| 70 // no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement. | |
| 71 | |
| 72 class CORE_EXPORT HTMLMediaElement : public HTMLElement, public WillBeHeapSupple mentable<HTMLMediaElement>, public MediaPlayerClient, public ActiveDOMObject { | |
| 73 DEFINE_WRAPPERTYPEINFO(); | 70 DEFINE_WRAPPERTYPEINFO(); |
| 74 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement); | 71 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(HTMLMediaElement); |
| 75 WILL_BE_USING_PRE_FINALIZER(HTMLMediaElement, dispose); | 72 WILL_BE_USING_PRE_FINALIZER(HTMLMediaElement, dispose); |
| 76 public: | 73 public: |
| 77 static WebMimeRegistry::SupportsType supportsType(const ContentType&, const String& keySystem = String()); | 74 static WebMimeRegistry::SupportsType supportsType(const ContentType&, const String& keySystem = String()); |
| 78 | 75 |
| 79 static void setMediaStreamRegistry(URLRegistry*); | 76 static void setMediaStreamRegistry(URLRegistry*); |
| 80 static bool isMediaStreamURL(const String& url); | 77 static bool isMediaStreamURL(const String& url); |
| 81 | 78 |
| 82 DECLARE_VIRTUAL_TRACE(); | 79 DECLARE_VIRTUAL_TRACE(); |
| 83 #if ENABLE(WEB_AUDIO) | 80 #if ENABLE(WEB_AUDIO) |
| 84 void clearWeakMembers(Visitor*); | 81 void clearWeakMembers(Visitor*); |
| 85 #endif | 82 #endif |
| 86 WebMediaPlayer* webMediaPlayer() const { return m_player ? m_player->webMedi aPlayer() : 0; } | 83 WebMediaPlayer* webMediaPlayer() const |
| 84 { | |
| 85 return m_webMediaPlayer.get(); | |
| 86 } | |
| 87 | 87 |
| 88 virtual bool hasVideo() const { return false; } | 88 virtual bool hasVideo() const { return false; } |
| 89 bool hasAudio() const; | 89 bool hasAudio() const; |
| 90 | 90 |
| 91 bool supportsSave() const; | 91 bool supportsSave() const; |
| 92 | 92 |
| 93 WebLayer* platformLayer() const; | 93 WebLayer* platformLayer() const; |
| 94 | 94 |
| 95 enum DelayedActionType { | 95 enum DelayedActionType { |
| 96 LoadMediaResource = 1 << 0, | 96 LoadMediaResource = 1 << 0, |
| 97 LoadTextTrackResource = 1 << 1, | 97 LoadTextTrackResource = 1 << 1, |
| 98 TextTrackChangesNotification = 1 << 2 | 98 TextTrackChangesNotification = 1 << 2 |
| 99 }; | 99 }; |
| 100 void scheduleDelayedAction(DelayedActionType); | 100 void scheduleDelayedAction(DelayedActionType); |
| 101 | 101 |
| 102 bool hasRemoteRoutes() const { return m_remoteRoutesAvailable; } | 102 bool hasRemoteRoutes() const { return m_remoteRoutesAvailable; } |
| 103 bool isPlayingRemotely() const { return m_playingRemotely; } | 103 bool isPlayingRemotely() const { return m_playingRemotely; } |
| 104 | 104 |
| 105 // error state | 105 // error state |
| 106 PassRefPtrWillBeRawPtr<MediaError> error() const; | 106 PassRefPtrWillBeRawPtr<MediaError> error() const; |
| 107 | 107 |
| 108 // network state | 108 // network state |
| 109 void setSrc(const AtomicString&); | 109 void setSrc(const AtomicString&); |
| 110 const KURL& currentSrc() const { return m_currentSrc; } | 110 const KURL& currentSrc() const { return m_currentSrc; } |
| 111 | 111 |
| 112 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO _SOURCE }; | 112 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO _SOURCE }; |
| 113 NetworkState networkState() const; | 113 NetworkState networkState() const; |
| 114 | 114 |
| 115 String preload() const; | 115 String preload() const; |
| 116 MediaPlayer::Preload effectivePreloadType() const; | 116 WebMediaPlayer::Preload effectivePreloadType() const; |
| 117 void setPreload(const AtomicString&); | 117 void setPreload(const AtomicString&); |
| 118 | 118 |
| 119 PassRefPtrWillBeRawPtr<TimeRanges> buffered() const; | 119 PassRefPtrWillBeRawPtr<TimeRanges> buffered() const; |
| 120 void load(); | 120 void load(); |
| 121 String canPlayType(const String& mimeType, const String& keySystem = String( )) const; | 121 String canPlayType(const String& mimeType, const String& keySystem = String( )) const; |
| 122 | 122 |
| 123 // ready state | 123 // ready state |
| 124 enum ReadyState { HAVE_NOTHING, HAVE_METADATA, HAVE_CURRENT_DATA, HAVE_FUTUR E_DATA, HAVE_ENOUGH_DATA }; | 124 enum ReadyState { HAVE_NOTHING, HAVE_METADATA, HAVE_CURRENT_DATA, HAVE_FUTUR E_DATA, HAVE_ENOUGH_DATA }; |
| 125 ReadyState readyState() const; | 125 ReadyState readyState() const; |
| 126 bool seeking() const; | 126 bool seeking() const; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 181 void removeTextTrack(TextTrack*); | 181 void removeTextTrack(TextTrack*); |
| 182 void textTracksChanged(); | 182 void textTracksChanged(); |
| 183 void notifyMediaPlayerOfTextTrackChanges(); | 183 void notifyMediaPlayerOfTextTrackChanges(); |
| 184 | 184 |
| 185 // Implements the "forget the media element's media-resource-specific tracks " algorithm in the HTML5 spec. | 185 // Implements the "forget the media element's media-resource-specific tracks " algorithm in the HTML5 spec. |
| 186 void forgetResourceSpecificTracks(); | 186 void forgetResourceSpecificTracks(); |
| 187 | 187 |
| 188 void didAddTrackElement(HTMLTrackElement*); | 188 void didAddTrackElement(HTMLTrackElement*); |
| 189 void didRemoveTrackElement(HTMLTrackElement*); | 189 void didRemoveTrackElement(HTMLTrackElement*); |
| 190 | 190 |
| 191 WebMediaPlayer::TrackId addAudioTrack(const String& id, WebMediaPlayerClient ::AudioTrackKind, const AtomicString& label, const AtomicString& language, bool enabled); | |
| 192 void removeAudioTrack(WebMediaPlayer::TrackId); | |
| 193 WebMediaPlayer::TrackId addVideoTrack(const String& id, WebMediaPlayerClient ::VideoTrackKind, const AtomicString& label, const AtomicString& language, bool selected); | |
| 194 void removeVideoTrack(WebMediaPlayer::TrackId); | |
| 195 | |
| 196 virtual void mediaPlayerDidAddTextTrack(WebInbandTextTrack*) override final; | |
| 197 virtual void mediaPlayerDidRemoveTextTrack(WebInbandTextTrack*) override fin al; | |
| 198 // FIXME: Remove this when WebMediaPlayerClientImpl::loadInternal does not d epend on it. | |
| 199 virtual KURL mediaPlayerPosterURL() override { return KURL(); } | |
| 200 | |
| 201 void honorUserPreferencesForAutomaticTextTrackSelection(); | 191 void honorUserPreferencesForAutomaticTextTrackSelection(); |
| 202 | 192 |
| 203 bool textTracksAreReady() const; | 193 bool textTracksAreReady() const; |
| 204 enum VisibilityChangeAssumption { | 194 enum VisibilityChangeAssumption { |
| 205 AssumeNoVisibleChange, | 195 AssumeNoVisibleChange, |
| 206 AssumeVisibleChange | 196 AssumeVisibleChange |
| 207 }; | 197 }; |
| 208 void configureTextTrackDisplay(VisibilityChangeAssumption); | 198 void configureTextTrackDisplay(VisibilityChangeAssumption); |
| 209 void updateTextTrackDisplay(); | 199 void updateTextTrackDisplay(); |
| 210 double lastSeekTime() const { return m_lastSeekTime; } | 200 double lastSeekTime() const { return m_lastSeekTime; } |
| 211 void textTrackReadyStateChanged(TextTrack*); | 201 void textTrackReadyStateChanged(TextTrack*); |
| 212 | 202 |
| 213 void textTrackModeChanged(TextTrack*); | 203 void textTrackModeChanged(TextTrack*); |
| 214 | 204 |
| 215 // EventTarget function. | 205 // EventTarget function. |
| 216 // Both Node (via HTMLElement) and ActiveDOMObject define this method, which | 206 // Both Node (via HTMLElement) and ActiveDOMObject define this method, which |
| 217 // causes an ambiguity error at compile time. This class's constructor | 207 // causes an ambiguity error at compile time. This class's constructor |
| 218 // ensures that both implementations return document, so return the result | 208 // ensures that both implementations return document, so return the result |
| 219 // of one of them here. | 209 // of one of them here. |
| 220 using HTMLElement::executionContext; | 210 using HTMLElement::executionContext; |
| 221 | 211 |
| 222 bool hasSingleSecurityOrigin() const { return !m_player || (webMediaPlayer() && webMediaPlayer()->hasSingleSecurityOrigin()); } | 212 bool hasSingleSecurityOrigin() const { return webMediaPlayer() && webMediaPl ayer()->hasSingleSecurityOrigin(); } |
| 223 | 213 |
| 224 bool isFullscreen() const; | 214 bool isFullscreen() const; |
| 225 void enterFullscreen(); | 215 void enterFullscreen(); |
| 226 void exitFullscreen(); | 216 void exitFullscreen(); |
| 227 | 217 |
| 228 bool hasClosedCaptions() const; | 218 bool hasClosedCaptions() const; |
| 229 bool closedCaptionsVisible() const; | 219 bool closedCaptionsVisible() const; |
| 230 void setClosedCaptionsVisible(bool); | 220 void setClosedCaptionsVisible(bool); |
| 231 | 221 |
| 232 void remoteRouteAvailabilityChanged(bool); | |
| 233 void connectedToRemoteDevice(); | |
| 234 void disconnectedFromRemoteDevice(); | |
| 235 | |
| 236 // Returns the MediaControls, or null if they have not been added yet. | 222 // Returns the MediaControls, or null if they have not been added yet. |
| 237 // Note that this can be non-null even if there is no controls attribute. | 223 // Note that this can be non-null even if there is no controls attribute. |
| 238 MediaControls* mediaControls() const; | 224 MediaControls* mediaControls() const; |
| 239 | 225 |
| 240 // Notifies the media element that the media controls became visible, so | 226 // Notifies the media element that the media controls became visible, so |
| 241 // that text track layout may be updated to avoid overlapping them. | 227 // that text track layout may be updated to avoid overlapping them. |
| 242 void mediaControlsDidBecomeVisible(); | 228 void mediaControlsDidBecomeVisible(); |
| 243 | 229 |
| 244 void sourceWasRemoved(HTMLSourceElement*); | 230 void sourceWasRemoved(HTMLSourceElement*); |
| 245 void sourceWasAdded(HTMLSourceElement*); | 231 void sourceWasAdded(HTMLSourceElement*); |
| 246 | 232 |
| 247 // ActiveDOMObject functions. | 233 // ActiveDOMObject functions. |
| 248 virtual bool hasPendingActivity() const override final; | 234 virtual bool hasPendingActivity() const override final; |
| 249 virtual void contextDestroyed() override final; | 235 virtual void contextDestroyed() override final; |
| 250 | 236 |
| 251 #if ENABLE(WEB_AUDIO) | 237 #if ENABLE(WEB_AUDIO) |
| 252 AudioSourceProviderClient* audioSourceNode() { return m_audioSourceNode; } | 238 AudioSourceProviderClient* audioSourceNode() { return m_audioSourceNode; } |
| 253 void setAudioSourceNode(AudioSourceProviderClient*); | 239 void setAudioSourceNode(AudioSourceProviderClient*); |
| 254 | 240 |
| 255 AudioSourceProvider* audioSourceProvider(); | 241 AudioSourceProvider* audioSourceProvider() { return &m_audioSourceProvider; } |
| 256 #endif | 242 #endif |
| 257 | 243 |
| 258 enum InvalidURLAction { DoNothing, Complain }; | 244 enum InvalidURLAction { DoNothing, Complain }; |
| 259 bool isSafeToLoadURL(const KURL&, InvalidURLAction); | 245 bool isSafeToLoadURL(const KURL&, InvalidURLAction); |
| 260 | 246 |
| 261 // Checks to see if current media data is CORS-same-origin as the | 247 // Checks to see if current media data is CORS-same-origin as the |
| 262 // specified origin. | 248 // specified origin. |
| 263 bool isMediaDataCORSSameOrigin(SecurityOrigin*) const; | 249 bool isMediaDataCORSSameOrigin(SecurityOrigin*) const; |
| 264 | 250 |
| 265 MediaController* controller() const; | 251 MediaController* controller() const; |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 292 #if ENABLE(OILPAN) | 278 #if ENABLE(OILPAN) |
| 293 void dispose(); | 279 void dispose(); |
| 294 #endif | 280 #endif |
| 295 | 281 |
| 296 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr ide; | 282 virtual void parseAttribute(const QualifiedName&, const AtomicString&) overr ide; |
| 297 virtual void finishParsingChildren() override final; | 283 virtual void finishParsingChildren() override final; |
| 298 virtual bool isURLAttribute(const Attribute&) const override; | 284 virtual bool isURLAttribute(const Attribute&) const override; |
| 299 virtual void attach(const AttachContext& = AttachContext()) override; | 285 virtual void attach(const AttachContext& = AttachContext()) override; |
| 300 | 286 |
| 301 virtual void didMoveToNewDocument(Document& oldDocument) override; | 287 virtual void didMoveToNewDocument(Document& oldDocument) override; |
| 288 virtual KURL posterImageURL() const { return KURL(); } | |
| 302 | 289 |
| 303 enum DisplayMode { Unknown, Poster, Video }; | 290 enum DisplayMode { Unknown, Poster, Video }; |
| 304 DisplayMode displayMode() const { return m_displayMode; } | 291 DisplayMode displayMode() const { return m_displayMode; } |
| 305 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } | 292 virtual void setDisplayMode(DisplayMode mode) { m_displayMode = mode; } |
| 306 | 293 |
| 307 void setControllerInternal(PassRefPtrWillBeRawPtr<MediaController>); | 294 void setControllerInternal(PassRefPtrWillBeRawPtr<MediaController>); |
| 308 | 295 |
| 309 private: | 296 private: |
| 310 void createMediaPlayer(); | 297 void createMediaPlayer(); |
| 311 | 298 |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 329 virtual void defaultEventHandler(Event*) override final; | 316 virtual void defaultEventHandler(Event*) override final; |
| 330 | 317 |
| 331 // ActiveDOMObject functions. | 318 // ActiveDOMObject functions. |
| 332 virtual void stop() override final; | 319 virtual void stop() override final; |
| 333 | 320 |
| 334 virtual void updateDisplayState() { } | 321 virtual void updateDisplayState() { } |
| 335 | 322 |
| 336 void setReadyState(ReadyState); | 323 void setReadyState(ReadyState); |
| 337 void setNetworkState(WebMediaPlayer::NetworkState); | 324 void setNetworkState(WebMediaPlayer::NetworkState); |
| 338 | 325 |
| 339 virtual void mediaPlayerNetworkStateChanged() override final; | 326 virtual void networkStateChanged() override final; |
|
ddorwin
2015/07/06 20:43:01
Should we label these as:
// <interface> implement
Srirama
2015/07/09 15:19:37
Done.
| |
| 340 virtual void mediaPlayerReadyStateChanged() override final; | 327 virtual void readyStateChanged() override final; |
| 341 virtual void mediaPlayerTimeChanged() override final; | 328 virtual void timeChanged() override final; |
| 342 virtual void mediaPlayerDurationChanged() override final; | 329 virtual void repaint() override final; |
| 343 virtual void mediaPlayerPlaybackStateChanged() override final; | 330 virtual void durationChanged() override final; |
| 331 virtual void sizeChanged() override final; | |
| 332 virtual void playbackStateChanged() override final; | |
| 333 | |
| 334 virtual void setWebLayer(WebLayer*) override final; | |
| 335 virtual WebMediaPlayer::TrackId addAudioTrack(const WebString&, WebMediaPlay erClient::AudioTrackKind, const WebString&, const WebString&, bool) override fin al; | |
| 336 virtual void removeAudioTrack(WebMediaPlayer::TrackId) override final; | |
| 337 virtual WebMediaPlayer::TrackId addVideoTrack(const WebString&, WebMediaPlay erClient::VideoTrackKind, const WebString&, const WebString&, bool) override fin al; | |
| 338 virtual void removeVideoTrack(WebMediaPlayer::TrackId) override final; | |
| 339 virtual void addTextTrack(WebInbandTextTrack*) override final; | |
| 340 virtual void removeTextTrack(WebInbandTextTrack*) override final; | |
| 341 virtual void mediaSourceOpened(WebMediaSource*) override final; | |
| 344 virtual void mediaPlayerRequestSeek(double) override final; | 342 virtual void mediaPlayerRequestSeek(double) override final; |
| 345 virtual void mediaPlayerRepaint() override final; | 343 virtual void remoteRouteAvailabilityChanged(bool) override final; |
| 346 virtual void mediaPlayerSizeChanged() override final; | 344 virtual void connectedToRemoteDevice() override final; |
| 347 virtual void mediaPlayerSetWebLayer(WebLayer*) override final; | 345 virtual void disconnectedFromRemoteDevice() override final; |
| 348 virtual void mediaPlayerMediaSourceOpened(WebMediaSource*) override final; | |
| 349 | 346 |
| 350 void loadTimerFired(Timer<HTMLMediaElement>*); | 347 void loadTimerFired(Timer<HTMLMediaElement>*); |
| 351 void progressEventTimerFired(Timer<HTMLMediaElement>*); | 348 void progressEventTimerFired(Timer<HTMLMediaElement>*); |
| 352 void playbackProgressTimerFired(Timer<HTMLMediaElement>*); | 349 void playbackProgressTimerFired(Timer<HTMLMediaElement>*); |
| 353 void startPlaybackProgressTimer(); | 350 void startPlaybackProgressTimer(); |
| 354 void startProgressEventTimer(); | 351 void startProgressEventTimer(); |
| 355 void stopPeriodicTimers(); | 352 void stopPeriodicTimers(); |
| 356 | 353 |
| 357 void seek(double time); | 354 void seek(double time); |
| 358 void finishSeek(); | 355 void finishSeek(); |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 505 WaitingForStopDelayingLoadEventTask, | 502 WaitingForStopDelayingLoadEventTask, |
| 506 // The load is the deferred, and waiting for a triggering event. | 503 // The load is the deferred, and waiting for a triggering event. |
| 507 WaitingForTrigger, | 504 WaitingForTrigger, |
| 508 // The load is deferred, and waiting for the task to set the | 505 // The load is deferred, and waiting for the task to set the |
| 509 // delaying-the-load-event flag, after which the load will be executed. | 506 // delaying-the-load-event flag, after which the load will be executed. |
| 510 ExecuteOnStopDelayingLoadEventTask | 507 ExecuteOnStopDelayingLoadEventTask |
| 511 }; | 508 }; |
| 512 DeferredLoadState m_deferredLoadState; | 509 DeferredLoadState m_deferredLoadState; |
| 513 Timer<HTMLMediaElement> m_deferredLoadTimer; | 510 Timer<HTMLMediaElement> m_deferredLoadTimer; |
| 514 | 511 |
| 515 OwnPtr<MediaPlayer> m_player; | 512 OwnPtr<WebMediaPlayer> m_webMediaPlayer; |
| 516 WebLayer* m_webLayer; | 513 WebLayer* m_webLayer; |
| 517 | 514 |
| 518 MediaPlayer::Preload m_preload; | 515 WebMediaPlayer::Preload m_preload; |
| 519 | 516 |
| 520 DisplayMode m_displayMode; | 517 DisplayMode m_displayMode; |
| 521 | 518 |
| 522 RefPtrWillBeMember<HTMLMediaSource> m_mediaSource; | 519 RefPtrWillBeMember<HTMLMediaSource> m_mediaSource; |
| 523 | 520 |
| 524 // Cached time value. Only valid when ready state is HAVE_METADATA or | 521 // Cached time value. Only valid when ready state is HAVE_METADATA or |
| 525 // higher, otherwise the current time is assumed to be zero. | 522 // higher, otherwise the current time is assumed to be zero. |
| 526 mutable double m_cachedTime; | 523 mutable double m_cachedTime; |
| 527 | 524 |
| 528 double m_fragmentEndTime; | 525 double m_fragmentEndTime; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 569 RefPtrWillBeMember<TextTrackList> m_textTracks; | 566 RefPtrWillBeMember<TextTrackList> m_textTracks; |
| 570 WillBeHeapVector<RefPtrWillBeMember<TextTrack>> m_textTracksWhenResourceSele ctionBegan; | 567 WillBeHeapVector<RefPtrWillBeMember<TextTrack>> m_textTracksWhenResourceSele ctionBegan; |
| 571 | 568 |
| 572 OwnPtrWillBeMember<CueTimeline> m_cueTimeline; | 569 OwnPtrWillBeMember<CueTimeline> m_cueTimeline; |
| 573 | 570 |
| 574 #if ENABLE(WEB_AUDIO) | 571 #if ENABLE(WEB_AUDIO) |
| 575 // This is a weak reference, since m_audioSourceNode holds a reference to us . | 572 // This is a weak reference, since m_audioSourceNode holds a reference to us . |
| 576 // FIXME: Oilpan: Consider making this a strongly traced pointer with oilpan where strong cycles are not a problem. | 573 // FIXME: Oilpan: Consider making this a strongly traced pointer with oilpan where strong cycles are not a problem. |
| 577 GC_PLUGIN_IGNORE("http://crbug.com/404577") | 574 GC_PLUGIN_IGNORE("http://crbug.com/404577") |
| 578 RawPtrWillBeWeakMember<AudioSourceProviderClient> m_audioSourceNode; | 575 RawPtrWillBeWeakMember<AudioSourceProviderClient> m_audioSourceNode; |
| 576 | |
| 577 // AudioClientImpl wraps an AudioSourceProviderClient. | |
| 578 // When the audio format is known, Chromium calls setFormat(). | |
| 579 | |
| 580 class AudioClientImpl final : public GarbageCollectedFinalized<AudioClientIm pl>, public WebAudioSourceProviderClient { | |
| 581 public: | |
| 582 explicit AudioClientImpl(AudioSourceProviderClient* client) | |
| 583 : m_client(client) | |
| 584 { | |
| 585 } | |
| 586 | |
| 587 virtual ~AudioClientImpl() { } | |
| 588 | |
| 589 // WebAudioSourceProviderClient | |
| 590 virtual void setFormat(size_t numberOfChannels, float sampleRate) overri de; | |
| 591 | |
| 592 DECLARE_TRACE(); | |
| 593 | |
| 594 private: | |
| 595 Member<AudioSourceProviderClient> m_client; | |
| 596 }; | |
| 597 | |
| 598 // AudioSourceProviderImpl wraps a WebAudioSourceProvider. | |
| 599 // provideInput() calls into Chromium to get a rendered audio stream. | |
| 600 | |
| 601 class AudioSourceProviderImpl final : public AudioSourceProvider { | |
| 602 public: | |
| 603 AudioSourceProviderImpl() | |
| 604 : m_webAudioSourceProvider(0) | |
| 605 { | |
| 606 } | |
| 607 | |
| 608 virtual ~AudioSourceProviderImpl() { } | |
| 609 | |
| 610 // Wraps the given WebAudioSourceProvider. | |
| 611 void wrap(WebAudioSourceProvider*); | |
| 612 | |
| 613 // AudioSourceProvider | |
| 614 virtual void setClient(AudioSourceProviderClient*) override; | |
| 615 virtual void provideInput(AudioBus*, size_t framesToProcess) override; | |
| 616 | |
| 617 private: | |
| 618 WebAudioSourceProvider* m_webAudioSourceProvider; | |
| 619 Persistent<AudioClientImpl> m_client; | |
| 620 Mutex provideInputLock; | |
| 621 }; | |
| 622 | |
| 623 AudioSourceProviderImpl m_audioSourceProvider; | |
| 579 #endif | 624 #endif |
| 580 | 625 |
| 581 friend class MediaController; | 626 friend class MediaController; |
| 582 RefPtrWillBeMember<MediaController> m_mediaController; | 627 RefPtrWillBeMember<MediaController> m_mediaController; |
| 583 | 628 |
| 584 friend class Internals; | 629 friend class Internals; |
| 585 friend class TrackDisplayUpdateScope; | 630 friend class TrackDisplayUpdateScope; |
| 586 | 631 |
| 587 static URLRegistry* s_mediaStreamRegistry; | 632 static URLRegistry* s_mediaStreamRegistry; |
| 588 }; | 633 }; |
| 589 | 634 |
| 590 inline bool isHTMLMediaElement(const HTMLElement& element) | 635 inline bool isHTMLMediaElement(const HTMLElement& element) |
| 591 { | 636 { |
| 592 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 637 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
| 593 } | 638 } |
| 594 | 639 |
| 595 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 640 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
| 596 | 641 |
| 597 } // namespace blink | 642 } // namespace blink |
| 598 | 643 |
| 599 #endif // HTMLMediaElement_h | 644 #endif // HTMLMediaElement_h |
| OLD | NEW |