1 /* 2 * Copyright (c) 2025 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 /** 17 * @addtogroup OH_PictureInPicture 18 * @file oh_window_pip.h 19 * 20 * @brief Declares C APIs for picture in picture window 21 * 22 * @kit ArkUI 23 * @library libnative_window_manager.so 24 * @syscap SystemCapability.Window.SessionManager 25 * @since 20 26 * @version 1.0 27 */ 28 #ifndef OH_WINDOW_PIP_H 29 #define OH_WINDOW_PIP_H 30 31 #include "stdint.h" 32 33 #ifdef __cplusplus 34 extern "C" { 35 #endif 36 37 /** 38 * @brief Picture in picture config. 39 * @since 20 40 */ 41 typedef void* PictureInPicture_PipConfig; 42 43 /** 44 * @brief Enumerates picture in picture template type. 45 * @since 20 46 */ 47 typedef enum { 48 /** Video play. */ 49 VIDEO_PLAY = 0, 50 /** Video call. */ 51 VIDEO_CALL = 1, 52 /** Video meeting. */ 53 VIDEO_MEETING = 2, 54 /** Video live. */ 55 VIDEO_LIVE = 3, 56 } PictureInPicture_PipTemplateType; 57 58 /** 59 * @brief Enumerates picture in picture control group. 60 * @since 20 61 */ 62 typedef enum { 63 /** Previous/next control group for video play. */ 64 VIDEO_PLAY_VIDEO_PREVIOUS_NEXT = 101, 65 /** Fast forward/backward control group for video play. */ 66 VIDEO_PLAY_FAST_FORWARD_BACKWARD = 102, 67 /** Switch on/off the microphone control group for video call. */ 68 VIDEO_CALL_MICROPHONE_SWITCH = 201, 69 /** Hang up control group for video call. */ 70 VIDEO_CALL_HANG_UP_BUTTON = 202, 71 /** Switch on/off the camera control group for video call. */ 72 VIDEO_CALL_CAMERA_SWITCH = 203, 73 /** Mute control group for video call. */ 74 VIDEO_CALL_MUTE_SWITCH = 204, 75 /** Hang up control group for video meeting. */ 76 VIDEO_MEETING_HANG_UP_BUTTON = 301, 77 /** Switch on/off the camera control group for video meeting. */ 78 VIDEO_MEETING_CAMERA_SWITCH = 302, 79 /** Mute control group for video meeting. */ 80 VIDEO_MEETING_MUTE_SWITCH = 303, 81 /** Switch on/off the microphone control group for video meeting. */ 82 VIDEO_MEETING_MICROPHONE_SWITCH = 304, 83 /** Video play/pause control group for video live. */ 84 VIDEO_LIVE_VIDEO_PLAY_PAUSE = 401, 85 /** Mute control group for video live. */ 86 VIDEO_LIVE_MUTE_SWITCH = 402, 87 } PictureInPicture_PipControlGroup; 88 89 /** 90 * @brief Enumerates picture in picture control type. 91 * @since 20 92 */ 93 typedef enum { 94 /** Video play/pause. */ 95 VIDEO_PLAY_PAUSE = 0, 96 /** Video previous. */ 97 VIDEO_PREVIOUS = 1, 98 /** Video next. */ 99 VIDEO_NEXT = 2, 100 /** Video fast forward. */ 101 FAST_FORWARD = 3, 102 /** Video back forward. */ 103 FAST_BACKWARD = 4, 104 /** Hang up. */ 105 HANG_UP_BUTTON = 5, 106 /** Microphone switch. */ 107 MICROPHONE_SWITCH = 6, 108 /** camera switch. */ 109 CAMERA_SWITCH = 7, 110 /** mute switch. */ 111 MUTE_SWITCH = 8, 112 } PictureInPicture_PipControlType; 113 114 /** 115 * @brief Enumerates picture in picture control status. 116 * @since 20 117 */ 118 typedef enum { 119 /** Play. */ 120 PLAY = 1, 121 /** Pause. */ 122 PAUSE = 0, 123 /** Open. */ 124 OPEN = 1, 125 /** Close. */ 126 CLOSE = 0, 127 } PictureInPicture_PipControlStatus; 128 129 /** 130 * @brief Enumerates picture in picture state. 131 * @since 20 132 */ 133 typedef enum { 134 /** About to start. */ 135 ABOUT_TO_START = 1, 136 /** started. */ 137 STARTED = 2, 138 /** About to stop. */ 139 ABOUT_TO_STOP = 3, 140 /** stopped. */ 141 STOPPED = 4, 142 /** About to restore. */ 143 ABOUT_TO_RESTORE = 5, 144 /** Error. */ 145 ERROR = 6, 146 } PictureInPicture_PipState; 147 148 /** 149 * @brief Start the picture-in-picture callback 150 * @param controllerId The picture-in-picture controller ID 151 * @param requestId The picture-in-picture requestId 152 * @param surfaceId The picture-in-picture surfaceId 153 * @since 20 154 */ 155 typedef void (*WebPipStartPipCallback)(uint32_t controllerId, uint8_t requestId, uint64_t surfaceId); 156 157 /** 158 * @brief The picture-in-picture lifecycle callback 159 * @param controllerId The picture-in-picture controller ID 160 * @param state The picture-in-picture state 161 * @param errcode The picture-in-picture error code 162 * @since 20 163 */ 164 typedef void (*WebPipLifecycleCallback)(uint32_t controllerId, PictureInPicture_PipState state, int32_t errcode); 165 166 /** 167 * @brief The picture-in-picture control event callback 168 * @param controllerId The picture-in-picture controller ID 169 * @param controlType The picture-in-picture control type 170 * @param status The picture-in-picture control status 171 * @since 20 172 */ 173 typedef void (*WebPipControlEventCallback)(uint32_t controllerId, PictureInPicture_PipControlType controlType, 174 PictureInPicture_PipControlStatus status); 175 176 /** 177 * @brief The picture-in-picture size change callback 178 * @param controllerId The picture-in-picture controller ID 179 * @param width The picture-in-picture window width 180 * @param height The picture-in-picture window height 181 * @param scale The picture-in-picture window scale 182 * @since 20 183 */ 184 typedef void (*WebPipResizeCallback)(uint32_t controllerId, uint32_t width, uint32_t height, double scale); 185 186 /** 187 * @brief Create picture-in-picture config. 188 * @param pipConfig The picture-in-picture config 189 * @return Return the result code. 190 * {@link OK} the function call is successful. 191 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 192 * @since 20 193 */ 194 int32_t OH_PictureInPicture_CreatePipConfig(PictureInPicture_PipConfig* pipConfig); 195 196 /** 197 * @brief Destroy picture-in-picture config. 198 * @param pipConfig The picture-in-picture config 199 * @return Return the result code. 200 * {@link OK} the function call is successful. 201 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 202 * @since 20 203 */ 204 int32_t OH_PictureInPicture_DestroyPipConfig(PictureInPicture_PipConfig* pipConfig); 205 206 /** 207 * @brief Set picture-in-picture mainWindowId. 208 * 209 * @param pipConfig The picture-in-picture config 210 * @param mainWindowId WindowId of corresponding mainWindow 211 * @return Return the result code. 212 * {@link OK} the function call is successful. 213 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 214 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 215 * @since 20 216 */ 217 int32_t OH_PictureInPicture_SetPipMainWindowId(PictureInPicture_PipConfig pipConfig, uint32_t mainWindowId); 218 219 /** 220 * @brief Set picture-in-picture templateType. 221 * 222 * @param pipConfig The picture-in-picture config 223 * @param pipTemplateType The picture-in-picture template type 224 * @return Return the result code. 225 * {@link OK} the function call is successful. 226 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 227 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 228 * @since 20 229 */ 230 int32_t OH_PictureInPicture_SetPipTemplateType(PictureInPicture_PipConfig pipConfig, 231 PictureInPicture_PipTemplateType pipTemplateType); 232 233 /** 234 * @brief Set picture-in-picture rect. 235 * 236 * @param pipConfig The picture-in-picture config 237 * @param width The picture-in-picture window width 238 * @param height The picture-in-picture window height 239 * @return Return the result code. 240 * {@link OK} the function call is successful. 241 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 242 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 243 * @since 20 244 */ 245 int32_t OH_PictureInPicture_SetPipRect(PictureInPicture_PipConfig pipConfig, uint32_t width, uint32_t height); 246 247 /** 248 * @brief Set picture-in-picture control group. 249 * 250 * @param pipConfig The picture-in-picture config 251 * @param controlGroup The picture-in-picture control group 252 * @param controlGroupLength The length of picture-in-picture control group 253 * @return Return the result code. 254 * {@link OK} the function call is successful. 255 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 256 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 257 * @since 20 258 */ 259 int32_t OH_PictureInPicture_SetPipControlGroup(PictureInPicture_PipConfig pipConfig, 260 PictureInPicture_PipControlGroup* controlGroup, uint8_t controlGroupLength); 261 262 /** 263 * @brief Set picture-in-picture napi env. 264 * 265 * @param pipConfig The picture-in-picture config 266 * @param env The picture-in-picture napi env 267 * @return Return the result code. 268 * {@link OK} the function call is successful. 269 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 270 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 271 * @since 20 272 */ 273 int32_t OH_PictureInPicture_SetPipNapiEnv(PictureInPicture_PipConfig pipConfig, void* env); 274 275 /** 276 * @brief Create picture-in-picture controller. 277 * @param pipConfig The picture-in-picture config 278 * @param controllerId The picture-in-picture controller ID 279 * @return Return the result code. 280 * {@link OK} the function call is successful. 281 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 282 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 283 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 284 * @since 20 285 */ 286 int32_t OH_PictureInPicture_CreatePip(PictureInPicture_PipConfig pipConfig, uint32_t* controllerId); 287 288 /** 289 * @brief Delete picture-in-picture controller. 290 * 291 * @param controllerId The picture-in-picture controller ID 292 * @return Return the result code. 293 * {@link OK} The function call is successful. 294 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 295 * @since 20 296 */ 297 int32_t OH_PictureInPicture_DeletePip(uint32_t controllerId); 298 299 /** 300 * @brief Start picture-in-picture. 301 * 302 * @param controllerId The picture-in-picture controller ID 303 * @return Return the result code. 304 * {@link OK} the function call is successful. 305 * {@link WINDOW_MANAGER_ERRORCODE_PIP_STATE_ABNORMAL} the PiP window state is abnormal. 306 * {@link WINDOW_MANAGER_ERRORCODE_PIP_CREATE_FAILED} failed to create the PiP window. 307 * {@link WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 308 * {@link WINDOW_MANAGER_ERRORCODE_PIP_REPEATED_OPERATION} repeated PiP operation. 309 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 310 * @since 20 311 */ 312 int32_t OH_PictureInPicture_StartPip(uint32_t controllerId); 313 314 /** 315 * @brief Stop picture-in-picture. 316 * 317 * @param controllerId The picture-in-picture controller ID 318 * @return Return the result code. 319 * {@link OK} the function call is successful. 320 * {@link WINDOW_MANAGER_ERRORCODE_PIP_DESTROY_FAILED} failed to destroy the PiP window. 321 * {@link WINDOW_MANAGER_ERRORCODE_PIP_STATE_ABNORMAL} the PiP window state is abnormal. 322 * {@link WINDOW_MANAGER_ERRORCODE_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 323 * {@link WINDOW_MANAGER_ERRORCODE_PIP_REPEATED_OPERATION} repeated PiP operation. 324 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 325 * @since 20 326 */ 327 int32_t OH_PictureInPicture_StopPip(uint32_t controllerId); 328 329 /** 330 * @brief Update picture-in-picture content size. 331 * 332 * @param controllerId The picture-in-picture controller ID 333 * @param width The picture-in-picture content width 334 * @param height The picture-in-picture content height 335 * @return Return the result code. 336 * {@link OK} the function call is successful. 337 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 338 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 339 * @since 20 340 */ 341 int32_t OH_PictureInPicture_UpdatePipContentSize(uint32_t controllerId, uint32_t width, uint32_t height); 342 343 /** 344 * @brief Update picture-in-picture control status. 345 * 346 * @param controllerId The picture-in-picture controller ID 347 * @param controlType The picture-in-picture control type. 348 * @param status The picture-in-picture control status. 349 * @return Return the result code. 350 * {@link OK} the function call is successful. 351 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 352 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 353 * @since 20 354 */ 355 int32_t OH_PictureInPicture_UpdatePipControlStatus(uint32_t controllerId, PictureInPicture_PipControlType controlType, 356 PictureInPicture_PipControlStatus status); 357 358 /** 359 * @brief Set picture-in-picture controll enable status. 360 * 361 * @param controllerId The picture-in-picture controller ID 362 * @param controlType The picture-in-picture control type. 363 * @param enabled Indicate the picture-in-picture control is enabled. 364 * @return Return the result code. 365 * {@link OK} the function call is successful. 366 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 367 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 368 * @since 20 369 */ 370 int32_t OH_PictureInPicture_SetPipControlEnabled(uint32_t controllerId, PictureInPicture_PipControlType controlType, 371 bool enabled); 372 373 /** 374 * @brief Set picture-in-picture initial surface rect. 375 * 376 * @param controllerId The picture-in-picture controller ID 377 * @param positionX The X position of the first frame when start the picture-in-picture. 378 * @param positionY The Y position of the first frame when start the picture-in-picture. 379 * @param width The width of the first frame when start the picture-in-picture. 380 * @param height The height of the first frame when start the picture-in-picture. 381 * @return Return the result code. 382 * {@link OK} the function call is successful. 383 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 384 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 385 * @since 20 386 */ 387 int32_t OH_PictureInPicture_SetPipInitialSurfaceRect(uint32_t controllerId, int32_t positionX, int32_t positionY, 388 uint32_t width, uint32_t height); 389 390 /** 391 * @brief Unset picture-in-picture initial surface rect. 392 * 393 * @param controllerId The picture-in-picture controller ID 394 * @return Return the result code. 395 * {@link OK} the function call is successful. 396 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 397 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 398 * @since 20 399 */ 400 int32_t OH_PictureInPicture_UnsetPipInitialSurfaceRect(uint32_t controllerId); 401 402 /** 403 * @brief Register picture-in-picture controller start callback. 404 * 405 * @param controllerId The picture-in-picture controller ID 406 * @param callback Start the picture-in-picture callback 407 * @return Return the result code. 408 * {@link OK} the function call is successful. 409 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 410 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 411 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 412 * @since 20 413 */ 414 int32_t OH_PictureInPicture_RegisterStartPipCallback(uint32_t controllerId, WebPipStartPipCallback callback); 415 416 /** 417 * @brief Unregister picture-in-picture controller start callback. 418 * 419 * @param controllerId The picture-in-picture controller ID 420 * @param callback Start the picture-in-picture callback 421 * @return Return the result code. 422 * {@link OK} the function call is successful. 423 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 424 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 425 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 426 * @since 20 427 */ 428 int32_t OH_PictureInPicture_UnregisterStartPipCallback(uint32_t controllerId, WebPipStartPipCallback callback); 429 430 /** 431 * @brief Unregister all picture-in-picture controller start callbacks. 432 * 433 * @param controllerId The picture-in-picture controller ID 434 * @return Return the result code. 435 * {@link OK} the function call is successful. 436 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 437 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 438 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 439 * @since 20 440 */ 441 int32_t OH_PictureInPicture_UnregisterAllStartPipCallbacks(uint32_t controllerId); 442 443 /** 444 * @brief Register picture-in-picture lifecycle listener callback. 445 * 446 * @param controllerId The picture-in-picture controller ID 447 * @param callback The picture-in-picture lifecycle callback. 448 * @return Return the result code. 449 * {@link OK} the function call is successful. 450 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 451 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 452 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 453 * @since 20 454 */ 455 int32_t OH_PictureInPicture_RegisterLifecycleListener(uint32_t controllerId, WebPipLifecycleCallback callback); 456 457 /** 458 * @brief Unregister picture-in-picture lifecycle listener callback. 459 * 460 * @param controllerId The picture-in-picture controller ID 461 * @param callback The picture-in-picture lifecycle callback. 462 * @return Return the result code. 463 * {@link OK} the function call is successful. 464 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 465 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 466 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 467 * @since 20 468 */ 469 int32_t OH_PictureInPicture_UnregisterLifecycleListener(uint32_t controllerId, WebPipLifecycleCallback callback); 470 471 /** 472 * @brief Unregister all picture-in-picture lifecycle listener callbacks. 473 * 474 * @param controllerId The picture-in-picture controller ID 475 * @return Return the result code. 476 * {@link OK} the function call is successful. 477 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 478 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 479 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 480 * @since 20 481 */ 482 int32_t OH_PictureInPicture_UnregisterAllLifecycleListeners(uint32_t controllerId); 483 484 /** 485 * @brief Register picture-in-picture control event listener callback. 486 * 487 * @param controllerId The picture-in-picture controller ID 488 * @param callback The picture-in-picture control event callback. 489 * @return Return the result code. 490 * {@link OK} the function call is successful. 491 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 492 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 493 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 494 * @since 20 495 */ 496 int32_t OH_PictureInPicture_RegisterControlEventListener(uint32_t controllerId, WebPipControlEventCallback callback); 497 498 /** 499 * @brief Unregister picture-in-picture control event listener callback. 500 * 501 * @param controllerId The picture-in-picture controller ID 502 * @param callback The picture-in-picture control event callback. 503 * @return Return the result code. 504 * {@link OK} the function call is successful. 505 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 506 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 507 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 508 * @since 20 509 */ 510 int32_t OH_PictureInPicture_UnregisterControlEventListener(uint32_t controllerId, WebPipControlEventCallback callback); 511 512 /** 513 * @brief Unregister all picture-in-picture control event listener callbacks. 514 * 515 * @param controllerId The picture-in-picture controller ID 516 * @return Return the result code. 517 * {@link OK} the function call is successful. 518 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 519 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 520 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 521 * @since 20 522 */ 523 int32_t OH_PictureInPicture_UnregisterAllControlEventListeners(uint32_t controllerId); 524 525 /** 526 * @brief Register picture-in-picture resize listener callback. 527 * 528 * @param controllerId The picture-in-picture controller ID 529 * @param callback The picture-in-picture size change callback. 530 * @return Return the result code. 531 * {@link OK} the function call is successful. 532 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 533 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 534 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 535 * @since 20 536 */ 537 int32_t OH_PictureInPicture_RegisterResizeListener(uint32_t controllerId, WebPipResizeCallback callback); 538 539 /** 540 * @brief Unregister picture-in-picture resize listener callback. 541 * 542 * @param controllerId The picture-in-picture controller ID 543 * @param callback The picture-in-picture size change callback. 544 * @return Return the result code. 545 * {@link OK} the function call is successful. 546 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 547 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 548 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 549 * @since 20 550 */ 551 int32_t OH_PictureInPicture_UnregisterResizeListener(uint32_t controllerId, WebPipResizeCallback callback); 552 553 /** 554 * @brief Unregister all picture-in-picture resize listener callbacks. 555 * 556 * @param controllerId The picture-in-picture controller ID 557 * @return Return the result code. 558 * {@link OK} the function call is successful. 559 * {@link WINDOW_MANAGER_ERRORCODE_INCORRECT_PARAM} parameter error. 560 * {@link WINDOW_MANAGER_ERRORCODE_DEVICE_NOT_SUPPORTED} capability not supported. 561 * {@link WINDOW_MANAGER_ERRORCODE_PIP_INTERNAL_ERROR} pip internal error. 562 * @since 20 563 */ 564 int32_t OH_PictureInPicture_UnregisterAllResizeListeners(uint32_t controllerId); 565 566 #ifdef __cplusplus 567 } 568 #endif 569 570 #endif // OH_WINDOW_PIP_H