| 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/command_line.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 13 | 13 |
| 14 #include "content/common/gpu/gpu_channel.h" | 14 #include "content/common/gpu/gpu_channel.h" |
| 15 #include "content/common/gpu/gpu_messages.h" | 15 #include "content/common/gpu/gpu_messages.h" |
| 16 #include "content/public/common/content_switches.h" | 16 #include "content/public/common/content_switches.h" |
| 17 #include "gpu/command_buffer/common/command_buffer.h" | 17 #include "gpu/command_buffer/common/command_buffer.h" |
| 18 #include "ipc/ipc_message_macros.h" | 18 #include "ipc/ipc_message_macros.h" |
| 19 #include "ipc/ipc_message_utils.h" | 19 #include "ipc/ipc_message_utils.h" |
| 20 #include "ui/gl/gl_context.h" | 20 #include "ui/gl/gl_context.h" |
| 21 #include "ui/gl/gl_surface_egl.h" | 21 #include "ui/gl/gl_surface_egl.h" |
| 22 | 22 |
| 23 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
| 24 #include "base/win/windows_version.h" | 24 #include "base/win/windows_version.h" |
| 25 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 25 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
| 26 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) | 26 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) |
| 27 #include "content/common/gpu/media/exynos_video_decode_accelerator.h" | 27 #include "content/common/gpu/media/exynos_video_decode_accelerator.h" |
| 28 #include "content/common/gpu/media/omx_video_decode_accelerator.h" | 28 #include "content/common/gpu/media/omx_video_decode_accelerator.h" |
| 29 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) | 29 #elif defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) |
| 30 #include "ui/gl/gl_context_glx.h" | 30 #include "ui/gl/gl_context_glx.h" |
| 31 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 31 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
| 32 #elif defined(OS_ANDROID) | 32 #elif defined(OS_ANDROID) |
| 33 #include "content/common/gpu/media/android_video_decode_accelerator.h" | 33 #include "content/common/gpu/media/android_video_decode_accelerator.h" |
| 34 #endif | 34 #endif |
| 35 | 35 |
| 36 #include "gpu/command_buffer/service/texture_manager.h" | 36 #include "gpu/command_buffer/service/texture_manager.h" |
| 37 #include "ui/gfx/size.h" | 37 #include "ui/gfx/size.h" |
| 38 | 38 |
| 39 using gpu::gles2::TextureManager; | 39 using gpu::gles2::TextureManager; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 stub_->decoder()->GetGLContext()->GetHandle(), | 184 stub_->decoder()->GetGLContext()->GetHandle(), |
| 185 this, | 185 this, |
| 186 make_context_current_)); | 186 make_context_current_)); |
| 187 } else { | 187 } else { |
| 188 video_decode_accelerator_.reset(new OmxVideoDecodeAccelerator( | 188 video_decode_accelerator_.reset(new OmxVideoDecodeAccelerator( |
| 189 gfx::GLSurfaceEGL::GetHardwareDisplay(), | 189 gfx::GLSurfaceEGL::GetHardwareDisplay(), |
| 190 stub_->decoder()->GetGLContext()->GetHandle(), | 190 stub_->decoder()->GetGLContext()->GetHandle(), |
| 191 this, | 191 this, |
| 192 make_context_current_)); | 192 make_context_current_)); |
| 193 } | 193 } |
| 194 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) | 194 #elif defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) |
| 195 gfx::GLContextGLX* glx_context = | 195 gfx::GLContextGLX* glx_context = |
| 196 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext()); | 196 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext()); |
| 197 GLXContext glx_context_handle = | 197 GLXContext glx_context_handle = |
| 198 static_cast<GLXContext>(glx_context->GetHandle()); | 198 static_cast<GLXContext>(glx_context->GetHandle()); |
| 199 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( | 199 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( |
| 200 glx_context->display(), glx_context_handle, this, | 200 glx_context->display(), glx_context_handle, this, |
| 201 make_context_current_)); | 201 make_context_current_)); |
| 202 #elif defined(OS_ANDROID) | 202 #elif defined(OS_ANDROID) |
| 203 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator( | 203 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator( |
| 204 this, | 204 this, |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 void GpuVideoDecodeAccelerator::OnWillDestroyStub() { | 342 void GpuVideoDecodeAccelerator::OnWillDestroyStub() { |
| 343 delete this; | 343 delete this; |
| 344 } | 344 } |
| 345 | 345 |
| 346 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 346 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
| 347 DCHECK(stub_); | 347 DCHECK(stub_); |
| 348 return stub_->channel()->Send(message); | 348 return stub_->channel()->Send(message); |
| 349 } | 349 } |
| 350 | 350 |
| 351 } // namespace content | 351 } // namespace content |
| OLD | NEW |