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

Side by Side Diff: media/filters/ffmpeg_demuxer_unittest.cc

Issue 113611: Handle end of stream for media... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <deque> 5 #include <deque>
6 6
7 #include "base/singleton.h" 7 #include "base/singleton.h"
8 #include "base/tuple.h" 8 #include "base/tuple.h"
9 #include "media/base/filter_host.h" 9 #include "media/base/filter_host.h"
10 #include "media/base/filters.h" 10 #include "media/base/filters.h"
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after
613 //---------------------------------------------------------------------------- 613 //----------------------------------------------------------------------------
614 // End of stream tests. 614 // End of stream tests.
615 615
616 // Simulate end of stream. 616 // Simulate end of stream.
617 g_av_read_frame = AVERROR_IO; 617 g_av_read_frame = AVERROR_IO;
618 618
619 // Attempt a read from the audio stream and run the message loop until done. 619 // Attempt a read from the audio stream and run the message loop until done.
620 reader = new TestReader(); 620 reader = new TestReader();
621 reader->Read(audio_stream); 621 reader->Read(audio_stream);
622 pipeline_->RunAllTasks(); 622 pipeline_->RunAllTasks();
623 EXPECT_FALSE(reader->WaitForRead()); 623 EXPECT_TRUE(reader->WaitForRead());
624 EXPECT_FALSE(reader->called()); 624 EXPECT_TRUE(reader->called());
625 EXPECT_FALSE(reader->buffer()); 625 ASSERT_TRUE(reader->buffer());
626 EXPECT_TRUE(reader->buffer()->IsEndOfStream());
626 627
627 // Manually release buffer, which should release any remaining AVPackets. 628 // Manually release buffer, which should release any remaining AVPackets.
628 reader = NULL; 629 reader = NULL;
629 EXPECT_TRUE(PacketQueue::get()->WaitForOutstandingPackets(0)); 630 EXPECT_TRUE(PacketQueue::get()->WaitForOutstandingPackets(0));
630 } 631 }
631 632
632 // This tests our deep-copying workaround for FFmpeg's MP3 demuxer. When we fix 633 // This tests our deep-copying workaround for FFmpeg's MP3 demuxer. When we fix
633 // the root cause this test will fail and should be removed. 634 // the root cause this test will fail and should be removed.
634 TEST_F(FFmpegDemuxerTest, MP3Hack) { 635 TEST_F(FFmpegDemuxerTest, MP3Hack) {
635 // Prepare some test data. 636 // Prepare some test data.
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
677 EXPECT_TRUE(PacketQueue::get()->WaitForOutstandingPackets(0)); 678 EXPECT_TRUE(PacketQueue::get()->WaitForOutstandingPackets(0));
678 EXPECT_EQ(1, g_outstanding_packets_av_new_frame); 679 EXPECT_EQ(1, g_outstanding_packets_av_new_frame);
679 680
680 // Now release our reference, which should destruct the packet allocated by 681 // Now release our reference, which should destruct the packet allocated by
681 // av_new_packet(). 682 // av_new_packet().
682 reader = NULL; 683 reader = NULL;
683 EXPECT_EQ(0, g_outstanding_packets_av_new_frame); 684 EXPECT_EQ(0, g_outstanding_packets_av_new_frame);
684 } 685 }
685 686
686 } // namespace 687 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698