OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/renderer/media/rtc_video_decoder.h" | 5 #include "content/renderer/media/rtc_video_decoder.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/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 return; | 645 return; |
646 } | 646 } |
647 | 647 |
648 // DestroyVDA() might already have been called. | 648 // DestroyVDA() might already have been called. |
649 if (vda_) | 649 if (vda_) |
650 vda_->ReusePictureBuffer(picture_buffer_id); | 650 vda_->ReusePictureBuffer(picture_buffer_id); |
651 } | 651 } |
652 | 652 |
653 bool RTCVideoDecoder::IsProfileSupported(media::VideoCodecProfile profile) { | 653 bool RTCVideoDecoder::IsProfileSupported(media::VideoCodecProfile profile) { |
654 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); | 654 DCheckGpuVideoAcceleratorFactoriesTaskRunnerIsCurrent(); |
655 media::VideoDecodeAccelerator::SupportedProfiles supported_profiles = | 655 media::VideoDecodeAccelerator::Capabilities capabilities = |
656 factories_->GetVideoDecodeAcceleratorSupportedProfiles(); | 656 factories_->GetVideoDecodeAcceleratorCapabilities(); |
657 | 657 |
658 for (const auto& supported_profile : supported_profiles) { | 658 for (const auto& supported_profile : capabilities.supported_profiles) { |
659 if (profile == supported_profile.profile) { | 659 if (profile == supported_profile.profile) { |
660 min_resolution_ = supported_profile.min_resolution; | 660 min_resolution_ = supported_profile.min_resolution; |
661 max_resolution_ = supported_profile.max_resolution; | 661 max_resolution_ = supported_profile.max_resolution; |
662 return true; | 662 return true; |
663 } | 663 } |
664 } | 664 } |
665 | 665 |
666 return false; | 666 return false; |
667 } | 667 } |
668 | 668 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
803 } | 803 } |
804 | 804 |
805 void RTCVideoDecoder::ClearPendingBuffers() { | 805 void RTCVideoDecoder::ClearPendingBuffers() { |
806 // Delete WebRTC input buffers. | 806 // Delete WebRTC input buffers. |
807 for (const auto& pending_buffer : pending_buffers_) | 807 for (const auto& pending_buffer : pending_buffers_) |
808 delete[] pending_buffer.first._buffer; | 808 delete[] pending_buffer.first._buffer; |
809 pending_buffers_.clear(); | 809 pending_buffers_.clear(); |
810 } | 810 } |
811 | 811 |
812 } // namespace content | 812 } // namespace content |
OLD | NEW |