Chromium Code Reviews| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 42 #include "content/common/gpu/media/rendering_helper.h" | 42 #include "content/common/gpu/media/rendering_helper.h" |
| 43 #include "content/public/common/content_switches.h" | 43 #include "content/public/common/content_switches.h" |
| 44 | 44 |
| 45 #if defined(OS_WIN) | 45 #if defined(OS_WIN) |
| 46 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 46 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
| 47 #elif defined(OS_MACOSX) | 47 #elif defined(OS_MACOSX) |
| 48 #include "content/common/gpu/media/mac_video_decode_accelerator.h" | 48 #include "content/common/gpu/media/mac_video_decode_accelerator.h" |
| 49 #elif defined(OS_CHROMEOS) | 49 #elif defined(OS_CHROMEOS) |
| 50 #if defined(ARCH_CPU_ARMEL) | 50 #if defined(ARCH_CPU_ARMEL) |
| 51 #include "content/common/gpu/media/exynos_video_decode_accelerator.h" | 51 #include "content/common/gpu/media/exynos_video_decode_accelerator.h" |
| 52 #include "content/common/gpu/media/omx_video_decode_accelerator.h" | |
| 53 #elif defined(ARCH_CPU_X86_FAMILY) | 52 #elif defined(ARCH_CPU_X86_FAMILY) |
| 54 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 53 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
| 55 #endif // ARCH_CPU_ARMEL | 54 #endif // ARCH_CPU_ARMEL |
| 56 #else | 55 #else |
| 57 #error The VideoAccelerator tests are not supported on this platform. | 56 #error The VideoAccelerator tests are not supported on this platform. |
| 58 #endif // OS_WIN | 57 #endif // OS_WIN |
| 59 | 58 |
| 60 using media::VideoDecodeAccelerator; | 59 using media::VideoDecodeAccelerator; |
| 61 | 60 |
| 62 namespace content { | 61 namespace content { |
| (...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 369 CHECK(decoder_deleted()); | 368 CHECK(decoder_deleted()); |
| 370 CHECK(!decoder_.get()); | 369 CHECK(!decoder_.get()); |
| 371 #if defined(OS_WIN) | 370 #if defined(OS_WIN) |
| 372 decoder_.reset(new DXVAVideoDecodeAccelerator( | 371 decoder_.reset(new DXVAVideoDecodeAccelerator( |
| 373 this, base::Bind(&DoNothingReturnTrue))); | 372 this, base::Bind(&DoNothingReturnTrue))); |
| 374 #elif defined(OS_MACOSX) | 373 #elif defined(OS_MACOSX) |
| 375 decoder_.reset(new MacVideoDecodeAccelerator( | 374 decoder_.reset(new MacVideoDecodeAccelerator( |
| 376 static_cast<CGLContextObj>(rendering_helper_->GetGLContext()), this)); | 375 static_cast<CGLContextObj>(rendering_helper_->GetGLContext()), this)); |
| 377 #elif defined(OS_CHROMEOS) | 376 #elif defined(OS_CHROMEOS) |
| 378 #if defined(ARCH_CPU_ARMEL) | 377 #if defined(ARCH_CPU_ARMEL) |
| 379 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseExynosVda)) { | 378 decoder_.reset( |
|
yuli
2013/04/01 10:35:24
remove kUseExynosVda from content_switches.h?
| |
| 380 decoder_.reset( | 379 new ExynosVideoDecodeAccelerator( |
| 381 new ExynosVideoDecodeAccelerator( | 380 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), |
| 382 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), | 381 static_cast<EGLContext>(rendering_helper_->GetGLContext()), |
| 383 static_cast<EGLContext>(rendering_helper_->GetGLContext()), | 382 this, base::Bind(&DoNothingReturnTrue))); |
| 384 this, base::Bind(&DoNothingReturnTrue))); | |
| 385 } else { | |
| 386 decoder_.reset( | |
| 387 new OmxVideoDecodeAccelerator( | |
| 388 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), | |
| 389 static_cast<EGLContext>(rendering_helper_->GetGLContext()), | |
| 390 this, base::Bind(&DoNothingReturnTrue))); | |
| 391 } | |
| 392 #elif defined(ARCH_CPU_X86_FAMILY) | 383 #elif defined(ARCH_CPU_X86_FAMILY) |
| 393 decoder_.reset(new VaapiVideoDecodeAccelerator( | 384 decoder_.reset(new VaapiVideoDecodeAccelerator( |
| 394 static_cast<Display*>(rendering_helper_->GetGLDisplay()), | 385 static_cast<Display*>(rendering_helper_->GetGLDisplay()), |
| 395 static_cast<GLXContext>(rendering_helper_->GetGLContext()), | 386 static_cast<GLXContext>(rendering_helper_->GetGLContext()), |
| 396 this, base::Bind(&DoNothingReturnTrue))); | 387 this, base::Bind(&DoNothingReturnTrue))); |
| 397 #endif // ARCH_CPU_ARMEL | 388 #endif // ARCH_CPU_ARMEL |
| 398 #endif // OS_WIN | 389 #endif // OS_WIN |
| 399 CHECK(decoder_.get()); | 390 CHECK(decoder_.get()); |
| 400 SetState(CS_DECODER_SET); | 391 SetState(CS_DECODER_SET); |
| 401 if (decoder_deleted()) | 392 if (decoder_deleted()) |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 967 | 958 |
| 968 CommandLine::SwitchMap switches = cmd_line->GetSwitches(); | 959 CommandLine::SwitchMap switches = cmd_line->GetSwitches(); |
| 969 for (CommandLine::SwitchMap::const_iterator it = switches.begin(); | 960 for (CommandLine::SwitchMap::const_iterator it = switches.begin(); |
| 970 it != switches.end(); ++it) { | 961 it != switches.end(); ++it) { |
| 971 if (it->first == "test_video_data") { | 962 if (it->first == "test_video_data") { |
| 972 content::test_video_data = it->second.c_str(); | 963 content::test_video_data = it->second.c_str(); |
| 973 continue; | 964 continue; |
| 974 } | 965 } |
| 975 if (it->first == "v" || it->first == "vmodule") | 966 if (it->first == "v" || it->first == "vmodule") |
| 976 continue; | 967 continue; |
| 977 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | |
| 978 if (it->first == switches::kUseExynosVda) | |
| 979 continue; | |
| 980 #endif | |
| 981 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 968 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
| 982 } | 969 } |
| 983 | 970 |
| 984 base::ShadowingAtExitManager at_exit_manager; | 971 base::ShadowingAtExitManager at_exit_manager; |
| 985 content::RenderingHelper::InitializePlatform(); | 972 content::RenderingHelper::InitializePlatform(); |
| 986 | 973 |
| 987 #if defined(OS_WIN) | 974 #if defined(OS_WIN) |
| 988 content::DXVAVideoDecodeAccelerator::PreSandboxInitialization(); | 975 content::DXVAVideoDecodeAccelerator::PreSandboxInitialization(); |
| 989 #elif defined(OS_CHROMEOS) | 976 #elif defined(OS_CHROMEOS) |
| 990 #if defined(ARCH_CPU_ARMEL) | 977 #if defined(ARCH_CPU_ARMEL) |
| 991 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseExynosVda)) | 978 content::ExynosVideoDecodeAccelerator::PreSandboxInitialization(); |
| 992 content::ExynosVideoDecodeAccelerator::PreSandboxInitialization(); | |
| 993 else | |
| 994 content::OmxVideoDecodeAccelerator::PreSandboxInitialization(); | |
| 995 #elif defined(ARCH_CPU_X86_FAMILY) | 979 #elif defined(ARCH_CPU_X86_FAMILY) |
| 996 content::VaapiVideoDecodeAccelerator::PreSandboxInitialization(); | 980 content::VaapiVideoDecodeAccelerator::PreSandboxInitialization(); |
| 997 #endif // ARCH_CPU_ARMEL | 981 #endif // ARCH_CPU_ARMEL |
| 998 #endif // OS_CHROMEOS | 982 #endif // OS_CHROMEOS |
| 999 | 983 |
| 1000 return RUN_ALL_TESTS(); | 984 return RUN_ALL_TESTS(); |
| 1001 } | 985 } |
| OLD | NEW |