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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 | 303 |
304 double MediaSource::duration() const | 304 double MediaSource::duration() const |
305 { | 305 { |
306 return isClosed() ? std::numeric_limits<float>::quiet_NaN() : m_webMediaSour
ce->duration(); | 306 return isClosed() ? std::numeric_limits<float>::quiet_NaN() : m_webMediaSour
ce->duration(); |
307 } | 307 } |
308 | 308 |
309 PassRefPtrWillBeRawPtr<TimeRanges> MediaSource::buffered() const | 309 PassRefPtrWillBeRawPtr<TimeRanges> MediaSource::buffered() const |
310 { | 310 { |
311 // Implements MediaSource algorithm for HTMLMediaElement.buffered. | 311 // Implements MediaSource algorithm for HTMLMediaElement.buffered. |
312 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#htmlmediaelement-extensions | 312 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#htmlmediaelement-extensions |
313 WillBeHeapVector<RefPtrWillBeMember<TimeRanges> > ranges(m_activeSourceBuffe
rs->length()); | 313 WillBeHeapVector<RefPtrWillBeMember<TimeRanges>> ranges(m_activeSourceBuffer
s->length()); |
314 for (size_t i = 0; i < m_activeSourceBuffers->length(); ++i) | 314 for (size_t i = 0; i < m_activeSourceBuffers->length(); ++i) |
315 ranges[i] = m_activeSourceBuffers->item(i)->buffered(ASSERT_NO_EXCEPTION
); | 315 ranges[i] = m_activeSourceBuffers->item(i)->buffered(ASSERT_NO_EXCEPTION
); |
316 | 316 |
317 // 1. If activeSourceBuffers.length equals 0 then return an empty TimeRanges
object and abort these steps. | 317 // 1. If activeSourceBuffers.length equals 0 then return an empty TimeRanges
object and abort these steps. |
318 if (ranges.isEmpty()) | 318 if (ranges.isEmpty()) |
319 return TimeRanges::create(); | 319 return TimeRanges::create(); |
320 | 320 |
321 // 2. Let active ranges be the ranges returned by buffered for each SourceBu
ffer object in activeSourceBuffers. | 321 // 2. Let active ranges be the ranges returned by buffered for each SourceBu
ffer object in activeSourceBuffers. |
322 // 3. Let highest end time be the largest range end time in the active range
s. | 322 // 3. Let highest end time be the largest range end time in the active range
s. |
323 double highestEndTime = -1; | 323 double highestEndTime = -1; |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 | 616 |
617 m_asyncEventQueue->enqueueEvent(event.release()); | 617 m_asyncEventQueue->enqueueEvent(event.release()); |
618 } | 618 } |
619 | 619 |
620 URLRegistry& MediaSource::registry() const | 620 URLRegistry& MediaSource::registry() const |
621 { | 621 { |
622 return MediaSourceRegistry::registry(); | 622 return MediaSourceRegistry::registry(); |
623 } | 623 } |
624 | 624 |
625 } // namespace blink | 625 } // namespace blink |
OLD | NEW |