| 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 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ | 10 #ifndef WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 namespace rtp { | 25 namespace rtp { |
| 26 class Packet { | 26 class Packet { |
| 27 public: | 27 public: |
| 28 using ExtensionType = RTPExtensionType; | 28 using ExtensionType = RTPExtensionType; |
| 29 using ExtensionManager = RtpHeaderExtensionMap; | 29 using ExtensionManager = RtpHeaderExtensionMap; |
| 30 static constexpr size_t kMaxExtensionHeaders = 14; | 30 static constexpr size_t kMaxExtensionHeaders = 14; |
| 31 | 31 |
| 32 // Parse and copy given buffer into Packet. | 32 // Parse and copy given buffer into Packet. |
| 33 bool Parse(const uint8_t* buffer, size_t size); | 33 bool Parse(const uint8_t* buffer, size_t size); |
| 34 bool Parse(rtc::ArrayView<const uint8_t> packet); | |
| 35 | 34 |
| 36 // Parse and move given buffer into Packet. | 35 // Parse and move given buffer into Packet. |
| 37 bool Parse(rtc::CopyOnWriteBuffer packet); | 36 bool Parse(rtc::CopyOnWriteBuffer packet); |
| 38 | 37 |
| 39 // Maps extensions id to their types. | 38 // Maps extensions id to their types. |
| 40 void IdentifyExtensions(const ExtensionManager& extensions); | 39 void IdentifyExtensions(const ExtensionManager& extensions); |
| 41 | 40 |
| 42 // Header. | 41 // Header. |
| 43 bool Marker() const; | 42 bool Marker() const; |
| 44 uint8_t PayloadType() const; | 43 uint8_t PayloadType() const; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 uint16_t offset = 0; | 185 uint16_t offset = 0; |
| 187 if (!AllocateExtension(Extension::kId, Extension::kValueSizeBytes, &offset)) | 186 if (!AllocateExtension(Extension::kId, Extension::kValueSizeBytes, &offset)) |
| 188 return false; | 187 return false; |
| 189 memset(WriteAt(offset), 0, Extension::kValueSizeBytes); | 188 memset(WriteAt(offset), 0, Extension::kValueSizeBytes); |
| 190 return true; | 189 return true; |
| 191 } | 190 } |
| 192 } // namespace rtp | 191 } // namespace rtp |
| 193 } // namespace webrtc | 192 } // namespace webrtc |
| 194 | 193 |
| 195 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ | 194 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ |
| OLD | NEW |