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 492 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
503 visible_rect = picture.visible_rect(); | 503 visible_rect = picture.visible_rect(); |
504 } | 504 } |
505 if (!gfx::Rect(pb.size()).Contains(visible_rect)) { | 505 if (!gfx::Rect(pb.size()).Contains(visible_rect)) { |
506 LOG(WARNING) << "Visible size " << visible_rect.ToString() | 506 LOG(WARNING) << "Visible size " << visible_rect.ToString() |
507 << " is larger than coded size " << pb.size().ToString(); | 507 << " is larger than coded size " << pb.size().ToString(); |
508 visible_rect = gfx::Rect(pb.size()); | 508 visible_rect = gfx::Rect(pb.size()); |
509 } | 509 } |
510 | 510 |
511 DCHECK(decoder_texture_target_); | 511 DCHECK(decoder_texture_target_); |
512 | 512 |
513 bool opaque = IsOpaque(config_.format()); | |
514 | |
515 scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture( | 513 scoped_refptr<VideoFrame> frame(VideoFrame::WrapNativeTexture( |
516 opaque ? PIXEL_FORMAT_XRGB : PIXEL_FORMAT_ARGB, | 514 vda_->GetOutputFormat(), |
kcwu
2016/03/22 07:47:02
The original code will use XRGB for some cases. Bu
Pawel Osciak
2016/03/28 01:31:29
If a VDA doesn't implement GetOutputFormat(), it w
Pawel Osciak
2016/03/28 01:59:10
Sorry, I meant ARGB. As for the choice between XRG
| |
517 gpu::MailboxHolder(pb.texture_mailbox(), gpu::SyncToken(), | 515 gpu::MailboxHolder(pb.texture_mailbox(), gpu::SyncToken(), |
518 decoder_texture_target_), | 516 decoder_texture_target_), |
519 BindToCurrentLoop(base::Bind( | 517 BindToCurrentLoop(base::Bind( |
520 &GpuVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(), | 518 &GpuVideoDecoder::ReleaseMailbox, weak_factory_.GetWeakPtr(), |
521 factories_, picture.picture_buffer_id(), pb.texture_id())), | 519 factories_, picture.picture_buffer_id(), pb.texture_id())), |
522 pb.size(), visible_rect, natural_size, timestamp)); | 520 pb.size(), visible_rect, natural_size, timestamp)); |
523 if (!frame) { | 521 if (!frame) { |
524 DLOG(ERROR) << "Create frame failed for: " << picture.picture_buffer_id(); | 522 DLOG(ERROR) << "Create frame failed for: " << picture.picture_buffer_id(); |
525 NotifyError(VideoDecodeAccelerator::PLATFORM_FAILURE); | 523 NotifyError(VideoDecodeAccelerator::PLATFORM_FAILURE); |
526 return; | 524 return; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
719 } | 717 } |
720 return false; | 718 return false; |
721 } | 719 } |
722 | 720 |
723 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() | 721 void GpuVideoDecoder::DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent() |
724 const { | 722 const { |
725 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); | 723 DCHECK(factories_->GetTaskRunner()->BelongsToCurrentThread()); |
726 } | 724 } |
727 | 725 |
728 } // namespace media | 726 } // namespace media |
OLD | NEW |