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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
73 decode_fps_estimator_(1000, 1000), | 73 decode_fps_estimator_(1000, 1000), |
74 renders_fps_estimator_(1000, 1000), | 74 renders_fps_estimator_(1000, 1000), |
75 render_fps_tracker_(100, 10u), | 75 render_fps_tracker_(100, 10u), |
76 render_pixel_tracker_(100, 10u), | 76 render_pixel_tracker_(100, 10u), |
77 total_byte_tracker_(100, 10u), // bucket_interval_ms, bucket_count | 77 total_byte_tracker_(100, 10u), // bucket_interval_ms, bucket_count |
78 e2e_delay_max_ms_video_(-1), | 78 e2e_delay_max_ms_video_(-1), |
79 e2e_delay_max_ms_screenshare_(-1), | 79 e2e_delay_max_ms_screenshare_(-1), |
80 freq_offset_counter_(clock, nullptr, kFreqOffsetProcessIntervalMs), | 80 freq_offset_counter_(clock, nullptr, kFreqOffsetProcessIntervalMs), |
81 first_report_block_time_ms_(-1), | 81 first_report_block_time_ms_(-1), |
82 avg_rtt_ms_(0), | 82 avg_rtt_ms_(0), |
83 last_content_type_(VideoContentType::UNSPECIFIED) { | 83 last_content_type_(VideoContentType::UNSPECIFIED), |
84 timing_frame_info_() { | |
84 stats_.ssrc = config_.rtp.remote_ssrc; | 85 stats_.ssrc = config_.rtp.remote_ssrc; |
85 // TODO(brandtr): Replace |rtx_stats_| with a single instance of | 86 // TODO(brandtr): Replace |rtx_stats_| with a single instance of |
86 // StreamDataCounters. | 87 // StreamDataCounters. |
87 if (config_.rtp.rtx_ssrc) { | 88 if (config_.rtp.rtx_ssrc) { |
88 rtx_stats_[config_.rtp.rtx_ssrc] = StreamDataCounters(); | 89 rtx_stats_[config_.rtp.rtx_ssrc] = StreamDataCounters(); |
89 } | 90 } |
90 } | 91 } |
91 | 92 |
92 ReceiveStatisticsProxy::~ReceiveStatisticsProxy() { | 93 ReceiveStatisticsProxy::~ReceiveStatisticsProxy() { |
93 UpdateHistograms(); | 94 UpdateHistograms(); |
(...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
364 VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { | 365 VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { |
365 rtc::CritScope lock(&crit_); | 366 rtc::CritScope lock(&crit_); |
366 // Get current frame rates here, as only updating them on new frames prevents | 367 // Get current frame rates here, as only updating them on new frames prevents |
367 // us from ever correctly displaying frame rate of 0. | 368 // us from ever correctly displaying frame rate of 0. |
368 int64_t now_ms = clock_->TimeInMilliseconds(); | 369 int64_t now_ms = clock_->TimeInMilliseconds(); |
369 UpdateFramerate(now_ms); | 370 UpdateFramerate(now_ms); |
370 stats_.render_frame_rate = renders_fps_estimator_.Rate(now_ms).value_or(0); | 371 stats_.render_frame_rate = renders_fps_estimator_.Rate(now_ms).value_or(0); |
371 stats_.decode_frame_rate = decode_fps_estimator_.Rate(now_ms).value_or(0); | 372 stats_.decode_frame_rate = decode_fps_estimator_.Rate(now_ms).value_or(0); |
372 stats_.total_bitrate_bps = | 373 stats_.total_bitrate_bps = |
373 static_cast<int>(total_byte_tracker_.ComputeRate() * 8); | 374 static_cast<int>(total_byte_tracker_.ComputeRate() * 8); |
375 stats_.timing_frame_info = timing_frame_info_; | |
376 // Reset reported value to be overwritten by new values. | |
Taylor Brandstetter
2017/06/25 20:48:04
nit: This comment says what the code does, but not
ilnik
2017/06/26 08:46:38
revised.
| |
377 timing_frame_info_ = TimingFrameInfo(); | |
374 return stats_; | 378 return stats_; |
375 } | 379 } |
376 | 380 |
377 void ReceiveStatisticsProxy::OnIncomingPayloadType(int payload_type) { | 381 void ReceiveStatisticsProxy::OnIncomingPayloadType(int payload_type) { |
378 rtc::CritScope lock(&crit_); | 382 rtc::CritScope lock(&crit_); |
379 stats_.current_payload_type = payload_type; | 383 stats_.current_payload_type = payload_type; |
380 } | 384 } |
381 | 385 |
382 void ReceiveStatisticsProxy::OnDecoderImplementationName( | 386 void ReceiveStatisticsProxy::OnDecoderImplementationName( |
383 const char* implementation_name) { | 387 const char* implementation_name) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
425 "target_delay_ms", target_delay_ms, | 429 "target_delay_ms", target_delay_ms, |
426 "ssrc", stats_.ssrc); | 430 "ssrc", stats_.ssrc); |
427 TRACE_EVENT_INSTANT2("webrtc_stats", "WebRTC.Video.JitterBufferDelayInMs", | 431 TRACE_EVENT_INSTANT2("webrtc_stats", "WebRTC.Video.JitterBufferDelayInMs", |
428 "jitter_buffer_ms", jitter_buffer_ms, | 432 "jitter_buffer_ms", jitter_buffer_ms, |
429 "ssrc", stats_.ssrc); | 433 "ssrc", stats_.ssrc); |
430 TRACE_EVENT_INSTANT2("webrtc_stats", "WebRTC.Video.RenderDelayInMs", | 434 TRACE_EVENT_INSTANT2("webrtc_stats", "WebRTC.Video.RenderDelayInMs", |
431 "render_delay_ms", render_delay_ms, | 435 "render_delay_ms", render_delay_ms, |
432 "ssrc", stats_.ssrc); | 436 "ssrc", stats_.ssrc); |
433 } | 437 } |
434 | 438 |
439 void ReceiveStatisticsProxy::OnTimingFrameInfoUpdated( | |
440 const TimingFrameInfo& info) { | |
441 rtc::CritScope lock(&crit_); | |
442 // Only the frame which was processed the longest is reported since last | |
Taylor Brandstetter
2017/06/25 20:48:03
nit: "since the last..."
ilnik
2017/06/26 08:46:38
Done.
| |
443 // GetStats() call. Therefore, only it's stored here. | |
Taylor Brandstetter
2017/06/25 20:48:04
I don't understand the "Therefore, only it's store
ilnik
2017/06/26 08:46:38
Revised.
| |
444 if (info.IsLongerThan(timing_frame_info_)) { | |
445 timing_frame_info_ = info; | |
446 } | |
447 } | |
448 | |
435 void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated( | 449 void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated( |
436 uint32_t ssrc, | 450 uint32_t ssrc, |
437 const RtcpPacketTypeCounter& packet_counter) { | 451 const RtcpPacketTypeCounter& packet_counter) { |
438 rtc::CritScope lock(&crit_); | 452 rtc::CritScope lock(&crit_); |
439 if (stats_.ssrc != ssrc) | 453 if (stats_.ssrc != ssrc) |
440 return; | 454 return; |
441 stats_.rtcp_packet_type_counts = packet_counter; | 455 stats_.rtcp_packet_type_counts = packet_counter; |
442 } | 456 } |
443 | 457 |
444 void ReceiveStatisticsProxy::StatisticsUpdated( | 458 void ReceiveStatisticsProxy::StatisticsUpdated( |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
630 sum = 0; | 644 sum = 0; |
631 } | 645 } |
632 | 646 |
633 void ReceiveStatisticsProxy::OnRttUpdate(int64_t avg_rtt_ms, | 647 void ReceiveStatisticsProxy::OnRttUpdate(int64_t avg_rtt_ms, |
634 int64_t max_rtt_ms) { | 648 int64_t max_rtt_ms) { |
635 rtc::CritScope lock(&crit_); | 649 rtc::CritScope lock(&crit_); |
636 avg_rtt_ms_ = avg_rtt_ms; | 650 avg_rtt_ms_ = avg_rtt_ms; |
637 } | 651 } |
638 | 652 |
639 } // namespace webrtc | 653 } // namespace webrtc |
OLD | NEW |