avp

package
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: MIT Imports: 13 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(r *Registry)

Init avp with a registry of elements

Types

type AVP

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

AVP represents an avp instance

func NewAVP

func NewAVP(c Config) *AVP

NewAVP creates a new avp instance

func (*AVP) Process

func (a *AVP) Process(ctx context.Context, addr, pid, sid, tid, eid string)

Process starts a process for a track.

type Config

type Config struct {
	Log           log.Config    `mapstructure:"log"`
	Pipeline      pipeline      `mapstructure:"pipeline"`
	SampleBuilder samplebuilder `mapstructure:"samplebuilder"`
	WebRTC        webrtcconf    `mapstructure:"webrtc"`
}

Config for base AVP

type Element

type Element interface {
	ID() string
	Write(*samples.Sample) error
	Attach(Element) error
	Read() <-chan *samples.Sample
	Close()
}

Element interface

type Pipeline

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

Pipeline constructs a processing graph

+--->elementCh--->element
|

builder--+--->elementCh--->element

|
+--->elementCh--->element

func NewPipeline

func NewPipeline(e Element) *Pipeline

NewPipeline return a new Pipeline

func (*Pipeline) AddTrack

func (p *Pipeline) AddTrack(builder *samples.Builder)

AddTrack to pipeline

func (*Pipeline) Stop

func (p *Pipeline) Stop()

Stop a pipeline

type Registry

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

Registry provides a registry of elements

func NewRegistry

func NewRegistry() *Registry

NewRegistry returns new registry instance

func (*Registry) AddElement

func (r *Registry) AddElement(eid string, f func(sid, pid, tid string) Element)

AddElement to registry

func (*Registry) GetElement

func (r *Registry) GetElement(id string) func(string, string, string) Element

GetElement to registry

type WebRTCTransport

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

WebRTCTransport represents a webrtc transport

func NewWebRTCTransport

func NewWebRTCTransport(id string, cfg WebRTCTransportConfig) *WebRTCTransport

NewWebRTCTransport creates a new webrtc transport

func (*WebRTCTransport) AddICECandidate

func (t *WebRTCTransport) AddICECandidate(candidate webrtc.ICECandidateInit) error

AddICECandidate accepts an ICE candidate string and adds it to the existing set of candidates

func (*WebRTCTransport) CreateAnswer

func (t *WebRTCTransport) CreateAnswer() (webrtc.SessionDescription, error)

CreateAnswer starts the PeerConnection and generates the localDescription

func (*WebRTCTransport) CreateOffer

func (t *WebRTCTransport) CreateOffer() (webrtc.SessionDescription, error)

CreateOffer starts the PeerConnection and generates the localDescription

func (*WebRTCTransport) OnICECandidate

func (t *WebRTCTransport) OnICECandidate(f func(c *webrtc.ICECandidate))

OnICECandidate sets an event handler which is invoked when a new ICE candidate is found. Take note that the handler is gonna be called with a nil pointer when gathering is finished.

func (*WebRTCTransport) Process

func (t *WebRTCTransport) Process(pid, tid, eid string)

Process creates a pipeline

func (*WebRTCTransport) SetLocalDescription

func (t *WebRTCTransport) SetLocalDescription(desc webrtc.SessionDescription) error

SetLocalDescription sets the SessionDescription of the local peer

func (*WebRTCTransport) SetRemoteDescription

func (t *WebRTCTransport) SetRemoteDescription(desc webrtc.SessionDescription) error

SetRemoteDescription sets the SessionDescription of the remote peer

type WebRTCTransportConfig added in v0.0.4

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

WebRTCTransportConfig represents configuration options

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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