From c84ec9dc24d0ced200dbc14b86ae743892dc378b Mon Sep 17 00:00:00 2001 From: boks1971 Date: Fri, 15 Aug 2025 12:22:21 +0530 Subject: [PATCH] clean up --- pkg/rtc/participant_sdp.go | 2 ++ pkg/rtc/transport.go | 14 ++++++++------ test/client/client.go | 6 ------ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/pkg/rtc/participant_sdp.go b/pkg/rtc/participant_sdp.go index 5b257b5d0..ed96e008b 100644 --- a/pkg/rtc/participant_sdp.go +++ b/pkg/rtc/participant_sdp.go @@ -371,6 +371,8 @@ func (p *ParticipantImpl) setCodecPreferencesForPublisherMedia( } // SINGLE-PEER-CONNECTION-TODO: can set mid in TrackInfo before sending offer and check on receiving answer to set SdpCid + // SINGLE-PEER-CONNECTION-TODO: this has to be do publish enabled codecs filtering also, cannot do it with setting registered codecs on peer connection as subscriber codecs could be different from publisher codecs + // SINGLE-PEER-CONNECTION-TODO: probably have to do RTP Header Extensions and RTCP feedback filtering also here } return parsedOffer, unprocessed diff --git a/pkg/rtc/transport.go b/pkg/rtc/transport.go index c71e66ef4..6bb96ef8d 100644 --- a/pkg/rtc/transport.go +++ b/pkg/rtc/transport.go @@ -265,12 +265,14 @@ type PCTransport struct { } type TransportParams struct { - Handler transport.Handler - ProtocolVersion types.ProtocolVersion - Config *WebRTCConfig - Twcc *lktwcc.Responder - DirectionConfig DirectionConfig - CongestionControlConfig config.CongestionControlConfig + Handler transport.Handler + ProtocolVersion types.ProtocolVersion + Config *WebRTCConfig + Twcc *lktwcc.Responder + // SINGLE-PEER-CONNECTION-TODO: guess this has to be superset of published and subscribed direction configs + DirectionConfig DirectionConfig + CongestionControlConfig config.CongestionControlConfig + // SINGLE-PEER-CONNECTION-TODO: guess this has to be superset of published and subscribed codecs EnabledCodecs []*livekit.Codec Logger logger.Logger Transport livekit.SignalTarget diff --git a/test/client/client.go b/test/client/client.go index b294cb7fe..d2ef5d2e8 100644 --- a/test/client/client.go +++ b/test/client/client.go @@ -81,8 +81,6 @@ type RTCClient struct { publisherFullyEstablished atomic.Bool subscriberFullyEstablished atomic.Bool pongReceivedAt atomic.Int64 - lastOffer atomic.Pointer[webrtc.SessionDescription] // RAJA-REMOVE - lastAnswer atomic.Pointer[webrtc.SessionDescription] // RAJA-REMOVE // tracks waiting to be acked, cid => trackInfo pendingPublishedTracks map[string]*livekit.TrackInfo @@ -869,13 +867,11 @@ func (c *RTCClient) GetPublishedTrackIDs() []string { // LastOffer return SDP of the last offer for the subscriber connection func (c *RTCClient) LastOffer() *webrtc.SessionDescription { - // RAJA-REMOVE return c.lastOffer.Load() return c.subscriber.CurrentRemoteDescription() } // LastAnswer return SDP of the last answer for the publisher connection func (c *RTCClient) LastAnswer() *webrtc.SessionDescription { - // RAJA-REMOVE return c.lastAnswer.Load() return c.publisher.CurrentRemoteDescription() } @@ -925,7 +921,6 @@ func (c *RTCClient) handleDataMessageUnlabeled(data []byte) { // handles a server initiated offer, handle on subscriber PC func (c *RTCClient) handleOffer(desc webrtc.SessionDescription, offerId uint32) { logger.Infow("handling server offer", "participant", c.localParticipant.Identity) - // RAJA-REMOVE c.lastOffer.Store(&desc) c.subscriber.HandleRemoteDescription(desc, offerId) } @@ -933,7 +928,6 @@ func (c *RTCClient) handleOffer(desc webrtc.SessionDescription, offerId uint32) func (c *RTCClient) handleAnswer(desc webrtc.SessionDescription, answerId uint32) { logger.Infow("handling server answer", "participant", c.localParticipant.Identity) - // RAJA-REMOVE c.lastAnswer.Store(&desc) // remote answered the offer, establish connection c.publisher.HandleRemoteDescription(desc, answerId) }