| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // Unknown block, ignore. | 84 // Unknown block, ignore. |
| 85 LOG(LS_WARNING) << "Unknown extended report block type " << block_type; | 85 LOG(LS_WARNING) << "Unknown extended report block type " << block_type; |
| 86 break; | 86 break; |
| 87 } | 87 } |
| 88 current_block = next_block; | 88 current_block = next_block; |
| 89 } | 89 } |
| 90 | 90 |
| 91 return true; | 91 return true; |
| 92 } | 92 } |
| 93 | 93 |
| 94 bool ExtendedReports::WithRrtr(const Rrtr& rrtr) { | 94 bool ExtendedReports::AddRrtr(const Rrtr& rrtr) { |
| 95 if (rrtr_blocks_.size() >= kMaxNumberOfRrtrBlocks) { | 95 if (rrtr_blocks_.size() >= kMaxNumberOfRrtrBlocks) { |
| 96 LOG(LS_WARNING) << "Max RRTR blocks reached."; | 96 LOG(LS_WARNING) << "Max RRTR blocks reached."; |
| 97 return false; | 97 return false; |
| 98 } | 98 } |
| 99 rrtr_blocks_.push_back(rrtr); | 99 rrtr_blocks_.push_back(rrtr); |
| 100 return true; | 100 return true; |
| 101 } | 101 } |
| 102 | 102 |
| 103 bool ExtendedReports::WithDlrr(const Dlrr& dlrr) { | 103 bool ExtendedReports::AddDlrr(const Dlrr& dlrr) { |
| 104 if (dlrr_blocks_.size() >= kMaxNumberOfDlrrBlocks) { | 104 if (dlrr_blocks_.size() >= kMaxNumberOfDlrrBlocks) { |
| 105 LOG(LS_WARNING) << "Max DLRR blocks reached."; | 105 LOG(LS_WARNING) << "Max DLRR blocks reached."; |
| 106 return false; | 106 return false; |
| 107 } | 107 } |
| 108 dlrr_blocks_.push_back(dlrr); | 108 dlrr_blocks_.push_back(dlrr); |
| 109 return true; | 109 return true; |
| 110 } | 110 } |
| 111 | 111 |
| 112 bool ExtendedReports::WithVoipMetric(const VoipMetric& voip_metric) { | 112 bool ExtendedReports::AddVoipMetric(const VoipMetric& voip_metric) { |
| 113 if (voip_metric_blocks_.size() >= kMaxNumberOfVoipMetricBlocks) { | 113 if (voip_metric_blocks_.size() >= kMaxNumberOfVoipMetricBlocks) { |
| 114 LOG(LS_WARNING) << "Max Voip Metric blocks reached."; | 114 LOG(LS_WARNING) << "Max Voip Metric blocks reached."; |
| 115 return false; | 115 return false; |
| 116 } | 116 } |
| 117 voip_metric_blocks_.push_back(voip_metric); | 117 voip_metric_blocks_.push_back(voip_metric); |
| 118 return true; | 118 return true; |
| 119 } | 119 } |
| 120 | 120 |
| 121 bool ExtendedReports::Create(uint8_t* packet, | 121 bool ExtendedReports::Create(uint8_t* packet, |
| 122 size_t* index, | 122 size_t* index, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 if (block_length != VoipMetric::kBlockLength) { | 179 if (block_length != VoipMetric::kBlockLength) { |
| 180 LOG(LS_WARNING) << "Incorrect voip metric block size " << block_length | 180 LOG(LS_WARNING) << "Incorrect voip metric block size " << block_length |
| 181 << " Should be " << VoipMetric::kBlockLength; | 181 << " Should be " << VoipMetric::kBlockLength; |
| 182 return; | 182 return; |
| 183 } | 183 } |
| 184 voip_metric_blocks_.push_back(VoipMetric()); | 184 voip_metric_blocks_.push_back(VoipMetric()); |
| 185 voip_metric_blocks_.back().Parse(block); | 185 voip_metric_blocks_.back().Parse(block); |
| 186 } | 186 } |
| 187 } // namespace rtcp | 187 } // namespace rtcp |
| 188 } // namespace webrtc | 188 } // namespace webrtc |
| OLD | NEW |