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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 RTC_DCHECK_LE(0, playout_delay.min_ms); | 208 RTC_DCHECK_LE(0, playout_delay.min_ms); |
209 RTC_DCHECK_LE(playout_delay.min_ms, playout_delay.max_ms); | 209 RTC_DCHECK_LE(playout_delay.min_ms, playout_delay.max_ms); |
210 RTC_DCHECK_LE(playout_delay.max_ms, kMaxMs); | 210 RTC_DCHECK_LE(playout_delay.max_ms, kMaxMs); |
211 // Convert MS to value to be sent on extension header. | 211 // Convert MS to value to be sent on extension header. |
212 uint32_t min_delay = playout_delay.min_ms / kGranularityMs; | 212 uint32_t min_delay = playout_delay.min_ms / kGranularityMs; |
213 uint32_t max_delay = playout_delay.max_ms / kGranularityMs; | 213 uint32_t max_delay = playout_delay.max_ms / kGranularityMs; |
214 ByteWriter<uint32_t, 3>::WriteBigEndian(data, (min_delay << 12) | max_delay); | 214 ByteWriter<uint32_t, 3>::WriteBigEndian(data, (min_delay << 12) | max_delay); |
215 return true; | 215 return true; |
216 } | 216 } |
217 | 217 |
| 218 // RtpStreamId. |
| 219 constexpr RTPExtensionType RtpStreamId::kId; |
| 220 constexpr uint8_t RtpStreamId::kValueSizeBytes; |
| 221 constexpr const char* RtpStreamId::kUri; |
| 222 |
| 223 bool RtpStreamId::Parse(rtc::ArrayView<const uint8_t> data, std::string* rid) { |
| 224 if (data.empty()) |
| 225 return false; |
| 226 rid->assign(reinterpret_cast<const char*>(data.data()), data.size()); |
| 227 return true; |
| 228 } |
| 229 |
| 230 // RepairRtpStreamId. |
| 231 constexpr RTPExtensionType RepairRtpStreamId::kId; |
| 232 constexpr uint8_t RepairRtpStreamId::kValueSizeBytes; |
| 233 constexpr const char* RepairRtpStreamId::kUri; |
| 234 |
| 235 bool RepairRtpStreamId::Parse(rtc::ArrayView<const uint8_t> data, |
| 236 std::string* rid) { |
| 237 if (data.empty()) |
| 238 return false; |
| 239 rid->assign(reinterpret_cast<const char*>(data.data()), data.size()); |
| 240 return true; |
| 241 } |
| 242 |
218 } // namespace webrtc | 243 } // namespace webrtc |
OLD | NEW |