-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Description
Related to #1079.
Overview
We are gonna save lot of bandwidth by just adding into each RTP packet RTP extensions supported by the receiver, and we are gonna make the MID RTP extension has dynamic value instead of being always 8 bytes (value + required zeroed padding).
Current Approach in v3
Currently we set all the RTP extensions in Producer::MangleRtpPacket() and later we rewrite their values when sending the RTP packet to each consumer. This comes with pros and cons:
Pros:
- We just shit bytes in the RTP packet once, and we do it when we receive it (in
Producer.cpp.
Const:
- We add RTP extensions that some consumers may not even support.
- For dynamic length extensions (just MID for now) we allocate maximum size (8 bytes) and fill with zeros if MID takes less than 8 bytes (it usually does).
- In summary, outgoing packets have usually many useless bytes, and this means more bitrate.
New Proposal
- Let's not call
packet->SetExtensions()inProducer::MangleRtpPacket(). - Instead, call
packet->SetExtensions()it in the sendingTransportwith a customized vector of RTP extensions (those supported by the receiver). - Of course, these extensions must be reseted when sending the same RTP packet to the next consumer.
- Special care with RTP probation packets which already have preallocated space for required RTP header extensions. The sending
TransportMUST NOT override the set of extensions in those probation packets, but must only rewrite them (absSendTime,transportWideCc01, etc).
Pros:
- We save lot of bytes.
Const:
- We may shift a single RTP packet many times while iterating it through all the consumers that must receive it.
Reactions are currently unavailable