OLD | NEW |
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 24 matching lines...) Expand all Loading... |
35 // Called as soon as an overuse is detected. | 35 // Called as soon as an overuse is detected. |
36 virtual void OveruseDetected() = 0; | 36 virtual void OveruseDetected() = 0; |
37 // Called periodically when the system is not overused any longer. | 37 // Called periodically when the system is not overused any longer. |
38 virtual void NormalUsage() = 0; | 38 virtual void NormalUsage() = 0; |
39 | 39 |
40 protected: | 40 protected: |
41 virtual ~CpuOveruseObserver() {} | 41 virtual ~CpuOveruseObserver() {} |
42 }; | 42 }; |
43 | 43 |
44 struct CpuOveruseOptions { | 44 struct CpuOveruseOptions { |
45 CpuOveruseOptions() | 45 CpuOveruseOptions(); |
46 : low_encode_usage_threshold_percent(55), | |
47 high_encode_usage_threshold_percent(85), | |
48 frame_timeout_interval_ms(1500), | |
49 min_frame_samples(120), | |
50 min_process_count(3), | |
51 high_threshold_consecutive_count(2) {} | |
52 | 46 |
53 int low_encode_usage_threshold_percent; // Threshold for triggering underuse. | 47 int low_encode_usage_threshold_percent; // Threshold for triggering underuse. |
54 int high_encode_usage_threshold_percent; // Threshold for triggering overuse. | 48 int high_encode_usage_threshold_percent; // Threshold for triggering overuse. |
55 // General settings. | 49 // General settings. |
56 int frame_timeout_interval_ms; // The maximum allowed interval between two | 50 int frame_timeout_interval_ms; // The maximum allowed interval between two |
57 // frames before resetting estimations. | 51 // frames before resetting estimations. |
58 int min_frame_samples; // The minimum number of frames required. | 52 int min_frame_samples; // The minimum number of frames required. |
59 int min_process_count; // The number of initial process times required before | 53 int min_process_count; // The number of initial process times required before |
60 // triggering an overuse/underuse. | 54 // triggering an overuse/underuse. |
61 int high_threshold_consecutive_count; // The number of consecutive checks | 55 int high_threshold_consecutive_count; // The number of consecutive checks |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 std::list<FrameTiming> frame_timing_ GUARDED_BY(crit_); | 158 std::list<FrameTiming> frame_timing_ GUARDED_BY(crit_); |
165 | 159 |
166 rtc::ThreadChecker processing_thread_; | 160 rtc::ThreadChecker processing_thread_; |
167 | 161 |
168 RTC_DISALLOW_COPY_AND_ASSIGN(OveruseFrameDetector); | 162 RTC_DISALLOW_COPY_AND_ASSIGN(OveruseFrameDetector); |
169 }; | 163 }; |
170 | 164 |
171 } // namespace webrtc | 165 } // namespace webrtc |
172 | 166 |
173 #endif // WEBRTC_VIDEO_OVERUSE_FRAME_DETECTOR_H_ | 167 #endif // WEBRTC_VIDEO_OVERUSE_FRAME_DETECTOR_H_ |
OLD | NEW |