~Send initial participant update only after a participant becomes active.~ - General clean up (#3655)
* Send initial participant update only after a participant becomes active. There are cases where apps send data to remote participant as soon as client emits `ParticipantConnected`. But, that time point would not have a fully established client (i. e. the media connection + data channel establishment is still in progress). This PR changes the initial participant update to be sent from server side only when a participant becomes `ACTIVE`, i.e fully connected (media channel established and data channels open). It is supported for clients using protocol version > 15. @cnderrauber bumping up the protocol version in this PR. Move support is also conditioned on protocol version > 15, but that PR did not ump protocol version. Please let me know if there are issues bumping protocol version. * check for joining states in broadcast * have to check on other participant * test * make helper for sending participant updates * test * make utility of pushAndDeque * test * consolidate getting other participants * remove extra cast * debug * debug * typo * stop transceiver that is not bound * logs * log * check for ever bound * clean up * clean up
This commit is contained in:
@@ -291,6 +291,7 @@ type DownTrack struct {
|
||||
|
||||
bindLock sync.Mutex
|
||||
bindState atomic.Value
|
||||
wasEverBound atomic.Bool
|
||||
onBinding func(error)
|
||||
bindOnReceiverReady func()
|
||||
onBindAndConnected func()
|
||||
@@ -584,6 +585,7 @@ func (d *DownTrack) Bind(t webrtc.TrackLocalContext) (webrtc.RTPCodecParameters,
|
||||
d.onBinding(nil)
|
||||
}
|
||||
d.setBindStateLocked(bindStateBound)
|
||||
d.wasEverBound.Store(true)
|
||||
d.bindLock.Unlock()
|
||||
|
||||
d.forwarder.DetermineCodec(codec.RTPCodecCapability, d.Receiver().HeaderExtensions())
|
||||
@@ -852,8 +854,8 @@ func (d *DownTrack) SetTransceiver(transceiver *webrtc.RTPTransceiver) {
|
||||
d.transceiver.Store(transceiver)
|
||||
}
|
||||
|
||||
func (d *DownTrack) GetTransceiver() *webrtc.RTPTransceiver {
|
||||
return d.transceiver.Load()
|
||||
func (d *DownTrack) GetTransceiver() (*webrtc.RTPTransceiver, bool) {
|
||||
return d.transceiver.Load(), d.wasEverBound.Load()
|
||||
}
|
||||
|
||||
func (d *DownTrack) postKeyFrameRequestEvent() {
|
||||
|
||||
Reference in New Issue
Block a user