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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 } | 224 } |
225 | 225 |
226 void GpuVideoDecodeAcceleratorHost::OnDismissPictureBuffer( | 226 void GpuVideoDecodeAcceleratorHost::OnDismissPictureBuffer( |
227 int32 picture_buffer_id) { | 227 int32 picture_buffer_id) { |
228 DCHECK(CalledOnValidThread()); | 228 DCHECK(CalledOnValidThread()); |
229 if (client_) | 229 if (client_) |
230 client_->DismissPictureBuffer(picture_buffer_id); | 230 client_->DismissPictureBuffer(picture_buffer_id); |
231 } | 231 } |
232 | 232 |
233 void GpuVideoDecodeAcceleratorHost::OnPictureReady( | 233 void GpuVideoDecodeAcceleratorHost::OnPictureReady( |
234 int32 picture_buffer_id, int32 bitstream_buffer_id) { | 234 int32 picture_buffer_id, |
| 235 int32 bitstream_buffer_id, |
| 236 const gfx::Rect& visible_rect) { |
235 DCHECK(CalledOnValidThread()); | 237 DCHECK(CalledOnValidThread()); |
236 if (!client_) | 238 if (!client_) |
237 return; | 239 return; |
238 media::Picture picture(picture_buffer_id, bitstream_buffer_id); | 240 media::Picture picture(picture_buffer_id, bitstream_buffer_id, visible_rect); |
239 client_->PictureReady(picture); | 241 client_->PictureReady(picture); |
240 } | 242 } |
241 | 243 |
242 void GpuVideoDecodeAcceleratorHost::OnFlushDone() { | 244 void GpuVideoDecodeAcceleratorHost::OnFlushDone() { |
243 DCHECK(CalledOnValidThread()); | 245 DCHECK(CalledOnValidThread()); |
244 if (client_) | 246 if (client_) |
245 client_->NotifyFlushDone(); | 247 client_->NotifyFlushDone(); |
246 } | 248 } |
247 | 249 |
248 void GpuVideoDecodeAcceleratorHost::OnResetDone() { | 250 void GpuVideoDecodeAcceleratorHost::OnResetDone() { |
249 DCHECK(CalledOnValidThread()); | 251 DCHECK(CalledOnValidThread()); |
250 if (client_) | 252 if (client_) |
251 client_->NotifyResetDone(); | 253 client_->NotifyResetDone(); |
252 } | 254 } |
253 | 255 |
254 void GpuVideoDecodeAcceleratorHost::OnNotifyError(uint32 error) { | 256 void GpuVideoDecodeAcceleratorHost::OnNotifyError(uint32 error) { |
255 DCHECK(CalledOnValidThread()); | 257 DCHECK(CalledOnValidThread()); |
256 if (!client_) | 258 if (!client_) |
257 return; | 259 return; |
258 weak_this_factory_.InvalidateWeakPtrs(); | 260 weak_this_factory_.InvalidateWeakPtrs(); |
259 | 261 |
260 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the | 262 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the |
261 // last thing done on this stack! | 263 // last thing done on this stack! |
262 media::VideoDecodeAccelerator::Client* client = NULL; | 264 media::VideoDecodeAccelerator::Client* client = NULL; |
263 std::swap(client, client_); | 265 std::swap(client, client_); |
264 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error)); | 266 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error)); |
265 } | 267 } |
266 | 268 |
267 } // namespace content | 269 } // namespace content |
OLD | NEW |