algorithms

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: 4 Imported by: 0

Documentation

Overview

Package algorithms contains the algorithms for node selection

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Algorithm

type Algorithm interface {

	// UpdateSFUStatus tell the algorithm that the SFU graph and the computation and communication quality has changed
	// `current` is the changed SFU's current status
	// `reports` is a series of Quality Report
	// `expected` is that which SFU's status should change
	UpdateSFUStatus(current []*pb.SFUStatus, reports []*pb.QualityReport) (expected []*pb.SFUStatus)
}

Algorithm is the node selection algorithm interface

type AtomReport

type AtomReport interface{}

type Processor

type Processor interface {

	// Init set the AddTrack, RemoveTrack and OnBroken func and init the output track from Processor
	// Should be NON-BLOCK!
	// after you created a new track, please call AddTrack
	// before you close a track, please call RemoveTrack
	// when occurred error, please call OnBroken
	Init(
		AddTrack func(webrtc.TrackLocal) (*webrtc.RTPSender, error),
		RemoveTrack func(*webrtc.RTPSender) error,
		OnBroken func(badGay error),
	) error

	// AddInTrack add a input track to Processor
	// Will be called AFTER InitOutTrack!
	// read video from `remote` process it and write the result to the output track
	// r/w should stop when error occurred
	// Should be NON-BLOCK!
	AddInTrack(SID string, remote *webrtc.TrackRemote, receiver *webrtc.RTPReceiver) error

	// UpdateProcedure update the procedure in the Processor
	UpdateProcedure(procedure *pb.ProceedTrack) error
}

Processor is a processor that can process webrtc.TrackRemote and output webrtc.TrackLocal MULTI-THREAD access!!! Should implemented in THREAD-SAFE!!!

type ProcessorFactory

type ProcessorFactory interface {
	NewProcessor() (Processor, error)
}

type ReportGathererBuilder

type ReportGathererBuilder interface {
	// NewGatherer : get SessionReport from i and put TransmissionReport to o
	NewGatherer(src, dst *ion.Node, i <-chan SessionReport, o chan<- *pb.TransmissionReport)
}

ReportGathererBuilder : How to analysis SessionReport and give TransmissionReport?

type ReporterInterceptor

type ReporterInterceptor interface {
	interceptor.Interceptor

	// BindReportChannel : put report to o
	BindReportChannel(o chan<- AtomReport)
}

ReporterInterceptor : How to analysis the RTP/RTCP packet and give report?

type ReporterInterceptorFactory

type ReporterInterceptorFactory interface {
	NewInterceptor(id string) (ReporterInterceptor, error)
}

ReporterInterceptorFactory just a interceptor.Factory for ReporterInterceptor

type SessionReport

type SessionReport struct {
	SID, UID string
	Report   AtomReport
}

Directories

Path Synopsis
impl

Jump to

Keyboard shortcuts

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