OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2012 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 | 84 |
85 class RTPFragmentationHeader { | 85 class RTPFragmentationHeader { |
86 public: | 86 public: |
87 RTPFragmentationHeader() | 87 RTPFragmentationHeader() |
88 : fragmentationVectorSize(0), | 88 : fragmentationVectorSize(0), |
89 fragmentationOffset(NULL), | 89 fragmentationOffset(NULL), |
90 fragmentationLength(NULL), | 90 fragmentationLength(NULL), |
91 fragmentationTimeDiff(NULL), | 91 fragmentationTimeDiff(NULL), |
92 fragmentationPlType(NULL) {} | 92 fragmentationPlType(NULL) {} |
93 | 93 |
94 RTPFragmentationHeader(RTPFragmentationHeader&& other) | |
95 : RTPFragmentationHeader() { | |
96 fragmentationVectorSize = other.fragmentationVectorSize; | |
97 std::swap(fragmentationOffset, other.fragmentationOffset); | |
98 std::swap(fragmentationLength, other.fragmentationLength); | |
99 std::swap(fragmentationTimeDiff, other.fragmentationTimeDiff); | |
100 std::swap(fragmentationPlType, other.fragmentationPlType); | |
101 } | |
kwiberg-webrtc
2017/08/27 22:59:24
You could turn lines 96-100 into a swap() implemen
sakal
2017/08/28 08:00:20
Done.
| |
102 | |
94 ~RTPFragmentationHeader() { | 103 ~RTPFragmentationHeader() { |
95 delete[] fragmentationOffset; | 104 delete[] fragmentationOffset; |
96 delete[] fragmentationLength; | 105 delete[] fragmentationLength; |
97 delete[] fragmentationTimeDiff; | 106 delete[] fragmentationTimeDiff; |
98 delete[] fragmentationPlType; | 107 delete[] fragmentationPlType; |
99 } | 108 } |
100 | 109 |
101 void CopyFrom(const RTPFragmentationHeader& src) { | 110 void CopyFrom(const RTPFragmentationHeader& src) { |
102 if (this == &src) { | 111 if (this == &src) { |
103 return; | 112 return; |
(...skipping 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
622 static constexpr int kNotAProbe = -1; | 631 static constexpr int kNotAProbe = -1; |
623 int send_bitrate_bps = -1; | 632 int send_bitrate_bps = -1; |
624 int probe_cluster_id = kNotAProbe; | 633 int probe_cluster_id = kNotAProbe; |
625 int probe_cluster_min_probes = -1; | 634 int probe_cluster_min_probes = -1; |
626 int probe_cluster_min_bytes = -1; | 635 int probe_cluster_min_bytes = -1; |
627 }; | 636 }; |
628 | 637 |
629 } // namespace webrtc | 638 } // namespace webrtc |
630 | 639 |
631 #endif // WEBRTC_MODULES_INCLUDE_MODULE_COMMON_TYPES_H_ | 640 #endif // WEBRTC_MODULES_INCLUDE_MODULE_COMMON_TYPES_H_ |
OLD | NEW |