| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 } | 156 } |
| 157 | 157 |
| 158 void GpuVideoDecodeAccelerator::Initialize(const std::vector<uint32>& configs) { | 158 void GpuVideoDecodeAccelerator::Initialize(const std::vector<uint32>& configs) { |
| 159 DCHECK(!video_decode_accelerator_.get()); | 159 DCHECK(!video_decode_accelerator_.get()); |
| 160 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 160 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 161 DCHECK(stub_ && stub_->scheduler()); | 161 DCHECK(stub_ && stub_->scheduler()); |
| 162 OmxVideoDecodeAccelerator* omx_decoder = new OmxVideoDecodeAccelerator(this); | 162 OmxVideoDecodeAccelerator* omx_decoder = new OmxVideoDecodeAccelerator(this); |
| 163 omx_decoder->SetEglState( | 163 omx_decoder->SetEglState( |
| 164 gfx::GLSurfaceEGL::GetDisplay(), | 164 gfx::GLSurfaceEGL::GetDisplay(), |
| 165 stub_->scheduler()->decoder()->GetGLContext()->GetHandle()); | 165 stub_->scheduler()->decoder()->GetGLContext()->GetHandle()); |
| 166 video_decode_accelerator_.reset(omx_decoder); | 166 video_decode_accelerator_ = omx_decoder; |
| 167 video_decode_accelerator_->Initialize(configs); | 167 video_decode_accelerator_->Initialize(configs); |
| 168 #else | 168 #else |
| 169 NOTIMPLEMENTED() << "HW video decode acceleration not available."; | 169 NOTIMPLEMENTED() << "HW video decode acceleration not available."; |
| 170 #endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 170 #endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 171 } | 171 } |
| 172 | 172 |
| 173 void GpuVideoDecodeAccelerator::OnDecode( | 173 void GpuVideoDecodeAccelerator::OnDecode( |
| 174 const gpu::ReadWriteTokens&, /* tokens */ | 174 const gpu::ReadWriteTokens&, /* tokens */ |
| 175 base::SharedMemoryHandle handle, int32 id, int32 size) { | 175 base::SharedMemoryHandle handle, int32 id, int32 size) { |
| 176 DCHECK(video_decode_accelerator_.get()); | 176 DCHECK(video_decode_accelerator_.get()); |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 void GpuVideoDecodeAccelerator::NotifyFlushDone() { | 243 void GpuVideoDecodeAccelerator::NotifyFlushDone() { |
| 244 if (!Send(new AcceleratedVideoDecoderHostMsg_FlushDone(host_route_id_))) | 244 if (!Send(new AcceleratedVideoDecoderHostMsg_FlushDone(host_route_id_))) |
| 245 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_FlushDone) failed"; | 245 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_FlushDone) failed"; |
| 246 } | 246 } |
| 247 | 247 |
| 248 void GpuVideoDecodeAccelerator::NotifyResetDone() { | 248 void GpuVideoDecodeAccelerator::NotifyResetDone() { |
| 249 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_))) | 249 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_))) |
| 250 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed"; | 250 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed"; |
| 251 } | 251 } |
| 252 | 252 |
| 253 void GpuVideoDecodeAccelerator::NotifyDestroyDone() { | |
| 254 if (!Send(new AcceleratedVideoDecoderHostMsg_DestroyDone(host_route_id_))) | |
| 255 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_DestroyDone) failed"; | |
| 256 } | |
| 257 | |
| 258 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 253 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
| 259 DCHECK(sender_); | 254 DCHECK(sender_); |
| 260 return sender_->Send(message); | 255 return sender_->Send(message); |
| 261 } | 256 } |
| OLD | NEW |