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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "base/synchronization/condition_variable.h" | 43 #include "base/synchronization/condition_variable.h" |
44 #include "base/synchronization/lock.h" | 44 #include "base/synchronization/lock.h" |
45 #include "base/synchronization/waitable_event.h" | 45 #include "base/synchronization/waitable_event.h" |
46 #include "base/thread_task_runner_handle.h" | 46 #include "base/thread_task_runner_handle.h" |
47 #include "base/threading/thread.h" | 47 #include "base/threading/thread.h" |
48 #include "build/build_config.h" | 48 #include "build/build_config.h" |
49 #include "content/common/gpu/media/fake_video_decode_accelerator.h" | 49 #include "content/common/gpu/media/fake_video_decode_accelerator.h" |
50 #include "content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h" | 50 #include "content/common/gpu/media/gpu_video_decode_accelerator_factory_impl.h" |
51 #include "content/common/gpu/media/rendering_helper.h" | 51 #include "content/common/gpu/media/rendering_helper.h" |
52 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h" | 52 #include "content/common/gpu/media/video_accelerator_unittest_helpers.h" |
53 #include "gpu/command_buffer/service/gpu_preferences.h" | |
54 #include "media/filters/h264_parser.h" | 53 #include "media/filters/h264_parser.h" |
55 #include "testing/gtest/include/gtest/gtest.h" | 54 #include "testing/gtest/include/gtest/gtest.h" |
56 #include "ui/gfx/codec/png_codec.h" | 55 #include "ui/gfx/codec/png_codec.h" |
57 #include "ui/gl/gl_image.h" | 56 #include "ui/gl/gl_image.h" |
58 | 57 |
59 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
60 #include "base/win/windows_version.h" | 59 #include "base/win/windows_version.h" |
61 #include "content/common/gpu/media/dxva_video_decode_accelerator_win.h" | 60 #include "content/common/gpu/media/dxva_video_decode_accelerator_win.h" |
62 #elif defined(OS_CHROMEOS) | 61 #elif defined(OS_CHROMEOS) |
63 #if defined(USE_V4L2_CODEC) | 62 #if defined(USE_V4L2_CODEC) |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 } else { | 523 } else { |
525 if (!vda_factory_) { | 524 if (!vda_factory_) { |
526 vda_factory_ = GpuVideoDecodeAcceleratorFactoryImpl::Create( | 525 vda_factory_ = GpuVideoDecodeAcceleratorFactoryImpl::Create( |
527 base::Bind(&RenderingHelper::GetGLContext, | 526 base::Bind(&RenderingHelper::GetGLContext, |
528 base::Unretained(rendering_helper_)), | 527 base::Unretained(rendering_helper_)), |
529 base::Bind(&DoNothingReturnTrue), base::Bind(&DummyBindImage)); | 528 base::Bind(&DoNothingReturnTrue), base::Bind(&DummyBindImage)); |
530 LOG_ASSERT(vda_factory_); | 529 LOG_ASSERT(vda_factory_); |
531 } | 530 } |
532 | 531 |
533 VideoDecodeAccelerator::Config config(profile_); | 532 VideoDecodeAccelerator::Config config(profile_); |
534 gpu::GpuPreferences gpu_preferences; | 533 decoder_ = vda_factory_->CreateVDA(this, config); |
535 decoder_ = vda_factory_->CreateVDA(this, config, gpu_preferences); | |
536 } | 534 } |
537 | 535 |
538 LOG_ASSERT(decoder_) << "Failed creating a VDA"; | 536 LOG_ASSERT(decoder_) << "Failed creating a VDA"; |
539 | 537 |
540 decoder_->TryToSetupDecodeOnSeparateThread( | 538 decoder_->TryToSetupDecodeOnSeparateThread( |
541 weak_this_, base::ThreadTaskRunnerHandle::Get()); | 539 weak_this_, base::ThreadTaskRunnerHandle::Get()); |
542 | 540 |
543 SetState(CS_DECODER_SET); | 541 SetState(CS_DECODER_SET); |
544 FinishInitialization(); | 542 FinishInitialization(); |
545 } | 543 } |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1579 content::VaapiWrapper::PreSandboxInitialization(); | 1577 content::VaapiWrapper::PreSandboxInitialization(); |
1580 #endif | 1578 #endif |
1581 | 1579 |
1582 content::g_env = | 1580 content::g_env = |
1583 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( | 1581 reinterpret_cast<content::VideoDecodeAcceleratorTestEnvironment*>( |
1584 testing::AddGlobalTestEnvironment( | 1582 testing::AddGlobalTestEnvironment( |
1585 new content::VideoDecodeAcceleratorTestEnvironment())); | 1583 new content::VideoDecodeAcceleratorTestEnvironment())); |
1586 | 1584 |
1587 return RUN_ALL_TESTS(); | 1585 return RUN_ALL_TESTS(); |
1588 } | 1586 } |
OLD | NEW |