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

Unified Diff: third_party/WebKit/Source/modules/mediasource/MediaSource.cpp

Issue 2263823002: Deliver change notifications to SourceBuffer track lists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed video-track-selected test Created 4 years, 4 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: third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
diff --git a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
index e48dfd717a1b6cc1e55bdec28fe04bee0488aa5b..71124d30caacff479d47b42f0f297a129b9f6946 100644
--- a/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
+++ b/third_party/WebKit/Source/modules/mediasource/MediaSource.cpp
@@ -39,7 +39,10 @@
#include "core/frame/Deprecation.h"
#include "core/frame/UseCounter.h"
#include "core/html/HTMLMediaElement.h"
+#include "core/html/track/AudioTrackList.h"
+#include "core/html/track/VideoTrackList.h"
#include "modules/mediasource/MediaSourceRegistry.h"
+#include "modules/mediasource/SourceBufferTrackBaseSupplement.h"
#include "platform/ContentType.h"
#include "platform/MIMETypeRegistry.h"
#include "platform/RuntimeEnabledFeatures.h"
@@ -416,6 +419,18 @@ TimeRanges* MediaSource::seekable() const
return TimeRanges::create(0, sourceDuration);
}
+void MediaSource::onTrackChanged(TrackBase* track)
+{
+ SourceBuffer* sourceBuffer = SourceBufferTrackBaseSupplement::sourceBuffer(*track);
+ if (sourceBuffer) {
+ if (track->type() == WebMediaPlayer::AudioTrack) {
+ sourceBuffer->audioTracks().scheduleChangeEvent();
+ } else if (track->type() == WebMediaPlayer::VideoTrack) {
+ sourceBuffer->videoTracks().scheduleChangeEvent();
+ }
+ }
+}
+
void MediaSource::setDuration(double duration, ExceptionState& exceptionState)
{
// 2.1 http://www.w3.org/TR/media-source/#widl-MediaSource-duration

Powered by Google App Engine
This is Rietveld 408576698