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 parsed extensions to their types to allow use of GetExtension. | 39 // Maps parsed extensions to their types to allow use of GetExtension. |
39 // Used after parsing when |extensions| can't be provided until base rtp | 40 // Used after parsing when |extensions| can't be provided until base rtp |
40 // header is parsed. | 41 // header is parsed. |
41 void IdentifyExtensions(const ExtensionManager* extensions); | 42 void IdentifyExtensions(const ExtensionManager* extensions); |
42 | 43 |
43 // Header. | 44 // Header. |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 uint16_t offset = 0; | 192 uint16_t offset = 0; |
192 if (!AllocateExtension(Extension::kId, Extension::kValueSizeBytes, &offset)) | 193 if (!AllocateExtension(Extension::kId, Extension::kValueSizeBytes, &offset)) |
193 return false; | 194 return false; |
194 memset(WriteAt(offset), 0, Extension::kValueSizeBytes); | 195 memset(WriteAt(offset), 0, Extension::kValueSizeBytes); |
195 return true; | 196 return true; |
196 } | 197 } |
197 } // namespace rtp | 198 } // namespace rtp |
198 } // namespace webrtc | 199 } // namespace webrtc |
199 | 200 |
200 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ | 201 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ |
OLD | NEW |