wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
| 3 | * |
| 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 |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #include "modules/rtp_rtcp/source/receive_statistics_impl.h" |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 12 | |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 13 | #include <math.h> |
| 14 | |
kwiberg | fd8be34 | 2016-05-14 19:44:11 -0700 | [diff] [blame] | 15 | #include <cstdlib> |
danilchap | f5f793c | 2017-07-27 04:44:18 -0700 | [diff] [blame] | 16 | #include <vector> |
kwiberg | fd8be34 | 2016-05-14 19:44:11 -0700 | [diff] [blame] | 17 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 18 | #include "modules/remote_bitrate_estimator/test/bwe_test_logging.h" |
| 19 | #include "modules/rtp_rtcp/source/rtp_rtcp_config.h" |
| 20 | #include "modules/rtp_rtcp/source/time_util.h" |
| 21 | #include "rtc_base/logging.h" |
| 22 | #include "system_wrappers/include/clock.h" |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 23 | |
| 24 | namespace webrtc { |
| 25 | |
stefan@webrtc.org | 286fe0b | 2013-08-21 20:58:21 +0000 | [diff] [blame] | 26 | const int64_t kStatisticsTimeoutMs = 8000; |
pkasting@chromium.org | 0b1534c | 2014-12-15 22:09:40 +0000 | [diff] [blame] | 27 | const int64_t kStatisticsProcessIntervalMs = 1000; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 28 | |
stefan@webrtc.org | 286fe0b | 2013-08-21 20:58:21 +0000 | [diff] [blame] | 29 | StreamStatistician::~StreamStatistician() {} |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 30 | |
sprang@webrtc.org | 54ae4ff | 2013-12-19 13:26:02 +0000 | [diff] [blame] | 31 | StreamStatisticianImpl::StreamStatisticianImpl( |
danilchap | ec86be0 | 2017-08-14 05:51:02 -0700 | [diff] [blame] | 32 | uint32_t ssrc, |
sprang@webrtc.org | 54ae4ff | 2013-12-19 13:26:02 +0000 | [diff] [blame] | 33 | Clock* clock, |
Niels Möller | 5304a32 | 2018-08-27 13:27:05 +0200 | [diff] [blame] | 34 | bool enable_retransmit_detection, |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 35 | RtcpStatisticsCallback* rtcp_callback, |
| 36 | StreamDataCountersCallback* rtp_callback) |
danilchap | ec86be0 | 2017-08-14 05:51:02 -0700 | [diff] [blame] | 37 | : ssrc_(ssrc), |
| 38 | clock_(clock), |
sprang | cd349d9 | 2016-07-13 09:11:28 -0700 | [diff] [blame] | 39 | incoming_bitrate_(kStatisticsProcessIntervalMs, |
| 40 | RateStatistics::kBpsScale), |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 41 | max_reordering_threshold_(kDefaultMaxReorderingThreshold), |
Niels Möller | 5304a32 | 2018-08-27 13:27:05 +0200 | [diff] [blame] | 42 | enable_retransmit_detection_(enable_retransmit_detection), |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 43 | jitter_q4_(0), |
Qingsi Wang | 2370b08 | 2018-08-21 14:24:26 -0700 | [diff] [blame] | 44 | cumulative_loss_(0), |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 45 | last_receive_time_ms_(0), |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 46 | last_received_timestamp_(0), |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 47 | received_seq_first_(0), |
| 48 | received_seq_max_(0), |
| 49 | received_seq_wraps_(0), |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 50 | received_packet_overhead_(12), |
Qingsi Wang | 2370b08 | 2018-08-21 14:24:26 -0700 | [diff] [blame] | 51 | last_report_inorder_packets_(0), |
| 52 | last_report_old_packets_(0), |
| 53 | last_report_seq_max_(0), |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 54 | rtcp_callback_(rtcp_callback), |
| 55 | rtp_callback_(rtp_callback) {} |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 56 | |
Danil Chapovalov | 2a5ce2b | 2018-02-07 09:38:31 +0100 | [diff] [blame] | 57 | StreamStatisticianImpl::~StreamStatisticianImpl() = default; |
| 58 | |
stefan@webrtc.org | 286fe0b | 2013-08-21 20:58:21 +0000 | [diff] [blame] | 59 | void StreamStatisticianImpl::IncomingPacket(const RTPHeader& header, |
Niels Möller | 5304a32 | 2018-08-27 13:27:05 +0200 | [diff] [blame] | 60 | size_t packet_length) { |
Niels Möller | b615d1a | 2018-08-27 12:32:21 +0200 | [diff] [blame] | 61 | StreamDataCounters counters; |
| 62 | { |
| 63 | rtc::CritScope cs(&stream_lock_); |
| 64 | |
Niels Möller | 5304a32 | 2018-08-27 13:27:05 +0200 | [diff] [blame] | 65 | bool retransmitted = |
| 66 | enable_retransmit_detection_ && IsRetransmitOfOldPacket(header); |
Niels Möller | b615d1a | 2018-08-27 12:32:21 +0200 | [diff] [blame] | 67 | counters = UpdateCounters(header, packet_length, retransmitted); |
| 68 | } |
danilchap | ec86be0 | 2017-08-14 05:51:02 -0700 | [diff] [blame] | 69 | rtp_callback_->DataCountersUpdated(counters, ssrc_); |
sprang@webrtc.org | a45cac0 | 2014-01-27 16:22:08 +0000 | [diff] [blame] | 70 | } |
| 71 | |
danilchap | ec86be0 | 2017-08-14 05:51:02 -0700 | [diff] [blame] | 72 | StreamDataCounters StreamStatisticianImpl::UpdateCounters( |
| 73 | const RTPHeader& header, |
| 74 | size_t packet_length, |
| 75 | bool retransmitted) { |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 76 | bool in_order = InOrderPacketInternal(header.sequenceNumber); |
danilchap | ec86be0 | 2017-08-14 05:51:02 -0700 | [diff] [blame] | 77 | RTC_DCHECK_EQ(ssrc_, header.ssrc); |
sprang | cd349d9 | 2016-07-13 09:11:28 -0700 | [diff] [blame] | 78 | incoming_bitrate_.Update(packet_length, clock_->TimeInMilliseconds()); |
asapersson@webrtc.org | 4414939 | 2015-02-04 08:34:47 +0000 | [diff] [blame] | 79 | receive_counters_.transmitted.AddPacket(packet_length, header); |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 80 | if (!in_order && retransmitted) { |
asapersson@webrtc.org | 4414939 | 2015-02-04 08:34:47 +0000 | [diff] [blame] | 81 | receive_counters_.retransmitted.AddPacket(packet_length, header); |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 82 | } |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 83 | |
asapersson@webrtc.org | cfd82df | 2015-01-22 09:39:59 +0000 | [diff] [blame] | 84 | if (receive_counters_.transmitted.packets == 1) { |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 85 | received_seq_first_ = header.sequenceNumber; |
asapersson@webrtc.org | d08d389 | 2014-12-16 12:03:11 +0000 | [diff] [blame] | 86 | receive_counters_.first_packet_time_ms = clock_->TimeInMilliseconds(); |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | // Count only the new packets received. That is, if packets 1, 2, 3, 5, 4, 6 |
| 90 | // are received, 4 will be ignored. |
| 91 | if (in_order) { |
| 92 | // Current time in samples. |
danilchap | 3795376 | 2017-02-09 11:15:25 -0800 | [diff] [blame] | 93 | NtpTime receive_time = clock_->CurrentNtpTime(); |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 94 | |
| 95 | // Wrong if we use RetransmitOfOldPacket. |
asapersson@webrtc.org | cfd82df | 2015-01-22 09:39:59 +0000 | [diff] [blame] | 96 | if (receive_counters_.transmitted.packets > 1 && |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 97 | received_seq_max_ > header.sequenceNumber) { |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 98 | // Wrap around detected. |
| 99 | received_seq_wraps_++; |
| 100 | } |
| 101 | // New max. |
| 102 | received_seq_max_ = header.sequenceNumber; |
| 103 | |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 104 | // If new time stamp and more than one in-order packet received, calculate |
| 105 | // new jitter statistics. |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 106 | if (header.timestamp != last_received_timestamp_ && |
asapersson@webrtc.org | cfd82df | 2015-01-22 09:39:59 +0000 | [diff] [blame] | 107 | (receive_counters_.transmitted.packets - |
| 108 | receive_counters_.retransmitted.packets) > 1) { |
danilchap | 1227e8b | 2015-12-21 11:06:50 -0800 | [diff] [blame] | 109 | UpdateJitter(header, receive_time); |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 110 | } |
| 111 | last_received_timestamp_ = header.timestamp; |
danilchap | 1227e8b | 2015-12-21 11:06:50 -0800 | [diff] [blame] | 112 | last_receive_time_ntp_ = receive_time; |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 113 | last_receive_time_ms_ = clock_->TimeInMilliseconds(); |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 114 | } |
| 115 | |
pkasting@chromium.org | 4591fbd | 2014-11-20 22:28:14 +0000 | [diff] [blame] | 116 | size_t packet_oh = header.headerLength + header.paddingLength; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 117 | |
| 118 | // Our measured overhead. Filter from RFC 5104 4.2.1.2: |
| 119 | // avg_OH (new) = 15/16*avg_OH (old) + 1/16*pckt_OH, |
| 120 | received_packet_overhead_ = (15 * received_packet_overhead_ + packet_oh) >> 4; |
danilchap | ec86be0 | 2017-08-14 05:51:02 -0700 | [diff] [blame] | 121 | return receive_counters_; |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 122 | } |
| 123 | |
| 124 | void StreamStatisticianImpl::UpdateJitter(const RTPHeader& header, |
danilchap | 1227e8b | 2015-12-21 11:06:50 -0800 | [diff] [blame] | 125 | NtpTime receive_time) { |
| 126 | uint32_t receive_time_rtp = |
| 127 | NtpToRtp(receive_time, header.payload_type_frequency); |
pbos@webrtc.org | 62bafae | 2014-07-08 12:10:51 +0000 | [diff] [blame] | 128 | uint32_t last_receive_time_rtp = |
danilchap | 1227e8b | 2015-12-21 11:06:50 -0800 | [diff] [blame] | 129 | NtpToRtp(last_receive_time_ntp_, header.payload_type_frequency); |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 130 | int32_t time_diff_samples = (receive_time_rtp - last_receive_time_rtp) - |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 131 | (header.timestamp - last_received_timestamp_); |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 132 | |
kwiberg | fd8be34 | 2016-05-14 19:44:11 -0700 | [diff] [blame] | 133 | time_diff_samples = std::abs(time_diff_samples); |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 134 | |
| 135 | // lib_jingle sometimes deliver crazy jumps in TS for the same stream. |
| 136 | // If this happens, don't update jitter value. Use 5 secs video frequency |
| 137 | // as the threshold. |
| 138 | if (time_diff_samples < 450000) { |
| 139 | // Note we calculate in Q4 to avoid using float. |
| 140 | int32_t jitter_diff_q4 = (time_diff_samples << 4) - jitter_q4_; |
| 141 | jitter_q4_ += ((jitter_diff_q4 + 8) >> 4); |
| 142 | } |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 143 | } |
| 144 | |
asapersson@webrtc.org | 273fbbb | 2015-01-27 12:17:29 +0000 | [diff] [blame] | 145 | void StreamStatisticianImpl::FecPacketReceived(const RTPHeader& header, |
| 146 | size_t packet_length) { |
danilchap | ec86be0 | 2017-08-14 05:51:02 -0700 | [diff] [blame] | 147 | StreamDataCounters counters; |
sprang@webrtc.org | a45cac0 | 2014-01-27 16:22:08 +0000 | [diff] [blame] | 148 | { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 149 | rtc::CritScope cs(&stream_lock_); |
asapersson@webrtc.org | 4414939 | 2015-02-04 08:34:47 +0000 | [diff] [blame] | 150 | receive_counters_.fec.AddPacket(packet_length, header); |
danilchap | ec86be0 | 2017-08-14 05:51:02 -0700 | [diff] [blame] | 151 | counters = receive_counters_; |
sprang@webrtc.org | a45cac0 | 2014-01-27 16:22:08 +0000 | [diff] [blame] | 152 | } |
danilchap | ec86be0 | 2017-08-14 05:51:02 -0700 | [diff] [blame] | 153 | rtp_callback_->DataCountersUpdated(counters, ssrc_); |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 154 | } |
| 155 | |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 156 | void StreamStatisticianImpl::SetMaxReorderingThreshold( |
| 157 | int max_reordering_threshold) { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 158 | rtc::CritScope cs(&stream_lock_); |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 159 | max_reordering_threshold_ = max_reordering_threshold; |
| 160 | } |
| 161 | |
Niels Möller | 5304a32 | 2018-08-27 13:27:05 +0200 | [diff] [blame] | 162 | void StreamStatisticianImpl::EnableRetransmitDetection(bool enable) { |
| 163 | rtc::CritScope cs(&stream_lock_); |
| 164 | enable_retransmit_detection_ = enable; |
| 165 | } |
| 166 | |
sprang@webrtc.org | 54ae4ff | 2013-12-19 13:26:02 +0000 | [diff] [blame] | 167 | bool StreamStatisticianImpl::GetStatistics(RtcpStatistics* statistics, |
Qingsi Wang | 2370b08 | 2018-08-21 14:24:26 -0700 | [diff] [blame] | 168 | bool reset) { |
sprang@webrtc.org | 7dba27c | 2014-01-21 16:33:37 +0000 | [diff] [blame] | 169 | { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 170 | rtc::CritScope cs(&stream_lock_); |
asapersson@webrtc.org | cfd82df | 2015-01-22 09:39:59 +0000 | [diff] [blame] | 171 | if (received_seq_first_ == 0 && |
| 172 | receive_counters_.transmitted.payload_bytes == 0) { |
sprang@webrtc.org | 7dba27c | 2014-01-21 16:33:37 +0000 | [diff] [blame] | 173 | // We have not received anything. |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 174 | return false; |
| 175 | } |
sprang@webrtc.org | 7dba27c | 2014-01-21 16:33:37 +0000 | [diff] [blame] | 176 | |
Qingsi Wang | 2370b08 | 2018-08-21 14:24:26 -0700 | [diff] [blame] | 177 | if (!reset) { |
| 178 | if (last_report_inorder_packets_ == 0) { |
| 179 | // No report. |
| 180 | return false; |
| 181 | } |
| 182 | // Just get last report. |
| 183 | *statistics = last_reported_statistics_; |
| 184 | return true; |
| 185 | } |
| 186 | |
| 187 | *statistics = CalculateRtcpStatistics(); |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 188 | } |
| 189 | |
Qingsi Wang | 2370b08 | 2018-08-21 14:24:26 -0700 | [diff] [blame] | 190 | rtcp_callback_->StatisticsUpdated(*statistics, ssrc_); |
sprang@webrtc.org | 7dba27c | 2014-01-21 16:33:37 +0000 | [diff] [blame] | 191 | return true; |
| 192 | } |
| 193 | |
Danil Chapovalov | c5267d2 | 2017-09-18 13:57:19 +0200 | [diff] [blame] | 194 | bool StreamStatisticianImpl::GetActiveStatisticsAndReset( |
| 195 | RtcpStatistics* statistics) { |
| 196 | { |
| 197 | rtc::CritScope cs(&stream_lock_); |
| 198 | if (clock_->CurrentNtpInMilliseconds() - last_receive_time_ntp_.ToMs() >= |
| 199 | kStatisticsTimeoutMs) { |
| 200 | // Not active. |
| 201 | return false; |
| 202 | } |
| 203 | if (received_seq_first_ == 0 && |
| 204 | receive_counters_.transmitted.payload_bytes == 0) { |
| 205 | // We have not received anything. |
| 206 | return false; |
| 207 | } |
| 208 | |
Qingsi Wang | 2370b08 | 2018-08-21 14:24:26 -0700 | [diff] [blame] | 209 | *statistics = CalculateRtcpStatistics(); |
Danil Chapovalov | c5267d2 | 2017-09-18 13:57:19 +0200 | [diff] [blame] | 210 | } |
| 211 | |
| 212 | rtcp_callback_->StatisticsUpdated(*statistics, ssrc_); |
| 213 | return true; |
| 214 | } |
| 215 | |
Qingsi Wang | 2370b08 | 2018-08-21 14:24:26 -0700 | [diff] [blame] | 216 | RtcpStatistics StreamStatisticianImpl::CalculateRtcpStatistics() { |
| 217 | RtcpStatistics stats; |
sprang@webrtc.org | 7dba27c | 2014-01-21 16:33:37 +0000 | [diff] [blame] | 218 | |
Qingsi Wang | 2370b08 | 2018-08-21 14:24:26 -0700 | [diff] [blame] | 219 | if (last_report_inorder_packets_ == 0) { |
| 220 | // First time we send a report. |
| 221 | last_report_seq_max_ = received_seq_first_ - 1; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 222 | } |
| 223 | |
Qingsi Wang | 2370b08 | 2018-08-21 14:24:26 -0700 | [diff] [blame] | 224 | // Calculate fraction lost. |
| 225 | uint16_t exp_since_last = (received_seq_max_ - last_report_seq_max_); |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 226 | |
Qingsi Wang | 2370b08 | 2018-08-21 14:24:26 -0700 | [diff] [blame] | 227 | if (last_report_seq_max_ > received_seq_max_) { |
| 228 | // Can we assume that the seq_num can't go decrease over a full RTCP period? |
| 229 | exp_since_last = 0; |
| 230 | } |
| 231 | |
| 232 | // Number of received RTP packets since last report, counts all packets but |
| 233 | // not re-transmissions. |
| 234 | uint32_t rec_since_last = (receive_counters_.transmitted.packets - |
| 235 | receive_counters_.retransmitted.packets) - |
| 236 | last_report_inorder_packets_; |
| 237 | |
| 238 | // With NACK we don't know the expected retransmissions during the last |
| 239 | // second. We know how many "old" packets we have received. We just count |
| 240 | // the number of old received to estimate the loss, but it still does not |
| 241 | // guarantee an exact number since we run this based on time triggered by |
| 242 | // sending of an RTP packet. This should have a minimum effect. |
| 243 | |
| 244 | // With NACK we don't count old packets as received since they are |
| 245 | // re-transmitted. We use RTT to decide if a packet is re-ordered or |
| 246 | // re-transmitted. |
| 247 | uint32_t retransmitted_packets = |
| 248 | receive_counters_.retransmitted.packets - last_report_old_packets_; |
| 249 | rec_since_last += retransmitted_packets; |
| 250 | |
| 251 | int32_t missing = 0; |
| 252 | if (exp_since_last > rec_since_last) { |
| 253 | missing = (exp_since_last - rec_since_last); |
| 254 | } |
| 255 | uint8_t local_fraction_lost = 0; |
| 256 | if (exp_since_last) { |
| 257 | // Scale 0 to 255, where 255 is 100% loss. |
| 258 | local_fraction_lost = static_cast<uint8_t>(255 * missing / exp_since_last); |
| 259 | } |
| 260 | stats.fraction_lost = local_fraction_lost; |
| 261 | |
| 262 | // We need a counter for cumulative loss too. |
| 263 | // TODO(danilchap): Ensure cumulative loss is below maximum value of 2^24. |
| 264 | cumulative_loss_ += missing; |
| 265 | stats.packets_lost = cumulative_loss_; |
| 266 | stats.extended_highest_sequence_number = |
| 267 | (received_seq_wraps_ << 16) + received_seq_max_; |
| 268 | // Note: internal jitter value is in Q4 and needs to be scaled by 1/16. |
| 269 | stats.jitter = jitter_q4_ >> 4; |
| 270 | |
| 271 | // Store this report. |
| 272 | last_reported_statistics_ = stats; |
| 273 | |
| 274 | // Only for report blocks in RTCP SR and RR. |
| 275 | last_report_inorder_packets_ = receive_counters_.transmitted.packets - |
| 276 | receive_counters_.retransmitted.packets; |
| 277 | last_report_old_packets_ = receive_counters_.retransmitted.packets; |
| 278 | last_report_seq_max_ = received_seq_max_; |
gaetano.carlucci | 61050f6 | 2016-09-30 06:29:54 -0700 | [diff] [blame] | 279 | BWE_TEST_LOGGING_PLOT_WITH_SSRC(1, "cumulative_loss_pkts", |
gaetano.carlucci | 52a5703 | 2016-09-14 05:04:36 -0700 | [diff] [blame] | 280 | clock_->TimeInMilliseconds(), |
Qingsi Wang | 2370b08 | 2018-08-21 14:24:26 -0700 | [diff] [blame] | 281 | cumulative_loss_, ssrc_); |
gaetano.carlucci | 52a5703 | 2016-09-14 05:04:36 -0700 | [diff] [blame] | 282 | BWE_TEST_LOGGING_PLOT_WITH_SSRC( |
gaetano.carlucci | 61050f6 | 2016-09-30 06:29:54 -0700 | [diff] [blame] | 283 | 1, "received_seq_max_pkts", clock_->TimeInMilliseconds(), |
gaetano.carlucci | 52a5703 | 2016-09-14 05:04:36 -0700 | [diff] [blame] | 284 | (received_seq_max_ - received_seq_first_), ssrc_); |
sprang@webrtc.org | 7dba27c | 2014-01-21 16:33:37 +0000 | [diff] [blame] | 285 | |
Qingsi Wang | 2370b08 | 2018-08-21 14:24:26 -0700 | [diff] [blame] | 286 | return stats; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 287 | } |
| 288 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 289 | void StreamStatisticianImpl::GetDataCounters(size_t* bytes_received, |
| 290 | uint32_t* packets_received) const { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 291 | rtc::CritScope cs(&stream_lock_); |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 292 | if (bytes_received) { |
asapersson@webrtc.org | cfd82df | 2015-01-22 09:39:59 +0000 | [diff] [blame] | 293 | *bytes_received = receive_counters_.transmitted.payload_bytes + |
| 294 | receive_counters_.transmitted.header_bytes + |
| 295 | receive_counters_.transmitted.padding_bytes; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 296 | } |
| 297 | if (packets_received) { |
asapersson@webrtc.org | cfd82df | 2015-01-22 09:39:59 +0000 | [diff] [blame] | 298 | *packets_received = receive_counters_.transmitted.packets; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 299 | } |
| 300 | } |
| 301 | |
asapersson@webrtc.org | d952c40 | 2014-11-27 07:38:56 +0000 | [diff] [blame] | 302 | void StreamStatisticianImpl::GetReceiveStreamDataCounters( |
| 303 | StreamDataCounters* data_counters) const { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 304 | rtc::CritScope cs(&stream_lock_); |
asapersson@webrtc.org | d952c40 | 2014-11-27 07:38:56 +0000 | [diff] [blame] | 305 | *data_counters = receive_counters_; |
asapersson@webrtc.org | d952c40 | 2014-11-27 07:38:56 +0000 | [diff] [blame] | 306 | } |
| 307 | |
stefan@webrtc.org | 286fe0b | 2013-08-21 20:58:21 +0000 | [diff] [blame] | 308 | uint32_t StreamStatisticianImpl::BitrateReceived() const { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 309 | rtc::CritScope cs(&stream_lock_); |
sprang | cd349d9 | 2016-07-13 09:11:28 -0700 | [diff] [blame] | 310 | return incoming_bitrate_.Rate(clock_->TimeInMilliseconds()).value_or(0); |
stefan@webrtc.org | 286fe0b | 2013-08-21 20:58:21 +0000 | [diff] [blame] | 311 | } |
| 312 | |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 313 | bool StreamStatisticianImpl::IsRetransmitOfOldPacket( |
Niels Möller | eda0087 | 2018-05-23 13:54:51 +0200 | [diff] [blame] | 314 | const RTPHeader& header) const { |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 315 | if (InOrderPacketInternal(header.sequenceNumber)) { |
| 316 | return false; |
| 317 | } |
| 318 | uint32_t frequency_khz = header.payload_type_frequency / 1000; |
| 319 | assert(frequency_khz > 0); |
| 320 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 321 | int64_t time_diff_ms = clock_->TimeInMilliseconds() - last_receive_time_ms_; |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 322 | |
| 323 | // Diff in time stamp since last received in order. |
| 324 | uint32_t timestamp_diff = header.timestamp - last_received_timestamp_; |
pkasting@chromium.org | 16825b1 | 2015-01-12 21:51:21 +0000 | [diff] [blame] | 325 | uint32_t rtp_time_stamp_diff_ms = timestamp_diff / frequency_khz; |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 326 | |
pkasting@chromium.org | 16825b1 | 2015-01-12 21:51:21 +0000 | [diff] [blame] | 327 | int64_t max_delay_ms = 0; |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 328 | |
Niels Möller | eda0087 | 2018-05-23 13:54:51 +0200 | [diff] [blame] | 329 | // Jitter standard deviation in samples. |
| 330 | float jitter_std = sqrt(static_cast<float>(jitter_q4_ >> 4)); |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 331 | |
Niels Möller | eda0087 | 2018-05-23 13:54:51 +0200 | [diff] [blame] | 332 | // 2 times the standard deviation => 95% confidence. |
| 333 | // And transform to milliseconds by dividing by the frequency in kHz. |
| 334 | max_delay_ms = static_cast<int64_t>((2 * jitter_std) / frequency_khz); |
| 335 | |
| 336 | // Min max_delay_ms is 1. |
| 337 | if (max_delay_ms == 0) { |
| 338 | max_delay_ms = 1; |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 339 | } |
| 340 | return time_diff_ms > rtp_time_stamp_diff_ms + max_delay_ms; |
| 341 | } |
| 342 | |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 343 | bool StreamStatisticianImpl::InOrderPacketInternal( |
| 344 | uint16_t sequence_number) const { |
| 345 | // First packet is always in order. |
Qingsi Wang | 2370b08 | 2018-08-21 14:24:26 -0700 | [diff] [blame] | 346 | if (last_receive_time_ms_ == 0) |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 347 | return true; |
| 348 | |
| 349 | if (IsNewerSequenceNumber(sequence_number, received_seq_max_)) { |
| 350 | return true; |
| 351 | } else { |
| 352 | // If we have a restart of the remote side this packet is still in order. |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 353 | return !IsNewerSequenceNumber( |
| 354 | sequence_number, received_seq_max_ - max_reordering_threshold_); |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 355 | } |
| 356 | } |
| 357 | |
stefan@webrtc.org | 286fe0b | 2013-08-21 20:58:21 +0000 | [diff] [blame] | 358 | ReceiveStatistics* ReceiveStatistics::Create(Clock* clock) { |
| 359 | return new ReceiveStatisticsImpl(clock); |
| 360 | } |
| 361 | |
| 362 | ReceiveStatisticsImpl::ReceiveStatisticsImpl(Clock* clock) |
| 363 | : clock_(clock), |
Danil Chapovalov | d1996b7 | 2018-01-16 11:07:18 +0100 | [diff] [blame] | 364 | last_returned_ssrc_(0), |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 365 | rtcp_stats_callback_(NULL), |
| 366 | rtp_stats_callback_(NULL) {} |
stefan@webrtc.org | 286fe0b | 2013-08-21 20:58:21 +0000 | [diff] [blame] | 367 | |
| 368 | ReceiveStatisticsImpl::~ReceiveStatisticsImpl() { |
| 369 | while (!statisticians_.empty()) { |
| 370 | delete statisticians_.begin()->second; |
| 371 | statisticians_.erase(statisticians_.begin()); |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | void ReceiveStatisticsImpl::IncomingPacket(const RTPHeader& header, |
Niels Möller | 5304a32 | 2018-08-27 13:27:05 +0200 | [diff] [blame] | 376 | size_t packet_length) { |
sprang@webrtc.org | c30e9e2 | 2014-09-08 08:20:18 +0000 | [diff] [blame] | 377 | StreamStatisticianImpl* impl; |
sprang@webrtc.org | 7dba27c | 2014-01-21 16:33:37 +0000 | [diff] [blame] | 378 | { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 379 | rtc::CritScope cs(&receive_statistics_lock_); |
Danil Chapovalov | c5267d2 | 2017-09-18 13:57:19 +0200 | [diff] [blame] | 380 | auto it = statisticians_.find(header.ssrc); |
sprang@webrtc.org | c30e9e2 | 2014-09-08 08:20:18 +0000 | [diff] [blame] | 381 | if (it != statisticians_.end()) { |
| 382 | impl = it->second; |
| 383 | } else { |
Niels Möller | 5304a32 | 2018-08-27 13:27:05 +0200 | [diff] [blame] | 384 | impl = new StreamStatisticianImpl( |
| 385 | header.ssrc, clock_, /* enable_retransmit_detection = */ false, this, |
| 386 | this); |
sprang@webrtc.org | c30e9e2 | 2014-09-08 08:20:18 +0000 | [diff] [blame] | 387 | statisticians_[header.ssrc] = impl; |
sprang@webrtc.org | 7dba27c | 2014-01-21 16:33:37 +0000 | [diff] [blame] | 388 | } |
stefan@webrtc.org | 286fe0b | 2013-08-21 20:58:21 +0000 | [diff] [blame] | 389 | } |
sprang@webrtc.org | c30e9e2 | 2014-09-08 08:20:18 +0000 | [diff] [blame] | 390 | // StreamStatisticianImpl instance is created once and only destroyed when |
| 391 | // this whole ReceiveStatisticsImpl is destroyed. StreamStatisticianImpl has |
| 392 | // it's own locking so don't hold receive_statistics_lock_ (potential |
| 393 | // deadlock). |
Niels Möller | 5304a32 | 2018-08-27 13:27:05 +0200 | [diff] [blame] | 394 | impl->IncomingPacket(header, packet_length); |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 395 | } |
| 396 | |
asapersson@webrtc.org | 273fbbb | 2015-01-27 12:17:29 +0000 | [diff] [blame] | 397 | void ReceiveStatisticsImpl::FecPacketReceived(const RTPHeader& header, |
| 398 | size_t packet_length) { |
danilchap | ec86be0 | 2017-08-14 05:51:02 -0700 | [diff] [blame] | 399 | StreamStatisticianImpl* impl; |
| 400 | { |
| 401 | rtc::CritScope cs(&receive_statistics_lock_); |
Danil Chapovalov | c5267d2 | 2017-09-18 13:57:19 +0200 | [diff] [blame] | 402 | auto it = statisticians_.find(header.ssrc); |
danilchap | ec86be0 | 2017-08-14 05:51:02 -0700 | [diff] [blame] | 403 | // Ignore FEC if it is the first packet. |
| 404 | if (it == statisticians_.end()) |
| 405 | return; |
| 406 | impl = it->second; |
sprang@webrtc.org | c30e9e2 | 2014-09-08 08:20:18 +0000 | [diff] [blame] | 407 | } |
danilchap | ec86be0 | 2017-08-14 05:51:02 -0700 | [diff] [blame] | 408 | impl->FecPacketReceived(header, packet_length); |
stefan@webrtc.org | 286fe0b | 2013-08-21 20:58:21 +0000 | [diff] [blame] | 409 | } |
| 410 | |
stefan@webrtc.org | 286fe0b | 2013-08-21 20:58:21 +0000 | [diff] [blame] | 411 | StreamStatistician* ReceiveStatisticsImpl::GetStatistician( |
| 412 | uint32_t ssrc) const { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 413 | rtc::CritScope cs(&receive_statistics_lock_); |
Danil Chapovalov | c5267d2 | 2017-09-18 13:57:19 +0200 | [diff] [blame] | 414 | auto it = statisticians_.find(ssrc); |
stefan@webrtc.org | 286fe0b | 2013-08-21 20:58:21 +0000 | [diff] [blame] | 415 | if (it == statisticians_.end()) |
| 416 | return NULL; |
| 417 | return it->second; |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 418 | } |
| 419 | |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 420 | void ReceiveStatisticsImpl::SetMaxReorderingThreshold( |
| 421 | int max_reordering_threshold) { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 422 | rtc::CritScope cs(&receive_statistics_lock_); |
Danil Chapovalov | c5267d2 | 2017-09-18 13:57:19 +0200 | [diff] [blame] | 423 | for (auto& statistician : statisticians_) { |
| 424 | statistician.second->SetMaxReorderingThreshold(max_reordering_threshold); |
stefan@webrtc.org | 7bb8f02 | 2013-09-06 13:40:11 +0000 | [diff] [blame] | 425 | } |
| 426 | } |
| 427 | |
Niels Möller | 5304a32 | 2018-08-27 13:27:05 +0200 | [diff] [blame] | 428 | void ReceiveStatisticsImpl::EnableRetransmitDetection(uint32_t ssrc, |
| 429 | bool enable) { |
| 430 | StreamStatisticianImpl* impl; |
| 431 | { |
| 432 | rtc::CritScope cs(&receive_statistics_lock_); |
| 433 | StreamStatisticianImpl*& impl_ref = statisticians_[ssrc]; |
| 434 | if (impl_ref == nullptr) { // new element |
| 435 | impl_ref = new StreamStatisticianImpl(ssrc, clock_, enable, this, this); |
| 436 | return; |
| 437 | } |
| 438 | impl = impl_ref; |
| 439 | } |
| 440 | impl->EnableRetransmitDetection(enable); |
| 441 | } |
| 442 | |
sprang@webrtc.org | 54ae4ff | 2013-12-19 13:26:02 +0000 | [diff] [blame] | 443 | void ReceiveStatisticsImpl::RegisterRtcpStatisticsCallback( |
| 444 | RtcpStatisticsCallback* callback) { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 445 | rtc::CritScope cs(&receive_statistics_lock_); |
sprang@webrtc.org | 54ae4ff | 2013-12-19 13:26:02 +0000 | [diff] [blame] | 446 | if (callback != NULL) |
| 447 | assert(rtcp_stats_callback_ == NULL); |
| 448 | rtcp_stats_callback_ = callback; |
| 449 | } |
| 450 | |
| 451 | void ReceiveStatisticsImpl::StatisticsUpdated(const RtcpStatistics& statistics, |
| 452 | uint32_t ssrc) { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 453 | rtc::CritScope cs(&receive_statistics_lock_); |
pbos@webrtc.org | ce4e9a3 | 2014-12-18 13:50:16 +0000 | [diff] [blame] | 454 | if (rtcp_stats_callback_) |
sprang@webrtc.org | 54ae4ff | 2013-12-19 13:26:02 +0000 | [diff] [blame] | 455 | rtcp_stats_callback_->StatisticsUpdated(statistics, ssrc); |
pbos@webrtc.org | ce4e9a3 | 2014-12-18 13:50:16 +0000 | [diff] [blame] | 456 | } |
| 457 | |
| 458 | void ReceiveStatisticsImpl::CNameChanged(const char* cname, uint32_t ssrc) { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 459 | rtc::CritScope cs(&receive_statistics_lock_); |
pbos@webrtc.org | ce4e9a3 | 2014-12-18 13:50:16 +0000 | [diff] [blame] | 460 | if (rtcp_stats_callback_) |
| 461 | rtcp_stats_callback_->CNameChanged(cname, ssrc); |
sprang@webrtc.org | 54ae4ff | 2013-12-19 13:26:02 +0000 | [diff] [blame] | 462 | } |
stefan@webrtc.org | 286fe0b | 2013-08-21 20:58:21 +0000 | [diff] [blame] | 463 | |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 464 | void ReceiveStatisticsImpl::RegisterRtpStatisticsCallback( |
| 465 | StreamDataCountersCallback* callback) { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 466 | rtc::CritScope cs(&receive_statistics_lock_); |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 467 | if (callback != NULL) |
| 468 | assert(rtp_stats_callback_ == NULL); |
| 469 | rtp_stats_callback_ = callback; |
| 470 | } |
| 471 | |
| 472 | void ReceiveStatisticsImpl::DataCountersUpdated(const StreamDataCounters& stats, |
| 473 | uint32_t ssrc) { |
danilchap | 7c9426c | 2016-04-14 03:05:31 -0700 | [diff] [blame] | 474 | rtc::CritScope cs(&receive_statistics_lock_); |
sprang@webrtc.org | 0e93257 | 2014-01-23 10:00:39 +0000 | [diff] [blame] | 475 | if (rtp_stats_callback_) { |
| 476 | rtp_stats_callback_->DataCountersUpdated(stats, ssrc); |
| 477 | } |
| 478 | } |
| 479 | |
danilchap | 0bc8423 | 2017-08-11 08:12:54 -0700 | [diff] [blame] | 480 | std::vector<rtcp::ReportBlock> ReceiveStatisticsImpl::RtcpReportBlocks( |
danilchap | f5f793c | 2017-07-27 04:44:18 -0700 | [diff] [blame] | 481 | size_t max_blocks) { |
Danil Chapovalov | c5267d2 | 2017-09-18 13:57:19 +0200 | [diff] [blame] | 482 | std::map<uint32_t, StreamStatisticianImpl*> statisticians; |
| 483 | { |
| 484 | rtc::CritScope cs(&receive_statistics_lock_); |
| 485 | statisticians = statisticians_; |
| 486 | } |
danilchap | f5f793c | 2017-07-27 04:44:18 -0700 | [diff] [blame] | 487 | std::vector<rtcp::ReportBlock> result; |
| 488 | result.reserve(std::min(max_blocks, statisticians.size())); |
Danil Chapovalov | d1996b7 | 2018-01-16 11:07:18 +0100 | [diff] [blame] | 489 | auto add_report_block = [&result](uint32_t media_ssrc, |
| 490 | StreamStatisticianImpl* statistician) { |
danilchap | f5f793c | 2017-07-27 04:44:18 -0700 | [diff] [blame] | 491 | // Do we have receive statistics to send? |
| 492 | RtcpStatistics stats; |
Danil Chapovalov | d1996b7 | 2018-01-16 11:07:18 +0100 | [diff] [blame] | 493 | if (!statistician->GetActiveStatisticsAndReset(&stats)) |
| 494 | return; |
danilchap | f5f793c | 2017-07-27 04:44:18 -0700 | [diff] [blame] | 495 | result.emplace_back(); |
| 496 | rtcp::ReportBlock& block = result.back(); |
Danil Chapovalov | d1996b7 | 2018-01-16 11:07:18 +0100 | [diff] [blame] | 497 | block.SetMediaSsrc(media_ssrc); |
danilchap | f5f793c | 2017-07-27 04:44:18 -0700 | [diff] [blame] | 498 | block.SetFractionLost(stats.fraction_lost); |
srte | 186d9c3 | 2017-08-04 05:03:53 -0700 | [diff] [blame] | 499 | if (!block.SetCumulativeLost(stats.packets_lost)) { |
Mirko Bonadei | 675513b | 2017-11-09 11:09:25 +0100 | [diff] [blame] | 500 | RTC_LOG(LS_WARNING) << "Cumulative lost is oversized."; |
danilchap | f5f793c | 2017-07-27 04:44:18 -0700 | [diff] [blame] | 501 | result.pop_back(); |
Danil Chapovalov | d1996b7 | 2018-01-16 11:07:18 +0100 | [diff] [blame] | 502 | return; |
danilchap | f5f793c | 2017-07-27 04:44:18 -0700 | [diff] [blame] | 503 | } |
srte | 186d9c3 | 2017-08-04 05:03:53 -0700 | [diff] [blame] | 504 | block.SetExtHighestSeqNum(stats.extended_highest_sequence_number); |
danilchap | f5f793c | 2017-07-27 04:44:18 -0700 | [diff] [blame] | 505 | block.SetJitter(stats.jitter); |
Danil Chapovalov | d1996b7 | 2018-01-16 11:07:18 +0100 | [diff] [blame] | 506 | }; |
| 507 | |
| 508 | const auto start_it = statisticians.upper_bound(last_returned_ssrc_); |
| 509 | for (auto it = start_it; |
| 510 | result.size() < max_blocks && it != statisticians.end(); ++it) |
| 511 | add_report_block(it->first, it->second); |
| 512 | for (auto it = statisticians.begin(); |
| 513 | result.size() < max_blocks && it != start_it; ++it) |
| 514 | add_report_block(it->first, it->second); |
| 515 | |
| 516 | if (!result.empty()) |
| 517 | last_returned_ssrc_ = result.back().source_ssrc(); |
danilchap | f5f793c | 2017-07-27 04:44:18 -0700 | [diff] [blame] | 518 | return result; |
| 519 | } |
| 520 | |
wu@webrtc.org | 822fbd8 | 2013-08-15 23:38:54 +0000 | [diff] [blame] | 521 | } // namespace webrtc |