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

Unified Diff: media/filters/video_frame_stream_unittest.cc

Issue 490033002: Don't try to decode more than one EOS at a time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add TODO for decoding_eos_ -> State. Created 6 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
« no previous file with comments | « media/filters/fake_video_decoder.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 96848e42cd5f56aac7c2d975a96e21a1fb4a84c8..e36172cf5986868a0165e3eba883b3e1e4fed147 100644
--- a/media/filters/video_frame_stream_unittest.cc
+++ b/media/filters/video_frame_stream_unittest.cc
@@ -372,6 +372,7 @@ INSTANTIATE_TEST_CASE_P(
VideoFrameStreamTestParams(false, 0, 1),
VideoFrameStreamTestParams(false, 3, 1),
VideoFrameStreamTestParams(false, 7, 1)));
+
INSTANTIATE_TEST_CASE_P(
Encrypted,
VideoFrameStreamTest,
@@ -488,8 +489,44 @@ TEST_P(VideoFrameStreamTest, Read_BlockedDemuxerAndDecoder) {
EXPECT_FALSE(pending_read_);
}
-// No Reset() before initialization is successfully completed.
+TEST_P(VideoFrameStreamTest, Read_DuringEndOfStreamDecode) {
+ // Test applies only when the decoder allows multiple parallel requests, and
+ // they are not satisfied in a single batch.
+ if (GetParam().parallel_decoding == 1 || GetParam().decoding_delay != 0)
xhwang 2014/08/27 22:32:51 For the record, we don't run the test when we have
+ return;
+
+ Initialize();
+ decoder_->HoldDecode();
+
+ // Read all of the frames up to end of stream. Since parallel decoding is
+ // enabled, the end of stream buffer will be sent to the decoder immediately,
+ // but we don't satisfy it yet.
+ for (int configuration = 0; configuration < kNumConfigs; configuration++) {
+ for (int frame = 0; frame < kNumBuffersInOneConfig; frame++) {
+ ReadOneFrame();
+ while (pending_read_) {
+ decoder_->SatisfySingleDecode();
+ message_loop_.RunUntilIdle();
+ }
+ }
+ }
+
+ // Read() again. The callback must be delayed until the decode completes.
+ ReadOneFrame();
+ ASSERT_TRUE(pending_read_);
+
+ // Satisfy decoding of the end of stream buffer. The read should complete.
+ decoder_->SatisfySingleDecode();
+ message_loop_.RunUntilIdle();
+ ASSERT_FALSE(pending_read_);
+ EXPECT_EQ(last_read_status_, VideoFrameStream::OK);
+ // The read output should indicate end of stream.
+ ASSERT_TRUE(frame_read_.get());
+ EXPECT_TRUE(frame_read_->end_of_stream());
+}
+
+// No Reset() before initialization is successfully completed.
TEST_P(VideoFrameStreamTest, Reset_AfterInitialization) {
Initialize();
Reset();
« no previous file with comments | « media/filters/fake_video_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698