ohos_vsync_sys

Function OH_NativeVSync_RequestFrame

Source
pub unsafe extern "C" fn OH_NativeVSync_RequestFrame(
    nativeVsync: *mut OH_NativeVSync,
    callback: OH_NativeVSync_FrameCallback,
    data: *mut c_void,
) -> c_int
Expand description

Request next vsync with callback. If you call this interface multiple times in one frame, it will only call the last callback.

Required System Capabilities: SystemCapability.Graphic.Graphic2D.NativeVsync

§Arguments

nativeVsync - Indicates the pointer to a NativeVsync.

callback - Indicates the OH_NativeVSync_FrameCallback which will be called when next vsync coming.

data - Indicates data which will be used in callback.

§Returns

[NATIVE_ERROR_OK] 0 - Success. [NATIVE_ERROR_INVALID_ARGUMENTS] 40001000 - the parameter nativeVsync is NULL or callback is NULL. [NATIVE_ERROR_BINDER_ERROR] 50401000 - ipc send failed.

Available since API-level: 9

Version: 1.0