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 15 matching lines...) Expand all Loading... |
26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
27 #include "base/win/windows_version.h" | 27 #include "base/win/windows_version.h" |
28 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 28 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
29 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) | 29 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) |
30 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" | 30 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" |
31 #include "content/common/gpu/media/v4l2_video_device.h" | 31 #include "content/common/gpu/media/v4l2_video_device.h" |
32 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) | 32 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) && defined(USE_X11) |
33 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 33 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
34 #include "ui/gl/gl_context_glx.h" | 34 #include "ui/gl/gl_context_glx.h" |
35 #include "ui/gl/gl_implementation.h" | 35 #include "ui/gl/gl_implementation.h" |
| 36 #elif defined(USE_OZONE) |
| 37 #include "content/common/gpu/media/ozone_video_decode_accelerator.h" |
36 #elif defined(OS_ANDROID) | 38 #elif defined(OS_ANDROID) |
37 #include "content/common/gpu/media/android_video_decode_accelerator.h" | 39 #include "content/common/gpu/media/android_video_decode_accelerator.h" |
38 #endif | 40 #endif |
39 | 41 |
40 #include "ui/gfx/size.h" | 42 #include "ui/gfx/size.h" |
41 | 43 |
42 namespace content { | 44 namespace content { |
43 | 45 |
44 static bool MakeDecoderContextCurrent( | 46 static bool MakeDecoderContextCurrent( |
45 const base::WeakPtr<GpuCommandBufferStub> stub) { | 47 const base::WeakPtr<GpuCommandBufferStub> stub) { |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) { | 270 if (gfx::GetGLImplementation() != gfx::kGLImplementationDesktopGL) { |
269 VLOG(1) << "HW video decode acceleration not available without " | 271 VLOG(1) << "HW video decode acceleration not available without " |
270 "DesktopGL (GLX)."; | 272 "DesktopGL (GLX)."; |
271 SendCreateDecoderReply(init_done_msg, false); | 273 SendCreateDecoderReply(init_done_msg, false); |
272 return; | 274 return; |
273 } | 275 } |
274 gfx::GLContextGLX* glx_context = | 276 gfx::GLContextGLX* glx_context = |
275 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext()); | 277 static_cast<gfx::GLContextGLX*>(stub_->decoder()->GetGLContext()); |
276 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( | 278 video_decode_accelerator_.reset(new VaapiVideoDecodeAccelerator( |
277 glx_context->display(), make_context_current_)); | 279 glx_context->display(), make_context_current_)); |
| 280 #elif defined(USE_OZONE) |
| 281 video_decode_accelerator_.reset(new OzoneVideoDecodeAccelerator( |
| 282 make_context_current_)); |
278 #elif defined(OS_ANDROID) | 283 #elif defined(OS_ANDROID) |
279 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator( | 284 video_decode_accelerator_.reset(new AndroidVideoDecodeAccelerator( |
280 stub_->decoder()->AsWeakPtr(), | 285 stub_->decoder()->AsWeakPtr(), |
281 make_context_current_)); | 286 make_context_current_)); |
282 #else | 287 #else |
283 NOTIMPLEMENTED() << "HW video decode acceleration not available."; | 288 NOTIMPLEMENTED() << "HW video decode acceleration not available."; |
284 SendCreateDecoderReply(init_done_msg, false); | 289 SendCreateDecoderReply(init_done_msg, false); |
285 return; | 290 return; |
286 #endif | 291 #endif |
287 | 292 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 return stub_->channel()->Send(message); | 495 return stub_->channel()->Send(message); |
491 } | 496 } |
492 | 497 |
493 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, | 498 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, |
494 bool succeeded) { | 499 bool succeeded) { |
495 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); | 500 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); |
496 Send(message); | 501 Send(message); |
497 } | 502 } |
498 | 503 |
499 } // namespace content | 504 } // namespace content |
OLD | NEW |