proto

package
v0.3.10 Latest Latest
Warning

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

Go to latest
Published: May 26, 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

	SFUTrickleICE   = ClientTrickleICE
	SFUStreamRemove = ClientOnStreamRemove

	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"`
}

type CloseMsg added in v0.3.5

type CloseMsg struct {
	LeaveMsg
}

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 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 string `json:"rid,omitempty"` //Room ID
	UID string `json:"uid,omitempty"` //User ID
	MID string `json:"mid,omitempty"` //Media ID
}

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 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"`
}

type PublishResponseMsg added in v0.3.5

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

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 string `json:"rid"`
	Uid string `json:"uid"`
}

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
}

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 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 string
	UID string
}

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