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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 void Stop(int64_t now_ms); | 155 void Stop(int64_t now_ms); |
156 void Restart(int64_t now_ms); | 156 void Restart(int64_t now_ms); |
157 int64_t start_ms = -1; | 157 int64_t start_ms = -1; |
158 int64_t total_ms = 0; | 158 int64_t total_ms = 0; |
159 }; | 159 }; |
160 struct QpCounters { | 160 struct QpCounters { |
161 SampleCounter vp8; // QP range: 0-127. | 161 SampleCounter vp8; // QP range: 0-127. |
162 SampleCounter vp9; // QP range: 0-255. | 162 SampleCounter vp9; // QP range: 0-255. |
163 SampleCounter h264; // QP range: 0-51. | 163 SampleCounter h264; // QP range: 0-51. |
164 }; | 164 }; |
165 void PurgeOldStats() EXCLUSIVE_LOCKS_REQUIRED(crit_); | 165 void PurgeOldStats() RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); |
166 VideoSendStream::StreamStats* GetStatsEntry(uint32_t ssrc) | 166 VideoSendStream::StreamStats* GetStatsEntry(uint32_t ssrc) |
167 EXCLUSIVE_LOCKS_REQUIRED(crit_); | 167 RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); |
168 | 168 |
169 void SetAdaptTimer(const VideoStreamEncoder::AdaptCounts& counts, | 169 void SetAdaptTimer(const VideoStreamEncoder::AdaptCounts& counts, |
170 StatsTimer* timer) | 170 StatsTimer* timer) RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); |
171 EXCLUSIVE_LOCKS_REQUIRED(crit_); | |
172 void UpdateAdaptationStats( | 171 void UpdateAdaptationStats( |
173 const VideoStreamEncoder::AdaptCounts& cpu_counts, | 172 const VideoStreamEncoder::AdaptCounts& cpu_counts, |
174 const VideoStreamEncoder::AdaptCounts& quality_counts) | 173 const VideoStreamEncoder::AdaptCounts& quality_counts) |
175 EXCLUSIVE_LOCKS_REQUIRED(crit_); | 174 RTC_EXCLUSIVE_LOCKS_REQUIRED(crit_); |
176 | 175 |
177 Clock* const clock_; | 176 Clock* const clock_; |
178 const std::string payload_name_; | 177 const std::string payload_name_; |
179 const VideoSendStream::Config::Rtp rtp_config_; | 178 const VideoSendStream::Config::Rtp rtp_config_; |
180 rtc::CriticalSection crit_; | 179 rtc::CriticalSection crit_; |
181 VideoEncoderConfig::ContentType content_type_ GUARDED_BY(crit_); | 180 VideoEncoderConfig::ContentType content_type_ RTC_GUARDED_BY(crit_); |
182 const int64_t start_ms_; | 181 const int64_t start_ms_; |
183 VideoSendStream::Stats stats_ GUARDED_BY(crit_); | 182 VideoSendStream::Stats stats_ RTC_GUARDED_BY(crit_); |
184 uint32_t last_sent_frame_timestamp_ GUARDED_BY(crit_); | 183 uint32_t last_sent_frame_timestamp_ RTC_GUARDED_BY(crit_); |
185 std::map<uint32_t, StatsUpdateTimes> update_times_ GUARDED_BY(crit_); | 184 std::map<uint32_t, StatsUpdateTimes> update_times_ RTC_GUARDED_BY(crit_); |
186 rtc::ExpFilter encode_time_ GUARDED_BY(crit_); | 185 rtc::ExpFilter encode_time_ RTC_GUARDED_BY(crit_); |
187 int quality_downscales_ GUARDED_BY(crit_); | 186 int quality_downscales_ RTC_GUARDED_BY(crit_); |
188 int cpu_downscales_ GUARDED_BY(crit_); | 187 int cpu_downscales_ RTC_GUARDED_BY(crit_); |
189 | 188 |
190 // Contains stats used for UMA histograms. These stats will be reset if | 189 // Contains stats used for UMA histograms. These stats will be reset if |
191 // content type changes between real-time video and screenshare, since these | 190 // content type changes between real-time video and screenshare, since these |
192 // will be reported separately. | 191 // will be reported separately. |
193 struct UmaSamplesContainer { | 192 struct UmaSamplesContainer { |
194 UmaSamplesContainer(const char* prefix, | 193 UmaSamplesContainer(const char* prefix, |
195 const VideoSendStream::Stats& start_stats, | 194 const VideoSendStream::Stats& start_stats, |
196 Clock* clock); | 195 Clock* clock); |
197 ~UmaSamplesContainer(); | 196 ~UmaSamplesContainer(); |
198 | 197 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 StatsTimer quality_adapt_timer_; | 232 StatsTimer quality_adapt_timer_; |
234 BoolSampleCounter paused_time_counter_; | 233 BoolSampleCounter paused_time_counter_; |
235 TargetRateUpdates target_rate_updates_; | 234 TargetRateUpdates target_rate_updates_; |
236 ReportBlockStats report_block_stats_; | 235 ReportBlockStats report_block_stats_; |
237 const VideoSendStream::Stats start_stats_; | 236 const VideoSendStream::Stats start_stats_; |
238 | 237 |
239 std::map<int, QpCounters> | 238 std::map<int, QpCounters> |
240 qp_counters_; // QP counters mapped by spatial idx. | 239 qp_counters_; // QP counters mapped by spatial idx. |
241 }; | 240 }; |
242 | 241 |
243 std::unique_ptr<UmaSamplesContainer> uma_container_ GUARDED_BY(crit_); | 242 std::unique_ptr<UmaSamplesContainer> uma_container_ RTC_GUARDED_BY(crit_); |
244 }; | 243 }; |
245 | 244 |
246 } // namespace webrtc | 245 } // namespace webrtc |
247 #endif // WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_ | 246 #endif // WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_ |
OLD | NEW |