rtc

package
v0.0.0-...-a5da40b Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RoomsLock sync.RWMutex
	Rooms     map[string]*Room
	Streams   map[string]*Room
)

Functions

func RoomConnection

func RoomConnection(c *websocket.Conn, p *Peers)

func StreamConn

func StreamConn(c *websocket.Conn, p *Peers)

Types

type PeerConnectionState

type PeerConnectionState struct {
	PeerConnection *webrtc.PeerConnection
	Websocket      *ThreadSafeWriter
}

func NewPeerConnectionState

func NewPeerConnectionState() *PeerConnectionState

type Peers

type Peers struct {
	ListLock    sync.RWMutex
	Connections []PeerConnectionState
	TrackLocals map[string]*webrtc.TrackLocalStaticRTP
}

func (*Peers) AddTrack

func (p *Peers) AddTrack(t *webrtc.TrackRemote) *webrtc.TrackLocalStaticRTP

func (*Peers) DispatchKeyFrame

func (p *Peers) DispatchKeyFrame()

func (*Peers) RemoveTrack

func (p *Peers) RemoveTrack(t *webrtc.TrackLocalStaticRTP)

func (*Peers) SignalPeerConnections

func (p *Peers) SignalPeerConnections()

type Room

type Room struct {
	Peers *Peers
	Hub   *chat.Hub
}

type ThreadSafeWriter

type ThreadSafeWriter struct {
	Conn  *websocket.Conn
	Mutex sync.Mutex
}

func (*ThreadSafeWriter) WriteJSON

func (t *ThreadSafeWriter) WriteJSON(v interface{}) error

Jump to

Keyboard shortcuts

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