| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 NOTIMPLEMENTED() << "HW video decode acceleration not available."; | 252 NOTIMPLEMENTED() << "HW video decode acceleration not available."; |
| 253 SendCreateDecoderReply(init_done_msg, false); | 253 SendCreateDecoderReply(init_done_msg, false); |
| 254 return; | 254 return; |
| 255 } | 255 } |
| 256 DVLOG(0) << "Initializing DXVA HW decoder for windows."; | 256 DVLOG(0) << "Initializing DXVA HW decoder for windows."; |
| 257 video_decode_accelerator_.reset( | 257 video_decode_accelerator_.reset( |
| 258 new DXVAVideoDecodeAccelerator(make_context_current_)); | 258 new DXVAVideoDecodeAccelerator(make_context_current_)); |
| 259 #elif defined(OS_MACOSX) | 259 #elif defined(OS_MACOSX) |
| 260 video_decode_accelerator_.reset(new VTVideoDecodeAccelerator( | 260 video_decode_accelerator_.reset(new VTVideoDecodeAccelerator( |
| 261 static_cast<CGLContextObj>( | 261 static_cast<CGLContextObj>( |
| 262 stub_->decoder()->GetGLContext()->GetHandle()))); | 262 stub_->decoder()->GetGLContext()->GetHandle()), |
| 263 make_context_current_)); |
| 263 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) | 264 #elif defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) |
| 264 scoped_ptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); | 265 scoped_ptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); |
| 265 if (!device.get()) { | 266 if (!device.get()) { |
| 266 SendCreateDecoderReply(init_done_msg, false); | 267 SendCreateDecoderReply(init_done_msg, false); |
| 267 return; | 268 return; |
| 268 } | 269 } |
| 269 video_decode_accelerator_.reset(new V4L2VideoDecodeAccelerator( | 270 video_decode_accelerator_.reset(new V4L2VideoDecodeAccelerator( |
| 270 gfx::GLSurfaceEGL::GetHardwareDisplay(), | 271 gfx::GLSurfaceEGL::GetHardwareDisplay(), |
| 271 stub_->decoder()->GetGLContext()->GetHandle(), | 272 stub_->decoder()->GetGLContext()->GetHandle(), |
| 272 weak_factory_for_io_.GetWeakPtr(), | 273 weak_factory_for_io_.GetWeakPtr(), |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 return stub_->channel()->Send(message); | 508 return stub_->channel()->Send(message); |
| 508 } | 509 } |
| 509 | 510 |
| 510 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, | 511 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, |
| 511 bool succeeded) { | 512 bool succeeded) { |
| 512 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); | 513 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); |
| 513 Send(message); | 514 Send(message); |
| 514 } | 515 } |
| 515 | 516 |
| 516 } // namespace content | 517 } // namespace content |
| OLD | NEW |