| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 class WebInbandTextTrack; | 42 class WebInbandTextTrack; |
| 43 class WebLayer; | 43 class WebLayer; |
| 44 } | 44 } |
| 45 | 45 |
| 46 namespace WebCore { | 46 namespace WebCore { |
| 47 | 47 |
| 48 #if ENABLE(WEB_AUDIO) | 48 #if ENABLE(WEB_AUDIO) |
| 49 class AudioSourceProvider; | 49 class AudioSourceProvider; |
| 50 class MediaElementAudioSourceNode; | 50 class MediaElementAudioSourceNode; |
| 51 #endif | 51 #endif |
| 52 class AudioTrackList; |
| 52 class ContentType; | 53 class ContentType; |
| 53 class Event; | 54 class Event; |
| 54 class ExceptionState; | 55 class ExceptionState; |
| 55 class HTMLSourceElement; | 56 class HTMLSourceElement; |
| 56 class HTMLTrackElement; | 57 class HTMLTrackElement; |
| 57 class KURL; | 58 class KURL; |
| 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 TextTrackList; | 63 class TextTrackList; |
| 63 class TimeRanges; | 64 class TimeRanges; |
| 64 class URLRegistry; | 65 class URLRegistry; |
| 66 class VideoTrackList; |
| 65 | 67 |
| 66 typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree; | 68 typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree; |
| 67 typedef CueIntervalTree::IntervalType CueInterval; | 69 typedef CueIntervalTree::IntervalType CueInterval; |
| 68 typedef Vector<CueInterval> CueList; | 70 typedef Vector<CueInterval> CueList; |
| 69 | 71 |
| 70 // FIXME: The inheritance from MediaPlayerClient here should be private inherita
nce. | 72 // FIXME: The inheritance from MediaPlayerClient here should be private inherita
nce. |
| 71 // But it can't be until the Chromium WebMediaPlayerClientImpl class is fixed so
it | 73 // But it can't be until the Chromium WebMediaPlayerClientImpl class is fixed so
it |
| 72 // no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement. | 74 // no longer depends on typecasting a MediaPlayerClient to an HTMLMediaElement. |
| 73 | 75 |
| 74 class HTMLMediaElement : public Supplementable<HTMLMediaElement>, public HTMLEle
ment, public MediaPlayerClient, public ActiveDOMObject, public MediaControllerIn
terface | 76 class HTMLMediaElement : public Supplementable<HTMLMediaElement>, public HTMLEle
ment, public MediaPlayerClient, public ActiveDOMObject, public MediaControllerIn
terface |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 virtual double volume() const OVERRIDE FINAL; | 158 virtual double volume() const OVERRIDE FINAL; |
| 157 virtual void setVolume(double, ExceptionState&) OVERRIDE FINAL; | 159 virtual void setVolume(double, ExceptionState&) OVERRIDE FINAL; |
| 158 virtual bool muted() const OVERRIDE FINAL; | 160 virtual bool muted() const OVERRIDE FINAL; |
| 159 virtual void setMuted(bool) OVERRIDE FINAL; | 161 virtual void setMuted(bool) OVERRIDE FINAL; |
| 160 | 162 |
| 161 virtual void beginScrubbing() OVERRIDE FINAL; | 163 virtual void beginScrubbing() OVERRIDE FINAL; |
| 162 virtual void endScrubbing() OVERRIDE FINAL; | 164 virtual void endScrubbing() OVERRIDE FINAL; |
| 163 | 165 |
| 164 virtual bool canPlay() const OVERRIDE FINAL; | 166 virtual bool canPlay() const OVERRIDE FINAL; |
| 165 | 167 |
| 168 AudioTrackList* audioTracks(); |
| 169 void audioTrackChanged(const AtomicString& audioTrackID, bool enabled); |
| 170 |
| 171 VideoTrackList* videoTracks(); |
| 172 void selectedVideoTrackChanged(const AtomicString& selectedTrackID); |
| 173 |
| 166 PassRefPtr<TextTrack> addTextTrack(const AtomicString& kind, const AtomicStr
ing& label, const AtomicString& language, ExceptionState&); | 174 PassRefPtr<TextTrack> addTextTrack(const AtomicString& kind, const AtomicStr
ing& label, const AtomicString& language, ExceptionState&); |
| 167 PassRefPtr<TextTrack> addTextTrack(const AtomicString& kind, const AtomicStr
ing& label, ExceptionState& exceptionState) { return addTextTrack(kind, label, e
mptyAtom, exceptionState); } | 175 PassRefPtr<TextTrack> addTextTrack(const AtomicString& kind, const AtomicStr
ing& label, ExceptionState& exceptionState) { return addTextTrack(kind, label, e
mptyAtom, exceptionState); } |
| 168 PassRefPtr<TextTrack> addTextTrack(const AtomicString& kind, ExceptionState&
exceptionState) { return addTextTrack(kind, emptyAtom, emptyAtom, exceptionStat
e); } | 176 PassRefPtr<TextTrack> addTextTrack(const AtomicString& kind, ExceptionState&
exceptionState) { return addTextTrack(kind, emptyAtom, emptyAtom, exceptionStat
e); } |
| 169 | 177 |
| 170 TextTrackList* textTracks(); | 178 TextTrackList* textTracks(); |
| 171 CueList currentlyActiveCues() const { return m_currentlyActiveCues; } | 179 CueList currentlyActiveCues() const { return m_currentlyActiveCues; } |
| 172 | 180 |
| 173 void addTextTrack(TextTrack*); | 181 void addTextTrack(TextTrack*); |
| 174 void removeTextTrack(TextTrack*); | 182 void removeTextTrack(TextTrack*); |
| 175 void closeCaptionTracksChanged(); | 183 void closeCaptionTracksChanged(); |
| 176 void notifyMediaPlayerOfTextTrackChanges(); | 184 void notifyMediaPlayerOfTextTrackChanges(); |
| 177 | 185 |
| 178 // Implements the "forget the media element's media-resource-specific tracks
" algorithm in the HTML5 spec. | 186 // Implements the "forget the media element's media-resource-specific tracks
" algorithm in the HTML5 spec. |
| 179 void forgetResourceSpecificTracks(); | 187 void forgetResourceSpecificTracks(); |
| 180 | 188 |
| 181 void didAddTrackElement(HTMLTrackElement*); | 189 void didAddTrackElement(HTMLTrackElement*); |
| 182 void didRemoveTrackElement(HTMLTrackElement*); | 190 void didRemoveTrackElement(HTMLTrackElement*); |
| 183 | 191 |
| 192 void addVideoTrack(const AtomicString& id, blink::WebMediaPlayerClient::Vide
oTrackKind, const AtomicString& label, const AtomicString& language, bool select
ed); |
| 193 void removeVideoTrack(const AtomicString& id); |
| 194 void addAudioTrack(const AtomicString& id, blink::WebMediaPlayerClient::Audi
oTrackKind, const AtomicString& label, const AtomicString& language, bool enable
d); |
| 195 void removeAudioTrack(const AtomicString& id); |
| 196 |
| 184 virtual void mediaPlayerDidAddTextTrack(blink::WebInbandTextTrack*) OVERRIDE
FINAL; | 197 virtual void mediaPlayerDidAddTextTrack(blink::WebInbandTextTrack*) OVERRIDE
FINAL; |
| 185 virtual void mediaPlayerDidRemoveTextTrack(blink::WebInbandTextTrack*) OVERR
IDE FINAL; | 198 virtual void mediaPlayerDidRemoveTextTrack(blink::WebInbandTextTrack*) OVERR
IDE FINAL; |
| 186 // FIXME: Remove this when WebMediaPlayerClientImpl::loadInternal does not d
epend on it. | 199 // FIXME: Remove this when WebMediaPlayerClientImpl::loadInternal does not d
epend on it. |
| 187 virtual KURL mediaPlayerPosterURL() OVERRIDE { return KURL(); } | 200 virtual KURL mediaPlayerPosterURL() OVERRIDE { return KURL(); } |
| 188 | 201 |
| 189 struct TrackGroup { | 202 struct TrackGroup { |
| 190 enum GroupKind { CaptionsAndSubtitles, Description, Chapter, Metadata, O
ther }; | 203 enum GroupKind { CaptionsAndSubtitles, Description, Chapter, Metadata, O
ther }; |
| 191 | 204 |
| 192 TrackGroup(GroupKind kind) | 205 TrackGroup(GroupKind kind) |
| 193 : visibleTrack(nullptr) | 206 : visibleTrack(nullptr) |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 | 419 |
| 407 void changeNetworkStateFromLoadingToIdle(); | 420 void changeNetworkStateFromLoadingToIdle(); |
| 408 | 421 |
| 409 const AtomicString& mediaGroup() const; | 422 const AtomicString& mediaGroup() const; |
| 410 void setMediaGroup(const AtomicString&); | 423 void setMediaGroup(const AtomicString&); |
| 411 void updateMediaController(); | 424 void updateMediaController(); |
| 412 bool isBlocked() const; | 425 bool isBlocked() const; |
| 413 bool isBlockedOnMediaController() const; | 426 bool isBlockedOnMediaController() const; |
| 414 bool isAutoplaying() const { return m_autoplaying; } | 427 bool isAutoplaying() const { return m_autoplaying; } |
| 415 | 428 |
| 429 // Creates placeholder AudioTrack and/or VideoTrack objects when WebMemediaP
layer objects |
| 430 // advertise they have audio and/or video, but don't explicity signal them v
ia |
| 431 // mediaPlayerDidAddAudioTrack() and mediaPlayerDidAddVideoTrack(). |
| 432 // FIXME: Remove this once all WebMediaPlayer implementations properly repor
t their track info. |
| 433 void createPlaceholderTracksIfNecessary(); |
| 434 |
| 435 // Sets the selected/enabled tracks if they aren't set before we initially |
| 436 // transition to HAVE_METADATA. |
| 437 void selectInitialTracksIfNecessary(); |
| 438 |
| 416 Timer<HTMLMediaElement> m_loadTimer; | 439 Timer<HTMLMediaElement> m_loadTimer; |
| 417 Timer<HTMLMediaElement> m_progressEventTimer; | 440 Timer<HTMLMediaElement> m_progressEventTimer; |
| 418 Timer<HTMLMediaElement> m_playbackProgressTimer; | 441 Timer<HTMLMediaElement> m_playbackProgressTimer; |
| 419 RefPtr<TimeRanges> m_playedTimeRanges; | 442 RefPtr<TimeRanges> m_playedTimeRanges; |
| 420 OwnPtr<GenericEventQueue> m_asyncEventQueue; | 443 OwnPtr<GenericEventQueue> m_asyncEventQueue; |
| 421 | 444 |
| 422 double m_playbackRate; | 445 double m_playbackRate; |
| 423 double m_defaultPlaybackRate; | 446 double m_defaultPlaybackRate; |
| 424 NetworkState m_networkState; | 447 NetworkState m_networkState; |
| 425 ReadyState m_readyState; | 448 ReadyState m_readyState; |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 bool m_closedCaptionsVisible : 1; | 513 bool m_closedCaptionsVisible : 1; |
| 491 | 514 |
| 492 bool m_completelyLoaded : 1; | 515 bool m_completelyLoaded : 1; |
| 493 bool m_havePreparedToPlay : 1; | 516 bool m_havePreparedToPlay : 1; |
| 494 | 517 |
| 495 bool m_tracksAreReady : 1; | 518 bool m_tracksAreReady : 1; |
| 496 bool m_haveVisibleTextTrack : 1; | 519 bool m_haveVisibleTextTrack : 1; |
| 497 bool m_processingPreferenceChange : 1; | 520 bool m_processingPreferenceChange : 1; |
| 498 double m_lastTextTrackUpdateTime; | 521 double m_lastTextTrackUpdateTime; |
| 499 | 522 |
| 523 RefPtr<AudioTrackList> m_audioTracks; |
| 524 RefPtr<VideoTrackList> m_videoTracks; |
| 500 RefPtr<TextTrackList> m_textTracks; | 525 RefPtr<TextTrackList> m_textTracks; |
| 501 Vector<RefPtr<TextTrack> > m_textTracksWhenResourceSelectionBegan; | 526 Vector<RefPtr<TextTrack> > m_textTracksWhenResourceSelectionBegan; |
| 502 | 527 |
| 503 CueIntervalTree m_cueTree; | 528 CueIntervalTree m_cueTree; |
| 504 | 529 |
| 505 CueList m_currentlyActiveCues; | 530 CueList m_currentlyActiveCues; |
| 506 int m_ignoreTrackDisplayUpdate; | 531 int m_ignoreTrackDisplayUpdate; |
| 507 | 532 |
| 508 #if ENABLE(WEB_AUDIO) | 533 #if ENABLE(WEB_AUDIO) |
| 509 // This is a weak reference, since m_audioSourceNode holds a reference to us
. | 534 // This is a weak reference, since m_audioSourceNode holds a reference to us
. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 inline bool isHTMLMediaElement(const Node& node) | 567 inline bool isHTMLMediaElement(const Node& node) |
| 543 { | 568 { |
| 544 return node.isElementNode() && toElement(node).isMediaElement(); | 569 return node.isElementNode() && toElement(node).isMediaElement(); |
| 545 } | 570 } |
| 546 | 571 |
| 547 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); | 572 DEFINE_NODE_TYPE_CASTS_WITH_FUNCTION(HTMLMediaElement); |
| 548 | 573 |
| 549 } //namespace | 574 } //namespace |
| 550 | 575 |
| 551 #endif | 576 #endif |
| OLD | NEW |