* Expected vs actual Layer based connection quality.
With VBR streams (like screen share), bit rate is not a good indicator
of whether desired layer (spatial/temporal) is achieved due to high
variance.
Using expected vs actual layer (i. e. distance to desired) can capture
any short fall and include it in quality scoring.
This PR uses distance to desired, i. e. how many steps it would take to
go from actual spatial/temporal -> desired spatial/temporal and that
distance is propotionally used (currently it is just linear) to decrease
score.
* wire up layer transitions for screen share tracks
A couple of other bits
1. Use request layer for sending PLI on bind and connected.
2. When adjusting for overshoot, do not adjust target unless current is
at max. If not, it could get stuck in a lower layer in the following
scenario
a. Overshoot to layer 2
b. Max layer is 1, start sending PLI
c. Get key frame for layer 0, adjust for overshoot as we have
something at a layer lower than max.
d. Adjust for overshoot.
e. Setting target to max means that current and target are equal
and no further adjustment happens.
* WIP commit
* Send stream state paused only when it is paused due to bandwidth limitation.
When stream is resumed after a stream is paused, an active update is
sent. Note that this means if there are intervening events like
mute/unmute between pause and resume, resume will be sent.
* WIP commit
* WIP commit
* fix copy pasta
* setting PC with previous answer has to happen synchronously
* static check
* WIP commit
* WIP commit
* fixing transport tests
* fix tests and clean up
* minor renaming
* FIx test race
* log event when channel is full
This probably needs more work
- Maybe some events should not be queued
- Reduce number of events
Bump up the size any way so that the queue does not overflow
when subscribing to a lot of tracks.
* Handle an edge in layer lock.
A very edge case
- Available layer: [0, 1, 2], but bitrate is not yet available.
We set it to layer 2 awaiting measurement.
- Measurement for layers 0 and 1 come through.
- Still no key frame for layer 2.
- Finalize layers runs and sees that bitrate is available for 0 and 1.
It finalizes layer 1.
- Layer 1 key frame comes (because we asked key frame of layer 2,
publisher sends key frame for all layers). Locks to layer 1.
- No more events happen to switch to layer 2.
Changes
-------
- Move bit rate measurement to StreamTrackerManager. Allows re-use
in relay.
- Make bit rate availability (from zero -> non-zero) an event
and let it flow through the stream allocation flow so that we
always have an event when bit rate measurement becomes available.
This gets rid of finalization which I was unhappy with it anyway as
it was polling every second.
- Removing REMB stuff from buffer. We do not use it.
It is incorrect anyway. REMB should be ay peer connection level.
* Fix test
* fix test
* Simplify allocate
* Simplify/clean up
* Use an atomic flag to stop stream allocator
* use a mutex for event channel
* RLock while posting event
* lock isStopped flag to prevent posting to closed channel
Still not using it. But, now that Pion has merged the initial
version of GCC (Google Congestion Control) for send side bandwidth
estimation, we can integrate it.
We will enable once we have tested and feel comfortable.
* Prevent multiple resume notifications on track
When returning previous allocation as is, reset change to none.
Ideally, would like to have change as a separate return and not in last
allocation. But, also prefer to have last allocation state. For now,
resetting change.
* log bandwidth estimate only on decrease
* Fix tests
Add back adding track to publishedTracks for testing purposes.
* WIP branch
* Don't know why merge from `master` did not catch this change.
* WIP commit
* Hook up all the bits for TWCC to work
* Fix typo
* WIP commit
* Catch up to latest API
* Move RTP/RTCP info config
* Instantiate GCC/TWCC interceptor only when in use
* comment SSBWE parts
* RTCP feedback in publisher config
* WIP commit
* Add some tests
* allowedSubscribers uses participant sid
* correct variable name
* correct another variable name
* Add ParticipantSid to SubscriptionPermissionUpdate message
* protocol v0.11.2
* WIP commit
* WIP commit
* fix tests
* Remove unused code
* Close uptrack manager
* Remove duplicate close
* move comment to the correct line where the loop could be long
* Fix disallowed list revocation, thank you Jie
* Remove unneeded interface method
* RemoveSubscriber in Participant
* Clean up disallowed subscriptions and handle permissions on new track addition
* add test for track addition after permission set
* Remove unnecessary check