OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 #include "webrtc/modules/video_coding/jitter_buffer.h" | 10 #include "webrtc/modules/video_coding/jitter_buffer.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 void VCMJitterBuffer::UpdateHistograms() { | 274 void VCMJitterBuffer::UpdateHistograms() { |
275 if (num_packets_ <= 0 || !running_) { | 275 if (num_packets_ <= 0 || !running_) { |
276 return; | 276 return; |
277 } | 277 } |
278 int64_t elapsed_sec = | 278 int64_t elapsed_sec = |
279 (clock_->TimeInMilliseconds() - time_first_packet_ms_) / 1000; | 279 (clock_->TimeInMilliseconds() - time_first_packet_ms_) / 1000; |
280 if (elapsed_sec < metrics::kMinRunTimeInSeconds) { | 280 if (elapsed_sec < metrics::kMinRunTimeInSeconds) { |
281 return; | 281 return; |
282 } | 282 } |
283 | 283 |
284 RTC_HISTOGRAM_PERCENTAGE_SPARSE("WebRTC.Video.DiscardedPacketsInPercent", | 284 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.DiscardedPacketsInPercent", |
285 num_discarded_packets_ * 100 / num_packets_); | 285 num_discarded_packets_ * 100 / num_packets_); |
286 RTC_HISTOGRAM_PERCENTAGE_SPARSE("WebRTC.Video.DuplicatedPacketsInPercent", | 286 RTC_HISTOGRAM_PERCENTAGE("WebRTC.Video.DuplicatedPacketsInPercent", |
287 num_duplicated_packets_ * 100 / num_packets_); | 287 num_duplicated_packets_ * 100 / num_packets_); |
288 | 288 |
289 int total_frames = | 289 int total_frames = |
290 receive_statistics_.key_frames + receive_statistics_.delta_frames; | 290 receive_statistics_.key_frames + receive_statistics_.delta_frames; |
291 if (total_frames > 0) { | 291 if (total_frames > 0) { |
292 RTC_HISTOGRAM_COUNTS_SPARSE_100( | 292 RTC_HISTOGRAM_COUNTS_100( |
293 "WebRTC.Video.CompleteFramesReceivedPerSecond", | 293 "WebRTC.Video.CompleteFramesReceivedPerSecond", |
294 static_cast<int>((total_frames / elapsed_sec) + 0.5f)); | 294 static_cast<int>((total_frames / elapsed_sec) + 0.5f)); |
295 RTC_HISTOGRAM_COUNTS_SPARSE_1000( | 295 RTC_HISTOGRAM_COUNTS_1000( |
296 "WebRTC.Video.KeyFramesReceivedInPermille", | 296 "WebRTC.Video.KeyFramesReceivedInPermille", |
297 static_cast<int>( | 297 static_cast<int>( |
298 (receive_statistics_.key_frames * 1000.0f / total_frames) + 0.5f)); | 298 (receive_statistics_.key_frames * 1000.0f / total_frames) + 0.5f)); |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 void VCMJitterBuffer::Start() { | 302 void VCMJitterBuffer::Start() { |
303 CriticalSectionScoped cs(crit_sect_); | 303 CriticalSectionScoped cs(crit_sect_); |
304 running_ = true; | 304 running_ = true; |
305 incoming_frame_count_ = 0; | 305 incoming_frame_count_ = 0; |
(...skipping 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1337 } | 1337 } |
1338 // Evaluate if the RTT is higher than |high_rtt_nack_threshold_ms_|, and in | 1338 // Evaluate if the RTT is higher than |high_rtt_nack_threshold_ms_|, and in |
1339 // that case we don't wait for retransmissions. | 1339 // that case we don't wait for retransmissions. |
1340 if (high_rtt_nack_threshold_ms_ >= 0 && | 1340 if (high_rtt_nack_threshold_ms_ >= 0 && |
1341 rtt_ms_ >= high_rtt_nack_threshold_ms_) { | 1341 rtt_ms_ >= high_rtt_nack_threshold_ms_) { |
1342 return false; | 1342 return false; |
1343 } | 1343 } |
1344 return true; | 1344 return true; |
1345 } | 1345 } |
1346 } // namespace webrtc | 1346 } // namespace webrtc |
OLD | NEW |