| 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 20 matching lines...) Expand all Loading... |
| 31 #include "core/CoreExport.h" | 31 #include "core/CoreExport.h" |
| 32 #include "core/dom/ActiveDOMObject.h" | 32 #include "core/dom/ActiveDOMObject.h" |
| 33 #include "core/dom/ExceptionCode.h" | 33 #include "core/dom/ExceptionCode.h" |
| 34 #include "core/events/GenericEventQueue.h" | 34 #include "core/events/GenericEventQueue.h" |
| 35 #include "core/html/AutoplayExperimentHelper.h" | 35 #include "core/html/AutoplayExperimentHelper.h" |
| 36 #include "core/html/HTMLElement.h" | 36 #include "core/html/HTMLElement.h" |
| 37 #include "core/html/track/TextTrack.h" | 37 #include "core/html/track/TextTrack.h" |
| 38 #include "platform/Supplementable.h" | 38 #include "platform/Supplementable.h" |
| 39 #include "platform/audio/AudioSourceProvider.h" | 39 #include "platform/audio/AudioSourceProvider.h" |
| 40 #include "public/platform/WebAudioSourceProviderClient.h" | 40 #include "public/platform/WebAudioSourceProviderClient.h" |
| 41 #include "public/platform/WebMediaElementSource.h" |
| 41 #include "public/platform/WebMediaPlayerClient.h" | 42 #include "public/platform/WebMediaPlayerClient.h" |
| 42 #include "public/platform/WebMimeRegistry.h" | 43 #include "public/platform/WebMimeRegistry.h" |
| 43 | 44 |
| 44 namespace blink { | 45 namespace blink { |
| 45 | 46 |
| 46 class AudioSourceProviderClient; | 47 class AudioSourceProviderClient; |
| 47 class AudioTrackList; | 48 class AudioTrackList; |
| 48 class ContentType; | 49 class ContentType; |
| 49 class CueTimeline; | 50 class CueTimeline; |
| 50 class Event; | 51 class Event; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 | 104 |
| 104 bool hasRemoteRoutes() const { return m_remoteRoutesAvailable; } | 105 bool hasRemoteRoutes() const { return m_remoteRoutesAvailable; } |
| 105 bool isPlayingRemotely() const { return m_playingRemotely; } | 106 bool isPlayingRemotely() const { return m_playingRemotely; } |
| 106 | 107 |
| 107 // error state | 108 // error state |
| 108 MediaError* error() const; | 109 MediaError* error() const; |
| 109 | 110 |
| 110 // network state | 111 // network state |
| 111 void setSrc(const AtomicString&); | 112 void setSrc(const AtomicString&); |
| 112 const KURL& currentSrc() const { return m_currentSrc; } | 113 const KURL& currentSrc() const { return m_currentSrc; } |
| 114 void setSrcObject(const WebMediaElementSource&); |
| 115 const WebMediaElementSource& getSrcObject() const { return m_source; } |
| 113 | 116 |
| 114 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO
_SOURCE }; | 117 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO
_SOURCE }; |
| 115 NetworkState getNetworkState() const; | 118 NetworkState getNetworkState() const; |
| 116 | 119 |
| 117 String preload() const; | 120 String preload() const; |
| 118 void setPreload(const AtomicString&); | 121 void setPreload(const AtomicString&); |
| 119 WebMediaPlayer::Preload preloadType() const; | 122 WebMediaPlayer::Preload preloadType() const; |
| 120 String effectivePreload() const; | 123 String effectivePreload() const; |
| 121 WebMediaPlayer::Preload effectivePreloadType() const; | 124 WebMediaPlayer::Preload effectivePreloadType() const; |
| 122 | 125 |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 void checkIfSeekNeeded(); | 351 void checkIfSeekNeeded(); |
| 349 void addPlayedRange(double start, double end); | 352 void addPlayedRange(double start, double end); |
| 350 | 353 |
| 351 void scheduleEvent(const AtomicString& eventName); // FIXME: Rename to sched
uleNamedEvent for clarity. | 354 void scheduleEvent(const AtomicString& eventName); // FIXME: Rename to sched
uleNamedEvent for clarity. |
| 352 | 355 |
| 353 // loading | 356 // loading |
| 354 void invokeLoadAlgorithm(); | 357 void invokeLoadAlgorithm(); |
| 355 void invokeResourceSelectionAlgorithm(); | 358 void invokeResourceSelectionAlgorithm(); |
| 356 void loadInternal(); | 359 void loadInternal(); |
| 357 void selectMediaResource(); | 360 void selectMediaResource(); |
| 358 void loadResource(const KURL&, ContentType&); | 361 void loadResource(ContentType&); |
| 359 void startPlayerLoad(); | 362 void startPlayerLoad(); |
| 360 void setPlayerPreload(); | 363 void setPlayerPreload(); |
| 361 WebMediaPlayer::LoadType loadType() const; | 364 WebMediaPlayer::LoadType loadType() const; |
| 362 void scheduleNextSourceChild(); | 365 void scheduleNextSourceChild(); |
| 366 void loadSourceFromObject(); |
| 367 void loadSourceFromAttribute(); |
| 363 void loadNextSourceChild(); | 368 void loadNextSourceChild(); |
| 364 void clearMediaPlayer(); | 369 void clearMediaPlayer(); |
| 365 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); | 370 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); |
| 366 bool havePotentialSourceChild(); | 371 bool havePotentialSourceChild(); |
| 367 void noneSupported(); | 372 void noneSupported(); |
| 368 void mediaEngineError(MediaError*); | 373 void mediaEngineError(MediaError*); |
| 369 void cancelPendingEventsAndCallbacks(); | 374 void cancelPendingEventsAndCallbacks(); |
| 370 void waitForSourceChange(); | 375 void waitForSourceChange(); |
| 371 void setIgnorePreloadNone(); | 376 void setIgnorePreloadNone(); |
| 372 | 377 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer; | 481 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer; |
| 477 PersistentWillBeMember<TimeRanges> m_playedTimeRanges; | 482 PersistentWillBeMember<TimeRanges> m_playedTimeRanges; |
| 478 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; | 483 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; |
| 479 | 484 |
| 480 double m_playbackRate; | 485 double m_playbackRate; |
| 481 double m_defaultPlaybackRate; | 486 double m_defaultPlaybackRate; |
| 482 NetworkState m_networkState; | 487 NetworkState m_networkState; |
| 483 ReadyState m_readyState; | 488 ReadyState m_readyState; |
| 484 ReadyState m_readyStateMaximum; | 489 ReadyState m_readyStateMaximum; |
| 485 KURL m_currentSrc; | 490 KURL m_currentSrc; |
| 491 WebMediaElementSource m_source; |
| 486 | 492 |
| 487 PersistentWillBeMember<MediaError> m_error; | 493 PersistentWillBeMember<MediaError> m_error; |
| 488 | 494 |
| 489 double m_volume; | 495 double m_volume; |
| 490 double m_lastSeekTime; | 496 double m_lastSeekTime; |
| 491 | 497 |
| 492 double m_previousProgressTime; | 498 double m_previousProgressTime; |
| 493 | 499 |
| 494 // Cached duration to suppress duplicate events if duration unchanged. | 500 // Cached duration to suppress duplicate events if duration unchanged. |
| 495 double m_duration; | 501 double m_duration; |
| 496 | 502 |
| 497 // The last time a timeupdate event was sent (wall clock). | 503 // The last time a timeupdate event was sent (wall clock). |
| 498 double m_lastTimeUpdateEventWallTime; | 504 double m_lastTimeUpdateEventWallTime; |
| 499 | 505 |
| 500 // The last time a timeupdate event was sent in movie time. | 506 // The last time a timeupdate event was sent in movie time. |
| 501 double m_lastTimeUpdateEventMovieTime; | 507 double m_lastTimeUpdateEventMovieTime; |
| 502 | 508 |
| 503 // The default playback start position. | 509 // The default playback start position. |
| 504 double m_defaultPlaybackStartPosition; | 510 double m_defaultPlaybackStartPosition; |
| 505 | 511 |
| 506 // Loading state. | 512 // Loading state. |
| 507 enum LoadState { WaitingForSource, LoadingFromSrcAttr, LoadingFromSourceElem
ent }; | 513 enum LoadState { WaitingForSource, LoadingFromSrcObject, LoadingFromSrcAttr,
LoadingFromSourceElement }; |
| 508 LoadState m_loadState; | 514 LoadState m_loadState; |
| 509 RefPtrWillBeMember<HTMLSourceElement> m_currentSourceNode; | 515 RefPtrWillBeMember<HTMLSourceElement> m_currentSourceNode; |
| 510 RefPtrWillBeMember<Node> m_nextChildNodeToConsider; | 516 RefPtrWillBeMember<Node> m_nextChildNodeToConsider; |
| 511 | 517 |
| 512 // "Deferred loading" state (for preload=none). | 518 // "Deferred loading" state (for preload=none). |
| 513 enum DeferredLoadState { | 519 enum DeferredLoadState { |
| 514 // The load is not deferred. | 520 // The load is not deferred. |
| 515 NotDeferred, | 521 NotDeferred, |
| 516 // The load is deferred, and waiting for the task to set the | 522 // The load is deferred, and waiting for the task to set the |
| 517 // delaying-the-load-event flag (to false). | 523 // delaying-the-load-event flag (to false). |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 inline bool isHTMLMediaElement(const HTMLElement& element) | 657 inline bool isHTMLMediaElement(const HTMLElement& element) |
| 652 { | 658 { |
| 653 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 659 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
| 654 } | 660 } |
| 655 | 661 |
| 656 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 662 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
| 657 | 663 |
| 658 } // namespace blink | 664 } // namespace blink |
| 659 | 665 |
| 660 #endif // HTMLMediaElement_h | 666 #endif // HTMLMediaElement_h |
| OLD | NEW |