OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 ssrc1block2_.push_back(block1_2_); | 50 ssrc1block2_.push_back(block1_2_); |
51 ssrc12block1_.push_back(block1_1_); | 51 ssrc12block1_.push_back(block1_1_); |
52 ssrc12block1_.push_back(block2_1_); | 52 ssrc12block1_.push_back(block2_1_); |
53 ssrc12block2_.push_back(block1_2_); | 53 ssrc12block2_.push_back(block1_2_); |
54 ssrc12block2_.push_back(block2_2_); | 54 ssrc12block2_.push_back(block2_2_); |
55 } | 55 } |
56 | 56 |
57 RtcpStatistics RtcpReportBlockToRtcpStatistics( | 57 RtcpStatistics RtcpReportBlockToRtcpStatistics( |
58 const RTCPReportBlock& stats) { | 58 const RTCPReportBlock& stats) { |
59 RtcpStatistics block; | 59 RtcpStatistics block; |
60 block.cumulative_lost = stats.cumulativeLost; | 60 block.packets_lost = stats.cumulativeLost; |
61 block.fraction_lost = stats.fractionLost; | 61 block.fraction_lost = stats.fractionLost; |
62 block.extended_max_sequence_number = stats.extendedHighSeqNum; | 62 block.extended_highest_sequence_number = stats.extendedHighSeqNum; |
63 block.jitter = stats.jitter; | 63 block.jitter = stats.jitter; |
64 return block; | 64 return block; |
65 } | 65 } |
66 | 66 |
67 const uint32_t kSsrc1; | 67 const uint32_t kSsrc1; |
68 const uint32_t kSsrc2; | 68 const uint32_t kSsrc2; |
69 RTCPReportBlock block1_1_; | 69 RTCPReportBlock block1_1_; |
70 RTCPReportBlock block1_2_; | 70 RTCPReportBlock block1_2_; |
71 RTCPReportBlock block1_3_; | 71 RTCPReportBlock block1_3_; |
72 RTCPReportBlock block2_1_; | 72 RTCPReportBlock block2_1_; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 // fl: 100 * (15-10) / (24100-24000) = 5% | 136 // fl: 100 * (15-10) / (24100-24000) = 5% |
137 stats.Store(RtcpReportBlockToRtcpStatistics(block1_2_), kRemoteSsrc, kSsrc1); | 137 stats.Store(RtcpReportBlockToRtcpStatistics(block1_2_), kRemoteSsrc, kSsrc1); |
138 EXPECT_EQ(5, stats.FractionLostInPercent()); | 138 EXPECT_EQ(5, stats.FractionLostInPercent()); |
139 // fl: 100 * (50-10) / (24200-24000) = 20% | 139 // fl: 100 * (50-10) / (24200-24000) = 20% |
140 stats.Store(RtcpReportBlockToRtcpStatistics(block1_3_), kRemoteSsrc, kSsrc1); | 140 stats.Store(RtcpReportBlockToRtcpStatistics(block1_3_), kRemoteSsrc, kSsrc1); |
141 EXPECT_EQ(20, stats.FractionLostInPercent()); | 141 EXPECT_EQ(20, stats.FractionLostInPercent()); |
142 } | 142 } |
143 | 143 |
144 } // namespace webrtc | 144 } // namespace webrtc |
145 | 145 |
OLD | NEW |