Changeset 179725 in webkit
- Timestamp:
- Feb 5, 2015 4:57:41 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r179723 r179725 1 2015-02-05 Bartlomiej Gajda <b.gajda@samsung.com> 2 3 [MSE] Implement Append Error algorithm. 4 https://bugs.webkit.org/show_bug.cgi?id=139439 5 6 Reviewed by Jer Noble. 7 8 If Source Buffer has not received first init segment, then it shall call endOfStream after receiving 9 Media Segment, as per Media Source spec. (from 17 July 2014) in paragraph 3.5.1 point 6.1. 10 Added test which after creating SourceBuffer sends media sample, without any init segments. 11 12 * media/media-source/media-source-append-media-segment-without-init-expected.txt: Added. 13 * media/media-source/media-source-append-media-segment-without-init.html: Added. 14 1 15 2015-02-05 Zalan Bujtas <zalan@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r179706 r179725 1 2015-02-05 Bartlomiej Gajda <b.gajda@samsung.com> 2 3 [MSE] Implement Append Error algorithm. 4 https://bugs.webkit.org/show_bug.cgi?id=139439 5 6 Reviewed by Jer Noble. 7 8 If Source Buffer has not received first init segment, then it shall call endOfStream after receiving 9 Media Segment, as per Media Source spec. (from 17 July 2014) in paragraph 3.5.1 point 6.1. 10 11 Based this change on Editor's Draft 12 December 2014, as it clarifies order of events. 12 13 Test: media/media-source/media-source-append-media-segment-without-init.html 14 15 * Modules/mediasource/MediaSource.cpp: 16 (WebCore::MediaSource::streamEndedWithError): 17 * Modules/mediasource/MediaSource.h: 18 * Modules/mediasource/SourceBuffer.cpp: 19 (WebCore::SourceBuffer::sourceBufferPrivateAppendComplete): 20 (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment): 21 (WebCore::SourceBuffer::validateInitializationSegment): 22 (WebCore::SourceBuffer::appendError): 23 * Modules/mediasource/SourceBuffer.h: 24 1 25 2015-02-05 Maciej Stachowiak <mjs@apple.com> 2 26 -
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp
r179577 r179725 617 617 618 618 // 2. If the input buffer contains bytes that violate the SourceBuffer byte stream format specification, 619 // then run the end of stream algorithm with the error parameter set to "decode"and abort this algorithm.619 // then run the append error algorithm with the decode error parameter set to true and abort this algorithm. 620 620 if (result == ParsingFailed) { 621 621 LOG(MediaSource, "SourceBuffer::sourceBufferPrivateAppendComplete(%p) - result = ParsingFailed", this); 622 m_source->streamEndedWithError(decodeError(), IgnorableExceptionCode());622 appendError(true); 623 623 return; 624 624 } … … 998 998 LOG(MediaSource, "SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment(%p)", this); 999 999 1000 // 3.5.7 Initialization Segment Received 1001 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#sourcebuffer-init-segment-received 1000 // 3.5.8 Initialization Segment Received (ctd) 1001 // https://rawgit.com/w3c/media-source/c3ad59c7a370d04430969ba73d18dc9bcde57a33/index.html#sourcebuffer-init-segment-received [Editor's Draft 09 January 2015] 1002 1002 1003 // 1. Update the duration attribute if it currently equals NaN: 1003 1004 if (m_source->duration().isInvalid()) { … … 1010 1011 } 1011 1012 1012 // 2. If the initialization segment has no audio, video, or text tracks, then run the end of stream1013 // algorithm with the error parameter set to "decode"and abort these steps.1013 // 2. If the initialization segment has no audio, video, or text tracks, then run the append error algorithm 1014 // with the decode error parameter set to true and abort these steps. 1014 1015 if (!segment.audioTracks.size() && !segment.videoTracks.size() && !segment.textTracks.size()) 1015 m_source->streamEndedWithError(decodeError(), IgnorableExceptionCode()); 1016 1016 appendError(true); 1017 1017 1018 1018 // 3. If the first initialization segment flag is true, then run the following steps: 1019 1019 if (m_receivedFirstInitializationSegment) { 1020 1021 // 3.1. Verify the following properties. If any of the checks fail then run the append error algorithm 1022 // with the decode error parameter set to true and abort these steps. 1020 1023 if (!validateInitializationSegment(segment)) { 1021 m_source->streamEndedWithError(decodeError(), IgnorableExceptionCode());1024 appendError(true); 1022 1025 return; 1023 1026 } … … 1059 1062 } 1060 1063 1064 // 3.3 Set the need random access point flag on all track buffers to true. 1061 1065 for (auto& trackBuffer : m_trackBufferMap.values()) 1062 1066 trackBuffer.needRandomAccessFlag = true; … … 1069 1073 if (!m_receivedFirstInitializationSegment) { 1070 1074 // 5.1 If the initialization segment contains tracks with codecs the user agent does not support, 1071 // then run the end of stream algorithm with the error parameter set to "decode"and abort these steps.1075 // then run the append error algorithm with the decode error parameter set to true and abort these steps. 1072 1076 // NOTE: This check is the responsibility of the SourceBufferPrivate. 1073 1077 … … 1076 1080 AudioTrackPrivate* audioTrackPrivate = audioTrackInfo.track.get(); 1077 1081 1082 // FIXME: Implement steps 5.2.1-5.2.8.1 as per Editor's Draft 09 January 2015, and reorder this 1078 1083 // 5.2.1 Let new audio track be a new AudioTrack object. 1079 1084 // 5.2.2 Generate a unique ID and assign it to the id property on new video track. … … 1116 1121 VideoTrackPrivate* videoTrackPrivate = videoTrackInfo.track.get(); 1117 1122 1123 // FIXME: Implement steps 5.3.1-5.3.8.1 as per Editor's Draft 09 January 2015, and reorder this 1118 1124 // 5.3.1 Let new video track be a new VideoTrack object. 1119 1125 // 5.3.2 Generate a unique ID and assign it to the id property on new video track. … … 1156 1162 InbandTextTrackPrivate* textTrackPrivate = textTrackInfo.track.get(); 1157 1163 1164 // FIXME: Implement steps 5.4.1-5.4.8.1 as per Editor's Draft 09 January 2015, and reorder this 1158 1165 // 5.4.1 Let new text track be a new TextTrack object with its properties populated with the 1159 1166 // appropriate information from the initialization segment. … … 1190 1197 if (activeTrackFlag) { 1191 1198 // 5.5.1 Add this SourceBuffer to activeSourceBuffers. 1199 // 5.5.2 Queue a task to fire a simple event named addsourcebuffer at activeSourceBuffers 1192 1200 setActive(true); 1193 1201 } … … 1219 1227 bool SourceBuffer::validateInitializationSegment(const InitializationSegment& segment) 1220 1228 { 1221 // 3.5.7 Initialization Segment Received (ctd)1222 // https://dvcs.w3.org/hg/html-media/raw-file/default/media-source/media-source.html#sourcebuffer-init-segment-received1223 1224 // 3.1. Verify the following properties. If any of the checks fail then run the end of stream 1225 // algorithm with the error parameter set to "decode" and abort these steps.1229 // FIXME: ordering of all 3.5.X (X>=7) functions needs to be updated to post-[24 July 2014 Editor's Draft] version 1230 // 3.5.8 Initialization Segment Received (ctd) 1231 // https://rawgit.com/w3c/media-source/c3ad59c7a370d04430969ba73d18dc9bcde57a33/index.html#sourcebuffer-init-segment-received [Editor's Draft 09 January 2015] 1232 1233 // Note: those are checks from step 3.1 1226 1234 // * The number of audio, video, and text tracks match what was in the first initialization segment. 1227 1235 if (segment.audioTracks.size() != audioTracks()->length() … … 1290 1298 }; 1291 1299 1300 void SourceBuffer::appendError(bool decodeErrorParam) 1301 { 1302 // 3.5.3 Append Error Algorithm 1303 // https://rawgit.com/w3c/media-source/c3ad59c7a370d04430969ba73d18dc9bcde57a33/index.html#sourcebuffer-append-error [Editor's Draft 09 January 2015] 1304 1305 ASSERT(m_updating); 1306 // 1. Run the reset parser state algorithm. 1307 resetParserState(); 1308 1309 // 2. Set the updating attribute to false. 1310 m_updating = false; 1311 1312 // 3. Queue a task to fire a simple event named error at this SourceBuffer object. 1313 scheduleEvent(eventNames().errorEvent); 1314 1315 // 4. Queue a task to fire a simple event named updateend at this SourceBuffer object. 1316 scheduleEvent(eventNames().updateendEvent); 1317 1318 // 5. If decode error is true, then run the end of stream algorithm with the error parameter set to "decode". 1319 if (decodeErrorParam) 1320 m_source->streamEndedWithError(decodeError(), IgnorableExceptionCode()); 1321 } 1322 1292 1323 void SourceBuffer::sourceBufferPrivateDidReceiveSample(SourceBufferPrivate*, PassRefPtr<MediaSample> prpSample) 1293 1324 { 1294 1325 if (isRemoved()) 1295 1326 return; 1327 1328 // 3.5.1 Segment Parser Loop 1329 // 6.1 If the first initialization segment received flag is false, then run the append error algorithm 1330 // with the decode error parameter set to true and abort this algorithm. 1331 // Note: current design makes SourceBuffer somehow ignorant of append state - it's more a thing 1332 // of SourceBufferPrivate. That's why this check can't really be done in appendInternal. 1333 // unless we force some kind of design with state machine switching. 1334 if (!m_receivedFirstInitializationSegment) { 1335 appendError(true); 1336 return; 1337 } 1296 1338 1297 1339 RefPtr<MediaSample> sample = prpSample; -
trunk/Source/WebCore/Modules/mediasource/SourceBuffer.h
r179044 r179725 93 93 void remove(const MediaTime&, const MediaTime&, ExceptionCode&); 94 94 95 void appendError(bool); 95 96 void abortIfUpdating(); 96 97 void removedFromMediaSource();
Note: See TracChangeset
for help on using the changeset viewer.