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/filters/gpu_video_decoder.h" | 5 #include "media/filters/gpu_video_decoder.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 assigned_picture_buffers_.find(picture.picture_buffer_id()); | 417 assigned_picture_buffers_.find(picture.picture_buffer_id()); |
418 if (it == assigned_picture_buffers_.end()) { | 418 if (it == assigned_picture_buffers_.end()) { |
419 NOTREACHED() << "Missing picture buffer: " << picture.picture_buffer_id(); | 419 NOTREACHED() << "Missing picture buffer: " << picture.picture_buffer_id(); |
420 NotifyError(VideoDecodeAccelerator::PLATFORM_FAILURE); | 420 NotifyError(VideoDecodeAccelerator::PLATFORM_FAILURE); |
421 return; | 421 return; |
422 } | 422 } |
423 const PictureBuffer& pb = it->second; | 423 const PictureBuffer& pb = it->second; |
424 | 424 |
425 // Update frame's timestamp. | 425 // Update frame's timestamp. |
426 base::TimeDelta timestamp; | 426 base::TimeDelta timestamp; |
| 427 // Some of the VDAs don't support and thus don't provide us with visible |
| 428 // size in picture.size, passing coded size instead, so drop it and use |
| 429 // config information instead. |
427 gfx::Rect visible_rect; | 430 gfx::Rect visible_rect; |
428 gfx::Size natural_size; | 431 gfx::Size natural_size; |
429 GetBufferData(picture.bitstream_buffer_id(), ×tamp, &visible_rect, | 432 GetBufferData(picture.bitstream_buffer_id(), ×tamp, &visible_rect, |
430 &natural_size); | 433 &natural_size); |
431 DCHECK(decoder_texture_target_); | 434 DCHECK(decoder_texture_target_); |
432 | 435 |
433 scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture( | 436 scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture( |
434 make_scoped_ptr(new gpu::MailboxHolder( | 437 make_scoped_ptr(new gpu::MailboxHolder( |
435 pb.texture_mailbox(), decoder_texture_target_, 0 /* sync_point */)), | 438 pb.texture_mailbox(), decoder_texture_target_, 0 /* sync_point */)), |
436 BindToCurrentLoop(base::Bind(&GpuVideoDecoder::ReleaseMailbox, | 439 BindToCurrentLoop(base::Bind(&GpuVideoDecoder::ReleaseMailbox, |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
602 DLOG(ERROR) << "VDA Error: " << error; | 605 DLOG(ERROR) << "VDA Error: " << error; |
603 DestroyVDA(); | 606 DestroyVDA(); |
604 } | 607 } |
605 | 608 |
606 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 609 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
607 const { | 610 const { |
608 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 611 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
609 } | 612 } |
610 | 613 |
611 } // namespace media | 614 } // namespace media |
OLD | NEW |