Module native_buffer

Source
Available on crate feature native_buffer only.
Expand description

Native Buffer bindings

The native buffer module provides APIs that you can use to apply for, use, and release the shared memory, and query memory properties. The following scenario is common for native buffer development: Use the native buffer APIs to create an OH_NativeBuffer instance, obtain memory properties, and map the corresponding ION memory to the process address space.

Source:

English Documentation Chinese Documentation

Structs§

OH_NativeBuffer
OH_NativeBuffer_ColorGamutapi-12
Indicates the color gamut of a native buffer.
OH_NativeBuffer_ColorSpace
OH_NativeBuffer_ColorXY
OH_NativeBuffer_Config
OH_NativeBuffer config.
OH_NativeBuffer_Cta861
OH_NativeBuffer_Format
Indicates the format of a native buffer.
OH_NativeBuffer_MetadataKey
OH_NativeBuffer_MetadataType
OH_NativeBuffer_Planeapi-12
Holds info for a single image plane.
OH_NativeBuffer_Planesapi-12
Holds all image planes.
OH_NativeBuffer_Smpte2086
OH_NativeBuffer_StaticMetadata
OH_NativeBuffer_TransformTypeapi-12
Indicates the transform type of a native buffer.
OH_NativeBuffer_Usage
Indicates the usage of a native buffer.

Functions§

OH_NativeBuffer_Alloc
Alloc a OH_NativeBuffer that matches the passed BufferRequestConfig.
OH_NativeBuffer_FromNativeWindowBufferapi-12
Converts an OHNativeWindowBuffer instance to an OH_NativeBuffer.
OH_NativeBuffer_GetColorSpaceapi-12
Get the color space of the OH_NativeBuffer.
OH_NativeBuffer_GetConfig
Return a config of the OH_NativeBuffer in the passed OHNativeBufferConfig struct.
OH_NativeBuffer_GetMetadataValueapi-12
Set the metadata type of the OH_NativeBuffer.
OH_NativeBuffer_GetSeqNum
Get the systen wide unique sequence number of the OH_NativeBuffer.
OH_NativeBuffer_Map
Provide direct cpu access to the OH_NativeBuffer in the process’s address space.
OH_NativeBuffer_MapPlanesapi-12
Provide direct cpu access to the potentially multi-plannar OH_NativeBuffer in the process’s address space.
OH_NativeBuffer_Reference
Adds the reference count of a OH_NativeBuffer.
OH_NativeBuffer_SetColorSpaceapi-11
Set the color space of the OH_NativeBuffer.
OH_NativeBuffer_SetMetadataValueapi-12
Set the metadata type of the OH_NativeBuffer.
OH_NativeBuffer_Unmap
Remove direct cpu access ability of the OH_NativeBuffer in the process’s address space.
OH_NativeBuffer_Unreference
Decreases the reference count of a OH_NativeBuffer and, when the reference count reaches 0, destroys this OH_NativeBuffer.