Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Unified Diff: Source/core/html/HTMLMediaElement.h

Issue 170233009: Initial implementation of AudioTrack, AudioTrackList, VideoTrack, and VideoTrackList. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@blink-master
Patch Set: Addressed IDL comments. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/html/HTMLMediaElement.h
diff --git a/Source/core/html/HTMLMediaElement.h b/Source/core/html/HTMLMediaElement.h
index 774308fab390b5468fe3d0816d30e96d9a606a4f..bf666077528158fc1af65b6a9a6db03f3f7ae034 100644
--- a/Source/core/html/HTMLMediaElement.h
+++ b/Source/core/html/HTMLMediaElement.h
@@ -49,6 +49,7 @@ namespace WebCore {
class AudioSourceProvider;
class MediaElementAudioSourceNode;
#endif
+class AudioTrackList;
class ContentType;
class Event;
class ExceptionState;
@@ -62,6 +63,7 @@ class HTMLMediaSource;
class TextTrackList;
class TimeRanges;
class URLRegistry;
+class VideoTrackList;
typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree;
typedef CueIntervalTree::IntervalType CueInterval;
@@ -159,8 +161,15 @@ public:
virtual bool canPlay() const OVERRIDE FINAL;
+
void togglePlayState();
+ AudioTrackList& audioTracks();
+ void audioTrackChanged(const String& audioTrackID);
+
+ VideoTrackList& videoTracks();
+ void selectedVideoTrackChanged(const String& selectedTrackID);
+
PassRefPtr<TextTrack> addTextTrack(const AtomicString& kind, const AtomicString& label, const AtomicString& language, ExceptionState&);
PassRefPtr<TextTrack> addTextTrack(const AtomicString& kind, const AtomicString& label, ExceptionState& exceptionState) { return addTextTrack(kind, label, emptyAtom, exceptionState); }
PassRefPtr<TextTrack> addTextTrack(const AtomicString& kind, ExceptionState& exceptionState) { return addTextTrack(kind, emptyAtom, emptyAtom, exceptionState); }
@@ -179,6 +188,11 @@ public:
void didAddTrackElement(HTMLTrackElement*);
void didRemoveTrackElement(HTMLTrackElement*);
+ void addVideoTrack(const String& id, blink::WebMediaPlayerClient::VideoTrackKind, const AtomicString& label, const AtomicString& language, bool selected);
+ void removeVideoTrack(const String& id);
+ void addAudioTrack(const String& id, blink::WebMediaPlayerClient::AudioTrackKind, const AtomicString& label, const AtomicString& language, bool enabled);
+ void removeAudioTrack(const String& id);
+
virtual void mediaPlayerDidAddTextTrack(blink::WebInbandTextTrack*) OVERRIDE FINAL;
virtual void mediaPlayerDidRemoveTextTrack(blink::WebInbandTextTrack*) OVERRIDE FINAL;
// FIXME: Remove this when WebMediaPlayerClientImpl::loadInternal does not depend on it.
@@ -417,9 +431,22 @@ private:
blink::WebMediaPlayer::CORSMode corsMode() const;
+ // Creates placeholder AudioTrack and/or VideoTrack objects when WebMemediaPlayer objects
+ // advertise they have audio and/or video, but don't explicity signal them via
+ // mediaPlayerDidAddAudioTrack() and mediaPlayerDidAddVideoTrack().
+ // FIXME: Remove this once all WebMediaPlayer implementations properly report their track info.
+ void createPlaceholderTracksIfNecessary();
+
+ // Sets the selected/enabled tracks if they aren't set before we initially
+ // transition to HAVE_METADATA.
+ void selectInitialTracksIfNecessary();
+
+ void audioTracksTimerFired(Timer<HTMLMediaElement>*);
+
Timer<HTMLMediaElement> m_loadTimer;
Timer<HTMLMediaElement> m_progressEventTimer;
Timer<HTMLMediaElement> m_playbackProgressTimer;
+ Timer<HTMLMediaElement> m_audioTracksTimer;
RefPtr<TimeRanges> m_playedTimeRanges;
OwnPtr<GenericEventQueue> m_asyncEventQueue;
@@ -502,6 +529,8 @@ private:
bool m_processingPreferenceChange : 1;
double m_lastTextTrackUpdateTime;
+ RefPtr<AudioTrackList> m_audioTracks;
+ RefPtr<VideoTrackList> m_videoTracks;
RefPtr<TextTrackList> m_textTracks;
Vector<RefPtr<TextTrack> > m_textTracksWhenResourceSelectionBegan;

Powered by Google App Engine
This is Rietveld 408576698