diff --git a/graphic/graphic_2d/native_window/external_window.h b/graphic/graphic_2d/native_window/external_window.h index 88b3e056b90134da427413844224809fc0a1ff0f..66db08561edacfa1d5935a19c94570b8e89d3a27 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 58725d5505cb6ec1c371fb4fc5eb74298b254884..8f3717f9b8b714829c2307a09a46bf3496efbbb6 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