| 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 14 matching lines...) Expand all Loading... |
| 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) | 26 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 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) | 29 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
| 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) | 32 #elif defined(OS_MACOSX) |
| 33 #include "gpu/command_buffer/service/texture_manager.h" | 33 #include "gpu/command_buffer/service/texture_manager.h" |
| 34 #include "content/common/gpu/media/mac_video_decode_accelerator.h" | 34 #include "content/common/gpu/media/mac_video_decode_accelerator.h" |
| 35 #elif defined(OS_ANDROID) |
| 36 #include "content/common/gpu/media/android_video_decode_accelerator.h" |
| 35 #endif | 37 #endif |
| 36 | 38 |
| 37 #include "gpu/command_buffer/service/texture_manager.h" | 39 #include "gpu/command_buffer/service/texture_manager.h" |
| 38 #include "ui/gfx/size.h" | 40 #include "ui/gfx/size.h" |
| 39 | 41 |
| 40 using gpu::gles2::TextureManager; | 42 using gpu::gles2::TextureManager; |
| 41 | 43 |
| 42 namespace content { | 44 namespace content { |
| 43 | 45 |
| 44 static bool MakeDecoderContextCurrent( | 46 static bool MakeDecoderContextCurrent( |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 GLXContext glx_context_handle = | 200 GLXContext glx_context_handle = |
| 199 static_cast<GLXContext>(glx_context->GetHandle()); | 201 static_cast<GLXContext>(glx_context->GetHandle()); |
| 200 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( | 202 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( |
| 201 glx_context->display(), glx_context_handle, this, | 203 glx_context->display(), glx_context_handle, this, |
| 202 make_context_current_)); | 204 make_context_current_)); |
| 203 #elif defined(OS_MACOSX) | 205 #elif defined(OS_MACOSX) |
| 204 video_decode_accelerator_.reset(new MacVideoDecodeAccelerator( | 206 video_decode_accelerator_.reset(new MacVideoDecodeAccelerator( |
| 205 static_cast<CGLContextObj>( | 207 static_cast<CGLContextObj>( |
| 206 stub_->decoder()->GetGLContext()->GetHandle()), | 208 stub_->decoder()->GetGLContext()->GetHandle()), |
| 207 this)); | 209 this)); |
| 210 #elif defined(OS_ANDROID) |
| 211 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator( |
| 212 this, |
| 213 make_context_current_)); |
| 208 #else | 214 #else |
| 209 NOTIMPLEMENTED() << "HW video decode acceleration not available."; | 215 NOTIMPLEMENTED() << "HW video decode acceleration not available."; |
| 210 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 216 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
| 211 return; | 217 return; |
| 212 #endif | 218 #endif |
| 213 | 219 |
| 214 if (!video_decode_accelerator_->Initialize(profile)) | 220 if (!video_decode_accelerator_->Initialize(profile)) |
| 215 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 221 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
| 216 } | 222 } |
| 217 | 223 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 stub_.reset(); | 343 stub_.reset(); |
| 338 } | 344 } |
| 339 } | 345 } |
| 340 | 346 |
| 341 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 347 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
| 342 DCHECK(sender_); | 348 DCHECK(sender_); |
| 343 return sender_->Send(message); | 349 return sender_->Send(message); |
| 344 } | 350 } |
| 345 | 351 |
| 346 } // namespace content | 352 } // namespace content |
| OLD | NEW |