bridge

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2026 License: CC0-1.0 Imports: 4 Imported by: 0

Documentation

Overview

Package bridge provides typed Go wrappers around the gralloc_bridge.so C functions. It is the only package that imports purego or handles raw FFI concerns.

Analogous to kernelbinder/ioctl.go which wraps raw ioctls behind typed Go functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Free

func Free(h BufferHandle)

Free releases an imported buffer handle.

func LockGeneric

func LockGeneric(h BufferHandle, width, height int32, bufSize int) ([]byte, error)

LockGeneric locks a buffer for CPU read and copies the pixel data into a Go byte slice. The buffer is unlocked before returning.

func LockYCbCr

func LockYCbCr(h BufferHandle, width, height int32) ([]byte, error)

LockYCbCr locks a YCbCr buffer for CPU read and copies all three planes (Y, Cb, Cr) into a Go byte slice. The buffer is unlocked before returning.

func Open

func Open() error

Open loads the gralloc_bridge.so and initializes the HIDL IMapper. Safe to call multiple times; the .so is loaded only once.

Types

type BufferHandle

type BufferHandle uintptr

BufferHandle is an opaque reference to an imported gralloc buffer.

func ImportBuffer

func ImportBuffer(fds []int32, ints []int32) (BufferHandle, error)

ImportBuffer imports a raw gralloc buffer handle. The returned BufferHandle must be released with Free when no longer needed.

Jump to

Keyboard shortcuts

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