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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/memory/ref_counted.h" |
12 #include "base/message_loop/message_loop_proxy.h" | 13 #include "base/message_loop/message_loop_proxy.h" |
13 #include "base/stl_util.h" | 14 #include "base/stl_util.h" |
14 | 15 |
15 #include "content/common/gpu/gpu_channel.h" | 16 #include "content/common/gpu/gpu_channel.h" |
16 #include "content/common/gpu/gpu_messages.h" | 17 #include "content/common/gpu/gpu_messages.h" |
17 #include "content/public/common/content_switches.h" | 18 #include "content/public/common/content_switches.h" |
18 #include "gpu/command_buffer/common/command_buffer.h" | 19 #include "gpu/command_buffer/common/command_buffer.h" |
19 #include "ipc/ipc_message_macros.h" | 20 #include "ipc/ipc_message_macros.h" |
20 #include "ipc/ipc_message_utils.h" | 21 #include "ipc/ipc_message_utils.h" |
21 #include "ipc/message_filter.h" | 22 #include "ipc/message_filter.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 } | 294 } |
294 #endif | 295 #endif |
295 return decoder.Pass(); | 296 return decoder.Pass(); |
296 } | 297 } |
297 | 298 |
298 scoped_ptr<media::VideoDecodeAccelerator> | 299 scoped_ptr<media::VideoDecodeAccelerator> |
299 GpuVideoDecodeAccelerator::CreateV4L2VDA() { | 300 GpuVideoDecodeAccelerator::CreateV4L2VDA() { |
300 scoped_ptr<media::VideoDecodeAccelerator> decoder; | 301 scoped_ptr<media::VideoDecodeAccelerator> decoder; |
301 #if defined(OS_CHROMEOS) && (defined(ARCH_CPU_ARMEL) || \ | 302 #if defined(OS_CHROMEOS) && (defined(ARCH_CPU_ARMEL) || \ |
302 (defined(USE_OZONE) && defined(USE_V4L2_CODEC))) | 303 (defined(USE_OZONE) && defined(USE_V4L2_CODEC))) |
303 scoped_ptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); | 304 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); |
304 if (device.get()) { | 305 if (device.get()) { |
305 decoder.reset(new V4L2VideoDecodeAccelerator( | 306 decoder.reset(new V4L2VideoDecodeAccelerator( |
306 gfx::GLSurfaceEGL::GetHardwareDisplay(), | 307 gfx::GLSurfaceEGL::GetHardwareDisplay(), |
307 stub_->decoder()->GetGLContext()->GetHandle(), | 308 stub_->decoder()->GetGLContext()->GetHandle(), |
308 weak_factory_for_io_.GetWeakPtr(), | 309 weak_factory_for_io_.GetWeakPtr(), |
309 make_context_current_, | 310 make_context_current_, |
310 device.Pass(), | 311 device, |
311 io_message_loop_)); | 312 io_message_loop_)); |
312 } | 313 } |
313 #endif | 314 #endif |
314 return decoder.Pass(); | 315 return decoder.Pass(); |
315 } | 316 } |
316 | 317 |
317 scoped_ptr<media::VideoDecodeAccelerator> | 318 scoped_ptr<media::VideoDecodeAccelerator> |
318 GpuVideoDecodeAccelerator::CreateVaapiVDA() { | 319 GpuVideoDecodeAccelerator::CreateVaapiVDA() { |
319 scoped_ptr<media::VideoDecodeAccelerator> decoder; | 320 scoped_ptr<media::VideoDecodeAccelerator> decoder; |
320 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) | 321 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
555 return stub_->channel()->Send(message); | 556 return stub_->channel()->Send(message); |
556 } | 557 } |
557 | 558 |
558 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, | 559 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, |
559 bool succeeded) { | 560 bool succeeded) { |
560 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); | 561 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); |
561 Send(message); | 562 Send(message); |
562 } | 563 } |
563 | 564 |
564 } // namespace content | 565 } // namespace content |
OLD | NEW |