Documentation
¶
Overview ¶
Package vt drives Apple VideoToolbox hardware HEVC encode and decode through purego, with no cgo. Output and decode callbacks arrive on VideoToolbox's own threads and hand off to Go over channels.
Index ¶
Constants ¶
const ( PixelBGRA = 0x42475241 // 'BGRA' Pixel420v = 0x34323076 // '420v' NV12 video range PixelX420 = 0x78343230 // 'x420' 10-bit 4:2:0 video range (P010 layout) PixelL10r = 0x6c313072 // 'l10r' ARGB 2:10:10:10 little endian )
Variables ¶
This section is empty.
Functions ¶
func FillPixelBuffer ¶
FillPixelBuffer copies tightly packed planes into the buffer, row by row.
func HardwareDecode ¶
func HardwareDecode() bool
HardwareDecode reports whether the GPU decodes HEVC.
Types ¶
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder is a hardware HEVC decompression session.
func NewDecoder ¶
NewDecoder opens a hardware decoder for the format of an encoded sample.
type Encoder ¶
type Encoder struct {
// Keep is set by callers that want the CMSampleBuffer of the last packet
// (to feed a decoder); they release it.
Keep bool
LastSample uintptr
LastDone int64
LowLatency bool
// contains filtered or unexported fields
}
func Open ¶
Open creates a hardware HEVC compression session. 4:4:4 is refused: Apple silicon exposes HEVC 4:2:0 and 4:2:2 only. Frames passed to Encode are CVPixelBuffers backed by IOSurfaces.