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

Unified Diff: media/filters/chunk_demuxer_unittest.cc

Issue 414603002: Add support for partial append window end trimming. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Typos. Created 6 years, 5 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/chunk_demuxer_unittest.cc
diff --git a/media/filters/chunk_demuxer_unittest.cc b/media/filters/chunk_demuxer_unittest.cc
index 0bb3ecc5e4978eb7cb5e29f67fb9c45d4b8b8c19..12026d7d4954359d1796b663e3e00c4d278bc729 100644
--- a/media/filters/chunk_demuxer_unittest.cc
+++ b/media/filters/chunk_demuxer_unittest.cc
@@ -458,6 +458,9 @@ class ChunkDemuxerTest : public ::testing::Test {
<< " All text blocks must be keyframes";
}
+ if (track_number == kAudioTrackNum)
+ block_info.flags = kWebMFlagKeyframe;
+
blocks->push_back(block_info);
}
}
@@ -1373,16 +1376,16 @@ TEST_F(ChunkDemuxerTest, InitSegmentSetsNeedRandomAccessPointFlag) {
MuxedStreamInfo(kAudioTrackNum, "0 23K"),
acolwell GONE FROM CHROMIUM 2014/07/23 00:15:42 nit: Remove 0 and s/23K/23D23K/ . The intent of th
DaleCurtis 2014/07/23 01:50:41 Doesn't look like "D" is an understood code here.
MuxedStreamInfo(kVideoTrackNum, "0 30K"),
MuxedStreamInfo(kTextTrackNum, "25K 40K"));
- CheckExpectedRanges(kSourceId, "{ [23,46) }");
+ CheckExpectedRanges(kSourceId, "{ [0,46) }");
acolwell GONE FROM CHROMIUM 2014/07/23 00:15:42 This shouldn't be needed after the change above.
DaleCurtis 2014/07/23 01:50:41 Acknowledged.
AppendInitSegment(HAS_TEXT | HAS_AUDIO | HAS_VIDEO);
AppendMuxedCluster(
MuxedStreamInfo(kAudioTrackNum, "46 69K"),
acolwell GONE FROM CHROMIUM 2014/07/23 00:15:42 nit: s/46/46K/ just so it is explicit please.
DaleCurtis 2014/07/23 01:50:41 Done.
MuxedStreamInfo(kVideoTrackNum, "60 90K"),
MuxedStreamInfo(kTextTrackNum, "80K 90K"));
- CheckExpectedRanges(kSourceId, "{ [23,92) }");
+ CheckExpectedRanges(kSourceId, "{ [0,92) }");
acolwell GONE FROM CHROMIUM 2014/07/23 00:15:42 ditto
DaleCurtis 2014/07/23 01:50:41 Acknowledged.
- CheckExpectedBuffers(audio_stream, "23 69");
+ CheckExpectedBuffers(audio_stream, "0 23");
acolwell GONE FROM CHROMIUM 2014/07/23 00:15:42 I think this should be "23 46 69" since everything
DaleCurtis 2014/07/23 01:50:41 23 43 with my change above.
CheckExpectedBuffers(video_stream, "30 90");
CheckExpectedBuffers(text_stream, "25 40 80 90");
}
@@ -3356,7 +3359,7 @@ TEST_F(ChunkDemuxerTest, AppendWindow_Audio) {
//
// The first 50ms of the range should be truncated since it overlaps
// the start of the append window.
- CheckExpectedRanges(kSourceId, "{ [50,270) }");
+ CheckExpectedRanges(kSourceId, "{ [50,280) }");
acolwell GONE FROM CHROMIUM 2014/07/23 00:15:42 why did this and the range below change?
DaleCurtis 2014/07/23 01:50:41 Previously 270K was being entirely discarded since
// The "50P" buffer is the "0" buffer marked for complete discard. The next
// "50" buffer is the "30" buffer marked with 20ms of start discard.
@@ -3369,7 +3372,7 @@ TEST_F(ChunkDemuxerTest, AppendWindow_Audio) {
AppendSingleStreamCluster(
kSourceId, kAudioTrackNum,
"360K 390K 420K 450K 480K 510K 540K 570K 600K 630K");
- CheckExpectedRanges(kSourceId, "{ [50,270) [360,630) }");
+ CheckExpectedRanges(kSourceId, "{ [50,280) [360,650) }");
}
TEST_F(ChunkDemuxerTest, AppendWindow_AudioOverlapStartAndEnd) {
@@ -3382,9 +3385,8 @@ TEST_F(ChunkDemuxerTest, AppendWindow_AudioOverlapStartAndEnd) {
// Append a cluster that starts before and ends after the append window.
AppendSingleStreamCluster(kSourceId, kAudioTrackNum, "0K");
- // Verify that everything is dropped in this case. No partial append should
- // be generated.
- CheckExpectedRanges(kSourceId, "{ }");
+ // Verify the append is clipped to the append window.
+ CheckExpectedRanges(kSourceId, "{ [10,20) }");
}
TEST_F(ChunkDemuxerTest, AppendWindow_WebMFile_AudioOnly) {

Powered by Google App Engine
This is Rietveld 408576698