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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
640 GLRenderingVDAClient::~GLRenderingVDAClient() { | 640 GLRenderingVDAClient::~GLRenderingVDAClient() { |
641 DeleteDecoder(); // Clean up in case of expected error. | 641 DeleteDecoder(); // Clean up in case of expected error. |
642 LOG_ASSERT(decoder_deleted()); | 642 LOG_ASSERT(decoder_deleted()); |
643 SetState(CS_DESTROYED); | 643 SetState(CS_DESTROYED); |
644 } | 644 } |
645 | 645 |
646 void GLRenderingVDAClient::CreateAndStartDecoder() { | 646 void GLRenderingVDAClient::CreateAndStartDecoder() { |
647 LOG_ASSERT(decoder_deleted()); | 647 LOG_ASSERT(decoder_deleted()); |
648 LOG_ASSERT(!decoder_.get()); | 648 LOG_ASSERT(!decoder_.get()); |
649 | 649 |
| 650 VideoDecodeAccelerator::Config config(profile_); |
| 651 |
650 if (fake_decoder_) { | 652 if (fake_decoder_) { |
651 decoder_.reset(new FakeVideoDecodeAccelerator( | 653 decoder_.reset(new FakeVideoDecodeAccelerator( |
652 frame_size_, base::Bind(&DoNothingReturnTrue))); | 654 frame_size_, base::Bind(&DoNothingReturnTrue))); |
653 LOG_ASSERT(decoder_->Initialize(profile_, this)); | 655 LOG_ASSERT(decoder_->Initialize(config, this)); |
654 } else { | 656 } else { |
655 if (!vda_factory_) { | 657 if (!vda_factory_) { |
656 vda_factory_ = GpuVideoDecodeAcceleratorFactory::Create( | 658 vda_factory_ = GpuVideoDecodeAcceleratorFactory::Create( |
657 base::Bind(&RenderingHelper::GetGLContext, | 659 base::Bind(&RenderingHelper::GetGLContext, |
658 base::Unretained(rendering_helper_)), | 660 base::Unretained(rendering_helper_)), |
659 base::Bind(&DoNothingReturnTrue), base::Bind(&DummyBindImage)); | 661 base::Bind(&DoNothingReturnTrue), base::Bind(&DummyBindImage)); |
660 LOG_ASSERT(vda_factory_); | 662 LOG_ASSERT(vda_factory_); |
661 } | 663 } |
662 | 664 |
663 VideoDecodeAccelerator::Config config(profile_); | |
664 if (g_test_import) { | 665 if (g_test_import) { |
665 config.output_mode = VideoDecodeAccelerator::Config::OutputMode::IMPORT; | 666 config.output_mode = VideoDecodeAccelerator::Config::OutputMode::IMPORT; |
666 } | 667 } |
667 gpu::GpuDriverBugWorkarounds workarounds; | 668 gpu::GpuDriverBugWorkarounds workarounds; |
668 gpu::GpuPreferences gpu_preferences; | 669 gpu::GpuPreferences gpu_preferences; |
669 decoder_ = | 670 decoder_ = |
670 vda_factory_->CreateVDA(this, config, workarounds, gpu_preferences); | 671 vda_factory_->CreateVDA(this, config, workarounds, gpu_preferences); |
671 } | 672 } |
672 | 673 |
673 LOG_ASSERT(decoder_) << "Failed creating a VDA"; | 674 LOG_ASSERT(decoder_) << "Failed creating a VDA"; |
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1917 media::g_thumbnail_output_dir = base::FilePath(it->second.c_str()); | 1918 media::g_thumbnail_output_dir = base::FilePath(it->second.c_str()); |
1918 } | 1919 } |
1919 } | 1920 } |
1920 | 1921 |
1921 base::ShadowingAtExitManager at_exit_manager; | 1922 base::ShadowingAtExitManager at_exit_manager; |
1922 | 1923 |
1923 return base::LaunchUnitTestsSerially( | 1924 return base::LaunchUnitTestsSerially( |
1924 argc, argv, | 1925 argc, argv, |
1925 base::Bind(&media::VDATestSuite::Run, base::Unretained(&test_suite))); | 1926 base::Bind(&media::VDATestSuite::Run, base::Unretained(&test_suite))); |
1926 } | 1927 } |
OLD | NEW |