From 4ebd3373bfeba163d35c490c0eb446a8ccf72316 Mon Sep 17 00:00:00 2001 From: m00472246 Date: Tue, 5 Mar 2024 19:05:18 +0800 Subject: [PATCH] =?UTF-8?q?sdk=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=A2=9E=20Signe?= =?UTF-8?q?d-off-by:=20m00472246=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: m00472246 --- .../native_window/external_window.h | 31 +++++++++++++++++++ .../native_window/libnative_window.ndk.json | 4 ++- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/graphic/graphic_2d/native_window/external_window.h b/graphic/graphic_2d/native_window/external_window.h index 88b3e056b..66db08561 100644 --- a/graphic/graphic_2d/native_window/external_window.h +++ b/graphic/graphic_2d/native_window/external_window.h @@ -193,6 +193,13 @@ enum NativeWindowOperation { * [in] uint64_t uiTimestamp. */ SET_UI_TIMESTAMP, + /** + * get native window bufferqueue size, + * variable parameter in function is + * [out] int32_t *size. + * @since 12 + */ + GET_BUFFERQUEUE_SIZE, }; /** @@ -496,6 +503,30 @@ int32_t OH_NativeWindow_NativeWindowSetMetaDataSet(OHNativeWindow *window, uint3 */ int32_t OH_NativeWindow_NativeWindowSetTunnelHandle(OHNativeWindow *window, const OHExtDataHandle *handle); +/** + * @brief Attach a buffer to an OHNativeWindow instance. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + * @param window Indicates the pointer to an OHNativeWindow instance. + * @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. + * @return Returns an error code, 0 is success, otherwise, failed. + * @since 12 + * @version 1.0 + */ +int32_t OH_NativeWindow_NativeWindowAttachBuffer(OHNativeWindow *window, OHNativeWindowBuffer *buffer); + +/** + * @brief Detach a buffer from an OHNativeWindow instance. + * + * @syscap SystemCapability.Graphic.Graphic2D.NativeWindow + * @param window Indicates the pointer to an OHNativeWindow instance. + * @param buffer Indicates the pointer to a OHNativeWindowBuffer instance. + * @return Returns an error code, 0 is success, otherwise, failed. + * @since 12 + * @version 1.0 + */ +int32_t OH_NativeWindow_NativeWindowDetachBuffer(OHNativeWindow *window, OHNativeWindowBuffer *buffer); + /** * @brief Get surfaceId from native window. * diff --git a/graphic/graphic_2d/native_window/libnative_window.ndk.json b/graphic/graphic_2d/native_window/libnative_window.ndk.json index 58725d550..8f3717f9b 100644 --- a/graphic/graphic_2d/native_window/libnative_window.ndk.json +++ b/graphic/graphic_2d/native_window/libnative_window.ndk.json @@ -18,5 +18,7 @@ { "name": "OH_NativeWindow_NativeWindowSetMetaDataSet" }, { "name": "OH_NativeWindow_NativeWindowSetTunnelHandle" }, { "name": "OH_NativeWindow_GetSurfaceId"}, - { "name": "OH_NativeWindow_CreateNativeWindowFromSurfaceId"} + { "name": "OH_NativeWindow_CreateNativeWindowFromSurfaceId"}, + { "name": "OH_NativeWindow_NativeWindowAttachBuffer" }, + { "name": "OH_NativeWindow_NativeWindowDetachBuffer" } ] \ No newline at end of file -- Gitee