decoder

package module
v0.0.0-...-85b3b2b Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorFormat

type ColorFormat int
const (
	ColorRGBA ColorFormat = iota
	ColorBGRA
)

type DecodedImage

type DecodedImage interface {
	IsKeyFrame() bool
	Width() uint32
	Height() uint32
	Plane(n int) []byte
	Stride(n int) int
	ToBytes(format ColorFormat) []byte
	ToRGBA() *image.RGBA
}

DecodedImage defines interface for images which decoded by encoded video frame.

type Decoder

type Decoder interface {
	NewFrameBuilder() *FrameBuilder
	Process(src <-chan *Frame, out chan<- DecodedImage)
	Close() error
}

type Frame

type Frame struct {
	Packets   []interface{}
	Timestamp uint32
}

type FrameBuilder

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

FrameBuilder contains all packets maxLate determines how long we should wait until we get a valid Frame The larger the value the less packet loss you will see, but higher latency

This is customized version of Pion's sample builder https://github.com/pion/webrtc/blob/master/pkg/media/samplebuilder/samplebuilder.go

func NewFrameBuilder

func NewFrameBuilder(maxLate uint16, depacketizer rtp.Depacketizer, checker rtp.PartitionHeadChecker, opts ...Option) *FrameBuilder

NewFrameBuilder constructs a new FrameBuilder

func (*FrameBuilder) Pop

func (s *FrameBuilder) Pop() *Frame

Pop scans buffer for valid samples, returns nil when no valid samples have been found

func (*FrameBuilder) PopWithTimestamp

func (s *FrameBuilder) PopWithTimestamp() *Frame

PopWithTimestamp scans buffer for valid samples and its RTP timestamp, returns nil, 0 when no valid samples have been found

func (*FrameBuilder) Push

func (s *FrameBuilder) Push(p *rtp.Packet)

Push adds a RTP Packet to the FrameBuilder

type Option

type Option func(o *FrameBuilder)

Option configures FrameBuilder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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