| 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" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 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(OS_CHROMEOS) && 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_MACOSX) | |
| 33 #include "gpu/command_buffer/service/texture_manager.h" | |
| 34 #include "content/common/gpu/media/mac_video_decode_accelerator.h" | |
| 35 #elif defined(OS_ANDROID) | 32 #elif defined(OS_ANDROID) |
| 36 #include "content/common/gpu/media/android_video_decode_accelerator.h" | 33 #include "content/common/gpu/media/android_video_decode_accelerator.h" |
| 37 #endif | 34 #endif |
| 38 | 35 |
| 39 #include "gpu/command_buffer/service/texture_manager.h" | 36 #include "gpu/command_buffer/service/texture_manager.h" |
| 40 #include "ui/gfx/size.h" | 37 #include "ui/gfx/size.h" |
| 41 | 38 |
| 42 using gpu::gles2::TextureManager; | 39 using gpu::gles2::TextureManager; |
| 43 | 40 |
| 44 namespace content { | 41 namespace content { |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 make_context_current_)); | 195 make_context_current_)); |
| 199 } | 196 } |
| 200 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) | 197 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) |
| 201 gfx::GLContextGLX* glx_context = | 198 gfx::GLContextGLX* glx_context = |
| 202 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext()); | 199 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext()); |
| 203 GLXContext glx_context_handle = | 200 GLXContext glx_context_handle = |
| 204 static_cast<GLXContext>(glx_context->GetHandle()); | 201 static_cast<GLXContext>(glx_context->GetHandle()); |
| 205 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( | 202 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( |
| 206 glx_context->display(), glx_context_handle, this, | 203 glx_context->display(), glx_context_handle, this, |
| 207 make_context_current_)); | 204 make_context_current_)); |
| 208 #elif defined(OS_MACOSX) | |
| 209 video_decode_accelerator_.reset(new MacVideoDecodeAccelerator( | |
| 210 static_cast<CGLContextObj>( | |
| 211 stub_->decoder()->GetGLContext()->GetHandle()), | |
| 212 this)); | |
| 213 #elif defined(OS_ANDROID) | 205 #elif defined(OS_ANDROID) |
| 214 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator( | 206 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator( |
| 215 this, | 207 this, |
| 216 stub_->decoder()->AsWeakPtr(), | 208 stub_->decoder()->AsWeakPtr(), |
| 217 make_context_current_)); | 209 make_context_current_)); |
| 218 #else | 210 #else |
| 219 NOTIMPLEMENTED() << "HW video decode acceleration not available."; | 211 NOTIMPLEMENTED() << "HW video decode acceleration not available."; |
| 220 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 212 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
| 221 return; | 213 return; |
| 222 #endif | 214 #endif |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 stub_.reset(); | 348 stub_.reset(); |
| 357 } | 349 } |
| 358 } | 350 } |
| 359 | 351 |
| 360 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 352 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
| 361 DCHECK(stub_); | 353 DCHECK(stub_); |
| 362 return stub_->channel()->Send(message); | 354 return stub_->channel()->Send(message); |
| 363 } | 355 } |
| 364 | 356 |
| 365 } // namespace content | 357 } // namespace content |
| OLD | NEW |