1e41f4b71Sopenharmony_ci# native_avscreen_capture_base.h
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ci
4e41f4b71Sopenharmony_ci## Overview
5e41f4b71Sopenharmony_ci
6e41f4b71Sopenharmony_ciThe **native_avscreen_capture_base.h** file declares the common structs, character constants, and enums used for running screen capture.
7e41f4b71Sopenharmony_ci
8e41f4b71Sopenharmony_ci**Library**: libnative_avscreen_capture.so
9e41f4b71Sopenharmony_ci
10e41f4b71Sopenharmony_ci**File to include**: <multimedia/player_framework/native_avscreen_capture_base.h>
11e41f4b71Sopenharmony_ci
12e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.AVScreenCapture
13e41f4b71Sopenharmony_ci
14e41f4b71Sopenharmony_ci**Since**: 10
15e41f4b71Sopenharmony_ci
16e41f4b71Sopenharmony_ci**Related module**: [AVScreenCapture](_a_v_screen_capture.md)
17e41f4b71Sopenharmony_ci
18e41f4b71Sopenharmony_ci
19e41f4b71Sopenharmony_ci## Summary
20e41f4b71Sopenharmony_ci
21e41f4b71Sopenharmony_ci
22e41f4b71Sopenharmony_ci### Structs
23e41f4b71Sopenharmony_ci
24e41f4b71Sopenharmony_ci| Name| Description| 
25e41f4b71Sopenharmony_ci| -------- | -------- |
26e41f4b71Sopenharmony_ci| struct  [OH_AudioCaptureInfo](_o_h___audio_capture_info.md) | Describes the audio capture information.| 
27e41f4b71Sopenharmony_ci| struct  [OH_AudioEncInfo](_o_h___audio_enc_info.md) | Describes the audio encoding information.| 
28e41f4b71Sopenharmony_ci| struct  [OH_AudioInfo](_o_h___audio_info.md) | Describes the audio information.| 
29e41f4b71Sopenharmony_ci| struct  [OH_VideoCaptureInfo](_o_h___video_capture_info.md) | Describes the video capture information.| 
30e41f4b71Sopenharmony_ci| struct  [OH_VideoEncInfo](_o_h___video_enc_info.md) | Describes the video encoding information.| 
31e41f4b71Sopenharmony_ci| struct  [OH_VideoInfo](_o_h___video_info.md) | Describes the video information.| 
32e41f4b71Sopenharmony_ci| struct  [OH_RecorderInfo](_o_h___recorder_info.md) | Describes the recording file information.| 
33e41f4b71Sopenharmony_ci| struct  [OH_AVScreenCaptureConfig](_o_h___a_v_screen_capture_config.md) | Describes the screen capture configuration.| 
34e41f4b71Sopenharmony_ci| struct  [OH_AVScreenCaptureCallback](_o_h___a_v_screen_capture_callback.md) | Describes all the asynchronous callback function pointers of an **OH_AVScreenCapture** instance.| 
35e41f4b71Sopenharmony_ci| struct  [OH_Rect](_o_h___rect.md) | Describes the width, height, and image information of the rectangle used for screen capture.| 
36e41f4b71Sopenharmony_ci| struct  [OH_AudioBuffer](_o_h___audio_buffer.md) | Describes the configuration such as the size, type, and timestamp of audio data.| 
37e41f4b71Sopenharmony_ci
38e41f4b71Sopenharmony_ci
39e41f4b71Sopenharmony_ci### Types
40e41f4b71Sopenharmony_ci
41e41f4b71Sopenharmony_ci| Name| Description| 
42e41f4b71Sopenharmony_ci| -------- | -------- |
43e41f4b71Sopenharmony_ci| typedef struct [OH_NativeBuffer](_a_v_screen_capture.md#oh_nativebuffer) [OH_NativeBuffer](_a_v_screen_capture.md#oh_nativebuffer) | Defines the native video stream class for screen capture.| 
44e41f4b71Sopenharmony_ci| typedef struct [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) | Defines a screen capture instance used to obtain original video and audio streams.| 
45e41f4b71Sopenharmony_ci| typedef struct [OH_AVScreenCapture_ContentFilter](_a_v_screen_capture.md#oh_avscreencapture_contentfilter) [OH_AVScreenCapture_ContentFilter](_a_v_screen_capture.md#oh_avscreencapture_contentfilter) | Defines a struct that describes the filter used to filter audio and video content.| 
46e41f4b71Sopenharmony_ci| typedef enum [OH_CaptureMode](_a_v_screen_capture.md#oh_capturemode-1) [OH_CaptureMode](_a_v_screen_capture.md#oh_capturemode) | Defines an enum for the screen capture modes.| 
47e41f4b71Sopenharmony_ci| typedef enum [OH_AudioCaptureSourceType](_a_v_screen_capture.md#oh_audiocapturesourcetype-1) [OH_AudioCaptureSourceType](_a_v_screen_capture.md#oh_audiocapturesourcetype) | Defines an enum for the audio source types during screen capture.| 
48e41f4b71Sopenharmony_ci| typedef enum [OH_AudioCodecFormat](_a_v_screen_capture.md#oh_audiocodecformat-1) [OH_AudioCodecFormat](_a_v_screen_capture.md#oh_audiocodecformat) | Defines an enum for the audio encoding formats.| 
49e41f4b71Sopenharmony_ci| typedef enum [OH_VideoCodecFormat](_a_v_screen_capture.md#oh_videocodecformat-1) [OH_VideoCodecFormat](_a_v_screen_capture.md#oh_videocodecformat) | Defines an enum for the video encoding formats.| 
50e41f4b71Sopenharmony_ci| typedef enum [OH_DataType](_a_v_screen_capture.md#oh_datatype-1) [OH_DataType](_a_v_screen_capture.md#oh_datatype) | Defines an enum for the data types of screen capture streams.| 
51e41f4b71Sopenharmony_ci| typedef enum [OH_VideoSourceType](_a_v_screen_capture.md#oh_videosourcetype-1) [OH_VideoSourceType](_a_v_screen_capture.md#oh_videosourcetype) | Defines an enum for the video source formats.| 
52e41f4b71Sopenharmony_ci| typedef enum [OH_ContainerFormatType](_a_v_screen_capture.md#oh_containerformattype-1) [OH_ContainerFormatType](_a_v_screen_capture.md#oh_containerformattype) | Defines an enum for the types of files generated during screen capture.| 
53e41f4b71Sopenharmony_ci| typedef struct [OH_AudioCaptureInfo](_o_h___audio_capture_info.md) [OH_AudioCaptureInfo](_a_v_screen_capture.md#oh_audiocaptureinfo) | Defines a struct that describes the audio capture information.| 
54e41f4b71Sopenharmony_ci| typedef struct [OH_AudioEncInfo](_o_h___audio_enc_info.md) [OH_AudioEncInfo](_a_v_screen_capture.md#oh_audioencinfo) | Defines a struct that describes the audio encoding information.| 
55e41f4b71Sopenharmony_ci| typedef struct [OH_AudioInfo](_o_h___audio_info.md) [OH_AudioInfo](_a_v_screen_capture.md#oh_audioinfo) | Defines a struct that describes the audio information.| 
56e41f4b71Sopenharmony_ci| typedef struct [OH_VideoCaptureInfo](_o_h___video_capture_info.md) [OH_VideoCaptureInfo](_a_v_screen_capture.md#oh_videocaptureinfo) | Defines a struct that describes the video capture information.| 
57e41f4b71Sopenharmony_ci| typedef struct [OH_VideoEncInfo](_o_h___video_enc_info.md) [OH_VideoEncInfo](_a_v_screen_capture.md#oh_videoencinfo) | Defines a struct that describes the video encoding information.| 
58e41f4b71Sopenharmony_ci| typedef struct [OH_VideoInfo](_o_h___video_info.md) [OH_VideoInfo](_a_v_screen_capture.md#oh_videoinfo) | Defines a struct that describes the video information.| 
59e41f4b71Sopenharmony_ci| typedef struct [OH_RecorderInfo](_o_h___recorder_info.md) [OH_RecorderInfo](_a_v_screen_capture.md#oh_recorderinfo) | Defines a struct that describes the recording file information.| 
60e41f4b71Sopenharmony_ci| typedef struct [OH_AVScreenCaptureConfig](_o_h___a_v_screen_capture_config.md) [OH_AVScreenCaptureConfig](_a_v_screen_capture.md#oh_avscreencaptureconfig) | Defines a struct that describes the screen capture configuration.| 
61e41f4b71Sopenharmony_ci| typedef void(\* [OH_AVScreenCaptureOnError](_a_v_screen_capture.md#oh_avscreencaptureonerror)) ([OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, int32_t errorCode) | Defines a pointer to a callback function that is called when an error occurs during the running of an **OH_AVScreenCapture** instance.| 
62e41f4b71Sopenharmony_ci| typedef void(\* [OH_AVScreenCaptureOnAudioBufferAvailable](_a_v_screen_capture.md#oh_avscreencaptureonaudiobufferavailable)) ([OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, bool isReady, [OH_AudioCaptureSourceType](_a_v_screen_capture.md#oh_audiocapturesourcetype) type) | Defines a pointer to a callback function that is called when an audio buffer is available during the running of an **OH_AVScreenCapture** instance.| 
63e41f4b71Sopenharmony_ci| typedef void(\* [OH_AVScreenCaptureOnVideoBufferAvailable](_a_v_screen_capture.md#oh_avscreencaptureonvideobufferavailable)) ([OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, bool isReady) | Defines a pointer to a callback function that is called when a video buffer is available during the running of an **OH_AVScreenCapture** instance.| 
64e41f4b71Sopenharmony_ci| typedef struct [OH_AVScreenCaptureCallback](_o_h___a_v_screen_capture_callback.md) [OH_AVScreenCaptureCallback](_a_v_screen_capture.md#oh_avscreencapturecallback) | Defines a struct that describes all the asynchronous callback function pointers of an **OH_AVScreenCapture** instance.| 
65e41f4b71Sopenharmony_ci| typedef struct [OH_Rect](_o_h___rect.md) [OH_Rect](_a_v_screen_capture.md#oh_rect) | Defines a struct that describes the width, height, and image information of the rectangle used for screen capture.| 
66e41f4b71Sopenharmony_ci| typedef struct [OH_AudioBuffer](_o_h___audio_buffer.md) [OH_AudioBuffer](_a_v_screen_capture.md#oh_audiobuffer) | Defines a struct that describes the configuration such as the size, type, and timestamp of audio data.| 
67e41f4b71Sopenharmony_ci| typedef enum [OH_AVScreenCaptureStateCode](_a_v_screen_capture.md#oh_avscreencapturestatecode-1) [OH_AVScreenCaptureStateCode](_a_v_screen_capture.md#oh_avscreencapturestatecode) | Defines an enum for the screen capture states.| 
68e41f4b71Sopenharmony_ci| typedef enum [OH_AVScreenCaptureBufferType](_a_v_screen_capture.md#oh_avscreencapturebuffertype-1) [OH_AVScreenCaptureBufferType](_a_v_screen_capture.md#oh_avscreencapturebuffertype) | Defines an enum for the buffer types.| 
69e41f4b71Sopenharmony_ci| typedef enum [OH_AVScreenCaptureFilterableAudioContent](_a_v_screen_capture.md#oh_avscreencapturefilterableaudiocontent-1) [OH_AVScreenCaptureFilterableAudioContent](_a_v_screen_capture.md#oh_avscreencapturefilterableaudiocontent) | Defines an enum for the types of audio that can be added to a content filter.| 
70e41f4b71Sopenharmony_ci| typedef void(\* [OH_AVScreenCapture_OnStateChange](_a_v_screen_capture.md#oh_avscreencapture_onstatechange)) (struct [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, [OH_AVScreenCaptureStateCode](_a_v_screen_capture.md#oh_avscreencapturestatecode) stateCode, void \*userData) | Defines a pointer to a callback function that is called when the state changes during the running of an **OH_AVScreenCapture** instance.| 
71e41f4b71Sopenharmony_ci| typedef void(\* [OH_AVScreenCapture_OnError](_a_v_screen_capture.md#oh_avscreencapture_onerror)) ([OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, int32_t errorCode, void \*userData) | Defines a pointer to a callback function that is called when an error occurs during the running of an **OH_AVScreenCapture** instance.| 
72e41f4b71Sopenharmony_ci| typedef void(\* [OH_AVScreenCapture_OnBufferAvailable](_a_v_screen_capture.md#oh_avscreencapture_onbufferavailable)) ([OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, OH_AVBuffer \*buffer, [OH_AVScreenCaptureBufferType](_a_v_screen_capture.md#oh_avscreencapturebuffertype) bufferType, int64_t timestamp, void \*userData) | Defines a pointer to a callback function that is called when an audio or a video buffer is available during the running of an **OH_AVScreenCapture** instance.| 
73e41f4b71Sopenharmony_ci
74e41f4b71Sopenharmony_ci
75e41f4b71Sopenharmony_ci### Enums
76e41f4b71Sopenharmony_ci
77e41f4b71Sopenharmony_ci| Name| Description| 
78e41f4b71Sopenharmony_ci| -------- | -------- |
79e41f4b71Sopenharmony_ci| [OH_CaptureMode](_a_v_screen_capture.md#oh_capturemode-1) {<br>OH_CAPTURE_HOME_SCREEN = 0,<br>OH_CAPTURE_SPECIFIED_SCREEN = 1,<br>OH_CAPTURE_SPECIFIED_WINDOW = 2,<br>OH_CAPTURE_INVAILD = -1<br>} | Enumerates the screen capture modes.| 
80e41f4b71Sopenharmony_ci| [OH_AudioCaptureSourceType](_a_v_screen_capture.md#oh_audiocapturesourcetype-1) {<br>OH_SOURCE_INVALID = -1,<br>OH_SOURCE_DEFAULT = 0,<br>OH_MIC = 1,<br>OH_ALL_PLAYBACK = 2,<br>OH_APP_PLAYBACK = 3<br>} | Enumerates the audio source types during screen capture.| 
81e41f4b71Sopenharmony_ci| [OH_AudioCodecFormat](_a_v_screen_capture.md#oh_audiocodecformat-1) {<br>OH_AUDIO_DEFAULT = 0,<br>OH_AAC_LC = 3,<br>OH_AUDIO_CODEC_FORMAT_BUTT<br>} | Enumerates the audio encoding formats.| 
82e41f4b71Sopenharmony_ci| [OH_VideoCodecFormat](_a_v_screen_capture.md#oh_videocodecformat-1) {<br>OH_VIDEO_DEFAULT = 0,<br>OH_H264 = 2,<br>OH_H265 = 4,<br>OH_MPEG4 = 6,<br>OH_VP8 = 8,<br>OH_VP9 = 10,<br>OH_VIDEO_CODEC_FORMAT_BUTT<br>} | Enumerates the video encoding formats.| 
83e41f4b71Sopenharmony_ci| [OH_DataType](_a_v_screen_capture.md#oh_datatype-1) {<br>OH_ORIGINAL_STREAM = 0,<br>OH_ENCODED_STREAM = 1,<br>OH_CAPTURE_FILE = 2,<br>OH_INVAILD = -1<br>} | Enumerates the data types of screen capture streams.| 
84e41f4b71Sopenharmony_ci| [OH_VideoSourceType](_a_v_screen_capture.md#oh_videosourcetype-1) {<br>OH_VIDEO_SOURCE_SURFACE_YUV = 0,<br>OH_VIDEO_SOURCE_SURFACE_ES,<br>OH_VIDEO_SOURCE_SURFACE_RGBA,<br>OH_VIDEO_SOURCE_BUTT<br>} | Enumerates the video source formats.| 
85e41f4b71Sopenharmony_ci| [OH_ContainerFormatType](_a_v_screen_capture.md#oh_containerformattype-1) {<br>CFT_MPEG_4A = 0,<br>CFT_MPEG_4 = 1<br>} | Enumerates the types of files generated during screen capture.| 
86e41f4b71Sopenharmony_ci| [OH_AVScreenCaptureStateCode](_a_v_screen_capture.md#oh_avscreencapturestatecode-1) {<br>OH_SCREEN_CAPTURE_STATE_STARTED = 0,<br>OH_SCREEN_CAPTURE_STATE_CANCELED = 1,<br>OH_SCREEN_CAPTURE_STATE_STOPPED_BY_USER = 2,<br>OH_SCREEN_CAPTURE_STATE_INTERRUPTED_BY_OTHER = 3,<br>OH_SCREEN_CAPTURE_STATE_STOPPED_BY_CALL = 4,<br>OH_SCREEN_CAPTURE_STATE_MIC_UNAVAILABLE = 5,<br>OH_SCREEN_CAPTURE_STATE_MIC_MUTED_BY_USER = 6,<br>OH_SCREEN_CAPTURE_STATE_MIC_UNMUTED_BY_USER = 7,<br>OH_SCREEN_CAPTURE_STATE_ENTER_PRIVATE_SCENE = 8,<br>OH_SCREEN_CAPTURE_STATE_EXIT_PRIVATE_SCENE = 9<br>,<br>OH_SCREEN_CAPTURE_STATE_STOPPED_BY_USER_SWITCHES = 10<br>} | Enumerates the screen capture states.| 
87e41f4b71Sopenharmony_ci| [OH_AVScreenCaptureBufferType](_a_v_screen_capture.md#oh_avscreencapturebuffertype-1) {<br>OH_SCREEN_CAPTURE_BUFFERTYPE_VIDEO = 0,<br>OH_SCREEN_CAPTURE_BUFFERTYPE_AUDIO_INNER = 1,<br>OH_SCREEN_CAPTURE_BUFFERTYPE_AUDIO_MIC = 2<br>} | Enumerates the buffer types.| 
88e41f4b71Sopenharmony_ci| [OH_AVScreenCaptureFilterableAudioContent](_a_v_screen_capture.md#oh_avscreencapturefilterableaudiocontent-1) {<br>OH_SCREEN_CAPTURE_NOTIFICATION_AUDIO = 0, <br>OH_SCREEN_CAPTURE_CURRENT_APP_AUDIO = 1 <br>} | Enumerates the types of audio that can be added to a content filter. | 
89