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

Side by Side Diff: third_party/WebKit/Source/modules/mediasource/MediaSource.cpp

Issue 2532233003: [Video] Add dummy video/audio tracks inactive to select them later. (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 return TimeRanges::create( 458 return TimeRanges::create(
459 0, buffered->end(buffered->length() - 1, ASSERT_NO_EXCEPTION)); 459 0, buffered->end(buffered->length() - 1, ASSERT_NO_EXCEPTION));
460 } 460 }
461 461
462 // 3. Otherwise: Return a single range with a start time of 0 and an end time 462 // 3. Otherwise: Return a single range with a start time of 0 and an end time
463 // equal to duration. 463 // equal to duration.
464 return TimeRanges::create(0, sourceDuration); 464 return TimeRanges::create(0, sourceDuration);
465 } 465 }
466 466
467 void MediaSource::onTrackChanged(TrackBase* track) { 467 void MediaSource::onTrackChanged(TrackBase* track) {
468 DCHECK(RuntimeEnabledFeatures::audioVideoTracksEnabled()); 468 DCHECK(RuntimeEnabledFeatures::audioVideoTracksEnabled() ||
469 RuntimeEnabledFeatures::backgroundVideoTrackOptimizationEnabled());
469 SourceBuffer* sourceBuffer = 470 SourceBuffer* sourceBuffer =
470 SourceBufferTrackBaseSupplement::sourceBuffer(*track); 471 SourceBufferTrackBaseSupplement::sourceBuffer(*track);
471 if (!sourceBuffer) 472 if (!sourceBuffer)
472 return; 473 return;
473 474
474 DCHECK(m_sourceBuffers->contains(sourceBuffer)); 475 DCHECK(m_sourceBuffers->contains(sourceBuffer));
475 if (track->type() == WebMediaPlayer::AudioTrack) { 476 if (track->type() == WebMediaPlayer::AudioTrack) {
476 sourceBuffer->audioTracks().scheduleChangeEvent(); 477 sourceBuffer->audioTracks().scheduleChangeEvent();
477 } else if (track->type() == WebMediaPlayer::VideoTrack) { 478 } else if (track->type() == WebMediaPlayer::VideoTrack) {
478 if (static_cast<VideoTrack*>(track)->selected()) 479 if (static_cast<VideoTrack*>(track)->selected())
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 event->setTarget(this); 816 event->setTarget(this);
816 817
817 m_asyncEventQueue->enqueueEvent(event); 818 m_asyncEventQueue->enqueueEvent(event);
818 } 819 }
819 820
820 URLRegistry& MediaSource::registry() const { 821 URLRegistry& MediaSource::registry() const {
821 return MediaSourceRegistry::registry(); 822 return MediaSourceRegistry::registry();
822 } 823 }
823 824
824 } // namespace blink 825 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698