| OLD | NEW |
| 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 Loading... |
| 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(HTMLMediaElement::mediaTracksEnabledInternally()); |
| 469 SourceBuffer* sourceBuffer = | 469 SourceBuffer* sourceBuffer = |
| 470 SourceBufferTrackBaseSupplement::sourceBuffer(*track); | 470 SourceBufferTrackBaseSupplement::sourceBuffer(*track); |
| 471 if (!sourceBuffer) | 471 if (!sourceBuffer) |
| 472 return; | 472 return; |
| 473 | 473 |
| 474 DCHECK(m_sourceBuffers->contains(sourceBuffer)); | 474 DCHECK(m_sourceBuffers->contains(sourceBuffer)); |
| 475 if (track->type() == WebMediaPlayer::AudioTrack) { | 475 if (track->type() == WebMediaPlayer::AudioTrack) { |
| 476 sourceBuffer->audioTracks().scheduleChangeEvent(); | 476 sourceBuffer->audioTracks().scheduleChangeEvent(); |
| 477 } else if (track->type() == WebMediaPlayer::VideoTrack) { | 477 } else if (track->type() == WebMediaPlayer::VideoTrack) { |
| 478 if (static_cast<VideoTrack*>(track)->selected()) | 478 if (static_cast<VideoTrack*>(track)->selected()) |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 815 event->setTarget(this); | 815 event->setTarget(this); |
| 816 | 816 |
| 817 m_asyncEventQueue->enqueueEvent(event); | 817 m_asyncEventQueue->enqueueEvent(event); |
| 818 } | 818 } |
| 819 | 819 |
| 820 URLRegistry& MediaSource::registry() const { | 820 URLRegistry& MediaSource::registry() const { |
| 821 return MediaSourceRegistry::registry(); | 821 return MediaSourceRegistry::registry(); |
| 822 } | 822 } |
| 823 | 823 |
| 824 } // namespace blink | 824 } // namespace blink |
| OLD | NEW |