Chromium Code Reviews| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 85 | 85 |
| 86 void GpuVideoDecodeAccelerator::NotifyError( | 86 void GpuVideoDecodeAccelerator::NotifyError( |
| 87 media::VideoDecodeAccelerator::Error error) { | 87 media::VideoDecodeAccelerator::Error error) { |
| 88 if (!Send(new AcceleratedVideoDecoderHostMsg_ErrorNotification( | 88 if (!Send(new AcceleratedVideoDecoderHostMsg_ErrorNotification( |
| 89 host_route_id_, error))) { | 89 host_route_id_, error))) { |
| 90 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ErrorNotification) " | 90 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ErrorNotification) " |
| 91 << "failed"; | 91 << "failed"; |
| 92 } | 92 } |
| 93 } | 93 } |
| 94 | 94 |
| 95 void GpuVideoDecodeAccelerator::Initialize(const std::vector<uint32>& configs) { | 95 void GpuVideoDecodeAccelerator::Initialize( |
| 96 const std::vector<uint32>& configs, | |
| 97 IPC::Message* init_done_msg) { | |
| 96 DCHECK(!video_decode_accelerator_.get()); | 98 DCHECK(!video_decode_accelerator_.get()); |
| 97 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 99 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 98 DCHECK(stub_ && stub_->scheduler()); | 100 DCHECK(stub_ && stub_->scheduler()); |
|
piman
2011/07/28 23:40:59
Add a DCHECK(!init_done_msg_) ? Also, you wanna in
Ami GONE FROM CHROMIUM
2011/07/29 05:58:48
Done & done.
| |
| 101 init_done_msg_ = init_done_msg; | |
| 99 OmxVideoDecodeAccelerator* omx_decoder = new OmxVideoDecodeAccelerator(this); | 102 OmxVideoDecodeAccelerator* omx_decoder = new OmxVideoDecodeAccelerator(this); |
| 100 omx_decoder->SetEglState( | 103 omx_decoder->SetEglState( |
| 101 gfx::GLSurfaceEGL::GetHardwareDisplay(), | 104 gfx::GLSurfaceEGL::GetHardwareDisplay(), |
| 102 stub_->scheduler()->decoder()->GetGLContext()->GetHandle()); | 105 stub_->scheduler()->decoder()->GetGLContext()->GetHandle()); |
| 103 video_decode_accelerator_ = omx_decoder; | 106 video_decode_accelerator_ = omx_decoder; |
| 104 video_decode_accelerator_->Initialize(configs); | 107 video_decode_accelerator_->Initialize(configs); |
| 105 #else | 108 #else |
| 106 NOTIMPLEMENTED() << "HW video decode acceleration not available."; | 109 NOTIMPLEMENTED() << "HW video decode acceleration not available."; |
| 107 #endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) | 110 #endif // defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) |
| 108 } | 111 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 160 int32 bitstream_buffer_id) { | 163 int32 bitstream_buffer_id) { |
| 161 if (!Send(new AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed( | 164 if (!Send(new AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed( |
| 162 host_route_id_, bitstream_buffer_id))) { | 165 host_route_id_, bitstream_buffer_id))) { |
| 163 DLOG(ERROR) | 166 DLOG(ERROR) |
| 164 << "Send(AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed) " | 167 << "Send(AcceleratedVideoDecoderHostMsg_BitstreamBufferProcessed) " |
| 165 << "failed"; | 168 << "failed"; |
| 166 } | 169 } |
| 167 } | 170 } |
| 168 | 171 |
| 169 void GpuVideoDecodeAccelerator::NotifyInitializeDone() { | 172 void GpuVideoDecodeAccelerator::NotifyInitializeDone() { |
| 170 if (!Send(new AcceleratedVideoDecoderHostMsg_InitializeDone(host_route_id_))) | 173 if (!Send(init_done_msg_)) |
| 171 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_InitializeDone) failed"; | 174 LOG(ERROR) << "Send(init_done_msg_) failed"; |
| 175 init_done_msg_ = NULL; | |
| 172 } | 176 } |
| 173 | 177 |
| 174 void GpuVideoDecodeAccelerator::NotifyFlushDone() { | 178 void GpuVideoDecodeAccelerator::NotifyFlushDone() { |
| 175 if (!Send(new AcceleratedVideoDecoderHostMsg_FlushDone(host_route_id_))) | 179 if (!Send(new AcceleratedVideoDecoderHostMsg_FlushDone(host_route_id_))) |
| 176 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_FlushDone) failed"; | 180 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_FlushDone) failed"; |
| 177 } | 181 } |
| 178 | 182 |
| 179 void GpuVideoDecodeAccelerator::NotifyResetDone() { | 183 void GpuVideoDecodeAccelerator::NotifyResetDone() { |
| 180 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_))) | 184 if (!Send(new AcceleratedVideoDecoderHostMsg_ResetDone(host_route_id_))) |
| 181 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed"; | 185 LOG(ERROR) << "Send(AcceleratedVideoDecoderHostMsg_ResetDone) failed"; |
| 182 } | 186 } |
| 183 | 187 |
| 184 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { | 188 bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) { |
| 185 DCHECK(sender_); | 189 DCHECK(sender_); |
| 186 return sender_->Send(message); | 190 return sender_->Send(message); |
| 187 } | 191 } |
| OLD | NEW |