Documentation ¶
Index ¶
- type OnPacketFunc
- type OnStreamCloseFunc
- type PullInfo
- type Puller
- type Stream
- type StreamData
- type StreamId
- type StreamInfo
- type StreamMux
- func (s *StreamMux) AddPull(streamId StreamId, info PullInfo) (*Puller, error)
- func (s *StreamMux) AddStream(info StreamInfo) (*Stream, error)
- func (s *StreamMux) Close()
- func (s *StreamMux) GetStream(id StreamId) (stream *Stream, ok bool)
- func (s *StreamMux) RangeStream(f func(stream *Stream) bool)
- func (s *StreamMux) RemotePull(puller *Puller) error
- func (s *StreamMux) RemoteStream(stream *Stream) error
- func (s *StreamMux) Write(data *StreamData) error
- type StreamMuxer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OnPacketFunc ¶
type OnPacketFunc func(info *StreamInfo, data *StreamData)
type OnStreamCloseFunc ¶
type OnStreamCloseFunc func(stream *Stream)
type PullInfo ¶
type PullInfo struct { Name string // 拉流者的名称 OnPacket OnPacketFunc // 数据包回调 OnStreamClose OnStreamCloseFunc // 拉取的流不可用了 }
type Puller ¶
type Puller struct { PullInfo // contains filtered or unexported fields }
func (*Puller) GetStreamId ¶
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
func (*Stream) GetInfo ¶
func (st *Stream) GetInfo() *StreamInfo
func (*Stream) GetPullers ¶
func (*Stream) RemotePull ¶
type StreamData ¶
type StreamId ¶
type StreamId string
func NewStreamIdRTCP ¶
func NewStreamIdRTP ¶
func NewStreamIdRTPOrder ¶
NewStreamIdRTPOrder 排好序的rtp包
type StreamInfo ¶
type StreamMux ¶
type StreamMux struct {
// contains filtered or unexported fields
}
StreamMux 如果一个mux处理能力不够, 使用n个mux, 均匀分片id到n个mux中 (例如: id%5=[0,1,2,3,4])
func (*StreamMux) AddStream ¶
func (s *StreamMux) AddStream(info StreamInfo) (*Stream, error)
AddStream 添加推流stream
func (*StreamMux) RangeStream ¶
func (*StreamMux) RemotePull ¶
func (*StreamMux) RemoteStream ¶
type StreamMuxer ¶
type StreamMuxer interface { // AddStream 添加推流stream AddStream(info StreamInfo) (*Stream, error) RemoteStream(*Stream) error GetStream(streamId StreamId) (*Stream, bool) RangeStream(fnc func(*Stream) bool) // AddPull 添加拉流 AddPull(streamId StreamId, info PullInfo) (*Puller, error) RemotePull(puller *Puller) error // Write 发送数据 Write(data *StreamData) error Close() }
Click to show internal directories.
Click to hide internal directories.