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&); | |
113 | 115 |
114 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO _SOURCE }; | 116 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO _SOURCE }; |
115 NetworkState getNetworkState() const; | 117 NetworkState getNetworkState() const; |
116 | 118 |
117 String preload() const; | 119 String preload() const; |
118 void setPreload(const AtomicString&); | 120 void setPreload(const AtomicString&); |
119 WebMediaPlayer::Preload preloadType() const; | 121 WebMediaPlayer::Preload preloadType() const; |
120 String effectivePreload() const; | 122 String effectivePreload() const; |
121 WebMediaPlayer::Preload effectivePreloadType() const; | 123 WebMediaPlayer::Preload effectivePreloadType() const; |
122 | 124 |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
348 void checkIfSeekNeeded(); | 350 void checkIfSeekNeeded(); |
349 void addPlayedRange(double start, double end); | 351 void addPlayedRange(double start, double end); |
350 | 352 |
351 void scheduleEvent(const AtomicString& eventName); // FIXME: Rename to sched uleNamedEvent for clarity. | 353 void scheduleEvent(const AtomicString& eventName); // FIXME: Rename to sched uleNamedEvent for clarity. |
352 | 354 |
353 // loading | 355 // loading |
354 void invokeLoadAlgorithm(); | 356 void invokeLoadAlgorithm(); |
355 void invokeResourceSelectionAlgorithm(); | 357 void invokeResourceSelectionAlgorithm(); |
356 void loadInternal(); | 358 void loadInternal(); |
357 void selectMediaResource(); | 359 void selectMediaResource(); |
358 void loadResource(const KURL&, ContentType&); | 360 void loadResource(ContentType&); |
philipj_slow
2016/03/29 13:43:19
Can loadResource still take the thing to load as a
Guido Urdaneta
2016/03/29 14:48:11
The thing to load is now stored in the m_source me
| |
359 void startPlayerLoad(); | 361 void startPlayerLoad(); |
360 void setPlayerPreload(); | 362 void setPlayerPreload(); |
361 WebMediaPlayer::LoadType loadType() const; | 363 WebMediaPlayer::LoadType loadType() const; |
362 void scheduleNextSourceChild(); | 364 void scheduleNextSourceChild(); |
365 void loadSourceFromObject(); | |
366 void loadSourceFromAttribute(); | |
363 void loadNextSourceChild(); | 367 void loadNextSourceChild(); |
364 void clearMediaPlayer(); | 368 void clearMediaPlayer(); |
365 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); | 369 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); |
366 bool havePotentialSourceChild(); | 370 bool havePotentialSourceChild(); |
367 void noneSupported(); | 371 void noneSupported(); |
368 void mediaEngineError(MediaError*); | 372 void mediaEngineError(MediaError*); |
369 void cancelPendingEventsAndCallbacks(); | 373 void cancelPendingEventsAndCallbacks(); |
370 void waitForSourceChange(); | 374 void waitForSourceChange(); |
371 void setIgnorePreloadNone(); | 375 void setIgnorePreloadNone(); |
372 | 376 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
476 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer; | 480 UnthrottledTimer<HTMLMediaElement> m_audioTracksTimer; |
477 PersistentWillBeMember<TimeRanges> m_playedTimeRanges; | 481 PersistentWillBeMember<TimeRanges> m_playedTimeRanges; |
478 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; | 482 OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue; |
479 | 483 |
480 double m_playbackRate; | 484 double m_playbackRate; |
481 double m_defaultPlaybackRate; | 485 double m_defaultPlaybackRate; |
482 NetworkState m_networkState; | 486 NetworkState m_networkState; |
483 ReadyState m_readyState; | 487 ReadyState m_readyState; |
484 ReadyState m_readyStateMaximum; | 488 ReadyState m_readyStateMaximum; |
485 KURL m_currentSrc; | 489 KURL m_currentSrc; |
490 WebMediaElementSource m_source; | |
486 | 491 |
487 PersistentWillBeMember<MediaError> m_error; | 492 PersistentWillBeMember<MediaError> m_error; |
488 | 493 |
489 double m_volume; | 494 double m_volume; |
490 double m_lastSeekTime; | 495 double m_lastSeekTime; |
491 | 496 |
492 double m_previousProgressTime; | 497 double m_previousProgressTime; |
493 | 498 |
494 // Cached duration to suppress duplicate events if duration unchanged. | 499 // Cached duration to suppress duplicate events if duration unchanged. |
495 double m_duration; | 500 double m_duration; |
496 | 501 |
497 // The last time a timeupdate event was sent (wall clock). | 502 // The last time a timeupdate event was sent (wall clock). |
498 double m_lastTimeUpdateEventWallTime; | 503 double m_lastTimeUpdateEventWallTime; |
499 | 504 |
500 // The last time a timeupdate event was sent in movie time. | 505 // The last time a timeupdate event was sent in movie time. |
501 double m_lastTimeUpdateEventMovieTime; | 506 double m_lastTimeUpdateEventMovieTime; |
502 | 507 |
503 // The default playback start position. | 508 // The default playback start position. |
504 double m_defaultPlaybackStartPosition; | 509 double m_defaultPlaybackStartPosition; |
505 | 510 |
506 // Loading state. | 511 // Loading state. |
507 enum LoadState { WaitingForSource, LoadingFromSrcAttr, LoadingFromSourceElem ent }; | 512 enum LoadState { WaitingForSource, LoadingFromSrcObject, LoadingFromSrcAttr, LoadingFromSourceElement }; |
508 LoadState m_loadState; | 513 LoadState m_loadState; |
509 RefPtrWillBeMember<HTMLSourceElement> m_currentSourceNode; | 514 RefPtrWillBeMember<HTMLSourceElement> m_currentSourceNode; |
510 RefPtrWillBeMember<Node> m_nextChildNodeToConsider; | 515 RefPtrWillBeMember<Node> m_nextChildNodeToConsider; |
511 | 516 |
512 // "Deferred loading" state (for preload=none). | 517 // "Deferred loading" state (for preload=none). |
513 enum DeferredLoadState { | 518 enum DeferredLoadState { |
514 // The load is not deferred. | 519 // The load is not deferred. |
515 NotDeferred, | 520 NotDeferred, |
516 // The load is deferred, and waiting for the task to set the | 521 // The load is deferred, and waiting for the task to set the |
517 // delaying-the-load-event flag (to false). | 522 // 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) | 656 inline bool isHTMLMediaElement(const HTMLElement& element) |
652 { | 657 { |
653 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 658 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
654 } | 659 } |
655 | 660 |
656 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 661 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
657 | 662 |
658 } // namespace blink | 663 } // namespace blink |
659 | 664 |
660 #endif // HTMLMediaElement_h | 665 #endif // HTMLMediaElement_h |
OLD | NEW |