ftl

package
v0.0.0-...-bb59fc0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: MIT Imports: 18 Imported by: 0

README

FTL Protocol

Reimplementation of the ftl-sdk published by Microsoft.

Not complete.

Documentation

Index

Constants

View Source
const (
	DefaultPort  = 8084
	VersionMajor = 0
	VersionMinor = 2
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Callbacks

type Callbacks struct {
	OnStreamStart func(channelID int, streamID int)
}

type ChannelID

type ChannelID uint32

Custom Types

type Conn

type Conn struct {
	AssignedMediaPort int

	MediaAddr *net.UDPAddr
	MediaConn *net.UDPConn
	// contains filtered or unexported fields
}

func Dial

func Dial(targetHostname string, ftlPort int, channelID ChannelID, streamKey []byte) (conn *Conn, err error)

func (*Conn) Close

func (conn *Conn) Close() error

func (*Conn) Heartbeat

func (conn *Conn) Heartbeat() error

type FtlConnection

type FtlConnection struct {
	Connected bool
	Callbacks Callbacks

	Metadata *FtlConnectionMetadata
	// contains filtered or unexported fields
}

func (*FtlConnection) Disconnect

func (conn *FtlConnection) Disconnect() error

func (*FtlConnection) ProcessCommand

func (conn *FtlConnection) ProcessCommand(command string)

func (*FtlConnection) SendMessage

func (conn *FtlConnection) SendMessage(message string) error

type FtlConnectionMetadata

type FtlConnectionMetadata struct {
	ProtocolVersion string
	VendorName      string
	VendorVersion   string

	HasVideo         bool
	VideoCodec       string
	VideoHeight      uint
	VideoWidth       uint
	VideoPayloadType uint
	VideoIngestSsrc  uint

	HasAudio         bool
	AudioCodec       string
	AudioPayloadType uint
	AudioIngestSsrc  uint
}

type Manager

type Manager struct {
	Clients map[int]*FtlConnection
}

func NewManager

func NewManager() *Manager

func (*Manager) AddChannel

func (manager *Manager) AddChannel(channelId int, ftlConn *FtlConnection)

func (*Manager) Listen

func (manager *Manager) Listen(callbacks Callbacks)

func (*Manager) WatchChannel

func (manager *Manager) WatchChannel(channelId int) (*webrtc.TrackLocalStaticRTP, *webrtc.TrackLocalStaticRTP, error)

type MediaConnection

type MediaConnection struct {
	Connected bool
	ChannelId int
	StreamId  int

	// RTP Packet Payload Type
	VideoPayloadType uint8
	VideoIngestSsrc  uint
	// RTP Packet Payload Type
	AudioPayloadType uint8
	AudioIngestSsrc  uint
	// contains filtered or unexported fields
}

func (*MediaConnection) Close

func (conn *MediaConnection) Close() error

func (*MediaConnection) Listen

func (conn *MediaConnection) Listen() error

type StreamID

type StreamID uint32

Jump to

Keyboard shortcuts

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