From 522a7fee89bcf38bd7b8508af10b3082827f47fb Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Tue, 13 May 2025 20:59:04 +0800 Subject: [PATCH 1/9] [featire] pip ndk Signed-off-by: wangyaohui --- arkui/window_manager/BUILD.gn | 2 + arkui/window_manager/libwm.ndk.json | 76 +++++ arkui/window_manager/oh_window_comm.h | 35 +++ arkui/window_manager/oh_window_pip.h | 416 ++++++++++++++++++++++++++ 4 files changed, 529 insertions(+) create mode 100644 arkui/window_manager/oh_window_pip.h diff --git a/arkui/window_manager/BUILD.gn b/arkui/window_manager/BUILD.gn index 0e5b250e5..f5b3dca50 100644 --- a/arkui/window_manager/BUILD.gn +++ b/arkui/window_manager/BUILD.gn @@ -24,6 +24,7 @@ ohos_ndk_library("native_window_manager") { "window_manager/oh_window.h", "window_manager/oh_window_comm.h", "window_manager/oh_window_event_filter.h", + "oh_window_pip.h", ] } @@ -33,5 +34,6 @@ ohos_ndk_headers("window_manager_header") { "oh_window.h", "oh_window_comm.h", "oh_window_event_filter.h", + "oh_window_pip.h", ] } diff --git a/arkui/window_manager/libwm.ndk.json b/arkui/window_manager/libwm.ndk.json index d3791022b..f0bc24c44 100644 --- a/arkui/window_manager/libwm.ndk.json +++ b/arkui/window_manager/libwm.ndk.json @@ -86,5 +86,81 @@ { "first_instroduced":"17", "name":"OH_WindowManager_ReleaseAllWindowLayoutInfoList" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_CreatePip" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_DeletePip" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_StartPip" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_StopPip" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_UpdatePipContentSize" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_UpdatePipControlStatus" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_SetPiPControlEnabled" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_RegisterStartPipCallBack" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_UnregisterStartPipCallBack" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_UnregisterAllStartPipCallBack" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_RegisterLifeCycleListener" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_UnregisterLifeCycleListener" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_UnregisterAllLifeCycleListener" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_RegisterPanelActionListener" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_UnregisterPanelActionListener" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_UnregisterAllPanelActionListener" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_RegisterResizeListener" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_UnregisterResizeListener" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_UnregisterAllResizeListener" } ] \ No newline at end of file diff --git a/arkui/window_manager/oh_window_comm.h b/arkui/window_manager/oh_window_comm.h index d015371a5..638e42370 100644 --- a/arkui/window_manager/oh_window_comm.h +++ b/arkui/window_manager/oh_window_comm.h @@ -92,6 +92,41 @@ typedef enum { * @since 15 */ WINDOW_MANAGER_ERRORCODE_SYSTEM_ABNORMAL = 1300003, + /** + * @error Picture-In-Picture failed to destroy. + * + * @since 20 + */ + WINDOW_MANAGER_ERRORCODE_PIP_DESTROY_FAILED = 1300011, + /** + * @error Picture-In-Picture state is abnormal. + * + * @since 20 + */ + WINDOW_MANAGER_ERRORCODE_PIP_STATE_ABNORMAL = 1300012, + /** + * @error Picture-In-Picture failed to create. + * + * @since 20 + */ + WINDOW_MANAGER_ERRORCODE_PIP_CREATE_FAILED = 1300013, + /** + * @error Picture-In-Picture internal error. + * + * @since 20 + */ + WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR = 1300014, + /** + * @error Picture-In-Picture repeat operation. + * + * @since 20 + */ + WINDOW_MANAGER_ERRORCODE_PIP_REPEAT_OPERATION = 1300015, + /** + * @error Parameter is incorrect. + * @since 20 + */ + WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM = 1300016, } WindowManager_ErrorCode; /** diff --git a/arkui/window_manager/oh_window_pip.h b/arkui/window_manager/oh_window_pip.h new file mode 100644 index 000000000..ba803f03d --- /dev/null +++ b/arkui/window_manager/oh_window_pip.h @@ -0,0 +1,416 @@ +/* + * Copyright (c) 2025 Huawei Device Co., Ltd. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * @addtogroup OH_PictureInPicture + * @file oh_window_pip.h + * + * @brief Declares C APIs for picture in picture window + * + * @kit ArkUI + * @library libnative_window_manager.so + * @syscap SystemCapability.Window.SessionManager + * @since 20 + * @version 1.0 + */ +#ifndef OH_WINDOW_PIP_H +#define OH_WINDOW_PIP_H + +#include "napi/native_api.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates picture in picture template type. + * @since 20 + */ +typedef enum { + VIDEO_PLAY = 0, + VIDEO_CALL = 1, + VIDEO_MEETING = 2, + VIDEO_LIVE = 3, +} PictureInPicture_PiPTemplateType; + +/** + * @brief Enumerates picture in picture control group. + * @since 20 + */ +typedef enum { + VIDEO_PLAY_VIDEO_PREVIOUS_NEXT = 101, + VIDEO_PLAY_FAST_FORWARD_BACKWARD = 102, + VIDEO_CALL_MICROPHONE_SWITCH = 201, + VIDEO_CALL_HANG_UP_BUTTON = 202, + VIDEO_CALL_CAMERA_SWITCH = 203, + VIDEO_CALL_MUTE_SWITCH = 204, + VIDEO_MEETING_HANG_UP_BUTTON = 301, + VIDEO_MEETING_CAMERA_SWITCH = 302, + VIDEO_MEETING_MUTE_SWITCH = 303, + VIDEO_MEETING_MICROPHONE_SWITCH = 304, + VIDEO_LIVE_VIDEO_PLAY_PAUSE = 401, + VIDEO_LIVE_MUTE_SWITCH = 402, +} PictureInPicture_PiPControlGroup; + +/** + * @brief Enumerates picture in picture control type. + * @since 20 + */ +typedef enum { + VIDEO_PLAY_PAUSE = 0, + VIDEO_PREVIOUS = 1, + VIDEO_NEXT = 2, + FAST_FORWARD = 3, + FAST_BACKWARD = 4, + HANG_UP_BUTTON = 5, + MICROPHONE_SWITCH = 6, + CAMERA_SWITCH = 7, + MUTE_SWITCH = 8, + END, +} PictureInPicture_PiPControlType; + +/** + * @brief Enumerates picture in picture control status. + * @since 20 + */ +typedef enum { + PLAY = 1, + PAUSE = 0, + OPEN = 1, + CLOSE = 0, +} PictureInPicture_PiPControlStatus; + +/** + * @brief Enumerates picture in picture state. + * @since 20 + */ +typedef enum { + ABOUT_TO_START = 1, + STARTED = 2, + ABOUT_TO_STOP = 3, + STOPPED = 4, + ABOUT_TO_RESTORE = 5, + ERROR = 6, +} PictureInPicture_PiPState; + +/** + * @brief Defines the PiP config structure. + * + * @since 20 + */ +typedef struct { + /** WindowId of Corresponding mainWindow. */ + uint32_t mainWindowId; + /** The picture-in-picture template type */ + PictureInPicture_PiPTemplateType pipTemplateType; + /** The picture-in-picture content width */ + uint32_t width; + /** The picture-in-picture content height */ + uint32_t height; + /** The picture-in-picture control group */ + PictureInPicture_PiPControlGroup* controlGroup; + /** The length of picture-in-picture control group */ + uint8_t controlGroupLength; + /** The application environment */ + napi_env env; +} PictureInPicture_PiPConfig; + +/** + * @brief Start the picture-in-picture callback + * @param requestId The picture-in-picture requestId + * @param surfaceId The picture-in-picture surfaceId + * @since 20 + */ +typedef void (*WebPipStartPipCallback)(uint32_t controllerId, uint8_t requestId, uint64_t surfaceId); + +/** + * @brief The picture-in-picture lifecycle callback + * @param state The picture-in-picture state + * @since 20 + */ +typedef void (*WebPipLifecycleCallback)(uint32_t controllerId, PictureInPicture_PiPState state, int32_t errcode); + +/** + * @brief The picture-in-picture control event callback + * @param controlType The picture-in-picture control type + * @param status The picture-in-picture control status + * @since 20 + */ +typedef void (*WebPipControlEventCallback)(uint32_t controllerId, PictureInPicture_PiPControlType controlType, + PictureInPicture_PiPControlStatus status); + +/** + * @brief The picture-in-picture size change callback + * @param width The picture-in-picture window width + * @param height The picture-in-picture window height + * @param scale The picture-in-picture window scale + * @since 20 + */ +typedef void (*WebPipResizeCallback)(uint32_t controllerId, uint32_t width, uint32_t height, double scale); + +/** + * @brief Create picture-in-picture controller. + * + * @param pipConfig The picture-in-picture configuration + * @param controllerId The picture-in-picture controller ID + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. + * @since 20 + */ +int32_t OH_PictureInPicture_CreatePip(PictureInPicture_PiPConfig* pipConfig, uint32_t* controllerId); + +/** + * @brief Delete picture-in-picture controller. + * + * @param controllerId The picture-in-picture controller ID + * @return Return the result code. + * {@link OK} The function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * @since 20 + */ +int32_t OH_PictureInPicture_DeletePip(uint32_t controllerId); + +/** + * @brief Start picture-in-picture. + * + * @param controllerId The picture-in-picture controller ID + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_STATE_ABNORMAL} the PiP window state is abnormal. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_CREATE_FAILED} failed to create the PiP window. + * {@link WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_REPEAT_OPERATION} repeated PiP operation. + * @since 20 + */ +int32_t OH_PictureInPicture_StartPip(uint32_t controllerId); + +/** + * @brief Stop picture-in-picture. + * + * @param controllerId The picture-in-picture controller ID + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_DESTROY_FAILED} failed to destroy the PiP window. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_STATE_ABNORMAL} the PiP window state is abnormal. + * {@link WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_REPEAT_OPERATION} repeated PiP operation. + * @since 20 + */ +int32_t OH_PictureInPicture_StopPip(uint32_t controllerId); + +/** + * @brief Update picture-in-picture content size. + * + * @param controllerId The picture-in-picture controller ID + * @param width The picture-in-picture content width + * @param height The picture-in-picture content height + * @since 20 + */ +void OH_PictureInPicture_UpdatePipContentSize(uint32_t controllerId, uint32_t width, uint32_t height); + +/** + * @brief Update picture-in-picture control status. + * + * @param controllerId The picture-in-picture controller ID + * @param controlType The picture-in-picture control type. + * @param status The picture-in-picture control status. + * @since 20 + */ +void OH_PictureInPicture_UpdatePipControlStatus(uint32_t controllerId, PictureInPicture_PiPControlType controlType, + PictureInPicture_PiPControlStatus status); + +/** + * @brief Set picture-in-picture controll enable status. + * + * @param controllerId The picture-in-picture controller ID + * @param controlType The picture-in-picture control type. + * @param enabled Indicate the picture-in-picture control is enabled. + * @since 20 + */ +void OH_PictureInPicture_SetPiPControlEnabled(uint32_t controllerId, PictureInPicture_PiPControlType controlType, + bool enabled); + +/** + * @brief Register picture-in-picture controller start callback. + * + * @param controllerId The picture-in-picture controller ID + * @param callback Start the picture-in-picture callback + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. + * @since 20 + */ +int32_t OH_PictureInPicture_RegisterStartPipCallback(uint32_t controllerId, WebPipStartPipCallback callback); + +/** + * @brief Unregister picture-in-picture controller start callback. + * + * @param controllerId The picture-in-picture controller ID + * @param callback Start the picture-in-picture callback + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. + * @since 20 + */ +int32_t OH_PictureInPicture_UnregisterStartPipCallback(uint32_t controllerId, WebPipStartPipCallback callback); + +/** + * @brief Unregister all picture-in-picture controller start callbacks. + * + * @param controllerId The picture-in-picture controller ID + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. + * @since 20 + */ +int32_t OH_PictureInPicture_UnregisterAllStartPipCallbacks(uint32_t controllerId); + +/** + * @brief Register picture-in-picture life cycle listener callback. + * + * @param controllerId The picture-in-picture controller ID + * @param callback The picture-in-picture lifecycle callback. + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. + * @since 20 + */ +int32_t OH_PictureInPicture_RegisterLifecycleListener(uint32_t controllerId, WebPipLifecycleCallback callback); + +/** + * @brief Unregister picture-in-picture life cycle listener callback. + * + * @param controllerId The picture-in-picture controller ID + * @param callback The picture-in-picture lifecycle callback. + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. + * @since 20 + */ +int32_t OH_PictureInPicture_UnregisterLifecycleListener(uint32_t controllerId, WebPipLifecycleCallback callback); + +/** + * @brief Unregister all picture-in-picture life cycle listener callbacks. + * + * @param controllerId The picture-in-picture controller ID + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. + * @since 20 + */ +int32_t OH_PictureInPicture_UnregisterAllLifecycleListeners(uint32_t controllerId); + +/** + * @brief Register picture-in-picture control event listener callback. + * + * @param controllerId The picture-in-picture controller ID + * @param callback The picture-in-picture control event callback. + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. + * @since 20 + */ +int32_t OH_PictureInPicture_RegisterControlEventListener(uint32_t controllerId, WebPipControlEventCallback callback); + +/** + * @brief Unregister picture-in-picture control event listener callback. + * + * @param controllerId The picture-in-picture controller ID + * @param callback The picture-in-picture control event callback. + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. + * @since 20 + */ +int32_t OH_PictureInPicture_UnregisterControlEventListener(uint32_t controllerId, WebPipControlEventCallback callback); + +/** + * @brief Unregister all picture-in-picture control event listener callbacks. + * + * @param controllerId The picture-in-picture controller ID + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. + * @since 20 + */ +int32_t OH_PictureInPicture_UnregisterAllControlEventListeners(uint32_t controllerId); + +/** + * @brief Register picture-in-picture resize listener callback. + * + * @param controllerId The picture-in-picture controller ID + * @param callback The picture-in-picture size change callback. + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. + * @since 20 + */ +int32_t OH_PictureInPicture_RegisterResizeListener(uint32_t controllerId, WebPipResizeCallback callback); + +/** + * @brief Unregister picture-in-picture resize listener callback. + * + * @param controllerId The picture-in-picture controller ID + * @param callback The picture-in-picture size change callback. + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. + * @since 20 + */ +int32_t OH_PictureInPicture_UnregisterResizeListener(uint32_t controllerId, WebPipResizeCallback callback); + +/** + * @brief Unregister all picture-in-picture resize listener callbacks. + * + * @param controllerId The picture-in-picture controller ID + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. + * @since 20 + */ +int32_t OH_PictureInPicture_UnregisterAllResizeListeners(uint32_t controllerId); + +#ifdef __cplusplus +} +#endif + +#endif // OH_WINDOW_PIP_H \ No newline at end of file -- Gitee From 4ba9c584ec35a42eceaae24610d1bbdda7112d35 Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Fri, 16 May 2025 15:06:02 +0800 Subject: [PATCH 2/9] =?UTF-8?q?[fix]=20=E6=A0=B9=E6=8D=AEAPI=E7=94=B5?= =?UTF-8?q?=E5=AD=90=E6=B5=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangyaohui --- arkui/window_manager/oh_window_comm.h | 4 ++-- arkui/window_manager/oh_window_pip.h | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/arkui/window_manager/oh_window_comm.h b/arkui/window_manager/oh_window_comm.h index 638e42370..152c9a318 100644 --- a/arkui/window_manager/oh_window_comm.h +++ b/arkui/window_manager/oh_window_comm.h @@ -117,11 +117,11 @@ typedef enum { */ WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR = 1300014, /** - * @error Picture-In-Picture repeat operation. + * @error Picture-In-Picture repeated operation. * * @since 20 */ - WINDOW_MANAGER_ERRORCODE_PIP_REPEAT_OPERATION = 1300015, + WINDOW_MANAGER_ERRORCODE_PIP_REPEATED_OPERATION = 1300015, /** * @error Parameter is incorrect. * @since 20 diff --git a/arkui/window_manager/oh_window_pip.h b/arkui/window_manager/oh_window_pip.h index ba803f03d..1ab21bb51 100644 --- a/arkui/window_manager/oh_window_pip.h +++ b/arkui/window_manager/oh_window_pip.h @@ -43,7 +43,7 @@ typedef enum { VIDEO_CALL = 1, VIDEO_MEETING = 2, VIDEO_LIVE = 3, -} PictureInPicture_PiPTemplateType; +} PictureInPicture_PipTemplateType; /** * @brief Enumerates picture in picture control group. @@ -62,7 +62,7 @@ typedef enum { VIDEO_MEETING_MICROPHONE_SWITCH = 304, VIDEO_LIVE_VIDEO_PLAY_PAUSE = 401, VIDEO_LIVE_MUTE_SWITCH = 402, -} PictureInPicture_PiPControlGroup; +} PictureInPicture_PipControlGroup; /** * @brief Enumerates picture in picture control type. @@ -103,7 +103,7 @@ typedef enum { STOPPED = 4, ABOUT_TO_RESTORE = 5, ERROR = 6, -} PictureInPicture_PiPState; +} PictureInPicture_PipState; /** * @brief Defines the PiP config structure. @@ -114,18 +114,18 @@ typedef struct { /** WindowId of Corresponding mainWindow. */ uint32_t mainWindowId; /** The picture-in-picture template type */ - PictureInPicture_PiPTemplateType pipTemplateType; + PictureInPicture_PipTemplateType pipTemplateType; /** The picture-in-picture content width */ uint32_t width; /** The picture-in-picture content height */ uint32_t height; /** The picture-in-picture control group */ - PictureInPicture_PiPControlGroup* controlGroup; + PictureInPicture_PipControlGroup* controlGroup; /** The length of picture-in-picture control group */ uint8_t controlGroupLength; /** The application environment */ napi_env env; -} PictureInPicture_PiPConfig; +} PictureInPicture_PipConfig; /** * @brief Start the picture-in-picture callback @@ -140,7 +140,7 @@ typedef void (*WebPipStartPipCallback)(uint32_t controllerId, uint8_t requestId, * @param state The picture-in-picture state * @since 20 */ -typedef void (*WebPipLifecycleCallback)(uint32_t controllerId, PictureInPicture_PiPState state, int32_t errcode); +typedef void (*WebPipLifecycleCallback)(uint32_t controllerId, PictureInPicture_PipState state, int32_t errcode); /** * @brief The picture-in-picture control event callback @@ -172,7 +172,7 @@ typedef void (*WebPipResizeCallback)(uint32_t controllerId, uint32_t width, uint * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. * @since 20 */ -int32_t OH_PictureInPicture_CreatePip(PictureInPicture_PiPConfig* pipConfig, uint32_t* controllerId); +int32_t OH_PictureInPicture_CreatePip(PictureInPicture_PipConfig* pipConfig, uint32_t* controllerId); /** * @brief Delete picture-in-picture controller. @@ -194,7 +194,7 @@ int32_t OH_PictureInPicture_DeletePip(uint32_t controllerId); * {@link WINDOW_MANAGER_ERRORCODE_PIP_STATE_ABNORMAL} the PiP window state is abnormal. * {@link WINDOW_MANAGER_ERRORCODE_PIP_CREATE_FAILED} failed to create the PiP window. * {@link WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. - * {@link WINDOW_MANAGER_ERRORCODE_PIP_REPEAT_OPERATION} repeated PiP operation. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_REPEATED_OPERATION} repeated PiP operation. * @since 20 */ int32_t OH_PictureInPicture_StartPip(uint32_t controllerId); @@ -208,7 +208,7 @@ int32_t OH_PictureInPicture_StartPip(uint32_t controllerId); * {@link WINDOW_MANAGER_ERRORCODE_PIP_DESTROY_FAILED} failed to destroy the PiP window. * {@link WINDOW_MANAGER_ERRORCODE_PIP_STATE_ABNORMAL} the PiP window state is abnormal. * {@link WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. - * {@link WINDOW_MANAGER_ERRORCODE_PIP_REPEAT_OPERATION} repeated PiP operation. + * {@link WINDOW_MANAGER_ERRORCODE_PIP_REPEATED_OPERATION} repeated PiP operation. * @since 20 */ int32_t OH_PictureInPicture_StopPip(uint32_t controllerId); @@ -229,7 +229,7 @@ void OH_PictureInPicture_UpdatePipContentSize(uint32_t controllerId, uint32_t wi * @param controllerId The picture-in-picture controller ID * @param controlType The picture-in-picture control type. * @param status The picture-in-picture control status. - * @since 20 + * @since 20 */ void OH_PictureInPicture_UpdatePipControlStatus(uint32_t controllerId, PictureInPicture_PiPControlType controlType, PictureInPicture_PiPControlStatus status); -- Gitee From 1493a2898ee063a9cf00dfea4e82b6f897d61b08 Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Fri, 16 May 2025 19:31:47 +0800 Subject: [PATCH 3/9] =?UTF-8?q?[fix]=20=E5=A2=9E=E5=8A=A0=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=9E=9A=E4=B8=BE=E6=B3=A8=E9=87=8A=EF=BC=8C=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangyaohui --- arkui/window_manager/BUILD.gn | 2 +- arkui/window_manager/oh_window_pip.h | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/arkui/window_manager/BUILD.gn b/arkui/window_manager/BUILD.gn index f5b3dca50..17fb43b1d 100644 --- a/arkui/window_manager/BUILD.gn +++ b/arkui/window_manager/BUILD.gn @@ -24,7 +24,7 @@ ohos_ndk_library("native_window_manager") { "window_manager/oh_window.h", "window_manager/oh_window_comm.h", "window_manager/oh_window_event_filter.h", - "oh_window_pip.h", + "window_manager/oh_window_pip.h", ] } diff --git a/arkui/window_manager/oh_window_pip.h b/arkui/window_manager/oh_window_pip.h index 1ab21bb51..9dfc5c0fd 100644 --- a/arkui/window_manager/oh_window_pip.h +++ b/arkui/window_manager/oh_window_pip.h @@ -28,7 +28,7 @@ #ifndef OH_WINDOW_PIP_H #define OH_WINDOW_PIP_H -#include "napi/native_api.h" +#include "stdint.h" #ifdef __cplusplus extern "C" { @@ -39,9 +39,13 @@ extern "C" { * @since 20 */ typedef enum { + /** Video play. */ VIDEO_PLAY = 0, + /** Video call. */ VIDEO_CALL = 1, + /** Video meeting. */ VIDEO_MEETING = 2, + /** Video live. */ VIDEO_LIVE = 3, } PictureInPicture_PipTemplateType; @@ -50,17 +54,29 @@ typedef enum { * @since 20 */ typedef enum { + /** Previous/next control group for video play. */ VIDEO_PLAY_VIDEO_PREVIOUS_NEXT = 101, + /** Fast forward/backward control group for video play. */ VIDEO_PLAY_FAST_FORWARD_BACKWARD = 102, + /** Switch on/off the microphone control group for video call. */ VIDEO_CALL_MICROPHONE_SWITCH = 201, + /** Hang up control group for video call. */ VIDEO_CALL_HANG_UP_BUTTON = 202, + /** Switch on/off the camera control group for video call. */ VIDEO_CALL_CAMERA_SWITCH = 203, + /** Mute control group for video call. */ VIDEO_CALL_MUTE_SWITCH = 204, + /** Hang up control group for video meeting. */ VIDEO_MEETING_HANG_UP_BUTTON = 301, + /** Switch on/off the camera control group for video meeting. */ VIDEO_MEETING_CAMERA_SWITCH = 302, + /** Mute control group for video meeting. */ VIDEO_MEETING_MUTE_SWITCH = 303, + /** Switch on/off the microphone control group for video meeting. */ VIDEO_MEETING_MICROPHONE_SWITCH = 304, + /** Video play/pause control group for video live. */ VIDEO_LIVE_VIDEO_PLAY_PAUSE = 401, + /** Mute control group for video live. */ VIDEO_LIVE_MUTE_SWITCH = 402, } PictureInPicture_PipControlGroup; @@ -69,9 +85,13 @@ typedef enum { * @since 20 */ typedef enum { + /** Video play/pause. */ VIDEO_PLAY_PAUSE = 0, + /** Video previous. */ VIDEO_PREVIOUS = 1, + /** Video next. */ VIDEO_NEXT = 2, + FAST_FORWARD = 3, FAST_BACKWARD = 4, HANG_UP_BUTTON = 5, -- Gitee From 8ac5198ccf117f3b03e3484c414de4c4b3dc537b Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Fri, 16 May 2025 20:02:11 +0800 Subject: [PATCH 4/9] =?UTF-8?q?[fix]=20=E6=8A=8A=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=BD=93=E6=94=BE=E5=9C=A8=E5=86=85=E9=83=A8=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E5=AF=B9=E5=A4=96=E6=9A=B4=E9=9C=B2=EF=BC=9B=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E6=A3=80=E8=A7=86=E6=84=8F=E8=A7=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangyaohui --- arkui/window_manager/oh_window_pip.h | 132 ++++++++++++++++++++------- 1 file changed, 98 insertions(+), 34 deletions(-) diff --git a/arkui/window_manager/oh_window_pip.h b/arkui/window_manager/oh_window_pip.h index 9dfc5c0fd..e5dc283d1 100644 --- a/arkui/window_manager/oh_window_pip.h +++ b/arkui/window_manager/oh_window_pip.h @@ -91,64 +91,59 @@ typedef enum { VIDEO_PREVIOUS = 1, /** Video next. */ VIDEO_NEXT = 2, - + /** Video fast forward. */ FAST_FORWARD = 3, + /** Video back forward. */ FAST_BACKWARD = 4, + /** Hang up. */ HANG_UP_BUTTON = 5, + /** Microphone switch. */ MICROPHONE_SWITCH = 6, + /** camera switch. */ CAMERA_SWITCH = 7, + /** mute switch. */ MUTE_SWITCH = 8, + /** end. */ END, -} PictureInPicture_PiPControlType; +} PictureInPicture_PipControlType; /** * @brief Enumerates picture in picture control status. * @since 20 */ typedef enum { + /** Play. */ PLAY = 1, + /** Pause. */ PAUSE = 0, + /** Open. */ OPEN = 1, + /** Close. */ CLOSE = 0, -} PictureInPicture_PiPControlStatus; +} PictureInPicture_PipControlStatus; /** * @brief Enumerates picture in picture state. * @since 20 */ typedef enum { + /** About to start. */ ABOUT_TO_START = 1, + /** started. */ STARTED = 2, + /** About to stop. */ ABOUT_TO_STOP = 3, + /** stopped. */ STOPPED = 4, + /** About to restore. */ ABOUT_TO_RESTORE = 5, + /** Error. */ ERROR = 6, } PictureInPicture_PipState; -/** - * @brief Defines the PiP config structure. - * - * @since 20 - */ -typedef struct { - /** WindowId of Corresponding mainWindow. */ - uint32_t mainWindowId; - /** The picture-in-picture template type */ - PictureInPicture_PipTemplateType pipTemplateType; - /** The picture-in-picture content width */ - uint32_t width; - /** The picture-in-picture content height */ - uint32_t height; - /** The picture-in-picture control group */ - PictureInPicture_PipControlGroup* controlGroup; - /** The length of picture-in-picture control group */ - uint8_t controlGroupLength; - /** The application environment */ - napi_env env; -} PictureInPicture_PipConfig; - /** * @brief Start the picture-in-picture callback + * @param controllerId The picture-in-picture controller ID * @param requestId The picture-in-picture requestId * @param surfaceId The picture-in-picture surfaceId * @since 20 @@ -157,22 +152,26 @@ typedef void (*WebPipStartPipCallback)(uint32_t controllerId, uint8_t requestId, /** * @brief The picture-in-picture lifecycle callback + * @param controllerId The picture-in-picture controller ID * @param state The picture-in-picture state + * @param errcode The picture-in-picture error code * @since 20 */ typedef void (*WebPipLifecycleCallback)(uint32_t controllerId, PictureInPicture_PipState state, int32_t errcode); /** * @brief The picture-in-picture control event callback + * @param controllerId The picture-in-picture controller ID * @param controlType The picture-in-picture control type * @param status The picture-in-picture control status * @since 20 */ -typedef void (*WebPipControlEventCallback)(uint32_t controllerId, PictureInPicture_PiPControlType controlType, - PictureInPicture_PiPControlStatus status); +typedef void (*WebPipControlEventCallback)(uint32_t controllerId, PictureInPicture_PipControlType controlType, + PictureInPicture_PipControlStatus status); /** * @brief The picture-in-picture size change callback + * @param controllerId The picture-in-picture controller ID * @param width The picture-in-picture window width * @param height The picture-in-picture window height * @param scale The picture-in-picture window scale @@ -182,8 +181,6 @@ typedef void (*WebPipResizeCallback)(uint32_t controllerId, uint32_t width, uint /** * @brief Create picture-in-picture controller. - * - * @param pipConfig The picture-in-picture configuration * @param controllerId The picture-in-picture controller ID * @return Return the result code. * {@link OK} the function call is successful. @@ -192,7 +189,74 @@ typedef void (*WebPipResizeCallback)(uint32_t controllerId, uint32_t width, uint * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. * @since 20 */ -int32_t OH_PictureInPicture_CreatePip(PictureInPicture_PipConfig* pipConfig, uint32_t* controllerId); +int32_t OH_PictureInPicture_CreatePip(uint32_t* controllerId); + +/** + * @brief Set picture-in-picture mainWindowId. + * + * @param controllerId The picture-in-picture controller ID + * @param mainWindowId WindowId of corresponding mainWindow + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * @since 20 + */ +int32_t OH_PictureInPicture_SetPipMainWindowId(uint32_t controllerId, uint32_t mainWindowId); + +/** + * @brief Set picture-in-picture templateType. + * + * @param controllerId The picture-in-picture controller ID + * @param pipTemplateType The picture-in-picture template type + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * @since 20 + */ +int32_t OH_PictureInPicture_SetPipTemplateType(uint32_t controllerId, PictureInPicture_PipTemplateType pipTemplateType); + +/** + * @brief Set picture-in-picture rect. + * + * @param controllerId The picture-in-picture controller ID + * @param width The picture-in-picture window width + * @param height The picture-in-picture window height + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * @since 20 + */ +int32_t OH_PictureInPicture_SetPipRect(uint32_t controllerId, uint32_t width, uint32_t height); + +/** + * @brief Set picture-in-picture control group. + * + * @param controllerId The picture-in-picture controller ID + * @param controlGroup The picture-in-picture control group + * @param controlGroupLength The length of picture-in-picture control group + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * @since 20 + */ +int32_t OH_PictureInPicture_SetPipControlGroup(uint32_t controllerId, PictureInPicture_PipControlGroup* controlGroup, uint8_t controlGroupLength); + +/** + * @brief Set picture-in-picture napi env. + * + * @param controllerId The picture-in-picture controller ID + * @param env The picture-in-picture napi env + * @return Return the result code. + * {@link OK} the function call is successful. + * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. + * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. + * @since 20 + */ +int32_t OH_PictureInPicture_SetPipNapiEnv(uint32_t controllerId, void* env); /** * @brief Delete picture-in-picture controller. @@ -249,10 +313,10 @@ void OH_PictureInPicture_UpdatePipContentSize(uint32_t controllerId, uint32_t wi * @param controllerId The picture-in-picture controller ID * @param controlType The picture-in-picture control type. * @param status The picture-in-picture control status. - * @since 20 + * @since 20 */ -void OH_PictureInPicture_UpdatePipControlStatus(uint32_t controllerId, PictureInPicture_PiPControlType controlType, - PictureInPicture_PiPControlStatus status); +void OH_PictureInPicture_UpdatePipControlStatus(uint32_t controllerId, PictureInPicture_PipControlType controlType, + PictureInPicture_PipControlStatus status); /** * @brief Set picture-in-picture controll enable status. @@ -262,7 +326,7 @@ void OH_PictureInPicture_UpdatePipControlStatus(uint32_t controllerId, PictureIn * @param enabled Indicate the picture-in-picture control is enabled. * @since 20 */ -void OH_PictureInPicture_SetPiPControlEnabled(uint32_t controllerId, PictureInPicture_PiPControlType controlType, +void OH_PictureInPicture_SetPipControlEnabled(uint32_t controllerId, PictureInPicture_PipControlType controlType, bool enabled); /** -- Gitee From 5ccfd142ad6d54aa7289367feef4e9d94df49745 Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Fri, 16 May 2025 20:08:23 +0800 Subject: [PATCH 5/9] =?UTF-8?q?[fix]=20=E6=96=B0=E5=A2=9E=E5=87=BD?= =?UTF-8?q?=E6=95=B0=E5=8A=A0=E5=85=A5json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangyaohui --- arkui/window_manager/libwm.ndk.json | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arkui/window_manager/libwm.ndk.json b/arkui/window_manager/libwm.ndk.json index f0bc24c44..2427d03d5 100644 --- a/arkui/window_manager/libwm.ndk.json +++ b/arkui/window_manager/libwm.ndk.json @@ -91,6 +91,26 @@ "first_instroduced":"20", "name":"OH_PictureInPicture_CreatePip" }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_SetPipMainWindowId" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_SetPipTemplateType" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_SetPipRect" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_SetPipControlGroup" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_SetPipNapiEnv" + }, { "first_instroduced":"20", "name":"OH_PictureInPicture_DeletePip" -- Gitee From 0bfe78dedd2f173ac4cabd1d37c80855be2bfecf Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Fri, 16 May 2025 20:20:42 +0800 Subject: [PATCH 6/9] =?UTF-8?q?[fix]=20json=20=E4=B8=8E=20=E5=A4=B4?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangyaohui --- arkui/window_manager/libwm.ndk.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/arkui/window_manager/libwm.ndk.json b/arkui/window_manager/libwm.ndk.json index 2427d03d5..1423e7db6 100644 --- a/arkui/window_manager/libwm.ndk.json +++ b/arkui/window_manager/libwm.ndk.json @@ -125,7 +125,7 @@ }, { "first_instroduced":"20", - "name":"OH_PictureInPicture_UpdatePipContentSize" + "name":"OH_PictureInPicture_StopPip" }, { "first_instroduced":"20", @@ -133,43 +133,43 @@ }, { "first_instroduced":"20", - "name":"OH_PictureInPicture_SetPiPControlEnabled" + "name":"OH_PictureInPicture_SetPipControlEnabled" }, { "first_instroduced":"20", - "name":"OH_PictureInPicture_RegisterStartPipCallBack" + "name":"OH_PictureInPicture_RegisterStartPipCallback" }, { "first_instroduced":"20", - "name":"OH_PictureInPicture_UnregisterStartPipCallBack" + "name":"OH_PictureInPicture_UnregisterStartPipCallback" }, { "first_instroduced":"20", - "name":"OH_PictureInPicture_UnregisterAllStartPipCallBack" + "name":"OH_PictureInPicture_UnregisterAllStartPipCallbacks" }, { "first_instroduced":"20", - "name":"OH_PictureInPicture_RegisterLifeCycleListener" + "name":"OH_PictureInPicture_RegisterLifecycleListener" }, { "first_instroduced":"20", - "name":"OH_PictureInPicture_UnregisterLifeCycleListener" + "name":"OH_PictureInPicture_UnregisterLifecycleListener" }, { "first_instroduced":"20", - "name":"OH_PictureInPicture_UnregisterAllLifeCycleListener" + "name":"OH_PictureInPicture_UnregisterAllLifecycleListeners" }, { "first_instroduced":"20", - "name":"OH_PictureInPicture_RegisterPanelActionListener" + "name":"OH_PictureInPicture_RegisterControlEventListener" }, { "first_instroduced":"20", - "name":"OH_PictureInPicture_UnregisterPanelActionListener" + "name":"OH_PictureInPicture_UnregisterControlEventListener" }, { "first_instroduced":"20", - "name":"OH_PictureInPicture_UnregisterAllPanelActionListener" + "name":"OH_PictureInPicture_UnregisterAllControlEventListeners" }, { "first_instroduced":"20", @@ -181,6 +181,6 @@ }, { "first_instroduced":"20", - "name":"OH_PictureInPicture_UnregisterAllResizeListener" + "name":"OH_PictureInPicture_UnregisterAllResizeListeners" } ] \ No newline at end of file -- Gitee From b9ad0180dad2879943204e6b91fb56bc5993adc6 Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Fri, 16 May 2025 20:27:09 +0800 Subject: [PATCH 7/9] =?UTF-8?q?[fix]=20lifecycle=20=E6=94=B9=E4=B8=BA=20li?= =?UTF-8?q?feCycle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangyaohui --- arkui/window_manager/libwm.ndk.json | 6 +++--- arkui/window_manager/oh_window_pip.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arkui/window_manager/libwm.ndk.json b/arkui/window_manager/libwm.ndk.json index 1423e7db6..7262ab87e 100644 --- a/arkui/window_manager/libwm.ndk.json +++ b/arkui/window_manager/libwm.ndk.json @@ -149,15 +149,15 @@ }, { "first_instroduced":"20", - "name":"OH_PictureInPicture_RegisterLifecycleListener" + "name":"OH_PictureInPicture_RegisterLifeCycleListener" }, { "first_instroduced":"20", - "name":"OH_PictureInPicture_UnregisterLifecycleListener" + "name":"OH_PictureInPicture_UnregisterLifeCycleListener" }, { "first_instroduced":"20", - "name":"OH_PictureInPicture_UnregisterAllLifecycleListeners" + "name":"OH_PictureInPicture_UnregisterAllLifeCycleListeners" }, { "first_instroduced":"20", diff --git a/arkui/window_manager/oh_window_pip.h b/arkui/window_manager/oh_window_pip.h index e5dc283d1..53914976b 100644 --- a/arkui/window_manager/oh_window_pip.h +++ b/arkui/window_manager/oh_window_pip.h @@ -157,7 +157,7 @@ typedef void (*WebPipStartPipCallback)(uint32_t controllerId, uint8_t requestId, * @param errcode The picture-in-picture error code * @since 20 */ -typedef void (*WebPipLifecycleCallback)(uint32_t controllerId, PictureInPicture_PipState state, int32_t errcode); +typedef void (*WebPipLifeCycleCallback)(uint32_t controllerId, PictureInPicture_PipState state, int32_t errcode); /** * @brief The picture-in-picture control event callback @@ -382,7 +382,7 @@ int32_t OH_PictureInPicture_UnregisterAllStartPipCallbacks(uint32_t controllerId * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. * @since 20 */ -int32_t OH_PictureInPicture_RegisterLifecycleListener(uint32_t controllerId, WebPipLifecycleCallback callback); +int32_t OH_PictureInPicture_RegisterLifeCycleListener(uint32_t controllerId, WebPipLifeCycleCallback callback); /** * @brief Unregister picture-in-picture life cycle listener callback. @@ -396,7 +396,7 @@ int32_t OH_PictureInPicture_RegisterLifecycleListener(uint32_t controllerId, Web * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. * @since 20 */ -int32_t OH_PictureInPicture_UnregisterLifecycleListener(uint32_t controllerId, WebPipLifecycleCallback callback); +int32_t OH_PictureInPicture_UnregisterLifeCycleListener(uint32_t controllerId, WebPipLifeCycleCallback callback); /** * @brief Unregister all picture-in-picture life cycle listener callbacks. @@ -409,7 +409,7 @@ int32_t OH_PictureInPicture_UnregisterLifecycleListener(uint32_t controllerId, W * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. * @since 20 */ -int32_t OH_PictureInPicture_UnregisterAllLifecycleListeners(uint32_t controllerId); +int32_t OH_PictureInPicture_UnregisterAllLifeCycleListeners(uint32_t controllerId); /** * @brief Register picture-in-picture control event listener callback. -- Gitee From 4bd1c67af6dd8dff6b2fd725eefb5a4148100493 Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Fri, 16 May 2025 21:21:02 +0800 Subject: [PATCH 8/9] =?UTF-8?q?[fix]=20=E5=88=A0=E9=99=A4=E9=87=8D?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangyaohui --- arkui/window_manager/libwm.ndk.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/arkui/window_manager/libwm.ndk.json b/arkui/window_manager/libwm.ndk.json index 7262ab87e..2b377c479 100644 --- a/arkui/window_manager/libwm.ndk.json +++ b/arkui/window_manager/libwm.ndk.json @@ -123,10 +123,6 @@ "first_instroduced":"20", "name":"OH_PictureInPicture_StopPip" }, - { - "first_instroduced":"20", - "name":"OH_PictureInPicture_StopPip" - }, { "first_instroduced":"20", "name":"OH_PictureInPicture_UpdatePipControlStatus" -- Gitee From 53a974c255ba56942a6607218c99a0eacc46c4be Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Sat, 17 May 2025 11:48:32 +0800 Subject: [PATCH 9/9] =?UTF-8?q?[fix]=20=E5=8D=95=E8=A1=8C=E8=B6=85?= =?UTF-8?q?=E8=BF=87120=EF=BC=8C=E5=8A=A0=E6=8D=A2=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangyaohui --- arkui/window_manager/oh_window_pip.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arkui/window_manager/oh_window_pip.h b/arkui/window_manager/oh_window_pip.h index 53914976b..157722cd9 100644 --- a/arkui/window_manager/oh_window_pip.h +++ b/arkui/window_manager/oh_window_pip.h @@ -243,7 +243,8 @@ int32_t OH_PictureInPicture_SetPipRect(uint32_t controllerId, uint32_t width, ui * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. * @since 20 */ -int32_t OH_PictureInPicture_SetPipControlGroup(uint32_t controllerId, PictureInPicture_PipControlGroup* controlGroup, uint8_t controlGroupLength); +int32_t OH_PictureInPicture_SetPipControlGroup(uint32_t controllerId, PictureInPicture_PipControlGroup* controlGroup, + uint8_t controlGroupLength); /** * @brief Set picture-in-picture napi env. -- Gitee