Documentation
¶
Overview ¶
Package sfu forwards RTP between participants with pion/webrtc. The server is the only offerer; clients only answer.
Index ¶
- type Engine
- type EngineConfig
- type Peer
- func (p *Peer) AddICECandidate(c media.Candidate) error
- func (p *Peer) Close() error
- func (p *Peer) HandleAnswer(sdp string) error
- func (p *Peer) ID() string
- func (p *Peer) Negotiate()
- func (p *Peer) Publishes(kind media.Kind) bool
- func (p *Peer) RequestKeyframe(kind media.Kind)
- func (p *Peer) Sample() (s quality.Sample, ok bool)
- func (p *Peer) Subscribe(src media.Source, kind media.Kind) error
- func (p *Peer) Track(kind media.Kind) *webrtc.TrackLocalStaticRTP
- func (p *Peer) Transport() string
- func (p *Peer) Unsubscribe(from media.Source, kind media.Kind) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine owns the pion settings and the shared UDP socket.
type EngineConfig ¶
type EngineConfig struct {
UDPPort int
// TCP adds a passive ICE-TCP candidate on TCPPort, for clients whose UDP path to the
// server is blocked or unreliable. Browsers prefer UDP and fall back to it on their own.
TCP bool
TCPPort int
AdvertiseIP string
IncludeLoopback bool // tests only
}
EngineConfig selects the UDP port and the single advertised host address.
type Peer ¶
type Peer struct {
// contains filtered or unexported fields
}
Peer is one participant's connection to the SFU.
func (*Peer) AddICECandidate ¶
AddICECandidate adds a candidate the client sent.
func (*Peer) HandleAnswer ¶
HandleAnswer applies the client's answer to the outstanding offer.
func (*Peer) Negotiate ¶
func (p *Peer) Negotiate()
Negotiate sends an offer now, or marks the peer dirty when one is outstanding.
func (*Peer) Publishes ¶ added in v0.4.2
Publishes reports whether this peer's track of kind has arrived.
func (*Peer) RequestKeyframe ¶
RequestKeyframe asks this peer's browser for a keyframe on its published track.
func (*Peer) Sample ¶
Sample measures this participant's connection from the peer connection statistics. Uplink loss covers the time since the previous call. ok is false until there is anything to measure.
func (*Peer) Subscribe ¶
Subscribe attaches from's track of the given kind to this peer and renegotiates.