Documentation
¶
Index ¶
- Constants
- func ValidateVPFile(name string) (string, bool)
- type BizClient
- type Call
- type Client
- func (c *Client) Close()
- func (c *Client) CreateDataChannel(label string) (*webrtc.DataChannel, error)
- func (c *Client) GetPubStats() webrtc.StatsReport
- func (c *Client) GetPubTransport() *Transport
- func (c *Client) GetSubStats() webrtc.StatsReport
- func (c *Client) GetSubTransport() *Transport
- func (c *Client) Join(sid string, config *JoinConfig) error
- func (c *Client) Negotiate(sdp webrtc.SessionDescription) error
- func (c *Client) OnNegotiationNeeded()
- func (c *Client) Publish(track webrtc.TrackLocal) (*webrtc.RTPTransceiver, error)
- func (c *Client) PublishWebm(file string, video, audio bool) error
- func (c *Client) SetRemoteSDP(sdp webrtc.SessionDescription) error
- func (c *Client) Simulcast(layer string)
- func (c *Client) SubscribeAll(video string, audio bool)
- func (c *Client) Trickle(candidate webrtc.ICECandidateInit, target int)
- func (c *Client) UnPublish(t *webrtc.RTPTransceiver) error
- func (c *Client) UnSubscribeAll()
- type Config
- type Engine
- type IonConnector
- type JoinConfig
- type Message
- type Peer
- type PeerEvent
- type PeerState
- type Signal
- func (s *Signal) Answer(sdp webrtc.SessionDescription)
- func (s *Signal) Close()
- func (s *Signal) Join(sid string, uid string, offer webrtc.SessionDescription, config *JoinConfig) error
- func (s *Signal) Offer(sdp webrtc.SessionDescription)
- func (s *Signal) Trickle(candidate *webrtc.ICECandidate, target int)
- type Stream
- type StreamEvent
- type StreamState
- type Track
- type Transport
- type WebMProducer
- func (t *WebMProducer) AddTrack(pc *webrtc.PeerConnection, kind string) (*webrtc.TrackLocalStaticSample, error)
- func (t *WebMProducer) AudioTrack() *webrtc.TrackLocalStaticSample
- func (t *WebMProducer) GetSendBandwidth(cycle int) int
- func (t *WebMProducer) Pause(pause bool)
- func (t *WebMProducer) SeekP(ts int)
- func (t *WebMProducer) Start()
- func (t *WebMProducer) Stop()
- func (t *WebMProducer) VideoCodec() string
- func (t *WebMProducer) VideoTrack() *webrtc.TrackLocalStaticSample
- type WebRTCTransportConfig
Constants ¶
const ( API_CHANNEL = "ion-sfu" PUBLISHER = 0 SUBSCRIBER = 1 )
Variables ¶
This section is empty.
Functions ¶
func ValidateVPFile ¶
Types ¶
type BizClient ¶ added in v0.4.5
type BizClient struct { sync.Mutex OnJoin func(success bool, reason string) OnLeave func(reason string) OnPeerEvent func(state PeerState, peer Peer) OnStreamEvent func(state StreamState, sid string, uid string, streams []*Stream) OnMessage func(from string, to string, data map[string]interface{}) OnError func(error) // contains filtered or unexported fields }
func NewBizClient ¶ added in v0.4.5
type Call ¶ added in v0.2.0
type Call struct { StreamID string `json:"streamId"` Video string `json:"video"` Audio bool `json:"audio"` }
Call dc api
type Client ¶ added in v0.2.0
type Client struct { //export to user OnTrack func(track *webrtc.TrackRemote, receiver *webrtc.RTPReceiver) OnDataChannel func(*webrtc.DataChannel) OnError func(error) // contains filtered or unexported fields }
Client a sdk client
func (*Client) CreateDataChannel ¶ added in v0.2.0
CreateDataChannel create a custom datachannel
func (*Client) GetPubStats ¶ added in v0.2.0
func (c *Client) GetPubStats() webrtc.StatsReport
GetPubStats get pub stats
func (*Client) GetPubTransport ¶ added in v0.4.5
func (*Client) GetSubStats ¶ added in v0.2.0
func (c *Client) GetSubStats() webrtc.StatsReport
GetSubStats get sub stats
func (*Client) GetSubTransport ¶ added in v0.4.5
func (*Client) Join ¶ added in v0.2.0
func (c *Client) Join(sid string, config *JoinConfig) error
Join client join a session
func (*Client) OnNegotiationNeeded ¶ added in v0.2.0
func (c *Client) OnNegotiationNeeded()
OnNegotiationNeeded will be called when add/remove track, but never trigger, call by hand
func (*Client) PublishWebm ¶ added in v0.2.0
PublishWebm publish a webm producer
func (*Client) SetRemoteSDP ¶ added in v0.2.0
SetRemoteSDP pub SetRemoteDescription and send cadidate to sfu
func (*Client) SubscribeAll ¶ added in v0.2.0
SubscribeAll subscribe all stream with the same video/audio param
func (*Client) UnSubscribeAll ¶ added in v0.2.0
func (c *Client) UnSubscribeAll()
UnSubscribeAll unsubscribe all stream
type Config ¶
type Config struct { // WebRTC WebRTCConf `mapstructure:"webrtc"` WebRTC WebRTCTransportConfig `mapstructure:"webrtc"` }
Config ..
type Engine ¶ added in v0.2.0
Engine a sdk engine
func (*Engine) AddClient ¶ added in v0.2.0
AddClient add a client addr: grpc addr sid: session/room id cid: client id
func (*Engine) ServePProf ¶ added in v0.4.5
ServePProf listening pprof
type IonConnector ¶ added in v0.4.5
type IonConnector struct { OnJoin func(success bool, reason string) OnLeave func(reason string) OnTrack func(track *webrtc.TrackRemote, receiver *webrtc.RTPReceiver) OnDataChannel func(dc *webrtc.DataChannel) OnPeerEvent func(event PeerEvent) OnStreamEvent func(event StreamEvent) OnMessage func(msg Message) OnError func(error) // contains filtered or unexported fields }
func NewIonConnector ¶ added in v0.4.5
func NewIonConnector(addr string, uid string, pinfo map[string]interface{}) *IonConnector
func (*IonConnector) Close ¶ added in v0.4.5
func (i *IonConnector) Close()
func (*IonConnector) Join ¶ added in v0.4.5
func (i *IonConnector) Join(sid string) error
func (*IonConnector) Leave ¶ added in v0.4.5
func (i *IonConnector) Leave(uid string) error
func (*IonConnector) Message ¶ added in v0.4.5
func (i *IonConnector) Message(from string, to string, data map[string]interface{})
func (*IonConnector) SFU ¶ added in v0.4.5
func (i *IonConnector) SFU() *Client
type JoinConfig ¶ added in v0.6.0
func NewJoinConfig ¶ added in v0.6.0
func NewJoinConfig() *JoinConfig
func SetRelay ¶ added in v0.6.0
func SetRelay(j JoinConfig) *JoinConfig
func (JoinConfig) SetNoPublish ¶ added in v0.6.0
func (j JoinConfig) SetNoPublish() *JoinConfig
func (JoinConfig) SetNoSubscribe ¶ added in v0.6.0
func (j JoinConfig) SetNoSubscribe() *JoinConfig
type Signal ¶ added in v0.2.0
type Signal struct { OnNegotiate func(webrtc.SessionDescription) error OnTrickle func(candidate webrtc.ICECandidateInit, target int) OnSetRemoteSDP func(webrtc.SessionDescription) error OnError func(error) sync.Mutex // contains filtered or unexported fields }
Signal is a wrapper of grpc
type StreamEvent ¶ added in v0.4.5
type StreamEvent struct { State StreamState Sid string Uid string Streams []*Stream }
type StreamState ¶ added in v0.4.5
type StreamState int32
const ( StreamADD StreamState = 0 StreamREMOVE StreamState = 2 )
type Transport ¶ added in v0.2.0
type Transport struct { SendCandidates []*webrtc.ICECandidate RecvCandidates []webrtc.ICECandidateInit // contains filtered or unexported fields }
Transport is pub/sub transport
func NewTransport ¶ added in v0.2.0
func NewTransport(role int, signal *Signal, cfg WebRTCTransportConfig) *Transport
NewTransport create a transport
func (*Transport) GetPeerConnection ¶ added in v0.4.5
func (t *Transport) GetPeerConnection() *webrtc.PeerConnection
type WebMProducer ¶
type WebMProducer struct {
// contains filtered or unexported fields
}
WebMProducer support streaming by webm which encode with vp8 and opus
func NewWebMProducer ¶
func NewWebMProducer(id, name string, offset int) *WebMProducer
NewWebMProducer new a WebMProducer
func (*WebMProducer) AddTrack ¶
func (t *WebMProducer) AddTrack(pc *webrtc.PeerConnection, kind string) (*webrtc.TrackLocalStaticSample, error)
AddTrack will add new track to pc
func (*WebMProducer) AudioTrack ¶
func (t *WebMProducer) AudioTrack() *webrtc.TrackLocalStaticSample
func (*WebMProducer) GetSendBandwidth ¶
func (t *WebMProducer) GetSendBandwidth(cycle int) int
GetSendBandwidth calc the sending bandwidth with cycle(s)
func (*WebMProducer) Pause ¶
func (t *WebMProducer) Pause(pause bool)
func (*WebMProducer) SeekP ¶
func (t *WebMProducer) SeekP(ts int)
func (*WebMProducer) Start ¶
func (t *WebMProducer) Start()
func (*WebMProducer) Stop ¶
func (t *WebMProducer) Stop()
func (*WebMProducer) VideoCodec ¶
func (t *WebMProducer) VideoCodec() string
func (*WebMProducer) VideoTrack ¶
func (t *WebMProducer) VideoTrack() *webrtc.TrackLocalStaticSample
type WebRTCTransportConfig ¶
type WebRTCTransportConfig struct { VideoMime string Configuration webrtc.Configuration Setting webrtc.SettingEngine }
WebRTCTransportConfig represents configuration options
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
example
|
|
pkg
|
|
gstreamer-sink
Package gst provides an easy API to create an appsrc pipeline
|
Package gst provides an easy API to create an appsrc pipeline |
gstreamer-src
Package gst provides an easy API to create an appsink pipeline
|
Package gst provides an easy API to create an appsink pipeline |