Index: webrtc/video/bad_call_threshold.h |
diff --git a/webrtc/video/bad_call_threshold.h b/webrtc/video/bad_call_threshold.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..54035fbe6291eef1b4964d864dea260b9685dffe |
--- /dev/null |
+++ b/webrtc/video/bad_call_threshold.h |
@@ -0,0 +1,45 @@ |
+/* |
+ * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
+ * |
+ * Use of this source code is governed by a BSD-style license |
+ * that can be found in the LICENSE file in the root of the source |
+ * tree. An additional intellectual property rights grant can be found |
+ * in the file PATENTS. All contributing project authors may |
+ * be found in the AUTHORS file in the root of the source tree. |
+ */ |
+ |
+#ifndef WEBRTC_VIDEO_BAD_CALL_THRESHOLD_H_ |
+#define WEBRTC_VIDEO_BAD_CALL_THRESHOLD_H_ |
+ |
+#include <memory> |
+ |
+namespace webrtc { |
+ |
+class BadCallThreshold { |
palmkvist
2016/11/15 15:01:01
I am by the way rather unhappy with this name, so
sprang_webrtc
2016/11/16 13:20:09
Hm, dunno. How about QualityThreshold?
|
+ public: |
+ BadCallThreshold(int threshold, |
+ int default_measurement, |
+ float fraction, |
+ int max_measurements); |
+ |
+ enum BadCallState { |
+ NEWLY_LOW, |
+ STILL_LOW, |
+ NEWLY_HIGH, |
+ STILL_HIGH, |
+ }; |
sprang_webrtc
2016/11/14 13:14:15
Could you add a short comment explaining these?
Al
|
+ |
+ BadCallState AddMeasurement(int measurement); |
+ |
+ private: |
+ const std::unique_ptr<int[]> buffer_; |
sprang_webrtc
2016/11/14 13:14:15
Unless we want to be able to dynamically change th
palmkvist
2016/11/15 15:01:01
We do need the values to calculate the variance th
sprang_webrtc
2016/11/16 13:20:09
True. Though I think just keeping a sum of squares
|
+ const int max_measurements_; |
+ float fraction_; |
+ int threshold_; |
+ int next_index_; |
+ bool is_high_; |
+}; |
+ |
+} // namespace webrtc |
+ |
+#endif // WEBRTC_VIDEO_BAD_CALL_THRESHOLD_H_ |