| 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 "media/gpu/ipc/client/gpu_video_decode_accelerator_host.h" | 5 #include "media/gpu/ipc/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 "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 Send(new AcceleratedVideoDecoderMsg_Flush(decoder_route_id_)); | 162 Send(new AcceleratedVideoDecoderMsg_Flush(decoder_route_id_)); |
| 163 } | 163 } |
| 164 | 164 |
| 165 void GpuVideoDecodeAcceleratorHost::Reset() { | 165 void GpuVideoDecodeAcceleratorHost::Reset() { |
| 166 DCHECK(CalledOnValidThread()); | 166 DCHECK(CalledOnValidThread()); |
| 167 if (!channel_) | 167 if (!channel_) |
| 168 return; | 168 return; |
| 169 Send(new AcceleratedVideoDecoderMsg_Reset(decoder_route_id_)); | 169 Send(new AcceleratedVideoDecoderMsg_Reset(decoder_route_id_)); |
| 170 } | 170 } |
| 171 | 171 |
| 172 void GpuVideoDecodeAcceleratorHost::SetSurface(int32_t surface_id) { | 172 void GpuVideoDecodeAcceleratorHost::SetSurface( |
| 173 int32_t surface_id, |
| 174 const base::Optional<base::UnguessableToken>& routing_token) { |
| 173 DCHECK(CalledOnValidThread()); | 175 DCHECK(CalledOnValidThread()); |
| 174 if (!channel_) | 176 if (!channel_) |
| 175 return; | 177 return; |
| 176 Send( | 178 Send(new AcceleratedVideoDecoderMsg_SetSurface(decoder_route_id_, surface_id, |
| 177 new AcceleratedVideoDecoderMsg_SetSurface(decoder_route_id_, surface_id)); | 179 routing_token)); |
| 178 } | 180 } |
| 179 | 181 |
| 180 void GpuVideoDecodeAcceleratorHost::Destroy() { | 182 void GpuVideoDecodeAcceleratorHost::Destroy() { |
| 181 DCHECK(CalledOnValidThread()); | 183 DCHECK(CalledOnValidThread()); |
| 182 if (channel_) | 184 if (channel_) |
| 183 Send(new AcceleratedVideoDecoderMsg_Destroy(decoder_route_id_)); | 185 Send(new AcceleratedVideoDecoderMsg_Destroy(decoder_route_id_)); |
| 184 client_ = nullptr; | 186 client_ = nullptr; |
| 185 delete this; | 187 delete this; |
| 186 } | 188 } |
| 187 | 189 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 weak_this_factory_.InvalidateWeakPtrs(); | 289 weak_this_factory_.InvalidateWeakPtrs(); |
| 288 | 290 |
| 289 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the | 291 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the |
| 290 // last thing done on this stack! | 292 // last thing done on this stack! |
| 291 VideoDecodeAccelerator::Client* client = nullptr; | 293 VideoDecodeAccelerator::Client* client = nullptr; |
| 292 std::swap(client, client_); | 294 std::swap(client, client_); |
| 293 client->NotifyError(static_cast<VideoDecodeAccelerator::Error>(error)); | 295 client->NotifyError(static_cast<VideoDecodeAccelerator::Error>(error)); |
| 294 } | 296 } |
| 295 | 297 |
| 296 } // namespace media | 298 } // namespace media |
| OLD | NEW |