upgrade to pion/webrtc v4 (#3213)

This commit is contained in:
cnderrauber
2024-11-28 16:05:38 +08:00
committed by GitHub
parent baf47db834
commit 54f9f7de51
52 changed files with 144 additions and 119 deletions
@@ -8,7 +8,7 @@ import (
"github.com/livekit/livekit-server/pkg/rtc/types"
"github.com/livekit/livekit-server/pkg/sfu/streamallocator"
"github.com/livekit/protocol/livekit"
webrtc "github.com/pion/webrtc/v3"
webrtc "github.com/pion/webrtc/v4"
)
type FakeHandler struct {
@@ -23,6 +23,10 @@ type FakeHandler struct {
onAnswerReturnsOnCall map[int]struct {
result1 error
}
OnClosedStub func()
onClosedMutex sync.RWMutex
onClosedArgsForCall []struct {
}
OnDataPacketStub func(livekit.DataPacket_Kind, []byte)
onDataPacketMutex sync.RWMutex
onDataPacketArgsForCall []struct {
@@ -162,6 +166,30 @@ func (fake *FakeHandler) OnAnswerReturnsOnCall(i int, result1 error) {
}{result1}
}
func (fake *FakeHandler) OnClosed() {
fake.onClosedMutex.Lock()
fake.onClosedArgsForCall = append(fake.onClosedArgsForCall, struct {
}{})
stub := fake.OnClosedStub
fake.recordInvocation("OnClosed", []interface{}{})
fake.onClosedMutex.Unlock()
if stub != nil {
fake.OnClosedStub()
}
}
func (fake *FakeHandler) OnClosedCallCount() int {
fake.onClosedMutex.RLock()
defer fake.onClosedMutex.RUnlock()
return len(fake.onClosedArgsForCall)
}
func (fake *FakeHandler) OnClosedCalls(stub func()) {
fake.onClosedMutex.Lock()
defer fake.onClosedMutex.Unlock()
fake.OnClosedStub = stub
}
func (fake *FakeHandler) OnDataPacket(arg1 livekit.DataPacket_Kind, arg2 []byte) {
var arg2Copy []byte
if arg2 != nil {
@@ -591,6 +619,8 @@ func (fake *FakeHandler) Invocations() map[string][][]interface{} {
defer fake.invocationsMutex.RUnlock()
fake.onAnswerMutex.RLock()
defer fake.onAnswerMutex.RUnlock()
fake.onClosedMutex.RLock()
defer fake.onClosedMutex.RUnlock()
fake.onDataPacketMutex.RLock()
defer fake.onDataPacketMutex.RUnlock()
fake.onDataSendErrorMutex.RLock()