rtc

package
v0.0.0-...-6136325 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func (s *Session) RemoveParticipant(usrID string)

RemoveParticipant from with ID from Session and restart Pipeline

func (*Session) Restart

func (s *Session) Restart()

Restart a Session with new Parameters

func (*Session) Start

func (s *Session) Start()

Start a Session with new Parameters

func (*Session) Stop

func (s *Session) Stop()

Stop a Session

type SessionManager

type SessionManager struct {
	Config          *config.Config
	SessionRegister *cache.Cache
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL