From a821ffcb445d42319fef7f5e5d15e3f29d89ec7a Mon Sep 17 00:00:00 2001 From: lihui Date: Tue, 20 Aug 2024 10:37:02 +0800 Subject: [PATCH] add OH_NativeWindow_SetBufferDesiredPresentTimestamp Signed-off-by: lihui --- graphic/graphic_2d/native_window/external_window.h | 14 ++++++++++++++ .../native_window/libnative_window.ndk.json | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_window/external_window.h b/graphic/graphic_2d/native_window/external_window.h index 767e8c8ac..6cb9baab4 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 375d3e034..1edbd0e3f 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 -- Gitee