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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
143 int64_t resolution_update_ms; | 143 int64_t resolution_update_ms; |
144 int64_t bitrate_update_ms; | 144 int64_t bitrate_update_ms; |
145 }; | 145 }; |
146 struct TargetRateUpdates { | 146 struct TargetRateUpdates { |
147 TargetRateUpdates() | 147 TargetRateUpdates() |
148 : pause_resume_events(0), last_paused_or_resumed(false), last_ms(-1) {} | 148 : pause_resume_events(0), last_paused_or_resumed(false), last_ms(-1) {} |
149 int pause_resume_events; | 149 int pause_resume_events; |
150 bool last_paused_or_resumed; | 150 bool last_paused_or_resumed; |
151 int64_t last_ms; | 151 int64_t last_ms; |
152 }; | 152 }; |
153 struct FallbackEncoderInfo { | |
154 bool is_possible = true; | |
155 bool is_active = false; | |
156 int on_off_events = 0; | |
157 int64_t elapsed_ms = 0; | |
158 rtc::Optional<int64_t> last_update_ms; | |
159 const int max_frame_diff_ms = 2000; | |
160 }; | |
153 struct StatsTimer { | 161 struct StatsTimer { |
154 void Start(int64_t now_ms); | 162 void Start(int64_t now_ms); |
155 void Stop(int64_t now_ms); | 163 void Stop(int64_t now_ms); |
156 void Restart(int64_t now_ms); | 164 void Restart(int64_t now_ms); |
157 int64_t start_ms = -1; | 165 int64_t start_ms = -1; |
158 int64_t total_ms = 0; | 166 int64_t total_ms = 0; |
159 }; | 167 }; |
160 struct QpCounters { | 168 struct QpCounters { |
161 SampleCounter vp8; // QP range: 0-127. | 169 SampleCounter vp8; // QP range: 0-127. |
162 SampleCounter vp9; // QP range: 0-255. | 170 SampleCounter vp9; // QP range: 0-255. |
163 SampleCounter h264; // QP range: 0-51. | 171 SampleCounter h264; // QP range: 0-51. |
164 }; | 172 }; |
165 void PurgeOldStats() EXCLUSIVE_LOCKS_REQUIRED(crit_); | 173 void PurgeOldStats() EXCLUSIVE_LOCKS_REQUIRED(crit_); |
166 VideoSendStream::StreamStats* GetStatsEntry(uint32_t ssrc) | 174 VideoSendStream::StreamStats* GetStatsEntry(uint32_t ssrc) |
167 EXCLUSIVE_LOCKS_REQUIRED(crit_); | 175 EXCLUSIVE_LOCKS_REQUIRED(crit_); |
168 | 176 |
169 void SetAdaptTimer(const VideoStreamEncoder::AdaptCounts& counts, | 177 void SetAdaptTimer(const VideoStreamEncoder::AdaptCounts& counts, |
170 StatsTimer* timer) | 178 StatsTimer* timer) |
171 EXCLUSIVE_LOCKS_REQUIRED(crit_); | 179 EXCLUSIVE_LOCKS_REQUIRED(crit_); |
172 void UpdateAdaptationStats( | 180 void UpdateAdaptationStats( |
173 const VideoStreamEncoder::AdaptCounts& cpu_counts, | 181 const VideoStreamEncoder::AdaptCounts& cpu_counts, |
174 const VideoStreamEncoder::AdaptCounts& quality_counts) | 182 const VideoStreamEncoder::AdaptCounts& quality_counts) |
175 EXCLUSIVE_LOCKS_REQUIRED(crit_); | 183 EXCLUSIVE_LOCKS_REQUIRED(crit_); |
176 | 184 |
185 void UpdateEncoderFallbackStats(const CodecSpecificInfo* codec_info, | |
186 FallbackEncoderInfo* fallback_info) | |
187 EXCLUSIVE_LOCKS_REQUIRED(crit_); | |
brandtr
2017/09/14 12:30:12
I think you have to rebase this to use the RTC_ pr
åsapersson
2017/09/14 14:41:44
Done.
| |
188 | |
177 Clock* const clock_; | 189 Clock* const clock_; |
178 const std::string payload_name_; | 190 const std::string payload_name_; |
179 const VideoSendStream::Config::Rtp rtp_config_; | 191 const VideoSendStream::Config::Rtp rtp_config_; |
192 const rtc::Optional<int> min_first_fallback_interval_ms_; | |
180 rtc::CriticalSection crit_; | 193 rtc::CriticalSection crit_; |
181 VideoEncoderConfig::ContentType content_type_ GUARDED_BY(crit_); | 194 VideoEncoderConfig::ContentType content_type_ GUARDED_BY(crit_); |
182 const int64_t start_ms_; | 195 const int64_t start_ms_; |
183 VideoSendStream::Stats stats_ GUARDED_BY(crit_); | 196 VideoSendStream::Stats stats_ GUARDED_BY(crit_); |
184 uint32_t last_sent_frame_timestamp_ GUARDED_BY(crit_); | 197 uint32_t last_sent_frame_timestamp_ GUARDED_BY(crit_); |
185 std::map<uint32_t, StatsUpdateTimes> update_times_ GUARDED_BY(crit_); | 198 std::map<uint32_t, StatsUpdateTimes> update_times_ GUARDED_BY(crit_); |
186 rtc::ExpFilter encode_time_ GUARDED_BY(crit_); | 199 rtc::ExpFilter encode_time_ GUARDED_BY(crit_); |
187 int quality_downscales_ GUARDED_BY(crit_); | 200 int quality_downscales_ GUARDED_BY(crit_); |
188 int cpu_downscales_ GUARDED_BY(crit_); | 201 int cpu_downscales_ GUARDED_BY(crit_); |
189 | 202 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 RateAccCounter rtx_byte_counter_; | 239 RateAccCounter rtx_byte_counter_; |
227 RateAccCounter padding_byte_counter_; | 240 RateAccCounter padding_byte_counter_; |
228 RateAccCounter retransmit_byte_counter_; | 241 RateAccCounter retransmit_byte_counter_; |
229 RateAccCounter fec_byte_counter_; | 242 RateAccCounter fec_byte_counter_; |
230 int64_t first_rtcp_stats_time_ms_; | 243 int64_t first_rtcp_stats_time_ms_; |
231 int64_t first_rtp_stats_time_ms_; | 244 int64_t first_rtp_stats_time_ms_; |
232 StatsTimer cpu_adapt_timer_; | 245 StatsTimer cpu_adapt_timer_; |
233 StatsTimer quality_adapt_timer_; | 246 StatsTimer quality_adapt_timer_; |
234 BoolSampleCounter paused_time_counter_; | 247 BoolSampleCounter paused_time_counter_; |
235 TargetRateUpdates target_rate_updates_; | 248 TargetRateUpdates target_rate_updates_; |
249 BoolSampleCounter fallback_active_counter_; | |
250 FallbackEncoderInfo fallback_info_; | |
236 ReportBlockStats report_block_stats_; | 251 ReportBlockStats report_block_stats_; |
237 const VideoSendStream::Stats start_stats_; | 252 const VideoSendStream::Stats start_stats_; |
238 | 253 |
239 std::map<int, QpCounters> | 254 std::map<int, QpCounters> |
240 qp_counters_; // QP counters mapped by spatial idx. | 255 qp_counters_; // QP counters mapped by spatial idx. |
241 }; | 256 }; |
242 | 257 |
243 std::unique_ptr<UmaSamplesContainer> uma_container_ GUARDED_BY(crit_); | 258 std::unique_ptr<UmaSamplesContainer> uma_container_ GUARDED_BY(crit_); |
244 }; | 259 }; |
245 | 260 |
246 } // namespace webrtc | 261 } // namespace webrtc |
247 #endif // WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_ | 262 #endif // WEBRTC_VIDEO_SEND_STATISTICS_PROXY_H_ |
OLD | NEW |