From adde12eb316b8fc2dcd7e26e14e85f64b2c6e7b1 Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Wed, 4 Jun 2025 09:43:33 +0800 Subject: [PATCH 1/3] add setInitRect interface to pip ndk Signed-off-by: wangyaohui --- arkui/window_manager/libwm.ndk.json | 9 +++++++++ arkui/window_manager/oh_window_pip.h | 29 ++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/arkui/window_manager/libwm.ndk.json b/arkui/window_manager/libwm.ndk.json index 53d45ba82..256ddc7a3 100644 --- a/arkui/window_manager/libwm.ndk.json +++ b/arkui/window_manager/libwm.ndk.json @@ -135,6 +135,15 @@ "first_instroduced":"20", "name":"OH_PictureInPicture_SetPipControlEnabled" }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_SetPipInitialSurfaceRect" + }, + { + "first_instroduced":"20", + "name":"OH_PictureInPicture_UnsetPipInitialSurfaceRect" + }, + { "first_instroduced":"20", "name":"OH_PictureInPicture_RegisterStartPipCallback" diff --git a/arkui/window_manager/oh_window_pip.h b/arkui/window_manager/oh_window_pip.h index 157722cd9..a59ba12dc 100644 --- a/arkui/window_manager/oh_window_pip.h +++ b/arkui/window_manager/oh_window_pip.h @@ -330,6 +330,35 @@ void OH_PictureInPicture_UpdatePipControlStatus(uint32_t controllerId, PictureIn void OH_PictureInPicture_SetPipControlEnabled(uint32_t controllerId, PictureInPicture_PipControlType controlType, bool enabled); +/** + * @brief Set picture-in-picture initial surface rect. + * + * @param controllerId The picture-in-picture controller ID + * @param positionX The X position of the first frame when start picture-in-picture. + * @param positionY The Y position of the first frame when start picture-in-picture. + * @param width The width of the first frame when start picture-in-picture. + * @param height The height of the first frame when start picture-in-picture. + * @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_SetPipInitialSurfaceRect(uint32_t controllerId, uint32_t positionX, uint32_t positionY, + uint32_t width, uint32_t height); + +/** + * @brief Unset picture-in-picture initial surface rect. + * + * @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. + * @since 20 + */ +int32_t OH_PictureInPicture_UnsetPipInitialSurfaceRect(uint32_t controllerId); + /** * @brief Register picture-in-picture controller start callback. * -- Gitee From ae65fe01b7c945c41eca7c9c2e8d35c2b269c08d Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Wed, 4 Jun 2025 09:57:57 +0800 Subject: [PATCH 2/3] errCode Signed-off-by: wangyaohui --- arkui/window_manager/oh_window_pip.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arkui/window_manager/oh_window_pip.h b/arkui/window_manager/oh_window_pip.h index a59ba12dc..840a45718 100644 --- a/arkui/window_manager/oh_window_pip.h +++ b/arkui/window_manager/oh_window_pip.h @@ -341,7 +341,7 @@ void OH_PictureInPicture_SetPipControlEnabled(uint32_t controllerId, PictureInPi * @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_SetPipInitialSurfaceRect(uint32_t controllerId, uint32_t positionX, uint32_t positionY, @@ -354,7 +354,7 @@ int32_t OH_PictureInPicture_SetPipInitialSurfaceRect(uint32_t controllerId, uint * @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_UnsetPipInitialSurfaceRect(uint32_t controllerId); -- Gitee From a1bf5bc011dad97d0416846a598233a33d69b519 Mon Sep 17 00:00:00 2001 From: wangyaohui Date: Sat, 7 Jun 2025 11:47:53 +0800 Subject: [PATCH 3/3] codeCheck Signed-off-by: wangyaohui --- arkui/window_manager/oh_window_pip.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/arkui/window_manager/oh_window_pip.h b/arkui/window_manager/oh_window_pip.h index 840a45718..4481ae1e6 100644 --- a/arkui/window_manager/oh_window_pip.h +++ b/arkui/window_manager/oh_window_pip.h @@ -334,17 +334,17 @@ void OH_PictureInPicture_SetPipControlEnabled(uint32_t controllerId, PictureInPi * @brief Set picture-in-picture initial surface rect. * * @param controllerId The picture-in-picture controller ID - * @param positionX The X position of the first frame when start picture-in-picture. - * @param positionY The Y position of the first frame when start picture-in-picture. - * @param width The width of the first frame when start picture-in-picture. - * @param height The height of the first frame when start picture-in-picture. + * @param positionX The X position of the first frame when start the picture-in-picture. + * @param positionY The Y position of the first frame when start the picture-in-picture. + * @param width The width of the first frame when start the picture-in-picture. + * @param height The height of the first frame when start the picture-in-picture. * @return Return the result code. * {@link OK} the function call is successful. * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. * @since 20 */ -int32_t OH_PictureInPicture_SetPipInitialSurfaceRect(uint32_t controllerId, uint32_t positionX, uint32_t positionY, +int32_t OH_PictureInPicture_SetPipInitialSurfaceRect(uint32_t controllerId, int32_t positionX, int32_t positionY, uint32_t width, uint32_t height); /** -- Gitee