Documentation ¶
Index ¶
- Constants
- Variables
- type Candidates
- type ICECandidateInit
- type ICEServerConfig
- type Publisher
- func (p *Publisher) AddICECandidate(candidate webrtc.ICECandidateInit) error
- func (p *Publisher) Answer(sdp webrtc.SessionDescription) (*webrtc.SessionDescription, error)
- func (p *Publisher) Close()
- func (p *Publisher) GetUpTrack(trackId string) *UpTrack
- func (p *Publisher) Logger() *logrus.Entry
- func (p *Publisher) OnUpTrack(fn func(track forwarder.IFrameSource, layer int8))
- type RetransmitPacketMsg
- type SessionDescription
- type SimulcastConfig
- type Subscriber
- func (s *Subscriber) AddICECandidate(candidate webrtc.ICECandidateInit) error
- func (s *Subscriber) Close()
- func (s *Subscriber) CreateOffer() (webrtc.SessionDescription, error)
- func (s *Subscriber) Logger() *logrus.Entry
- func (s *Subscriber) NegotiateTracks()
- func (s *Subscriber) OnDownTrack(fn func(track forwarder.IDownTrack))
- func (s *Subscriber) OnNegotiateTracks(f func())
- func (s *Subscriber) SetRemoteDescription(sdp webrtc.SessionDescription) error
- type UpTrack
- func (up *UpTrack) Close()
- func (up *UpTrack) GetCodecType() forwarder.FrameFormat
- func (up *UpTrack) GetFrameKind() forwarder.FrameKind
- func (up *UpTrack) GetPacketType() forwarder.PacketType
- func (up *UpTrack) Layer() int8
- func (up *UpTrack) SendRTCP(p []rtcp.Packet)
- func (up *UpTrack) SetRTCPCh(ch chan []rtcp.Packet)
- func (up *UpTrack) WriteFeedback(fb *forwarder.FeedbackMsg)
- type WebRTC
- func (rtc *WebRTC) ConfigChanged()
- func (rtc *WebRTC) InitCommand() ([]*cobra.Command, error)
- func (rtc *WebRTC) InitModule(_ context.Context, _ *gomodule.Manager) (interface{}, error)
- func (rtc *WebRTC) ModuleRun()
- func (rtc *WebRTC) NewPublisher(ctx context.Context, id string, logger *logrus.Entry) (forwarder.IPublisher, error)
- func (rtc *WebRTC) NewSubscriber(ctx context.Context, id string, logger *logrus.Entry) (forwarder.ISubscriber, error)
- func (rtc *WebRTC) WebRTCConfig() WebRTCTransportConfig
- type WebRTCConfig
- type WebRTCTimeoutsConfig
- type WebRTCTransportConfig
Constants ¶
View Source
const ( RolePublisher = 0 RoleSubscriber = 1 )
Variables ¶
View Source
var ( ErrSpatialNotSupported = errors.New("current track does not support simulcast/SVC") ErrSpatialLayerBusy = errors.New("a spatial layer change is in progress, try latter") )
Functions ¶
This section is empty.
Types ¶
type Candidates ¶
type ICECandidateInit ¶
type ICECandidateInit webrtc.ICECandidateInit
func (*ICECandidateInit) ToJSON ¶
func (ice *ICECandidateInit) ToJSON() string
type ICEServerConfig ¶
type ICEServerConfig struct { URLs []string `mapstructure:"urls"` Username string `mapstructure:"username"` Credential string `mapstructure:"credential"` }
ICEServerConfig defines parameters for ice servers
type Publisher ¶
type Publisher struct { OnIceCandidate func(*webrtc.ICECandidateInit, int) // contains filtered or unexported fields }
func NewPublisher ¶
func (*Publisher) AddICECandidate ¶
func (*Publisher) GetUpTrack ¶
type RetransmitPacketMsg ¶
type RetransmitPacketMsg struct { Dest forwarder.IFrameDestination Packets []packetMeta }
type SessionDescription ¶
type SessionDescription webrtc.SessionDescription
type SimulcastConfig ¶
type Subscriber ¶
type Subscriber struct { sync.Mutex OnOffer func(offer *webrtc.SessionDescription) OnIceCandidate func(*webrtc.ICECandidateInit, int) OnICEConnectionStateChange func(webrtc.ICEConnectionState) // contains filtered or unexported fields }
func NewSubscriber ¶
func NewSubscriber(ctx context.Context, id string, c WebRTCTransportConfig, logger *logrus.Entry) (*Subscriber, error)
func (*Subscriber) AddICECandidate ¶
func (s *Subscriber) AddICECandidate(candidate webrtc.ICECandidateInit) error
func (*Subscriber) Close ¶
func (s *Subscriber) Close()
func (*Subscriber) CreateOffer ¶
func (s *Subscriber) CreateOffer() (webrtc.SessionDescription, error)
func (*Subscriber) Logger ¶
func (s *Subscriber) Logger() *logrus.Entry
func (*Subscriber) NegotiateTracks ¶
func (s *Subscriber) NegotiateTracks()
func (*Subscriber) OnDownTrack ¶
func (s *Subscriber) OnDownTrack(fn func(track forwarder.IDownTrack))
func (*Subscriber) OnNegotiateTracks ¶
func (s *Subscriber) OnNegotiateTracks(f func())
func (*Subscriber) SetRemoteDescription ¶
func (s *Subscriber) SetRemoteDescription(sdp webrtc.SessionDescription) error
SetRemoteDescription when receiving an answer from remote
type UpTrack ¶
type UpTrack struct { forwarder.FrameSource // contains filtered or unexported fields }
func NewUpTrack ¶
func (*UpTrack) GetCodecType ¶
func (up *UpTrack) GetCodecType() forwarder.FrameFormat
func (*UpTrack) GetFrameKind ¶
func (*UpTrack) GetPacketType ¶
func (up *UpTrack) GetPacketType() forwarder.PacketType
func (*UpTrack) WriteFeedback ¶
func (up *UpTrack) WriteFeedback(fb *forwarder.FeedbackMsg)
type WebRTC ¶
type WebRTC struct { gomodule.DefaultModule // contains filtered or unexported fields }
func WebRTCModule ¶
func WebRTCModule() *WebRTC
func (*WebRTC) ConfigChanged ¶
func (rtc *WebRTC) ConfigChanged()
func (*WebRTC) InitModule ¶
func (*WebRTC) NewPublisher ¶
func (*WebRTC) NewSubscriber ¶
func (*WebRTC) WebRTCConfig ¶
func (rtc *WebRTC) WebRTCConfig() WebRTCTransportConfig
type WebRTCConfig ¶
type WebRTCConfig struct { ICESinglePort int `mapstructure:"singleport"` ICEPortRange []uint16 `mapstructure:"portrange"` ICEServers []ICEServerConfig `mapstructure:"iceserver"` Candidates Candidates `mapstructure:"candidates"` SDPSemantics string `mapstructure:"sdpsemantics"` MDNS bool `mapstructure:"mdns"` Timeouts WebRTCTimeoutsConfig `mapstructure:"timeouts"` TrackingPackets int `mapstructure:"trackingPackets"` MaxBitRate int `mapstructure:"maxBitRate"` }
WebRTCConfig defines parameters for ice
func (*WebRTCConfig) Compare ¶
func (wc *WebRTCConfig) Compare(other *WebRTCConfig) bool
type WebRTCTimeoutsConfig ¶
type WebRTCTransportConfig ¶
type WebRTCTransportConfig struct { Configuration webrtc.Configuration Setting webrtc.SettingEngine MaxBitRate int TrackingPackets int }
WebRTCTransportConfig represents Configuration options
Click to show internal directories.
Click to hide internal directories.