samples

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeOpus  = 111
	TypeVP8   = 96
	TypeVP9   = 98
	TypeH264  = 102
	TypeRGB24 = 200
)

Types for samples

Variables

View Source
var (
	// ErrCodecNotSupported is returned when a rtp packed it pushed with an unsupported codec
	ErrCodecNotSupported = errors.New("codec not supported")
)

Functions

This section is empty.

Types

type Builder

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

Builder Module for building video/audio samples from rtp streams

func NewBuilder

func NewBuilder(config BuilderConfig) *Builder

NewBuilder Initialize a new sample builder

func (*Builder) ID

func (s *Builder) ID() string

ID Builder id

func (*Builder) Read

func (s *Builder) Read() *Sample

Read sample

func (*Builder) Stop

func (s *Builder) Stop()

Stop stop all buffer

func (*Builder) WriteRTP

func (s *Builder) WriteRTP(pkt *rtp.Packet) error

WriteRTP Write RTP packet to Builder

type BuilderConfig

type BuilderConfig struct {
	ID           string
	On           bool
	AudioMaxLate uint16
	VideoMaxLate uint16
}

BuilderConfig .

type Sample

type Sample struct {
	Type           int
	Timestamp      uint32
	SequenceNumber uint16
	Properties     map[string]interface{}
	Payload        []byte
}

Sample of audio or video

Jump to

Keyboard shortcuts

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