Documentation
¶
Overview ¶
Package gralloc provides gralloc buffer allocation via the Android IAllocator HAL service.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Buffer ¶
type Buffer struct {
Handle common.NativeHandle
Stride int32
Width uint32
Height uint32
Format int32
Usage uint64
// MmapData holds a persistent mmap of the dmabuf, set by Mmap().
// Keeping it mapped avoids mmap/munmap syscalls per frame read.
MmapData []byte
}
Buffer holds a gralloc-allocated buffer with its NativeHandle.
func Allocate ¶
func Allocate( ctx context.Context, sm *servicemanager.ServiceManager, width int32, height int32, format gfxCommon.PixelFormat, usage gfxCommon.BufferUsage, ) (*Buffer, error)
Allocate allocates a gralloc buffer using the IAllocator HAL service. The returned Buffer contains a dmabuf FD that can be mmap'd for CPU read access.
Click to show internal directories.
Click to hide internal directories.