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_ |
11 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ | 11 #define WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ |
12 | 12 |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "webrtc/api/array_view.h" | 15 #include "webrtc/api/array_view.h" |
16 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" | 16 #include "webrtc/modules/rtp_rtcp/include/rtp_rtcp_defines.h" |
17 #include "webrtc/rtc_base/basictypes.h" | 17 #include "webrtc/rtc_base/basictypes.h" |
18 #include "webrtc/rtc_base/copyonwritebuffer.h" | 18 #include "webrtc/rtc_base/copyonwritebuffer.h" |
19 | 19 |
20 namespace webrtc { | 20 namespace webrtc { |
21 class RtpHeaderExtensionMap; | 21 class RtpHeaderExtensionMap; |
22 class Random; | 22 class Random; |
23 | 23 |
24 namespace rtp { | 24 namespace rtp { |
25 class Packet { | 25 class Packet { |
26 public: | 26 public: |
27 using ExtensionType = RTPExtensionType; | 27 using ExtensionType = RTPExtensionType; |
28 using ExtensionManager = RtpHeaderExtensionMap; | 28 using ExtensionManager = RtpHeaderExtensionMap; |
29 static constexpr size_t kMaxExtensionHeaders = 14; | 29 static constexpr int kMaxExtensionHeaders = 14; |
30 static constexpr int kMinExtensionId = 1; | 30 static constexpr int kMinExtensionId = 1; |
31 static constexpr int kMaxExtensionId = 14; | 31 static constexpr int kMaxExtensionId = 14; |
32 | 32 |
33 // Parse and copy given buffer into Packet. | 33 // Parse and copy given buffer into Packet. |
34 bool Parse(const uint8_t* buffer, size_t size); | 34 bool Parse(const uint8_t* buffer, size_t size); |
35 bool Parse(rtc::ArrayView<const uint8_t> packet); | 35 bool Parse(rtc::ArrayView<const uint8_t> packet); |
36 | 36 |
37 // Parse and move given buffer into Packet. | 37 // Parse and move given buffer into Packet. |
38 bool Parse(rtc::CopyOnWriteBuffer packet); | 38 bool Parse(rtc::CopyOnWriteBuffer packet); |
39 | 39 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 auto buffer = AllocateExtension(Extension::kId, Extension::kValueSizeBytes); | 192 auto buffer = AllocateExtension(Extension::kId, Extension::kValueSizeBytes); |
193 if (buffer.empty()) | 193 if (buffer.empty()) |
194 return false; | 194 return false; |
195 memset(buffer.data(), 0, Extension::kValueSizeBytes); | 195 memset(buffer.data(), 0, Extension::kValueSizeBytes); |
196 return true; | 196 return true; |
197 } | 197 } |
198 } // namespace rtp | 198 } // namespace rtp |
199 } // namespace webrtc | 199 } // namespace webrtc |
200 | 200 |
201 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ | 201 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ |
OLD | NEW |