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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 } // namespace | 92 } // namespace |
93 | 93 |
94 SourceBuffer* SourceBuffer::create(PassOwnPtr<WebSourceBuffer> webSourceBuffer,
MediaSource* source, GenericEventQueue* asyncEventQueue) | 94 SourceBuffer* SourceBuffer::create(PassOwnPtr<WebSourceBuffer> webSourceBuffer,
MediaSource* source, GenericEventQueue* asyncEventQueue) |
95 { | 95 { |
96 SourceBuffer* sourceBuffer = new SourceBuffer(webSourceBuffer, source, async
EventQueue); | 96 SourceBuffer* sourceBuffer = new SourceBuffer(webSourceBuffer, source, async
EventQueue); |
97 sourceBuffer->suspendIfNeeded(); | 97 sourceBuffer->suspendIfNeeded(); |
98 return sourceBuffer; | 98 return sourceBuffer; |
99 } | 99 } |
100 | 100 |
101 SourceBuffer::SourceBuffer(PassOwnPtr<WebSourceBuffer> webSourceBuffer, MediaSou
rce* source, GenericEventQueue* asyncEventQueue) | 101 SourceBuffer::SourceBuffer(PassOwnPtr<WebSourceBuffer> webSourceBuffer, MediaSou
rce* source, GenericEventQueue* asyncEventQueue) |
102 : ActiveDOMObject(source->executionContext()) | 102 : ActiveDOMObject(source->getExecutionContext()) |
103 , m_webSourceBuffer(webSourceBuffer) | 103 , m_webSourceBuffer(webSourceBuffer) |
104 , m_source(source) | 104 , m_source(source) |
105 , m_trackDefaults(TrackDefaultList::create()) | 105 , m_trackDefaults(TrackDefaultList::create()) |
106 , m_asyncEventQueue(asyncEventQueue) | 106 , m_asyncEventQueue(asyncEventQueue) |
107 , m_mode(segmentsKeyword()) | 107 , m_mode(segmentsKeyword()) |
108 , m_updating(false) | 108 , m_updating(false) |
109 , m_timestampOffset(0) | 109 , m_timestampOffset(0) |
110 , m_appendWindowStart(0) | 110 , m_appendWindowStart(0) |
111 , m_appendWindowEnd(std::numeric_limits<double>::infinity()) | 111 , m_appendWindowEnd(std::numeric_limits<double>::infinity()) |
112 , m_firstInitializationSegmentReceived(false) | 112 , m_firstInitializationSegmentReceived(false) |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 m_appendStreamAsyncPartRunner->resume(); | 513 m_appendStreamAsyncPartRunner->resume(); |
514 } | 514 } |
515 | 515 |
516 void SourceBuffer::stop() | 516 void SourceBuffer::stop() |
517 { | 517 { |
518 m_appendBufferAsyncPartRunner->stop(); | 518 m_appendBufferAsyncPartRunner->stop(); |
519 m_removeAsyncPartRunner->stop(); | 519 m_removeAsyncPartRunner->stop(); |
520 m_appendStreamAsyncPartRunner->stop(); | 520 m_appendStreamAsyncPartRunner->stop(); |
521 } | 521 } |
522 | 522 |
523 ExecutionContext* SourceBuffer::executionContext() const | 523 ExecutionContext* SourceBuffer::getExecutionContext() const |
524 { | 524 { |
525 return ActiveDOMObject::executionContext(); | 525 return ActiveDOMObject::getExecutionContext(); |
526 } | 526 } |
527 | 527 |
528 const AtomicString& SourceBuffer::interfaceName() const | 528 const AtomicString& SourceBuffer::interfaceName() const |
529 { | 529 { |
530 return EventTargetNames::SourceBuffer; | 530 return EventTargetNames::SourceBuffer; |
531 } | 531 } |
532 | 532 |
533 bool SourceBuffer::isRemoved() const | 533 bool SourceBuffer::isRemoved() const |
534 { | 534 { |
535 return !m_source; | 535 return !m_source; |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 | 751 |
752 // 1. If maxSize is set, then let bytesLeft equal maxSize. | 752 // 1. If maxSize is set, then let bytesLeft equal maxSize. |
753 // 2. Loop Top: If maxSize is set and bytesLeft equals 0, then jump to the l
oop done step below. | 753 // 2. Loop Top: If maxSize is set and bytesLeft equals 0, then jump to the l
oop done step below. |
754 if (m_streamMaxSizeValid && !m_streamMaxSize) { | 754 if (m_streamMaxSizeValid && !m_streamMaxSize) { |
755 appendStreamDone(true); | 755 appendStreamDone(true); |
756 return; | 756 return; |
757 } | 757 } |
758 | 758 |
759 // Steps 3-11 are handled by m_loader. | 759 // Steps 3-11 are handled by m_loader. |
760 // Note: Passing 0 here signals that maxSize was not set. (i.e. Read all the
data in the stream). | 760 // Note: Passing 0 here signals that maxSize was not set. (i.e. Read all the
data in the stream). |
761 m_loader->start(executionContext(), *m_stream, m_streamMaxSizeValid ? m_stre
amMaxSize : 0); | 761 m_loader->start(getExecutionContext(), *m_stream, m_streamMaxSizeValid ? m_s
treamMaxSize : 0); |
762 } | 762 } |
763 | 763 |
764 void SourceBuffer::appendStreamDone(bool success) | 764 void SourceBuffer::appendStreamDone(bool success) |
765 { | 765 { |
766 ASSERT(m_updating); | 766 ASSERT(m_updating); |
767 ASSERT(m_loader); | 767 ASSERT(m_loader); |
768 ASSERT(m_stream); | 768 ASSERT(m_stream); |
769 | 769 |
770 clearAppendStreamState(); | 770 clearAppendStreamState(); |
771 | 771 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 visitor->trace(m_asyncEventQueue); | 870 visitor->trace(m_asyncEventQueue); |
871 visitor->trace(m_appendBufferAsyncPartRunner); | 871 visitor->trace(m_appendBufferAsyncPartRunner); |
872 visitor->trace(m_removeAsyncPartRunner); | 872 visitor->trace(m_removeAsyncPartRunner); |
873 visitor->trace(m_appendStreamAsyncPartRunner); | 873 visitor->trace(m_appendStreamAsyncPartRunner); |
874 visitor->trace(m_stream); | 874 visitor->trace(m_stream); |
875 RefCountedGarbageCollectedEventTargetWithInlineData<SourceBuffer>::trace(vis
itor); | 875 RefCountedGarbageCollectedEventTargetWithInlineData<SourceBuffer>::trace(vis
itor); |
876 ActiveDOMObject::trace(visitor); | 876 ActiveDOMObject::trace(visitor); |
877 } | 877 } |
878 | 878 |
879 } // namespace blink | 879 } // namespace blink |
OLD | NEW |