Documentation
¶
Index ¶
- Constants
- type Codec
- type PeerManager
- func (pm *PeerManager) AddICECandidatePublisher(publisherKey string, candidate webrtc.ICECandidateInit)
- func (pm *PeerManager) AddSubscriber(id, publisherSocketID sockets.SocketID, streamType string, c sockets.Socket, ...) *api.PlayerMessage
- func (pm *PeerManager) Close()
- func (pm *PeerManager) DeletePublisher(id sockets.SocketID)
- func (pm *PeerManager) DeleteSubscriber(id sockets.SocketID)
- func (pm *PeerManager) OfferAnswerPublisher(publisherKey string, answer webrtc.SessionDescription)
- func (pm *PeerManager) SubscriberICE(id sockets.SocketID, candidate webrtc.ICECandidateInit)
- type RawCodec
- type RawServerConfig
- type Server
- type ServerConfig
- type Storage
- type SyncMapWrapper
- func (sw *SyncMapWrapper[K, V]) Clear()
- func (sw *SyncMapWrapper[K, V]) Delete(key K)
- func (sw *SyncMapWrapper[K, V]) Len() int
- func (sw *SyncMapWrapper[K, V]) Load(key K) (V, bool)
- func (sw *SyncMapWrapper[K, V]) LoadAndDelete(key K) (V, bool)
- func (sw *SyncMapWrapper[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
- func (sw *SyncMapWrapper[K, V]) Range(f func(key K, value V) bool)
- func (sw *SyncMapWrapper[K, V]) Store(key K, value V)
- type TrackBroadcaster
- func (tb *TrackBroadcaster) AddSubscriber(pc *webrtc.PeerConnection)
- func (tb *TrackBroadcaster) GetLocalTrack() *webrtc.TrackLocalStaticRTP
- func (tb *TrackBroadcaster) GetSubscriberCount() int
- func (tb *TrackBroadcaster) RemoveSubscriber(pc *webrtc.PeerConnection)
- func (tb *TrackBroadcaster) Stop()
Constants ¶
View Source
const ( PublisherWatingTime = 20 * time.Second BufferSize = 1500 MaxConcurrentReads = 10 )
View Source
const PlayerSendPeerStatusInterval = time.Second * 5
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Codec ¶
type Codec struct { Params webrtc.RTPCodecParameters `json:"params"` Type webrtc.RTPCodecType `json:"type"` }
type PeerManager ¶
type PeerManager struct {
// contains filtered or unexported fields
}
func NewPeerManager ¶
func NewPeerManager(config *ServerConfig) (*PeerManager, error)
func (*PeerManager) AddICECandidatePublisher ¶
func (pm *PeerManager) AddICECandidatePublisher(publisherKey string, candidate webrtc.ICECandidateInit)
func (*PeerManager) AddSubscriber ¶
func (pm *PeerManager) AddSubscriber(id, publisherSocketID sockets.SocketID, streamType string, c sockets.Socket, offer *webrtc.SessionDescription, publisherConn sockets.Socket) *api.PlayerMessage
func (*PeerManager) Close ¶
func (pm *PeerManager) Close()
func (*PeerManager) DeletePublisher ¶
func (pm *PeerManager) DeletePublisher(id sockets.SocketID)
func (*PeerManager) DeleteSubscriber ¶
func (pm *PeerManager) DeleteSubscriber(id sockets.SocketID)
func (*PeerManager) OfferAnswerPublisher ¶
func (pm *PeerManager) OfferAnswerPublisher(publisherKey string, answer webrtc.SessionDescription)
func (*PeerManager) SubscriberICE ¶
func (pm *PeerManager) SubscriberICE(id sockets.SocketID, candidate webrtc.ICECandidateInit)
type RawServerConfig ¶
type RawServerConfig struct { PlayerCredential *string `json:"adminCredential"` Participants []string `json:"participants"` AdminsRawNetworks []string `json:"adminsNetworks"` PeerConnectionConfig api.PeerConnectionConfig `json:"peerConnectionConfig"` GrabberPingInterval int `json:"grabberPingInterval"` ServerPort int `json:"serverPort"` ServerTLSCrtFile *string `json:"serverTLSCrtFile"` ServerTLSKeyFile *string `json:"serverTLSKeyFile"` Codecs []RawCodec `json:"codecs"` WebcamTrackCount int `json:"webcamTrackCount"` }
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(config *ServerConfig, app *fiber.App) (*Server, error)
func (*Server) CheckPlayerCredential ¶
func (*Server) SetupWebSockets ¶
func (s *Server) SetupWebSockets()
type ServerConfig ¶
type ServerConfig struct { PlayerCredential *string `json:"adminCredential"` Participants []string `json:"participants"` AdminsRawNetworks []netip.Prefix `json:"adminsNetworks"` PeerConnectionConfig api.PeerConnectionConfig `json:"peerConnectionConfig"` GrabberPingInterval int `json:"grabberPingInterval"` ServerPort int `json:"serverPort"` ServerTLSCrtFile *string `json:"serverTLSCrtFile"` ServerTLSKeyFile *string `json:"serverTLSKeyFile"` Codecs []Codec `json:"codecs"` WebcamTrackCount int `json:"webcamTrackCount"` }
func LoadServerConfig ¶
func LoadServerConfig() (ServerConfig, error)
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
func NewStorage ¶
func NewStorage() *Storage
type SyncMapWrapper ¶
type SyncMapWrapper[K comparable, V any] struct { // contains filtered or unexported fields }
func NewSyncMapWrapper ¶
func NewSyncMapWrapper[K comparable, V any]() *SyncMapWrapper[K, V]
func (*SyncMapWrapper[K, V]) Clear ¶
func (sw *SyncMapWrapper[K, V]) Clear()
func (*SyncMapWrapper[K, V]) Delete ¶
func (sw *SyncMapWrapper[K, V]) Delete(key K)
func (*SyncMapWrapper[K, V]) Len ¶
func (sw *SyncMapWrapper[K, V]) Len() int
func (*SyncMapWrapper[K, V]) Load ¶
func (sw *SyncMapWrapper[K, V]) Load(key K) (V, bool)
func (*SyncMapWrapper[K, V]) LoadAndDelete ¶
func (sw *SyncMapWrapper[K, V]) LoadAndDelete(key K) (V, bool)
func (*SyncMapWrapper[K, V]) LoadOrStore ¶
func (sw *SyncMapWrapper[K, V]) LoadOrStore(key K, value V) (actual V, loaded bool)
func (*SyncMapWrapper[K, V]) Range ¶
func (sw *SyncMapWrapper[K, V]) Range(f func(key K, value V) bool)
func (*SyncMapWrapper[K, V]) Store ¶
func (sw *SyncMapWrapper[K, V]) Store(key K, value V)
type TrackBroadcaster ¶
type TrackBroadcaster struct {
// contains filtered or unexported fields
}
func NewTrackBroadcaster ¶
func NewTrackBroadcaster(remoteTrack *webrtc.TrackRemote, publisherSocketID sockets.SocketID) (*TrackBroadcaster, error)
func (*TrackBroadcaster) AddSubscriber ¶
func (tb *TrackBroadcaster) AddSubscriber(pc *webrtc.PeerConnection)
func (*TrackBroadcaster) GetLocalTrack ¶
func (tb *TrackBroadcaster) GetLocalTrack() *webrtc.TrackLocalStaticRTP
func (*TrackBroadcaster) GetSubscriberCount ¶
func (tb *TrackBroadcaster) GetSubscriberCount() int
func (*TrackBroadcaster) RemoveSubscriber ¶
func (tb *TrackBroadcaster) RemoveSubscriber(pc *webrtc.PeerConnection)
func (*TrackBroadcaster) Stop ¶
func (tb *TrackBroadcaster) Stop()
Click to show internal directories.
Click to hide internal directories.