elements

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeMetadata = 100
	TypeBinary   = 101
	TypeRGB24    = 102
	TypeWebM     = 103
	TypeYCbCr    = 104
	TypeJPEG     = 105
	TypeRGBA     = 106
)

Types for samples

Variables

View Source
var (
	// ErrAttachNotSupported returned when attaching elements is not supported
	ErrAttachNotSupported = errors.New("attach not supported")
	// ErrElementAlreadyAttached returned when attaching an element that is already attached
	ErrElementAlreadyAttached = errors.New("element already attached")
)

Functions

This section is empty.

Types

type Converter

type Converter struct {
	Node
	// contains filtered or unexported fields
}

Converter instance

func NewConverter

func NewConverter(typ int) *Converter

NewConverter instance. Converter converts between media types.

Currently supports:

  • YCbCR -> JPEG

func (*Converter) Write

func (c *Converter) Write(sample *avp.Sample) error

type FileWriter

type FileWriter struct {
	Leaf
	// contains filtered or unexported fields
}

FileWriter instance

func NewFileWriter

func NewFileWriter(path string) *FileWriter

NewFileWriter instance

func (*FileWriter) Write

func (w *FileWriter) Write(sample *avp.Sample) error

type Filter

type Filter struct {
	Node
	// contains filtered or unexported fields
}

Filter instance

func NewFilter

func NewFilter(condition func(*avp.Sample) bool) *Filter

NewFilter instance. Filter contitionally forwards a payload based on the return of the provided function.

func (*Filter) Write

func (f *Filter) Write(sample *avp.Sample) error

type Leaf

type Leaf struct{}

func (*Leaf) Attach

func (e *Leaf) Attach(el avp.Element)

func (*Leaf) Close

func (e *Leaf) Close()

func (*Leaf) Write

func (e *Leaf) Write(sample *avp.Sample) error

type Map

type Map struct {
	Node
	// contains filtered or unexported fields
}

Map instance

func NewMap

func NewMap(fn func(*avp.Sample) *avp.Sample) *Map

NewMap creates a new sample mapper which maps samples using the provided function

func (*Map) Write

func (m *Map) Write(sample *avp.Sample) error

type Node

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

func (*Node) Attach

func (e *Node) Attach(el avp.Element)

func (*Node) Close

func (e *Node) Close()

func (*Node) Write

func (e *Node) Write(sample *avp.Sample) error

type SampleWriter

type SampleWriter struct {
	Node
}

SampleWriter for writing samples

func NewSampleWriter

func NewSampleWriter() *SampleWriter

NewSampleWriter creates a new sample writer

func (*SampleWriter) Close

func (w *SampleWriter) Close() error

func (*SampleWriter) Write

func (w *SampleWriter) Write(p []byte) (n int, err error)

Write sample

type WebmSaver

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

WebmSaver Module for saving rtp streams to webm

func NewWebmSaver

func NewWebmSaver() *WebmSaver

NewWebmSaver Initialize a new webm saver

func (*WebmSaver) Attach

func (s *WebmSaver) Attach(e avp.Element)

Attach attach a child element

func (*WebmSaver) Close

func (s *WebmSaver) Close()

Close Close the WebmSaver

func (*WebmSaver) Write

func (s *WebmSaver) Write(sample *avp.Sample) error

Write sample to webmsaver

Jump to

Keyboard shortcuts

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