rtc

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package rtc consists of a RTC to fetch tracks from other SFU

Index

Constants

This section is empty.

Variables

Functions

func TrackSame

func TrackSame(t1 *pb.Subscription, t2 *webrtc.TrackRemote) bool

Types

type RTC

type RTC struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewRTC

func NewRTC(peer UpPeerLocal, signaller rtc.RTC_SignalClient) *RTC

func (*RTC) GetSubStats

func (r *RTC) GetSubStats() webrtc.StatsReport

GetSubStats get sub stats

func (*RTC) Run

func (r *RTC) Run(remoteSid, localSid string) error

Run start a rtc from remote session to local session

func (*RTC) SendAnswer

func (r *RTC) SendAnswer(sdp webrtc.SessionDescription) error

func (*RTC) SendJoin

func (r *RTC) SendJoin(sid string, uid string) error

func (*RTC) SendTrickle

func (r *RTC) SendTrickle(candidate *webrtc.ICECandidate, target Target) error

func (*RTC) SendTrickleInit

func (r *RTC) SendTrickleInit(candidate webrtc.ICECandidateInit, target Target) error

func (*RTC) Subscribe

func (r *RTC) Subscribe(trackInfos []*Subscription) error

Subscribe to tracks

func (*RTC) Update

func (r *RTC) Update(tracks []*pb.Subscription) error

type Subscription

type Subscription struct {
	TrackId   string
	Mute      bool
	Subscribe bool
	Layer     string
}

type Target

type Target int32
const (
	Target_PUBLISHER  Target = 0
	Target_SUBSCRIBER Target = 1
)

type UpPeerLocal

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

UpPeerLocal is a local peer that only have up tracks (tracks from other nodes)

func NewUpPeerLocal

func NewUpPeerLocal(peer *ion_sfu.PeerLocal) UpPeerLocal

func (*UpPeerLocal) AddICECandidate

func (p *UpPeerLocal) AddICECandidate(candidate webrtc.ICECandidateInit) error

func (*UpPeerLocal) Answer

func (p *UpPeerLocal) Answer(desc webrtc.SessionDescription) (*webrtc.SessionDescription, error)

func (*UpPeerLocal) Close

func (p *UpPeerLocal) Close() error

func (*UpPeerLocal) GetStats

func (p *UpPeerLocal) GetStats() webrtc.StatsReport

func (*UpPeerLocal) Join

func (p *UpPeerLocal) Join(sid string) error

Join the up track peer join a session, with the option NoPublish = false and NoSubscribe = true

func (*UpPeerLocal) OnICECandidate

func (p *UpPeerLocal) OnICECandidate(f func(c *webrtc.ICECandidateInit))

Jump to

Keyboard shortcuts

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