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

Unified Diff: media/filters/source_buffer_stream_unittest.cc

Issue 1089873006: WIP - MSE: Drop non-keyframes that lack keyframe dependency (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Checkpoint of WIP while I work on prereq https://codereview.chromium.org/1091293005/ Created 5 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
« no previous file with comments | « media/filters/source_buffer_stream.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 610e78d75866dcca5ada51b9333b61fdbf80f040..cd7faafae1ccd16bfb5b6027d1d62a3e9b63a9e6 100644
--- a/media/filters/source_buffer_stream_unittest.cc
+++ b/media/filters/source_buffer_stream_unittest.cc
@@ -4041,6 +4041,52 @@ TEST_F(SourceBufferStreamTest, RefinedDurationEstimates_FrontOverlap) {
CheckNoNextBuffer();
}
+TEST_F(SourceBufferStreamTest, LeadingNonKeyframes_Kept) {
+ // Append a media segment that begins with a keyframe.
+ NewSegmentAppend("0K 10D10");
+
+ // Append another (continuous) media segment that begins with non-keyframes.
+ NewSegmentAppend("20 30 40K 50 60D10");
+
+ CheckExpectedRangesByTimestamp("{ [0,70) }");
+ Seek(0);
+ CheckExpectedBuffers("0K 10D10 20 30 40K 50 60D10");
+ CheckNoNextBuffer();
+}
+
+TEST_F(SourceBufferStreamTest, LeadingNonKeyframes_Dropped) {
+ // Append a media segment that has some initial non-keyframes.
+ NewSegmentAppend("0 10 20 30K 40 50 60 70D10K");
+
+ CheckExpectedRangesByTimestamp("{ [30,80) }");
+ SeekToTimestamp(base::TimeDelta::FromMilliseconds(30));
+ CheckExpectedBuffers("30K 40 50 60 70K");
+ CheckNoNextBuffer();
+}
+
+TEST_F(SourceBufferStreamTest,
+ NonKeyframesDirectlyFollowingRemovedRange_Dropped) {
+ // Append a media segment containing decode dependencies for subsequent
+ // append.
+ NewSegmentAppend("0K 10 20 30 40D10K");
+ CheckExpectedRangesByTimestamp("{ [0,50) }");
+
+ // Remove the decode dependency that subsequent append will depend upon.
+ RemoveInMs(40, 41, 50);
+ CheckExpectedRangesByTimestamp("{ [0,40) }");
+
+ // Append more media, leading with non-keyframes that supposedly might have
+ // depended upon the now-removed keyframe from time 40ms.
+ AppendBuffers("50 60 70K 80D10");
+ CheckExpectedRangesByTimestamp("{ [0,40) [70,90) }");
+ Seek(0);
+ CheckExpectedBuffers("0K 10 20 30D10");
+ CheckNoNextBuffer();
+ SeekToTimestamp(base::TimeDelta::FromMilliseconds(70));
+ CheckExpectedBuffers("70K 80D10");
+ CheckNoNextBuffer();
+}
+
// TODO(vrk): Add unit tests where keyframes are unaligned between streams.
// (crbug.com/133557)
« no previous file with comments | « media/filters/source_buffer_stream.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698