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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples); | 52 int decode_ms = decode_time_counter_.Avg(kMinRequiredDecodeSamples); |
53 if (decode_ms != -1) | 53 if (decode_ms != -1) |
54 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms); | 54 RTC_HISTOGRAM_COUNTS_1000("WebRTC.Video.DecodeTimeInMs", decode_ms); |
55 } | 55 } |
56 | 56 |
57 VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { | 57 VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { |
58 rtc::CritScope lock(&crit_); | 58 rtc::CritScope lock(&crit_); |
59 return stats_; | 59 return stats_; |
60 } | 60 } |
61 | 61 |
62 void ReceiveStatisticsProxy::IncomingRate(const int video_channel, | 62 void ReceiveStatisticsProxy::OnIncomingPayloadType(int payload_type) { |
63 const unsigned int framerate, | 63 rtc::CritScope lock(&crit_); |
64 const unsigned int bitrate_bps) { | 64 stats_.current_payload_type = payload_type; |
| 65 } |
| 66 |
| 67 void ReceiveStatisticsProxy::OnIncomingRate(unsigned int framerate, |
| 68 unsigned int bitrate_bps) { |
65 rtc::CritScope lock(&crit_); | 69 rtc::CritScope lock(&crit_); |
66 stats_.network_frame_rate = framerate; | 70 stats_.network_frame_rate = framerate; |
67 stats_.total_bitrate_bps = bitrate_bps; | 71 stats_.total_bitrate_bps = bitrate_bps; |
68 } | 72 } |
69 | 73 |
70 void ReceiveStatisticsProxy::DecoderTiming(int decode_ms, | 74 void ReceiveStatisticsProxy::OnDecoderTiming(int decode_ms, |
71 int max_decode_ms, | 75 int max_decode_ms, |
72 int current_delay_ms, | 76 int current_delay_ms, |
73 int target_delay_ms, | 77 int target_delay_ms, |
74 int jitter_buffer_ms, | 78 int jitter_buffer_ms, |
75 int min_playout_delay_ms, | 79 int min_playout_delay_ms, |
76 int render_delay_ms) { | 80 int render_delay_ms) { |
77 rtc::CritScope lock(&crit_); | 81 rtc::CritScope lock(&crit_); |
78 stats_.decode_ms = decode_ms; | 82 stats_.decode_ms = decode_ms; |
79 stats_.max_decode_ms = max_decode_ms; | 83 stats_.max_decode_ms = max_decode_ms; |
80 stats_.current_delay_ms = current_delay_ms; | 84 stats_.current_delay_ms = current_delay_ms; |
81 stats_.target_delay_ms = target_delay_ms; | 85 stats_.target_delay_ms = target_delay_ms; |
82 stats_.jitter_buffer_ms = jitter_buffer_ms; | 86 stats_.jitter_buffer_ms = jitter_buffer_ms; |
83 stats_.min_playout_delay_ms = min_playout_delay_ms; | 87 stats_.min_playout_delay_ms = min_playout_delay_ms; |
84 stats_.render_delay_ms = render_delay_ms; | 88 stats_.render_delay_ms = render_delay_ms; |
85 decode_time_counter_.Add(decode_ms); | 89 decode_time_counter_.Add(decode_ms); |
86 } | 90 } |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 ++num_samples; | 167 ++num_samples; |
164 } | 168 } |
165 | 169 |
166 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { | 170 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { |
167 if (num_samples < min_required_samples || num_samples == 0) | 171 if (num_samples < min_required_samples || num_samples == 0) |
168 return -1; | 172 return -1; |
169 return sum / num_samples; | 173 return sum / num_samples; |
170 } | 174 } |
171 | 175 |
172 } // namespace webrtc | 176 } // namespace webrtc |
OLD | NEW |