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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 | 80 |
81 // From FrameCountObserver. | 81 // From FrameCountObserver. |
82 void FrameCountUpdated(const FrameCounts& frame_counts, | 82 void FrameCountUpdated(const FrameCounts& frame_counts, |
83 uint32_t ssrc) override; | 83 uint32_t ssrc) override; |
84 | 84 |
85 void SendSideDelayUpdated(int avg_delay_ms, | 85 void SendSideDelayUpdated(int avg_delay_ms, |
86 int max_delay_ms, | 86 int max_delay_ms, |
87 uint32_t ssrc) override; | 87 uint32_t ssrc) override; |
88 | 88 |
89 private: | 89 private: |
90 struct SampleCounter { | 90 class SampleCounter { |
| 91 public: |
91 SampleCounter() : sum(0), num_samples(0) {} | 92 SampleCounter() : sum(0), num_samples(0) {} |
| 93 ~SampleCounter() {} |
92 void Add(int sample); | 94 void Add(int sample); |
93 int Avg(int min_required_samples) const; | 95 int Avg(int min_required_samples) const; |
94 | 96 |
95 private: | 97 private: |
96 int sum; | 98 int sum; |
97 int num_samples; | 99 int num_samples; |
98 }; | 100 }; |
99 struct BoolSampleCounter { | 101 class BoolSampleCounter { |
| 102 public: |
100 BoolSampleCounter() : sum(0), num_samples(0) {} | 103 BoolSampleCounter() : sum(0), num_samples(0) {} |
| 104 ~BoolSampleCounter() {} |
101 void Add(bool sample); | 105 void Add(bool sample); |
102 int Percent(int min_required_samples) const; | 106 int Percent(int min_required_samples) const; |
103 int Permille(int min_required_samples) const; | 107 int Permille(int min_required_samples) const; |
104 | 108 |
105 private: | 109 private: |
106 int Fraction(int min_required_samples, float multiplier) const; | 110 int Fraction(int min_required_samples, float multiplier) const; |
107 int sum; | 111 int sum; |
108 int num_samples; | 112 int num_samples; |
109 }; | 113 }; |
110 struct StatsUpdateTimes { | 114 struct StatsUpdateTimes { |
(...skipping 18 matching lines...) Expand all Loading... |
129 int max_sent_width_per_timestamp_ GUARDED_BY(crit_); | 133 int max_sent_width_per_timestamp_ GUARDED_BY(crit_); |
130 int max_sent_height_per_timestamp_ GUARDED_BY(crit_); | 134 int max_sent_height_per_timestamp_ GUARDED_BY(crit_); |
131 SampleCounter input_width_counter_ GUARDED_BY(crit_); | 135 SampleCounter input_width_counter_ GUARDED_BY(crit_); |
132 SampleCounter input_height_counter_ GUARDED_BY(crit_); | 136 SampleCounter input_height_counter_ GUARDED_BY(crit_); |
133 SampleCounter sent_width_counter_ GUARDED_BY(crit_); | 137 SampleCounter sent_width_counter_ GUARDED_BY(crit_); |
134 SampleCounter sent_height_counter_ GUARDED_BY(crit_); | 138 SampleCounter sent_height_counter_ GUARDED_BY(crit_); |
135 SampleCounter encode_time_counter_ GUARDED_BY(crit_); | 139 SampleCounter encode_time_counter_ GUARDED_BY(crit_); |
136 BoolSampleCounter key_frame_counter_ GUARDED_BY(crit_); | 140 BoolSampleCounter key_frame_counter_ GUARDED_BY(crit_); |
137 BoolSampleCounter quality_limited_frame_counter_ GUARDED_BY(crit_); | 141 BoolSampleCounter quality_limited_frame_counter_ GUARDED_BY(crit_); |
138 SampleCounter quality_downscales_counter_ GUARDED_BY(crit_); | 142 SampleCounter quality_downscales_counter_ GUARDED_BY(crit_); |
| 143 BoolSampleCounter bw_limited_frame_counter_ GUARDED_BY(crit_); |
| 144 SampleCounter bw_resolutions_disabled_counter_ GUARDED_BY(crit_); |
139 }; | 145 }; |
140 | 146 |
141 } // namespace webrtc | 147 } // namespace webrtc |
142 #endif // WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_ | 148 #endif // WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_ |
OLD | NEW |