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

Unified Diff: media/filters/video_frame_stream_unittest.cc

Issue 1918693003: Fix EOS reached before decoder fallback (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
« no previous file with comments | « media/filters/decoder_stream.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_frame_stream_unittest.cc
diff --git a/media/filters/video_frame_stream_unittest.cc b/media/filters/video_frame_stream_unittest.cc
index 35120440aa35c33273d644efb9c14b672872a8cc..04fef03cb21a92ae62ac0b6a49b7bb66adad377a 100644
--- a/media/filters/video_frame_stream_unittest.cc
+++ b/media/filters/video_frame_stream_unittest.cc
@@ -768,6 +768,47 @@ TEST_P(VideoFrameStreamTest, FallbackDecoder_SelectedOnInitialDecodeError) {
ReadAllFrames();
}
+TEST_P(VideoFrameStreamTest, FallbackDecoder_EndOfStreamReachedBeforeFallback) {
+ // Only consider cases where there is a decoder delay. For test simplicity,
+ // omit the parallel case.
+ if (GetParam().decoding_delay == 0 || GetParam().parallel_decoding > 1)
+ return;
+
+ Initialize();
+ decoder1_->HoldDecode();
+ ReadOneFrame();
+
+ // One buffer should have already pulled from the demuxer stream. Set the next
+ // one to be an EOS.
+ demuxer_stream_->SeekToEndOfStream();
+
+ decoder1_->SatisfySingleDecode();
+ message_loop_.RunUntilIdle();
+
+ // |video_frame_stream_| should not have emited a frame.
+ EXPECT_TRUE(pending_read_);
+
+ // Pending buffers should contain a regular buffer and an EOS buffer.
+ EXPECT_EQ(video_frame_stream_->get_pending_buffers_size_for_testing(), 2);
+
+ decoder1_->SimulateError();
+ message_loop_.RunUntilIdle();
+
+ // A frame should have been emited
+ EXPECT_FALSE(pending_read_);
+ EXPECT_EQ(last_read_status_, VideoFrameStream::OK);
+ EXPECT_FALSE(
+ frame_read_->metadata()->IsTrue(VideoFrameMetadata::END_OF_STREAM));
+ EXPECT_GT(decoder2_->total_bytes_decoded(), 0);
+
+ ReadOneFrame();
+
+ EXPECT_FALSE(pending_read_);
+ EXPECT_EQ(0, video_frame_stream_->get_fallback_buffers_size_for_testing());
+ EXPECT_TRUE(
+ frame_read_->metadata()->IsTrue(VideoFrameMetadata::END_OF_STREAM));
+}
+
TEST_P(VideoFrameStreamTest,
FallbackDecoder_SelectedOnInitialDecodeError_Twice) {
Initialize();
« no previous file with comments | « media/filters/decoder_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698