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:
@@ -60,6 +60,8 @@ type MediaTrack struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type MediaTrackParams struct {
|
type MediaTrackParams struct {
|
||||||
|
SignalCid string
|
||||||
|
SdpCid string
|
||||||
ParticipantID livekit.ParticipantID
|
ParticipantID livekit.ParticipantID
|
||||||
ParticipantIdentity livekit.ParticipantIdentity
|
ParticipantIdentity livekit.ParticipantIdentity
|
||||||
ParticipantVersion uint32
|
ParticipantVersion uint32
|
||||||
@@ -175,6 +177,10 @@ func (t *MediaTrack) NotifySubscriberNodeMaxQuality(nodeID livekit.NodeID, quali
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *MediaTrack) HasSignalCid(cid string) bool {
|
func (t *MediaTrack) HasSignalCid(cid string) bool {
|
||||||
|
if t.params.SignalCid == cid {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
for _, c := range t.MediaTrackReceiver.TrackInfo().Codecs {
|
for _, c := range t.MediaTrackReceiver.TrackInfo().Codecs {
|
||||||
if c.SignalCid == cid {
|
if c.SignalCid == cid {
|
||||||
return true
|
return true
|
||||||
@@ -194,6 +200,10 @@ func (t *MediaTrack) SdpCids() []string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (t *MediaTrack) HasSdpCid(cid string) bool {
|
func (t *MediaTrack) HasSdpCid(cid string) bool {
|
||||||
|
if t.params.SdpCid == cid {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
for _, c := range t.MediaTrackReceiver.TrackInfo().Codecs {
|
for _, c := range t.MediaTrackReceiver.TrackInfo().Codecs {
|
||||||
if c.SdpCid == cid {
|
if c.SdpCid == cid {
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -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 {
|
func (p *ParticipantImpl) addMediaTrack(signalCid string, sdpCid string, ti *livekit.TrackInfo) *MediaTrack {
|
||||||
mt := NewMediaTrack(MediaTrackParams{
|
mt := NewMediaTrack(MediaTrackParams{
|
||||||
|
SignalCid: signalCid,
|
||||||
|
SdpCid: sdpCid,
|
||||||
ParticipantID: p.params.SID,
|
ParticipantID: p.params.SID,
|
||||||
ParticipantIdentity: p.params.Identity,
|
ParticipantIdentity: p.params.Identity,
|
||||||
ParticipantVersion: p.version.Load(),
|
ParticipantVersion: p.version.Load(),
|
||||||
|
|||||||
Reference in New Issue
Block a user