| 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 VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { | 73 VideoReceiveStream::Stats ReceiveStatisticsProxy::GetStats() const { |
| 74 rtc::CritScope lock(&crit_); | 74 rtc::CritScope lock(&crit_); |
| 75 return stats_; | 75 return stats_; |
| 76 } | 76 } |
| 77 | 77 |
| 78 void ReceiveStatisticsProxy::OnIncomingPayloadType(int payload_type) { | 78 void ReceiveStatisticsProxy::OnIncomingPayloadType(int payload_type) { |
| 79 rtc::CritScope lock(&crit_); | 79 rtc::CritScope lock(&crit_); |
| 80 stats_.current_payload_type = payload_type; | 80 stats_.current_payload_type = payload_type; |
| 81 } | 81 } |
| 82 | 82 |
| 83 void ReceiveStatisticsProxy::OnDecoderImplementationName( |
| 84 const char* implementation_name) { |
| 85 rtc::CritScope lock(&crit_); |
| 86 stats_.decoder_implementation_name = implementation_name; |
| 87 } |
| 83 void ReceiveStatisticsProxy::OnIncomingRate(unsigned int framerate, | 88 void ReceiveStatisticsProxy::OnIncomingRate(unsigned int framerate, |
| 84 unsigned int bitrate_bps) { | 89 unsigned int bitrate_bps) { |
| 85 rtc::CritScope lock(&crit_); | 90 rtc::CritScope lock(&crit_); |
| 86 stats_.network_frame_rate = framerate; | 91 stats_.network_frame_rate = framerate; |
| 87 stats_.total_bitrate_bps = bitrate_bps; | 92 stats_.total_bitrate_bps = bitrate_bps; |
| 88 } | 93 } |
| 89 | 94 |
| 90 void ReceiveStatisticsProxy::OnDecoderTiming(int decode_ms, | 95 void ReceiveStatisticsProxy::OnDecoderTiming(int decode_ms, |
| 91 int max_decode_ms, | 96 int max_decode_ms, |
| 92 int current_delay_ms, | 97 int current_delay_ms, |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 ++num_samples; | 206 ++num_samples; |
| 202 } | 207 } |
| 203 | 208 |
| 204 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { | 209 int ReceiveStatisticsProxy::SampleCounter::Avg(int min_required_samples) const { |
| 205 if (num_samples < min_required_samples || num_samples == 0) | 210 if (num_samples < min_required_samples || num_samples == 0) |
| 206 return -1; | 211 return -1; |
| 207 return sum / num_samples; | 212 return sum / num_samples; |
| 208 } | 213 } |
| 209 | 214 |
| 210 } // namespace webrtc | 215 } // namespace webrtc |
| OLD | NEW |