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

Unified Diff: webrtc/video/overuse_frame_detector.cc

Issue 1556703002: Remove always-on options in OveruseFrameDetector. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: remove redundant methods Created 4 years, 11 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/video/overuse_frame_detector.cc
diff --git a/webrtc/video/overuse_frame_detector.cc b/webrtc/video/overuse_frame_detector.cc
index db58266e38b994fad56a0ac4974a990a00122a0d..d971ad9d3ef79427c2da93e0d8b5522ac7056344 100644
--- a/webrtc/video/overuse_frame_detector.cc
+++ b/webrtc/video/overuse_frame_detector.cc
@@ -255,23 +255,10 @@ void OveruseFrameDetector::FrameCaptured(int width,
last_capture_time_ = now;
- if (options_.enable_extended_processing_usage) {
- frame_queue_->Start(capture_time_ms, now);
- }
-}
-
-void OveruseFrameDetector::FrameEncoded(int encode_time_ms) {
- if (options_.enable_extended_processing_usage)
- return;
-
- rtc::CritScope cs(&crit_);
- AddProcessingTime(encode_time_ms);
+ frame_queue_->Start(capture_time_ms, now);
}
void OveruseFrameDetector::FrameSent(int64_t capture_time_ms) {
- if (!options_.enable_extended_processing_usage)
- return;
-
rtc::CritScope cs(&crit_);
int delay_ms = frame_queue_->End(capture_time_ms,
clock_->TimeInMilliseconds());
@@ -356,12 +343,8 @@ int32_t OveruseFrameDetector::Process() {
}
bool OveruseFrameDetector::IsOverusing(const CpuOveruseMetrics& metrics) {
- bool overusing = false;
- if (options_.enable_encode_usage_method) {
- overusing = metrics.encode_usage_percent >=
- options_.high_encode_usage_threshold_percent;
- }
- if (overusing) {
+ if (metrics.encode_usage_percent >=
+ options_.high_encode_usage_threshold_percent) {
++checks_above_threshold_;
} else {
checks_above_threshold_ = 0;
@@ -375,11 +358,7 @@ bool OveruseFrameDetector::IsUnderusing(const CpuOveruseMetrics& metrics,
if (time_now < last_rampup_time_ + delay)
return false;
- bool underusing = false;
- if (options_.enable_encode_usage_method) {
- underusing = metrics.encode_usage_percent <
- options_.low_encode_usage_threshold_percent;
- }
- return underusing;
+ return metrics.encode_usage_percent <
+ options_.low_encode_usage_threshold_percent;
}
} // namespace webrtc
« 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