Documentation
¶
Overview ¶
Package scream provides interceptors to implement SCReAM congestion control via cgo
Index ¶
- type BandwidthEstimator
- type NewPeerConnectionCallback
- type RTPQueue
- type ReceiverInterceptor
- func (r *ReceiverInterceptor) BindRTCPWriter(writer interceptor.RTCPWriter) interceptor.RTCPWriter
- func (r *ReceiverInterceptor) BindRemoteStream(info *interceptor.StreamInfo, reader interceptor.RTPReader) interceptor.RTPReader
- func (r *ReceiverInterceptor) Close() error
- func (r *ReceiverInterceptor) UnbindRemoteStream(info *interceptor.StreamInfo)
- type ReceiverInterceptorFactory
- type ReceiverOption
- type SenderInterceptor
- func (s *SenderInterceptor) BindLocalStream(info *interceptor.StreamInfo, writer interceptor.RTPWriter) interceptor.RTPWriter
- func (s *SenderInterceptor) BindRTCPReader(reader interceptor.RTCPReader) interceptor.RTCPReader
- func (s *SenderInterceptor) Close() error
- func (s *SenderInterceptor) GetStats() map[string]interface{}
- func (s *SenderInterceptor) GetTargetBitrate(ssrc uint32) (int, error)
- func (s *SenderInterceptor) UnbindLocalStream(info *interceptor.StreamInfo)
- type SenderInterceptorFactory
- type SenderOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BandwidthEstimator ¶
type NewPeerConnectionCallback ¶
type NewPeerConnectionCallback func(id string, estimator BandwidthEstimator)
type RTPQueue ¶
type RTPQueue interface {
scream.RTPQueue
// Enqueue adds a new packet to the end of the queue.
Enqueue(packet *packet, ts float64)
// Dequeue removes and returns the first packet in the queue.
Dequeue() *packet
}
RTPQueue implements the packet queue which will be used by SCReAM to buffer packets
type ReceiverInterceptor ¶
type ReceiverInterceptor struct {
interceptor.NoOp
// contains filtered or unexported fields
}
ReceiverInterceptor generates Feedback for SCReAM congestion control
func (*ReceiverInterceptor) BindRTCPWriter ¶
func (r *ReceiverInterceptor) BindRTCPWriter(writer interceptor.RTCPWriter) interceptor.RTCPWriter
BindRTCPWriter lets you modify any outgoing RTCP packets. It is called once per PeerConnection. The returned method will be called once per packet batch.
func (*ReceiverInterceptor) BindRemoteStream ¶
func (r *ReceiverInterceptor) BindRemoteStream(info *interceptor.StreamInfo, reader interceptor.RTPReader) interceptor.RTPReader
BindRemoteStream lets you modify any incoming RTP packets. It is called once for per RemoteStream. The returned method will be called once per rtp packet.
func (*ReceiverInterceptor) Close ¶
func (r *ReceiverInterceptor) Close() error
Close closes the interceptor.
func (*ReceiverInterceptor) UnbindRemoteStream ¶
func (r *ReceiverInterceptor) UnbindRemoteStream(info *interceptor.StreamInfo)
UnbindRemoteStream is called when the Stream is removed. It can be used to clean up any data related to that track.
type ReceiverInterceptorFactory ¶
type ReceiverInterceptorFactory struct {
// contains filtered or unexported fields
}
ReceiverInterceptorFactory is a interceptor.Factory for a scream receiver interceptor
func NewReceiverInterceptor ¶
func NewReceiverInterceptor(opts ...ReceiverOption) (*ReceiverInterceptorFactory, error)
NewReceiverInterceptor returns a new ReceiverInterceptor
func (*ReceiverInterceptorFactory) NewInterceptor ¶
func (f *ReceiverInterceptorFactory) NewInterceptor(id string) (interceptor.Interceptor, error)
NewInterceptor constructs a new SCReAM receiver interceptor
type ReceiverOption ¶
type ReceiverOption func(r *ReceiverInterceptor) error
ReceiverOption can be used to configure SenderInterceptor.
func ReceiverInterval ¶
func ReceiverInterval(interval time.Duration) ReceiverOption
ReceiverInterval sets the feedback send interval for the interceptor
type SenderInterceptor ¶
type SenderInterceptor struct {
interceptor.NoOp
// contains filtered or unexported fields
}
SenderInterceptor performs SCReAM congestion control
func (*SenderInterceptor) BindLocalStream ¶
func (s *SenderInterceptor) BindLocalStream(info *interceptor.StreamInfo, writer interceptor.RTPWriter) interceptor.RTPWriter
BindLocalStream lets you modify any outgoing RTP packets. It is called once for per LocalStream. The returned method will be called once per rtp packet.
func (*SenderInterceptor) BindRTCPReader ¶
func (s *SenderInterceptor) BindRTCPReader(reader interceptor.RTCPReader) interceptor.RTCPReader
BindRTCPReader lets you modify any incoming RTCP packets. It is called once per sender/receiver, however this might change in the future. The returned method will be called once per packet batch.
func (*SenderInterceptor) Close ¶
func (s *SenderInterceptor) Close() error
Close closes the interceptor
func (*SenderInterceptor) GetStats ¶
func (s *SenderInterceptor) GetStats() map[string]interface{}
func (*SenderInterceptor) GetTargetBitrate ¶
func (s *SenderInterceptor) GetTargetBitrate(ssrc uint32) (int, error)
GetTargetBitrate returns the target bitrate calculated by SCReAM in bps.
func (*SenderInterceptor) UnbindLocalStream ¶
func (s *SenderInterceptor) UnbindLocalStream(info *interceptor.StreamInfo)
UnbindLocalStream is called when the Stream is removed. It can be used to clean up any data related to that track.
type SenderInterceptorFactory ¶
type SenderInterceptorFactory struct {
// contains filtered or unexported fields
}
func NewSenderInterceptor ¶
func NewSenderInterceptor(opts ...SenderOption) (*SenderInterceptorFactory, error)
func (*SenderInterceptorFactory) NewInterceptor ¶
func (f *SenderInterceptorFactory) NewInterceptor(id string) (interceptor.Interceptor, error)
func (*SenderInterceptorFactory) OnNewPeerConnection ¶
func (f *SenderInterceptorFactory) OnNewPeerConnection(cb NewPeerConnectionCallback)
type SenderOption ¶
type SenderOption func(r *SenderInterceptor) error
SenderOption can be used to configure SenderInterceptor.
func InitialBitrate ¶
func InitialBitrate(rate float64) SenderOption
func MaxBitrate ¶
func MaxBitrate(rate float64) SenderOption
func MinBitrate ¶
func MinBitrate(rate float64) SenderOption
func SenderQueue ¶
func SenderQueue(queueFactory func() RTPQueue) SenderOption
SenderQueue sets the factory function to create new RTP Queues for new streams.
func Tx ¶
func Tx(tx *scream.Tx) SenderOption