proto

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: MIT Imports: 4 Imported by: 10

Documentation

Index

Constants

View Source
const (
	// client to ion
	ClientLogin       = "login"
	ClientJoin        = "join"
	ClientLeave       = "leave"
	ClientPublish     = "publish"
	ClientUnPublish   = "unpublish"
	ClientSubscribe   = "subscribe"
	ClientUnSubscribe = "unsubscribe"
	ClientClose       = "close"
	ClientBroadcast   = "broadcast"
	ClientTrickleICE  = "trickle"

	// ion to client
	ClientOnJoin         = "peer-join"
	ClientOnLeave        = "peer-leave"
	ClientOnStreamAdd    = "stream-add"
	ClientOnStreamRemove = "stream-remove"

	// ion to islb
	IslbFindService  = "findService"
	IslbGetPubs      = "getPubs"
	IslbGetMediaInfo = "getMediaInfo"
	IslbRelay        = "relay"
	IslbUnrelay      = "unRelay"

	IslbKeepAlive      = "keepAlive"
	IslbClientOnJoin   = ClientOnJoin
	IslbClientOnLeave  = ClientOnLeave
	IslbOnStreamAdd    = ClientOnStreamAdd
	IslbOnStreamRemove = ClientOnStreamRemove
	IslbOnBroadcast    = ClientBroadcast

	// SFU Endpoints
	SFUTrickleICE   = ClientTrickleICE
	SFUStreamRemove = ClientOnStreamRemove

	// AVPProcess enables an audio/video processor
	AVPProcess = "process"
	// AVPUnprocess disables an audio/video processor
	AVPUnprocess = "unprocess"

	IslbID = "islb"
)

Variables

This section is empty.

Functions

func GetPubMediaPath

func GetPubMediaPath(rid, mid string, ssrc uint32) string

func GetPubMediaPathKey

func GetPubMediaPathKey(rid string) string

func GetPubNodePath

func GetPubNodePath(rid, uid string) string

func MarshalNodeField added in v0.2.0

func MarshalNodeField(node NodeInfo) (string, string, error)

func MarshalTrackField added in v0.2.0

func MarshalTrackField(id string, infos []TrackInfo) (string, string, error)

func UnmarshalTrackField added in v0.2.0

func UnmarshalTrackField(key string, value string) (string, *[]TrackInfo, error)

Types

type BroadcastMsg added in v0.3.5

type BroadcastMsg struct {
	RoomInfo
	Info json.RawMessage `json:"info"`
}

type ClientUserInfo added in v0.3.5

type ClientUserInfo struct {
	Name string `json:"name"`
}

func (*ClientUserInfo) MarshalBinary added in v0.4.5

func (m *ClientUserInfo) MarshalBinary() ([]byte, error)

func (*ClientUserInfo) UnmarshalBinary added in v0.4.5

func (m *ClientUserInfo) UnmarshalBinary(data []byte) error

type CloseMsg added in v0.3.5

type CloseMsg struct {
	LeaveMsg
}

type ElementInfo added in v0.4.1

type ElementInfo struct {
	MID    string          `json:"mid"`
	RID    string          `json:"rid"`
	Type   string          `json:"type"`
	Config json.RawMessage `json:"config"`
}

ElementInfo describes an a/v process

type FindServiceParams added in v0.4.5

type FindServiceParams struct {
	Service string
	MID     MID
}

type GetMediaParams added in v0.4.5

type GetMediaParams struct {
	RID RID
	MID MID
}

type GetPubResp added in v0.4.5

type GetPubResp struct {
	RoomInfo
	Pubs []PubInfo
}

type GetSFURPCParams added in v0.4.5

type GetSFURPCParams struct {
	RPCID   string
	EventID string
	ID      string
	Name    string
	Service string
}

type JoinMsg added in v0.3.5

type JoinMsg struct {
	RoomInfo
	Info ClientUserInfo `json:"info"`
}

type LeaveMsg added in v0.3.5

type LeaveMsg struct {
	RoomInfo
	Info ClientUserInfo `json:"info"`
}

type LoginMsg added in v0.3.5

type LoginMsg struct {
}

type MID added in v0.4.5

type MID string

type MediaInfo added in v0.2.0

type MediaInfo struct {
	DC  string `json:"dc,omitempty"`  //Data Center ID
	NID string `json:"nid,omitempty"` //Node ID
	RID RID    `json:"rid,omitempty"` //Room ID
	UID UID    `json:"uid,omitempty"` //User ID
	MID MID    `json:"mid,omitempty"` //Media ID
}

media dc/${nid}/${rid}/${uid}/media/pub/${mid}

node1 origin node2 shadow msid [{ssrc: 1234, pt: 111, type:audio}] msid [{ssrc: 5678, pt: 96, type:video}]

func ParseMediaInfo added in v0.2.0

func ParseMediaInfo(key string) (*MediaInfo, error)

Parse dc1/sfu-tU2GInE5Lfuc/7485294b-9815-4888-83a5-631e77445b67/room1/media/pub/7e97c1e8-c80a-4c69-81b0-27efc83e6120

func (MediaInfo) BuildKey added in v0.3.5

func (m MediaInfo) BuildKey() string

type NodeInfo added in v0.2.0

type NodeInfo struct {
	Name string `json:"name"`
	ID   string `json:"id"`
	Type string `json:"type"` // origin | shadow
}

func UnmarshalNodeField added in v0.2.0

func UnmarshalNodeField(key string, value string) (*NodeInfo, error)

type PubInfo added in v0.4.5

type PubInfo struct {
	MediaInfo
	Info   ClientUserInfo `json:"info"`
	Tracks TrackMap       `json:"tracks"`
}

type PublishMsg added in v0.3.5

type PublishMsg struct {
	RoomInfo
	RTCInfo
	Options PublishOptions `json:"options"`
}

type PublishOptions added in v0.3.5

type PublishOptions struct {
	Codec       string `json:"codec"`
	Resolution  string `json:"resolution"`
	Bandwidth   int    `json:"bandwidth"`
	Audio       bool   `json:"audio"`
	Video       bool   `json:"video"`
	Screen      bool   `json:"screen"`
	TransportCC bool   `json:"transportCC,omitempty"`
}

type PublishResponseMsg added in v0.3.5

type PublishResponseMsg struct {
	MediaInfo
	RTCInfo
	Tracks TrackMap `json:"tracks"`
}

type RID added in v0.4.5

type RID string

type RTCInfo added in v0.3.5

type RTCInfo struct {
	Jsep webrtc.SessionDescription `json:"jsep"`
}

type RoomInfo added in v0.3.5

type RoomInfo struct {
	RID RID `json:"rid"`
	UID UID `json:"uid"`
}

type SFUSubscribeMsg added in v0.4.5

type SFUSubscribeMsg struct {
	SubscribeMsg
	Tracks TrackMap `json:"tracks"`
}

type StreamAddMsg added in v0.3.5

type StreamAddMsg struct {
	MediaInfo
	Info   ClientUserInfo `json:"info"`
	Tracks TrackMap       `json:"tracks"`
}

type StreamRemoveMsg added in v0.3.5

type StreamRemoveMsg struct {
	MediaInfo
}

type SubscribeMsg added in v0.3.5

type SubscribeMsg struct {
	MediaInfo
	RTCInfo
	Options SubscribeOptions
}

type SubscribeOptions added in v0.4.5

type SubscribeOptions struct {
	Bandwidth   int  `json:"bandwidth"`
	TransportCC bool `json:"transportCC"`
}

type SubscribeResponseMsg added in v0.3.5

type SubscribeResponseMsg struct {
	MediaInfo
	RTCInfo
}

type TrackInfo added in v0.2.0

type TrackInfo struct {
	ID      string `json:"id"`
	Ssrc    int    `json:"ssrc"`
	Payload int    `json:"pt"`
	Type    string `json:"type"`
	Codec   string `json:"codec"`
	Fmtp    string `json:"fmtp"`
}

type TrackMap added in v0.3.5

type TrackMap map[string][]TrackInfo

type TrickleMsg added in v0.3.5

type TrickleMsg struct {
	MediaInfo
	Info    json.RawMessage `json:"info"`
	Trickle json.RawMessage `json:"trickle"`
}

type UID added in v0.4.5

type UID string

type UnpublishMsg added in v0.3.5

type UnpublishMsg struct {
	MediaInfo
}

type UnsubscribeMsg added in v0.3.5

type UnsubscribeMsg struct {
	MediaInfo
}

type UserInfo added in v0.2.0

type UserInfo struct {
	DC  string
	RID RID
	UID UID
}

func ParseUserInfo added in v0.2.0

func ParseUserInfo(key string) (*UserInfo, error)

func (UserInfo) BuildKey added in v0.3.5

func (u UserInfo) BuildKey() string

Jump to

Keyboard shortcuts

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