OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2011 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 if (len < kMinRtpPacketLen) | 272 if (len < kMinRtpPacketLen) |
273 return false; | 273 return false; |
274 | 274 |
275 return (static_cast<const uint8_t*>(data)[0] >> 6) == kRtpVersion; | 275 return (static_cast<const uint8_t*>(data)[0] >> 6) == kRtpVersion; |
276 } | 276 } |
277 | 277 |
278 bool IsValidRtpPayloadType(int payload_type) { | 278 bool IsValidRtpPayloadType(int payload_type) { |
279 return payload_type >= 0 && payload_type <= 127; | 279 return payload_type >= 0 && payload_type <= 127; |
280 } | 280 } |
281 | 281 |
| 282 bool IsValidRtpRtcpPacketSize(bool rtcp, size_t size) { |
| 283 return (rtcp ? size >= kMinRtcpPacketLen : size >= kMinRtpPacketLen) && |
| 284 size <= kMaxRtpPacketLen; |
| 285 } |
| 286 |
| 287 const char* RtpRtcpStringLiteral(bool rtcp) { |
| 288 return rtcp ? "RTCP" : "RTP"; |
| 289 } |
| 290 |
282 bool ValidateRtpHeader(const uint8_t* rtp, | 291 bool ValidateRtpHeader(const uint8_t* rtp, |
283 size_t length, | 292 size_t length, |
284 size_t* header_length) { | 293 size_t* header_length) { |
285 if (header_length) { | 294 if (header_length) { |
286 *header_length = 0; | 295 *header_length = 0; |
287 } | 296 } |
288 | 297 |
289 if (length < kMinRtpPacketLen) { | 298 if (length < kMinRtpPacketLen) { |
290 return false; | 299 return false; |
291 } | 300 } |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
455 UpdateRtpAbsSendTimeExtension(start, rtp_length, | 464 UpdateRtpAbsSendTimeExtension(start, rtp_length, |
456 packet_time_params.rtp_sendtime_extension_id, | 465 packet_time_params.rtp_sendtime_extension_id, |
457 time_us); | 466 time_us); |
458 } | 467 } |
459 | 468 |
460 UpdateRtpAuthTag(start, rtp_length, packet_time_params); | 469 UpdateRtpAuthTag(start, rtp_length, packet_time_params); |
461 return true; | 470 return true; |
462 } | 471 } |
463 | 472 |
464 } // namespace cricket | 473 } // namespace cricket |
OLD | NEW |