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:
danilchap
2016-04-20 05:25:10 -07:00
committed by Commit bot
parent 2ddf09397f
commit 1edb7ab7bd
14 changed files with 1391 additions and 4 deletions

View File

@ -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;