OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |