native_buffer.h

Overview

The native_buffer.h file declares the functions for obtaining and using NativeBuffer.

Since

9

Related Modules

OH_NativeBuffer

Summary

Structs

Name Description:
OH_NativeBuffer_Config Defines the OH_NativeBuffer attribute configuration, which is used when you apply for a new OH_NativeBuffer instance or query the attributes of an existing instance.

Types

Name Description:
OH_NativeBuffer Provides the declaration of an OH_NativeBuffer struct.

Enums

Name Description:
OH_NativeBuffer_Usage { NATIVEBUFFER_USAGE_CPU_READ = (1ULL << 0), NATIVEBUFFER_USAGE_CPU_WRITE = (1ULL << 1), NATIVEBUFFER_USAGE_MEM_DMA = (1ULL << 3) } Enumerates the OH_NativeBuffer usages.
OH_NativeBuffer_Format {
NATIVEBUFFER_PIXEL_FMT_RGB_565 = 3, NATIVEBUFFER_PIXEL_FMT_RGBA_5658, NATIVEBUFFER_PIXEL_FMT_RGBX_4444, NATIVEBUFFER_PIXEL_FMT_RGBA_4444,
NATIVEBUFFER_PIXEL_FMT_RGB_444, NATIVEBUFFER_PIXEL_FMT_RGBX_5551, NATIVEBUFFER_PIXEL_FMT_RGBA_5551, NATIVEBUFFER_PIXEL_FMT_RGB_555,
NATIVEBUFFER_PIXEL_FMT_RGBX_8888, NATIVEBUFFER_PIXEL_FMT_RGBA_8888, NATIVEBUFFER_PIXEL_FMT_RGB_888, NATIVEBUFFER_PIXEL_FMT_BGR_565,
NATIVEBUFFER_PIXEL_FMT_BGRX_4444, NATIVEBUFFER_PIXEL_FMT_BGRA_4444, NATIVEBUFFER_PIXEL_FMT_BGRX_5551, NATIVEBUFFER_PIXEL_FMT_BGRA_5551,
NATIVEBUFFER_PIXEL_FMT_BGRX_8888, NATIVEBUFFER_PIXEL_FMT_BGRA_8888, NATIVEBUFFER_PIXEL_FMT_BUTT = 0X7FFFFFFF
}
Enumerates the OH_NativeBuffer formats.

Functions

Name Description:
OH_NativeBuffer_Alloc (const OH_NativeBuffer_Config *config) Creates an OH_NativeBuffer instance based on an OH_NativeBuffer_Config struct. A new OH_NativeBuffer instance is created each time this function is called.
OH_NativeBuffer_Reference (OH_NativeBuffer *buffer) Increases the reference count of an OH_NativeBuffer instance by 1.
OH_NativeBuffer_Unreference (OH_NativeBuffer *buffer) Decreases the reference count of an OH_NativeBuffer instance by 1 and, when the reference count reaches 0, destroys the instance.
OH_NativeBuffer_GetConfig (OH_NativeBuffer *buffer, OH_NativeBuffer_Config *config) Obtains the attributes of an OH_NativeBuffer instance.
OH_NativeBuffer_Map (OH_NativeBuffer *buffer, void **virAddr) Maps the ION memory corresponding to an OH_NativeBuffer instance to the process address space.
OH_NativeBuffer_Unmap (OH_NativeBuffer *buffer) Unmaps the ION memory corresponding to an OH_NativeBuffer instance from the process address space.
OH_NativeBuffer_GetSeqNum (OH_NativeBuffer *buffer) Obtains the sequence number of an OH_NativeBuffer instance.