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

Side by Side Diff: webrtc/video/overuse_frame_detector.cc

Issue 1751903002: Replace scoped_ptr with unique_ptr in webrtc/video/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 months 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
« no previous file with comments | « webrtc/video/overuse_frame_detector.h ('k') | webrtc/video/overuse_frame_detector_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 float InitialProcessingMs() const { 159 float InitialProcessingMs() const {
160 return InitialUsageInPercent() * kInitialSampleDiffMs / 100; 160 return InitialUsageInPercent() * kInitialSampleDiffMs / 100;
161 } 161 }
162 162
163 const float kWeightFactorFrameDiff; 163 const float kWeightFactorFrameDiff;
164 const float kWeightFactorProcessing; 164 const float kWeightFactorProcessing;
165 const float kInitialSampleDiffMs; 165 const float kInitialSampleDiffMs;
166 const float kMaxSampleDiffMs; 166 const float kMaxSampleDiffMs;
167 uint64_t count_; 167 uint64_t count_;
168 const CpuOveruseOptions options_; 168 const CpuOveruseOptions options_;
169 rtc::scoped_ptr<rtc::ExpFilter> filtered_processing_ms_; 169 std::unique_ptr<rtc::ExpFilter> filtered_processing_ms_;
170 rtc::scoped_ptr<rtc::ExpFilter> filtered_frame_diff_ms_; 170 std::unique_ptr<rtc::ExpFilter> filtered_frame_diff_ms_;
171 }; 171 };
172 172
173 OveruseFrameDetector::OveruseFrameDetector( 173 OveruseFrameDetector::OveruseFrameDetector(
174 Clock* clock, 174 Clock* clock,
175 const CpuOveruseOptions& options, 175 const CpuOveruseOptions& options,
176 CpuOveruseObserver* observer, 176 CpuOveruseObserver* observer,
177 EncodedFrameObserver* encoder_timing, 177 EncodedFrameObserver* encoder_timing,
178 CpuOveruseMetricsObserver* metrics_observer) 178 CpuOveruseMetricsObserver* metrics_observer)
179 : options_(options), 179 : options_(options),
180 observer_(observer), 180 observer_(observer),
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 bool OveruseFrameDetector::IsUnderusing(const CpuOveruseMetrics& metrics, 373 bool OveruseFrameDetector::IsUnderusing(const CpuOveruseMetrics& metrics,
374 int64_t time_now) { 374 int64_t time_now) {
375 int delay = in_quick_rampup_ ? kQuickRampUpDelayMs : current_rampup_delay_ms_; 375 int delay = in_quick_rampup_ ? kQuickRampUpDelayMs : current_rampup_delay_ms_;
376 if (time_now < last_rampup_time_ms_ + delay) 376 if (time_now < last_rampup_time_ms_ + delay)
377 return false; 377 return false;
378 378
379 return metrics.encode_usage_percent < 379 return metrics.encode_usage_percent <
380 options_.low_encode_usage_threshold_percent; 380 options_.low_encode_usage_threshold_percent;
381 } 381 }
382 } // namespace webrtc 382 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/video/overuse_frame_detector.h ('k') | webrtc/video/overuse_frame_detector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698