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

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

Issue 284513003: Implement AudioTrack, AudioTrackList, VideoTrack, and VideoTrackList (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: nits Created 6 years, 6 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
« no previous file with comments | « Source/core/events/EventTargetFactory.in ('k') | Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLMediaElement.h
diff --git a/Source/core/html/HTMLMediaElement.h b/Source/core/html/HTMLMediaElement.h
index 4bf6af4bbeea39f58dfe218cdb20ce61a2db06a3..7586271c362522d3bb883ccdb14fd8a17a1ccb0c 100644
--- a/Source/core/html/HTMLMediaElement.h
+++ b/Source/core/html/HTMLMediaElement.h
@@ -34,6 +34,7 @@
#include "core/html/track/vtt/VTTCue.h"
#include "platform/PODIntervalTree.h"
#include "platform/graphics/media/MediaPlayer.h"
+#include "public/platform/WebMediaPlayerClient.h"
#include "public/platform/WebMimeRegistry.h"
namespace blink {
@@ -48,6 +49,7 @@ namespace WebCore {
class AudioSourceProvider;
class AudioSourceProviderClient;
#endif
+class AudioTrackList;
class ContentType;
class Event;
class ExceptionState;
@@ -61,6 +63,7 @@ class HTMLMediaSource;
class TextTrackList;
class TimeRanges;
class URLRegistry;
+class VideoTrackList;
typedef PODIntervalTree<double, TextTrackCue*> CueIntervalTree;
typedef CueIntervalTree::IntervalType CueInterval;
@@ -167,6 +170,12 @@ public:
bool togglePlayStateWillPlay() const;
void togglePlayState();
+ AudioTrackList& audioTracks();
+ void audioTrackChanged();
+
+ VideoTrackList& videoTracks();
+ void selectedVideoTrackChanged(blink::WebMediaPlayer::TrackId*);
+
PassRefPtrWillBeRawPtr<TextTrack> addTextTrack(const AtomicString& kind, const AtomicString& label, const AtomicString& language, ExceptionState&);
PassRefPtrWillBeRawPtr<TextTrack> addTextTrack(const AtomicString& kind, const AtomicString& label, ExceptionState& exceptionState) { return addTextTrack(kind, label, emptyAtom, exceptionState); }
PassRefPtrWillBeRawPtr<TextTrack> addTextTrack(const AtomicString& kind, ExceptionState& exceptionState) { return addTextTrack(kind, emptyAtom, emptyAtom, exceptionState); }
@@ -185,6 +194,11 @@ public:
void didAddTrackElement(HTMLTrackElement*);
void didRemoveTrackElement(HTMLTrackElement*);
+ blink::WebMediaPlayer::TrackId addAudioTrack(const String& id, blink::WebMediaPlayerClient::AudioTrackKind, const AtomicString& label, const AtomicString& language, bool enabled);
+ void removeAudioTrack(blink::WebMediaPlayer::TrackId);
+ blink::WebMediaPlayer::TrackId addVideoTrack(const String& id, blink::WebMediaPlayerClient::VideoTrackKind, const AtomicString& label, const AtomicString& language, bool selected);
+ void removeVideoTrack(blink::WebMediaPlayer::TrackId);
+
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.
@@ -426,9 +440,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 explicitly signal them via
+ // addAudioTrack() and addVideoTrack().
+ // 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;
OwnPtrWillBeMember<GenericEventQueue> m_asyncEventQueue;
@@ -513,6 +540,8 @@ private:
#endif
double m_lastTextTrackUpdateTime;
+ RefPtrWillBeMember<AudioTrackList> m_audioTracks;
+ RefPtrWillBeMember<VideoTrackList> m_videoTracks;
RefPtrWillBeMember<TextTrackList> m_textTracks;
WillBeHeapVector<RefPtrWillBeMember<TextTrack> > m_textTracksWhenResourceSelectionBegan;
« no previous file with comments | « Source/core/events/EventTargetFactory.in ('k') | Source/core/html/HTMLMediaElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698