| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // The bulk of this file is support code; sorry about that. Here's an overview | 5 // The bulk of this file is support code; sorry about that. Here's an overview |
| 6 // to hopefully help readers of this code: | 6 // to hopefully help readers of this code: |
| 7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or | 7 // - RenderingHelper is charged with interacting with X11/{EGL/GLES2,GLX/GL} or |
| 8 // Win/EGL. | 8 // Win/EGL. |
| 9 // - ClientState is an enum for the state of the decode client used by the test. | 9 // - ClientState is an enum for the state of the decode client used by the test. |
| 10 // - ClientStateNotification is a barrier abstraction that allows the test code | 10 // - ClientStateNotification is a barrier abstraction that allows the test code |
| (...skipping 1475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1486 // allowed to finish. | 1486 // allowed to finish. |
| 1487 if (g_output_log != NULL && delete_decoder_state >= CS_FLUSHED) { | 1487 if (g_output_log != NULL && delete_decoder_state >= CS_FLUSHED) { |
| 1488 base::File output_file( | 1488 base::File output_file( |
| 1489 base::FilePath(g_output_log), | 1489 base::FilePath(g_output_log), |
| 1490 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); | 1490 base::File::FLAG_CREATE_ALWAYS | base::File::FLAG_WRITE); |
| 1491 for (size_t i = 0; i < num_concurrent_decoders; ++i) { | 1491 for (size_t i = 0; i < num_concurrent_decoders; ++i) { |
| 1492 clients[i]->OutputFrameDeliveryTimes(&output_file); | 1492 clients[i]->OutputFrameDeliveryTimes(&output_file); |
| 1493 } | 1493 } |
| 1494 } | 1494 } |
| 1495 | 1495 |
| 1496 std::unique_ptr<ClientsVector> clients2(new ClientsVector); |
| 1497 clients2->swap(clients); |
| 1496 std::unique_ptr<NotesVector> notes2(new NotesVector); | 1498 std::unique_ptr<NotesVector> notes2(new NotesVector); |
| 1497 notes2->swap(notes); | 1499 notes2->swap(notes); |
| 1498 std::unique_ptr<ClientsVector> clients2(new ClientsVector); | 1500 |
| 1499 clients2->swap(clients); | 1501 // |clients| must be deleted first because |clients| use |notes2|. |
| 1502 g_env->GetRenderingTaskRunner()->PostTask( |
| 1503 FROM_HERE, base::Bind(&Delete<ClientsVector>, base::Passed(&clients2))); |
| 1500 | 1504 |
| 1501 g_env->GetRenderingTaskRunner()->PostTask( | 1505 g_env->GetRenderingTaskRunner()->PostTask( |
| 1502 FROM_HERE, base::Bind(&Delete<NotesVector>, base::Passed(¬es2))); | 1506 FROM_HERE, base::Bind(&Delete<NotesVector>, base::Passed(¬es2))); |
| 1503 | 1507 |
| 1504 g_env->GetRenderingTaskRunner()->PostTask( | |
| 1505 FROM_HERE, base::Bind(&Delete<ClientsVector>, base::Passed(&clients2))); | |
| 1506 | |
| 1507 WaitUntilIdle(); | 1508 WaitUntilIdle(); |
| 1508 }; | 1509 }; |
| 1509 | 1510 |
| 1510 // Test that replay after EOS works fine. | 1511 // Test that replay after EOS works fine. |
| 1511 INSTANTIATE_TEST_CASE_P( | 1512 INSTANTIATE_TEST_CASE_P( |
| 1512 ReplayAfterEOS, | 1513 ReplayAfterEOS, |
| 1513 VideoDecodeAcceleratorParamTest, | 1514 VideoDecodeAcceleratorParamTest, |
| 1514 ::testing::Values( | 1515 ::testing::Values( |
| 1515 std::make_tuple(1, 1, 4, END_OF_STREAM_RESET, CS_RESET, false, false))); | 1516 std::make_tuple(1, 1, 4, END_OF_STREAM_RESET, CS_RESET, false, false))); |
| 1516 | 1517 |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1793 media::VaapiWrapper::PreSandboxInitialization(); | 1794 media::VaapiWrapper::PreSandboxInitialization(); |
| 1794 #endif | 1795 #endif |
| 1795 | 1796 |
| 1796 media::g_env = | 1797 media::g_env = |
| 1797 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>( | 1798 reinterpret_cast<media::VideoDecodeAcceleratorTestEnvironment*>( |
| 1798 testing::AddGlobalTestEnvironment( | 1799 testing::AddGlobalTestEnvironment( |
| 1799 new media::VideoDecodeAcceleratorTestEnvironment())); | 1800 new media::VideoDecodeAcceleratorTestEnvironment())); |
| 1800 | 1801 |
| 1801 return RUN_ALL_TESTS(); | 1802 return RUN_ALL_TESTS(); |
| 1802 } | 1803 } |
| OLD | NEW |