This repository has been archived by the owner on Mar 1, 2024. It is now read-only.
Add support for programmatically changing peer layers when using the SFU #179
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.
Relevant components:
Problem statement:
Currently when utilising the SFU, players are switched to different resolution streams based on their prevailing network conditions.
It may be useful however, to force a specific player (or all players) to be on a specific layer. This could be useful during development to see how your stream will look at different resolutions without needing to use a third party tool such as NetLimiter to fake this poor network.
Solution
This PR adds support for a new message from the application. This message is structured as follows:
The
playerId
value represents the id of the player whose layers you wish to change.The
spatialLayer
value represents the resolution based layer, configured by theSimulcastParameters
passed to the application at launch. If no value is passed, layer 0 represents full resolution and layer 1 represents half resolution.The
temporalLayer
value represents the framerate based layer. Pixel Streaming currently doesn't support different temporal layers, but if/when support for it is added this value will become useful.Documentation
No SFU specific docs.
Test Plan and Compatibility
Tested using the latest SFU and Cirrus to ensure a stream can still operate as expected.
I also setup a key bind in an Unreal project to switch between layers. In this example, I passed three layers in the application by launching with
-SimulcastParameters=1.0,5000000,20000000,2.0,1000000,5000000,4.0,50000,1000000
. These three layers represent Full Res, Half Res and Quarter Res. My bind would then cycle through each layer on key press and set every player to this new layer.