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 stub_->decoder()->AsWeakPtr(), |
| 214 make_context_current_)); |
208 #else | 215 #else |
209 NOTIMPLEMENTED() << "HW video decode acceleration not available."; | 216 NOTIMPLEMENTED() << "HW video decode acceleration not available."; |
210 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 217 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
211 return; | 218 return; |
212 #endif | 219 #endif |
213 | 220 |
214 if (!video_decode_accelerator_->Initialize(profile)) | 221 if (!video_decode_accelerator_->Initialize(profile)) |
215 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 222 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
216 } | 223 } |
217 | 224 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 stub_.reset(); | 343 stub_.reset(); |
337 } | 344 } |
338 } | 345 } |
339 | 346 |
340 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 347 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
341 DCHECK(sender_); | 348 DCHECK(sender_); |
342 return sender_->Send(message); | 349 return sender_->Send(message); |
343 } | 350 } |
344 | 351 |
345 } // namespace content | 352 } // namespace content |
OLD | NEW |