Documentation ¶
Index ¶
- Variables
- func GetMediaEngineForSDPOffer(offer webrtc.SessionDescription, mediaCfg *config.MediaConfig) (uint8, string, *webrtc.MediaEngine)
- type Participant
- func (p *Participant) Anwser(offer webrtc.SessionDescription) webrtc.SessionDescription
- func (p *Participant) AudioOutput() *webrtc.Track
- func (p *Participant) OnParticipantConnectionStateChangedHandler(session *Session) func(f webrtc.PeerConnectionState)
- func (p *Participant) OnParticipantSessionMessage(session *Session) func(m webrtc.DataChannelMessage)
- func (p *Participant) OnRemoteTrackHandler(session *Session) func(*webrtc.Track, *webrtc.RTPReceiver)
- func (p *Participant) VideoOutput() *webrtc.Track
- type Session
- func (s *Session) AddParticipant(newPart Participant)
- func (s *Session) BroadcastState()
- func (s *Session) CreateParticipant(name string, offer webrtc.SessionDescription) (*Participant, error)
- func (s *Session) DisconnectParticipant(part *Participant)
- func (s *Session) RemoveParticipant(usrID string)
- func (s *Session) Restart()
- func (s *Session) Start()
- func (s *Session) Stop()
- type SessionManager
Constants ¶
This section is empty.
Variables ¶
var Logger *logrus.Logger
Logger is the Gst Logger Instance
Functions ¶
func GetMediaEngineForSDPOffer ¶
func GetMediaEngineForSDPOffer(offer webrtc.SessionDescription, mediaCfg *config.MediaConfig) (uint8, string, *webrtc.MediaEngine)
GetMediaEngineForSDPOffer for an Offer
Types ¶
type Participant ¶
type Participant struct { ID string `json:"ID"` Name string `json:"Name"` MediaEngine *webrtc.MediaEngine `json:"-"` API *webrtc.API `json:"-"` Codec string `json:"-"` PayloadType uint8 `json:"-"` Peer *webrtc.PeerConnection `json:"-"` DataChannels map[string]*webrtc.DataChannel `json:"-"` // contains filtered or unexported fields }
Participant can connect to a Session
func NewParticipant ¶
func NewParticipant(name string, peerConnectionConfig webrtc.Configuration, media *webrtc.MediaEngine, customPayloadType uint8, codec string) (*Participant, error)
NewParticipant creates a new Participant
func (*Participant) Anwser ¶
func (p *Participant) Anwser(offer webrtc.SessionDescription) webrtc.SessionDescription
Anwser generates the Anwser for the SDP Handshake
func (*Participant) AudioOutput ¶
func (p *Participant) AudioOutput() *webrtc.Track
AudioOutput is the Audio Pipeline Output Track
func (*Participant) OnParticipantConnectionStateChangedHandler ¶
func (p *Participant) OnParticipantConnectionStateChangedHandler(session *Session) func(f webrtc.PeerConnectionState)
OnParticipantConnectionStateChangedHandler handles Participant Timeout
func (*Participant) OnParticipantSessionMessage ¶
func (p *Participant) OnParticipantSessionMessage(session *Session) func(m webrtc.DataChannelMessage)
OnParticipantSessionMessage attach Session DataChannels
func (*Participant) OnRemoteTrackHandler ¶
func (p *Participant) OnRemoteTrackHandler(session *Session) func(*webrtc.Track, *webrtc.RTPReceiver)
OnRemoteTrackHandler dasdas
func (*Participant) VideoOutput ¶
func (p *Participant) VideoOutput() *webrtc.Track
VideoOutput is the Video Pipeline Output Track
type Session ¶
type Session struct { ID string `json:"ID"` Name string `json:"Name"` API *webrtc.API `json:"-"` Codec string `json:"Codec"` VideoPipeline *gst.Pipeline `json:"-"` AudioPipeline *gst.Pipeline `json:"-"` Participants []Participant `json:"Participants"` // contains filtered or unexported fields }
Session is a GroupVideo Call
func (*Session) AddParticipant ¶
func (s *Session) AddParticipant(newPart Participant)
AddParticipant to Session and restart Pipeline
func (*Session) BroadcastState ¶
func (s *Session) BroadcastState()
BroadcastState to the DataChannel
func (*Session) CreateParticipant ¶
func (s *Session) CreateParticipant(name string, offer webrtc.SessionDescription) (*Participant, error)
CreateParticipant in the Session
func (*Session) DisconnectParticipant ¶
func (s *Session) DisconnectParticipant(part *Participant)
DisconnectParticipant from Session
func (*Session) RemoveParticipant ¶
RemoveParticipant from with ID from Session and restart Pipeline
type SessionManager ¶
SessionManager manage Sessions
func NewSessionManager ¶
func NewSessionManager(cfg *config.Config) SessionManager
NewSessionManager create a new SessionManager
func (*SessionManager) GetAllSessions ¶
func (s *SessionManager) GetAllSessions() []*Session
GetAllSessions from Manager
func (*SessionManager) GetSession ¶
func (s *SessionManager) GetSession(sessionID string) *Session
GetSession Get from Cache or Create a new Session
func (*SessionManager) NewSession ¶
func (s *SessionManager) NewSession(name string) *Session
NewSession Get from Cache or Create a new Session
func (*SessionManager) RemoveSession ¶
func (s *SessionManager) RemoveSession(sessionID string) bool
RemoveSession remove the Session from Cache if found. Returns true if found.
func (*SessionManager) SaveSession ¶
func (s *SessionManager) SaveSession(session *Session) error
SaveSession Add the Session in Cache or Replace it.