| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 SourceBuffer::~SourceBuffer() | 137 SourceBuffer::~SourceBuffer() |
| 138 { | 138 { |
| 139 WTF_LOG(Media, "SourceBuffer(%p)::~SourceBuffer", this); | 139 WTF_LOG(Media, "SourceBuffer(%p)::~SourceBuffer", this); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void SourceBuffer::dispose() | 142 void SourceBuffer::dispose() |
| 143 { | 143 { |
| 144 // Promptly clears a raw reference from content/ to an on-heap object | 144 // Promptly clears a raw reference from content/ to an on-heap object |
| 145 // so that content/ doesn't access it in a lazy sweeping phase. | 145 // so that content/ doesn't access it in a lazy sweeping phase. |
| 146 m_webSourceBuffer.clear(); | 146 m_webSourceBuffer.reset(); |
| 147 } | 147 } |
| 148 | 148 |
| 149 const AtomicString& SourceBuffer::segmentsKeyword() | 149 const AtomicString& SourceBuffer::segmentsKeyword() |
| 150 { | 150 { |
| 151 DEFINE_STATIC_LOCAL(const AtomicString, segments, ("segments")); | 151 DEFINE_STATIC_LOCAL(const AtomicString, segments, ("segments")); |
| 152 return segments; | 152 return segments; |
| 153 } | 153 } |
| 154 | 154 |
| 155 const AtomicString& SourceBuffer::sequenceKeyword() | 155 const AtomicString& SourceBuffer::sequenceKeyword() |
| 156 { | 156 { |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 486 | 486 |
| 487 if (RuntimeEnabledFeatures::audioVideoTracksEnabled()) { | 487 if (RuntimeEnabledFeatures::audioVideoTracksEnabled()) { |
| 488 ASSERT(m_source); | 488 ASSERT(m_source); |
| 489 if (m_source->mediaElement()->audioTracks().length() > 0 | 489 if (m_source->mediaElement()->audioTracks().length() > 0 |
| 490 || m_source->mediaElement()->videoTracks().length() > 0) { | 490 || m_source->mediaElement()->videoTracks().length() > 0) { |
| 491 removeMediaTracks(); | 491 removeMediaTracks(); |
| 492 } | 492 } |
| 493 } | 493 } |
| 494 | 494 |
| 495 m_webSourceBuffer->removedFromMediaSource(); | 495 m_webSourceBuffer->removedFromMediaSource(); |
| 496 m_webSourceBuffer.clear(); | 496 m_webSourceBuffer.reset(); |
| 497 m_source = nullptr; | 497 m_source = nullptr; |
| 498 m_asyncEventQueue = nullptr; | 498 m_asyncEventQueue = nullptr; |
| 499 } | 499 } |
| 500 | 500 |
| 501 void SourceBuffer::removeMediaTracks() | 501 void SourceBuffer::removeMediaTracks() |
| 502 { | 502 { |
| 503 ASSERT(RuntimeEnabledFeatures::audioVideoTracksEnabled()); | 503 ASSERT(RuntimeEnabledFeatures::audioVideoTracksEnabled()); |
| 504 // Spec: http://w3c.github.io/media-source/#widl-MediaSource-removeSourceBuf
fer-void-SourceBuffer-sourceBuffer | 504 // Spec: http://w3c.github.io/media-source/#widl-MediaSource-removeSourceBuf
fer-void-SourceBuffer-sourceBuffer |
| 505 ASSERT(m_source); | 505 ASSERT(m_source); |
| 506 | 506 |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 938 // 14. Queue a task to fire a simple event named updateend at this SourceBuf
fer object. | 938 // 14. Queue a task to fire a simple event named updateend at this SourceBuf
fer object. |
| 939 scheduleEvent(EventTypeNames::updateend); | 939 scheduleEvent(EventTypeNames::updateend); |
| 940 TRACE_EVENT_ASYNC_END0("media", "SourceBuffer::appendStream", this); | 940 TRACE_EVENT_ASYNC_END0("media", "SourceBuffer::appendStream", this); |
| 941 WTF_LOG(Media, "SourceBuffer(%p)::appendStream ended. buffered=%s", this, we
bTimeRangesToString(m_webSourceBuffer->buffered()).utf8().data()); | 941 WTF_LOG(Media, "SourceBuffer(%p)::appendStream ended. buffered=%s", this, we
bTimeRangesToString(m_webSourceBuffer->buffered()).utf8().data()); |
| 942 } | 942 } |
| 943 | 943 |
| 944 void SourceBuffer::clearAppendStreamState() | 944 void SourceBuffer::clearAppendStreamState() |
| 945 { | 945 { |
| 946 m_streamMaxSizeValid = false; | 946 m_streamMaxSizeValid = false; |
| 947 m_streamMaxSize = 0; | 947 m_streamMaxSize = 0; |
| 948 m_loader.clear(); | 948 m_loader.reset(); |
| 949 m_stream = nullptr; | 949 m_stream = nullptr; |
| 950 } | 950 } |
| 951 | 951 |
| 952 void SourceBuffer::appendError(bool decodeError) | 952 void SourceBuffer::appendError(bool decodeError) |
| 953 { | 953 { |
| 954 WTF_LOG(Media, "SourceBuffer::appendError %p decodeError=%d", this, decodeEr
ror); | 954 WTF_LOG(Media, "SourceBuffer::appendError %p decodeError=%d", this, decodeEr
ror); |
| 955 // Section 3.5.3 Append Error Algorithm | 955 // Section 3.5.3 Append Error Algorithm |
| 956 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#sourcebuffer-append-error | 956 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-sou
rce.html#sourcebuffer-append-error |
| 957 | 957 |
| 958 // 1. Run the reset parser state algorithm. | 958 // 1. Run the reset parser state algorithm. |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 visitor->trace(m_removeAsyncPartRunner); | 1023 visitor->trace(m_removeAsyncPartRunner); |
| 1024 visitor->trace(m_appendStreamAsyncPartRunner); | 1024 visitor->trace(m_appendStreamAsyncPartRunner); |
| 1025 visitor->trace(m_stream); | 1025 visitor->trace(m_stream); |
| 1026 visitor->trace(m_audioTracks); | 1026 visitor->trace(m_audioTracks); |
| 1027 visitor->trace(m_videoTracks); | 1027 visitor->trace(m_videoTracks); |
| 1028 EventTargetWithInlineData::trace(visitor); | 1028 EventTargetWithInlineData::trace(visitor); |
| 1029 ActiveDOMObject::trace(visitor); | 1029 ActiveDOMObject::trace(visitor); |
| 1030 } | 1030 } |
| 1031 | 1031 |
| 1032 } // namespace blink | 1032 } // namespace blink |
| OLD | NEW |