decoder

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2020 License: BSD-3-Clause Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	PixelFormatRGB = iota
	PixelFormatBGR
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Frame

type Frame struct {
	Data                  []byte
	Width, Height, Stride int
}

Frame represents decoded frame from H.264 stream Data field will contain bitmap data in the pixel format specified in the decoder

func (*Frame) ToRGB

func (f *Frame) ToRGB() *rgb.Image

ToRGBA converts the frame into image.RGBA The returned image share the same memory as the frame

type H264Decoder

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

func New

func New(pxlFmt PixelFormat) (*H264Decoder, error)

New creates new H264Decoder It accepts expected pixel format for the output which

func (*H264Decoder) Close

func (h *H264Decoder) Close()

Close free ups memory used for decoder structures It needs to be called to prevent memory leaks

func (*H264Decoder) Decode

func (h *H264Decoder) Decode(data []byte) ([]*Frame, error)

Decode tries to parse the input data and return list of frames If input data doesn't contain any H.264 frames the list will be empty

type PixelFormat

type PixelFormat int

Jump to

Keyboard shortcuts

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