native_display_soloist.h
Overview
This file declares the functions for obtaining and using native display soloist.
File to include: <native_display_soloist/native_display_soloist.h>
Library: libnative_display_soloist.so
System capability: SystemCapability.Graphic.Graphic2D.HyperGraphicManager
Since: 12
Related module: NativeDisplaySoloist
Summary
Structs
| Name | typedef Keyword | Description |
|---|---|---|
| DisplaySoloist_ExpectedRateRange | DisplaySoloist_ExpectedRateRange | Describes the expected frame rate range. |
| OH_DisplaySoloist | OH_DisplaySoloist | Provides the declaration of an OH_DisplaySoloist struct. |
Functions
Function Description
OH_DisplaySoloist_FrameCallback()
typedef void (*OH_DisplaySoloist_FrameCallback)(long long timestamp, long long targetTimestamp, void* data)
Description
Defines the pointer to an OH_DisplaySoloist callback function.
Since: 12
Parameters
| Name | Description |
|---|---|
| long long timestamp | Current frame VSync timestamp. |
| long long targetTimestamp | Expected VSync timestamp of the next frame. |
| void* data | Pointer to user-defined data. |
OH_DisplaySoloist_Create()
OH_DisplaySoloist* OH_DisplaySoloist_Create(bool useExclusiveThread)
Description
Creates an OH_DisplaySoloist instance. A new OH_DisplaySoloist instance is created each time this API is called.
Since: 12
Parameters
| Name | Description |
|---|---|
| bool useExclusiveThread | Whether the OH_DisplaySoloist instance is an exclusive thread. true means yes; false otherwise. |
Returns
| Type | Description |
|---|---|
| OH_DisplaySoloist* | Returns the pointer to the OH_DisplaySoloist instance created if the operation is successful; returns a null pointer otherwise. The failure cause may be out of memory. |
OH_DisplaySoloist_Destroy()
int32_t OH_DisplaySoloist_Destroy(OH_DisplaySoloist* displaySoloist)
Description
Destroys an OH_DisplaySoloist object and reclaims the memory occupied.
Since: 12
Parameters
| Name | Description |
|---|---|
| OH_DisplaySoloist* displaySoloist | Pointer to the OH_DisplaySoloist instance. |
Returns
| Type | Description |
|---|---|
| int32_t | Returns 0 if the operation is successful; returns -1 otherwise. |
OH_DisplaySoloist_Start()
int32_t OH_DisplaySoloist_Start(OH_DisplaySoloist* displaySoloist, OH_DisplaySoloist_FrameCallback callback, void* data)
Description
Sets a callback function for each frame. The callback function is triggered each time a VSync signal arrives.
Since: 12
Parameters
| Name | Description |
|---|---|
| OH_DisplaySoloist* displaySoloist | Pointer to the OH_DisplaySoloist instance. |
| OH_DisplaySoloist_FrameCallback callback | Callback function to be triggered when the next VSync signal arrives. |
| void* data | Pointer to the user-defined data struct. The type is void. |
Returns
| Type | Description |
|---|---|
| int32_t | Returns 0 if the operation is successful; returns -1 otherwise. |
OH_DisplaySoloist_Stop()
int32_t OH_DisplaySoloist_Stop(OH_DisplaySoloist* displaySoloist)
Description
Stops requesting the next VSync signal and triggering the callback function.
Since: 12
Parameters
| Name | Description |
|---|---|
| OH_DisplaySoloist* displaySoloist | Pointer to the OH_DisplaySoloist instance. |
Returns
| Type | Description |
|---|---|
| int32_t | Returns 0 if the operation is successful; returns -1 otherwise. |
OH_DisplaySoloist_SetExpectedFrameRateRange()
int32_t OH_DisplaySoloist_SetExpectedFrameRateRange(OH_DisplaySoloist* displaySoloist, DisplaySoloist_ExpectedRateRange* range)
Description
Sets the expected frame rate range.
Since: 12
Parameters
| Name | Description |
|---|---|
| OH_DisplaySoloist* displaySoloist | Pointer to the OH_DisplaySoloist instance. |
| DisplaySoloist_ExpectedRateRange* range | Pointer to the DisplaySoloist_ExpectedRateRange instance. |
Returns
| Type | Description |
|---|---|
| int32_t | Returns 0 if the operation is successful; returns -1 otherwise. |
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 capi-drawing-gpu-context-h
openharmony 鸿蒙 capi-drawing-nativepixelmap-
openharmony 鸿蒙 capi-nativevsync-oh-nativevsync-expectedraterange
openharmony 鸿蒙 capi-drawing-oh-drawing-brush
openharmony 鸿蒙 capi-drawing-oh-drawing-image-info
openharmony 鸿蒙 capi-drawing-text-linetypography-h
openharmony 鸿蒙 capi-oh-nativeimage-oh-nativeimage
openharmony 鸿蒙 capi-drawing-typeface-h