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); |
34 | 35 |
35 // Parse and move given buffer into Packet. | 36 // Parse and move given buffer into Packet. |
36 bool Parse(rtc::CopyOnWriteBuffer packet); | 37 bool Parse(rtc::CopyOnWriteBuffer packet); |
37 | 38 |
38 // Maps extensions id to their types. | 39 // Maps extensions id to their types. |
39 void IdentifyExtensions(const ExtensionManager& extensions); | 40 void IdentifyExtensions(const ExtensionManager& extensions); |
40 | 41 |
41 // Header. | 42 // Header. |
42 bool Marker() const; | 43 bool Marker() const; |
43 uint8_t PayloadType() const; | 44 uint8_t PayloadType() const; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 uint16_t offset = 0; | 186 uint16_t offset = 0; |
186 if (!AllocateExtension(Extension::kId, Extension::kValueSizeBytes, &offset)) | 187 if (!AllocateExtension(Extension::kId, Extension::kValueSizeBytes, &offset)) |
187 return false; | 188 return false; |
188 memset(WriteAt(offset), 0, Extension::kValueSizeBytes); | 189 memset(WriteAt(offset), 0, Extension::kValueSizeBytes); |
189 return true; | 190 return true; |
190 } | 191 } |
191 } // namespace rtp | 192 } // namespace rtp |
192 } // namespace webrtc | 193 } // namespace webrtc |
193 | 194 |
194 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ | 195 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ |
OLD | NEW |