Implement new padding manager calculation algorithm #1810
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR implements a new algorithm to decide the amount of padding to send.
The new algorithm is based on a FSM with 4 states:
Start
- a ramp-up state where we will send more padding than the current estimate. This state will be triggered when a stream starts and will last for a few seconds.Stable
- a mode similar to the old algorithm that adjust padding based on the current estimate, the target bitrate and the media that is being sent.Hold
- After a big drop in estimate is detected, we will go into hold mode and stop sending padding for a few seconds.Recover
- After being on hold, this state will check if the estimate drop was transitory by adjusting padding with the estimate detected before the drop. If another drop is detected in this state, the new lower estimation will be used in stable mode.We currently have no way to "restart" which may be a good idea in some situations (big changes in the target bw, for instance)
Changes in Client or Server public APIs
[] It includes documentation for these changes in
/doc
.