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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 return ids_[type]; | 70 return ids_[type]; |
71 } | 71 } |
72 | 72 |
73 size_t GetTotalLengthInBytes() const; | 73 size_t GetTotalLengthInBytes() const; |
74 | 74 |
75 // TODO(danilchap): Remove use of the functions below. | 75 // TODO(danilchap): Remove use of the functions below. |
76 int32_t Register(RTPExtensionType type, uint8_t id) { | 76 int32_t Register(RTPExtensionType type, uint8_t id) { |
77 return RegisterByType(id, type) ? 0 : -1; | 77 return RegisterByType(id, type) ? 0 : -1; |
78 } | 78 } |
79 int32_t Deregister(RTPExtensionType type); | 79 int32_t Deregister(RTPExtensionType type); |
80 int32_t GetType(uint8_t id, RTPExtensionType* type) const { | |
81 *type = GetType(id); | |
82 return *type == kInvalidType ? -1 : 0; | |
83 } | |
84 void GetCopy(RtpHeaderExtensionMap* copy) const { *copy = *this; } | |
85 | 80 |
86 private: | 81 private: |
87 static constexpr uint8_t kMinId = 1; | 82 static constexpr uint8_t kMinId = 1; |
88 static constexpr uint8_t kMaxId = 14; | 83 static constexpr uint8_t kMaxId = 14; |
89 bool Register(uint8_t id, | 84 bool Register(uint8_t id, |
90 RTPExtensionType type, | 85 RTPExtensionType type, |
91 size_t value_size, | 86 size_t value_size, |
92 const char* uri); | 87 const char* uri); |
93 | 88 |
94 size_t total_values_size_bytes_ = 0; | 89 size_t total_values_size_bytes_ = 0; |
95 RTPExtensionType types_[kMaxId + 1]; | 90 RTPExtensionType types_[kMaxId + 1]; |
96 uint8_t ids_[kRtpExtensionNumberOfExtensions]; | 91 uint8_t ids_[kRtpExtensionNumberOfExtensions]; |
97 }; | 92 }; |
98 | 93 |
99 } // namespace webrtc | 94 } // namespace webrtc |
100 | 95 |
101 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSION_H_ | 96 #endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_RTP_HEADER_EXTENSION_H_ |
102 | 97 |
OLD | NEW |