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 30 matching lines...) Expand all Loading... |
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 | 43 |
44 #if defined(OS_WIN) | 44 #if defined(OS_WIN) |
45 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 45 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
46 #elif defined(OS_MACOSX) | 46 #elif defined(OS_MACOSX) |
47 #include "content/common/gpu/media/mac_video_decode_accelerator.h" | 47 #include "content/common/gpu/media/mac_video_decode_accelerator.h" |
48 #elif defined(ARCH_CPU_X86_FAMILY) | 48 #elif defined(ARCH_CPU_X86_FAMILY) |
49 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 49 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
50 #elif defined(ARCH_CPU_ARMEL) | 50 #elif defined(ARCH_CPU_ARMEL) |
| 51 #include "content/common/gpu/media/exynos_video_decode_accelerator.h" |
51 #include "content/common/gpu/media/omx_video_decode_accelerator.h" | 52 #include "content/common/gpu/media/omx_video_decode_accelerator.h" |
52 #else | 53 #else |
53 #error The VideoAccelerator tests are not supported on this platform. | 54 #error The VideoAccelerator tests are not supported on this platform. |
54 #endif // defined(OS_WIN) | 55 #endif // defined(OS_WIN) |
55 | 56 |
56 using media::VideoDecodeAccelerator; | 57 using media::VideoDecodeAccelerator; |
57 | 58 |
58 namespace content { | 59 namespace content { |
59 namespace { | 60 namespace { |
60 | 61 |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 void GLRenderingVDAClient::CreateDecoder() { | 318 void GLRenderingVDAClient::CreateDecoder() { |
318 CHECK(decoder_deleted()); | 319 CHECK(decoder_deleted()); |
319 CHECK(!decoder_.get()); | 320 CHECK(!decoder_.get()); |
320 #if defined(OS_WIN) | 321 #if defined(OS_WIN) |
321 decoder_.reset(new DXVAVideoDecodeAccelerator( | 322 decoder_.reset(new DXVAVideoDecodeAccelerator( |
322 this, base::Bind(&DoNothingReturnTrue))); | 323 this, base::Bind(&DoNothingReturnTrue))); |
323 #elif defined(OS_MACOSX) | 324 #elif defined(OS_MACOSX) |
324 decoder_.reset(new MacVideoDecodeAccelerator( | 325 decoder_.reset(new MacVideoDecodeAccelerator( |
325 static_cast<CGLContextObj>(rendering_helper_->GetGLContext()), this)); | 326 static_cast<CGLContextObj>(rendering_helper_->GetGLContext()), this)); |
326 #elif defined(ARCH_CPU_ARMEL) | 327 #elif defined(ARCH_CPU_ARMEL) |
327 decoder_.reset( | 328 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseExynosVda)) |
328 new OmxVideoDecodeAccelerator( | 329 decoder_.reset( |
329 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), | 330 new ExynosVideoDecodeAccelerator( |
330 static_cast<EGLContext>(rendering_helper_->GetGLContext()), | 331 rendering_helper_->GetGLDisplay(), this, |
331 this, | 332 base::Bind(&DoNothingReturnTrue))); |
332 base::Bind(&DoNothingReturnTrue))); | 333 else |
| 334 decoder_.reset( |
| 335 new OmxVideoDecodeAccelerator( |
| 336 static_cast<EGLDisplay>(rendering_helper_->GetGLDisplay()), |
| 337 static_cast<EGLContext>(rendering_helper_->GetGLContext()), |
| 338 this, |
| 339 base::Bind(&DoNothingReturnTrue))); |
333 #elif defined(ARCH_CPU_X86_FAMILY) | 340 #elif defined(ARCH_CPU_X86_FAMILY) |
334 decoder_.reset(new VaapiVideoDecodeAccelerator( | 341 decoder_.reset(new VaapiVideoDecodeAccelerator( |
335 static_cast<Display*>(rendering_helper_->GetGLDisplay()), | 342 static_cast<Display*>(rendering_helper_->GetGLDisplay()), |
336 static_cast<GLXContext>(rendering_helper_->GetGLContext()), | 343 static_cast<GLXContext>(rendering_helper_->GetGLContext()), |
337 this, base::Bind(&DoNothingReturnTrue))); | 344 this, base::Bind(&DoNothingReturnTrue))); |
338 #endif // OS_WIN | 345 #endif // OS_WIN |
339 CHECK(decoder_.get()); | 346 CHECK(decoder_.get()); |
340 SetState(CS_DECODER_SET); | 347 SetState(CS_DECODER_SET); |
341 if (decoder_deleted()) | 348 if (decoder_deleted()) |
342 return; | 349 return; |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
885 continue; | 892 continue; |
886 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; | 893 LOG(FATAL) << "Unexpected switch: " << it->first << ":" << it->second; |
887 } | 894 } |
888 | 895 |
889 base::ShadowingAtExitManager at_exit_manager; | 896 base::ShadowingAtExitManager at_exit_manager; |
890 content::RenderingHelper::InitializePlatform(); | 897 content::RenderingHelper::InitializePlatform(); |
891 | 898 |
892 #if defined(OS_WIN) | 899 #if defined(OS_WIN) |
893 content::DXVAVideoDecodeAccelerator::PreSandboxInitialization(); | 900 content::DXVAVideoDecodeAccelerator::PreSandboxInitialization(); |
894 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 901 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
895 content::OmxVideoDecodeAccelerator::PreSandboxInitialization(); | 902 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseExynosVda)) |
| 903 content::ExynosVideoDecodeAccelerator::PreSandboxInitialization(); |
| 904 else |
| 905 content::OmxVideoDecodeAccelerator::PreSandboxInitialization(); |
896 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 906 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
897 content::VaapiVideoDecodeAccelerator::PreSandboxInitialization(); | 907 content::VaapiVideoDecodeAccelerator::PreSandboxInitialization(); |
898 #endif | 908 #endif |
899 | 909 |
900 return RUN_ALL_TESTS(); | 910 return RUN_ALL_TESTS(); |
901 } | 911 } |
OLD | NEW |