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 #include <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "ui/gl/gl_implementation.h" | 28 #include "ui/gl/gl_implementation.h" |
29 #include "ui/gl/gl_surface.h" | 29 #include "ui/gl/gl_surface.h" |
30 #include "ui/gl/gl_switches.h" | 30 #include "ui/gl/gl_switches.h" |
31 #include "ui/gl/gpu_switching_manager.h" | 31 #include "ui/gl/gpu_switching_manager.h" |
32 | 32 |
33 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
34 #include "base/win/scoped_com_initializer.h" | 34 #include "base/win/scoped_com_initializer.h" |
35 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 35 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
36 #include "sandbox/win/src/sandbox.h" | 36 #include "sandbox/win/src/sandbox.h" |
37 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 37 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 38 #include "content/common/gpu/media/exynos_video_decode_accelerator.h" |
38 #include "content/common/gpu/media/omx_video_decode_accelerator.h" | 39 #include "content/common/gpu/media/omx_video_decode_accelerator.h" |
39 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 40 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
40 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 41 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
41 #endif | 42 #endif |
42 | 43 |
43 #if defined(USE_X11) | 44 #if defined(USE_X11) |
44 #include "ui/base/x/x11_util.h" | 45 #include "ui/base/x/x11_util.h" |
45 #endif | 46 #endif |
46 | 47 |
47 #if defined(OS_LINUX) | 48 #if defined(OS_LINUX) |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 TRACE_EVENT0("gpu", "Warm up HMAC"); | 332 TRACE_EVENT0("gpu", "Warm up HMAC"); |
332 // Warm up the crypto subsystem, which needs to done pre-sandbox on all | 333 // Warm up the crypto subsystem, which needs to done pre-sandbox on all |
333 // platforms. | 334 // platforms. |
334 crypto::HMAC hmac(crypto::HMAC::SHA256); | 335 crypto::HMAC hmac(crypto::HMAC::SHA256); |
335 unsigned char key = '\0'; | 336 unsigned char key = '\0'; |
336 bool ret = hmac.Init(&key, sizeof(key)); | 337 bool ret = hmac.Init(&key, sizeof(key)); |
337 (void) ret; | 338 (void) ret; |
338 } | 339 } |
339 | 340 |
340 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 341 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
341 OmxVideoDecodeAccelerator::PreSandboxInitialization(); | 342 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseExynosVda)) |
| 343 ExynosVideoDecodeAccelerator::PreSandboxInitialization(); |
| 344 else |
| 345 OmxVideoDecodeAccelerator::PreSandboxInitialization(); |
342 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 346 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
343 VaapiVideoDecodeAccelerator::PreSandboxInitialization(); | 347 VaapiVideoDecodeAccelerator::PreSandboxInitialization(); |
344 #endif | 348 #endif |
345 | 349 |
346 #if defined(OS_LINUX) | 350 #if defined(OS_LINUX) |
347 // We special case Optimus since the vendor_id we see may not be Nvidia. | 351 // We special case Optimus since the vendor_id we see may not be Nvidia. |
348 bool uses_nvidia_driver = (gpu_info.gpu.vendor_id == 0x10de && // NVIDIA. | 352 bool uses_nvidia_driver = (gpu_info.gpu.vendor_id == 0x10de && // NVIDIA. |
349 gpu_info.driver_vendor == "NVIDIA") || | 353 gpu_info.driver_vendor == "NVIDIA") || |
350 gpu_info.optimus; | 354 gpu_info.optimus; |
351 if (uses_nvidia_driver && should_initialize_gl_context) { | 355 if (uses_nvidia_driver && should_initialize_gl_context) { |
352 // We need this on Nvidia to pre-open /dev/nvidiactl and /dev/nvidia0. | 356 // We need this on Nvidia to pre-open /dev/nvidiactl and /dev/nvidia0. |
353 CreateDummyGlContext(); | 357 CreateDummyGlContext(); |
354 } | 358 } |
355 #endif | 359 #endif |
356 | 360 |
357 #if defined(OS_WIN) | 361 #if defined(OS_WIN) |
358 // Preload these DLL because the sandbox prevents them from loading. | 362 // Preload these DLL because the sandbox prevents them from loading. |
359 LoadLibrary(L"setupapi.dll"); | 363 LoadLibrary(L"setupapi.dll"); |
360 #endif | 364 #endif |
361 } | 365 } |
362 | 366 |
363 } // namespace. | 367 } // namespace. |
364 | 368 |
365 } // namespace content | 369 } // namespace content |
OLD | NEW |