forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MSE: Signal new coded frame group more aggressively
For 'sequence' mode coded frame processing, we may need to signal a new coded frame group because application may override timestampOffset and cause the processed frame sequence to go backwards in time. Jumps forward are allowed and kept within the same coded frame group. Jumps backward are now detected and trigger new coded frame group signalling so the overlap-append logic in SourceBufferStream handles this situation more correctly. TEST=*FrameProcessorTest.AudioVideo_Discontinuity_TimestampOffset*, http/tests/media/media-source/mediasource-crbug-616565.html BUG=616565,620523 Review-Url: https://codereview.chromium.org/2035003002 Cr-Commit-Position: refs/heads/master@{#400249}
- Loading branch information
Showing
4 changed files
with
216 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
71 changes: 71 additions & 0 deletions
71
...bKit/LayoutTests/http/tests/media/media-source/mediasource-sequencemode-crbug-616565.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<script src="/w3c/resources/testharness.js"></script> | ||
<script src="/w3c/resources/testharnessreport.js"></script> | ||
<script src="mediasource-util.js"></script> | ||
</head> | ||
<body> | ||
<script> | ||
mediasource_testafterdataloaded(function(test, mediaElement, mediaSource, segmentInfo, sourceBuffer, mediaData) | ||
{ | ||
assert_greater_than(segmentInfo.media.length, 3, "at least 3 media segments for supported type"); | ||
test.failOnEvent(mediaElement, "error"); | ||
sourceBuffer.mode = "sequence"; | ||
assert_equals(sourceBuffer.mode, "sequence", "mode after setting it to 'sequence'"); | ||
|
||
// Append all media segments, preceded by a (now redundant) initialization segment. | ||
test.expectEvent(sourceBuffer, "updatestart", "media segment append started."); | ||
test.expectEvent(sourceBuffer, "update", "media segment append success."); | ||
test.expectEvent(sourceBuffer, "updateend", "media segment append ended."); | ||
sourceBuffer.appendBuffer(mediaData); | ||
|
||
test.waitForExpectedEvents(function() | ||
{ | ||
// Remove much of what we just appended. | ||
test.expectEvent(sourceBuffer, "updatestart", "remove started."); | ||
test.expectEvent(sourceBuffer, "update", "remove success."); | ||
test.expectEvent(sourceBuffer, "updateend", "remove ended."); | ||
sourceBuffer.remove(segmentInfo.media[3].timecode, mediaSource.duration); | ||
}); | ||
|
||
test.waitForExpectedEvents(function() | ||
{ | ||
// Set the timestampOffset to the beginning of the region we just removed. | ||
sourceBuffer.timestampOffset = segmentInfo.media[3].timecode; | ||
|
||
// Remove everything. | ||
test.expectEvent(sourceBuffer, "updatestart", "remove started."); | ||
test.expectEvent(sourceBuffer, "update", "remove success."); | ||
test.expectEvent(sourceBuffer, "updateend", "remove ended."); | ||
sourceBuffer.remove(0, mediaSource.duration); | ||
}); | ||
|
||
test.waitForExpectedEvents(function() | ||
{ | ||
// Set the timestampOffset back to the beginning. | ||
sourceBuffer.timestampOffset = 0; | ||
|
||
// Re-append everything. | ||
test.expectEvent(sourceBuffer, "updatestart", "media segment append started."); | ||
test.expectEvent(sourceBuffer, "update", "media segment append success."); | ||
test.expectEvent(sourceBuffer, "updateend", "media segment append ended."); | ||
sourceBuffer.appendBuffer(mediaData); | ||
}); | ||
|
||
test.waitForExpectedEvents(function() | ||
{ | ||
// Use EOS to get a more precisely verifiable buffered range given our segmentInfo. | ||
test.expectEvent(mediaSource, "sourceended", "mediaSource endOfStream"); | ||
mediaSource.endOfStream(); | ||
}); | ||
|
||
test.waitForExpectedEvents(function() | ||
{ | ||
assertBufferedEquals(sourceBuffer, "{ [0.000, " + segmentInfo.duration.toFixed(3) + ") }"); | ||
test.done(); | ||
}); | ||
}, "Test no error for sequence mode remove and timestampOffset scenario in bug 616565"); | ||
</script> | ||
</body> | ||
</html> |