Pure code movement (#1552)
This commit is contained in:
@@ -240,7 +240,7 @@ func (t *MediaTrackReceiver) SetLayerSsrc(mime string, rid string, ssrc uint32)
|
||||
defer t.lock.Unlock()
|
||||
|
||||
layer := buffer.RidToSpatialLayer(rid, t.params.TrackInfo)
|
||||
if layer == sfu.InvalidLayerSpatial {
|
||||
if layer == buffer.InvalidLayerSpatial {
|
||||
// non-simulcast case will not have `rid`
|
||||
layer = 0
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import (
|
||||
"github.com/livekit/livekit-server/pkg/sfu"
|
||||
"github.com/livekit/livekit-server/pkg/sfu/buffer"
|
||||
"github.com/livekit/livekit-server/pkg/sfu/connectionquality"
|
||||
"github.com/livekit/livekit-server/pkg/sfu/streamallocator"
|
||||
"github.com/livekit/livekit-server/pkg/telemetry"
|
||||
"github.com/livekit/mediatransportutil/pkg/twcc"
|
||||
"github.com/livekit/protocol/auth"
|
||||
@@ -1338,7 +1339,7 @@ func (p *ParticipantImpl) subscriberRTCPWorker() {
|
||||
}
|
||||
}
|
||||
|
||||
func (p *ParticipantImpl) onStreamStateChange(update *sfu.StreamStateUpdate) error {
|
||||
func (p *ParticipantImpl) onStreamStateChange(update *streamallocator.StreamStateUpdate) error {
|
||||
if len(update.StreamStates) == 0 {
|
||||
return nil
|
||||
}
|
||||
@@ -1346,7 +1347,7 @@ func (p *ParticipantImpl) onStreamStateChange(update *sfu.StreamStateUpdate) err
|
||||
streamStateUpdate := &livekit.StreamStateUpdate{}
|
||||
for _, streamStateInfo := range update.StreamStates {
|
||||
state := livekit.StreamState_ACTIVE
|
||||
if streamStateInfo.State == sfu.StreamStatePaused {
|
||||
if streamStateInfo.State == streamallocator.StreamStatePaused {
|
||||
state = livekit.StreamState_PAUSED
|
||||
}
|
||||
streamStateUpdate.StreamStates = append(streamStateUpdate.StreamStates, &livekit.StreamStateInfo{
|
||||
|
||||
@@ -26,7 +26,7 @@ import (
|
||||
"github.com/livekit/livekit-server/pkg/config"
|
||||
serverlogger "github.com/livekit/livekit-server/pkg/logger"
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
"github.com/livekit/livekit-server/pkg/sfu"
|
||||
"github.com/livekit/livekit-server/pkg/sfu/streamallocator"
|
||||
"github.com/livekit/livekit-server/pkg/telemetry"
|
||||
"github.com/livekit/livekit-server/pkg/telemetry/prometheus"
|
||||
)
|
||||
@@ -182,7 +182,7 @@ type PCTransport struct {
|
||||
onNegotiationFailed func()
|
||||
|
||||
// stream allocator for subscriber PC
|
||||
streamAllocator *sfu.StreamAllocator
|
||||
streamAllocator *streamallocator.StreamAllocator
|
||||
|
||||
previousAnswer *webrtc.SessionDescription
|
||||
// track id -> description map in previous offer sdp
|
||||
@@ -366,7 +366,7 @@ func NewPCTransport(params TransportParams) (*PCTransport, error) {
|
||||
canReuseTransceiver: true,
|
||||
}
|
||||
if params.IsSendSide {
|
||||
t.streamAllocator = sfu.NewStreamAllocator(sfu.StreamAllocatorParams{
|
||||
t.streamAllocator = streamallocator.NewStreamAllocator(streamallocator.StreamAllocatorParams{
|
||||
Config: params.CongestionControlConfig,
|
||||
Logger: params.Logger,
|
||||
})
|
||||
@@ -1085,7 +1085,7 @@ func (t *PCTransport) ResetShortConnOnICERestart() {
|
||||
t.resetShortConnOnICERestart.Store(true)
|
||||
}
|
||||
|
||||
func (t *PCTransport) OnStreamStateChange(f func(update *sfu.StreamStateUpdate) error) {
|
||||
func (t *PCTransport) OnStreamStateChange(f func(update *streamallocator.StreamStateUpdate) error) {
|
||||
if t.streamAllocator == nil {
|
||||
return
|
||||
}
|
||||
@@ -1098,7 +1098,7 @@ func (t *PCTransport) AddTrackToStreamAllocator(subTrack types.SubscribedTrack)
|
||||
return
|
||||
}
|
||||
|
||||
t.streamAllocator.AddTrack(subTrack.DownTrack(), sfu.AddTrackParams{
|
||||
t.streamAllocator.AddTrack(subTrack.DownTrack(), streamallocator.AddTrackParams{
|
||||
Source: subTrack.MediaTrack().Source(),
|
||||
IsSimulcast: subTrack.MediaTrack().IsSimulcast(),
|
||||
PublisherID: subTrack.MediaTrack().PublisherID(),
|
||||
|
||||
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/livekit/livekit-server/pkg/config"
|
||||
"github.com/livekit/livekit-server/pkg/rtc/types"
|
||||
"github.com/livekit/livekit-server/pkg/sfu"
|
||||
"github.com/livekit/livekit-server/pkg/sfu/streamallocator"
|
||||
"github.com/livekit/livekit-server/pkg/telemetry"
|
||||
"github.com/livekit/protocol/livekit"
|
||||
"github.com/livekit/protocol/logger"
|
||||
@@ -243,7 +244,7 @@ func (t *TransportManager) OnSubscriberInitialConnected(f func()) {
|
||||
t.onSubscriberInitialConnected = f
|
||||
}
|
||||
|
||||
func (t *TransportManager) OnSubscriberStreamStateChange(f func(update *sfu.StreamStateUpdate) error) {
|
||||
func (t *TransportManager) OnSubscriberStreamStateChange(f func(update *streamallocator.StreamStateUpdate) error) {
|
||||
t.subscriber.OnStreamStateChange(f)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user