Introduce a pending close map and fire onNoSubscribers only
when there are not subscribed and no pending close.
There are a couple of paths for down track close
- RemoveSubscriber
- RemoveAllSubscriber
We remove the subscriber from `subscribedTracks` in these.
This is because `AddSubscriber` checks for existing subscription.
If there is a remove followed by an add, the add should not think
there is an existing susbcription if there is a delay in down track
close callback.
But, down track close is also called directly from places like
participant close. So, have to clean up both subscribedTrack
and pendingClose when the down track close fires.
Call onNoSubscribers only when both are empty. This will allow
relay up track to stop properly when all susbcribers have left.
* Fix no-video with adaptive streaming
With a recent change to initialize max quality for subscriber
synchronously, a subsequent update at the same quality was
getting ignored. So, there was no message back to publisher
to start up video layers. Reproducible every time the subscriber
joined after all the layers of publishers was turned off.
While not pretty, for now, disable the check for quality match
on subscriber update. That disabling itself is fine as there is
another check for consolidated quality match before sending
a message to the publisher, but in general this area has shown
some shakiness and needs some work.
* Use notify function to set initial quality also
* Consolidating PLI throttle
Use the throttler in `sfu.WebRTCReceiver`.
Does change shape of config object.
* Move PLIThrottleConfig to sfu.WebRTCReceiver
* fix test compile
* Cleaning up unused stuff
* improve readability
* RTT
- Calculate down track RTT using RTCP Receiver report
- Surface it back to the participant
- Participant updates all its published trackes
(throttled to limit update to once in 5 seconds)
- That propagates to all the upstream sfu.Buffer and the nacker.
So, we will have RTT throttled NACKs.
* rtt callback
* Consolidating PLI throttle
Use the throttler in `sfu.WebRTCReceiver`.
Does change shape of config object.
* Move PLIThrottleConfig to sfu.WebRTCReceiver
* fix test compile
* Cleaning up unused stuff
* readability improvement
* Force DTLE role client for the simulated client side peer connection
during migration.
Without that, with remote side being ice-lite (i. e. server offer
is subscriber peer connection), pion chooses the server DTLS role
and both side end up being servers.
* pion/webrtc -> 3.1.21
* remove local reference
* Use setup from previous answer
* more comments
* Use ParticipantInfo version to ensure consistency
Deprecating time.Time and avoid locking unnecessarily
* properly adjust ulimit. update protocol
* Save initial version from params
* get rid of metadata field, use grants copy
* fix test