| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/client/gpu_video_decode_accelerator_host.h" | 5 #include "content/common/gpu/client/gpu_video_decode_accelerator_host.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "content/common/gpu/client/gpu_channel_host.h" | 10 #include "content/common/gpu/client/gpu_channel_host.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 } | 170 } |
| 171 | 171 |
| 172 void GpuVideoDecodeAcceleratorHost::Destroy() { | 172 void GpuVideoDecodeAcceleratorHost::Destroy() { |
| 173 DCHECK(CalledOnValidThread()); | 173 DCHECK(CalledOnValidThread()); |
| 174 if (channel_) | 174 if (channel_) |
| 175 Send(new AcceleratedVideoDecoderMsg_Destroy(decoder_route_id_)); | 175 Send(new AcceleratedVideoDecoderMsg_Destroy(decoder_route_id_)); |
| 176 client_ = NULL; | 176 client_ = NULL; |
| 177 delete this; | 177 delete this; |
| 178 } | 178 } |
| 179 | 179 |
| 180 bool GpuVideoDecodeAcceleratorHost::CanDecodeOnIOThread() { |
| 181 NOTREACHED(); |
| 182 return false; |
| 183 } |
| 184 |
| 180 void GpuVideoDecodeAcceleratorHost::OnWillDeleteImpl() { | 185 void GpuVideoDecodeAcceleratorHost::OnWillDeleteImpl() { |
| 181 DCHECK(CalledOnValidThread()); | 186 DCHECK(CalledOnValidThread()); |
| 182 impl_ = NULL; | 187 impl_ = NULL; |
| 183 | 188 |
| 184 // The CommandBufferProxyImpl is going away; error out this VDA. | 189 // The CommandBufferProxyImpl is going away; error out this VDA. |
| 185 OnChannelError(); | 190 OnChannelError(); |
| 186 } | 191 } |
| 187 | 192 |
| 188 void GpuVideoDecodeAcceleratorHost::PostNotifyError(Error error) { | 193 void GpuVideoDecodeAcceleratorHost::PostNotifyError(Error error) { |
| 189 DCHECK(CalledOnValidThread()); | 194 DCHECK(CalledOnValidThread()); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 weak_this_factory_.InvalidateWeakPtrs(); | 263 weak_this_factory_.InvalidateWeakPtrs(); |
| 259 | 264 |
| 260 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the | 265 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the |
| 261 // last thing done on this stack! | 266 // last thing done on this stack! |
| 262 media::VideoDecodeAccelerator::Client* client = NULL; | 267 media::VideoDecodeAccelerator::Client* client = NULL; |
| 263 std::swap(client, client_); | 268 std::swap(client, client_); |
| 264 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error)); | 269 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error)); |
| 265 } | 270 } |
| 266 | 271 |
| 267 } // namespace content | 272 } // namespace content |
| OLD | NEW |