Chromium Code Reviews| 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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 125 extensions->erase(it); | 125 extensions->erase(it); |
| 126 } | 126 } |
| 127 found = true; | 127 found = true; |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 } | 130 } |
| 131 } // namespace | 131 } // namespace |
| 132 | 132 |
| 133 bool ValidateRtpExtensions( | 133 bool ValidateRtpExtensions( |
| 134 const std::vector<webrtc::RtpExtension>& extensions) { | 134 const std::vector<webrtc::RtpExtension>& extensions) { |
| 135 bool id_used[14] = {false}; | 135 int id_used[14] = {false}; |
|
pthatcher1
2017/03/21 07:07:06
Why was this changed?
joachim
2017/03/23 00:04:32
This was a leftover from some earlier testing code
| |
| 136 for (const auto& extension : extensions) { | 136 for (const auto& extension : extensions) { |
| 137 if (extension.id <= 0 || extension.id >= 15) { | 137 if (extension.id <= 0 || extension.id >= 15) { |
| 138 LOG(LS_ERROR) << "Bad RTP extension ID: " << extension.ToString(); | 138 LOG(LS_ERROR) << "Bad RTP extension ID: " << extension.ToString(); |
| 139 return false; | 139 return false; |
| 140 } | 140 } |
| 141 if (id_used[extension.id - 1]) { | 141 if (id_used[extension.id - 1]) { |
| 142 LOG(LS_ERROR) << "Duplicate RTP extension ID: " << extension.ToString(); | 142 LOG(LS_ERROR) << "Duplicate RTP extension ID: " << extension.ToString(); |
| 143 return false; | 143 return false; |
| 144 } | 144 } |
| 145 id_used[extension.id - 1] = true; | 145 id_used[extension.id - 1] = true; |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 168 // specified in a different order (also allows us to use std::unique below). | 168 // specified in a different order (also allows us to use std::unique below). |
| 169 std::sort(result.begin(), result.end(), | 169 std::sort(result.begin(), result.end(), |
| 170 [](const webrtc::RtpExtension& rhs, | 170 [](const webrtc::RtpExtension& rhs, |
| 171 const webrtc::RtpExtension& lhs) { return rhs.uri < lhs.uri; }); | 171 const webrtc::RtpExtension& lhs) { return rhs.uri < lhs.uri; }); |
| 172 | 172 |
| 173 // Remove unnecessary extensions (used on send side). | 173 // Remove unnecessary extensions (used on send side). |
| 174 if (filter_redundant_extensions) { | 174 if (filter_redundant_extensions) { |
| 175 auto it = std::unique( | 175 auto it = std::unique( |
| 176 result.begin(), result.end(), | 176 result.begin(), result.end(), |
| 177 [](const webrtc::RtpExtension& rhs, const webrtc::RtpExtension& lhs) { | 177 [](const webrtc::RtpExtension& rhs, const webrtc::RtpExtension& lhs) { |
| 178 return rhs.uri == lhs.uri; | 178 return rhs.uri == lhs.uri && rhs.encrypted == lhs.encrypted; |
| 179 }); | 179 }); |
| 180 result.erase(it, result.end()); | 180 result.erase(it, result.end()); |
| 181 | 181 |
| 182 // Keep just the highest priority extension of any in the following list. | 182 // Keep just the highest priority extension of any in the following list. |
| 183 static const char* kBweExtensionPriorities[] = { | 183 static const char* kBweExtensionPriorities[] = { |
| 184 webrtc::RtpExtension::kTransportSequenceNumberUri, | 184 webrtc::RtpExtension::kTransportSequenceNumberUri, |
| 185 webrtc::RtpExtension::kAbsSendTimeUri, | 185 webrtc::RtpExtension::kAbsSendTimeUri, |
| 186 webrtc::RtpExtension::kTimestampOffsetUri}; | 186 webrtc::RtpExtension::kTimestampOffsetUri}; |
| 187 DiscardRedundantExtensions(&result, kBweExtensionPriorities); | 187 DiscardRedundantExtensions(&result, kBweExtensionPriorities); |
| 188 } | 188 } |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 209 } | 209 } |
| 210 if (codec.GetParam(kCodecParamMaxBitrate, &bitrate_kbps) && | 210 if (codec.GetParam(kCodecParamMaxBitrate, &bitrate_kbps) && |
| 211 bitrate_kbps > 0) { | 211 bitrate_kbps > 0) { |
| 212 config.max_bitrate_bps = bitrate_kbps * 1000; | 212 config.max_bitrate_bps = bitrate_kbps * 1000; |
| 213 } else { | 213 } else { |
| 214 config.max_bitrate_bps = -1; | 214 config.max_bitrate_bps = -1; |
| 215 } | 215 } |
| 216 return config; | 216 return config; |
| 217 } | 217 } |
| 218 } // namespace cricket | 218 } // namespace cricket |
| OLD | NEW |