update core to 0.0.5 (#1540)

* update core

* sort imports

* fix typos

* redundant types
This commit is contained in:
David Colburn
2023-03-22 16:53:23 -07:00
committed by GitHub
parent 0ea88e4025
commit 191a9e8014
41 changed files with 272 additions and 263 deletions
+3 -3
View File
@@ -340,7 +340,7 @@ func getNAT1to1IPsForConf(conf *config.Config, ipFilter func(net.IP) bool) ([]st
}(ip)
}
var firstResloved bool
var firstResolved bool
natMapping := make(map[string]string)
timeout := time.NewTimer(5 * time.Second)
defer timeout.Stop()
@@ -349,8 +349,8 @@ done:
for {
select {
case mapping := <-addrCh:
if !firstResloved {
firstResloved = true
if !firstResolved {
firstResolved = true
timeout.Reset(1 * time.Second)
}
if local, ok := natMapping[mapping.externalIP]; ok {
+1 -1
View File
@@ -88,7 +88,7 @@ func (d *DynacastManager) Close() {
}
}
// THere are situations like track unmute or streaming from a sifferent node
// THere are situations like track unmute or streaming from a different node
// where subscribed quality needs to sent to the provider immediately.
// This bypasses any debouncing and forces a subscribed quality update
// with immediate effect.
+3 -2
View File
@@ -6,10 +6,11 @@ import (
"testing"
"time"
"github.com/livekit/livekit-server/pkg/rtc/types"
"github.com/livekit/protocol/livekit"
"github.com/pion/webrtc/v3"
"github.com/stretchr/testify/require"
"github.com/livekit/livekit-server/pkg/rtc/types"
"github.com/livekit/protocol/livekit"
)
func TestSubscribedMaxQuality(t *testing.T) {
+1 -1
View File
@@ -54,7 +54,7 @@ func (m mediaTrackReceiverState) String() string {
}
}
//-----------------------------------------------------
// -----------------------------------------------------
type simulcastReceiver struct {
sfu.TrackReceiver
+4 -4
View File
@@ -687,7 +687,7 @@ func (p *ParticipantImpl) IsClosed() bool {
return p.isClosed.Load()
}
// Negotiate subscriber SDP with client, if force is true, will cencel pending
// Negotiate subscriber SDP with client, if force is true, will cancel pending
// negotiate task and negotiate immediately
func (p *ParticipantImpl) Negotiate(force bool) {
if p.MigrateState() != types.MigrateStateInit {
@@ -1363,7 +1363,7 @@ func (p *ParticipantImpl) onStreamStateChange(update *sfu.StreamStateUpdate) err
})
}
func (p *ParticipantImpl) onSubscribedMaxQualityChange(trackID livekit.TrackID, subscribedQualities []*livekit.SubscribedCodec, maxSubscribedQualites []types.SubscribedCodecQuality) error {
func (p *ParticipantImpl) onSubscribedMaxQualityChange(trackID livekit.TrackID, subscribedQualities []*livekit.SubscribedCodec, maxSubscribedQualities []types.SubscribedCodecQuality) error {
if p.params.DisableDynacast {
return nil
}
@@ -1394,7 +1394,7 @@ func (p *ParticipantImpl) onSubscribedMaxQualityChange(trackID livekit.TrackID,
}
}
for _, maxSubscribedQuality := range maxSubscribedQualites {
for _, maxSubscribedQuality := range maxSubscribedQualities {
ti := &livekit.TrackInfo{
Sid: string(trackID),
Type: livekit.TrackType_VIDEO,
@@ -1417,7 +1417,7 @@ func (p *ParticipantImpl) onSubscribedMaxQualityChange(trackID livekit.TrackID,
"sending max subscribed quality",
"trackID", trackID,
"qualities", subscribedQualities,
"max", maxSubscribedQualites,
"max", maxSubscribedQualities,
)
return p.writeMessage(&livekit.SignalResponse{
Message: &livekit.SignalResponse_SubscribedQualityUpdate{
+1 -1
View File
@@ -361,7 +361,7 @@ func TestSetStableTrackID(t *testing.T) {
}
func TestDisableCodecs(t *testing.T) {
participant := newParticipantForTestWithOpts(livekit.ParticipantIdentity("123"), &participantOpts{
participant := newParticipantForTestWithOpts("123", &participantOpts{
publisher: false,
clientConf: &livekit.ClientConfiguration{
DisabledCodecs: &livekit.DisabledCodecs{
+6 -6
View File
@@ -1162,11 +1162,11 @@ func BroadcastDataPacketForRoom(r types.Room, source types.LocalParticipant, dp
var dpData []byte
participants := r.GetLocalParticipants()
cap := len(dest)
if cap == 0 {
cap = len(participants)
capacity := len(dest)
if capacity == 0 {
capacity = len(participants)
}
destParticpants := make([]types.LocalParticipant, 0, cap)
destParticipants := make([]types.LocalParticipant, 0, capacity)
for _, op := range participants {
if op.State() != livekit.ParticipantInfo_ACTIVE {
@@ -1195,10 +1195,10 @@ func BroadcastDataPacketForRoom(r types.Room, source types.LocalParticipant, dp
return
}
}
destParticpants = append(destParticpants, op)
destParticipants = append(destParticipants, op)
}
utils.ParallelExec(destParticpants, dataForwardLoadBalanceThreshold, 1, func(op types.LocalParticipant) {
utils.ParallelExec(destParticipants, dataForwardLoadBalanceThreshold, 1, func(op types.LocalParticipant) {
err := op.SendDataPacket(dp, dpData)
if err != nil && !errors.Is(err, io.ErrClosedPipe) {
op.GetLogger().Infow("send data packet error", "error", err)
+4 -4
View File
@@ -1263,7 +1263,7 @@ func (t *PCTransport) initPCWithPreviousAnswer(previousAnswer webrtc.SessionDesc
}
tr.SetMid(mid)
// save mid -> senders for migration resue
// save mid -> senders for migration reuse
sender := tr.Sender()
senders[mid] = sender
@@ -1294,7 +1294,7 @@ func (t *PCTransport) SetPreviousSdp(offer, answer *webrtc.SessionDescription) {
}
return
} else if offer != nil {
// in migration case, can't reuse tranceiver before negotiated except track subscribed at previous node
// in migration case, can't reuse transceiver before negotiated except track subscribed at previous node
t.canReuseTransceiver = false
if err := t.parseTrackMid(*offer, senders); err != nil {
t.params.Logger.Errorw("parse previous offer failed", err, "offer", offer.SDP)
@@ -1318,12 +1318,12 @@ func (t *PCTransport) parseTrackMid(offer webrtc.SessionDescription, senders map
}
if split := strings.Split(msid, " "); len(split) == 2 {
trackid := split[1]
trackID := split[1]
mid := lksdp.GetMidValue(m)
if mid == "" {
return ErrMidNotFound
}
t.previousTrackDescription[trackid] = &trackDescription{
t.previousTrackDescription[trackID] = &trackDescription{
mid: mid,
sender: senders[mid],
}
+1 -1
View File
@@ -246,7 +246,7 @@ func TestFirstAnswerMissedDuringICERestart(t *testing.T) {
// exchange ICE
handleICEExchange(t, transportA, transportB)
// first anwser missed
// first answer missed
var firstAnswerReceived atomic.Bool
transportB.OnAnswer(func(sd webrtc.SessionDescription) error {
if firstAnswerReceived.Load() {
+2 -2
View File
@@ -363,7 +363,7 @@ func (t *TransportManager) GetUnmatchMediaForOffer(offer webrtc.SessionDescripti
answer := lastAnswer.(webrtc.SessionDescription)
parsedAnswer, err1 := answer.Unmarshal()
if err1 != nil {
// should not happend
// should not happen
t.params.Logger.Errorw("failed to parse last answer", err)
return
}
@@ -572,7 +572,7 @@ func (t *TransportManager) handleConnectionFailed(isShortLived bool) {
}
//
// Checking only `PreferenceSubcriber` field although any connection failure (PUBLISHER OR SUBSCRIBER) will
// Checking only `PreferenceSubscriber` field although any connection failure (PUBLISHER OR SUBSCRIBER) will
// flow through here.
//
// As both transports are switched to the same type on any failure, checking just subscriber should be fine.