| 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 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 visible_rect = picture.visible_rect(); | 505 visible_rect = picture.visible_rect(); |
| 506 } | 506 } |
| 507 if (!gfx::Rect(pb.size()).Contains(visible_rect)) { | 507 if (!gfx::Rect(pb.size()).Contains(visible_rect)) { |
| 508 LOG(WARNING) << "Visible size " << visible_rect.ToString() | 508 LOG(WARNING) << "Visible size " << visible_rect.ToString() |
| 509 << " is larger than coded size " << pb.size().ToString(); | 509 << " is larger than coded size " << pb.size().ToString(); |
| 510 visible_rect = gfx::Rect(pb.size()); | 510 visible_rect = gfx::Rect(pb.size()); |
| 511 } | 511 } |
| 512 | 512 |
| 513 DCHECK(decoder_texture_target_); | 513 DCHECK(decoder_texture_target_); |
| 514 | 514 |
| 515 bool opaque = IsOpaque(config_.format()); | |
| 516 | |
| 517 scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture( | 515 scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture( |
| 518 opaque ? PIXEL_FORMAT_XRGB : PIXEL_FORMAT_ARGB, | 516 vda_->GetOutputFormat(), |
| 519 gpu::MailboxHolder(pb.texture_mailbox(), gpu::SyncToken(), | 517 gpu::MailboxHolder(pb.texture_mailbox(), gpu::SyncToken(), |
| 520 decoder_texture_target_), | 518 decoder_texture_target_), |
| 521 BindToCurrentLoop(base::Bind( | 519 BindToCurrentLoop(base::Bind( |
| 522 &GpuVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(), | 520 &GpuVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(), |
| 523 factories_, picture.picture_buffer_id(), pb.texture_id())), | 521 factories_, picture.picture_buffer_id(), pb.texture_id())), |
| 524 pb.size(), visible_rect, natural_size, timestamp)); | 522 pb.size(), visible_rect, natural_size, timestamp)); |
| 525 if (!frame) { | 523 if (!frame) { |
| 526 DLOG(ERROR) << "Create frame failed for: " << picture.picture_buffer_id(); | 524 DLOG(ERROR) << "Create frame failed for: " << picture.picture_buffer_id(); |
| 527 NotifyError(VideoDecodeAccelerator::PLATFORM_FAILURE); | 525 NotifyError(VideoDecodeAccelerator::PLATFORM_FAILURE); |
| 528 return; | 526 return; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 } | 723 } |
| 726 return false; | 724 return false; |
| 727 } | 725 } |
| 728 | 726 |
| 729 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 727 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
| 730 const { | 728 const { |
| 731 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 729 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
| 732 } | 730 } |
| 733 | 731 |
| 734 } // namespace media | 732 } // namespace media |
| OLD | NEW |