signalling

package
v0.0.0-...-52aba34 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2025 License: MIT Imports: 21 Imported by: 0

Documentation

Index

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 RawCodec

type RawCodec struct {
	Params struct {
		MimeType    string `json:"mimeType"`
		ClockRate   uint32 `json:"clockRate"`
		PayloadType uint8  `json:"payloadType"`
		Channels    uint16 `json:"channels"`
	} `json:"params"`
	Type string `json:"type"`
}

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 (s *Server) CheckPlayerCredential(credentials string) bool

func (*Server) Close

func (s *Server) Close()

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()

Jump to

Keyboard shortcuts

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