Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(824)

Side by Side Diff: content/common/gpu/media/gpu_video_decode_accelerator.cc

Issue 7361010: Enable fire-and-forget Destroy of HW video decoder, and misc other improvements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: vrk CR responses. Created 9 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698