Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: media/filters/source_buffer_stream_unittest.cc

Issue 1898373002: MSE: More cleanly handle stall resolution edge cases (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/filters/source_buffer_stream_unittest.cc
diff --git a/media/filters/source_buffer_stream_unittest.cc b/media/filters/source_buffer_stream_unittest.cc
index 34f131637d8849c48421914c2fada6be32c664ee..1eeebabb6ef892943b573948e995a92ffa797b74 100644
--- a/media/filters/source_buffer_stream_unittest.cc
+++ b/media/filters/source_buffer_stream_unittest.cc
@@ -3534,6 +3534,76 @@ TEST_F(SourceBufferStreamTest, OverlapSplitAndMergeWhileWaitingForMoreData) {
CheckExpectedBuffers("180K 210");
}
+// Verify that a single coded frame at the current read position unblocks the
+// read even if the frame is buffered after the previously read position is
+// removed.
+TEST_F(SourceBufferStreamTest, AfterRemove_SingleFrameRange_Unblocks_Read) {
+ Seek(0);
+ NewCodedFrameGroupAppend("0K 30 60 90D30");
+ CheckExpectedRangesByTimestamp("{ [0,120) }");
+ CheckExpectedBuffers("0K 30 60 90");
+ CheckNoNextBuffer();
+
+ RemoveInMs(0, 120, 120);
+ CheckExpectedRangesByTimestamp("{ }");
+ NewCodedFrameGroupAppend("120D30K");
+ CheckExpectedRangesByTimestamp("{ [120,150) }");
+ CheckExpectedBuffers("120K");
wolenetz 2016/04/20 00:38:24 This line fails prior to the SBS.cc change also in
chcunningham 2016/04/20 20:14:27 Acknowledged.
+ CheckNoNextBuffer();
+}
+
+// Verify that multiple short (relative to max-inter-buffer-distance * 2) coded
+// frames at the current read position unblock the read even if the frames are
+// buffered after the previously read position is removed.
+TEST_F(SourceBufferStreamTest, AfterRemove_TinyFrames_Unblock_Read_1) {
+ Seek(0);
+ NewCodedFrameGroupAppend("0K 30 60 90D30");
+ CheckExpectedRangesByTimestamp("{ [0,120) }");
+ CheckExpectedBuffers("0K 30 60 90");
+ CheckNoNextBuffer();
+
+ RemoveInMs(0, 120, 120);
+ CheckExpectedRangesByTimestamp("{ }");
+ NewCodedFrameGroupAppend("120D1K 121D1");
+ CheckExpectedRangesByTimestamp("{ [120,122) }");
+ CheckExpectedBuffers("120K 121");
wolenetz 2016/04/20 00:38:24 This line fails prior to the SBS.cc change also in
chcunningham 2016/04/20 20:14:27 Done.
+ CheckNoNextBuffer();
+}
+
+// Verify that multiple short (relative to max-inter-buffer-distance * 2) coded
+// frames starting at the fudge room boundary unblock the read even if the
+// frames are buffered after the previously read position is removed.
+TEST_F(SourceBufferStreamTest, AfterRemove_TinyFrames_Unblock_Read_2) {
+ Seek(0);
+ NewCodedFrameGroupAppend("0K 30 60 90D30");
+ CheckExpectedRangesByTimestamp("{ [0,120) }");
+ CheckExpectedBuffers("0K 30 60 90");
+ CheckNoNextBuffer();
+
+ RemoveInMs(0, 120, 120);
+ CheckExpectedRangesByTimestamp("{ }");
+ NewCodedFrameGroupAppend("150D1K 151D1");
+ CheckExpectedRangesByTimestamp("{ [150,152) }");
+ CheckExpectedBuffers("150K 151");
wolenetz 2016/04/20 00:38:24 This line fails prior to the SBS.cc change also in
chcunningham 2016/04/20 20:14:27 Acknowledged.
+ CheckNoNextBuffer();
+}
+
+// Verify that coded frames starting after the fudge room boundary do not
+// unblock the read when buffered after the previously read position is removed.
+TEST_F(SourceBufferStreamTest, AfterRemove_BeyondFudge_Stalled) {
+ Seek(0);
+ NewCodedFrameGroupAppend("0K 30 60 90D30");
+ CheckExpectedRangesByTimestamp("{ [0,120) }");
+ CheckExpectedBuffers("0K 30 60 90");
+ CheckNoNextBuffer();
+
+ RemoveInMs(0, 120, 120);
+ CheckExpectedRangesByTimestamp("{ }");
+ NewCodedFrameGroupAppend("151D1K 152D1");
+ CheckExpectedRangesByTimestamp("{ [151,153) }");
+ CheckNoNextBuffer();
wolenetz 2016/04/20 00:38:24 This test confirms stall behavior that used to be
chcunningham 2016/04/20 20:14:27 Acknowledged.
+}
+
// Verify that non-keyframes with the same timestamp in the same
// append are handled correctly.
TEST_F(SourceBufferStreamTest, SameTimestamp_Video_SingleAppend) {
« media/filters/source_buffer_stream.cc ('K') | « media/filters/source_buffer_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698