diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index bcc196abdbfd6fe9b0d5f58c9c01e04d13ac4b67..c8af1edc168c53d2e35363f88aebf819190c8145 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -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" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_interface_xcomponent.h b/arkui/ace_engine/native/native_interface_xcomponent.h index df44e8b4e4ea413b8897d4ce909ca64f80844eb0..9c266f116e24d820233d07a569a6efd84dd87cd1 100644 --- a/arkui/ace_engine/native/native_interface_xcomponent.h +++ b/arkui/ace_engine/native/native_interface_xcomponent.h @@ -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,40 @@ 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 OH_NativeXComponent 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 OH_NativeXComponent instance. + * + * @param component Indicates the pointer to this OH_NativeXComponent 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 OH_NativeXComponent instance. + * + * @param component Indicates the pointer to this OH_NativeXComponent 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