Audio uses signal SignalCid and SdpCid. (#3564)

This is a bit annoying and painful. Audio does not have the information
in the track info (because it does not use Codecs, it should probably at
some point to make it consistent).
This commit is contained in:
Raja Subramanian
2025-03-31 21:16:11 +05:30
committed by GitHub
parent ed5e2f16b2
commit cdfbb106d1
2 changed files with 12 additions and 0 deletions
+10
View File
@@ -60,6 +60,8 @@ type MediaTrack struct {
}
type MediaTrackParams struct {
SignalCid string
SdpCid string
ParticipantID livekit.ParticipantID
ParticipantIdentity livekit.ParticipantIdentity
ParticipantVersion uint32
@@ -175,6 +177,10 @@ func (t *MediaTrack) NotifySubscriberNodeMaxQuality(nodeID livekit.NodeID, quali
}
func (t *MediaTrack) HasSignalCid(cid string) bool {
if t.params.SignalCid == cid {
return true
}
for _, c := range t.MediaTrackReceiver.TrackInfo().Codecs {
if c.SignalCid == cid {
return true
@@ -194,6 +200,10 @@ func (t *MediaTrack) SdpCids() []string {
}
func (t *MediaTrack) HasSdpCid(cid string) bool {
if t.params.SdpCid == cid {
return true
}
for _, c := range t.MediaTrackReceiver.TrackInfo().Codecs {
if c.SdpCid == cid {
return true
+2
View File
@@ -2607,6 +2607,8 @@ func (p *ParticipantImpl) addMigratedTrack(cid string, ti *livekit.TrackInfo) *M
func (p *ParticipantImpl) addMediaTrack(signalCid string, sdpCid string, ti *livekit.TrackInfo) *MediaTrack {
mt := NewMediaTrack(MediaTrackParams{
SignalCid: signalCid,
SdpCid: sdpCid,
ParticipantID: p.params.SID,
ParticipantIdentity: p.params.Identity,
ParticipantVersion: p.version.Load(),