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

Unified Diff: media/filters/chunk_demuxer_unittest.cc

Issue 322273003: MSE: On init segment received, set need random access point flag on all track buffers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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/chunk_demuxer.cc ('k') | media/filters/frame_processor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/chunk_demuxer_unittest.cc
diff --git a/media/filters/chunk_demuxer_unittest.cc b/media/filters/chunk_demuxer_unittest.cc
index 56c9ae57a039eba7544a15d21e0a330a7ab3056b..294d7692535b9f9a7ae0b78c969a4cce7811867b 100644
--- a/media/filters/chunk_demuxer_unittest.cc
+++ b/media/filters/chunk_demuxer_unittest.cc
@@ -1223,6 +1223,41 @@ TEST_P(ChunkDemuxerTest, SingleTextTrackIdChange) {
ShutdownDemuxer();
}
+TEST_P(ChunkDemuxerTest, InitSegmentSetsNeedRandomAccessPointFlag) {
+ // Tests that non-keyframes following an init segment are allowed
+ // and dropped, as expected if the initialization segment received
+ // algorithm correctly sets the needs random access point flag to true for all
+ // track buffers. Note that the first initialization segment is insufficient
+ // to fully test this since needs random access point flag initializes to
+ // true.
+ CreateNewDemuxer();
+ DemuxerStream* text_stream = NULL;
+ EXPECT_CALL(host_, AddTextStream(_, _))
+ .WillOnce(SaveArg<0>(&text_stream));
+ ASSERT_TRUE(InitDemuxerWithEncryptionInfo(
+ HAS_TEXT | HAS_AUDIO | HAS_VIDEO, false, false));
+ DemuxerStream* audio_stream = demuxer_->GetStream(DemuxerStream::AUDIO);
+ DemuxerStream* video_stream = demuxer_->GetStream(DemuxerStream::VIDEO);
+ ASSERT_TRUE(audio_stream && video_stream && text_stream);
+
+ AppendSingleStreamCluster(kSourceId, kAudioTrackNum, "0 23K");
+ AppendSingleStreamCluster(kSourceId, kVideoTrackNum, "0 30K");
+ AppendSingleStreamCluster(kSourceId, kTextTrackNum, "0 40K");
+ CheckExpectedRanges(kSourceId, "{ [30,46) }");
+
+ AppendInitSegment(HAS_TEXT | HAS_AUDIO | HAS_VIDEO);
+ AppendSingleStreamCluster(kSourceId, kAudioTrackNum, "46 69K");
+ AppendSingleStreamCluster(kSourceId, kVideoTrackNum, "60 90K");
+ AppendSingleStreamCluster(kSourceId, kTextTrackNum, "80 90K");
+ CheckExpectedRanges(kSourceId, "{ [30,92) }");
+
+ CheckExpectedBuffers(audio_stream, "23 69");
+ CheckExpectedBuffers(video_stream, "30 90");
+
+ // WebM parser marks all text buffers as keyframes.
+ CheckExpectedBuffers(text_stream, "0 40 80 90");
+}
+
// Make sure that the demuxer reports an error if Shutdown()
// is called before all the initialization segments are appended.
TEST_P(ChunkDemuxerTest, Shutdown_BeforeAllInitSegmentsAppended) {
« no previous file with comments | « media/filters/chunk_demuxer.cc ('k') | media/filters/frame_processor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698