| 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_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | 166 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 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( | 172 void GpuVideoDecodeAcceleratorHost::SetOverlayInfo( |
| 173 int32_t surface_id, | 173 const OverlayInfo& overlay_info) { |
| 174 const base::Optional<base::UnguessableToken>& routing_token) { | |
| 175 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | 174 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 176 if (!channel_) | 175 if (!channel_) |
| 177 return; | 176 return; |
| 178 Send(new AcceleratedVideoDecoderMsg_SetSurface(decoder_route_id_, surface_id, | 177 Send(new AcceleratedVideoDecoderMsg_SetOverlayInfo(decoder_route_id_, |
| 179 routing_token)); | 178 overlay_info)); |
| 180 } | 179 } |
| 181 | 180 |
| 182 void GpuVideoDecodeAcceleratorHost::Destroy() { | 181 void GpuVideoDecodeAcceleratorHost::Destroy() { |
| 183 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); | 182 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 184 if (channel_) | 183 if (channel_) |
| 185 Send(new AcceleratedVideoDecoderMsg_Destroy(decoder_route_id_)); | 184 Send(new AcceleratedVideoDecoderMsg_Destroy(decoder_route_id_)); |
| 186 client_ = nullptr; | 185 client_ = nullptr; |
| 187 delete this; | 186 delete this; |
| 188 } | 187 } |
| 189 | 188 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 289 weak_this_factory_.InvalidateWeakPtrs(); | 288 weak_this_factory_.InvalidateWeakPtrs(); |
| 290 | 289 |
| 291 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the | 290 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the |
| 292 // last thing done on this stack! | 291 // last thing done on this stack! |
| 293 VideoDecodeAccelerator::Client* client = nullptr; | 292 VideoDecodeAccelerator::Client* client = nullptr; |
| 294 std::swap(client, client_); | 293 std::swap(client, client_); |
| 295 client->NotifyError(static_cast<VideoDecodeAccelerator::Error>(error)); | 294 client->NotifyError(static_cast<VideoDecodeAccelerator::Error>(error)); |
| 296 } | 295 } |
| 297 | 296 |
| 298 } // namespace media | 297 } // namespace media |
| OLD | NEW |