[MSE] Implement Append Error algorithm.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Feb 2015 22:14:20 +0000 (22:14 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 6 Feb 2015 22:14:20 +0000 (22:14 +0000)
commit6c1c9c2e5d91bb0004568fcfc2f8ab7d5e2cf942
treed10fcf32ba1cc8e657b1994faeb6e3a9e3da8865
parentee63f5af66536f1e4548994a3c50a176d72e1b44
[MSE] Implement Append Error algorithm.
https://bugs.webkit.org/show_bug.cgi?id=139439

Patch by Bartlomiej Gajda <b.gajda@samsung.com> on 2015-02-06
Reviewed by Jer Noble.

If Source Buffer has not received first init segment, then it shall call endOfStream after receiving
Media Segment, as per Media Source spec. (from 17 July 2014) in paragraph 3.5.1 point 6.1.
Source/WebCore:

Based this change on Editor's Draft 12 December 2014, as it clarifies order of events.

Test: media/media-source/media-source-append-media-segment-without-init.html

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::streamEndedWithError):
* Modules/mediasource/MediaSource.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::sourceBufferPrivateAppendComplete):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
(WebCore::SourceBuffer::validateInitializationSegment):
(WebCore::SourceBuffer::appendError):
* Modules/mediasource/SourceBuffer.h:

LayoutTests:

Added test which after creating SourceBuffer sends media sample, without any init segments.
Updated existing tests, so they correctly expect updateend and error as per Append Error algorithm.

* media/media-source/media-source-append-failed-expected.txt:
* media/media-source/media-source-append-failed.html:
* media/media-source/media-source-append-media-segment-without-init-expected.txt: Added.
* media/media-source/media-source-append-media-segment-without-init.html: Added.
* media/media-source/media-source-multiple-initialization-segments-expected.txt:
* media/media-source/media-source-multiple-initialization-segments.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@179762 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/media/media-source/media-source-append-failed-expected.txt
LayoutTests/media/media-source/media-source-append-failed.html
LayoutTests/media/media-source/media-source-append-media-segment-without-init-expected.txt [new file with mode: 0644]
LayoutTests/media/media-source/media-source-append-media-segment-without-init.html [new file with mode: 0644]
LayoutTests/media/media-source/media-source-multiple-initialization-segments-expected.txt
LayoutTests/media/media-source/media-source-multiple-initialization-segments.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediasource/SourceBuffer.cpp
Source/WebCore/Modules/mediasource/SourceBuffer.h