Skip to main content

OH_NativeBuffer_MapAndGetConfig

Function OH_NativeBuffer_MapAndGetConfig 

Source
pub unsafe extern "C" fn OH_NativeBuffer_MapAndGetConfig(
    buffer: *mut OH_NativeBuffer,
    virAddr: *mut *mut c_void,
    config: *mut OH_NativeBuffer_Config,
) -> i32
Available on crate features native_buffer and api-23 only.
Expand description

Provide direct cpu access to the OH_NativeBuffer in the process’s address space,

and return a NativeBufferConfig of the OH_NativeBuffer. This interface is a non-thread-safe type interface.

Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeBuffer

§Arguments

  • buffer - Indicates the pointer to a OH_NativeBuffer instance.

  • virAddr - Indicates the address of the OH_NativeBuffer in virtual memory.

  • config - Indicates the pointer to the NativeBufferConfig of the buffer.

§Returns

  • [NATIVE_ERROR_OK] 0 - Success. [NATIVE_ERROR_INVALID_ARGUMENTS] 40001000 - buffer or virAddr or config is NULL or invalid fenceFd. [NATIVE_ERROR_UNKNOWN] 50002000 - map failed.

Available since API-level: 23

Version: 1.0