| 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "base/win/windows_version.h" | 22 #include "base/win/windows_version.h" |
| 23 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 23 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
| 24 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 24 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 25 #include "content/common/gpu/media/omx_video_decode_accelerator.h" | 25 #include "content/common/gpu/media/omx_video_decode_accelerator.h" |
| 26 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 26 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
| 27 #include "ui/gl/gl_context_glx.h" | 27 #include "ui/gl/gl_context_glx.h" |
| 28 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 28 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
| 29 #elif defined(OS_MACOSX) | 29 #elif defined(OS_MACOSX) |
| 30 #include "gpu/command_buffer/service/texture_manager.h" | 30 #include "gpu/command_buffer/service/texture_manager.h" |
| 31 #include "content/common/gpu/media/mac_video_decode_accelerator.h" | 31 #include "content/common/gpu/media/mac_video_decode_accelerator.h" |
| 32 #elif defined(OS_ANDROID) |
| 33 #include "content/common/gpu/media/android_video_decode_accelerator.h" |
| 32 #endif | 34 #endif |
| 33 | 35 |
| 34 #include "gpu/command_buffer/service/texture_manager.h" | 36 #include "gpu/command_buffer/service/texture_manager.h" |
| 35 #include "ui/gfx/size.h" | 37 #include "ui/gfx/size.h" |
| 36 | 38 |
| 37 using gpu::gles2::TextureManager; | 39 using gpu::gles2::TextureManager; |
| 38 | 40 |
| 39 namespace content { | 41 namespace content { |
| 40 | 42 |
| 41 static bool MakeDecoderContextCurrent( | 43 static bool MakeDecoderContextCurrent( |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 GLXContext glx_context_handle = | 187 GLXContext glx_context_handle = |
| 186 static_cast<GLXContext>(glx_context->GetHandle()); | 188 static_cast<GLXContext>(glx_context->GetHandle()); |
| 187 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( | 189 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( |
| 188 glx_context->display(), glx_context_handle, this, | 190 glx_context->display(), glx_context_handle, this, |
| 189 make_context_current_)); | 191 make_context_current_)); |
| 190 #elif defined(OS_MACOSX) | 192 #elif defined(OS_MACOSX) |
| 191 video_decode_accelerator_.reset(new MacVideoDecodeAccelerator( | 193 video_decode_accelerator_.reset(new MacVideoDecodeAccelerator( |
| 192 static_cast<CGLContextObj>( | 194 static_cast<CGLContextObj>( |
| 193 stub_->decoder()->GetGLContext()->GetHandle()), | 195 stub_->decoder()->GetGLContext()->GetHandle()), |
| 194 this)); | 196 this)); |
| 197 #elif defined(OS_ANDROID) |
| 198 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator( |
| 199 this, |
| 200 make_context_current_)); |
| 195 #else | 201 #else |
| 196 NOTIMPLEMENTED() << "HW video decode acceleration not available."; | 202 NOTIMPLEMENTED() << "HW video decode acceleration not available."; |
| 197 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 203 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
| 198 return; | 204 return; |
| 199 #endif | 205 #endif |
| 200 | 206 |
| 201 if (!video_decode_accelerator_->Initialize(profile)) | 207 if (!video_decode_accelerator_->Initialize(profile)) |
| 202 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 208 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
| 203 } | 209 } |
| 204 | 210 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 stub_.reset(); | 320 stub_.reset(); |
| 315 } | 321 } |
| 316 } | 322 } |
| 317 | 323 |
| 318 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 324 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
| 319 DCHECK(sender_); | 325 DCHECK(sender_); |
| 320 return sender_->Send(message); | 326 return sender_->Send(message); |
| 321 } | 327 } |
| 322 | 328 |
| 323 } // namespace content | 329 } // namespace content |
| OLD | NEW |