formats-usage

command
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Hardware buffer formats and usage flags overview.

Enumerates every AHardwareBuffer pixel format with its String() representation, then shows how to combine Usage flags with bitwise OR to describe the intended access pattern for a buffer.

AHardwareBuffer is Android's cross-process, cross-API buffer primitive. It enables zero-copy sharing of pixel and blob data between the CPU, GPU (OpenGL ES / Vulkan), hardware composer, camera, and codec pipelines. A single buffer can be written by the GPU and read by the CPU (or vice-versa) without an intermediate copy, provided the correct Usage flags are set at allocation time.

This program exercises only the type system (Format, Usage, AHardwareBuffer_Desc); it does not call Allocate, so it compiles and runs on any host for demonstration purposes.

Jump to

Keyboard shortcuts

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