!120 XComponent 增加帧率控制与显示更新接口

Merge pull request !120 from 徐炜楠/master
This commit is contained in:
openharmony_ci 2023-12-16 12:57:03 +00:00 committed by Gitee
commit a62e386194
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 62 additions and 0 deletions

View File

@ -78,5 +78,17 @@
{
"first_introduced": "10",
"name": "OH_NativeXComponent_GetHistoricalPoints"
},
{
"first_introduced": "11",
"name": "OH_NativeXComponent_SetExpectedFrameRateRange"
},
{
"first_introduced": "11",
"name": "OH_NativeXComponent_RegisterOnFrameCallback"
},
{
"first_introduced": "11",
"name": "OH_NativeXComponent_UnregisterOnFrameCallback"
}
]

View File

@ -329,6 +329,21 @@ struct OH_NativeXComponent_KeyEvent;
*/
typedef struct OH_NativeXComponent_KeyEvent OH_NativeXComponent_KeyEvent;
/**
* @brief Defines the expected frame rate range struct.
*
* @since 11
* @version 1.0
*/
typedef struct {
/** The minimum frame rate of dynamical callback rate range. */
int32_t min;
/** The maximum frame rate of dynamical callback rate range. */
int32_t max;
/** The expected frame rate of dynamical callback rate range. */
int32_t expected;
} OH_NativeXComponent_ExpectedRateRange;
/**
* @brief Obtains the ID of the ArkUI XComponent.
*
@ -575,6 +590,41 @@ int32_t OH_NativeXComponent_GetKeyEventDeviceId(OH_NativeXComponent_KeyEvent* ke
*/
int32_t OH_NativeXComponent_GetKeyEventTimestamp(OH_NativeXComponent_KeyEvent* keyEvent, int64_t* timestamp);
/**
* @brief Set the Expected FrameRateRange.
*
* @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
* @param callback Indicates the pointer to a expected rate range.
* @return Returns the status code of the execution.
* @since 11
* @version 1.0
*/
int32_t OH_NativeXComponent_SetExpectedFrameRateRange(
OH_NativeXComponent* component, OH_NativeXComponent_ExpectedRateRange* range);
/**
* @brief Registers a callback for this <b>OH_NativeXComponent</b> instance.
*
* @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
* @param callback Indicates the pointer to a onFrame callback.
* @return Returns the status code of the execution.
* @since 11
* @version 1.0
*/
int32_t OH_NativeXComponent_RegisterOnFrameCallback(OH_NativeXComponent* component,
void (*callback)(OH_NativeXComponent* component, uint64_t timestamp, uint64_t targetTimestamp));
/**
* @brief UnRegister a callback for this <b>OH_NativeXComponent</b> instance.
*
* @param component Indicates the pointer to this <b>OH_NativeXComponent</b> instance.
* @return Returns the status code of the execution.
* @since 11
* @version 1.0
*/
int32_t OH_NativeXComponent_UnregisterOnFrameCallback(OH_NativeXComponent* component);
#ifdef __cplusplus
};
#endif