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/MediaSource.h" | 32 #include "modules/mediasource/MediaSource.h" |
33 | 33 |
34 #include "RuntimeEnabledFeatures.h" | |
35 #include "bindings/v8/ExceptionMessages.h" | 34 #include "bindings/v8/ExceptionMessages.h" |
36 #include "bindings/v8/ExceptionState.h" | 35 #include "bindings/v8/ExceptionState.h" |
37 #include "bindings/v8/ExceptionStatePlaceholder.h" | 36 #include "bindings/v8/ExceptionStatePlaceholder.h" |
38 #include "core/dom/ExceptionCode.h" | 37 #include "core/dom/ExceptionCode.h" |
39 #include "core/events/GenericEventQueue.h" | 38 #include "core/events/GenericEventQueue.h" |
40 #include "core/html/HTMLMediaElement.h" | 39 #include "core/html/HTMLMediaElement.h" |
41 #include "core/html/TimeRanges.h" | 40 #include "core/html/TimeRanges.h" |
42 #include "modules/mediasource/MediaSourceRegistry.h" | 41 #include "modules/mediasource/MediaSourceRegistry.h" |
43 #include "platform/ContentType.h" | 42 #include "platform/ContentType.h" |
44 #include "platform/Logging.h" | 43 #include "platform/Logging.h" |
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 m_asyncEventQueue->close(); | 470 m_asyncEventQueue->close(); |
472 if (!isClosed()) | 471 if (!isClosed()) |
473 setReadyState(closedKeyword()); | 472 setReadyState(closedKeyword()); |
474 m_webMediaSource.clear(); | 473 m_webMediaSource.clear(); |
475 } | 474 } |
476 | 475 |
477 PassOwnPtr<WebSourceBuffer> MediaSource::createWebSourceBuffer(const String& typ
e, const Vector<String>& codecs, ExceptionState& exceptionState) | 476 PassOwnPtr<WebSourceBuffer> MediaSource::createWebSourceBuffer(const String& typ
e, const Vector<String>& codecs, ExceptionState& exceptionState) |
478 { | 477 { |
479 WebSourceBuffer* webSourceBuffer = 0; | 478 WebSourceBuffer* webSourceBuffer = 0; |
480 | 479 |
481 // FIXME: Always use the new frame processor once it has stabilized enough.
See http://crbug.com/249422. | 480 switch (m_webMediaSource->addSourceBuffer(type, codecs, &webSourceBuffer)) { |
482 WebMediaSource::FrameProcessorChoice frameProcessorChoice = RuntimeEnabledFe
atures::mediaSourceExperimentalEnabled() ? | |
483 WebMediaSource::UseNewFrameProcessor : WebMediaSource::UseLegacyFramePro
cessor; | |
484 | |
485 WTF_LOG(Media, "MediaSource::createWebSourceBuffer() %p : frameProcessorChoi
ce = %i", this, frameProcessorChoice); | |
486 | |
487 switch (m_webMediaSource->addSourceBuffer(type, codecs, frameProcessorChoice
, &webSourceBuffer)) { | |
488 case WebMediaSource::AddStatusOk: | 481 case WebMediaSource::AddStatusOk: |
489 return adoptPtr(webSourceBuffer); | 482 return adoptPtr(webSourceBuffer); |
490 case WebMediaSource::AddStatusNotSupported: | 483 case WebMediaSource::AddStatusNotSupported: |
491 ASSERT(!webSourceBuffer); | 484 ASSERT(!webSourceBuffer); |
492 // 2.2 https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/m
edia-source.html#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type | 485 // 2.2 https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/m
edia-source.html#widl-MediaSource-addSourceBuffer-SourceBuffer-DOMString-type |
493 // Step 2: If type contains a MIME type ... that is not supported with t
he types | 486 // Step 2: If type contains a MIME type ... that is not supported with t
he types |
494 // specified for the other SourceBuffer objects in sourceBuffers, then t
hrow | 487 // specified for the other SourceBuffer objects in sourceBuffers, then t
hrow |
495 // a NotSupportedError exception and abort these steps. | 488 // a NotSupportedError exception and abort these steps. |
496 exceptionState.throwDOMException(NotSupportedError, "The type provided (
'" + type + "') is not supported."); | 489 exceptionState.throwDOMException(NotSupportedError, "The type provided (
'" + type + "') is not supported."); |
497 return nullptr; | 490 return nullptr; |
(...skipping 19 matching lines...) Expand all Loading... |
517 | 510 |
518 m_asyncEventQueue->enqueueEvent(event.release()); | 511 m_asyncEventQueue->enqueueEvent(event.release()); |
519 } | 512 } |
520 | 513 |
521 URLRegistry& MediaSource::registry() const | 514 URLRegistry& MediaSource::registry() const |
522 { | 515 { |
523 return MediaSourceRegistry::registry(); | 516 return MediaSourceRegistry::registry(); |
524 } | 517 } |
525 | 518 |
526 } // namespace WebCore | 519 } // namespace WebCore |
OLD | NEW |