Expand description
Bindings to the native vsync APIs
See also Native Vsync Development.
§Feature flags
api-14— Enables API-14 bindings, including support for DVSync (Decoupled Vsync)document-features— Document available features when building the documentation
Structs§
Functions§
- OH_
NativeV ⚠Sync_ Create - Creates a NativeVsync instance.
- OH_
NativeV ⚠Sync_ Create_ ForAssociated Window api-14 - Creates a NativeVsync instance.
- OH_
NativeV ⚠Sync_ DVSync Switch api-14 - Enables DVSync to improve the smoothness of self-drawing animations. DVSync, short for Decoupled VSync, is a frame timing management policy that is decoupled from the hardware’s VSync. DVSync drives the early rendering of upcoming animation frames by sending VSync signals with future timestamps. These frames are stored in a frame buffer queue. This helps DVSync reduce potential frame drop and therefore enhances the smoothness of animations. DVSync requires free self-drawing frame buffers to store these pre-rendered animation frames. Therefore, you must ensure that at least one free frame buffer is available. Otherwise, do not enable DVSync. After DVSync is enabled, you must correctly respond to the early VSync signals and request the subsequent VSync after the animation frame associated with the previous VSync is complete. In addition, the self-drawing frames must carry timestamps that align with VSync. After the animation ends, disable DVSync. Only phones and tablets support DVSync. On a platform that does not support DVSync or if another application has enabled DVSync, the attempt to enable it will not take effect, and the application still receives normal VSync signals.
- OH_
NativeV ⚠Sync_ Destroy - Destroys an OH_NativeVSync instance. Once the OH_NativeVSync pointer is destroyed, it must not be used to prevent dangling pointer problems. Pay special attention to the management of the OH_NativeVSync pointer in concurrent multithreaded scenarios.
- OH_
NativeV ⚠Sync_ GetPeriod - Obtains the VSync period. The VSync period is refreshed only when the OH_NativeVSync_FrameCallback callback is received following a request for a VSync signal via OH_NativeVSync_RequestFrame. To obtain the VSync period for the first time using this function, you need to call OH_NativeVSync_RequestFrame to request a VSync signal. Once the OH_NativeVSync_FrameCallback callback is received, the vsync period can be obtained.
- OH_
NativeV ⚠Sync_ Request Frame - Request next vsync with callback. If you call this interface multiple times in one frame, it will only call the last callback.
- OH_
NativeV ⚠Sync_ Request Frame With Multi Callback api-12 - Request next vsync with callback. If this function is called multiple times in one vsync period, all these callbacks and dataset will be called.