RtpPacket class introduced.
BUG=webrtc:1994, webrtc:5261 Review URL: https://codereview.webrtc.org/1841453004 Cr-Commit-Position: refs/heads/master@{#12444}
This commit is contained in:
@ -112,6 +112,14 @@ int32_t RtpHeaderExtensionMap::GetType(const uint8_t id,
|
||||
return 0;
|
||||
}
|
||||
|
||||
RTPExtensionType RtpHeaderExtensionMap::GetType(uint8_t id) const {
|
||||
auto it = extensionMap_.find(id);
|
||||
if (it == extensionMap_.end()) {
|
||||
return kInvalidType;
|
||||
}
|
||||
return it->second->type;
|
||||
}
|
||||
|
||||
int32_t RtpHeaderExtensionMap::GetId(const RTPExtensionType type,
|
||||
uint8_t* id) const {
|
||||
assert(id);
|
||||
@ -129,6 +137,14 @@ int32_t RtpHeaderExtensionMap::GetId(const RTPExtensionType type,
|
||||
return -1;
|
||||
}
|
||||
|
||||
uint8_t RtpHeaderExtensionMap::GetId(RTPExtensionType type) const {
|
||||
for (auto kv : extensionMap_) {
|
||||
if (kv.second->type == type)
|
||||
return kv.first;
|
||||
}
|
||||
return kInvalidId;
|
||||
}
|
||||
|
||||
size_t RtpHeaderExtensionMap::GetTotalLengthInBytes() const {
|
||||
// Get length for each extension block.
|
||||
size_t length = 0;
|
||||
|
||||
Reference in New Issue
Block a user