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

Unified Diff: webrtc/video/overuse_frame_detector.cc

Issue 2398963003: Move usage of QualityScaler to ViEEncoder. (Closed)
Patch Set: rebase Created 4 years, 1 month 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 1670dc3aaa2c327b0e7b822d850021592f7ca202..f4a9c866e0acc39febfb83ffa8732a3be443268d 100644
--- a/webrtc/video/overuse_frame_detector.cc
+++ b/webrtc/video/overuse_frame_detector.cc
@@ -49,6 +49,7 @@ const int kMaxOverusesBeforeApplyRampupDelay = 4;
const float kSampleDiffMs = 33.0f;
const float kMaxExp = 7.0f;
+const auto kScaleReasonCpu = ScalingObserverInterface::ScaleReason::kCpu;
} // namespace
CpuOveruseOptions::CpuOveruseOptions()
@@ -204,7 +205,7 @@ class OveruseFrameDetector::CheckOveruseTask : public rtc::QueuedTask {
OveruseFrameDetector::OveruseFrameDetector(
Clock* clock,
const CpuOveruseOptions& options,
- CpuOveruseObserver* observer,
+ ScalingObserverInterface* observer,
EncodedFrameObserver* encoder_timing,
CpuOveruseMetricsObserver* metrics_observer)
: check_overuse_task_(nullptr),
@@ -370,13 +371,13 @@ void OveruseFrameDetector::CheckForOveruse() {
++num_overuse_detections_;
if (observer_)
- observer_->OveruseDetected();
+ observer_->ScaleDown(kScaleReasonCpu);
} else if (IsUnderusing(*metrics_, now)) {
last_rampup_time_ms_ = now;
in_quick_rampup_ = true;
if (observer_)
- observer_->NormalUsage();
+ observer_->ScaleUp(kScaleReasonCpu);
}
int rampup_delay =
« 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