Documentation ¶
Index ¶
- Constants
- Variables
- func Init(r *Registry)
- type AVP
- type Builder
- type Config
- type Element
- type Registry
- type SFU
- type Sample
- type WebRTCTransport
- func (t *WebRTCTransport) AddICECandidate(candidate webrtc.ICECandidateInit) error
- func (t *WebRTCTransport) Close() error
- func (t *WebRTCTransport) CreateAnswer() (webrtc.SessionDescription, error)
- func (t *WebRTCTransport) CreateOffer() (webrtc.SessionDescription, error)
- func (t *WebRTCTransport) OnClose(f func())
- func (t *WebRTCTransport) OnICECandidate(f func(c *webrtc.ICECandidate))
- func (t *WebRTCTransport) Process(pid, tid, eid string, config []byte)
- func (t *WebRTCTransport) SetLocalDescription(desc webrtc.SessionDescription) error
- func (t *WebRTCTransport) SetRemoteDescription(desc webrtc.SessionDescription) error
- type WebRTCTransportConfig
Constants ¶
const ( TypeOpus = 1 TypeVP8 = 2 TypeVP9 = 3 TypeH264 = 4 )
Types for samples
Variables ¶
var ( // ErrCodecNotSupported is returned when a rtp packed it pushed with an unsupported codec ErrCodecNotSupported = errors.New("codec not supported") )
Functions ¶
Types ¶
type AVP ¶
type AVP struct {
// contains filtered or unexported fields
}
AVP represents an avp instance
type Builder ¶ added in v0.1.0
type Builder struct {
// contains filtered or unexported fields
}
Builder Module for building video/audio samples from rtp streams
func NewBuilder ¶ added in v0.1.0
NewBuilder Initialize a new audio sample builder
func (*Builder) AttachElement ¶ added in v0.1.0
AttachElement attaches a element to a builder
type Config ¶
type Config struct { Log log.Config `mapstructure:"log"` Pipeline pipelineconf `mapstructure:"pipeline"` SampleBuilder samplebuilderconf `mapstructure:"samplebuilder"` WebRTC webrtcconf `mapstructure:"webrtc"` }
Config for base AVP
type Element ¶
type Element interface { ID() string Write(*Sample) error Attach(Element) error Read() <-chan *Sample Close() }
Element interface
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry provides a registry of elements
func (*Registry) AddElement ¶
AddElement to registry
type SFU ¶ added in v0.1.0
type SFU struct {
// contains filtered or unexported fields
}
SFU client
func NewSFU ¶ added in v0.1.0
func NewSFU(addr string, config WebRTCTransportConfig) *SFU
NewSFU intializes a new SFU client
func (*SFU) GetTransport ¶ added in v0.1.0
func (s *SFU) GetTransport(sid string) *WebRTCTransport
GetTransport returns a webrtc transport for a session
type WebRTCTransport ¶
type WebRTCTransport struct {
// contains filtered or unexported fields
}
WebRTCTransport represents a webrtc transport
func NewWebRTCTransport ¶
func NewWebRTCTransport(id string, cfg WebRTCTransportConfig) *WebRTCTransport
NewWebRTCTransport creates a new webrtc transport
func (*WebRTCTransport) AddICECandidate ¶
func (t *WebRTCTransport) AddICECandidate(candidate webrtc.ICECandidateInit) error
AddICECandidate accepts an ICE candidate string and adds it to the existing set of candidates
func (*WebRTCTransport) Close ¶ added in v0.1.0
func (t *WebRTCTransport) Close() error
Close the webrtc transport
func (*WebRTCTransport) CreateAnswer ¶
func (t *WebRTCTransport) CreateAnswer() (webrtc.SessionDescription, error)
CreateAnswer starts the PeerConnection and generates the localDescription
func (*WebRTCTransport) CreateOffer ¶
func (t *WebRTCTransport) CreateOffer() (webrtc.SessionDescription, error)
CreateOffer starts the PeerConnection and generates the localDescription
func (*WebRTCTransport) OnClose ¶ added in v0.1.0
func (t *WebRTCTransport) OnClose(f func())
OnClose sets a handler that is called when the webrtc transport is closed
func (*WebRTCTransport) OnICECandidate ¶
func (t *WebRTCTransport) OnICECandidate(f func(c *webrtc.ICECandidate))
OnICECandidate sets an event handler which is invoked when a new ICE candidate is found. Take note that the handler is gonna be called with a nil pointer when gathering is finished.
func (*WebRTCTransport) Process ¶
func (t *WebRTCTransport) Process(pid, tid, eid string, config []byte)
Process creates a pipeline
func (*WebRTCTransport) SetLocalDescription ¶
func (t *WebRTCTransport) SetLocalDescription(desc webrtc.SessionDescription) error
SetLocalDescription sets the SessionDescription of the local peer
func (*WebRTCTransport) SetRemoteDescription ¶
func (t *WebRTCTransport) SetRemoteDescription(desc webrtc.SessionDescription) error
SetRemoteDescription sets the SessionDescription of the remote peer
type WebRTCTransportConfig ¶ added in v0.0.4
type WebRTCTransportConfig struct {
// contains filtered or unexported fields
}
WebRTCTransportConfig represents configuration options