| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #define _CRT_SECURE_NO_WARNINGS | 5 #define _CRT_SECURE_NO_WARNINGS |
| 6 | 6 |
| 7 #if 0 | 7 #if 0 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 EXPECT_EQ(kBufferCount, static_cast<int>(input_units_.size())); | 411 EXPECT_EQ(kBufferCount, static_cast<int>(input_units_.size())); |
| 412 EXPECT_EQ(kBufferCount, static_cast<int>(output_units_.size())); | 412 EXPECT_EQ(kBufferCount, static_cast<int>(output_units_.size())); |
| 413 EXPECT_EQ(count, static_cast<int>(output_pool_.size())); | 413 EXPECT_EQ(count, static_cast<int>(output_pool_.size())); |
| 414 output_units_.clear(); | 414 output_units_.clear(); |
| 415 | 415 |
| 416 // Send EndOfStream, expect eos flag. | 416 // Send EndOfStream, expect eos flag. |
| 417 SendEOSInputBuffer(); | 417 SendEOSInputBuffer(); |
| 418 EXPECT_EQ(kBufferCount - 1, static_cast<int>(input_units_.size())); | 418 EXPECT_EQ(kBufferCount - 1, static_cast<int>(input_units_.size())); |
| 419 EXPECT_EQ(1, static_cast<int>(output_units_.size())); | 419 EXPECT_EQ(1, static_cast<int>(output_units_.size())); |
| 420 EXPECT_EQ(count - 1, static_cast<int>(output_pool_.size())); | 420 EXPECT_EQ(count - 1, static_cast<int>(output_pool_.size())); |
| 421 EXPECT_EQ(true, got_eos_); | 421 EXPECT_TRUE(got_eos_); |
| 422 | 422 |
| 423 // Shutdown. | 423 // Shutdown. |
| 424 ExpectStop(); | 424 ExpectStop(); |
| 425 omx_engine_->Stop(stop_task_.CreateTask()); | 425 omx_engine_->Stop(stop_task_.CreateTask()); |
| 426 message_loop_.RunAllPending(); | 426 message_loop_.RunAllPending(); |
| 427 } | 427 } |
| 428 | 428 |
| 429 TEST_F(OmxCodecTest, RecycleInputBuffers) { | 429 TEST_F(OmxCodecTest, RecycleInputBuffers) { |
| 430 ExpectSettings(); | 430 ExpectSettings(); |
| 431 ExpectStart(); | 431 ExpectStart(); |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 463 EXPECT_EQ(kBufferCount, static_cast<int>(input_units_.size())); | 463 EXPECT_EQ(kBufferCount, static_cast<int>(input_units_.size())); |
| 464 EXPECT_EQ(repeat_count, static_cast<int>(output_units_.size())); | 464 EXPECT_EQ(repeat_count, static_cast<int>(output_units_.size())); |
| 465 EXPECT_EQ(count, static_cast<int>(output_pool_.size())); | 465 EXPECT_EQ(count, static_cast<int>(output_pool_.size())); |
| 466 output_units_.clear(); | 466 output_units_.clear(); |
| 467 | 467 |
| 468 // Send EndOfStream, expect eos flag. | 468 // Send EndOfStream, expect eos flag. |
| 469 SendEOSInputBuffer(); | 469 SendEOSInputBuffer(); |
| 470 EXPECT_EQ(kBufferCount - 1, static_cast<int>(input_units_.size())); | 470 EXPECT_EQ(kBufferCount - 1, static_cast<int>(input_units_.size())); |
| 471 EXPECT_EQ(1, static_cast<int>(output_units_.size())); | 471 EXPECT_EQ(1, static_cast<int>(output_units_.size())); |
| 472 EXPECT_EQ(count - 1, static_cast<int>(output_pool_.size())); | 472 EXPECT_EQ(count - 1, static_cast<int>(output_pool_.size())); |
| 473 EXPECT_EQ(true, got_eos_); | 473 EXPECT_TRUE(got_eos_); |
| 474 | 474 |
| 475 // Shutdown. | 475 // Shutdown. |
| 476 ExpectStop(); | 476 ExpectStop(); |
| 477 omx_engine_->Stop(stop_task_.CreateTask()); | 477 omx_engine_->Stop(stop_task_.CreateTask()); |
| 478 message_loop_.RunAllPending(); | 478 message_loop_.RunAllPending(); |
| 479 } | 479 } |
| 480 | 480 |
| 481 // TODO(hclam): Add test case for dynamic port config. | 481 // TODO(hclam): Add test case for dynamic port config. |
| 482 // TODO(hclam): Create a more complicated test case so that read | 482 // TODO(hclam): Create a more complicated test case so that read |
| 483 // requests and reply from FillThisBuffer() arrives out of order. | 483 // requests and reply from FillThisBuffer() arrives out of order. |
| 484 | 484 |
| 485 } // namespace media | 485 } // namespace media |
| 486 #endif | 486 #endif |
| OLD | NEW |