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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 uint8_t* AllocatePayload(size_t size_bytes); | 118 uint8_t* AllocatePayload(size_t size_bytes); |
119 bool SetPadding(uint8_t size_bytes, Random* random); | 119 bool SetPadding(uint8_t size_bytes, Random* random); |
120 | 120 |
121 protected: | 121 protected: |
122 // |extensions| required for SetExtension/ReserveExtension functions during | 122 // |extensions| required for SetExtension/ReserveExtension functions during |
123 // packet creating and used if available in Parse function. | 123 // packet creating and used if available in Parse function. |
124 // Adding and getting extensions will fail until |extensions| is | 124 // Adding and getting extensions will fail until |extensions| is |
125 // provided via constructor or IdentifyExtensions function. | 125 // provided via constructor or IdentifyExtensions function. |
126 Packet(); | 126 Packet(); |
127 explicit Packet(const ExtensionManager* extensions); | 127 explicit Packet(const ExtensionManager* extensions); |
128 Packet(const Packet&) = default; | 128 Packet(const Packet&); |
129 Packet(const ExtensionManager* extensions, size_t capacity); | 129 Packet(const ExtensionManager* extensions, size_t capacity); |
130 virtual ~Packet(); | 130 virtual ~Packet(); |
131 | 131 |
132 Packet& operator=(const Packet&) = default; | 132 Packet& operator=(const Packet&) = default; |
133 | 133 |
134 private: | 134 private: |
135 struct ExtensionInfo { | 135 struct ExtensionInfo { |
136 ExtensionType type; | 136 ExtensionType type; |
137 uint16_t offset; | 137 uint16_t offset; |
138 uint8_t length; | 138 uint8_t length; |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 auto buffer = AllocateExtension(Extension::kId, Extension::kValueSizeBytes); | 197 auto buffer = AllocateExtension(Extension::kId, Extension::kValueSizeBytes); |
198 if (buffer.empty()) | 198 if (buffer.empty()) |
199 return false; | 199 return false; |
200 memset(buffer.data(), 0, Extension::kValueSizeBytes); | 200 memset(buffer.data(), 0, Extension::kValueSizeBytes); |
201 return true; | 201 return true; |
202 } | 202 } |
203 } // namespace rtp | 203 } // namespace rtp |
204 } // namespace webrtc | 204 } // namespace webrtc |
205 | 205 |
206 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ | 206 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_PACKET_H_ |
OLD | NEW |