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 "content/common/gpu/media/gpu_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
12 | 13 |
13 #include "content/common/gpu/gpu_channel.h" | 14 #include "content/common/gpu/gpu_channel.h" |
14 #include "content/common/gpu/gpu_messages.h" | 15 #include "content/common/gpu/gpu_messages.h" |
| 16 #include "content/public/common/content_switches.h" |
15 #include "gpu/command_buffer/common/command_buffer.h" | 17 #include "gpu/command_buffer/common/command_buffer.h" |
16 #include "ipc/ipc_message_macros.h" | 18 #include "ipc/ipc_message_macros.h" |
17 #include "ipc/ipc_message_utils.h" | 19 #include "ipc/ipc_message_utils.h" |
18 #include "ui/gl/gl_context.h" | 20 #include "ui/gl/gl_context.h" |
19 #include "ui/gl/gl_surface_egl.h" | 21 #include "ui/gl/gl_surface_egl.h" |
20 | 22 |
21 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
22 #include "base/win/windows_version.h" | 24 #include "base/win/windows_version.h" |
23 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 25 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
24 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 26 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 27 #include "content/common/gpu/media/exynos_video_decode_accelerator.h" |
25 #include "content/common/gpu/media/omx_video_decode_accelerator.h" | 28 #include "content/common/gpu/media/omx_video_decode_accelerator.h" |
26 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 29 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
27 #include "ui/gl/gl_context_glx.h" | 30 #include "ui/gl/gl_context_glx.h" |
28 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 31 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
29 #elif defined(OS_MACOSX) | 32 #elif defined(OS_MACOSX) |
30 #include "gpu/command_buffer/service/texture_manager.h" | 33 #include "gpu/command_buffer/service/texture_manager.h" |
31 #include "content/common/gpu/media/mac_video_decode_accelerator.h" | 34 #include "content/common/gpu/media/mac_video_decode_accelerator.h" |
32 #endif | 35 #endif |
33 | 36 |
34 #include "gpu/command_buffer/service/texture_manager.h" | 37 #include "gpu/command_buffer/service/texture_manager.h" |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 #if defined(OS_WIN) | 170 #if defined(OS_WIN) |
168 if (base::win::GetVersion() < base::win::VERSION_WIN7) { | 171 if (base::win::GetVersion() < base::win::VERSION_WIN7) { |
169 NOTIMPLEMENTED() << "HW video decode acceleration not available."; | 172 NOTIMPLEMENTED() << "HW video decode acceleration not available."; |
170 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 173 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
171 return; | 174 return; |
172 } | 175 } |
173 DLOG(INFO) << "Initializing DXVA HW decoder for windows."; | 176 DLOG(INFO) << "Initializing DXVA HW decoder for windows."; |
174 video_decode_accelerator_.reset(new DXVAVideoDecodeAccelerator( | 177 video_decode_accelerator_.reset(new DXVAVideoDecodeAccelerator( |
175 this, make_context_current_)); | 178 this, make_context_current_)); |
176 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 179 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
177 video_decode_accelerator_.reset(new OmxVideoDecodeAccelerator( | 180 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseExynosVda)) { |
178 gfx::GLSurfaceEGL::GetHardwareDisplay(), | 181 video_decode_accelerator_.reset(new ExynosVideoDecodeAccelerator( |
179 stub_->decoder()->GetGLContext()->GetHandle(), | 182 gfx::GLSurfaceEGL::GetHardwareDisplay(), |
180 this, | 183 stub_->decoder()->GetGLContext()->GetHandle(), |
181 make_context_current_)); | 184 this, |
| 185 make_context_current_)); |
| 186 } else { |
| 187 video_decode_accelerator_.reset(new OmxVideoDecodeAccelerator( |
| 188 gfx::GLSurfaceEGL::GetHardwareDisplay(), |
| 189 stub_->decoder()->GetGLContext()->GetHandle(), |
| 190 this, |
| 191 make_context_current_)); |
| 192 } |
182 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 193 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
183 gfx::GLContextGLX* glx_context = | 194 gfx::GLContextGLX* glx_context = |
184 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext()); | 195 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext()); |
185 GLXContext glx_context_handle = | 196 GLXContext glx_context_handle = |
186 static_cast<GLXContext>(glx_context->GetHandle()); | 197 static_cast<GLXContext>(glx_context->GetHandle()); |
187 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( | 198 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( |
188 glx_context->display(), glx_context_handle, this, | 199 glx_context->display(), glx_context_handle, this, |
189 make_context_current_)); | 200 make_context_current_)); |
190 #elif defined(OS_MACOSX) | 201 #elif defined(OS_MACOSX) |
191 video_decode_accelerator_.reset(new MacVideoDecodeAccelerator( | 202 video_decode_accelerator_.reset(new MacVideoDecodeAccelerator( |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 stub_.reset(); | 312 stub_.reset(); |
302 } | 313 } |
303 } | 314 } |
304 | 315 |
305 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 316 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
306 DCHECK(sender_); | 317 DCHECK(sender_); |
307 return sender_->Send(message); | 318 return sender_->Send(message); |
308 } | 319 } |
309 | 320 |
310 } // namespace content | 321 } // namespace content |
OLD | NEW |