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

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

Issue 292183011: Make DefaultDeleter for Video{De|En}codeAccelerator (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: out-of-line DefaultDeleter::operator() Created 6 years, 6 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_encode_accelerator.h" 5 #include "content/common/gpu/media/gpu_video_encode_accelerator.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/memory/shared_memory.h" 9 #include "base/memory/shared_memory.h"
10 #include "base/message_loop/message_loop_proxy.h" 10 #include "base/message_loop/message_loop_proxy.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 void GpuVideoEncodeAccelerator::NotifyError( 143 void GpuVideoEncodeAccelerator::NotifyError(
144 media::VideoEncodeAccelerator::Error error) { 144 media::VideoEncodeAccelerator::Error error) {
145 Send(new AcceleratedVideoEncoderHostMsg_NotifyError(host_route_id_, error)); 145 Send(new AcceleratedVideoEncoderHostMsg_NotifyError(host_route_id_, error));
146 } 146 }
147 147
148 void GpuVideoEncodeAccelerator::OnWillDestroyStub() { 148 void GpuVideoEncodeAccelerator::OnWillDestroyStub() {
149 DCHECK(stub_); 149 DCHECK(stub_);
150 stub_->channel()->RemoveRoute(host_route_id_); 150 stub_->channel()->RemoveRoute(host_route_id_);
151 stub_->RemoveDestructionObserver(this); 151 stub_->RemoveDestructionObserver(this);
152 152
153 if (encoder_)
154 encoder_.release()->Destroy();
155
156 delete this; 153 delete this;
157 } 154 }
158 155
159 // static 156 // static
160 std::vector<media::VideoEncodeAccelerator::SupportedProfile> 157 std::vector<media::VideoEncodeAccelerator::SupportedProfile>
161 GpuVideoEncodeAccelerator::GetSupportedProfiles() { 158 GpuVideoEncodeAccelerator::GetSupportedProfiles() {
162 std::vector<media::VideoEncodeAccelerator::SupportedProfile> profiles; 159 std::vector<media::VideoEncodeAccelerator::SupportedProfile> profiles;
163 160
164 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11) 161 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_ARMEL) && defined(USE_X11)
165 profiles = V4L2VideoEncodeAccelerator::GetSupportedProfiles(); 162 profiles = V4L2VideoEncodeAccelerator::GetSupportedProfiles();
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 stub_->channel()->Send(message); 289 stub_->channel()->Send(message);
293 } 290 }
294 291
295 void GpuVideoEncodeAccelerator::SendCreateEncoderReply(IPC::Message* message, 292 void GpuVideoEncodeAccelerator::SendCreateEncoderReply(IPC::Message* message,
296 bool succeeded) { 293 bool succeeded) {
297 GpuCommandBufferMsg_CreateVideoEncoder::WriteReplyParams(message, succeeded); 294 GpuCommandBufferMsg_CreateVideoEncoder::WriteReplyParams(message, succeeded);
298 Send(message); 295 Send(message);
299 } 296 }
300 297
301 } // namespace content 298 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/media/gpu_video_decode_accelerator.cc ('k') | content/common/gpu/media/video_decode_accelerator_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698