| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logging.h" | 10 #include "base/logging.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 << "failed"; | 105 << "failed"; |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 | 108 |
| 109 void GpuVideoDecodeAccelerator::Initialize( | 109 void GpuVideoDecodeAccelerator::Initialize( |
| 110 const media::VideoDecodeAccelerator::Profile profile, | 110 const media::VideoDecodeAccelerator::Profile profile, |
| 111 IPC::Message* init_done_msg) { | 111 IPC::Message* init_done_msg) { |
| 112 DCHECK(!video_decode_accelerator_.get()); | 112 DCHECK(!video_decode_accelerator_.get()); |
| 113 DCHECK(!init_done_msg_); | 113 DCHECK(!init_done_msg_); |
| 114 DCHECK(init_done_msg); | 114 DCHECK(init_done_msg); |
| 115 init_done_msg_ = init_done_msg; |
| 115 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 116 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 116 DCHECK(stub_ && stub_->decoder()); | 117 DCHECK(stub_ && stub_->decoder()); |
| 117 init_done_msg_ = init_done_msg; | |
| 118 OmxVideoDecodeAccelerator* omx_decoder = new OmxVideoDecodeAccelerator(this); | 118 OmxVideoDecodeAccelerator* omx_decoder = new OmxVideoDecodeAccelerator(this); |
| 119 omx_decoder->SetEglState( | 119 omx_decoder->SetEglState( |
| 120 gfx::GLSurfaceEGL::GetHardwareDisplay(), | 120 gfx::GLSurfaceEGL::GetHardwareDisplay(), |
| 121 stub_->decoder()->GetGLContext()->GetHandle()); | 121 stub_->decoder()->GetGLContext()->GetHandle()); |
| 122 video_decode_accelerator_ = omx_decoder; | 122 video_decode_accelerator_ = omx_decoder; |
| 123 video_decode_accelerator_->Initialize(profile); | 123 video_decode_accelerator_->Initialize(profile); |
| 124 #else | 124 #else // Update RenderViewImpl::createMediaPlayer when adding clauses. |
| 125 NOTIMPLEMENTED() << "HW video decode acceleration not available."; | 125 NOTIMPLEMENTED() << "HW video decode acceleration not available."; |
| 126 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); | 126 NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE); |
| 127 #endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 127 #endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 128 } | 128 } |
| 129 | 129 |
| 130 void GpuVideoDecodeAccelerator::OnDecode( | 130 void GpuVideoDecodeAccelerator::OnDecode( |
| 131 base::SharedMemoryHandle handle, int32 id, int32 size) { | 131 base::SharedMemoryHandle handle, int32 id, int32 size) { |
| 132 DCHECK(video_decode_accelerator_.get()); | 132 DCHECK(video_decode_accelerator_.get()); |
| 133 video_decode_accelerator_->Decode(media::BitstreamBuffer(id, handle, size)); | 133 video_decode_accelerator_->Decode(media::BitstreamBuffer(id, handle, size)); |
| 134 } | 134 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 209 |
| 210 void GpuVideoDecodeAccelerator::NotifyResetDone() { | 210 void GpuVideoDecodeAccelerator::NotifyResetDone() { |
| 211 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_))) | 211 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_))) |
| 212 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed"; | 212 DLOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed"; |
| 213 } | 213 } |
| 214 | 214 |
| 215 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 215 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
| 216 DCHECK(sender_); | 216 DCHECK(sender_); |
| 217 return sender_->Send(message); | 217 return sender_->Send(message); |
| 218 } | 218 } |
| OLD | NEW |