Repository navigation
Conversation
| AddTrackRequests []*livekit.AddTrackRequest | ||
| PublisherOffer *livekit.SessionDescription | ||
| SyncState *livekit.SyncState | ||
| UseSinglePeerConnection bool |
There was a problem hiding this comment.
This is set automatically on ParticipantInit based on how the initial request is received. If client uses the WrappedJoinRequest, this is automatically enabled.
| } | ||
|
|
||
| func getPublisherConfig(consolidated bool) DirectionConfig { | ||
| if consolidated { |
There was a problem hiding this comment.
using the union of subscriber and publisher when in single peer connection mode so that the media engine has all the options.
Separately, RTCP config is set on subscribed track media sections using SetCodecPreferences when a subscribed track is assigned to a transceiver. Will make a note of where that happens in the relevant file below.
There was a problem hiding this comment.
There is an option to use sendside or recvside bandwidth estimation for subscriber before, is it still possible to use recvside bandwidth estimation for subscribed track in signle peer connection mode?
There was a problem hiding this comment.
Good catch Jie. Actually, I only have receive side (meaning REMB) available here as it is the default. send side (TWCC) is config based now. And I think I have it now such that it can be enabled only for subscriber peer connection. I had a mental note to address it, but forgot. I will check what is a good way to do that and will also check that it works.
There was a problem hiding this comment.
by doing consolidated config both extensions are available in SDP. Actually, just checked and the code to enable send side (TWCC) in downstream via config should work.
There was a problem hiding this comment.
@cnderrauber Just wanted to make sure that you were able to see the above replies. I frequently forget to hit submit. Looks like I did it this time. Did you not get a notification?
| return mime.MimeTypeOpus.String() | ||
| } | ||
|
|
||
| func filterCodecs( |
There was a problem hiding this comment.
This is used by subscribed track side to filter out non-subscribe enabled codecs.
In a single peer connection mode, the media engine is configured with all codecs. The filtering happens when subscribed track is added to the peer connection on the corresponding transceiver.
| info := t.params.MediaTrack.ToProto() | ||
| addTrackParams := types.AddTrackParams{ | ||
| Stereo: info.Stereo, | ||
| Stereo: slices.Contains(info.AudioFeatures, livekit.AudioTrackFeature_TF_STEREO), |
There was a problem hiding this comment.
just clean up to not rely on deprecated/legacy fields.
| return p.TransportManager.AddTrackLocal( | ||
| trackLocal, | ||
| params, | ||
| p.enabledSubscribeCodecs, |
There was a problem hiding this comment.
Made a note above about subscribed tracks filtering only subscribe enabled codecs. This is the place where the subscribed enabled codecs are given to AddTrack when using single peer connection mode. It is given nil when in dual peer connection mode.
| return err | ||
| } | ||
|
|
||
| func (p *ParticipantImpl) sendMediaSectionsRequirement(numAudios uint32, numVideos uint32) error { |
There was a problem hiding this comment.
This is the new signal response message to require clients to send another offer maybe with more media sections added.
| // As Firefox does not support migration, ICE Lite can be disabled. | ||
| se.SetLite(false) | ||
| } | ||
| se.SetDisableTransceiverReuseInRecvonly(params.DisableRecvonlyTransceiverReuse) |
There was a problem hiding this comment.
This is the new flag to disable transceiver re-use when in recvonly. Details in pion PR - pion/webrtc#3200. Will look at maintaining state in transceiver like Nils suggested later. In that case, this flag may not be required.
| if trackLocal.Kind() == webrtc.RTPCodecTypeAudio { | ||
| configureAudioTransceiver(transceiver, params.Stereo, !params.Red || !t.params.ClientInfo.SupportsAudioRED()) | ||
| } | ||
| configureTransceiverCodecs(transceiver, enabledCodecs, rtcpFeedbackConfig, !t.params.IsOfferer) |
There was a problem hiding this comment.
Made a note in couple of places about subscribed track filtering enabled codecs and setting codec preferences. This is where it happens when a track is added to the peer connection. The preferences are set on the corresponding transceiver.
|
|
||
| return "" | ||
| }, AssignJobTimeout) | ||
| for _, useSinglePeerConnection := range []bool{false, true} { |
There was a problem hiding this comment.
Using this for all tests to test both dual peer connection and single peer connection modes. Using a separate argument to createRTCClient helper to indicate use of single peer connection. But, it is possible to roll it into testclient.Options. But, wanted to use an extra argument to ensure I have covered all the places which uses this helper to test both modes. Once it is working, will probably change it to use an option.
cnderrauber
left a comment
There was a problem hiding this comment.
Great work!! This will improve connectivity for edge case!
| } | ||
|
|
||
| func getPublisherConfig(consolidated bool) DirectionConfig { | ||
| if consolidated { |
There was a problem hiding this comment.
There is an option to use sendside or recvside bandwidth estimation for subscriber before, is it still possible to use recvside bandwidth estimation for subscribed track in signle peer connection mode?
|
|
||
| if info == nil { | ||
| p.pendingTracksLock.RUnlock() | ||
| if ti != nil { |
There was a problem hiding this comment.
put this block below the ti == nil check?
| // configure publisher answer for audio track's dtx and stereo settings | ||
| func (p *ParticipantImpl) configurePublisherAnswer(answer webrtc.SessionDescription) webrtc.SessionDescription { | ||
| offer := p.TransportManager.LastPublisherOffer() | ||
| if offer == nil { |
There was a problem hiding this comment.
is it possible a nil offer when setting answer?
There was a problem hiding this comment.
No, it should not be. Left over from when I was trying to do the subscriber peer connection as single peer connection I think. Will remove.
Use publisher peer connection only for both upstream and down stream tracks.
The flow is
offerto receive subscribed tracks. These should beaddTrack('audio|video', recvonly). This lets the server add subscribed track in theanswerif there are media sections available.MediaSectionsRequirementsignal response. More details about that message in Protocol changes to potentially support single peer connection mode. protocol#1174SyncState, client should send publisher peer connection's previous offer/answer. Need some resolution for that, have an open question in Protocol changes to potentially support single peer connection mode. protocol#1174Made all integration tests to run with dual peer connection protocol and single peer connection protocol.
Will leave more notes inline.