decoder

package
v0.0.0-...-ac6b29b Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2023 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PixelFormatRGB = avcodec.AV_PIX_FMT_RGB24
	PixelFormatBGR = av_PIX_FMT_BGR24
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Compression

type Compression int

type Decoder

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

func New

func New(pxlFmt PixelFormat, cpr Compression) (*Decoder, error)

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

func (*Decoder) Close

func (h *Decoder) Close()

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

func (*Decoder) Decode

func (h *Decoder) 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/H.265 frames the list will be empty

type Frame

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

Frame represents decoded frame from H.264/H.265 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 PixelFormat

type PixelFormat int

Jump to

Keyboard shortcuts

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