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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 if (width != -1) { | 46 if (width != -1) { |
47 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedWidthInPixels", width); | 47 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedWidthInPixels", width); |
48 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedHeightInPixels", height); | 48 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceivedHeightInPixels", height); |
49 } | 49 } |
50 // TODO(asapersson): DecoderTiming() is call periodically (each 1000ms) and | 50 // TODO(asapersson): DecoderTiming() is call periodically (each 1000ms) and |
51 // not per frame. Change decode time to include every frame. | 51 // not per frame. Change decode time to include every frame. |
52 const int kMinRequiredDecodeSamples = 5; | 52 const int kMinRequiredDecodeSamples = 5; |
53 int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples); | 53 int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples); |
54 if (decode_ms != -1) | 54 if (decode_ms != -1) |
55 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms); | 55 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms); |
56 | |
57 int delay_ms = delay_counter_.Avg(kMinRequiredDecodeSamples); | |
58 if (delay_ms != -1) | |
59 RTC_HISTOGRAM_COUNTS_10000("WebRTC.Video.ReceiveSideDelayInMs", delay_ms); | |
56 } | 60 } |
57 | 61 |
58 VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { | 62 VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { |
59 rtc::CritScope lock(&crit_); | 63 rtc::CritScope lock(&crit_); |
60 return stats_; | 64 return stats_; |
61 } | 65 } |
62 | 66 |
63 void ReceiveStatisticsProxy::OnIncomingPayloadType(int payload_type) { | 67 void ReceiveStatisticsProxy::OnIncomingPayloadType(int payload_type) { |
64 rtc::CritScope lock(&crit_); | 68 rtc::CritScope lock(&crit_); |
65 stats_.current_payload_type = payload_type; | 69 stats_.current_payload_type = payload_type; |
66 } | 70 } |
67 | 71 |
68 void ReceiveStatisticsProxy::OnIncomingRate(unsigned int framerate, | 72 void ReceiveStatisticsProxy::OnIncomingRate(unsigned int framerate, |
69 unsigned int bitrate_bps) { | 73 unsigned int bitrate_bps) { |
70 rtc::CritScope lock(&crit_); | 74 rtc::CritScope lock(&crit_); |
71 stats_.network_frame_rate = framerate; | 75 stats_.network_frame_rate = framerate; |
72 stats_.total_bitrate_bps = bitrate_bps; | 76 stats_.total_bitrate_bps = bitrate_bps; |
73 } | 77 } |
74 | 78 |
75 void ReceiveStatisticsProxy::OnDecoderTiming(int decode_ms, | 79 void ReceiveStatisticsProxy::OnDecoderTiming(int decode_ms, |
76 int max_decode_ms, | 80 int max_decode_ms, |
77 int current_delay_ms, | 81 int current_delay_ms, |
78 int target_delay_ms, | 82 int target_delay_ms, |
79 int jitter_buffer_ms, | 83 int jitter_buffer_ms, |
80 int min_playout_delay_ms, | 84 int min_playout_delay_ms, |
81 int render_delay_ms) { | 85 int render_delay_ms, |
86 int64_t rtt_ms) { | |
82 rtc::CritScope lock(&crit_); | 87 rtc::CritScope lock(&crit_); |
83 stats_.decode_ms = decode_ms; | 88 stats_.decode_ms = decode_ms; |
84 stats_.max_decode_ms = max_decode_ms; | 89 stats_.max_decode_ms = max_decode_ms; |
85 stats_.current_delay_ms = current_delay_ms; | 90 stats_.current_delay_ms = current_delay_ms; |
86 stats_.target_delay_ms = target_delay_ms; | 91 stats_.target_delay_ms = target_delay_ms; |
87 stats_.jitter_buffer_ms = jitter_buffer_ms; | 92 stats_.jitter_buffer_ms = jitter_buffer_ms; |
88 stats_.min_playout_delay_ms = min_playout_delay_ms; | 93 stats_.min_playout_delay_ms = min_playout_delay_ms; |
89 stats_.render_delay_ms = render_delay_ms; | 94 stats_.render_delay_ms = render_delay_ms; |
90 decode_time_counter_.Add(decode_ms); | 95 decode_time_counter_.Add(decode_ms); |
96 delay_counter_.Add(target_delay_ms + rtt_ms / 2); | |
stefan-webrtc
2015/09/28 15:20:42
Why are we adding rtt/2? Should at least be explai
åsapersson
2015/10/05 13:26:00
Added comment and updated CL description.
| |
91 } | 97 } |
92 | 98 |
93 void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated( | 99 void ReceiveStatisticsProxy::RtcpPacketTypesCounterUpdated( |
94 uint32_t ssrc, | 100 uint32_t ssrc, |
95 const RtcpPacketTypeCounter& packet_counter) { | 101 const RtcpPacketTypeCounter& packet_counter) { |
96 rtc::CritScope lock(&crit_); | 102 rtc::CritScope lock(&crit_); |
97 if (stats_.ssrc != ssrc) | 103 if (stats_.ssrc != ssrc) |
98 return; | 104 return; |
99 stats_.rtcp_packet_type_counts = packet_counter; | 105 stats_.rtcp_packet_type_counts = packet_counter; |
100 } | 106 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
168 ++num_samples; | 174 ++num_samples; |
169 } | 175 } |
170 | 176 |
171 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { | 177 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { |
172 if (num_samples < min_required_samples || num_samples == 0) | 178 if (num_samples < min_required_samples || num_samples == 0) |
173 return -1; | 179 return -1; |
174 return sum / num_samples; | 180 return sum / num_samples; |
175 } | 181 } |
176 | 182 |
177 } // namespace webrtc | 183 } // namespace webrtc |
OLD | NEW |