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

Unified Diff: webrtc/modules/video_coding/utility/quality_scaler.h

Issue 2652893015: Rename adaptation api methods, extended vie_encoder unit test. (Closed)
Patch Set: Rebase, again Created 3 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 | « no previous file | webrtc/modules/video_coding/utility/quality_scaler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/video_coding/utility/quality_scaler.h
diff --git a/webrtc/modules/video_coding/utility/quality_scaler.h b/webrtc/modules/video_coding/utility/quality_scaler.h
index 5734e6647e653dd4c99a74145b047e1d48aa4e1e..bf81e768e433971aadff0b2e38f1fdb11a6adaaa 100644
--- a/webrtc/modules/video_coding/utility/quality_scaler.h
+++ b/webrtc/modules/video_coding/utility/quality_scaler.h
@@ -21,18 +21,21 @@
namespace webrtc {
-// An interface for a class that receives scale up/down requests.
-class ScalingObserverInterface {
+// An interface for signaling requests to limit or increase the resolution or
+// framerate of the captured video stream.
+class AdaptationObserverInterface {
public:
- enum ScaleReason : size_t { kQuality = 0, kCpu = 1 };
+ // Indicates if the adaptation is due to overuse of the CPU resources, or if
+ // the quality of the encoded frames have dropped too low.
+ enum AdaptReason : size_t { kQuality = 0, kCpu = 1 };
static const size_t kScaleReasonSize = 2;
- // Called to signal that we can handle larger frames.
- virtual void ScaleUp(ScaleReason reason) = 0;
- // Called to signal that encoder to scale down.
- virtual void ScaleDown(ScaleReason reason) = 0;
+ // Called to signal that we can handle larger or more frequent frames.
+ virtual void AdaptUp(AdaptReason reason) = 0;
+ // Called to signal that the source should reduce the resolution or framerate.
+ virtual void AdaptDown(AdaptReason reason) = 0;
protected:
- virtual ~ScalingObserverInterface() {}
+ virtual ~AdaptationObserverInterface() {}
};
// QualityScaler runs asynchronously and monitors QP values of encoded frames.
@@ -43,9 +46,10 @@ class QualityScaler {
// Construct a QualityScaler with a given |observer|.
// This starts the quality scaler periodically checking what the average QP
// has been recently.
- QualityScaler(ScalingObserverInterface* observer, VideoCodecType codec_type);
+ QualityScaler(AdaptationObserverInterface* observer,
+ VideoCodecType codec_type);
// If specific thresholds are desired these can be supplied as |thresholds|.
- QualityScaler(ScalingObserverInterface* observer,
+ QualityScaler(AdaptationObserverInterface* observer,
VideoEncoder::QpThresholds thresholds);
virtual ~QualityScaler();
// Should be called each time the encoder drops a frame
@@ -55,7 +59,7 @@ class QualityScaler {
// The following members declared protected for testing purposes
protected:
- QualityScaler(ScalingObserverInterface* observer,
+ QualityScaler(AdaptationObserverInterface* observer,
VideoEncoder::QpThresholds thresholds,
int64_t sampling_period);
@@ -68,7 +72,7 @@ class QualityScaler {
int64_t GetSamplingPeriodMs() const;
CheckQPTask* check_qp_task_ GUARDED_BY(&task_checker_);
- ScalingObserverInterface* const observer_ GUARDED_BY(&task_checker_);
+ AdaptationObserverInterface* const observer_ GUARDED_BY(&task_checker_);
rtc::SequencedTaskChecker task_checker_;
const int64_t sampling_period_ms_;
« no previous file with comments | « no previous file | webrtc/modules/video_coding/utility/quality_scaler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698