1# native_avscreen_capture_base.h 2<!--Kit: Media Kit--> 3<!--Subsystem: Multimedia--> 4<!--Owner: @zzs_911--> 5<!--Designer: @stupig001--> 6<!--Tester: @xdlinc--> 7<!--Adviser: @zengyawen--> 8 9## Overview 10 11The file declares the common structs, character constants, and enums used for running screen capture. 12 13**File to include**: <multimedia/player_framework/native_avscreen_capture_base.h> 14 15**Library**: libnative_avscreen_capture.so 16 17**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 18 19**Since**: 10 20 21**Related module**: [AVScreenCapture](capi-avscreencapture.md) 22 23## Summary 24 25### Structs 26 27| Name| typedef Keyword| Description| 28| -- | -- | -- | 29| [OH_AudioCaptureInfo](capi-avscreencapture-oh-audiocaptureinfo.md) | OH_AudioCaptureInfo | Describes the audio capture information.<br>When both **audioSampleRate** and **audioChannels** are **0**, the audio-related parameters are ignored and the audio data is not recorded.| 30| [OH_AudioEncInfo](capi-avscreencapture-oh-audioencinfo.md) | OH_AudioEncInfo | Describes the audio encoding information.| 31| [OH_AudioInfo](capi-avscreencapture-oh-audioinfo.md) | OH_AudioInfo | Describes the audio information.<br>To perform both external capture (using microphones) and internal capture, **audioSampleRate** and **audioChannels** must be the same for both audio channels.| 32| [OH_VideoCaptureInfo](capi-avscreencapture-oh-videocaptureinfo.md) | OH_VideoCaptureInfo | Describes the video capture information. When **videoFrameWidth** and **videoFrameHeight** are both **0**, video-related parameters are ignored and screen data is not recorded.| 33| [OH_VideoEncInfo](capi-avscreencapture-oh-videoencinfo.md) | OH_VideoEncInfo | Describes the video encoding information.| 34| [OH_VideoInfo](capi-avscreencapture-oh-videoinfo.md) | OH_VideoInfo | Describes the video information.| 35| [OH_RecorderInfo](capi-avscreencapture-oh-recorderinfo.md) | OH_RecorderInfo | Describes the recording file information.| 36| [OH_AVScreenCaptureConfig](capi-avscreencapture-oh-avscreencaptureconfig.md) | OH_AVScreenCaptureConfig | Describes the screen capture configuration.| 37| [OH_AVScreenCaptureCallback](capi-avscreencapture-oh-avscreencapturecallback.md) | OH_AVScreenCaptureCallback | Defines all the asynchronous callback function pointers of an OH_AVScreenCapture instance. To ensure the normal running of OH_AVScreenCapture, you must register the instance of this struct with the OH_AVScreenCapture instance and process the information reported by the callback functions.<br>From API version 12, you are advised to use [OH_AVScreenCapture_OnError](#oh_avscreencapture_onerror) and [OH_AVScreenCapture_OnBufferAvailable](#oh_avscreencapture_onbufferavailable) instead.| 38| [OH_Rect](capi-avscreencapture-oh-rect.md) | OH_Rect | Describes the width, height, and image information of the rectangle used for screen capture.| 39| [OH_AudioBuffer](capi-avscreencapture-oh-audiobuffer.md) | OH_AudioBuffer | Describes the configuration such as the size, type, and timestamp of audio data.| 40| [OH_NativeBuffer](capi-avscreencapture-avscreencapture-oh-nativebuffer.md) | OH_NativeBuffer | Describes the native video stream class for screen capture.| 41| [OH_AVScreenCapture](capi-avscreencapture-oh-avscreencapture.md) | OH_AVScreenCapture | Describes a screen capture instance used to obtain original video and audio streams.| 42| [OH_AVScreenCapture_ContentFilter](capi-avscreencapture-oh-avscreencapture-contentfilter.md) | OH_AVScreenCapture_ContentFilter | Describes the filter used to filter audio and video content.| 43| [OH_AVScreenCapture_CaptureStrategy](capi-avscreencapture-oh-avscreencapture-capturestrategy.md) | OH_AVScreenCapture_CaptureStrategy | Describes the screen capture strategy configured by using OH_AVScreenCapture_CaptureStrategy.| 44| [OH_AVScreenCapture_UserSelectionInfo](capi-avscreencapture-oh-avscreencapture-userselectioninfo.md) | OH_AVScreenCapture_UserSelectionInfo | Describes the parameters selected by the user on the authorization UI (selection UI) by using OH_AVScreenCapture_UserSelectionInfo.| 45 46### Enums 47 48| Name| typedef Keyword| Description| 49| -- | -- | -- | 50| [OH_CaptureMode](#oh_capturemode) | OH_CaptureMode | Enumerates the screen capture modes.| 51| [OH_AudioCaptureSourceType](#oh_audiocapturesourcetype) | OH_AudioCaptureSourceType | Enumerates the audio source types during screen capture.| 52| [OH_AudioCodecFormat](#oh_audiocodecformat) | OH_AudioCodecFormat | Enumerates the audio encoding formats.| 53| [OH_VideoCodecFormat](#oh_videocodecformat) | OH_VideoCodecFormat | Enumerates the video encoding formats.| 54| [OH_DataType](#oh_datatype) | OH_DataType | Enumerates the data types of screen capture streams.| 55| [OH_VideoSourceType](#oh_videosourcetype) | OH_VideoSourceType | Enumerates the video source formats. Currently, only the RGBA format is supported.| 56| [OH_ContainerFormatType](#oh_containerformattype) | OH_ContainerFormatType | Enumerates the types of files generated during screen capture.| 57| [OH_AVScreenCaptureStateCode](#oh_avscreencapturestatecode) | OH_AVScreenCaptureStateCode | Enumerates the screen capture states.| 58| [OH_AVScreenCaptureBufferType](#oh_avscreencapturebuffertype) | OH_AVScreenCaptureBufferType | Enumerates the buffer types.| 59| [OH_AVScreenCaptureFilterableAudioContent](#oh_avscreencapturefilterableaudiocontent) | OH_AVScreenCaptureFilterableAudioContent | Enumerates the types of audio that can be added to a content filter.| 60| [OH_AVScreenCaptureContentChangedEvent](#oh_avscreencapturecontentchangedevent) | OH_AVScreenCaptureContentChangedEvent | Enumerates the screen capture content change events.| 61| [OH_AVScreenCapture_FillMode](#oh_avscreencapture_fillmode) | OH_AVScreenCapture_FillMode | Enumerates the image fill modes.| 62 63### Functions 64 65| Name| typedef Keyword| Description| 66| -- | -- | -- | 67| [typedef void (\*OH_AVScreenCaptureOnError)(OH_AVScreenCapture *capture, int32_t errorCode)](#oh_avscreencaptureonerror) | OH_AVScreenCaptureOnError | Called when an error occurs during the running of an OH_AVScreenCapture instance.<br>From API version 12, you are advised to use [OH_AVScreenCapture_OnError](#oh_avscreencapture_onerror) instead.| 68| [typedef void (\*OH_AVScreenCaptureOnAudioBufferAvailable)(OH_AVScreenCapture *capture, bool isReady, OH_AudioCaptureSourceType type)](#oh_avscreencaptureonaudiobufferavailable) | OH_AVScreenCaptureOnAudioBufferAvailable | Called when an audio buffer is available during the running of an OH_AVScreenCapture instance.<br>From API version 12, you are advised to use [OH_AVScreenCapture_OnBufferAvailable](#oh_avscreencapture_onbufferavailable) instead.| 69| [typedef void (\*OH_AVScreenCaptureOnVideoBufferAvailable)(OH_AVScreenCapture *capture, bool isReady)](#oh_avscreencaptureonvideobufferavailable) | OH_AVScreenCaptureOnVideoBufferAvailable | Called when a video buffer is available during the running of an OH_AVScreenCapture instance.<br>From API version 12, you are advised to use [OH_AVScreenCapture_OnBufferAvailable](#oh_avscreencapture_onbufferavailable) instead.| 70| [typedef void (\*OH_AVScreenCapture_OnStateChange)(struct OH_AVScreenCapture *capture, OH_AVScreenCaptureStateCode stateCode, void *userData)](#oh_avscreencapture_onstatechange) | OH_AVScreenCapture_OnStateChange | Called when the state changes during the running of an OH_AVScreenCapture instance.| 71| [typedef void (\*OH_AVScreenCapture_OnError)(OH_AVScreenCapture *capture, int32_t errorCode, void *userData)](#oh_avscreencapture_onerror) | OH_AVScreenCapture_OnError | Called when an error occurs during the running of an OH_AVScreenCapture instance.| 72| [typedef void (\*OH_AVScreenCapture_OnBufferAvailable)(OH_AVScreenCapture *capture, OH_AVBuffer *buffer, OH_AVScreenCaptureBufferType bufferType, int64_t timestamp, void *userData)](#oh_avscreencapture_onbufferavailable) | OH_AVScreenCapture_OnBufferAvailable | Called when an audio buffer or a video buffer is available during the running of an OH_AVScreenCapture instance.| 73| [typedef void (\*OH_AVScreenCapture_OnDisplaySelected)(OH_AVScreenCapture *capture, uint64_t displayId, void *userData)](#oh_avscreencapture_ondisplayselected) | OH_AVScreenCapture_OnDisplaySelected | Called when screen capture starts.| 74| [typedef void (\*OH_AVScreenCapture_OnCaptureContentChanged)(OH_AVScreenCapture* capture, OH_AVScreenCaptureContentChangedEvent event, OH_Rect* area, void *userData)](#oh_avscreencapture_oncapturecontentchanged) | OH_AVScreenCapture_OnCaptureContentChanged | Called when the screen capture content changes during the running of an OH_AVScreenCapture instance.| 75| [typedef void (\*OH_AVScreenCapture_OnUserSelected)(OH_AVScreenCapture* capture, OH_AVScreenCapture_UserSelectionInfo* selections, void *userData)](#oh_avscreencapture_onuserselected) | OH_AVScreenCapture_OnUserSelected | Called to return the parameters selected by the user on the authorization UI to the application.| 76 77## Enum Description 78 79### OH_CaptureMode 80 81``` 82enum OH_CaptureMode 83``` 84 85**Description** 86 87Enumerates the screen capture modes. 88 89**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 90 91**Since**: 10 92 93| Enum Item| Description| 94| -- | -- | 95| OH_CAPTURE_HOME_SCREEN = 0 | Captures the home screen.| 96| OH_CAPTURE_SPECIFIED_SCREEN = 1 | Captures a specified screen.| 97| OH_CAPTURE_SPECIFIED_WINDOW = 2 | Captures a specified window.| 98| OH_CAPTURE_INVAILD = -1 | Invalid mode.| 99 100### OH_AudioCaptureSourceType 101 102``` 103enum OH_AudioCaptureSourceType 104``` 105 106**Description** 107 108Enumerates the audio source types during screen capture. 109 110**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 111 112**Since**: 10 113 114| Enum Item| Description| 115| -- | -- | 116| OH_SOURCE_INVALID = -1 | Invalid audio source.| 117| OH_SOURCE_DEFAULT = 0 | Default audio source. The default value is **OH_MIC**.| 118| OH_MIC = 1 | External audio streams recorded by the microphone.| 119| OH_ALL_PLAYBACK = 2 | All internal audio streams played by the system.| 120| OH_APP_PLAYBACK = 3 | Internal audio streams played by a specified application.| 121 122### OH_AudioCodecFormat 123 124``` 125enum OH_AudioCodecFormat 126``` 127 128**Description** 129 130Enumerates the audio encoding formats. 131 132**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 133 134**Since**: 10 135 136| Enum Item| Description| 137| -- | -- | 138| OH_AUDIO_DEFAULT = 0 | Default audio encoding format. The default value is **AAC_LC**.| 139| OH_AAC_LC = 3 | AAC_LC audio encoding.| 140| OH_AUDIO_CODEC_FORMAT_BUTT | Invalid format.| 141 142### OH_VideoCodecFormat 143 144``` 145enum OH_VideoCodecFormat 146``` 147 148**Description** 149 150Enumerates the video encoding formats. 151 152**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 153 154**Since**: 10 155 156| Enum Item| Description| 157| -- | -- | 158| OH_VIDEO_DEFAULT = 0 | Default video encoding format. The default value is **H.264**.| 159| OH_H264 = 2 | H.264.| 160| OH_H265 = 4 | H.265/HEVC.| 161| OH_MPEG4 = 6 | MPEG4.| 162| OH_VP8 = 8 | VP8.| 163| OH_VP9 = 10 | VP9.| 164| OH_VIDEO_CODEC_FORMAT_BUTT | Invalid format.| 165 166### OH_DataType 167 168``` 169enum OH_DataType 170``` 171 172**Description** 173 174Enumerates the data types of screen capture streams. 175 176**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 177 178**Since**: 10 179 180| Enum Item| Description| 181| -- | -- | 182| OH_ORIGINAL_STREAM = 0 | Original stream format, such as YUV, RGBA, and PCM.| 183| OH_ENCODED_STREAM = 1 | Encoded stream format, such as H.264 and AAC. This value is not supported yet.| 184| OH_CAPTURE_FILE = 2 | Format of the recording file. The value can be **mp4**.| 185| OH_INVAILD = -1 | Invalid format.| 186 187### OH_VideoSourceType 188 189``` 190enum OH_VideoSourceType 191``` 192 193**Description** 194 195Enumerates the video source formats. Currently, only the RGBA format is supported. 196 197**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 198 199**Since**: 10 200 201| Enum Item| Description| 202| -- | -- | 203| OH_VIDEO_SOURCE_SURFACE_YUV = 0 | YUV format. This value is not supported yet.| 204| OH_VIDEO_SOURCE_SURFACE_ES | Raw format. This value is not supported yet.| 205| OH_VIDEO_SOURCE_SURFACE_RGBA | RGBA format.| 206| OH_VIDEO_SOURCE_BUTT | Invalid format.| 207 208### OH_ContainerFormatType 209 210``` 211enum OH_ContainerFormatType 212``` 213 214**Description** 215 216Enumerates the types of files generated during screen capture. 217 218**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 219 220**Since**: 10 221 222| Enum Item| Description| 223| -- | -- | 224| CFT_MPEG_4A = 0 | Audio format M4A.| 225| CFT_MPEG_4 = 1 | Video format MP4.| 226 227### OH_AVScreenCaptureStateCode 228 229``` 230enum OH_AVScreenCaptureStateCode 231``` 232 233**Description** 234 235Enumerates the screen capture states. 236 237**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 238 239**Since**: 12 240 241| Enum Item| Description| 242| -- | -- | 243| OH_SCREEN_CAPTURE_STATE_STARTED = 0 | Screen capture is started.| 244| OH_SCREEN_CAPTURE_STATE_CANCELED = 1 | Screen capture is canceled.| 245| OH_SCREEN_CAPTURE_STATE_STOPPED_BY_USER = 2 | Screen capture is stopped.| 246| OH_SCREEN_CAPTURE_STATE_INTERRUPTED_BY_OTHER = 3 | Screen capture is interrupted by another screen capture.| 247| OH_SCREEN_CAPTURE_STATE_STOPPED_BY_CALL = 4 | Screen capture is interrupted by a call.| 248| OH_SCREEN_CAPTURE_STATE_MIC_UNAVAILABLE = 5 | The microphone is unavailable.| 249| OH_SCREEN_CAPTURE_STATE_MIC_MUTED_BY_USER = 6 | The microphone is muted.| 250| OH_SCREEN_CAPTURE_STATE_MIC_UNMUTED_BY_USER = 7 | The microphone is unmuted.| 251| OH_SCREEN_CAPTURE_STATE_ENTER_PRIVATE_SCENE = 8 | The system enters a privacy screen.| 252| OH_SCREEN_CAPTURE_STATE_EXIT_PRIVATE_SCENE = 9 | The system exits a privacy screen.| 253| OH_SCREEN_CAPTURE_STATE_STOPPED_BY_USER_SWITCHES = 10 | Screen capture is interrupted by system user switching.| 254 255### OH_AVScreenCaptureBufferType 256 257``` 258enum OH_AVScreenCaptureBufferType 259``` 260 261**Description** 262 263Enumerates the buffer types. 264 265**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 266 267**Since**: 12 268 269| Enum Item| Description| 270| -- | -- | 271| OH_SCREEN_CAPTURE_BUFFERTYPE_VIDEO = 0 | Video data.| 272| OH_SCREEN_CAPTURE_BUFFERTYPE_AUDIO_INNER = 1 | Internal audio capture data.| 273| OH_SCREEN_CAPTURE_BUFFERTYPE_AUDIO_MIC = 2 | Microphone audio data.| 274 275### OH_AVScreenCaptureFilterableAudioContent 276 277``` 278enum OH_AVScreenCaptureFilterableAudioContent 279``` 280 281**Description** 282 283Enumerates the types of audio that can be added to a content filter. 284 285**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 286 287**Since**: 12 288 289| Enum Item| Description| 290| -- | -- | 291| OH_SCREEN_CAPTURE_NOTIFICATION_AUDIO = 0 | Notification tone.| 292| OH_SCREEN_CAPTURE_CURRENT_APP_AUDIO = 1 | Sound of the application itself.| 293 294### OH_AVScreenCaptureContentChangedEvent 295 296``` 297enum OH_AVScreenCaptureContentChangedEvent 298``` 299 300**Description** 301 302Enumerates the screen capture content change events. 303 304**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 305 306**Since**: 20 307 308| Enum Item| Description| 309| -- | -- | 310| OH_SCREEN_CAPTURE_CONTENT_HIDE = 0 | The screen capture content is hidden.| 311| OH_SCREEN_CAPTURE_CONTENT_VISIBLE = 1 | The screen capture content is visible.| 312| OH_SCREEN_CAPTURE_CONTENT_UNAVAILABLE = 2 | The screen capture content becomes unavailable. For example, the screen capture window is closed.| 313 314### OH_AVScreenCapture_FillMode 315 316``` 317enum OH_AVScreenCapture_FillMode 318``` 319 320**Description** 321 322Enumerates the image fill modes. 323 324**Since**: 20 325 326| Enum Item| Description| 327| -- | -- | 328| OH_SCREENCAPTURE_FILLMODE_ASPECT_SCALE_FIT = 0 | Keeps the original aspect ratio of the image to fit the target size. Black bars may appear if the aspect ratios differ.| 329| OH_SCREENCAPTURE_FILLMODE_SCALE_TO_FILL = 1 | Stretches the image to fill the target size. The image may stretch and distort if the aspect ratios differ.| 330 331 332## Function Description 333 334### OH_AVScreenCaptureOnError() 335 336``` 337typedef void (*OH_AVScreenCaptureOnError)(OH_AVScreenCapture *capture, int32_t errorCode) 338``` 339 340**Description** 341 342Called when an error occurs during the running of an OH_AVScreenCapture instance. 343 344From API version 12, you are advised to use [OH_AVScreenCapture_OnError](#oh_avscreencapture_onerror) instead. 345 346**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 347 348**Since**: 10 349 350 351**Parameters** 352 353| Parameter| Description| 354| -- | -- | 355| [OH_AVScreenCapture](capi-avscreencapture-oh-avscreencapture.md) *capture | Pointer to the OH_AVScreenCapture instance.| 356| int32_t errorCode | Error code.| 357 358### OH_AVScreenCaptureOnAudioBufferAvailable() 359 360``` 361typedef void (*OH_AVScreenCaptureOnAudioBufferAvailable)(OH_AVScreenCapture *capture, bool isReady,OH_AudioCaptureSourceType type) 362``` 363 364**Description** 365 366Called when an audio buffer is available during the running of an OH_AVScreenCapture instance. 367 368From API version 12, you are advised to use [OH_AVScreenCapture_OnBufferAvailable](#oh_avscreencapture_onbufferavailable) instead. 369 370**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 371 372**Since**: 10 373 374 375**Parameters** 376 377| Parameter| Description| 378| -- | -- | 379| [OH_AVScreenCapture](capi-avscreencapture-oh-avscreencapture.md) *capture | Pointer to the OH_AVScreenCapture instance.| 380| bool isReady | Whether the audio buffer is available.| 381| [OH_AudioCaptureSourceType](#oh_audiocapturesourcetype) type | Audio source type.| 382 383### OH_AVScreenCaptureOnVideoBufferAvailable() 384 385``` 386typedef void (*OH_AVScreenCaptureOnVideoBufferAvailable)(OH_AVScreenCapture *capture, bool isReady) 387``` 388 389**Description** 390 391Called when a video buffer is available during the running of an OH_AVScreenCapture instance. 392 393From API version 12, you are advised to use [OH_AVScreenCapture_OnBufferAvailable](#oh_avscreencapture_onbufferavailable) instead. 394 395**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 396 397**Since**: 10 398 399 400**Parameters** 401 402| Parameter| Description| 403| -- | -- | 404| [OH_AVScreenCapture](capi-avscreencapture-oh-avscreencapture.md) *capture | Pointer to the OH_AVScreenCapture instance.| 405| bool isReady | Whether the video buffer is available.| 406 407### OH_AVScreenCapture_OnStateChange() 408 409``` 410typedef void (*OH_AVScreenCapture_OnStateChange)(struct OH_AVScreenCapture *capture,OH_AVScreenCaptureStateCode stateCode, void *userData) 411``` 412 413**Description** 414 415Called when the state changes during the running of an OH_AVScreenCapture instance. 416 417**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 418 419**Since**: 12 420 421 422**Parameters** 423 424| Parameter| Description| 425| -- | -- | 426| struct [OH_AVScreenCapture](capi-avscreencapture-oh-avscreencapture.md) *capture | Pointer to the OH_AVScreenCapture instance.| 427| [OH_AVScreenCaptureStateCode](#oh_avscreencapturestatecode) stateCode | Status code.| 428| void *userData | Pointer to the user-defined data carried in the function.| 429 430### OH_AVScreenCapture_OnError() 431 432``` 433typedef void (*OH_AVScreenCapture_OnError)(OH_AVScreenCapture *capture, int32_t errorCode, void *userData) 434``` 435 436**Description** 437 438Called when an error occurs during the running of an OH_AVScreenCapture instance. 439 440**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 441 442**Since**: 12 443 444 445**Parameters** 446 447| Parameter| Description| 448| -- | -- | 449| [OH_AVScreenCapture](capi-avscreencapture-oh-avscreencapture.md) *capture | Pointer to the OH_AVScreenCapture instance.| 450| int32_t errorCode | Error code.| 451| void *userData | Pointer to the user-defined data carried in the function.| 452 453### OH_AVScreenCapture_OnBufferAvailable() 454 455``` 456typedef void (*OH_AVScreenCapture_OnBufferAvailable)(OH_AVScreenCapture *capture, OH_AVBuffer *buffer,OH_AVScreenCaptureBufferType bufferType, int64_t timestamp, void *userData) 457``` 458 459**Description** 460 461Called when an audio buffer or a video buffer is available during the running of an OH_AVScreenCapture instance. 462 463**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 464 465**Since**: 12 466 467 468**Parameters** 469 470| Parameter| Description| 471| -- | -- | 472| [OH_AVScreenCapture](capi-avscreencapture-oh-avscreencapture.md) *capture | Pointer to the OH_AVScreenCapture instance.| 473| [OH_AVBuffer](../apis-avcodec-kit/_core.md#oh_avbuffer) *buffer | Pointer to the OH_AVBuffer instance. After the callback is triggered, the buffer is no longer valid.| 474| [OH_AVScreenCaptureBufferType](#oh_avscreencapturebuffertype) bufferType | Type of the buffer.| 475| int64_t timestamp | Timestamp, in nanoseconds.| 476| void *userData | Pointer to the user-defined data carried in the function.| 477 478### OH_AVScreenCapture_OnDisplaySelected() 479 480``` 481typedef void (*OH_AVScreenCapture_OnDisplaySelected)(OH_AVScreenCapture *capture, uint64_t displayId, void *userData) 482``` 483 484**Description** 485 486Called when screen capture starts. 487 488**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 489 490**Since**: 15 491 492 493**Parameters** 494 495| Parameter| Description| 496| -- | -- | 497| [OH_AVScreenCapture](capi-avscreencapture-oh-avscreencapture.md) *capture | Pointer to the OH_AVScreenCapture instance.| 498| uint64_t displayId | ID of the screen to capture.| 499| void *userData | Pointer to the user-defined data carried in the function.| 500 501### OH_AVScreenCapture_OnCaptureContentChanged() 502 503``` 504typedef void (*OH_AVScreenCapture_OnCaptureContentChanged)(OH_AVScreenCapture* capture,OH_AVScreenCaptureContentChangedEvent event, OH_Rect* area, void *userData) 505``` 506 507**Description** 508 509Called when the screen capture content changes during the running of an OH_AVScreenCapture instance. 510 511**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture 512 513**Since**: 20 514 515 516**Parameters** 517 518| Parameter| Description| 519| -- | -- | 520| [OH_AVScreenCapture](capi-avscreencapture-oh-avscreencapture.md)* capture | Pointer to the OH_AVScreenCapture instance.| 521| [OH_AVScreenCaptureContentChangedEvent](#oh_avscreencapturecontentchangedevent) event | Screen capture content change event.| 522| [OH_Rect](capi-avscreencapture-oh-rect.md)* area | Pointer to the area information when the screen capture content is visible.| 523| void *userData | Pointer to the user-defined data carried in the function.| 524 525### OH_AVScreenCapture_OnUserSelected() 526 527``` 528typedef void (*OH_AVScreenCapture_OnUserSelected)(OH_AVScreenCapture* capture,OH_AVScreenCapture_UserSelectionInfo* selections, void *userData) 529``` 530 531**Description** 532 533Called to return the parameters selected by the user on the authorization UI to the application. 534 535**Since**: 20 536 537 538**Parameters** 539 540| Parameter| Description| 541| -- | -- | 542| [OH_AVScreenCapture](capi-avscreencapture-oh-avscreencapture.md)* capture | Pointer to the OH_AVScreenCapture instance.| 543| [OH_AVScreenCapture_UserSelectionInfo](capi-avscreencapture-oh-avscreencapture-userselectioninfo.md)* selections | Pointer to capture parameters selected by the user on the authorization UI.| 544| void *userData | Pointer to user-defined data.| 545