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

Unified Diff: media/filters/source_buffer_stream_unittest.cc

Issue 1281113002: MSE: Warn when keyframe after track_buffer is significantly in future (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed DCHECK, added tests, need to fix log resulting from one of new tests Created 5 years, 4 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 3d03ccd16867f6c662ee0fa28e3e2e31fcf045bb..4ea3329ea840566394eb55c7a9b3b03e268a0b82 100644
--- a/media/filters/source_buffer_stream_unittest.cc
+++ b/media/filters/source_buffer_stream_unittest.cc
@@ -4285,6 +4285,64 @@ TEST_F(SourceBufferStreamTest, ConfigChange_ReSeek) {
CheckVideoConfig(new_config);
}
+TEST_F(SourceBufferStreamTest,
+ TrackBuffer_WithDelayUntilNextKeyframeInOverlap) {
+ NewSegmentAppend("0K 10 20 30 40");
+
+ // Read the first 4 buffers, so next buffer is at time 40.
+ Seek(0);
+ CheckExpectedRangesByTimestamp("{ [0,50) }");
+ CheckExpectedBuffers("0K 10 20 30");
+
+ // Overlap-append, populating track buffer with timestamp 40 from original
+ // append. Confirm there could be a large jump in time until the next key
+ // frame after exhausting the track buffer.
+ NewSegmentAppend(
+ "31K 41 51 61 71 81 91 101 111 121 "
+ "131K 141");
+ CheckExpectedRangesByTimestamp("{ [0,151) }");
+ // Confirm the large jump. If this test is changed, update
+ // TrackBufferExhaustion_ImmediateNewTrackBuffer accordingly.
+ CheckExpectedBuffers("40 131K 141");
+ CheckNoNextBuffer();
+}
+
+TEST_F(SourceBufferStreamTest,
+ TrackBuffer_ExhaustionAndImmediateNewTrackBuffer) {
+ NewSegmentAppend("0K 10 20 30 40");
+
+ // Read the first 4 buffers, so next buffer is at time 40.
+ Seek(0);
+ CheckExpectedRangesByTimestamp("{ [0,50) }");
+ CheckExpectedBuffers("0K 10 20 30");
+
+ // Overlap-append
+ NewSegmentAppend(
+ "31K 41 51 61 71 81 91 101 111 121 "
+ "131K 141");
+ CheckExpectedRangesByTimestamp("{ [0,151) }");
+
+ // Exhaust the track buffer, but don't read any of the overlapping append yet.
+ CheckExpectedBuffers("40");
+
+ // Selected range's next buffer is now the 131K buffer from the overlapping
+ // append. (See TrackBuffer_WithDelayUntilNextKeyframeInOverlap for
+ // confirmation.)
+ // Do another overlap-append to immediately create another track buffer and
+ // verify.
+ NewSegmentAppend("22K 32 42 52 62 72 82 92 102 112 122K 132 142 152K 162");
+ CheckExpectedRangesByTimestamp("{ [0,172) }");
+
+ //**********
+ // BIG TODO: The following outputs to MediaLog a message understating the
+ // actual gap. Actual gap is time 40->131K==91ms. Log shows 11ms==141->152K.
+ // Fix the implementation and perhaps verify the log with a MockMediaLog?
+ //**********
+
+ CheckExpectedBuffers("131K 141 152K 162");
+ CheckNoNextBuffer();
+}
+
// TODO(vrk): Add unit tests where keyframes are unaligned between streams.
// (crbug.com/133557)
« 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