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 22 matching lines...) Expand all Loading... |
33 #include "base/stl_util.h" | 33 #include "base/stl_util.h" |
34 #include "base/string_number_conversions.h" | 34 #include "base/string_number_conversions.h" |
35 #include "base/string_split.h" | 35 #include "base/string_split.h" |
36 #include "base/stringize_macros.h" | 36 #include "base/stringize_macros.h" |
37 #include "base/synchronization/condition_variable.h" | 37 #include "base/synchronization/condition_variable.h" |
38 #include "base/synchronization/lock.h" | 38 #include "base/synchronization/lock.h" |
39 #include "base/synchronization/waitable_event.h" | 39 #include "base/synchronization/waitable_event.h" |
40 #include "base/threading/thread.h" | 40 #include "base/threading/thread.h" |
41 #include "base/utf_string_conversions.h" | 41 #include "base/utf_string_conversions.h" |
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 | 44 |
44 #if defined(OS_WIN) | 45 #if defined(OS_WIN) |
45 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 46 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
46 #elif defined(OS_MACOSX) | 47 #elif defined(OS_MACOSX) |
47 #include "content/common/gpu/media/mac_video_decode_accelerator.h" | 48 #include "content/common/gpu/media/mac_video_decode_accelerator.h" |
48 #elif defined(ARCH_CPU_X86_FAMILY) | 49 #elif defined(ARCH_CPU_X86_FAMILY) |
49 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 50 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
50 #elif defined(ARCH_CPU_ARMEL) | 51 #elif defined(ARCH_CPU_ARMEL) |
| 52 #include "content/common/gpu/media/exynos_video_decode_accelerator.h" |
51 #include "content/common/gpu/media/omx_video_decode_accelerator.h" | 53 #include "content/common/gpu/media/omx_video_decode_accelerator.h" |
52 #else | 54 #else |
53 #error The VideoAccelerator tests are not supported on this platform. | 55 #error The VideoAccelerator tests are not supported on this platform. |
54 #endif // defined(OS_WIN) | 56 #endif // defined(OS_WIN) |
55 | 57 |
56 using media::VideoDecodeAccelerator; | 58 using media::VideoDecodeAccelerator; |
57 | 59 |
58 namespace content { | 60 namespace content { |
59 namespace { | 61 namespace { |
60 | 62 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 void GLRenderingVDAClient::CreateDecoder() { | 319 void GLRenderingVDAClient::CreateDecoder() { |
318 CHECK(decoder_deleted()); | 320 CHECK(decoder_deleted()); |
319 CHECK(!decoder_.get()); | 321 CHECK(!decoder_.get()); |
320 #if defined(OS_WIN) | 322 #if defined(OS_WIN) |
321 decoder_.reset(new DXVAVideoDecodeAccelerator( | 323 decoder_.reset(new DXVAVideoDecodeAccelerator( |
322 this, base::Bind(&DoNothingReturnTrue))); | 324 this, base::Bind(&DoNothingReturnTrue))); |
323 #elif defined(OS_MACOSX) | 325 #elif defined(OS_MACOSX) |
324 decoder_.reset(new MacVideoDecodeAccelerator( | 326 decoder_.reset(new MacVideoDecodeAccelerator( |
325 static_cast<CGLContextObj>(rendering_helper_->GetGLContext()), this)); | 327 static_cast<CGLContextObj>(rendering_helper_->GetGLContext()), this)); |
326 #elif defined(ARCH_CPU_ARMEL) | 328 #elif defined(ARCH_CPU_ARMEL) |
327 decoder_.reset( | 329 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseExynosVda)) { |
328 new OmxVideoDecodeAccelerator( | 330 decoder_.reset( |
329 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), | 331 new ExynosVideoDecodeAccelerator( |
330 static_cast<EGLContext>(rendering_helper_->GetGLContext()), | 332 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), |
331 this, | 333 static_cast<EGLContext>(rendering_helper_->GetGLContext()), |
332 base::Bind(&DoNothingReturnTrue))); | 334 this, base::Bind(&DoNothingReturnTrue))); |
| 335 } else { |
| 336 decoder_.reset( |
| 337 new OmxVideoDecodeAccelerator( |
| 338 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), |
| 339 static_cast<EGLContext>(rendering_helper_->GetGLContext()), |
| 340 this, base::Bind(&DoNothingReturnTrue))); |
| 341 } |
333 #elif defined(ARCH_CPU_X86_FAMILY) | 342 #elif defined(ARCH_CPU_X86_FAMILY) |
334 decoder_.reset(new VaapiVideoDecodeAccelerator( | 343 decoder_.reset(new VaapiVideoDecodeAccelerator( |
335 static_cast<Display*>(rendering_helper_->GetGLDisplay()), | 344 static_cast<Display*>(rendering_helper_->GetGLDisplay()), |
336 static_cast<GLXContext>(rendering_helper_->GetGLContext()), | 345 static_cast<GLXContext>(rendering_helper_->GetGLContext()), |
337 this, base::Bind(&DoNothingReturnTrue))); | 346 this, base::Bind(&DoNothingReturnTrue))); |
338 #endif // OS_WIN | 347 #endif // OS_WIN |
339 CHECK(decoder_.get()); | 348 CHECK(decoder_.get()); |
340 SetState(CS_DECODER_SET); | 349 SetState(CS_DECODER_SET); |
341 if (decoder_deleted()) | 350 if (decoder_deleted()) |
342 return; | 351 return; |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
876 | 885 |
877 CommandLine::SwitchMap switches = cmd_line->GetSwitches(); | 886 CommandLine::SwitchMap switches = cmd_line->GetSwitches(); |
878 for (CommandLine::SwitchMap::const_iterator it = switches.begin(); | 887 for (CommandLine::SwitchMap::const_iterator it = switches.begin(); |
879 it != switches.end(); ++it) { | 888 it != switches.end(); ++it) { |
880 if (it->first == "test_video_data") { | 889 if (it->first == "test_video_data") { |
881 content::test_video_data = it->second.c_str(); | 890 content::test_video_data = it->second.c_str(); |
882 continue; | 891 continue; |
883 } | 892 } |
884 if (it->first == "v" || it->first == "vmodule") | 893 if (it->first == "v" || it->first == "vmodule") |
885 continue; | 894 continue; |
| 895 if (it->first == switches::kUseExynosVda) |
| 896 continue; |
886 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 897 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
887 } | 898 } |
888 | 899 |
889 base::ShadowingAtExitManager at_exit_manager; | 900 base::ShadowingAtExitManager at_exit_manager; |
890 content::RenderingHelper::InitializePlatform(); | 901 content::RenderingHelper::InitializePlatform(); |
891 | 902 |
892 #if defined(OS_WIN) | 903 #if defined(OS_WIN) |
893 content::DXVAVideoDecodeAccelerator::PreSandboxInitialization(); | 904 content::DXVAVideoDecodeAccelerator::PreSandboxInitialization(); |
894 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 905 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
895 content::OmxVideoDecodeAccelerator::PreSandboxInitialization(); | 906 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseExynosVda)) |
| 907 content::ExynosVideoDecodeAccelerator::PreSandboxInitialization(); |
| 908 else |
| 909 content::OmxVideoDecodeAccelerator::PreSandboxInitialization(); |
896 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 910 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
897 content::VaapiVideoDecodeAccelerator::PreSandboxInitialization(); | 911 content::VaapiVideoDecodeAccelerator::PreSandboxInitialization(); |
898 #endif | 912 #endif |
899 | 913 |
900 return RUN_ALL_TESTS(); | 914 return RUN_ALL_TESTS(); |
901 } | 915 } |
OLD | NEW |