Documentation ¶
Index ¶
- Constants
- func CheckPlugins(config Config) error
- func IsVP8KeyFrame(pkt *rtp.Packet) bool
- type Buffer
- func (b *Buffer) FindPacket(sn uint16) *rtp.Packet
- func (b *Buffer) GetLostRateBandwidth(cycle uint64) (float64, uint64)
- func (b *Buffer) GetNackPair(buffer [65536]*rtp.Packet, begin, end uint16) (rtcp.NackPair, int)
- func (b *Buffer) GetPacket(sn uint16) *rtp.Packet
- func (b *Buffer) GetPayloadType() uint8
- func (b *Buffer) GetRTCPChan() chan rtcp.Packet
- func (b *Buffer) GetSSRC() uint32
- func (b *Buffer) GetStat() string
- func (b *Buffer) Push(p *rtp.Packet)
- func (b *Buffer) SetSSRCPT(ssrc uint32, pt uint8)
- func (b *Buffer) Stop()
- type BufferOptions
- type Config
- type JitterBuffer
- func (j *JitterBuffer) AddBuffer(ssrc uint32) *Buffer
- func (j *JitterBuffer) AttachPub(t transport.Transport)
- func (j *JitterBuffer) GetBuffer(ssrc uint32) *Buffer
- func (j *JitterBuffer) GetBuffers() map[uint32]*Buffer
- func (j *JitterBuffer) GetPacket(ssrc uint32, sn uint16) *rtp.Packet
- func (j *JitterBuffer) ID() string
- func (j *JitterBuffer) Init(config JitterBufferConfig)
- func (j *JitterBuffer) ReadRTP() <-chan *rtp.Packet
- func (j *JitterBuffer) Stat() string
- func (j *JitterBuffer) Stop()
- func (j *JitterBuffer) WriteRTP(pkt *rtp.Packet) error
- type JitterBufferConfig
- type Plugin
- type PluginChain
- func (p *PluginChain) AddPlugin(id string, i Plugin)
- func (p *PluginChain) AttachPub(pub transport.Transport)
- func (p *PluginChain) Close()
- func (p *PluginChain) DelPlugin(id string)
- func (p *PluginChain) DelPluginChain()
- func (p *PluginChain) GetPlugin(id string) Plugin
- func (p *PluginChain) GetPluginsTotal() int
- func (p *PluginChain) Init(config Config) error
- func (p *PluginChain) On() bool
- func (p *PluginChain) ReadRTP() *rtp.Packet
- type RTPForwarder
- type RTPForwarderConfig
Constants ¶
const ( TypeJitterBuffer = "JitterBuffer" TypeRTPForwarder = "RTPForwarder" )
Variables ¶
This section is empty.
Functions ¶
func CheckPlugins ¶ added in v0.2.0
Types ¶
type Buffer ¶
type Buffer struct {
// contains filtered or unexported fields
}
Buffer contains all packets
func (*Buffer) FindPacket ¶ added in v0.2.0
FindPacket find packet from buffer
func (*Buffer) GetLostRateBandwidth ¶ added in v0.2.0
GetLostRateBandwidth calc lostRate and bandwidth by cycle
func (*Buffer) GetNackPair ¶ added in v0.2.0
GetNackPair calc nackpair
func (*Buffer) GetPayloadType ¶
GetPayloadType get payloadtype
func (*Buffer) GetRTCPChan ¶
GetRTCPChan return rtcp channel
type BufferOptions ¶ added in v0.4.2
type Config ¶ added in v0.2.0
type Config struct { On bool JitterBuffer JitterBufferConfig RTPForwarder RTPForwarderConfig }
type JitterBuffer ¶
JitterBuffer core buffer module
func NewJitterBuffer ¶
func NewJitterBuffer(config JitterBufferConfig) *JitterBuffer
NewJitterBuffer return new JitterBuffer
func (*JitterBuffer) AddBuffer ¶
func (j *JitterBuffer) AddBuffer(ssrc uint32) *Buffer
AddBuffer add a buffer by ssrc
func (*JitterBuffer) AttachPub ¶ added in v0.2.0
func (j *JitterBuffer) AttachPub(t transport.Transport)
AttachPub Attach pub stream
func (*JitterBuffer) GetBuffer ¶
func (j *JitterBuffer) GetBuffer(ssrc uint32) *Buffer
GetBuffer get a buffer by ssrc
func (*JitterBuffer) GetBuffers ¶
func (j *JitterBuffer) GetBuffers() map[uint32]*Buffer
GetBuffers get all buffers
func (*JitterBuffer) GetPacket ¶
func (j *JitterBuffer) GetPacket(ssrc uint32, sn uint16) *rtp.Packet
GetPacket get packet from buffer
func (*JitterBuffer) Init ¶
func (j *JitterBuffer) Init(config JitterBufferConfig)
Init jitterbuffer config
func (*JitterBuffer) ReadRTP ¶ added in v0.2.0
func (j *JitterBuffer) ReadRTP() <-chan *rtp.Packet
ReadRTP return the last packet
type JitterBufferConfig ¶ added in v0.2.0
type JitterBufferConfig struct { ID string On bool TCCOn bool REMBCycle int PLICycle int MaxBandwidth int MaxBufferTime int }
JitterBufferConfig .
type Plugin ¶ added in v0.2.0
type Plugin interface { ID() string WriteRTP(*rtp.Packet) error ReadRTP() <-chan *rtp.Packet Stop() }
Plugin some interfaces
type PluginChain ¶ added in v0.2.0
type PluginChain struct {
// contains filtered or unexported fields
}
func NewPluginChain ¶ added in v0.2.0
func NewPluginChain(mid string) *PluginChain
func (*PluginChain) AddPlugin ¶ added in v0.2.0
func (p *PluginChain) AddPlugin(id string, i Plugin)
AddPlugin add a plugin
func (*PluginChain) AttachPub ¶ added in v0.2.0
func (p *PluginChain) AttachPub(pub transport.Transport)
func (*PluginChain) Close ¶ added in v0.2.0
func (p *PluginChain) Close()
func (*PluginChain) DelPlugin ¶ added in v0.2.0
func (p *PluginChain) DelPlugin(id string)
DelPlugin del plugin
func (*PluginChain) DelPluginChain ¶ added in v0.2.0
func (p *PluginChain) DelPluginChain()
DelPluginChain del all plugins
func (*PluginChain) GetPlugin ¶ added in v0.2.0
func (p *PluginChain) GetPlugin(id string) Plugin
GetPlugin get plugin by id
func (*PluginChain) GetPluginsTotal ¶ added in v0.2.0
func (p *PluginChain) GetPluginsTotal() int
GetPluginsTotal get plugin total count
func (*PluginChain) Init ¶ added in v0.2.0
func (p *PluginChain) Init(config Config) error
func (*PluginChain) On ¶ added in v0.2.0
func (p *PluginChain) On() bool
func (*PluginChain) ReadRTP ¶ added in v0.2.0
func (p *PluginChain) ReadRTP() *rtp.Packet
type RTPForwarder ¶ added in v0.3.0
type RTPForwarder struct { Transport *transport.RTPTransport // contains filtered or unexported fields }
RTPForwarder core
func NewRTPForwarder ¶ added in v0.3.0
func NewRTPForwarder(config RTPForwarderConfig) *RTPForwarder
NewRTPForwarder Create new RTP Forwarder
func (*RTPForwarder) ID ¶ added in v0.3.0
func (r *RTPForwarder) ID() string
ID Return RTPForwarder ID
func (*RTPForwarder) ReadRTP ¶ added in v0.3.0
func (r *RTPForwarder) ReadRTP() <-chan *rtp.Packet
ReadRTP Forward rtp packet which from pub