| 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 12 matching lines...) Expand all Loading... |
| 23 #include "media/base/limits.h" | 23 #include "media/base/limits.h" |
| 24 #include "ui/gl/gl_context.h" | 24 #include "ui/gl/gl_context.h" |
| 25 #include "ui/gl/gl_surface_egl.h" | 25 #include "ui/gl/gl_surface_egl.h" |
| 26 | 26 |
| 27 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
| 28 #include "base/win/windows_version.h" | 28 #include "base/win/windows_version.h" |
| 29 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" | 29 #include "content/common/gpu/media/dxva_video_decode_accelerator.h" |
| 30 #elif defined(OS_MACOSX) | 30 #elif defined(OS_MACOSX) |
| 31 #include "content/common/gpu/media/vt_video_decode_accelerator.h" | 31 #include "content/common/gpu/media/vt_video_decode_accelerator.h" |
| 32 #elif defined(OS_CHROMEOS) | 32 #elif defined(OS_CHROMEOS) |
| 33 #if defined(ARCH_CPU_ARMEL) | |
| 34 #include "content/common/gpu/media/v4l2_slice_video_decode_accelerator.h" | |
| 35 #endif // defined(ARCH_CPU_ARMEL) | |
| 36 #if defined(ARCH_CPU_ARMEL) || (defined(USE_OZONE) && defined(USE_V4L2_CODEC)) | 33 #if defined(ARCH_CPU_ARMEL) || (defined(USE_OZONE) && defined(USE_V4L2_CODEC)) |
| 37 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" | 34 #include "content/common/gpu/media/v4l2_video_decode_accelerator.h" |
| 38 #include "content/common/gpu/media/v4l2_video_device.h" | 35 #include "content/common/gpu/media/v4l2_video_device.h" |
| 39 // defined(ARCH_CPU_ARMEL) || (defined(USE_OZONE) && defined(USE_V4L2_CODEC)) | 36 // defined(ARCH_CPU_ARMEL) || (defined(USE_OZONE) && defined(USE_V4L2_CODEC)) |
| 40 #endif | 37 #endif |
| 41 #if defined(ARCH_CPU_X86_FAMILY) | 38 #if defined(ARCH_CPU_X86_FAMILY) |
| 42 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" | 39 #include "content/common/gpu/media/vaapi_video_decode_accelerator.h" |
| 43 #include "ui/gl/gl_implementation.h" | 40 #include "ui/gl/gl_implementation.h" |
| 44 #endif // defined(ARCH_CPU_X86_FAMILY) | 41 #endif // defined(ARCH_CPU_X86_FAMILY) |
| 45 #elif defined(USE_OZONE) | 42 #elif defined(USE_OZONE) |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 video_decode_accelerator_.reset(); | 268 video_decode_accelerator_.reset(); |
| 272 NOTIMPLEMENTED() << "HW video decode acceleration not available."; | 269 NOTIMPLEMENTED() << "HW video decode acceleration not available."; |
| 273 SendCreateDecoderReply(init_done_msg, false); | 270 SendCreateDecoderReply(init_done_msg, false); |
| 274 } | 271 } |
| 275 | 272 |
| 276 std::vector<GpuVideoDecodeAccelerator::CreateVDAFp> | 273 std::vector<GpuVideoDecodeAccelerator::CreateVDAFp> |
| 277 GpuVideoDecodeAccelerator::CreateVDAFps() { | 274 GpuVideoDecodeAccelerator::CreateVDAFps() { |
| 278 std::vector<GpuVideoDecodeAccelerator::CreateVDAFp> create_vda_fps; | 275 std::vector<GpuVideoDecodeAccelerator::CreateVDAFp> create_vda_fps; |
| 279 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateDXVAVDA); | 276 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateDXVAVDA); |
| 280 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateV4L2VDA); | 277 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateV4L2VDA); |
| 281 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateV4L2SliceVDA); | |
| 282 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateVaapiVDA); | 278 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateVaapiVDA); |
| 283 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateVTVDA); | 279 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateVTVDA); |
| 284 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateOzoneVDA); | 280 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateOzoneVDA); |
| 285 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateAndroidVDA); | 281 create_vda_fps.push_back(&GpuVideoDecodeAccelerator::CreateAndroidVDA); |
| 286 return create_vda_fps; | 282 return create_vda_fps; |
| 287 } | 283 } |
| 288 | 284 |
| 289 scoped_ptr<media::VideoDecodeAccelerator> | 285 scoped_ptr<media::VideoDecodeAccelerator> |
| 290 GpuVideoDecodeAccelerator::CreateDXVAVDA() { | 286 GpuVideoDecodeAccelerator::CreateDXVAVDA() { |
| 291 scoped_ptr<media::VideoDecodeAccelerator> decoder; | 287 scoped_ptr<media::VideoDecodeAccelerator> decoder; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 309 if (device.get()) { | 305 if (device.get()) { |
| 310 decoder.reset(new V4L2VideoDecodeAccelerator( | 306 decoder.reset(new V4L2VideoDecodeAccelerator( |
| 311 gfx::GLSurfaceEGL::GetHardwareDisplay(), | 307 gfx::GLSurfaceEGL::GetHardwareDisplay(), |
| 312 stub_->decoder()->GetGLContext()->GetHandle(), | 308 stub_->decoder()->GetGLContext()->GetHandle(), |
| 313 weak_factory_for_io_.GetWeakPtr(), | 309 weak_factory_for_io_.GetWeakPtr(), |
| 314 make_context_current_, | 310 make_context_current_, |
| 315 device, | 311 device, |
| 316 io_message_loop_)); | 312 io_message_loop_)); |
| 317 } | 313 } |
| 318 #endif | 314 #endif |
| 319 return decoder.Pass(); | |
| 320 } | |
| 321 | |
| 322 scoped_ptr<media::VideoDecodeAccelerator> | |
| 323 GpuVideoDecodeAccelerator::CreateV4L2SliceVDA() { | |
| 324 scoped_ptr<media::VideoDecodeAccelerator> decoder; | |
| 325 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | |
| 326 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); | |
| 327 if (device.get()) { | |
| 328 decoder.reset(new V4L2SliceVideoDecodeAccelerator( | |
| 329 device, | |
| 330 gfx::GLSurfaceEGL::GetHardwareDisplay(), | |
| 331 stub_->decoder()->GetGLContext()->GetHandle(), | |
| 332 weak_factory_for_io_.GetWeakPtr(), | |
| 333 make_context_current_, | |
| 334 io_message_loop_)); | |
| 335 } | |
| 336 #endif | |
| 337 return decoder.Pass(); | 315 return decoder.Pass(); |
| 338 } | 316 } |
| 339 | 317 |
| 340 scoped_ptr<media::VideoDecodeAccelerator> | 318 scoped_ptr<media::VideoDecodeAccelerator> |
| 341 GpuVideoDecodeAccelerator::CreateVaapiVDA() { | 319 GpuVideoDecodeAccelerator::CreateVaapiVDA() { |
| 342 scoped_ptr<media::VideoDecodeAccelerator> decoder; | 320 scoped_ptr<media::VideoDecodeAccelerator> decoder; |
| 343 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 321 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
| 344 decoder.reset(new VaapiVideoDecodeAccelerator(make_context_current_)); | 322 decoder.reset(new VaapiVideoDecodeAccelerator(make_context_current_)); |
| 345 #endif | 323 #endif |
| 346 return decoder.Pass(); | 324 return decoder.Pass(); |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 return stub_->channel()->Send(message); | 556 return stub_->channel()->Send(message); |
| 579 } | 557 } |
| 580 | 558 |
| 581 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, | 559 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, |
| 582 bool succeeded) { | 560 bool succeeded) { |
| 583 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); | 561 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); |
| 584 Send(message); | 562 Send(message); |
| 585 } | 563 } |
| 586 | 564 |
| 587 } // namespace content | 565 } // namespace content |
| OLD | NEW |