Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(818)

Side by Side Diff: content/renderer/media/rtc_video_decoder.cc

Issue 1490333005: Don't require VDAs to return all PictureBuffers at once. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cl feedback. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
805 } 805 }
806 806
807 void RTCVideoDecoder::ClearPendingBuffers() { 807 void RTCVideoDecoder::ClearPendingBuffers() {
808 // Delete WebRTC input buffers. 808 // Delete WebRTC input buffers.
809 for (const auto& pending_buffer : pending_buffers_) 809 for (const auto& pending_buffer : pending_buffers_)
810 delete[] pending_buffer.first._buffer; 810 delete[] pending_buffer.first._buffer;
811 pending_buffers_.clear(); 811 pending_buffers_.clear();
812 } 812 }
813 813
814 } // namespace content 814 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698