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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 int32_t picture_buffer_id) { | 235 int32_t picture_buffer_id) { |
236 DCHECK(CalledOnValidThread()); | 236 DCHECK(CalledOnValidThread()); |
237 if (client_) | 237 if (client_) |
238 client_->DismissPictureBuffer(picture_buffer_id); | 238 client_->DismissPictureBuffer(picture_buffer_id); |
239 } | 239 } |
240 | 240 |
241 void GpuVideoDecodeAcceleratorHost::OnPictureReady( | 241 void GpuVideoDecodeAcceleratorHost::OnPictureReady( |
242 int32_t picture_buffer_id, | 242 int32_t picture_buffer_id, |
243 int32_t bitstream_buffer_id, | 243 int32_t bitstream_buffer_id, |
244 const gfx::Rect& visible_rect, | 244 const gfx::Rect& visible_rect, |
245 bool allow_overlay, | 245 const gfx::ColorSpace& color_space, |
246 bool size_changed) { | 246 const std::pair<bool, bool>& allow_overlay_and_size_changed) { |
247 DCHECK(CalledOnValidThread()); | 247 DCHECK(CalledOnValidThread()); |
248 if (!client_) | 248 if (!client_) |
249 return; | 249 return; |
250 Picture picture(picture_buffer_id, bitstream_buffer_id, visible_rect, | 250 Picture picture(picture_buffer_id, bitstream_buffer_id, visible_rect, |
251 allow_overlay); | 251 color_space, allow_overlay_and_size_changed.first); |
252 picture.set_size_changed(size_changed); | 252 picture.set_size_changed(allow_overlay_and_size_changed.second); |
253 client_->PictureReady(picture); | 253 client_->PictureReady(picture); |
254 } | 254 } |
255 | 255 |
256 void GpuVideoDecodeAcceleratorHost::OnFlushDone() { | 256 void GpuVideoDecodeAcceleratorHost::OnFlushDone() { |
257 DCHECK(CalledOnValidThread()); | 257 DCHECK(CalledOnValidThread()); |
258 if (client_) | 258 if (client_) |
259 client_->NotifyFlushDone(); | 259 client_->NotifyFlushDone(); |
260 } | 260 } |
261 | 261 |
262 void GpuVideoDecodeAcceleratorHost::OnResetDone() { | 262 void GpuVideoDecodeAcceleratorHost::OnResetDone() { |
263 DCHECK(CalledOnValidThread()); | 263 DCHECK(CalledOnValidThread()); |
264 if (client_) | 264 if (client_) |
265 client_->NotifyResetDone(); | 265 client_->NotifyResetDone(); |
266 } | 266 } |
267 | 267 |
268 void GpuVideoDecodeAcceleratorHost::OnNotifyError(uint32_t error) { | 268 void GpuVideoDecodeAcceleratorHost::OnNotifyError(uint32_t error) { |
269 DCHECK(CalledOnValidThread()); | 269 DCHECK(CalledOnValidThread()); |
270 if (!client_) | 270 if (!client_) |
271 return; | 271 return; |
272 weak_this_factory_.InvalidateWeakPtrs(); | 272 weak_this_factory_.InvalidateWeakPtrs(); |
273 | 273 |
274 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the | 274 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the |
275 // last thing done on this stack! | 275 // last thing done on this stack! |
276 VideoDecodeAccelerator::Client* client = NULL; | 276 VideoDecodeAccelerator::Client* client = NULL; |
277 std::swap(client, client_); | 277 std::swap(client, client_); |
278 client->NotifyError(static_cast<VideoDecodeAccelerator::Error>(error)); | 278 client->NotifyError(static_cast<VideoDecodeAccelerator::Error>(error)); |
279 } | 279 } |
280 | 280 |
281 } // namespace media | 281 } // namespace media |
OLD | NEW |