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 | 10 |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 // | Payload | | 55 // | Payload | |
56 // | .... : padding... | | 56 // | .... : padding... | |
57 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 57 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
58 // | padding | Padding size | | 58 // | padding | Padding size | |
59 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | 59 // +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |
60 Packet::Packet() : Packet(nullptr, kDefaultPacketSize) {} | 60 Packet::Packet() : Packet(nullptr, kDefaultPacketSize) {} |
61 | 61 |
62 Packet::Packet(const ExtensionManager* extensions) | 62 Packet::Packet(const ExtensionManager* extensions) |
63 : Packet(extensions, kDefaultPacketSize) {} | 63 : Packet(extensions, kDefaultPacketSize) {} |
64 | 64 |
| 65 Packet::Packet(const Packet&) = default; |
| 66 |
65 Packet::Packet(const ExtensionManager* extensions, size_t capacity) | 67 Packet::Packet(const ExtensionManager* extensions, size_t capacity) |
66 : buffer_(capacity) { | 68 : buffer_(capacity) { |
67 RTC_DCHECK_GE(capacity, kFixedHeaderSize); | 69 RTC_DCHECK_GE(capacity, kFixedHeaderSize); |
68 Clear(); | 70 Clear(); |
69 if (extensions) { | 71 if (extensions) { |
70 IdentifyExtensions(*extensions); | 72 IdentifyExtensions(*extensions); |
71 } else { | 73 } else { |
72 for (size_t i = 0; i < kMaxExtensionHeaders; ++i) | 74 for (size_t i = 0; i < kMaxExtensionHeaders; ++i) |
73 extension_entries_[i].type = ExtensionManager::kInvalidType; | 75 extension_entries_[i].type = ExtensionManager::kInvalidType; |
74 } | 76 } |
(...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 uint8_t* Packet::WriteAt(size_t offset) { | 575 uint8_t* Packet::WriteAt(size_t offset) { |
574 return buffer_.data() + offset; | 576 return buffer_.data() + offset; |
575 } | 577 } |
576 | 578 |
577 void Packet::WriteAt(size_t offset, uint8_t byte) { | 579 void Packet::WriteAt(size_t offset, uint8_t byte) { |
578 buffer_.data()[offset] = byte; | 580 buffer_.data()[offset] = byte; |
579 } | 581 } |
580 | 582 |
581 } // namespace rtp | 583 } // namespace rtp |
582 } // namespace webrtc | 584 } // namespace webrtc |
OLD | NEW |