diff --git a/graphic/graphic_2d/native_window/external_window.h b/graphic/graphic_2d/native_window/external_window.h index 767e8c8ace97c94607de3d2b0a933d71bf8ef0c9..6cb9baab46728b7caffff1abe3cee1e04bad07db 100644 --- a/graphic/graphic_2d/native_window/external_window.h +++ b/graphic/graphic_2d/native_window/external_window.h @@ -795,6 +795,20 @@ int32_t OH_NativeWindow_SetMetadataValue(OHNativeWindow *window, OH_NativeBuffer */ int32_t OH_NativeWindow_GetMetadataValue(OHNativeWindow *window, OH_NativeBuffer_MetadataKey metadataKey, int32_t *size, uint8_t **metadata); + +/** + * @brief Set the desiredPersentTimestamp of a native window buffer. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + * @param buffer Indicates the pointer to an OHNativeWindowBuffer pointer. + * @param desiredPersentTimestamp Indicates the desired time to present the buffer, which should be generated by std::chrono in nanoseconds. + * @return {@link NATIVE_ERROR_OK} 0 - Success. + * {@link NATIVE_ERROR_INVALID_ARGUMENTS} 40001000 - buffer is NULL. + * @since 12 + * @version 1.0 + */ +int32_t OH_NativeWindow_SetBufferDesiredPresentTimestamp(OHNativeWindowBuffer *buffer, + int64_t desiredPersentTimestamp); #ifdef __cplusplus } #endif diff --git a/graphic/graphic_2d/native_window/libnative_window.ndk.json b/graphic/graphic_2d/native_window/libnative_window.ndk.json index 375d3e034a2f351b1f9964c6a8fef025a40f359a..1edbd0e3f9654d749f602d2f32b6f61902222ccc 100644 --- a/graphic/graphic_2d/native_window/libnative_window.ndk.json +++ b/graphic/graphic_2d/native_window/libnative_window.ndk.json @@ -50,6 +50,9 @@ { "first_introduced": "12", "name": "OH_NativeWindow_GetMetadataValue" + }, + { + "first_introduced": "12", + "name": "OH_NativeWindow_SetBufferDesiredPresentTimestamp" } - ] \ No newline at end of file