| 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 13 matching lines...) Expand all Loading... |
| 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #include "config.h" | 31 #include "config.h" |
| 32 #include "modules/mediasource/MediaSourceBase.h" | 32 #include "modules/mediasource/MediaSourceBase.h" |
| 33 | 33 |
| 34 #include "RuntimeEnabledFeatures.h" |
| 34 #include "bindings/v8/ExceptionMessages.h" | 35 #include "bindings/v8/ExceptionMessages.h" |
| 35 #include "bindings/v8/ExceptionState.h" | 36 #include "bindings/v8/ExceptionState.h" |
| 36 #include "bindings/v8/ExceptionStatePlaceholder.h" | 37 #include "bindings/v8/ExceptionStatePlaceholder.h" |
| 37 #include "core/dom/ExceptionCode.h" | 38 #include "core/dom/ExceptionCode.h" |
| 38 #include "core/events/Event.h" | 39 #include "core/events/Event.h" |
| 39 #include "core/events/GenericEventQueue.h" | 40 #include "core/events/GenericEventQueue.h" |
| 40 #include "core/html/HTMLMediaElement.h" | 41 #include "core/html/HTMLMediaElement.h" |
| 41 #include "core/html/TimeRanges.h" | 42 #include "core/html/TimeRanges.h" |
| 42 #include "modules/mediasource/MediaSourceRegistry.h" | 43 #include "modules/mediasource/MediaSourceRegistry.h" |
| 43 #include "platform/Logging.h" | 44 #include "platform/Logging.h" |
| (...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 { | 304 { |
| 304 m_asyncEventQueue->close(); | 305 m_asyncEventQueue->close(); |
| 305 if (!isClosed()) | 306 if (!isClosed()) |
| 306 setReadyState(closedKeyword()); | 307 setReadyState(closedKeyword()); |
| 307 m_webMediaSource.clear(); | 308 m_webMediaSource.clear(); |
| 308 } | 309 } |
| 309 | 310 |
| 310 PassOwnPtr<WebSourceBuffer> MediaSourceBase::createWebSourceBuffer(const String&
type, const Vector<String>& codecs, ExceptionState& exceptionState) | 311 PassOwnPtr<WebSourceBuffer> MediaSourceBase::createWebSourceBuffer(const String&
type, const Vector<String>& codecs, ExceptionState& exceptionState) |
| 311 { | 312 { |
| 312 WebSourceBuffer* webSourceBuffer = 0; | 313 WebSourceBuffer* webSourceBuffer = 0; |
| 313 switch (m_webMediaSource->addSourceBuffer(type, codecs, &webSourceBuffer)) { | 314 |
| 315 // FIXME: Always use the new frame processor once it has stabilized enough.
See http://crbug.com/249422. |
| 316 WebMediaSource::FrameProcessorChoice frameProcessorChoice = RuntimeEnabledFe
atures::mediaSourceExperimentalEnabled() ? |
| 317 WebMediaSource::UseNewFrameProcessor : WebMediaSource::UseLegacyFramePro
cessor; |
| 318 |
| 319 WTF_LOG(Media, "MediaSourceBase::createWebSourceBuffer() %p : frameProcessor
Choice = %i", this, frameProcessorChoice); |
| 320 |
| 321 switch (m_webMediaSource->addSourceBuffer(type, codecs, frameProcessorChoice
, &webSourceBuffer)) { |
| 314 case WebMediaSource::AddStatusOk: | 322 case WebMediaSource::AddStatusOk: |
| 315 return adoptPtr(webSourceBuffer); | 323 return adoptPtr(webSourceBuffer); |
| 316 case WebMediaSource::AddStatusNotSupported: | 324 case WebMediaSource::AddStatusNotSupported: |
| 317 ASSERT(!webSourceBuffer); | 325 ASSERT(!webSourceBuffer); |
| 318 // 2.2 https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/m
edia-source.html#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type | 326 // 2.2 https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/m
edia-source.html#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type |
| 319 // Step 2: If type contains a MIME type ... that is not supported with t
he types | 327 // Step 2: If type contains a MIME type ... that is not supported with t
he types |
| 320 // specified for the other SourceBuffer objects in sourceBuffers, then t
hrow | 328 // specified for the other SourceBuffer objects in sourceBuffers, then t
hrow |
| 321 // a NotSupportedError exception and abort these steps. | 329 // a NotSupportedError exception and abort these steps. |
| 322 exceptionState.throwDOMException(NotSupportedError, "The type provided (
'" + type + "') is not supported."); | 330 exceptionState.throwDOMException(NotSupportedError, "The type provided (
'" + type + "') is not supported."); |
| 323 return nullptr; | 331 return nullptr; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 348 { | 356 { |
| 349 return ActiveDOMObject::executionContext(); | 357 return ActiveDOMObject::executionContext(); |
| 350 } | 358 } |
| 351 | 359 |
| 352 URLRegistry& MediaSourceBase::registry() const | 360 URLRegistry& MediaSourceBase::registry() const |
| 353 { | 361 { |
| 354 return MediaSourceRegistry::registry(); | 362 return MediaSourceRegistry::registry(); |
| 355 } | 363 } |
| 356 | 364 |
| 357 } | 365 } |
| OLD | NEW |