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

Unified Diff: media/filters/ffmpeg_video_decoder_unittest.cc

Issue 9667018: Make FFmpegVideoDecoder defer a flush until the pending read completes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix rebase build buster Created 8 years, 9 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/ffmpeg_video_decoder.cc ('k') | media/filters/pipeline_integration_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decoder_unittest.cc
diff --git a/media/filters/ffmpeg_video_decoder_unittest.cc b/media/filters/ffmpeg_video_decoder_unittest.cc
index 7818a94592bc80bc3b1c172e868b83b9632b9862..fa3d6f2df3cfaf1d3fb99a77a24f36c5e68bab7e 100644
--- a/media/filters/ffmpeg_video_decoder_unittest.cc
+++ b/media/filters/ffmpeg_video_decoder_unittest.cc
@@ -463,6 +463,32 @@ TEST_F(FFmpegVideoDecoderTest, Flush_EndOfStream) {
Flush();
}
+// Test flushing when there is a pending read on the demuxer.
+TEST_F(FFmpegVideoDecoderTest, Flush_DuringPendingRead) {
+ Initialize();
+
+ DemuxerStream::ReadCB read_cb;
+ EXPECT_CALL(*demuxer_, Read(_))
+ .WillOnce(SaveArg<0>(&read_cb));
+
+ decoder_->Read(read_cb_);
+ message_loop_.RunAllPending();
+
+ // Make sure the Read() on the decoder triggers a Read() on
+ // the demuxer.
+ EXPECT_FALSE(read_cb.is_null());
+
+ // Flush the decoder.
+ Flush();
+
+ EXPECT_CALL(*this, FrameReady(scoped_refptr<VideoFrame>()));
+
+ read_cb.Run(i_frame_buffer_);
+ message_loop_.RunAllPending();
+}
+
+
+
// Test seeking when decoder has initialized but not decoded.
TEST_F(FFmpegVideoDecoderTest, Seek_Initialized) {
Initialize();
« no previous file with comments | « media/filters/ffmpeg_video_decoder.cc ('k') | media/filters/pipeline_integration_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698