diff --git a/arkui/window_manager/libwm.ndk.json b/arkui/window_manager/libwm.ndk.json index 53d45ba82333b7ffa112fc80dbfff290f61d0ff6..256ddc7a39aa1ed9a0cdc678224633b0900bf022 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 157722cd902547579dc4778a88a1ab2338c2b04c..4481ae1e647f900cffec256b692685ada1d090ac 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 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, int32_t positionX, int32_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_PIP_INTERNAL_ERROR} pip internal error. + * @since 20 + */ +int32_t OH_PictureInPicture_UnsetPipInitialSurfaceRect(uint32_t controllerId); + /** * @brief Register picture-in-picture controller start callback. *