| 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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 bool SetRtpSsrc(void* data, size_t len, uint32_t value); | 52 bool SetRtpSsrc(void* data, size_t len, uint32_t value); |
| 53 // Assumes version 2, no padding, no extensions, no csrcs. | 53 // Assumes version 2, no padding, no extensions, no csrcs. |
| 54 bool SetRtpHeader(void* data, size_t len, const RtpHeader& header); | 54 bool SetRtpHeader(void* data, size_t len, const RtpHeader& header); |
| 55 | 55 |
| 56 bool IsRtpPacket(const void* data, size_t len); | 56 bool IsRtpPacket(const void* data, size_t len); |
| 57 | 57 |
| 58 // True if |payload type| is 0-127. | 58 // True if |payload type| is 0-127. |
| 59 bool IsValidRtpPayloadType(int payload_type); | 59 bool IsValidRtpPayloadType(int payload_type); |
| 60 | 60 |
| 61 // True if |size| is appropriate for the indicated packet type. |
| 62 bool IsValidRtpRtcpPacketSize(bool rtcp, size_t size); |
| 63 |
| 64 // TODO(zstein): Consider using an enum instead of a bool to differentiate |
| 65 // between RTP and RTCP. |
| 66 // Returns "RTCP" or "RTP" according to |rtcp|. |
| 67 const char* RtpRtcpStringLiteral(bool rtcp); |
| 68 |
| 61 // Verifies that a packet has a valid RTP header. | 69 // Verifies that a packet has a valid RTP header. |
| 62 bool ValidateRtpHeader(const uint8_t* rtp, | 70 bool ValidateRtpHeader(const uint8_t* rtp, |
| 63 size_t length, | 71 size_t length, |
| 64 size_t* header_length); | 72 size_t* header_length); |
| 65 | 73 |
| 66 // Helper method which updates the absolute send time extension if present. | 74 // Helper method which updates the absolute send time extension if present. |
| 67 bool UpdateRtpAbsSendTimeExtension(uint8_t* rtp, | 75 bool UpdateRtpAbsSendTimeExtension(uint8_t* rtp, |
| 68 size_t length, | 76 size_t length, |
| 69 int extension_id, | 77 int extension_id, |
| 70 uint64_t time_us); | 78 uint64_t time_us); |
| 71 | 79 |
| 72 // Applies specified |options| to the packet. It updates the absolute send time | 80 // Applies specified |options| to the packet. It updates the absolute send time |
| 73 // extension header if it is present present then updates HMAC. | 81 // extension header if it is present present then updates HMAC. |
| 74 bool ApplyPacketOptions(uint8_t* data, | 82 bool ApplyPacketOptions(uint8_t* data, |
| 75 size_t length, | 83 size_t length, |
| 76 const rtc::PacketTimeUpdateParams& packet_time_params, | 84 const rtc::PacketTimeUpdateParams& packet_time_params, |
| 77 uint64_t time_us); | 85 uint64_t time_us); |
| 78 | 86 |
| 79 | 87 |
| 80 } // namespace cricket | 88 } // namespace cricket |
| 81 | 89 |
| 82 #endif // WEBRTC_MEDIA_BASE_RTPUTILS_H_ | 90 #endif // WEBRTC_MEDIA_BASE_RTPUTILS_H_ |
| OLD | NEW |