Merge pull request #371 from stazio/fix_typos

Fixed the description of SDPs and refactor RTP_RTX packets
This commit is contained in:
Paul-Louis Ageneau
2021-03-16 20:38:34 +01:00
committed by GitHub
2 changed files with 10 additions and 11 deletions

View File

@ -716,16 +716,22 @@ public:
return totalSize - (getBody() - reinterpret_cast<char *>(this)); return totalSize - (getBody() - reinterpret_cast<char *>(this));
} }
[[nodiscard]] size_t getSize() const{
return header.getSize() + sizeof(uint16_t);
}
[[nodiscard]] RTP &getHeader() { return header; } [[nodiscard]] RTP &getHeader() { return header; }
/*
* Returns the new size of the packet
*/
size_t normalizePacket(size_t totalSize, SSRC originalSSRC, uint8_t originalPayloadType) { size_t normalizePacket(size_t totalSize, SSRC originalSSRC, uint8_t originalPayloadType) {
header.setSeqNumber(getOriginalSeqNo()); header.setSeqNumber(getOriginalSeqNo());
header.setSsrc(originalSSRC); header.setSsrc(originalSSRC);
header.setPayloadType(originalPayloadType); header.setPayloadType(originalPayloadType);
// TODO, the -12 is the size of the header (which is variable!) // TODO, the -12 is the size of the header (which is variable!)
memmove(header.getBody(), header.getBody() + sizeof(uint16_t), memmove(header.getBody(), getBody(), totalSize - getSize());
totalSize - 12 - sizeof(uint16_t)); return totalSize - 2;
return totalSize - sizeof(uint16_t);
} }
}; };

View File

@ -844,14 +844,7 @@ void Description::Media::addRTPMap(const Description::Media::RTPMap &map) {
} }
std::vector<uint32_t> Description::Media::getSSRCs() { std::vector<uint32_t> Description::Media::getSSRCs() {
std::vector<uint32_t> vec; return mSsrcs;
for (auto &val : mAttributes) {
PLOG_DEBUG << val;
if (val.find("ssrc:") == 0) {
vec.emplace_back(to_integer<uint32_t>(val.substr(5, val.find(" "))));
}
}
return vec;
} }
std::map<int, Description::Media::RTPMap>::iterator Description::Media::beginMaps() { std::map<int, Description::Media::RTPMap>::iterator Description::Media::beginMaps() {