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, StreamId* rsid) { | |
224 if (data.empty()) | |
nisse-webrtc
2017/04/10 12:25:00
If we use nul-termination in StreamId, I think ids
danilchap
2017/04/10 13:27:05
General rule suggest to be strict about spec when
nisse-webrtc
2017/04/11 07:59:24
"Be liberal in what you accept, and
conservati
danilchap
2017/04/11 10:05:26
I guess that was the quote I meant.
was interestin
nisse-webrtc
2017/04/11 10:42:53
Fair enough. I'd prefer stricter parsing, but I do
| |
225 return false; | |
226 rsid->Set(data); | |
227 return true; | |
228 } | |
229 | |
230 // RepairedRtpStreamId. | |
231 constexpr RTPExtensionType RepairedRtpStreamId::kId; | |
232 constexpr uint8_t RepairedRtpStreamId::kValueSizeBytes; | |
233 constexpr const char* RepairedRtpStreamId::kUri; | |
234 | |
235 bool RepairedRtpStreamId::Parse(rtc::ArrayView<const uint8_t> data, | |
236 StreamId* rsid) { | |
237 if (data.empty()) | |
nisse-webrtc
2017/04/10 12:25:00
And here too.
danilchap
2017/04/11 10:05:26
ensured RapairedRtpStreamId::Parse implementation
| |
238 return false; | |
239 rsid->Set(data); | |
240 return true; | |
241 } | |
242 | |
218 } // namespace webrtc | 243 } // namespace webrtc |
OLD | NEW |