removed channeltype, never used
This commit is contained in:
@@ -8,7 +8,6 @@ import (
|
|||||||
|
|
||||||
"github.com/pion/rtcp"
|
"github.com/pion/rtcp"
|
||||||
"github.com/pion/rtp"
|
"github.com/pion/rtp"
|
||||||
"github.com/pion/webrtc/v3"
|
|
||||||
|
|
||||||
"github.com/livekit/livekit-server/pkg/logger"
|
"github.com/livekit/livekit-server/pkg/logger"
|
||||||
"github.com/livekit/livekit-server/pkg/sfu"
|
"github.com/livekit/livekit-server/pkg/sfu"
|
||||||
@@ -21,7 +20,6 @@ type PacketBuffer interface {
|
|||||||
// a forwarder publishes data to a target remoteTrack or datachannel
|
// a forwarder publishes data to a target remoteTrack or datachannel
|
||||||
// manages the RTCP loop with the target participant
|
// manages the RTCP loop with the target participant
|
||||||
type Forwarder interface {
|
type Forwarder interface {
|
||||||
ChannelType() ChannelType
|
|
||||||
WriteRTP(*rtp.Packet) error
|
WriteRTP(*rtp.Packet) error
|
||||||
Start()
|
Start()
|
||||||
Close()
|
Close()
|
||||||
@@ -35,21 +33,12 @@ type RTCPWriter interface {
|
|||||||
WriteRTCP(pkts []rtcp.Packet) error
|
WriteRTCP(pkts []rtcp.Packet) error
|
||||||
}
|
}
|
||||||
|
|
||||||
type ChannelType int
|
|
||||||
|
|
||||||
const (
|
|
||||||
ChannelAudio ChannelType = iota + 1
|
|
||||||
ChannelVideo
|
|
||||||
ChannelData
|
|
||||||
)
|
|
||||||
|
|
||||||
type SimpleForwarder struct {
|
type SimpleForwarder struct {
|
||||||
ctx context.Context
|
ctx context.Context
|
||||||
cancel context.CancelFunc
|
cancel context.CancelFunc
|
||||||
sourceRtcpCh chan []rtcp.Packet // channel to write RTCP packets to source
|
sourceRtcpCh chan []rtcp.Packet // channel to write RTCP packets to source
|
||||||
track *sfu.DownTrack // sender track
|
track *sfu.DownTrack // sender track
|
||||||
packetBuffer PacketBuffer
|
packetBuffer PacketBuffer
|
||||||
channelType ChannelType
|
|
||||||
|
|
||||||
lastPli time.Time
|
lastPli time.Time
|
||||||
createdAt time.Time
|
createdAt time.Time
|
||||||
@@ -71,22 +60,12 @@ func NewSimpleForwarder(ctx context.Context, rtcpCh chan []rtcp.Packet, track *s
|
|||||||
createdAt: time.Now(),
|
createdAt: time.Now(),
|
||||||
}
|
}
|
||||||
|
|
||||||
if f.track.Kind() == webrtc.RTPCodecTypeAudio {
|
|
||||||
f.channelType = ChannelAudio
|
|
||||||
} else if f.track.Kind() == webrtc.RTPCodecTypeVideo {
|
|
||||||
f.channelType = ChannelVideo
|
|
||||||
}
|
|
||||||
|
|
||||||
// when underlying track is closed, close the forwarder too
|
// when underlying track is closed, close the forwarder too
|
||||||
track.OnCloseHandler(f.Close)
|
track.OnCloseHandler(f.Close)
|
||||||
|
|
||||||
return f
|
return f
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *SimpleForwarder) ChannelType() ChannelType {
|
|
||||||
return f.channelType
|
|
||||||
}
|
|
||||||
|
|
||||||
func (f *SimpleForwarder) Start() {
|
func (f *SimpleForwarder) Start() {
|
||||||
f.once.Do(func() {
|
f.once.Do(func() {
|
||||||
defer func() {
|
defer func() {
|
||||||
|
|||||||
Reference in New Issue
Block a user