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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #endif | 52 #endif |
53 class AudioTrackList; | 53 class AudioTrackList; |
54 class ContentType; | 54 class ContentType; |
55 class Event; | 55 class Event; |
56 class ExceptionState; | 56 class ExceptionState; |
57 class HTMLSourceElement; | 57 class HTMLSourceElement; |
58 class HTMLTrackElement; | 58 class HTMLTrackElement; |
59 class KURL; | 59 class KURL; |
60 class MediaController; | 60 class MediaController; |
61 class MediaControls; | 61 class MediaControls; |
| 62 class MediaProvider; |
62 class MediaError; | 63 class MediaError; |
63 class HTMLMediaSource; | 64 class HTMLMediaSource; |
64 class TextTrackList; | 65 class TextTrackList; |
65 class TimeRanges; | 66 class TimeRanges; |
66 class URLRegistry; | 67 class URLRegistry; |
67 class VideoTrackList; | 68 class VideoTrackList; |
68 | 69 |
69 typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree; | 70 typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree; |
70 typedef CueIntervalTree::IntervalType CueInterval; | 71 typedef CueIntervalTree::IntervalType CueInterval; |
71 typedef Vector<CueInterval> CueList; | 72 typedef Vector<CueInterval> CueList; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 }; | 105 }; |
105 void scheduleDelayedAction(DelayedActionType); | 106 void scheduleDelayedAction(DelayedActionType); |
106 | 107 |
107 bool isActive() const { return m_active; } | 108 bool isActive() const { return m_active; } |
108 | 109 |
109 // error state | 110 // error state |
110 PassRefPtrWillBeRawPtr<MediaError> error() const; | 111 PassRefPtrWillBeRawPtr<MediaError> error() const; |
111 | 112 |
112 // network state | 113 // network state |
113 void setSrc(const AtomicString&); | 114 void setSrc(const AtomicString&); |
| 115 MediaProvider* srcObject() const; |
| 116 void setSrcObject(MediaProvider*); |
114 const KURL& currentSrc() const { return m_currentSrc; } | 117 const KURL& currentSrc() const { return m_currentSrc; } |
115 | 118 |
116 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO
_SOURCE }; | 119 enum NetworkState { NETWORK_EMPTY, NETWORK_IDLE, NETWORK_LOADING, NETWORK_NO
_SOURCE }; |
117 NetworkState networkState() const; | 120 NetworkState networkState() const; |
118 | 121 |
119 String preload() const; | 122 String preload() const; |
120 void setPreload(const AtomicString&); | 123 void setPreload(const AtomicString&); |
121 | 124 |
122 PassRefPtrWillBeRawPtr<TimeRanges> buffered() const; | 125 PassRefPtrWillBeRawPtr<TimeRanges> buffered() const; |
123 void load(); | 126 void load(); |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 void checkIfSeekNeeded(); | 380 void checkIfSeekNeeded(); |
378 void addPlayedRange(double start, double end); | 381 void addPlayedRange(double start, double end); |
379 | 382 |
380 void scheduleTimeupdateEvent(bool periodicEvent); | 383 void scheduleTimeupdateEvent(bool periodicEvent); |
381 void scheduleEvent(const AtomicString& eventName); // FIXME: Rename to sched
uleNamedEvent for clarity. | 384 void scheduleEvent(const AtomicString& eventName); // FIXME: Rename to sched
uleNamedEvent for clarity. |
382 | 385 |
383 // loading | 386 // loading |
384 void prepareForLoad(); | 387 void prepareForLoad(); |
385 void loadInternal(); | 388 void loadInternal(); |
386 void selectMediaResource(); | 389 void selectMediaResource(); |
| 390 void loadResource(const KURL&); |
387 void loadResource(const KURL&, ContentType&, const String& keySystem); | 391 void loadResource(const KURL&, ContentType&, const String& keySystem); |
388 void startPlayerLoad(); | 392 void startPlayerLoad(); |
389 void setPlayerPreload(); | 393 void setPlayerPreload(); |
390 blink::WebMediaPlayer::LoadType loadType() const; | 394 blink::WebMediaPlayer::LoadType loadType() const; |
391 void scheduleNextSourceChild(); | 395 void scheduleNextSourceChild(); |
| 396 void loadFromObject(); |
| 397 void loadFromAttribute(); |
392 void loadNextSourceChild(); | 398 void loadNextSourceChild(); |
393 void userCancelledLoad(); | 399 void userCancelledLoad(); |
394 void clearMediaPlayer(int flags); | 400 void clearMediaPlayer(int flags); |
395 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); | 401 void clearMediaPlayerAndAudioSourceProviderClientWithoutLocking(); |
396 bool havePotentialSourceChild(); | 402 bool havePotentialSourceChild(); |
397 void noneSupported(); | 403 void noneSupported(); |
398 void mediaEngineError(PassRefPtrWillBeRawPtr<MediaError>); | 404 void mediaEngineError(PassRefPtrWillBeRawPtr<MediaError>); |
399 void cancelPendingEventsAndCallbacks(); | 405 void cancelPendingEventsAndCallbacks(); |
400 void waitForSourceChange(); | 406 void waitForSourceChange(); |
401 void prepareToPlay(); | 407 void prepareToPlay(); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
499 // Cached duration to suppress duplicate events if duration unchanged. | 505 // Cached duration to suppress duplicate events if duration unchanged. |
500 double m_duration; | 506 double m_duration; |
501 | 507 |
502 // The last time a timeupdate event was sent (wall clock). | 508 // The last time a timeupdate event was sent (wall clock). |
503 double m_lastTimeUpdateEventWallTime; | 509 double m_lastTimeUpdateEventWallTime; |
504 | 510 |
505 // The default playback start position. | 511 // The default playback start position. |
506 double m_defaultPlaybackStartPosition; | 512 double m_defaultPlaybackStartPosition; |
507 | 513 |
508 // Loading state. | 514 // Loading state. |
509 enum LoadState { WaitingForSource, LoadingFromSrcAttr, LoadingFromSourceElem
ent }; | 515 enum LoadState { WaitingForSource, LoadingFromSrcObject, LoadingFromSrcAttr,
LoadingFromSourceElement }; |
510 LoadState m_loadState; | 516 LoadState m_loadState; |
| 517 RawPtrWillBeMember<MediaProvider> m_srcObject; |
511 RefPtrWillBeMember<HTMLSourceElement> m_currentSourceNode; | 518 RefPtrWillBeMember<HTMLSourceElement> m_currentSourceNode; |
512 RefPtrWillBeMember<Node> m_nextChildNodeToConsider; | 519 RefPtrWillBeMember<Node> m_nextChildNodeToConsider; |
513 | 520 |
514 // "Deferred loading" state (for preload=none). | 521 // "Deferred loading" state (for preload=none). |
515 enum DeferredLoadState { | 522 enum DeferredLoadState { |
516 // The load is not deferred. | 523 // The load is not deferred. |
517 NotDeferred, | 524 NotDeferred, |
518 // The load is deferred, and waiting for the task to set the | 525 // The load is deferred, and waiting for the task to set the |
519 // delaying-the-load-event flag (to false). | 526 // delaying-the-load-event flag (to false). |
520 WaitingForStopDelayingLoadEventTask, | 527 WaitingForStopDelayingLoadEventTask, |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 inline bool isHTMLMediaElement(const HTMLElement& element) | 635 inline bool isHTMLMediaElement(const HTMLElement& element) |
629 { | 636 { |
630 return isHTMLAudioElement(element) || isHTMLVideoElement(element); | 637 return isHTMLAudioElement(element) || isHTMLVideoElement(element); |
631 } | 638 } |
632 | 639 |
633 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 640 DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
634 | 641 |
635 } // namespace blink | 642 } // namespace blink |
636 | 643 |
637 #endif // HTMLMediaElement_h | 644 #endif // HTMLMediaElement_h |
OLD | NEW |