OLD | NEW |
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/thread.h" | 7 #include "base/thread.h" |
8 #include "media/base/filters.h" | 8 #include "media/base/filters.h" |
9 #include "media/base/mock_ffmpeg.h" | 9 #include "media/base/mock_ffmpeg.h" |
10 #include "media/base/mock_filter_host.h" | 10 #include "media/base/mock_filter_host.h" |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 | 389 |
390 // We should now expect an end of stream buffer in both the audio and video | 390 // We should now expect an end of stream buffer in both the audio and video |
391 // streams. | 391 // streams. |
392 | 392 |
393 // Attempt a read from the audio stream and run the message loop until done. | 393 // Attempt a read from the audio stream and run the message loop until done. |
394 reader->Read(audio); | 394 reader->Read(audio); |
395 message_loop_.RunAllPending(); | 395 message_loop_.RunAllPending(); |
396 EXPECT_TRUE(reader->called()); | 396 EXPECT_TRUE(reader->called()); |
397 ASSERT_TRUE(reader->buffer()); | 397 ASSERT_TRUE(reader->buffer()); |
398 EXPECT_TRUE(reader->buffer()->IsEndOfStream()); | 398 EXPECT_TRUE(reader->buffer()->IsEndOfStream()); |
399 EXPECT_TRUE(NULL == reader->buffer()->GetData()); | 399 EXPECT_EQ(NULL, reader->buffer()->GetData()); |
400 EXPECT_EQ(0u, reader->buffer()->GetDataSize()); | 400 EXPECT_EQ(0u, reader->buffer()->GetDataSize()); |
401 | 401 |
402 // Manually release buffer, which should release any remaining AVPackets. | 402 // Manually release buffer, which should release any remaining AVPackets. |
403 reader->Reset(); | 403 reader->Reset(); |
404 message_loop_.RunAllPending(); | 404 message_loop_.RunAllPending(); |
405 MockFFmpeg::get()->CheckPoint(5); | 405 MockFFmpeg::get()->CheckPoint(5); |
406 | 406 |
407 // Attempt a read from the audio stream and run the message loop until done. | 407 // Attempt a read from the audio stream and run the message loop until done. |
408 reader->Read(video); | 408 reader->Read(video); |
409 message_loop_.RunAllPending(); | 409 message_loop_.RunAllPending(); |
410 EXPECT_TRUE(reader->called()); | 410 EXPECT_TRUE(reader->called()); |
411 ASSERT_TRUE(reader->buffer()); | 411 ASSERT_TRUE(reader->buffer()); |
412 EXPECT_TRUE(reader->buffer()->IsEndOfStream()); | 412 EXPECT_TRUE(reader->buffer()->IsEndOfStream()); |
413 EXPECT_TRUE(NULL == reader->buffer()->GetData()); | 413 EXPECT_EQ(NULL, reader->buffer()->GetData()); |
414 EXPECT_EQ(0u, reader->buffer()->GetDataSize()); | 414 EXPECT_EQ(0u, reader->buffer()->GetDataSize()); |
415 | 415 |
416 // Manually release buffer, which should release any remaining AVPackets. | 416 // Manually release buffer, which should release any remaining AVPackets. |
417 reader->Reset(); | 417 reader->Reset(); |
418 message_loop_.RunAllPending(); | 418 message_loop_.RunAllPending(); |
419 MockFFmpeg::get()->CheckPoint(6); | 419 MockFFmpeg::get()->CheckPoint(6); |
420 } | 420 } |
421 | 421 |
422 TEST_F(FFmpegDemuxerTest, Seek) { | 422 TEST_F(FFmpegDemuxerTest, Seek) { |
423 // We're testing the following: | 423 // We're testing the following: |
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 { | 798 { |
799 SCOPED_TRACE(""); | 799 SCOPED_TRACE(""); |
800 InitializeDemuxer(); | 800 InitializeDemuxer(); |
801 } | 801 } |
802 EXPECT_CALL(*data_source_, IsStreaming()) | 802 EXPECT_CALL(*data_source_, IsStreaming()) |
803 .WillOnce(Return(false)); | 803 .WillOnce(Return(false)); |
804 EXPECT_FALSE(demuxer_->IsStreaming()); | 804 EXPECT_FALSE(demuxer_->IsStreaming()); |
805 } | 805 } |
806 | 806 |
807 } // namespace media | 807 } // namespace media |
OLD | NEW |