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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 private: | 109 private: |
110 int Fraction(int min_required_samples, float multiplier) const; | 110 int Fraction(int min_required_samples, float multiplier) const; |
111 int sum; | 111 int sum; |
112 int num_samples; | 112 int num_samples; |
113 }; | 113 }; |
114 struct StatsUpdateTimes { | 114 struct StatsUpdateTimes { |
115 StatsUpdateTimes() : resolution_update_ms(0) {} | 115 StatsUpdateTimes() : resolution_update_ms(0) {} |
116 int64_t resolution_update_ms; | 116 int64_t resolution_update_ms; |
117 int64_t bitrate_update_ms; | 117 int64_t bitrate_update_ms; |
118 }; | 118 }; |
| 119 struct QpCounters { |
| 120 SampleCounter vp8; |
| 121 }; |
| 122 struct QpFilter { |
| 123 QpFilter() : qp(0.97f) {} // Weight factor. |
| 124 rtc::ExpFilter qp; |
| 125 }; |
119 void PurgeOldStats() EXCLUSIVE_LOCKS_REQUIRED(crit_); | 126 void PurgeOldStats() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
120 VideoSendStream::StreamStats* GetStatsEntry(uint32_t ssrc) | 127 VideoSendStream::StreamStats* GetStatsEntry(uint32_t ssrc) |
121 EXCLUSIVE_LOCKS_REQUIRED(crit_); | 128 EXCLUSIVE_LOCKS_REQUIRED(crit_); |
122 void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_); | 129 void UpdateHistograms() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
123 | 130 |
124 Clock* const clock_; | 131 Clock* const clock_; |
125 const VideoSendStream::Config config_; | 132 const VideoSendStream::Config config_; |
126 mutable rtc::CriticalSection crit_; | 133 mutable rtc::CriticalSection crit_; |
127 VideoSendStream::Stats stats_ GUARDED_BY(crit_); | 134 VideoSendStream::Stats stats_ GUARDED_BY(crit_); |
128 rtc::RateTracker input_frame_rate_tracker_ GUARDED_BY(crit_); | 135 rtc::RateTracker input_frame_rate_tracker_ GUARDED_BY(crit_); |
129 rtc::RateTracker sent_frame_rate_tracker_ GUARDED_BY(crit_); | 136 rtc::RateTracker sent_frame_rate_tracker_ GUARDED_BY(crit_); |
130 uint32_t last_sent_frame_timestamp_ GUARDED_BY(crit_); | 137 uint32_t last_sent_frame_timestamp_ GUARDED_BY(crit_); |
131 std::map<uint32_t, StatsUpdateTimes> update_times_ GUARDED_BY(crit_); | 138 std::map<uint32_t, StatsUpdateTimes> update_times_ GUARDED_BY(crit_); |
132 | 139 |
133 int max_sent_width_per_timestamp_ GUARDED_BY(crit_); | 140 int max_sent_width_per_timestamp_ GUARDED_BY(crit_); |
134 int max_sent_height_per_timestamp_ GUARDED_BY(crit_); | 141 int max_sent_height_per_timestamp_ GUARDED_BY(crit_); |
135 SampleCounter input_width_counter_ GUARDED_BY(crit_); | 142 SampleCounter input_width_counter_ GUARDED_BY(crit_); |
136 SampleCounter input_height_counter_ GUARDED_BY(crit_); | 143 SampleCounter input_height_counter_ GUARDED_BY(crit_); |
137 SampleCounter sent_width_counter_ GUARDED_BY(crit_); | 144 SampleCounter sent_width_counter_ GUARDED_BY(crit_); |
138 SampleCounter sent_height_counter_ GUARDED_BY(crit_); | 145 SampleCounter sent_height_counter_ GUARDED_BY(crit_); |
139 SampleCounter encode_time_counter_ GUARDED_BY(crit_); | 146 SampleCounter encode_time_counter_ GUARDED_BY(crit_); |
140 BoolSampleCounter key_frame_counter_ GUARDED_BY(crit_); | 147 BoolSampleCounter key_frame_counter_ GUARDED_BY(crit_); |
141 BoolSampleCounter quality_limited_frame_counter_ GUARDED_BY(crit_); | 148 BoolSampleCounter quality_limited_frame_counter_ GUARDED_BY(crit_); |
142 SampleCounter quality_downscales_counter_ GUARDED_BY(crit_); | 149 SampleCounter quality_downscales_counter_ GUARDED_BY(crit_); |
143 BoolSampleCounter bw_limited_frame_counter_ GUARDED_BY(crit_); | 150 BoolSampleCounter bw_limited_frame_counter_ GUARDED_BY(crit_); |
144 SampleCounter bw_resolutions_disabled_counter_ GUARDED_BY(crit_); | 151 SampleCounter bw_resolutions_disabled_counter_ GUARDED_BY(crit_); |
145 SampleCounter delay_counter_ GUARDED_BY(crit_); | 152 SampleCounter delay_counter_ GUARDED_BY(crit_); |
146 SampleCounter max_delay_counter_ GUARDED_BY(crit_); | 153 SampleCounter max_delay_counter_ GUARDED_BY(crit_); |
| 154 // QP counters mapped by SSRC. |
| 155 std::map<uint32_t, QpCounters> qp_counters_ GUARDED_BY(crit_); |
| 156 // QP filter mapped by SSRC. |
| 157 std::map<uint32_t, QpFilter> qp_filters_ GUARDED_BY(crit_); |
147 }; | 158 }; |
148 | 159 |
149 } // namespace webrtc | 160 } // namespace webrtc |
150 #endif // WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_ | 161 #endif // WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_ |
OLD | NEW |