rtmcsfu

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2020 License: AGPL-3.0-only Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const WebRTCPayloadVersion = 20180703

* * WebRTC payload version. All WebRTC payloads will include this value and * clients can use it to check if they are compatible with the received * data. This client will reject all messages which are from received with * older version than defined here.

Variables

This section is empty.

Functions

func New

func New(attach *kwm.MCUTypeContainer, ws *websocket.Conn, options *mcu.Options) (mcu.Plugin, error)

Types

type Channel

type Channel struct {
	deadlock.RWMutex
	// contains filtered or unexported fields
}

func NewChannel

func NewChannel(sfu *RTMChannelSFU, message *api.RTMTypeWebRTC) (*Channel, error)

func (*Channel) Stop added in v0.0.3

func (channel *Channel) Stop() error

type ChannelConnectionResource added in v0.0.5

type ChannelConnectionResource struct {
	Key string `json:"key"`

	Owner *ChannelUserResource `json:"owner"`
	Bound *ChannelUserResource `json:"bound"`

	ID    string `json:"id"`
	RPCID string `json:"rpcid"`

	IsInitiator bool `json:"isInitiator"`

	PeerConnection *ConnectionPeerConnectionResource `json:"peerConnection"`
	PCID           string                            `json:"pcid"`
	State          string                            `json:"state"`

	PendingCandidatesCount uint64 `json:"pendingCandidatesCount"`

	HasQueuedNegotiation bool `json:"hasQueuedNegotiation"`
	IsNegotiating        bool `json:"isNegotiating"`

	GUID string `json:"guid"`

	Tracks    map[uint32]interface{} `json:"tracks"`
	Senders   map[uint32]interface{} `json:"senders"`
	Receivers map[uint32]interface{} `json:"receivers"`
	Pending   map[uint32]interface{} `json:"pending"`

	RTPPayloadTypes map[string]uint8 `json:"rtpPayloadTypes"`

	JitterBuffer interface{} `json:"jitterBuffer"`

	P2p *P2PControllerResource `json:"p2p"`
}

func NewChannelConnectionResource added in v0.0.5

func NewChannelConnectionResource(key string, connectionRecord *ConnectionRecord) *ChannelConnectionResource

type ChannelResource added in v0.0.5

type ChannelResource struct {
	When    time.Time `json:"when"`
	Channel string    `json:"channel"`
	Group   string    `json:"group"`

	Pipeline *kwmapi.RTMDataWebRTCChannelPipeline `json:"pipeline"`

	UserCount uint64 `json:"userCount"`
}

type ChannelUserResource added in v0.0.5

type ChannelUserResource struct {
	Key string `json:"key"`

	When time.Time `json:"when"`
	ID   string    `json:"id"`

	IsClosed         bool   `json:"isClosed"`
	ConnectionsCount uint64 `json:"connectionsCount"`
	PublishersCount  uint64 `json:"publishersCount"`
}

func NewChannelUserResource added in v0.0.5

func NewChannelUserResource(key string, userRecord *UserRecord) *ChannelUserResource

type ConnectionPeerConnectionResource added in v0.0.6

type ConnectionPeerConnectionResource struct {
	ID string `json:"id"`

	ConnectionState   string `json:"connectionState"`
	SignalingState    string `json:"signalingState"`
	ICEGatheringState string `json:"iceGatheringState"`

	LocalDescription  *webrtc.SessionDescription `json:"localDescription"`
	RemoteDescription *webrtc.SessionDescription `json:"remoteDescription"`

	Stats *webrtc.StatsReport `json:"stats"`
}

func NewConnectionPeerConnectionResource added in v0.0.6

func NewConnectionPeerConnectionResource(pc *PeerConnection) *ConnectionPeerConnectionResource

type ConnectionRTPTransceiverStateResource added in v0.0.5

type ConnectionRTPTransceiverStateResource struct {
	DTLSTransport *DTLSTransportResource   `json:"dtlsTransport"`
	Track         *ConnectionTrackResource `json:"track"`
}

type ConnectionRecord

type ConnectionRecord struct {
	deadlock.RWMutex
	// contains filtered or unexported fields
}

func NewConnectionRecord

func NewConnectionRecord(parentCtx context.Context, owner *UserRecord, target string, state string, pipeline *api.RTMDataWebRTCChannelPipeline) *ConnectionRecord

func (*ConnectionRecord) OnReset added in v0.0.5

func (record *ConnectionRecord) OnReset(handler func(context.Context) error)

type ConnectionTrackRecordResource added in v0.0.5

type ConnectionTrackRecordResource struct {
	Connection      *ChannelConnectionResource `json:"connection"`
	Source          *ChannelUserResource       `json:"source"`
	Track           *ConnectionTrackResource   `json:"track"`
	IsRemove        bool                       `json:"IsRemove"`
	WithTransceiver bool                       `json:"WithTransceiver"`
}

type ConnectionTrackResource added in v0.0.5

type ConnectionTrackResource struct {
	ID          string `json:"id"`
	SSRC        uint32 `json:"ssrc"`
	Kind        string `json:"kind"`
	Label       string `json:"label"`
	PayloadType uint8  `json:"payloadType"`
}

func NewConnectionTrackResource added in v0.0.5

func NewConnectionTrackResource(track *webrtc.Track) *ConnectionTrackResource

type DTLSTransportResource added in v0.0.5

type DTLSTransportResource struct {
	State      string                `json:"state"`
	Parameters webrtc.DTLSParameters `json:"parameters"`

	ICETransport *webrtc.ICETransport `json:"iceTransport"`
}

func NewDTLSTransportResource added in v0.0.5

func NewDTLSTransportResource(transport *webrtc.DTLSTransport) *DTLSTransportResource

type JitterBufferBufferResource added in v0.0.5

type JitterBufferBufferResource struct {
	IsVideo     bool  `json:"isVideo"`
	PayloadType uint8 `json:"payloadType"`

	LostRate  float64 `json:"lostRate"`
	Bandwidth uint64  `json:"bandwidth"`
}

type JitterBufferResource added in v0.0.5

type JitterBufferResource struct {
	ID      string                                 `json:"id"`
	Buffers map[uint32]*JitterBufferBufferResource `json:"buffers"`
}

func NewJitterBufferResource added in v0.0.5

func NewJitterBufferResource(jitterBuffer *jitterbuffer.JitterBuffer) *JitterBufferResource

type P2PController added in v0.0.5

type P2PController struct {
	deadlock.RWMutex
	// contains filtered or unexported fields
}

func NewP2PController added in v0.0.5

func NewP2PController(parent *ConnectionRecord) *P2PController

type P2PControllerResource added in v0.1.0

type P2PControllerResource struct {
	Callbacks map[string]interface{} `json:"callbacks"`
	Streams   map[string]interface{} `json:"streams"`
	Pending   map[string]interface{} `json:"pending"`
}

func NewP2PControllerResource added in v0.1.0

func NewP2PControllerResource(controller *P2PController) *P2PControllerResource

type P2PRecord added in v0.0.5

type P2PRecord struct {
	deadlock.RWMutex
	// contains filtered or unexported fields
}

func NewP2PRecord added in v0.0.5

func NewP2PRecord(parentCtx context.Context, controller *P2PController, parentRecord *ConnectionRecord, dataChannel *webrtc.DataChannel, id string, token string, source *P2PRecord) *P2PRecord

type P2PRecordResource added in v0.1.0

type P2PRecordResource struct {
	Key string `json:"key"`

	ID    string `json:"id"`
	Token string `json:"token"`
	RPCID string `json:"rpcid"`

	PeerConnection *ConnectionPeerConnectionResource `json:"peerConnection"`
	PCID           string                            `json:"pcid"`
	State          string                            `json:"state"`

	PendingCandidatesCount uint64 `json:"pendingCandidatesCount"`

	HasQueuedNegotiation bool `json:"hasQueuedNegotiation"`
	IsNegotiating        bool `json:"isNegotiating"`

	GUID string `json:"guid"`

	Tracks    map[uint32]interface{} `json:"tracks"`
	Senders   map[uint32]interface{} `json:"senders"`
	Receivers map[uint32]interface{} `json:"receivers"`
	Pending   map[uint32]interface{} `json:"pending"`

	RTPPayloadTypes map[string]uint8 `json:"rtpPayloadTypes"`

	JitterBuffer interface{} `json:"jitterBuffer"`

	P2p *P2PControllerResource `json:"p2p"`
}

func NewP2PRecordResource added in v0.1.0

func NewP2PRecordResource(key string, p2pRecord *P2PRecord) *P2PRecordResource

type PeerConnection added in v0.0.5

type PeerConnection struct {
	*webrtc.PeerConnection
	// contains filtered or unexported fields
}

func NewPeerConnection added in v0.0.5

func NewPeerConnection(api *webrtc.API, configuration *webrtc.Configuration) (*PeerConnection, error)

func (*PeerConnection) ID added in v0.0.5

func (pc *PeerConnection) ID() string

type RTCPRecord added in v0.0.2

type RTCPRecord struct {
	// contains filtered or unexported fields
}

type RTMChannelSFU

type RTMChannelSFU struct {
	deadlock.RWMutex
	// contains filtered or unexported fields
}

func (*RTMChannelSFU) Bridge added in v0.0.5

func (sfu *RTMChannelSFU) Bridge() string

func (*RTMChannelSFU) Close

func (sfu *RTMChannelSFU) Close() error

func (*RTMChannelSFU) HTTPChannelHandler added in v0.0.5

func (sfu *RTMChannelSFU) HTTPChannelHandler(rw http.ResponseWriter, req *http.Request)

func (*RTMChannelSFU) HTTPChannelUsersHandler added in v0.0.5

func (sfu *RTMChannelSFU) HTTPChannelUsersHandler(rw http.ResponseWriter, req *http.Request)

func (*RTMChannelSFU) HTTPRootHandler added in v0.0.5

func (sfu *RTMChannelSFU) HTTPRootHandler(rw http.ResponseWriter, req *http.Request)

func (*RTMChannelSFU) ServeHTTP added in v0.0.5

func (sfu *RTMChannelSFU) ServeHTTP(rw http.ResponseWriter, req *http.Request)

func (*RTMChannelSFU) Start

func (sfu *RTMChannelSFU) Start(ctx context.Context) error

func (*RTMChannelSFU) Summary added in v0.0.5

func (sfu *RTMChannelSFU) Summary() interface{}

type RootResource added in v0.0.5

type RootResource struct {
	HasChannel bool        `json:"hasChannel"`
	Summary    interface{} `json:"summary"`
}

type StreamRecord added in v0.1.0

type StreamRecord struct {
	deadlock.RWMutex
	// contains filtered or unexported fields
}

func NewStreamRecord added in v0.1.0

func NewStreamRecord(controller *P2PController) *StreamRecord

type StreamRecordResource added in v0.1.0

type StreamRecordResource struct {
	Key string `json:"key"`

	Connection *P2PRecordResource `json:"connection"`

	ID    string `json:"id"`
	Kind  string `json:"kind"`
	Token string `json:"token"`
}

func NewStreamRecordResource added in v0.1.0

func NewStreamRecordResource(key string, streamRecord *StreamRecord) *StreamRecordResource

type TrackRecord

type TrackRecord struct {
	// contains filtered or unexported fields
}

type UserRecord

type UserRecord struct {
	// contains filtered or unexported fields
}

func NewUserRecord added in v0.0.2

func NewUserRecord(channel *Channel, id string) *UserRecord

Jump to

Keyboard shortcuts

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