rtc

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 8, 2022 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWindowSize  = 1000
	DefaultBpsScale    = 8000
	DefaultWindowItems = 100
)
View Source
const (
	InactivityCheckInterval        = 1500 // In ms.
	InactivityCheckIntervalWithDtx = 5000 // In ms.
)
View Source
const (
	MtuSize = 1500
)
View Source
const (
	RtpProbationSsrc = 1234
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferItem

type BufferItem struct {
	// contains filtered or unexported fields
}

func (*BufferItem) Reset

func (p *BufferItem) Reset()

type Consumer

type Consumer struct {
	Id         string
	ProducerId string
	Kind       mediasoupdata.MediaKind
	// contains filtered or unexported fields
}

func (*Consumer) Close

func (c *Consumer) Close()

func (*Consumer) FillJson

func (c *Consumer) FillJson() json.RawMessage

func (*Consumer) FillJsonStats

func (c *Consumer) FillJsonStats() json.RawMessage

func (*Consumer) GetConsumableRtpEncodings

func (c *Consumer) GetConsumableRtpEncodings() []mediasoupdata.RtpEncodingParameters

func (*Consumer) GetId

func (c *Consumer) GetId() string

func (*Consumer) GetKind

func (c *Consumer) GetKind() mediasoupdata.MediaKind

func (*Consumer) GetMediaSsrcs

func (c *Consumer) GetMediaSsrcs() []uint32

func (*Consumer) GetRtpParameters

func (c *Consumer) GetRtpParameters() mediasoupdata.RtpParameters

func (*Consumer) GetType

func (c *Consumer) GetType() mediasoupdata.ConsumerType

func (*Consumer) HandleRequest

func (c *Consumer) HandleRequest(request workerchannel.RequestData, response *workerchannel.ResponseData)

func (*Consumer) ReceiveKeyFrameRequest

func (c *Consumer) ReceiveKeyFrameRequest(feedbackFormat uint8, ssrc uint32)

func (*Consumer) ReceiveRtcpReceiverReport

func (c *Consumer) ReceiveRtcpReceiverReport(report *rtcp.ReceptionReport)

func (*Consumer) SendRtpPacket

func (c *Consumer) SendRtpPacket(packet *rtp.Packet)

type IConsumer

type IConsumer interface {
	GetId() string
	Close()
	FillJson() json.RawMessage
	HandleRequest(request workerchannel.RequestData, response *workerchannel.ResponseData)
	GetType() mediasoupdata.ConsumerType
	GetRtpParameters() mediasoupdata.RtpParameters
	SendRtpPacket(packet *rtp.Packet)
	ReceiveKeyFrameRequest(feedbackFormat uint8, ssrc uint32)
	GetMediaSsrcs() []uint32
	GetKind() mediasoupdata.MediaKind
	GetConsumableRtpEncodings() []mediasoupdata.RtpEncodingParameters
	ReceiveRtcpReceiverReport(report *rtcp.ReceptionReport)
}

type ITransport

type ITransport interface {
	Close()
	FillJson() json.RawMessage
	HandleRequest(request workerchannel.RequestData, response *workerchannel.ResponseData)
	ReceiveRtpPacket(packet *rtp.Packet)
	ReceiveRtcpPacket(header *rtcp.Header, packets []rtcp.Packet)
}

type KeyFrameRequestDelayer

type KeyFrameRequestDelayer struct {
}

func (*KeyFrameRequestDelayer) SetKeyFrameRequested

func (p *KeyFrameRequestDelayer) SetKeyFrameRequested(v bool)

type KeyFrameRequestManager

type KeyFrameRequestManager struct {
	// contains filtered or unexported fields
}

func (*KeyFrameRequestManager) ForceKeyFrameNeeded

func (p *KeyFrameRequestManager) ForceKeyFrameNeeded(ssrc uint32)

func (*KeyFrameRequestManager) KeyFrameNeeded

func (p *KeyFrameRequestManager) KeyFrameNeeded(ssrc uint32)

type KeyFrameRequestManagerParam

type KeyFrameRequestManagerParam struct {
	// contains filtered or unexported fields
}

type ParamRtpStream

type ParamRtpStream struct {
	EncodingIdx    int
	Ssrc           uint32
	PayloadType    uint8
	MimeType       mediasoupdata.RtpCodecMimeType
	ClockRate      int
	Rid            string
	Cname          string
	RtxSsrc        uint32
	RtxPayloadType uint8
	UseNack        bool
	UsePli         bool
	UseFir         bool
	UseInBandFec   bool
	UseDtx         bool
	SpatialLayers  uint8
	TemporalLayers uint8
}

type ParamRtpStreamRecv

type ParamRtpStreamRecv struct {
	*ParamRtpStream
	// contains filtered or unexported fields
}

type ParamRtpStreamSend

type ParamRtpStreamSend struct {
	*ParamRtpStream
	// contains filtered or unexported fields
}

type Producer

type Producer struct {
	Kind                  mediasoupdata.MediaKind
	RtpParameters         mediasoupdata.RtpParameters
	Type                  mediasoupdata.ProducerType
	RtpHeaderExtensionIds RtpHeaderExtensionIds
	Paused                bool
	// contains filtered or unexported fields
}

func (*Producer) Close

func (p *Producer) Close()

func (*Producer) CreateRtpStream

func (p *Producer) CreateRtpStream(packet *rtp.Packet, mediaCodec *mediasoupdata.RtpCodecParameters, encodingIdx int) *RtpStreamRecv

func (*Producer) FillJson

func (p *Producer) FillJson() json.RawMessage

func (*Producer) FillJsonStats

func (p *Producer) FillJsonStats() json.RawMessage

func (*Producer) GetRtpStream

func (p *Producer) GetRtpStream(packet *rtp.Packet) *RtpStreamRecv

func (*Producer) HandleRequest

func (p *Producer) HandleRequest(request workerchannel.RequestData, response *workerchannel.ResponseData)

func (*Producer) MangleRtpPacket

func (p *Producer) MangleRtpPacket(packet *rtp.Packet, rtpStream *RtpStreamRecv) bool

func (*Producer) NotifyNewRtpStream

func (p *Producer) NotifyNewRtpStream(rtpStream *RtpStreamRecv)

func (*Producer) OnKeyFrameNeeded

func (p *Producer) OnKeyFrameNeeded(ssrc uint32)

func (*Producer) OnRtpStreamSendRtcpPacket

func (p *Producer) OnRtpStreamSendRtcpPacket(packet rtcp.Packet)

func (*Producer) PostProcessRtpPacket

func (p *Producer) PostProcessRtpPacket(packet *rtp.Packet)

func (*Producer) PreProcessRtpPacket

func (p *Producer) PreProcessRtpPacket(packet *rtp.Packet)

func (*Producer) ReceiveRtcpSenderReport

func (p *Producer) ReceiveRtcpSenderReport(report *rtcp.ReceptionReport)

func (*Producer) ReceiveRtpPacket

func (p *Producer) ReceiveRtpPacket(packet *rtp.Packet) (result ReceiveRtpPacketResult)

func (*Producer) RequestKeyFrame

func (p *Producer) RequestKeyFrame(mappedSsrc uint32)

type RateCalculator

type RateCalculator struct {
	// contains filtered or unexported fields
}

func (RateCalculator) GetBytes

func (p RateCalculator) GetBytes() int

func (*RateCalculator) GetRate

func (p *RateCalculator) GetRate(nowMs int64) uint32

func (*RateCalculator) RemoveOldData

func (p *RateCalculator) RemoveOldData(nowMs int64)

func (*RateCalculator) Reset

func (p *RateCalculator) Reset()

func (*RateCalculator) Update

func (p *RateCalculator) Update(size int, nowMs int64)

type ReceiveRtpPacketResult

type ReceiveRtpPacketResult int
const (
	ReceiveRtpPacketResultDISCARDED ReceiveRtpPacketResult = iota
	ReceiveRtpPacketResultMEDIA
	ReceiveRtpPacketResultRETRANSMISSION
)

type Router

type Router struct {
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter(id string) *Router

func (*Router) Close

func (r *Router) Close()

func (*Router) FillJson

func (r *Router) FillJson() json.RawMessage

func (*Router) HandleRequest

func (r *Router) HandleRequest(request workerchannel.RequestData, response *workerchannel.ResponseData)

func (*Router) OnTransportConsumerClosed

func (r *Router) OnTransportConsumerClosed(producerId, consumerId string)

func (*Router) OnTransportConsumerKeyFrameRequested

func (r *Router) OnTransportConsumerKeyFrameRequested(consumerId string, mappedSsrc uint32)

func (*Router) OnTransportNewConsumer

func (r *Router) OnTransportNewConsumer(consumer IConsumer, producerId string) error

func (*Router) OnTransportNewProducer

func (r *Router) OnTransportNewProducer(producer *Producer) error

func (*Router) OnTransportProducerClosed

func (r *Router) OnTransportProducerClosed(producerId string)

func (*Router) OnTransportProducerRtpPacketReceived

func (r *Router) OnTransportProducerRtpPacketReceived(producer *Producer, packet *rtp.Packet)

type RtpDataCounter

type RtpDataCounter struct {
	// contains filtered or unexported fields
}

func (RtpDataCounter) GetBitrate

func (p RtpDataCounter) GetBitrate(nowMs int64) uint32

func (RtpDataCounter) GetBytes

func (p RtpDataCounter) GetBytes() int

func (RtpDataCounter) GetPacketCount

func (p RtpDataCounter) GetPacketCount() int

func (*RtpDataCounter) Update

func (p *RtpDataCounter) Update(packet *rtp.Packet)

type RtpHeaderExtensionIds

type RtpHeaderExtensionIds struct {
	Mid               uint8
	Rid               uint8
	RRid              uint8
	AbsSendTime       uint8
	TransportWideCc01 uint8
	FrameMarking07    uint8
	FrameMarking      uint8
	SsrcAudioLevel    uint8
	VideoOrientation  uint8
	TOffset           uint8
	AbsCaptureTime    uint8
}

type RtpListener

type RtpListener struct {
	// contains filtered or unexported fields
}

func (*RtpListener) AddProducer

func (r *RtpListener) AddProducer(producer *Producer)

func (*RtpListener) GetProducer

func (r *RtpListener) GetProducer(packet *rtp.Packet) *Producer

func (*RtpListener) GetProducerBySSRC

func (r *RtpListener) GetProducerBySSRC(ssrc uint32) *Producer

type RtpStream

type RtpStream struct {
	// contains filtered or unexported fields
}

func (*RtpStream) GetId

func (r *RtpStream) GetId() string

func (*RtpStream) GetRtxSsrc

func (r *RtpStream) GetRtxSsrc() uint32

func (*RtpStream) GetSsrc

func (r *RtpStream) GetSsrc() uint32

func (*RtpStream) HasRtx

func (r *RtpStream) HasRtx() bool

func (*RtpStream) ReceivePacket

func (r *RtpStream) ReceivePacket(packet *rtp.Packet) bool

func (*RtpStream) SetRtx

func (r *RtpStream) SetRtx(payloadType uint8, ssrc uint32)

type RtpStreamRecv

type RtpStreamRecv struct {
	*RtpStream
	// contains filtered or unexported fields
}

func (*RtpStreamRecv) FillJsonStats

func (r *RtpStreamRecv) FillJsonStats() mediasoupdata.ProducerStat

func (*RtpStreamRecv) GetScore

func (r *RtpStreamRecv) GetScore() uint8

func (*RtpStreamRecv) Pause

func (r *RtpStreamRecv) Pause()

func (*RtpStreamRecv) ReceivePacket

func (r *RtpStreamRecv) ReceivePacket(packet *rtp.Packet) bool

func (*RtpStreamRecv) ReceiveRtcpSenderReport

func (r *RtpStreamRecv) ReceiveRtcpSenderReport(report *rtcp.ReceptionReport)

func (*RtpStreamRecv) ReceiveRtxPacket

func (r *RtpStreamRecv) ReceiveRtxPacket(packet *rtp.Packet) bool

func (*RtpStreamRecv) RequestKeyFrame

func (r *RtpStreamRecv) RequestKeyFrame()

type RtpStreamSend

type RtpStreamSend struct {
	*RtpStream
	// contains filtered or unexported fields
}

func (*RtpStreamSend) ReceiveRtcpReceiverReport

func (p *RtpStreamSend) ReceiveRtcpReceiverReport(report *rtcp.ReceptionReport)

func (*RtpStreamSend) UpdateScore

func (p *RtpStreamSend) UpdateScore(report *rtcp.ReceptionReport)

type RtxStream

type RtxStream struct {
}

type SimpleConsumer

type SimpleConsumer struct {
	IConsumer
	// contains filtered or unexported fields
}

func (*SimpleConsumer) Close

func (c *SimpleConsumer) Close()

func (*SimpleConsumer) CreateRtpStream

func (c *SimpleConsumer) CreateRtpStream()

func (*SimpleConsumer) ReceiveKeyFrameRequest

func (c *SimpleConsumer) ReceiveKeyFrameRequest(feedbackFormat uint8, ssrc uint32)

func (*SimpleConsumer) ReceiveRtcpReceiverReport

func (c *SimpleConsumer) ReceiveRtcpReceiverReport(report *rtcp.ReceptionReport)

func (*SimpleConsumer) RequestKeyFrame

func (c *SimpleConsumer) RequestKeyFrame()

func (*SimpleConsumer) SendRtpPacket

func (c *SimpleConsumer) SendRtpPacket(packet *rtp.Packet)

type StorageItem

type StorageItem struct {
	// contains filtered or unexported fields
}

type TransmissionCounter

type TransmissionCounter struct {
	// contains filtered or unexported fields
}

func (*TransmissionCounter) Update

func (p *TransmissionCounter) Update(packet *rtp.Packet)

type Transport

type Transport struct {
	// contains filtered or unexported fields
}

func (*Transport) Close

func (t *Transport) Close()

func (*Transport) Consume

func (t *Transport) Consume(producerId, consumerId string, options mediasoupdata.ConsumerOptions) (*mediasoupdata.ConsumerData, error)

func (*Transport) FillJson

func (t *Transport) FillJson() json.RawMessage

func (*Transport) FillJsonStats

func (t *Transport) FillJsonStats() json.RawMessage

func (*Transport) HandleRequest

func (t *Transport) HandleRequest(request workerchannel.RequestData, response *workerchannel.ResponseData)

func (*Transport) HandleRtcpPacket

func (t *Transport) HandleRtcpPacket(header *rtcp.Header, packet rtcp.Packet)

func (*Transport) OnConsumerKeyFrameRequested

func (t *Transport) OnConsumerKeyFrameRequested(consumer IConsumer, mappedSsrc uint32)

func (*Transport) OnConsumerSendRtpPacket

func (t *Transport) OnConsumerSendRtpPacket(consumer IConsumer, packet *rtp.Packet)

func (*Transport) OnProducerRtpPacketReceived

func (t *Transport) OnProducerRtpPacketReceived(producer *Producer, packet *rtp.Packet)

func (*Transport) OnProducerSendRtcpPacket

func (t *Transport) OnProducerSendRtcpPacket(packet rtcp.Packet)

func (*Transport) Produce

func (*Transport) ReceiveKeyFrameRequest

func (t *Transport) ReceiveKeyFrameRequest(feedbackFormat uint8, ssrc uint32)

func (*Transport) ReceiveRtcpPacket

func (t *Transport) ReceiveRtcpPacket(header *rtcp.Header, packets []rtcp.Packet)

func (*Transport) ReceiveRtpPacket

func (t *Transport) ReceiveRtpPacket(packet *rtp.Packet)

type WebrtcTransport

type WebrtcTransport struct {
	ITransport
	// contains filtered or unexported fields
}

func (*WebrtcTransport) Close

func (t *WebrtcTransport) Close()

func (*WebrtcTransport) FillJson

func (t *WebrtcTransport) FillJson() json.RawMessage

func (*WebrtcTransport) HandleRequest

func (t *WebrtcTransport) HandleRequest(request workerchannel.RequestData, response *workerchannel.ResponseData)

func (*WebrtcTransport) OnPacketReceived

func (t *WebrtcTransport) OnPacketReceived(data []byte)

func (*WebrtcTransport) OnRtcpDataReceived

func (t *WebrtcTransport) OnRtcpDataReceived(rawData []byte)

func (*WebrtcTransport) OnRtpDataReceived

func (t *WebrtcTransport) OnRtpDataReceived(rawData []byte)

func (*WebrtcTransport) SendRtcpPacket

func (t *WebrtcTransport) SendRtcpPacket(packet rtcp.Packet)

func (*WebrtcTransport) SendRtpPacket

func (t *WebrtcTransport) SendRtpPacket(packet *rtp.Packet)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL