| [native_avscreen_capture.h](native__avscreen__capture_8h.md) | Declares the native APIs used to create an **OH_AVScreenCapture** instance.<br>**File to include**: <multimedia/player_framework/native_avscreen_capture.h><br>**Library**: libnative_avscreen_capture.so|
| [native_avscreen_capture_base.h](native__avscreen__capture__base_8h.md) | Declares the common structs, character constants, and enums used for running screen capture.<br>**File to include**: <multimedia/player_framework/native_avscreen_capture_base.h><br>**Library**: libnative_avscreen_capture.so|
| [native_avscreen_capture_errors.h](native__avscreen__capture__errors_8h.md) | Declares the error codes generated during screen capture.<br>**File to include**: <multimedia/player_framework/native_avscreen_capture_errors.h><br>**Library**: libnative_avscreen_capture.so|
| [OH_AudioEncInfo](_o_h___audio_enc_info.md) | Defines audio encoding information.<br>**NOTE**: This struct is reserved and will be provided in later versions.|
| [OH_VideoCaptureInfo](_o_h___video_capture_info.md) | Defines video capture information.|
| [OH_VideoEncInfo](_o_h___video_enc_info.md) | Defines video encoding information.<br>**NOTE**: This struct is reserved and will be provided in later versions.|
| [OH_VideoInfo](_o_h___video_info.md) | Defines video capture parameters.|
| [OH_RecorderInfo](_o_h___recorder_info.md) | Defines recording file information.<br>**NOTE**: This struct is reserved and will be provided in later versions.|
| [OH_AVScreenCaptureConfig](_o_h___a_v_screen_capture_config.md) | Defines the screen capture configuration.|
| [OH_AVScreenCaptureCallback](_o_h___a_v_screen_capture_callback.md) | Defines all the asynchronous callback function pointers of an **OH_AVScreenCapture** instance.|
| [OH_Rect](_o_h___rect.md) | Defines the width, height, and image information of the rectangle used for screen capture.|
| [OH_AudioBuffer](_o_h___audio_buffer.md) | Defines the configuration such as the size, type, and timestamp of audio data.|
### Types
| Name| Description|
| -------- | -------- |
| [OH_NativeBuffer](#oh_nativebuffer) | Defines the native video stream class for screen capture.|
| [OH_AVScreenCapture](#oh_avscreencapture) | Defines a screen capture instance used to obtain original video and audio streams.|
| [OH_CaptureMode](#oh_capturemode) | Defines an enum that enumerates the screen capture modes.|
| [OH_AudioCaptureSourceType](#oh_audiocapturesourcetype) | Defines an enum that enumerates the audio source types during screen capture.|
| [OH_AudioCodecFormat](#oh_audiocodecformat) | Defines an enum that enumerates the audio encoding formats.|
| [OH_VideoCodecFormat](#oh_videocodecformat) | Defines an enum that enumerates the video encoding formats.|
| [OH_DataType](#oh_datatype) | Defines an enum that enumerates the data types of screen capture streams.|
| [OH_VideoSourceType](#oh_videosourcetype) | Defines an enum that enumerates the video source formats.|
| [OH_ContainerFormatType](#oh_containerformattype) | Defines an enum that enumerates the types of files generated during screen capture.<br>**NOTE**: This type is reserved and will be provided in later versions.|
| [OH_AudioEncInfo](#oh_audioencinfo) | Defines audio encoding information.<br>**NOTE**: This type is reserved and will be provided in later versions.|
| [OH_VideoCaptureInfo](#oh_videocaptureinfo) | Defines video capture information.|
| [OH_VideoEncInfo](#oh_videoencinfo) | Defines video encoding information.<br>**NOTE**: This type is reserved and will be provided in later versions.|
| [OH_VideoInfo](#oh_videoinfo) | Defines video capture parameters.|
| [OH_AVScreenCaptureConfig](#oh_avscreencaptureconfig) | Defines the screen capture configuration.|
| (\*[OH_AVScreenCaptureOnError](#oh_avscreencaptureonerror)) ([OH_AVScreenCapture](#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.|
| (\*[OH_AVScreenCaptureOnAudioBufferAvailable](#oh_avscreencaptureonaudiobufferavailable)) ([OH_AVScreenCapture](#oh_avscreencapture)\*capture, bool isReady, [OH_AudioCaptureSourceType](#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.|
| (\*[OH_AVScreenCaptureOnVideoBufferAvailable](#oh_avscreencaptureonvideobufferavailable)) ([OH_AVScreenCapture](#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.|
| [OH_AVScreenCaptureCallback](#oh_avscreencapturecallback) | Defines all the asynchronous callback function pointers of an **OH_AVScreenCapture** instance.|
| [OH_Rect](#oh_rect) | Defines the width, height, and image information of the rectangle used for screen capture.|
| [OH_AudioBuffer](#oh_audiobuffer) | Defines the configuration such as the size, type, and timestamp of audio data.|
| [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) | Defines an enum that enumerates the error codes generated during screen recording.|
| [OH_DataType](#oh_datatype) { OH_ORIGINAL_STREAM = 0, OH_ENCODED_STREAM = 1, OH_CAPTURE_FILE = 2, OH_INVAILD = -1 } | Enumerates the data types of screen capture streams.|
| [OH_VideoSourceType](#oh_videosourcetype) { OH_VIDEO_SOURCE_SURFACE_YUV = 0, OH_VIDEO_SOURCE_SURFACE_ES, OH_VIDEO_SOURCE_SURFACE_RGBA, OH_VIDEO_SOURCE_BUTT } | Enumerates the video source formats.|
| [OH_ContainerFormatType](#oh_containerformattype) { CFT_MPEG_4A = 0, CFT_MPEG_4 = 1 } | Enumerates the types of files generated during screen capture.<br>**NOTE**: This enum is reserved and will be provided in later versions.|
| [OH_AVScreenCapture_Create](#oh_avscreencapture_create)(void) | Creates an **OH_AVScreenCapture** instance.|
| [OH_AVScreenCapture_Init](#oh_avscreencapture_init)(struct[OH_AVScreenCapture](#oh_avscreencapture) \*capture, [OH_AVScreenCaptureConfig](_o_h___a_v_screen_capture_config.md) config) | Initializes parameters related to an **OH_AVScreenCapture** instance.|
| [OH_AVScreenCapture_StartScreenCapture](#oh_avscreencapture_startscreencapture)(struct[OH_AVScreenCapture](#oh_avscreencapture) \*capture) | Starts screen capture and collects original streams. After calling this function, the application can use the callback listeners **OH_AVScreenCaptureOnAudioBufferAvailable** and **OH_AVScreenCaptureOnVideoBufferAvailable** to check whether streams are generated.|
| [OH_AVScreenCapture_StopScreenCapture](#oh_avscreencapture_stopscreencapture)(struct[OH_AVScreenCapture](#oh_avscreencapture) \*capture) | Stops screen capture. This function is used in pair with **OH_AVScreenCapture_StartScreenCapture**. After calling this function, the application stops screen capture or screen share and releases the microphone.|
| [OH_AVScreenCapture_StartScreenRecording](#oh_avscreencapture_startscreenrecording)(struct[OH_AVScreenCapture](#oh_avscreencapture) \*capture) | Starts screen recording and collects encoded streams.<br>**NOTE**: This function is reserved and will be provided in later versions.|
| [OH_AVScreenCapture_StopScreenRecording](#oh_avscreencapture_stopscreenrecording)(struct[OH_AVScreenCapture](#oh_avscreencapture) \*capture) | Stops screen recording. This function is used in pair with **OH_AVScreenCapture_StartScreenRecording**.<br>**NOTE**: This function is reserved and will be provided in later versions.|
| [OH_AVScreenCapture_AcquireAudioBuffer](#oh_avscreencapture_acquireaudiobuffer)(struct[OH_AVScreenCapture](#oh_avscreencapture) \*capture, [OH_AudioBuffer](_o_h___audio_buffer.md)\*\*audiobuffer, [OH_AudioCaptureSourceType](#oh_audiocapturesourcetype) type) | Obtains an audio buffer. When calling this function, the application must allocate the memory of the corresponding struct size to the audio buffer.|
| [OH_AVScreenCapture_AcquireVideoBuffer](#oh_avscreencapture_acquirevideobuffer)(struct[OH_AVScreenCapture](#oh_avscreencapture) \*capture, int32_t \*fence, int64_t \*timestamp, struct [OH_Rect](_o_h___rect.md)\*region) | Obtains a video buffer. An application can call this function to obtain information such as the video buffer and timestamp.|
| [OH_AVScreenCapture_ReleaseAudioBuffer](#oh_avscreencapture_releaseaudiobuffer)(struct[OH_AVScreenCapture](#oh_avscreencapture) \*capture, [OH_AudioCaptureSourceType](#oh_audiocapturesourcetype) type) | Releases an audio buffer.|
| [OH_AVScreenCapture_ReleaseVideoBuffer](#oh_avscreencapture_releasevideobuffer)(struct[OH_AVScreenCapture](#oh_avscreencapture) \*capture) | Releases a video buffer.|
| [OH_AVScreenCapture_SetCallback](#oh_avscreencapture_setcallback)(struct[OH_AVScreenCapture](#oh_avscreencapture) \*capture, struct [OH_AVScreenCaptureCallback](_o_h___a_v_screen_capture_callback.md) callback) | Sets a callback to listen for available video buffers and audio buffers and errors that occur during the function calling.|
| [OH_AVScreenCapture_Release](#oh_avscreencapture_release)(struct[OH_AVScreenCapture](#oh_avscreencapture) \*capture) | Releases an **OH_AVScreenCapture** instance. This function is used in pair with **OH_AVScreenCapture_Create**.|
| [OH_AVScreenCapture_SetMicrophoneEnabled](#oh_avscreencapture_setmicrophoneenabled)(struct[OH_AVScreenCapture](#oh_avscreencapture) \*capture, bool isMicrophone) | Enables or disables the microphone.|
## Type Description
### OH_AudioBuffer
```
typedef struct OH_AudioBuffer OH_AudioBuffer
```
**Description**
Defines the configuration such as the size, type, and timestamp of audio data.
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.
**Parameters**
| Name| Description|
| -------- | -------- |
| onError | Pointer to a callback function that is called when an error occurs during the running of an **OH_AVScreenCapture** instance. For details, see [OH_AVScreenCaptureOnError](#oh_avscreencaptureonerror).|
| onAudioBufferAvailable | Pointer to a callback function that is called when an audio buffer is available during the running of an **OH_AVScreenCapture** instance. For details, see [OH_AVScreenCaptureOnAudioBufferAvailable](#oh_avscreencaptureonaudiobufferavailable).|
| onVideoBufferAvailable | Pointer to a callback function that is called when a video buffer is available during the running of an **OH_AVScreenCapture** instance. For details, see [OH_AVScreenCaptureOnVideoBufferAvailable](#oh_avscreencaptureonvideobufferavailable).|
| OH_CAPTURE_HOME_SCREEN | To capture the home screen.|
| OH_CAPTURE_SPECIFIED_SCREEN | To capture a specified screen.<br>**NOTE**: This value is reserved and will be provided in later versions.|
| OH_CAPTURE_SPECIFIED_WINDOW | To capture a specified window.<br>**NOTE**: This value is reserved and will be provided in later versions.|
| OH_CAPTURE_INVAILD | Invalid mode.|
### OH_ContainerFormatType
```
enum OH_ContainerFormatType
```
**Description**
Enumerates the types of files generated during screen capture.
> **NOTE**
>
> This enum is reserved and will be provided in later versions.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
| Value| Description|
| -------- | -------- |
| CFT_MPEG_4A | Audio format M4A.|
| CFT_MPEG_4 | Video format MP4.|
### OH_DataType
```
enum OH_DataType
```
**Description**
Enumerates the data types of screen capture streams.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
| Value| Description|
| -------- | -------- |
| OH_ORIGINAL_STREAM | Original stream format, such as YUV, RGBA, and PCM.|
| OH_ENCODED_STREAM | Encoded stream format, such as H.264 and AAC.<br>**NOTE**: This value is reserved and will be provided in later versions.|
| OH_CAPTURE_FILE | Format of the recording file. The value can be **mp4**.<br>**NOTE**: This value is reserved and will be provided in later versions.|
| OH_INVAILD | Invalid format.|
### OH_VideoCodecFormat
```
enum OH_VideoCodecFormat
```
**Description**
Enumerates the video encoding formats.
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
| Value| Description|
| -------- | -------- |
| OH_VIDEO_DEFAULT | Default video encoding format. The default value is **H.264**.|
Obtains an audio buffer. When calling this function, the application must allocate the memory of the corresponding struct size to the audio buffer.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
| audiobuffer | Pointer to the struct for storing the audio buffer. This struct is used to obtain the information about the audio buffer and the timestamp of the buffer.|
| type | Type of the audio buffer, which is used to distinguish external streams recorded by the microphone from internal streams played by the system. For details, see [OH_AudioCaptureSourceType](#oh_audiocapturesourcetype).|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
Obtains a video buffer. An application can call this function to obtain information such as the video buffer and timestamp. After the buffer is no longer needed, call **OH_AVScreenCapture_ReleaseVideoBuffer** to release it.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
| fence | Pointer to parameters for synchronization display.|
| timestamp | Pointer to the timestamp of the video frame.|
| region | Pointer to the coordinates related to video display.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns an **OH_NativeBuffer** object if the operation is successful. The application can call the APIs provided by the **OH_NativeBuffer** object to obtain information such as the video buffer and resolution.
Initializes **OH_AVScreenCapture** parameters, including audio microphone sampling parameters, audio capture parameters (optional), and video resolution parameters.
To call this function, you must configure the **ohos.permission.MICROPHONE** and **ohos.permission.CAPTURE_SCREEN** permissions. Otherwise, the initialization fails and screen capture cannot be performed properly.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
| config | Parameters related to screen capture initialization.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
Releases an **OH_AVScreenCapture** instance. This function is used in pair with **OH_AVScreenCapture_Create**.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
### OH_AVScreenCapture_ReleaseAudioBuffer()
```
OH_AVSCREEN_CAPTURE_ErrCode OH_AVScreenCapture_ReleaseAudioBuffer (struct OH_AVScreenCapture * capture, OH_AudioCaptureSourceType type )
```
**Description**
Releases an audio buffer. After the audio buffer is no longer needed, call this function to release it.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
| type | Type of the audio buffer, which is used to distinguish external streams recorded by the microphone from internal streams played by the system.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
Releases a video buffer. After the video buffer is no longer needed, call this function to release it.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
Sets a callback to listen for available video buffers and audio buffers and errors that occur during the function calling.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
| callback | [OH_AVScreenCaptureCallback](_o_h___a_v_screen_capture_callback.md) struct, which stores related callback function pointers.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
Enables or disables the microphone. When **isMicrophone** is set to **true**, the microphone is enabled, and the original PCM data of the microphone can be obtained by calling **OH_AVScreenCapture_StartScreenRecording** and **OH_AVScreenCapture_AcquireAudioBuffer**. When **isMicrophone** is set to **false**, the obtained audio data is silent data.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
| isMicrophone | Whether to enable the microphone.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
Starts screen capture and collects original streams. After calling this function, the application can use the callback listeners **OH_AVScreenCaptureOnAudioBufferAvailable** and **OH_AVScreenCaptureOnVideoBufferAvailable** to check whether streams are generated.
The application can obtain the original streams of screen capture by calling **OH_AVScreenCapture_AcquireAudioBuffer** and **OH_AVScreenCapture_ReleaseVideoBuffer**.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
Starts screen recording and collects encoded streams.
> **NOTE**
>
> This function is reserved and will be provided in later versions.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
Stops screen capture. This function is used in pair with **OH_AVScreenCapture_StartScreenCapture**. After calling this function, the application stops screen capture or screen share and releases the microphone.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
Stops screen recording. This function is used in pair with **OH_AVScreenCapture_StartScreenRecording**.
> **NOTE**
>
> This function is reserved and will be provided in later versions.
**Parameters**
| Name| Description|
| -------- | -------- |
| capture | Pointer to an **OH_AVScreenCapture** instance.|
**System capability**
SystemCapability.Multimedia.Media.AVScreenCapture
**Returns**
Returns **AV_SCREEN_CAPTURE_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVSCREEN_CAPTURE_ErrCode](#oh_avscreen_capture_errcode) otherwise.
The **OH_AVScreenCaptureCallback** struct 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.
| [videoInfo](#videoinfo) | [OH_VideoInfo](_o_h___video_info.md)<br>Defines video capture parameters.|
| [recorderInfo](#recorderinfo) | [OH_RecorderInfo](_o_h___recorder_info.md)<br>Defines recording file parameters. This member variable is mandatory when the data type is **OH_CAPTURE_FILE**.<br>**NOTE**: This member variable is reserved and will be provided in later versions.|
| [audioSampleRate](#audiosamplerate) | int32_t<br>Defines the audio sampling rate. For details about the supported rates, see **OH_AudioCapturer_GetSamplingRate**.|
| [audioChannels](#audiochannels) | int32_t<br>Defines the number of audio channels.|
| [audioSource](#audiosource) | [OH_AudioCaptureSourceType](_a_v_screen_capture.md#oh_audiocapturesourcetype)<br>Defines the audio source.|
## Member Variable Description
### audioChannels
```
int32_t OH_AudioCaptureInfo::audioChannels
```
**Description**
Defines the number of audio channels.
### audioSampleRate
```
int32_t OH_AudioCaptureInfo::audioSampleRate
```
**Description**
Defines the audio sampling rate. For details about the supported rates, see **OH_AudioCapturer_GetSamplingRate**.
| [micCapInfo](#miccapinfo) | [OH_AudioCaptureInfo](_o_h___audio_capture_info.md)<br>Defines the audio parameters of the microphone.|
| [innerCapInfo](#innercapinfo) | [OH_AudioCaptureInfo](_o_h___audio_capture_info.md)<br>Defines the audio parameters for internal capture.|
| [audioEncInfo](#audioencinfo) | [OH_AudioEncInfo](_o_h___audio_enc_info.md)<br>Defines the audio encoding information. This member variable does not need to be set when **dataType** is set to **OH_ORIGINAL_STREAM**.<br>**NOTE**: This member variable is reserved and will be provided in later versions.|
## Member Variable Description
### audioEncInfo
```
OH_AudioEncInfo OH_AudioInfo::audioEncInfo
```
**Description**
Defines the audio encoding information. This member variable does not need to be set when **dataType** is set to **OH_ORIGINAL_STREAM**.
> **NOTE**
>
> This struct is reserved and will be provided in later versions.
### innerCapInfo
```
OH_AudioCaptureInfo OH_AudioInfo::innerCapInfo
```
**Description**
Defines the audio parameters for internal capture.
| [displayId](#displayid) | uint64_t<br>Defines the ID of the physical screen to capture. This member variable is valid when **capturemode** is set to **CAPTURE_SPECIFIED_SCREEN**.<br>**NOTE**: This member variable is reserved and will be provided in later versions.|
| [missionIDs](#missionids) | int32_t \*<br>Defines the mission ID list. This member variable is valid when **capturemode** is set to **CAPTURE_SPECIFIED_WINDOW**.<br>**NOTE**: This member variable is reserved and will be provided in later versions.|
| [missionIDsLen](#missionidslen) | int32_t<br>Defines the length of the mission ID list. This member variable is valid when **capturemode** is set to **CAPTURE_SPECIFIED_WINDOW**.<br>**NOTE**: This member variable is reserved and will be provided in later versions.|
| [videoFrameWidth](#videoframewidth) | int32_t<br>Defines the width of the captured video.|
| [videoFrameHeight](#videoframeheight) | int32_t<br>Defines the height of the captured video.|
| [videoSource](#videosource) | [OH_VideoSourceType](_a_v_screen_capture.md#oh_videosourcetype)<br>Defines the video source type. Currently, only RGBA is supported.|
## Member Variable Description
### displayId
```
uint64_t OH_VideoCaptureInfo::displayId
```
**Description**
Defines the ID of the physical screen to capture. This member variable is valid when **capturemode** is set to **CAPTURE_SPECIFIED_SCREEN**.
> **NOTE**
>
> This member variable is reserved and will be provided in later versions.
### missionIDs
```
int32_t* OH_VideoCaptureInfo::missionIDs
```
**Description**
Defines the mission ID list. This member variable is valid when **capturemode** is set to **CAPTURE_SPECIFIED_WINDOW**.
> **NOTE**
>
> This member variable is reserved and will be provided in later versions.
### missionIDsLen
```
int32_t OH_VideoCaptureInfo::missionIDsLen
```
**Description**
Defines the length of the mission ID list. This member variable is valid when **capturemode** is set to **CAPTURE_SPECIFIED_WINDOW**.
> **NOTE**
>
> This member variable is reserved and will be provided in later versions.
| [videoCapInfo](#videocapinfo) | [OH_VideoCaptureInfo](_o_h___video_capture_info.md)<br>Defines video capture information.|
| [videoEncInfo](#videoencinfo) | [OH_VideoEncInfo](_o_h___video_enc_info.md)<br>Defines video encoding parameters.<br>**NOTE**: This member variable is reserved and will be provided in later versions.|
## Member Variable Description
### videoCapInfo
```
OH_VideoCaptureInfo OH_VideoInfo::videoCapInfo
```
**Description**
Defines video capture information.
### videoEncInfo
```
OH_VideoEncInfo OH_VideoInfo::videoEncInfo
```
**Description**
Defines video encoding parameters.
> **NOTE**
>
> This member variable is reserved and will be provided in later versions.
The **OhosImageDecodingOps** struct defines the options for decoding an image source. It is used in [OH_ImageSource_CreatePixelMap](image.md#oh_imagesource_createpixelmap) and [OH_ImageSource_CreatePixelMapList](image.md#oh_imagesource_createpixelmaplist).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [editable](image.md#editable) | Defines whether the output pixel map is editable.|
| [pixelFormat](image.md#pixelformat-23) | Defines the pixel format of the output pixel map.|
| [fitDensity](image.md#fitdensity) | Defines the pixel density of the output pixel map.|
| [index](image.md#index) | Defines the index of the output pixel map.|
| [sampleSize](image.md#samplesize) | Defines the size of the sample.|
| [rotate](image.md#rotate) | Defines the decoding rotation option.|
| [size](image.md#size-27) | Defines the pixel width and height of the output pixel map.|
| [region](image.md#region) | Defines the region of the output pixel map.|
The **OhosImageRegion** struct defines the region of an image source to decode. It is used in [OhosImageDecodingOps](_ohos_image_decoding_ops.md), [OH_ImageSource_CreatePixelMap](image.md#oh_imagesource_createpixelmap), and [OH_ImageSource_CreatePixelMapList](image.md#oh_imagesource_createpixelmaplist).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [x](image.md#x) | Defines the X coordinate of the start point, in pixels.|
| [y](image.md#y) | Defines the Y coordinate of the start point, in pixels.|
| [width](image.md#width) | Defines the width of the region, in pixels.|
| [height](image.md#height) | Defines the height of the region, in pixels.|
The **OhosImageSource** struct defines the input resource of an image source. Only one type of resource is accepted at a time. The image source is obtained by calling [OH_ImageSource_Create](image.md#oh_imagesource_create).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [uri](image.md#uri) = nullptr | Defines a pointer to the image source URI. Only a file URI or Base64 URI is accepted.|
| [uriSize](image.md#urisize) = 0 | Defines the length of the image source URI.|
| [fd](image.md#fd) = -1 | Defines the descriptor of the image source.|
| [buffer](image.md#buffer-12) = nullptr | Defines a pointer to the image source buffer. Only a formatted packet buffer or Base64 buffer is accepted.|
| [bufferSize](image.md#buffersize-12) = 0 | Defines the size of the image source buffer.|
The **OhosImageSourceDelayTimeList** struct defines the delay time list of an image source. The delay time list is obtained by calling [OH_ImageSource_GetDelayTime](image.md#oh_imagesource_getdelaytime).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [delayTimeList](image.md#delaytimelist) | Defines a pointer to the head of the image source delay time list.|
| [size](image.md#size-47) = 0 | Defines the size of the image source delay time list.|
The **OhosImageSourceInfo** struct defines the image source information, which is obtained by calling [OH_ImageSource_GetImageInfo](image.md#oh_imagesource_getimageinfo).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [pixelFormat](image.md#pixelformat-33) | Defines the pixel format of the image source. It is set in [OH_ImageSource_Create()](image.md#oh_imagesource_create).|
| [colorSpace](image.md#colorspace) | Defines the color space of the image source.|
| [alphaType](image.md#alphatype) | Defines the alpha type of the image source.|
| [density](image.md#density-22) | Defines the image density of the image source. It is set in [OH_ImageSource_Create()](image.md#oh_imagesource_create).|
| [size](image.md#size-37) | Defines the pixel width and height of the image source.|
The **OhosImageSourceOps** struct defines the image source options. It is used in [OH_ImageSource_Create](image.md#oh_imagesource_create) and [OH_ImageSource_CreateIncremental](image.md#oh_imagesource_createincremental).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [density](image.md#density-12) | Defines the pixel density of the image source.|
| [pixelFormat](image.md#pixelformat-13) | Defines the pixel format of the image source. It is usually used to describe the YUV buffer.|
| [size](image.md#size-17) | Defines the pixel width and height of the image source.|
The **OhosImageSourceProperty** struct defines the property string (in key-value format) of an image source. It is used in [OH_ImageSource_GetImageProperty](image.md#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](image.md#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [value](image.md#value) = nullptr | Defines a pointer to the head of the property string.|
| [size](image.md#size-77) = 0 | Defines the size of the property string.|
The **OhosImageSourceSupportedFormat** struct defines the format string supported by an image source. It is used in [OhosImageSourceSupportedFormatList](_ohos_image_source_supported_format_list.md) and [OH_ImageSource_GetSupportedFormats](image.md#oh_imagesource_getsupportedformats).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [format](image.md#format) = nullptr | Defines a pointer to the head of the format string.|
| [size](image.md#size-57) = 0 | Defines the size of the format string.|
The OhosImageSourceSupportedFormatList struct defines the format string list supported by an image source. It is obtained by calling [OH_ImageSource_GetSupportedFormats](image.md#oh_imagesource_getsupportedformats).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [supportedFormatList](image.md#supportedformatlist) = nullptr | Defines a double pointer to the head of the format string list.|
| [size](image.md#size-67) = 0 | Defines the size of the format string list.|
The **OhosImageSourceUpdateData** struct defines the update data option of the image source. It is obtained by calling [OH_ImageSource_UpdateData](image.md#oh_imagesource_updatedata).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [buffer](image.md#buffer-22) = nullptr | Defines a pointer to the buffer for storing the update data.|
| [bufferSize](image.md#buffersize-22) = 0 | Defines the size of the buffer.|
| [offset](image.md#offset) = 0 | Defines the offset of the update data in the buffer.|
| [updateLength](image.md#updatelength) = 0 | Defines the length of the update data in the buffer.|
| [isCompleted](image.md#iscompleted) = 0 | Defines whether the image source data update is completed.|
Provides APIs for obtaining pixel map data and information.
## Overview
@Syscap SystemCapability.Multimedia.Image
The **Image** package provides APIs for accessing the **Image** module. For example, you can use the APIs to obtain image data, pixel map data, and pixel map information.
\@Syscap SystemCapability.Multimedia.Image
**Since**
**Since**
...
@@ -18,732 +19,4089 @@ Provides APIs for obtaining pixel map data and information.
...
@@ -18,732 +19,4089 @@ Provides APIs for obtaining pixel map data and information.
| Name| Description|
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| [image_pixel_map_napi.h](image__pixel__map__napi_8h.md) | Declares the APIs that can lock, access, and unlock a pixel map.<br>**File to include**: <multimedia/image_framework/image_pixel_map_napi.h><br>**Library**: libpixelmap_ndk.z.so|
| [image_mdk.h](image__mdk_8h.md) | Declares the functions that access the image rectangle, size, format, and component data.<br>**File to include**: <multimedia/image_framework/image_mdk.h><br>**Library**: libimage_ndk.z.so |
| [image_mdk_common.h](image__mdk__common_8h.md) | Declares the common enums and structs used by the image interface.<br>**File to include**: <multimedia/image_framework/image_mdk_common.h><br>**Library**: libimage_ndk.z.so|
| [image_pixel_map_mdk.h](image__pixel__map__mdk_8h.md) | Declares the APIs that can lock, access, and unlock a pixel map.<br>**File to include**: <multimedia/image_framework/image_pixel_map_mdk.h><br>**Library**: libpixelmap_ndk.z.so|
| [image_pixel_map_napi.h](image__pixel__map__napi_8h.md) | Declares the APIs that can lock, access, and unlock a pixel map.<br>**File to include**: <multimedia/image_framework/image_pixel_map_napi.h><br>**Library**: libpixelmap_ndk.z.so|
| [image_receiver_mdk.h](image__receiver__mdk_8h.md) | Declares the APIs for obtaining image data from the native layer.<br>**File to include**: <multimedia/image_framework/image_receiver_mdk.h><br>**Library**: libimage_receiver_ndk.z.so|
| [image_source_mdk.h](image__source__mdk_8h.md) | Declares the APIs for decoding an image source into a pixel map.<br>**File to include**: <multimedia/image_framework/image_source_mdk.h><br>**Library**: libimage_source_ndk.z.so |
### Structs
### Structs
| Name| Description|
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| [OhosPixelMapInfo](_ohos_pixel_map_info.md) | Defines the pixel map information.|
| [OHOS::Media::OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md) | Defines the information about an image rectangle.|
| [OhosPixelMapCreateOps](_ohos_pixel_map_create_ops.md) | Defines the options used for creating a pixel map.|
| [OHOS::Media::OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md) | Defines the information about an image component.|
| [OhosImageSize](_ohos_image_size.md) | Defines the image size.|
| [OhosPixelMapInfos](_ohos_pixel_map_infos.md) | Defines the information about a pixel map.|
| [OhosPixelMapCreateOps](_ohos_pixel_map_create_ops.md) | Defines the options for creating a pixel map.|
| [OHOS::Media::OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md) | Defines the information about a pixel map.|
| [OhosImageReceiverInfo](_ohos_image_receiver_info.md) | Defines the information about an image receiver.|
| [OhosImageRegion](_ohos_image_region.md) | Defines the region of an image source to decode.|
| [OhosImageSourceOps](_ohos_image_source_ops.md) | Defines the image source options.|
| [OhosImageDecodingOps](_ohos_image_decoding_ops.md) | Defines the options for decoding an image source.|
| [OhosImageSourceInfo](_ohos_image_source_info.md) | Defines the information about an image source.|
| [OhosImageSource](_ohos_image_source.md) | Defines the input resource of an image source. Only one type of resource is accepted at a time.|
| [OhosImageSourceDelayTimeList](_ohos_image_source_delay_time_list.md) | Defines the delay time list of an image source.|
| [OhosImageSourceSupportedFormat](_ohos_image_source_supported_format.md) | Defines the format string supported by an image source.|
| [OhosImageSourceSupportedFormatList](_ohos_image_source_supported_format_list.md) | Defines the format string list supported by an image source.|
| [OhosImageSourceProperty](_ohos_image_source_property.md) | Defines the property string (in key-value format) of an image source.|
| [OhosImageSourceUpdateData](_ohos_image_source_update_data.md) | Defines the update data of an image source.|
### Types
### Types
| Name| Description|
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| [NativePixelMap](#nativepixelmap) | Defines the data type name of the native pixel map.|
| [OHOS::Media::ImageNative](#imagenative) | Defines an image object at the native layer.|
| [NativePixelMap](#nativepixelmap) | Defines the data type name of the pixel map at the native layer.|
| [OhosPixelMapInfos](#ohospixelmapinfos) | Defines the information about a pixel map.|
| [ImageReceiverNative](#imagereceivernative) | Defines the data type name of the image receiver at the native layer.|
| (\*[OH_Image_Receiver_On_Callback](#oh_image_receiver_on_callback)) () | Defines the callbacks for the image interface at the native layer.|
| [ImageSourceNative](#imagesourcenative) | Defines an image source object at the native layer.|
### Macros
| Name| Description|
| -------- | -------- |
| **IMAGE_RESULT_BASE** 62980096 | Defines the basic value returned by the interface. |
### Enums
### Enums
| Name| Description|
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| { OHOS_IMAGE_RESULT_SUCCESS = 0, OHOS_IMAGE_RESULT_BAD_PARAMETER = -1 } | Enumerates the error codes returned by the functions.|
| { OHOS::Media::OHOS_IMAGE_RESULT_SUCCESS = 0,<br>OHOS::Media::OHOS_IMAGE_RESULT_BAD_PARAMETER = -1 } | Enumerates the error codes returned by the functions.|
| [OH_GetImageInfo](#oh_getimageinfo)(napi_env env, napi_value value, [OhosPixelMapInfo](_ohos_pixel_map_info.md)\*info) | Obtains the **PixelMap** information and stores the information to the [OhosPixelMapInfo](_ohos_pixel_map_info.md) struct.|
| [OHOS::Media::OH_Image_InitImageNative](#oh_image_initimagenative)(napi_env env, napi_value source) | Parses an **ImageNative** object from an **Image** object at the JavaScript native layer.|
| [OH_AccessPixels](#oh_accesspixels)(napi_env env, napi_value value, void \*\*addrPtr) | Obtains the memory address of a **PixelMap** object and locks the memory.|
| [OHOS::Media::OH_Image_ClipRect](#oh_image_cliprect)(const[ImageNative](#imagenative) \*native, struct [OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md)\*rect) | Obtains [OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md) of an **ImageNative** object.|
| [OH_UnAccessPixels](#oh_unaccesspixels)(napi_env env, napi_value value) | Unlocks the memory of a **PixelMap** object. This function is used with [OH_AccessPixels](#oh_accesspixels) in pairs.|
| [OHOS::Media::OH_Image_Size](#oh_image_size)(const[ImageNative](#imagenative) \*native, struct [OhosImageSize](_ohos_image_size.md)\*size) | Obtains [OhosImageSize](_ohos_image_size.md) of an **ImageNative** object.|
| [OHOS::Media::OH_Image_Format](#oh_image_format)(const[ImageNative](#imagenative) \*native, int32_t \*format) | Obtains the image format of an **ImageNative** object.|
| [OHOS::Media::OH_Image_GetComponent](#oh_image_getcomponent)(const[ImageNative](#imagenative) \*native, int32_t componentType, struct [OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md)\*componentNative) | Obtains [OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md) of an **ImageNative** object.|
| [OHOS::Media::OH_Image_Release](#oh_image_release)([ImageNative](#imagenative)\*native) | Releases an **ImageNative** object.|
| [OH_PixelMap_CreateAlphaPixelMap](#oh_pixelmap_createalphapixelmap)(napi_env env, napi_value source, napi_value \*alpha) | Creates a **PixelMap** object that contains only alpha channel information.|
| [OH_PixelMap_CreateAlphaPixelMap](#oh_pixelmap_createalphapixelmap)(napi_env env, napi_value source, napi_value \*alpha) | Creates a **PixelMap** object that contains only alpha channel information.|
| [OH_PixelMap_InitNativePixelMap](#oh_pixelmap_initnativepixelmap)(napi_env env, napi_value source) | Initializes a **PixelMap** object.|
| [OH_PixelMap_InitNativePixelMap](#oh_pixelmap_initnativepixelmap)(napi_env env, napi_value source) | Initializes a **PixelMap** object.|
| [OH_PixelMap_GetBytesNumberPerRow](#oh_pixelmap_getbytesnumberperrow)(const[NativePixelMap](#nativepixelmap) \*native, int32_t \*num) | Obtains the number of bytes per row of a **PixelMap** object.|
| [OH_PixelMap_GetBytesNumberPerRow](#oh_pixelmap_getbytesnumberperrow)(const[NativePixelMap](#nativepixelmap) \*native, int32_t \*num) | Obtains the number of bytes per row of a **NativePixelMap** object.|
| [OH_PixelMap_GetIsEditable](#oh_pixelmap_getiseditable)(const[NativePixelMap](#nativepixelmap) \*native, int32_t \*[editable](image__pixel__map__napi_8h.md#editable)) | Checks whether a **PixelMap** object is editable.|
| [OH_PixelMap_GetIsEditable](#oh_pixelmap_getiseditable)(const[NativePixelMap](#nativepixelmap) \*native, int32_t \*editable) | Checks whether a **NativePixelMap** object is editable.|
| [OH_PixelMap_SetAlphaAble](#oh_pixelmap_setalphaable)(const[NativePixelMap](#nativepixelmap) \*native, int32_t alpha) | Sets an alpha channel for a **PixelMap** object.|
| [OH_PixelMap_SetAlphaAble](#oh_pixelmap_setalphaable)(const[NativePixelMap](#nativepixelmap) \*native, int32_t alpha) | Sets an alpha channel for a **NativePixelMap** object.|
| [OH_PixelMap_GetDensity](#oh_pixelmap_getdensity)(const[NativePixelMap](#nativepixelmap) \*native, int32_t \*density) | Obtains the pixel density of a **PixelMap** object.|
| [OH_PixelMap_GetDensity](#oh_pixelmap_getdensity)(const[NativePixelMap](#nativepixelmap) \*native, int32_t \*density) | Obtains the pixel density of a **NativePixelMap** object.|
| [OH_PixelMap_SetDensity](#oh_pixelmap_setdensity)(const[NativePixelMap](#nativepixelmap) \*native, int32_t density) | Sets the pixel density for a **PixelMap** object.|
| [OH_PixelMap_SetDensity](#oh_pixelmap_setdensity)(const[NativePixelMap](#nativepixelmap) \*native, int32_t density) | Sets the pixel density for a **NativePixelMap** object.|
| [OH_PixelMap_SetOpacity](#oh_pixelmap_setopacity)(const[NativePixelMap](#nativepixelmap) \*native, float opacity) | Sets the opacity for a **PixelMap** object.|
| [OH_PixelMap_SetOpacity](#oh_pixelmap_setopacity)(const[NativePixelMap](#nativepixelmap) \*native, float opacity) | Sets the opacity for a **NativePixelMap** object.|
| [OH_PixelMap_Crop](#oh_pixelmap_crop)(const[NativePixelMap](#nativepixelmap) \*native, int32_t x, int32_t y, int32_t [width](image__pixel__map__napi_8h.md#width), int32_t [height](image__pixel__map__napi_8h.md#height)) | Crops a **PixelMap** object.|
| [OH_PixelMap_Crop](#oh_pixelmap_crop)(const[NativePixelMap](#nativepixelmap) \*native, int32_t x, int32_t y, int32_t width, int32_t height) | Crops a **NativePixelMap** object.|
| [OH_PixelMap_GetImageInfo](#oh_pixelmap_getimageinfo)(const[NativePixelMap](#nativepixelmap) \*native, [OhosPixelMapInfos](_ohos_pixel_map_infos.md)\*info) | Obtains the image information of a **NativePixelMap** object.|
| [OH_PixelMap_AccessPixels](#oh_pixelmap_accesspixels)(const[NativePixelMap](#nativepixelmap) \*native, void \*\*addr) | Obtains the memory address of a **NativePixelMap** object and locks the memory.|
| [OH_PixelMap_UnAccessPixels](#oh_pixelmap_unaccesspixels)(const[NativePixelMap](#nativepixelmap) \*native) | Unlocks the memory of a **NativePixelMap** object. This function is used with [OH_PixelMap_AccessPixels](#oh_pixelmap_accesspixels) in pairs.|
| [OHOS::Media::OH_GetImageInfo](#oh_getimageinfo)(napi_env env, napi_value value, [OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md)\*info) | Obtains the information about a **PixelMap** object and stores the information to the [OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md) struct.|
| [OHOS::Media::OH_AccessPixels](#oh_accesspixels)(napi_env env, napi_value value, void \*\*addrPtr) | Obtains the memory address of a **PixelMap** object and locks the memory.|
| [OHOS::Media::OH_UnAccessPixels](#oh_unaccesspixels)(napi_env env, napi_value value) | Unlocks the memory of a **PixelMap** object. This function is used with **OH_AccessPixels** in pairs.|
| [OH_Image_Receiver_CreateImageReceiver](#oh_image_receiver_createimagereceiver)(napi_env env, struct [OhosImageReceiverInfo](_ohos_image_receiver_info.md) info, napi_value \*res) | Creates an **ImageReceiver** object at the application layer.|
| [OH_Image_Receiver_InitImageReceiverNative](#oh_image_receiver_initimagereceivernative)(napi_env env, napi_value source) | Initializes an [ImageReceiverNative](#imagereceivernative) object through an **ImageReceiver** object.|
| [OH_Image_Receiver_GetReceivingSurfaceId](#oh_image_receiver_getreceivingsurfaceid)(const[ImageReceiverNative](#imagereceivernative) \*native, char \*id, size_t len) | Obtains the receiver ID through an [ImageReceiverNative](#imagereceivernative) object.|
| [OH_Image_Receiver_ReadLatestImage](#oh_image_receiver_readlatestimage)(const[ImageReceiverNative](#imagereceivernative) \*native, napi_value \*image) | Obtains the latest image through an [ImageReceiverNative](#imagereceivernative) object.|
| [OH_Image_Receiver_ReadNextImage](#oh_image_receiver_readnextimage)(const[ImageReceiverNative](#imagereceivernative) \*native, napi_value \*image) | Obtains the next image through an [ImageReceiverNative](#imagereceivernative) object.|
| [OH_Image_Receiver_On](#oh_image_receiver_on)(const[ImageReceiverNative](#imagereceivernative) \*native, [OH_Image_Receiver_On_Callback](#oh_image_receiver_on_callback) callback) | Registers an [OH_Image_Receiver_On_Callback](#oh_image_receiver_on_callback) callback. This callback is triggered whenever a new image is received.|
| [OH_Image_Receiver_GetSize](#oh_image_receiver_getsize)(const[ImageReceiverNative](#imagereceivernative) \*native, struct [OhosImageSize](_ohos_image_size.md)\*size) | Obtains the size of the image receiver through an [ImageReceiverNative](#imagereceivernative) object.|
| [OH_Image_Receiver_GetCapacity](#oh_image_receiver_getcapacity)(const[ImageReceiverNative](#imagereceivernative) \*native, int32_t \*capacity) | Obtains the capacity of the image receiver through an [ImageReceiverNative](#imagereceivernative) object.|
| [OH_Image_Receiver_GetFormat](#oh_image_receiver_getformat)(const[ImageReceiverNative](#imagereceivernative) \*native, int32_t \*format) | Obtains the format of the image receiver through an [ImageReceiverNative](#imagereceivernative) object.|
| [OH_Image_Receiver_Release](#oh_image_receiver_release)([ImageReceiverNative](#imagereceivernative)\*native) | Releases an [ImageReceiverNative](#imagereceivernative) object. Note: This function is not used to release an **ImageReceiver** object.|
| [OH_ImageSource_Create](#oh_imagesource_create)(napi_env env, struct [OhosImageSource](_ohos_image_source.md)\*src, struct [OhosImageSourceOps](_ohos_image_source_ops.md)\*ops, napi_value \*res) | Creates an **ImageSource** object at the JavaScript native layer based on the specified [OhosImageSource](_ohos_image_source.md) and [OhosImageSourceOps](_ohos_image_source_ops.md) structs.|
| [OH_ImageSource_CreateIncremental](#oh_imagesource_createincremental)(napi_env env, struct [OhosImageSource](_ohos_image_source.md)\*source, struct [OhosImageSourceOps](_ohos_image_source_ops.md)\*ops, napi_value \*res) | Creates an **ImageSource** object at the JavaScript native layer based on the specified [OhosImageSource](_ohos_image_source.md) and [OhosImageSourceOps](_ohos_image_source_ops.md) structs. The image source data will be updated through **OH_ImageSource_UpdateData**.|
| [OH_ImageSource_GetSupportedFormats](#oh_imagesource_getsupportedformats)(struct[OhosImageSourceSupportedFormatList](_ohos_image_source_supported_format_list.md) \*res) | Obtains all supported decoding formats.|
| [OH_ImageSource_InitNative](#oh_imagesource_initnative)(napi_env env, napi_value source) | Converts an **ImageSource** object at the JavaScript native layer to an [ImageSourceNative](#imagesourcenative) object.|
| [OH_ImageSource_CreatePixelMap](#oh_imagesource_createpixelmap)(const[ImageSourceNative](#imagesourcenative) \*native, struct [OhosImageDecodingOps](_ohos_image_decoding_ops.md)\*ops, napi_value \*res) | Decodes an **ImageSourceNative** object to obtain a **PixelMap** object at the JavaScript native layer based on the specified [OhosImageDecodingOps](_ohos_image_decoding_ops.md) struct.|
| [OH_ImageSource_CreatePixelMapList](#oh_imagesource_createpixelmaplist)(const[ImageSourceNative](#imagesourcenative) \*native, struct [OhosImageDecodingOps](_ohos_image_decoding_ops.md)\*ops, napi_value \*res) | Decodes an **ImageSourceNative** object to obtain all **PixelMap** objects at the JavaScript native layer based on the specified [OhosImageDecodingOps](_ohos_image_decoding_ops.md) struct.|
| [OH_ImageSource_GetDelayTime](#oh_imagesource_getdelaytime)(const[ImageSourceNative](#imagesourcenative) \*native, struct [OhosImageSourceDelayTimeList](_ohos_image_source_delay_time_list.md)\*res) | Obtains the delay time list from an **ImageSourceNative** object (such as GIF image source).|
| [OH_ImageSource_GetFrameCount](#oh_imagesource_getframecount)(const[ImageSourceNative](#imagesourcenative) \*native, uint32_t \*res) | Obtains the number of frames from an **ImageSourceNative** object.|
| [OH_ImageSource_GetImageInfo](#oh_imagesource_getimageinfo)(const[ImageSourceNative](#imagesourcenative) \*native, int32_t index, struct [OhosImageSourceInfo](_ohos_image_source_info.md)\*info) | Obtains image source information from an **ImageSourceNative** object by index.|
| [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty)(const[ImageSourceNative](#imagesourcenative) \*native, struct [OhosImageSourceProperty](_ohos_image_source_property.md)\*key, struct [OhosImageSourceProperty](_ohos_image_source_property.md)\*value) | Obtains the value of an image property from an **ImageSourceNative** object.|
| [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty)(const[ImageSourceNative](#imagesourcenative) \*native, struct [OhosImageSourceProperty](_ohos_image_source_property.md)\*key, struct [OhosImageSourceProperty](_ohos_image_source_property.md)\*value) | Modifies the value of an image property of an **ImageSourceNative** object.|
| [OH_ImageSource_UpdateData](#oh_imagesource_updatedata)(const[ImageSourceNative](#imagesourcenative) \*native, struct [OhosImageSourceUpdateData](_ohos_image_source_update_data.md)\*data) | Updates the data of an **ImageSourceNative** object.|
| [OH_ImageSource_Release](#oh_imagesource_release)([ImageSourceNative](#imagesourcenative)\*native) | Releases an **ImageSourceNative** object.|
### Variables
| Name| Description|
| -------- | -------- |
| [OHOS_IMAGE_PROPERTY_BITS_PER_SAMPLE](#ohos_image_property_bits_per_sample) = "BitsPerSample" | Defines a pointer to bits per sample, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_ORIENTATION](#ohos_image_property_orientation) = "Orientation" | Defines a pointer to the orientation, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_IMAGE_LENGTH](#ohos_image_property_image_length) = "ImageLength" | Defines a pointer to the image length, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_IMAGE_WIDTH](#ohos_image_property_image_width) = "ImageWidth" | Defines a pointer to the image width, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_GPS_LATITUDE](#ohos_image_property_gps_latitude) = "GPSLatitude" | Defines a pointer to the GPS latitude, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_GPS_LONGITUDE](#ohos_image_property_gps_longitude) = "GPSLongitude" | Defines a pointer to the GPS longitude, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_GPS_LATITUDE_REF](#ohos_image_property_gps_latitude_ref) = "GPSLatitudeRef" | Defines a pointer to the GPS latitude reference information, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_GPS_LONGITUDE_REF](#ohos_image_property_gps_longitude_ref) = "GPSLongitudeRef" | Defines a pointer to the GPS longitude reference information, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_DATE_TIME_ORIGINAL](#ohos_image_property_date_time_original) = "DateTimeOriginal" | Defines a pointer to the created date and time, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_EXPOSURE_TIME](#ohos_image_property_exposure_time) = "ExposureTime" | Defines a pointer to the exposure time, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_SCENE_TYPE](#ohos_image_property_scene_type) = "SceneType" | Defines a pointer to the scene type, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_ISO_SPEED_RATINGS](#ohos_image_property_iso_speed_ratings) = "ISOSpeedRatings" | Defines a pointer to the ISO speed ratings, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_F_NUMBER](#ohos_image_property_f_number) = "FNumber" | Defines a pointer to the f-number of the image, one of the image properties.|
| [OHOS_IMAGE_PROPERTY_COMPRESSED_BITS_PER_PIXEL](#ohos_image_property_compressed_bits_per_pixel) = "CompressedBitsPerPixel" | Defines a pointer to the compressed bits per pixel, one of the image properties.|
| [OhosImageRegion::x](#x) | Defines the X coordinate of the start point, in pixels.|
| [OhosImageRegion::y](#y) | Defines the Y coordinate of the start point, in pixels.|
| [OhosImageRegion::width](#width) | Defines the width of the region, in pixels.|
| [OhosImageRegion::height](#height) | Defines the height of the region, in pixels.|
| [OhosImageSourceOps::density](#density-12) | Defines the pixel density of the image source.|
| [OhosImageSourceOps::pixelFormat](#pixelformat-13) | Defines the pixel format of the image source. It is usually used to describe the YUV buffer.|
| [OhosImageSourceOps::size](#size-17) | Defines the pixel width and height of the image source.|
| [OhosImageDecodingOps::editable](#editable) | Defines whether the output pixel map is editable.|
| [OhosImageDecodingOps::pixelFormat](#pixelformat-23) | Defines the pixel format of the output pixel map.|
| [OhosImageDecodingOps::fitDensity](#fitdensity) | Defines the pixel density of the output pixel map.|
| [OhosImageDecodingOps::index](#index) | Defines the index of the output pixel map.|
| [OhosImageDecodingOps::sampleSize](#samplesize) | Defines the size of the sample.|
| [OhosImageDecodingOps::rotate](#rotate) | Defines the decoding rotation option.|
| [OhosImageDecodingOps::size](#size-27) | Defines the pixel width and height of the output pixel map.|
| [OhosImageDecodingOps::region](#region) | Defines the region of the output pixel map.|
| [OhosImageSourceInfo::pixelFormat](#pixelformat-33) | Defines the pixel format of the image source. It is set in [OH_ImageSource_Create](#oh_imagesource_create).|
| [OhosImageSourceInfo::colorSpace](#colorspace) | Defines the color space of the image source.|
| [OhosImageSourceInfo::alphaType](#alphatype) | Defines the alpha type of the image source.|
| [OhosImageSourceInfo::density](#density-22) | Defines the image density of the image source. It is set in [OH_ImageSource_Create](#oh_imagesource_create).|
| [OhosImageSourceInfo::size](#size-37) | Defines the pixel width and height of the image source.|
| [OhosImageSource::uri](#uri) = nullptr | Defines a pointer to the image source URI. Only a file URI or Base64 URI is accepted.|
| [OhosImageSource::uriSize](#urisize) = 0 | Defines the length of the image source URI.|
| [OhosImageSource::fd](#fd) = -1 | Defines the descriptor of the image source.|
| [OhosImageSource::buffer](#buffer-12) = nullptr | Defines a pointer to the image source buffer. Only a formatted packet buffer or Base64 buffer is accepted.|
| [OhosImageSource::bufferSize](#buffersize-12) = 0 | Defines the size of the image source buffer.|
| [OhosImageSourceDelayTimeList::delayTimeList](#delaytimelist) | Defines a pointer to the head of the image source delay time list.|
| [OhosImageSourceDelayTimeList::size](#size-47) = 0 | Defines the size of the image source delay time list.|
| [OhosImageSourceSupportedFormat::format](#format) = nullptr | Defines a pointer to the head of the format string.|
| [OhosImageSourceSupportedFormat::size](#size-57) = 0 | Defines the size of the format string.|
| [OhosImageSourceSupportedFormatList::supportedFormatList](#supportedformatlist) = nullptr | Defines a double pointer to the head of the format string list.|
| [OhosImageSourceSupportedFormatList::size](#size-67) = 0 | Defines the size of the format string list.|
| [OhosImageSourceProperty::value](#value) = nullptr | Defines a pointer to the head of the property string.|
| [OhosImageSourceProperty::size](#size-77) = 0 | Defines the size of the property string.|
| [OhosImageSourceUpdateData::buffer](#buffer-22) = nullptr | Defines a pointer to the buffer for storing the update data.|
| [OhosImageSourceUpdateData::bufferSize](#buffersize-22) = 0 | Defines the size of the buffer.|
| [OhosImageSourceUpdateData::offset](#offset) = 0 | Defines the offset of the update data in the buffer.|
| [OhosImageSourceUpdateData::updateLength](#updatelength) = 0 | Defines the length of the update data in the buffer.|
| [OhosImageSourceUpdateData::isCompleted](#iscompleted) = 0 | Defines whether the image source data update is completed.|
Defines the data type name of the pixel map at the native layer.
| -------- | -------- |
| OHOS_PIXEL_MAP_FORMAT_NONE| Unknown format.|
| OHOS_PIXEL_MAP_FORMAT_RGBA_8888| 32-bit RGBA, with 8 bits each for R (red), G (green), B (blue), and A (alpha). The data is stored from the most significant bit to the least significant bit.|
| OHOS_PIXEL_MAP_FORMAT_RGB_565| 16-bit RGB, with 5, 6, and 5 bits for R, G, and B, respectively. The storage sequence is from the most significant bit to the least significant bit.|
**Since**
**Since**
8
10
### anonymous enum
### OH_Image_Receiver_On_Callback
```
```
anonymous enum
typedef void(* OH_Image_Receiver_On_Callback) ()
```
```
**Description**
Enumerates the pixel map alpha types.
**Description**
| Value| Description|
Defines the callbacks for the image interface at the native layer.
Obtains the memory address of a **PixelMap** object and locks the memory.
Enumerates the error codes returned by the functions.
After the function is executed successfully, **\*addrPtr** is the address of the memory to be accessed. After the access operation is complete, you must use [OH_UnAccessPixels](#oh_unaccesspixels) to unlock the memory. Otherwise, the resources in the memory cannot be released. After the memory is unlocked, its address cannot be accessed or operated.
**Since**
**Parameters**
8
| Name| Description|
**Deprecated from**
10
| Value| Description|
| -------- | -------- |
| -------- | -------- |
| env | Indicates the NAPI environment pointer.|
| OHOS_IMAGE_RESULT_SUCCESS | Operation success.|
| value | Indicates the **PixelMap** object at the application layer.|
Obtains the **PixelMap** information and stores the information to the [OhosPixelMapInfo](_ohos_pixel_map_info.md) struct.
Enumerates the pixel map editing types.
**Parameters**
**Since**
| Name| Description|
10
| Value| Description|
| -------- | -------- |
| -------- | -------- |
| env | Indicates the NAPI environment pointer.|
| OHOS_PIXEL_MAP_READ_ONLY | Read-only.|
| value | Indicates the **PixelMap** object at the application layer.|
| OHOS_PIXEL_MAP_EDITABLE | Editable.|
| info | Indicates the pointer to the object that stores the information obtained. For details, see [OhosPixelMapInfo](_ohos_pixel_map_info.md).|
**Returns**
Returns **0** if the information is obtained and stored successfully; returns an error code otherwise.
### anonymous enum [3/3]
**See**
```
anonymous enum
```
**Description**
[OhosPixelMapInfo](_ohos_pixel_map_info.md)
Enumerates the pixel map formats.
**Since**
**Since**
8
8
**Deprecated from**
### OH_PixelMap_CreateAlphaPixelMap()
10
| Value| Description|
| -------- | -------- |
| OHOS_PIXEL_MAP_FORMAT_NONE | Unknown format.|
| OHOS_PIXEL_MAP_FORMAT_RGBA_8888 | 32-bit RGBA, with 8 bits each for R (red), G (green), B (blue), and A (alpha). The data is stored from the most significant bit to the least significant bit.|
| OHOS_PIXEL_MAP_FORMAT_RGB_565 | 16-bit RGB, with 5, 6, and 5 bits for R, G, and B, respectively. The storage sequence is from the most significant bit to the least significant bit.|
Obtains the memory address of a **PixelMap** object and locks the memory.
**\*addrPtr** is the memory address obtained. After finishing the access, you must use **OH_UnAccessPixels** to unlock the memory. Then the memory cannot be accessed or operated.
**Parameters**
**Parameters**
| Name| Description|
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| env | Indicates the NAPI environment pointer.|
| env | Pointer to the NAPI environment.|
| info | Indicates the options for setting the **PixelMap** object.|
| value | **PixelMap** object at the application layer.|
| buf | Indicates the pointer to the buffer of the image.|
| addrPtr | Double pointer to the memory address.|
| len | Indicates the image size.|
| res | Indicates the pointer to the **PixelMap** object at the application layer.|
**Returns**
**Returns**
Returns a **PixelMap** object if the operation is successful; returns an error code otherwise.
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful; returns an error code otherwise.
int32_t OHOS::Media::OH_GetImageInfo (napi_env env, napi_value value, OhosPixelMapInfo * info )
```
```
**Description**
**Description**
Crops a **PixelMap** object.
Obtains the information about a **PixelMap** object and stores the information to the [OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md) struct.
**Parameters**
**Parameters**
| Name| Description|
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| native | Indicates the pointer to a **NativePixelMap** object.|
| env | Pointer to the NAPI environment.|
| x | Indicates the x-coordinate of the upper left corner of the target image.|
| value | **PixelMap** object at the application layer.|
| y | Indicates the y-coordinate of the upper left corner of the target image.|
| info | Pointer to the object that stores the information obtained. For details, see [OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md).|
| width | Indicates the width of the cropped region.|
| height | Indicates the height of the cropped region.|
**Returns**
**Returns**
Returns **0** if the operation is successful; returns an error code otherwise.
Returns **0** if the information is obtained and stored successfully; returns an error code otherwise.
Parses an **ImageNative** object from an **Image** object at the JavaScript native layer.
**Parameters**
**Parameters**
| Name| Description|
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| native | Indicates the pointer to a **NativePixelMap** object.|
| env | Pointer to the JNI environment.|
| editable | Indicates the pointer to the editing type of the **PixelMap** object.|
| source | **Image** object at the JavaScript native layer.|
**Returns**
**Returns**
Returns an enumerated value that indicates the editing type of the **PixelMap** object if the operation is successful; returns an error code otherwise.
Returns a pointer to the **ImageNative** object if the operation is successful; returns a null pointer otherwise.
Releases an **ImageNative** object. Note: This function is not used to release an **Image** object at the JavaScript native API. It is used to release an **ImageNative** object parsed by calling **OH_Image_InitImageNative**.
**Parameters**
**Parameters**
| Name| Description|
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| native | Indicates the pointer to a **NativePixelMap** object.|
| native | Pointer to an **ImageNative** object.|
| x | Indicates the horizontal distance to translate.|
| y | Indicates the vertical distance to translate.|
**Returns**
**Returns**
Returns **0** if the operation is successful; returns an error code otherwise.
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Unlocks the memory of a **PixelMap** object. This function is used with [OH_AccessPixels](#oh_accesspixels) in pairs.
Creates an **ImageSource** object at the JavaScript native layer based on the specified [OhosImageSource](_ohos_image_source.md) and [OhosImageSourceOps](_ohos_image_source_ops.md) structs.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
**Parameters**
| Name| Description|
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| env | Indicates the NAPI environment pointer.|
| env | Pointer to the JNI environment.|
| value | Indicates the **PixelMap** object at the application layer.|
| src | Pointer to the input resource of the image source. For details, see [OhosImageSource](_ohos_image_source.md).|
| ops | Pointer to the options for creating the image source. For details, see [OhosImageSourceOps](_ohos_image_source_ops.md).|
| res | Pointer to an **ImageSource** object at the JavaScript native layer.|
**Returns**
**Returns**
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful; returns an error code otherwise.
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_SOURCE_DATA_INCOMPLETE** if the image source data is incomplete.
Returns **IMAGE_RESULT_SOURCE_DATA** if the image source data is incorrect.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_TOO_LARGE** if the image is too large.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_DECODE_EXIF_UNSUPPORT** if EXIF is not supported for image decoding.
Returns **IMAGE_RESULT_PROPERTY_NOT_EXIST** if the image property does not exist.
Returns **IMAGE_RESULT_FILE_DAMAGED** if the file is damaged.
Returns **IMAGE_RESULT_FILE_FD_ERROR** if the file descriptor is incorrect.
Returns **IMAGE_RESULT_STREAM_SIZE_ERROR** if the data stream is incorrect.
Returns **IMAGE_RESULT_SEEK_FAILED** if seeking the file fails.
Returns **IMAGE_RESULT_PEEK_FAILED** if peeking the file fails.
Returns **IMAGE_RESULT_FREAD_FAILED** if reading the file fails.
Creates an **ImageSource** object at the JavaScript native layer based on the specified [OhosImageSource](_ohos_image_source.md) and [OhosImageSourceOps](_ohos_image_source_ops.md) structs. The image source data will be updated through **OH_ImageSource_UpdateData**.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| env | Pointer to the JNI environment.|
| src | Pointer to the input resource of the image source. Only the buffer type is accepted. For details, see [OhosImageSource](_ohos_image_source.md).|
| ops | Pointer to the options for creating the image source. For details, see [OhosImageSourceOps](_ohos_image_source_ops.md).|
| res | Pointer to an **ImageSource** object at the JavaScript native layer.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_SOURCE_DATA_INCOMPLETE** if the image source data is incomplete.
Returns **IMAGE_RESULT_SOURCE_DATA** if the image source data is incorrect.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_TOO_LARGE** if the image is too large.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_DECODE_EXIF_UNSUPPORT** if EXIF is not supported for image decoding.
Returns **IMAGE_RESULT_PROPERTY_NOT_EXIST** if the image property does not exist.
Returns **IMAGE_RESULT_FILE_DAMAGED** if the file is damaged.
Returns **IMAGE_RESULT_FILE_FD_ERROR** if the file descriptor is incorrect.
Returns **IMAGE_RESULT_STREAM_SIZE_ERROR** if the data stream is incorrect.
Returns **IMAGE_RESULT_SEEK_FAILED** if seeking the file fails.
Returns **IMAGE_RESULT_PEEK_FAILED** if peeking the file fails.
Returns **IMAGE_RESULT_FREAD_FAILED** if reading the file fails.
Decodes an **ImageSourceNative** object to obtain a **PixelMap** object at the JavaScript native layer based on the specified [OhosImageDecodingOps](_ohos_image_decoding_ops.md) struct.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an [ImageSourceNative](#imagesourcenative) object.|
| ops | Pointer to the options for decoding the image source. For details, see [OhosImageDecodingOps](_ohos_image_decoding_ops.md).|
| res | Pointer to a **PixelMap** object at the JavaScript native layer.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_CREATE_DECODER_FAILED** if the decoder fails to be created.
Returns **IMAGE_RESULT_CREATE_ENCODER_FAILED** if the encoder fails to be created.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST** if sharing the memory fails.
Returns **IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL** if the data in the shared memory is abnormal.
Returns **IMAGE_RESULT_DECODE_ABNORMAL** if image decoding fails.
Returns **IMAGE_RESULT_MALLOC_ABNORMAL** if the image is incorrect.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if an error occurs during image initialization.
Returns **IMAGE_RESULT_INIT_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_CROP** if cropping fails.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_ENCODE_FAILED** if the pixel map fails to be added.
Returns **IMAGE_RESULT_HW_DECODE_UNSUPPORT** if hardware decoding is not supported.
Returns **IMAGE_RESULT_HW_DECODE_FAILED** if hardware decoding fails.
Returns **IMAGE_RESULT_ERR_IPC** if IPC fails.
Returns **IMAGE_RESULT_INDEX_INVALID** if the index is invalid.
Returns **IMAGE_RESULT_ALPHA_TYPE_ERROR** if the alpha type is incorrect.
Returns **IMAGE_RESULT_ALLOCATER_TYPE_ERROR** if the memory allocation type is incorrect.
Decodes an **ImageSourceNative** object to obtain all **PixelMap** objects at the JavaScript native layer based on the specified [OhosImageDecodingOps](_ohos_image_decoding_ops.md) struct.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an [ImageSourceNative](#imagesourcenative) object.|
| ops | Pointer to the options for decoding the image source. For details, see [OhosImageDecodingOps](_ohos_image_decoding_ops.md).|
| res | Pointer to **PixelMap** objects at the JavaScript native layer.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_CREATE_DECODER_FAILED** if the decoder fails to be created.
Returns **IMAGE_RESULT_CREATE_ENCODER_FAILED** if the encoder fails to be created.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_ERR_SHAMEM_NOT_EXIST** if sharing the memory fails.
Returns **IMAGE_RESULT_ERR_SHAMEM_DATA_ABNORMAL** if the data in the shared memory is abnormal.
Returns **IMAGE_RESULT_DECODE_ABNORMAL** if image decoding fails.
Returns **IMAGE_RESULT_MALLOC_ABNORMAL** if the image is incorrect.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if an error occurs during image initialization.
Returns **IMAGE_RESULT_INIT_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_CROP** if cropping fails.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_ENCODE_FAILED** if the pixel map fails to be added.
Returns **IMAGE_RESULT_HW_DECODE_UNSUPPORT** if hardware decoding is not supported.
Returns **IMAGE_RESULT_HW_DECODE_FAILED** if hardware decoding fails.
Returns **IMAGE_RESULT_ERR_IPC** if IPC fails.
Returns **IMAGE_RESULT_INDEX_INVALID** if the index is invalid.
Returns **IMAGE_RESULT_ALPHA_TYPE_ERROR** if the alpha type is incorrect.
Returns **IMAGE_RESULT_ALLOCATER_TYPE_ERROR** if the memory allocation type is incorrect.
Returns **IMAGE_RESULT_DECODE_EXIF_UNSUPPORT** if EXIF is not supported for image decoding.
Returns **IMAGE_RESULT_PROPERTY_NOT_EXIST** if the image property does not exist.
Obtains the delay time list from an **ImageSourceNative** object (such as GIF image source).
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an [ImageSourceNative](#imagesourcenative) object.|
| res | Pointer to the [OhosImageSourceDelayTimeList](_ohos_image_source_delay_time_list.md) object obtained. When the input **delayTimeList** is a null pointer and **size** is **0**, the size of the delay time list is returned through **size** in **res**. To obtain the complete delay time list, a space greater than **size** is required.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_CREATE_DECODER_FAILED** if the decoder fails to be created.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_DECODE_ABNORMAL** if image decoding fails.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if an error occurs during image initialization.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_INDEX_INVALID** if the index is invalid.
Returns **IMAGE_RESULT_DECODE_EXIF_UNSUPPORT** if EXIF is not supported for image decoding.
Returns **IMAGE_RESULT_PROPERTY_NOT_EXIST** if the image property does not exist.
Obtains the value of an image property from an **ImageSourceNative** object.
\@Syscap SystemCapability.Multimedia.Image
**Parameters**
| Name| Description|
| -------- | -------- |
| native | Pointer to an [ImageSourceNative](#imagesourcenative) object.|
| key | Pointer to the property. For details, see [OhosImageSourceProperty](_ohos_image_source_property.md).|
| value | Pointer to the [OhosImageSourceProperty](_ohos_image_source_property.md) object obtained. If the input **value** is a null pointer and **size** is **0**, the size of the property value is returned through **size** in **value**. To obtain the complete property value, a space greater than **size** is required.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_GET_DATA_ABNORMAL** if an error occurs during image data retrieval.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_DECODE_HEAD_ABNORMAL** if an error occurs during decoding of the image header.
Returns **IMAGE_RESULT_CREATE_DECODER_FAILED** if the decoder fails to be created.
Returns **IMAGE_RESULT_THIRDPART_SKIA_ERROR** if skia decoding fails.
Returns **IMAGE_RESULT_DATA_ABNORMAL** if the input image data is incorrect.
Returns **IMAGE_RESULT_DECODE_ABNORMAL** if image decoding fails.
Returns **IMAGE_RESULT_DATA_UNSUPPORT** if an error occurs during image initialization.
Returns **IMAGE_RESULT_UNKNOWN_FORMAT** if the image format is unknown.
Returns **IMAGE_RESULT_PLUGIN_REGISTER_FAILED** if the plug-in fails to be registered.
Returns **IMAGE_RESULT_PLUGIN_CREATE_FAILED** if the plug-in fails to be created.
Returns **IMAGE_RESULT_INDEX_INVALID** if the index is invalid.
Returns **IMAGE_RESULT_DECODE_EXIF_UNSUPPORT** if EXIF is not supported for image decoding.
Returns **IMAGE_RESULT_PROPERTY_NOT_EXIST** if the image property does not exist.
| res | Pointer to the [OhosImageSourceSupportedFormatList](_ohos_image_source_supported_format_list.md) struct. If the input **supportedFormatList** is a null pointer and **size** is 0, the size of the supported formats is returned through **size** in **res**.<br>To obtain all formats, a space larger than **size** is required. In addition, sufficient space must be reserved for each format supported.|
**Returns**
For details, see [IRNdkErrCode](#irndkerrcode).
Returns **OHOS_IMAGE_RESULT_SUCCESS** if the operation is successful.
Returns **IMAGE_RESULT_BAD_PARAMETER** if a parameter is incorrect.
Returns **IMAGE_RESULT_JNI_ENV_ABNORMAL** if the JNI environment is abnormal.
Returns **IMAGE_RESULT_INVALID_PARAMETER** if a parameter is invalid.
Returns **IMAGE_RESULT_DECODE_FAILED** if decoding fails.
Returns **IMAGE_RESULT_CHECK_FORMAT_ERROR** if the format check fails.
Defines a pointer to bits per sample, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
Defines a pointer to the compressed bits per pixel, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
Defines a pointer to the created date and time, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
Defines a pointer to the exposure time, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
Defines a pointer to the f-number of the image, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
Defines a pointer to the GPS latitude, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
Defines a pointer to the GPS latitude reference information, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
Defines a pointer to the GPS longitude, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
Defines a pointer to the GPS longitude reference information, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
Defines a pointer to the image length, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
Defines a pointer to the image width, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
Defines a pointer to the ISO speed ratings, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
Defines a pointer to the orientation, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
Defines a pointer to the scene type, one of the image properties. It is used in [OH_ImageSource_GetImageProperty](#oh_imagesource_getimageproperty) and [OH_ImageSource_ModifyImageProperty](#oh_imagesource_modifyimageproperty).
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
### pixelFormat [1/3]
```
int32_t OhosImageSourceOps::pixelFormat
```
**Description**
Defines the pixel format of the image source. It is usually used to describe the YUV buffer.
**Since**
10
### pixelFormat [2/3]
```
int32_t OhosImageDecodingOps::pixelFormat
```
**Description**
Defines the pixel format of the output pixel map.
**Since**
10
### pixelFormat [3/3]
```
int32_t OhosImageSourceInfo::pixelFormat
```
**Description**
Defines the pixel format of the image source. It is set in [OH_ImageSource_Create](#oh_imagesource_create).
| [OHOS::Media::OH_Image_InitImageNative](image.md#oh_image_initimagenative)(napi_env env, napi_value source) | Parses an **ImageNative** object from an **Image** object at the JavaScript native layer.|
| [OHOS::Media::OH_Image_ClipRect](image.md#oh_image_cliprect)(const[ImageNative](image.md#imagenative) \*native, struct [OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md)\*rect) | Obtains [OhosImageRect](_o_h_o_s_1_1_media_1_1_ohos_image_rect.md) of an **ImageNative** object.|
| [OHOS::Media::OH_Image_Size](image.md#oh_image_size)(const[ImageNative](image.md#imagenative) \*native, struct [OhosImageSize](_ohos_image_size.md)\*size) | Obtains [OhosImageSize](_ohos_image_size.md) of an **ImageNative** object.|
| [OHOS::Media::OH_Image_Format](image.md#oh_image_format)(const[ImageNative](image.md#imagenative) \*native, int32_t \*format) | Obtains the image format of an **ImageNative** object.|
| [OHOS::Media::OH_Image_GetComponent](image.md#oh_image_getcomponent)(const[ImageNative](image.md#imagenative) \*native, int32_t componentType, struct [OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md)\*componentNative) | Obtains [OhosImageComponent](_o_h_o_s_1_1_media_1_1_ohos_image_component.md) of an **ImageNative** object.|
| [OHOS::Media::OH_Image_Release](image.md#oh_image_release)([ImageNative](image.md#imagenative)\*native) | Releases an **ImageNative** object.|
| [OH_PixelMap_CreateAlphaPixelMap](image.md#oh_pixelmap_createalphapixelmap)(napi_env env, napi_value source, napi_value \*alpha) | Creates a **PixelMap** object that contains only alpha channel information.|
| [OH_PixelMap_InitNativePixelMap](image.md#oh_pixelmap_initnativepixelmap)(napi_env env, napi_value source) | Initializes a **PixelMap** object.|
| [OH_PixelMap_GetBytesNumberPerRow](image.md#oh_pixelmap_getbytesnumberperrow)(const[NativePixelMap](image.md#nativepixelmap) \*native, int32_t \*num) | Obtains the number of bytes per row of a **NativePixelMap** object.|
| [OH_PixelMap_GetIsEditable](image.md#oh_pixelmap_getiseditable)(const[NativePixelMap](image.md#nativepixelmap) \*native, int32_t \*editable) | Checks whether a **NativePixelMap** object is editable.|
| [OH_PixelMap_SetAlphaAble](image.md#oh_pixelmap_setalphaable)(const[NativePixelMap](image.md#nativepixelmap) \*native, int32_t alpha) | Sets an alpha channel for a **NativePixelMap** object.|
| [OH_PixelMap_GetDensity](image.md#oh_pixelmap_getdensity)(const[NativePixelMap](image.md#nativepixelmap) \*native, int32_t \*density) | Obtains the pixel density of a **NativePixelMap** object.|
| [OH_PixelMap_SetDensity](image.md#oh_pixelmap_setdensity)(const[NativePixelMap](image.md#nativepixelmap) \*native, int32_t density) | Sets the pixel density for a **NativePixelMap** object.|
| [OH_PixelMap_SetOpacity](image.md#oh_pixelmap_setopacity)(const[NativePixelMap](image.md#nativepixelmap) \*native, float opacity) | Sets the opacity for a **NativePixelMap** object.|
| [OH_PixelMap_Crop](image.md#oh_pixelmap_crop)(const[NativePixelMap](image.md#nativepixelmap) \*native, int32_t x, int32_t y, int32_t width, int32_t height) | Crops a **NativePixelMap** object.|
| [OH_PixelMap_GetImageInfo](image.md#oh_pixelmap_getimageinfo)(const[NativePixelMap](image.md#nativepixelmap) \*native, [OhosPixelMapInfos](_ohos_pixel_map_infos.md)\*info) | Obtains the image information of a **NativePixelMap** object.|
| [OH_PixelMap_AccessPixels](image.md#oh_pixelmap_accesspixels)(const[NativePixelMap](image.md#nativepixelmap) \*native, void \*\*addr) | Obtains the memory address of a **NativePixelMap** object and locks the memory.|
| [OH_PixelMap_UnAccessPixels](image.md#oh_pixelmap_unaccesspixels)(const[NativePixelMap](image.md#nativepixelmap) \*native) | Unlocks the memory of a **NativePixelMap** object. This function is used with [OH_PixelMap_AccessPixels](image.md#oh_pixelmap_accesspixels) in pairs.|
Declares the APIs that can lock, access, and unlock pixel map data.
The **image_pixel_map_napi.h** file declares the APIs that can lock, access, and unlock a pixel map.
**Since**
**Since:**
8
8
**Related Modules:**
**Related Modules**
[Image](image.md)
[Image](image.md)
...
@@ -18,107 +19,24 @@ Declares the APIs that can lock, access, and unlock pixel map data.
...
@@ -18,107 +19,24 @@ Declares the APIs that can lock, access, and unlock pixel map data.
### Structs
### Structs
| Name | Description |
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| [OhosPixelMapInfo](_ohos_pixel_map_info.md) | Defines the pixel map information. |
| [OHOS::Media::OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md) | Defines the pixel map information.|
| [OhosPixelMapCreateOps](_ohos_pixel_map_create_ops.md) |Defines the options used for creating a pixel map. |
### Types
| Name | Description |
| -------- | -------- |
| [NativePixelMap](image.md#nativepixelmap) | Defines the data type name of the native pixel map. |
### Enums
### Enums
| Name | Description |
| Name| Description|
| -------- | -------- |
| -------- | -------- |
| { OHOS_IMAGE_RESULT_SUCCESS = 0, OHOS_IMAGE_RESULT_BAD_PARAMETER = -1 } | Enumerates the error codes returned by a function. |
| { [OHOS::Media::OHOS_IMAGE_RESULT_SUCCESS](image.md) = 0,<br>[OHOS::Media::OHOS_IMAGE_RESULT_BAD_PARAMETER](image.md) = -1 } | Enumerates the error codes returned by the functions.|
| [OH_GetImageInfo](image.md#oh_getimageinfo)(napi_env env, napi_value value, [OhosPixelMapInfo](_ohos_pixel_map_info.md)\*info) | Obtains the **PixelMap** information and stores the information to the [OhosPixelMapInfo](_ohos_pixel_map_info.md) structure. |
| [OHOS::Media::OH_GetImageInfo](image.md#oh_getimageinfo)(napi_env env, napi_value value, [OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md)\*info) | Obtains the information about a **PixelMap** object and stores the information to the [OhosPixelMapInfo](_o_h_o_s_1_1_media_1_1_ohos_pixel_map_info.md) struct.|
| [OH_AccessPixels](image.md#oh_accesspixels)(napi_env env, napi_value value, void \*\*addrPtr) | Obtains the memory address of the **PixelMap** object data and locks the memory. |
| [OHOS::Media::OH_AccessPixels](image.md#oh_accesspixels)(napi_env env, napi_value value, void \*\*addrPtr) | Obtains the memory address of a **PixelMap** object and locks the memory.|
| [OH_UnAccessPixels](image.md#oh_unaccesspixels)(napi_env env, napi_value value) | Unlocks the memory of the **PixelMap** object data. This function is used with [OH_AccessPixels](image.md#oh_accesspixels) in pairs. |
| [OHOS::Media::OH_UnAccessPixels](image.md#oh_unaccesspixels)(napi_env env, napi_value value) | Unlocks the memory of a **PixelMap** object. This function is used with **OH_AccessPixels** in pairs.|
### Variables
| Name | Description |
| -------- | -------- |
| [width](#width) | Image width, in pixels. |
| [height](#height) | Image height, in pixels. |
| [pixelFormat](#pixelformat) | Image format. |
| [editable](#editable) | Editing type of the image. |
| [alphaType](#alphatype) | Alpha type of the image. |
| [scaleMode](#scalemode) | Scale mode of the image. |
The **image_receiver_mdk.h** file declares the APIs for obtaining image data from the native layer.
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Structs
| Name| Description|
| -------- | -------- |
| [OhosImageReceiverInfo](_ohos_image_receiver_info.md) | Defines the information about an image receiver.|
### Types
| Name| Description|
| -------- | -------- |
| [ImageReceiverNative](image.md#imagereceivernative) | Defines the data type name of the image receiver at the native layer.|
| (\*[OH_Image_Receiver_On_Callback](image.md#oh_image_receiver_on_callback)) () | Defines the callbacks for the image interface at the native layer.|
### Functions
| Name| Description|
| -------- | -------- |
| [OH_Image_Receiver_CreateImageReceiver](image.md#oh_image_receiver_createimagereceiver)(napi_env env, struct [OhosImageReceiverInfo](_ohos_image_receiver_info.md) info, napi_value \*res) | Creates an **ImageReceiver** object at the application layer.|
| [OH_Image_Receiver_InitImageReceiverNative](image.md#oh_image_receiver_initimagereceivernative)(napi_env env, napi_value source) | Initializes an [ImageReceiverNative](image.md#imagereceivernative) object through an **ImageReceiver** object.|
| [OH_Image_Receiver_GetReceivingSurfaceId](image.md#oh_image_receiver_getreceivingsurfaceid)(const[ImageReceiverNative](image.md#imagereceivernative) \*native, char \*id, size_t len) | Obtains the receiver ID through an [ImageReceiverNative](image.md#imagereceivernative) object.|
| [OH_Image_Receiver_ReadLatestImage](image.md#oh_image_receiver_readlatestimage)(const[ImageReceiverNative](image.md#imagereceivernative) \*native, napi_value \*image) | Obtains the latest image through an [ImageReceiverNative](image.md#imagereceivernative) object.|
| [OH_Image_Receiver_ReadNextImage](image.md#oh_image_receiver_readnextimage)(const[ImageReceiverNative](image.md#imagereceivernative) \*native, napi_value \*image) | Obtains the next image through an [ImageReceiverNative](image.md#imagereceivernative) object.|
| [OH_Image_Receiver_On](image.md#oh_image_receiver_on)(const[ImageReceiverNative](image.md#imagereceivernative) \*native, [OH_Image_Receiver_On_Callback](image.md#oh_image_receiver_on_callback) callback) | Registers an [OH_Image_Receiver_On_Callback](image.md#oh_image_receiver_on_callback) callback. This callback is triggered whenever a new image is received.|
| [OH_Image_Receiver_GetSize](image.md#oh_image_receiver_getsize)(const[ImageReceiverNative](image.md#imagereceivernative) \*native, struct [OhosImageSize](_ohos_image_size.md)\*size) | Obtains the size of the image receiver through an [ImageReceiverNative](image.md#imagereceivernative) object.|
| [OH_Image_Receiver_GetCapacity](image.md#oh_image_receiver_getcapacity)(const[ImageReceiverNative](image.md#imagereceivernative) \*native, int32_t \*capacity) | Obtains the capacity of the image receiver through an [ImageReceiverNative](image.md#imagereceivernative) object.|
| [OH_Image_Receiver_GetFormat](image.md#oh_image_receiver_getformat)(const[ImageReceiverNative](image.md#imagereceivernative) \*native, int32_t \*format) | Obtains the format of the image receiver through an [ImageReceiverNative](image.md#imagereceivernative) object.|
| [OH_Image_Receiver_Release](image.md#oh_image_receiver_release)([ImageReceiverNative](image.md#imagereceivernative)\*native) | Releases an [ImageReceiverNative](image.md#imagereceivernative) object.|
The **image_source_mdk.h** file declares the APIs for decoding an image source into a pixel map.
\@Syscap SystemCapability.Multimedia.Image
**Since**
10
**Related Modules**
[Image](image.md)
## Summary
### Structs
| Name| Description|
| -------- | -------- |
| [OhosImageRegion](_ohos_image_region.md) | Defines the region of an image source to decode.|
| [OhosImageSourceOps](_ohos_image_source_ops.md) | Defines the image source options.|
| [OhosImageDecodingOps](_ohos_image_decoding_ops.md) | Defines the options for decoding an image source.|
| [OhosImageSourceInfo](_ohos_image_source_info.md) | Defines the information about an image source.|
| [OhosImageSource](_ohos_image_source.md) | Defines the input resource of an image source. Only one type of resource is accepted at a time.|
| [OhosImageSourceDelayTimeList](_ohos_image_source_delay_time_list.md) | Defines the delay time list of an image source.|
| [OhosImageSourceSupportedFormat](_ohos_image_source_supported_format.md) | Defines the format string supported by an image source.|
| [OhosImageSourceSupportedFormatList](_ohos_image_source_supported_format_list.md) | Defines the format string list supported by an image source.|
| [OhosImageSourceProperty](_ohos_image_source_property.md) | Defines the property string (in key-value format) of an image source.|
| [OhosImageSourceUpdateData](_ohos_image_source_update_data.md) | Defines the update data of an image source.|
### Types
| Name| Description|
| -------- | -------- |
| [ImageSourceNative](image.md#imagesourcenative) | Defines an image source object at the native layer.|
### Functions
| Name| Description|
| -------- | -------- |
| [OH_ImageSource_Create](image.md#oh_imagesource_create)(napi_env env, struct [OhosImageSource](_ohos_image_source.md)\*src, struct [OhosImageSourceOps](_ohos_image_source_ops.md)\*ops, napi_value \*res) | Creates an **ImageSource** object at the JavaScript native layer based on the specified [OhosImageSource](_ohos_image_source.md) and [OhosImageSourceOps](_ohos_image_source_ops.md) structs.|
| [OH_ImageSource_CreateIncremental](image.md#oh_imagesource_createincremental)(napi_env env, struct [OhosImageSource](_ohos_image_source.md)\*source, struct [OhosImageSourceOps](_ohos_image_source_ops.md)\*ops, napi_value \*res) | Creates an **ImageSource** object at the JavaScript native layer based on the specified [OhosImageSource](_ohos_image_source.md) and [OhosImageSourceOps](_ohos_image_source_ops.md) structs. The image source data will be updated through **OH_ImageSource_UpdateData**.|
| [OH_ImageSource_GetSupportedFormats](image.md#oh_imagesource_getsupportedformats)(struct[OhosImageSourceSupportedFormatList](_ohos_image_source_supported_format_list.md) \*res) | Obtains all supported decoding formats.|
| \*[OH_ImageSource_InitNative](image.md#oh_imagesource_initnative)(napi_env env, napi_value source) | Converts an **ImageSource** object at the JavaScript native layer to an [ImageSourceNative](image.md#imagesourcenative) object.|
| [OH_ImageSource_CreatePixelMap](image.md#oh_imagesource_createpixelmap)(const[ImageSourceNative](image.md#imagesourcenative) \*native, struct [OhosImageDecodingOps](_ohos_image_decoding_ops.md)\*ops, napi_value \*res) | Decodes an **ImageSourceNative** object to obtain a **PixelMap** object at the JavaScript native layer based on the specified [OhosImageDecodingOps](_ohos_image_decoding_ops.md) struct.|
| [OH_ImageSource_CreatePixelMapList](image.md#oh_imagesource_createpixelmaplist)(const[ImageSourceNative](image.md#imagesourcenative) \*native, struct [OhosImageDecodingOps](_ohos_image_decoding_ops.md)\*ops, napi_value \*res) | Decodes an **ImageSourceNative** object to obtain all **PixelMap** objects at the JavaScript native layer based on the specified [OhosImageDecodingOps](_ohos_image_decoding_ops.md) struct.|
| [OH_ImageSource_GetDelayTime](image.md#oh_imagesource_getdelaytime)(const[ImageSourceNative](image.md#imagesourcenative) \*native, struct [OhosImageSourceDelayTimeList](_ohos_image_source_delay_time_list.md)\*res) | Obtains the delay time list from an **ImageSourceNative** object (such as GIF image source).|
| [OH_ImageSource_GetFrameCount](image.md#oh_imagesource_getframecount)(const[ImageSourceNative](image.md#imagesourcenative) \*native, uint32_t \*res) | Obtains the number of frames from an **ImageSourceNative** object.|
| [OH_ImageSource_GetImageInfo](image.md#oh_imagesource_getimageinfo)(const[ImageSourceNative](image.md#imagesourcenative) \*native, int32_t index, struct [OhosImageSourceInfo](_ohos_image_source_info.md)\*info) | Obtains image source information from an **ImageSourceNative** object by index.|
| [OH_ImageSource_GetImageProperty](image.md#oh_imagesource_getimageproperty)(const[ImageSourceNative](image.md#imagesourcenative) \*native, struct [OhosImageSourceProperty](_ohos_image_source_property.md)\*key, struct [OhosImageSourceProperty](_ohos_image_source_property.md)\*value) | Obtains the value of an image property from an **ImageSourceNative** object.|
| [OH_ImageSource_ModifyImageProperty](image.md#oh_imagesource_modifyimageproperty)(const[ImageSourceNative](image.md#imagesourcenative) \*native, struct [OhosImageSourceProperty](_ohos_image_source_property.md)\*key, struct [OhosImageSourceProperty](_ohos_image_source_property.md)\*value) | Modifies the value of an image property of an **ImageSourceNative** object.|
| [OH_ImageSource_UpdateData](image.md#oh_imagesource_updatedata)(const[ImageSourceNative](image.md#imagesourcenative) \*native, struct [OhosImageSourceUpdateData](_ohos_image_source_update_data.md)\*data) | Updates the data of an **ImageSourceNative** object.|
| [OH_ImageSource_Release](image.md#oh_imagesource_release)([ImageSourceNative](image.md#imagesourcenative)\*native) | Releases an **ImageSourceNative** object.|
### Variables
| Name| Description|
| -------- | -------- |
| \*[OHOS_IMAGE_PROPERTY_BITS_PER_SAMPLE](image.md#ohos_image_property_bits_per_sample) = "BitsPerSample" | Defines a pointer to bits per sample, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_ORIENTATION](image.md#ohos_image_property_orientation) = "Orientation" | Defines a pointer to the orientation, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_IMAGE_LENGTH](image.md#ohos_image_property_image_length) = "ImageLength" | Defines a pointer to the image length, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_IMAGE_WIDTH](image.md#ohos_image_property_image_width) = "ImageWidth" | Defines a pointer to the image width, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_GPS_LATITUDE](image.md#ohos_image_property_gps_latitude) = "GPSLatitude" | Defines a pointer to the GPS latitude, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_GPS_LONGITUDE](image.md#ohos_image_property_gps_longitude) = "GPSLongitude" | Defines a pointer to the GPS longitude, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_GPS_LATITUDE_REF](image.md#ohos_image_property_gps_latitude_ref) = "GPSLatitudeRef" | Defines a pointer to the GPS latitude reference information, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_GPS_LONGITUDE_REF](image.md#ohos_image_property_gps_longitude_ref) = "GPSLongitudeRef" | Defines a pointer to the GPS longitude reference information, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_DATE_TIME_ORIGINAL](image.md#ohos_image_property_date_time_original) = "DateTimeOriginal" | Defines a pointer to the created date and time, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_EXPOSURE_TIME](image.md#ohos_image_property_exposure_time) = "ExposureTime" | Defines a pointer to the exposure time, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_SCENE_TYPE](image.md#ohos_image_property_scene_type) = "SceneType" | Defines a pointer to the scene type, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_ISO_SPEED_RATINGS](image.md#ohos_image_property_iso_speed_ratings) = "ISOSpeedRatings" | Defines a pointer to the ISO speed ratings, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_F_NUMBER](image.md#ohos_image_property_f_number) = "FNumber" | Defines a pointer to the f-number of the image, one of the image properties.|
| \*[OHOS_IMAGE_PROPERTY_COMPRESSED_BITS_PER_PIXEL](image.md#ohos_image_property_compressed_bits_per_pixel) = "CompressedBitsPerPixel" | Defines a pointer to the compressed bits per pixel, one of the image properties.|
The **native_avscreen_capture.h** file declares the native APIs used to create an **OH_AVScreenCapture** instance.
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Functions
| Name| Description|
| -------- | -------- |
| [OH_AVScreenCapture_Create](_a_v_screen_capture.md#oh_avscreencapture_create)(void) | Creates an **OH_AVScreenCapture** instance.|
| [OH_AVScreenCapture_Init](_a_v_screen_capture.md#oh_avscreencapture_init)(struct[OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, [OH_AVScreenCaptureConfig](_o_h___a_v_screen_capture_config.md) config) | Initializes parameters related to an **OH_AVScreenCapture** instance.|
| [OH_AVScreenCapture_StartScreenCapture](_a_v_screen_capture.md#oh_avscreencapture_startscreencapture)(struct[OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture) | Starts screen capture and collects original streams. After calling this function, the application can use the callback listeners **OH_AVScreenCaptureOnAudioBufferAvailable** and **OH_AVScreenCaptureOnVideoBufferAvailable** to check whether streams are generated.|
| [OH_AVScreenCapture_StopScreenCapture](_a_v_screen_capture.md#oh_avscreencapture_stopscreencapture)(struct[OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture) | Stops screen capture. This function is used in pair with **OH_AVScreenCapture_StartScreenCapture**. After calling this function, the application stops screen capture or screen share and releases the microphone.|
| [OH_AVScreenCapture_StartScreenRecording](_a_v_screen_capture.md#oh_avscreencapture_startscreenrecording)(struct[OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture) | Starts screen recording and collects encoded streams.<br>**NOTE**: This function is reserved and will be provided in later versions.|
| [OH_AVScreenCapture_StopScreenRecording](_a_v_screen_capture.md#oh_avscreencapture_stopscreenrecording)(struct[OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture) | Stops screen recording. This function is used in pair with **OH_AVScreenCapture_StartScreenRecording**.<br>**NOTE**: This function is reserved and will be provided in later versions.|
| [OH_AVScreenCapture_AcquireAudioBuffer](_a_v_screen_capture.md#oh_avscreencapture_acquireaudiobuffer)(struct[OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, [OH_AudioBuffer](_o_h___audio_buffer.md)\*\*audiobuffer, [OH_AudioCaptureSourceType](_a_v_screen_capture.md#oh_audiocapturesourcetype) type) | Obtains an audio buffer. When calling this function, the application must allocate the memory of the corresponding struct size to the audio buffer.|
| [OH_AVScreenCapture_AcquireVideoBuffer](_a_v_screen_capture.md#oh_avscreencapture_acquirevideobuffer)(struct[OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, int32_t \*fence, int64_t \*timestamp, struct [OH_Rect](_o_h___rect.md)\*region) | Obtains a video buffer. An application can call this function to obtain information such as the video buffer and timestamp.|
| [OH_AVScreenCapture_ReleaseAudioBuffer](_a_v_screen_capture.md#oh_avscreencapture_releaseaudiobuffer)(struct[OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, [OH_AudioCaptureSourceType](_a_v_screen_capture.md#oh_audiocapturesourcetype) type) | Releases an audio buffer.|
| [OH_AVScreenCapture_ReleaseVideoBuffer](_a_v_screen_capture.md#oh_avscreencapture_releasevideobuffer)(struct[OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture) | Releases a video buffer.|
| [OH_AVScreenCapture_SetCallback](_a_v_screen_capture.md#oh_avscreencapture_setcallback)(struct[OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, struct [OH_AVScreenCaptureCallback](_o_h___a_v_screen_capture_callback.md) callback) | Sets a callback to listen for available video buffers and audio buffers and errors that occur during the function calling.|
| [OH_AVScreenCapture_Release](_a_v_screen_capture.md#oh_avscreencapture_release)(struct[OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture) | Releases an **OH_AVScreenCapture** instance. This function is used in pair with **OH_AVScreenCapture_Create**.|
| [OH_AVScreenCapture_SetMicrophoneEnabled](_a_v_screen_capture.md#oh_avscreencapture_setmicrophoneenabled)(struct[OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) \*capture, bool isMicrophone) | Enables or disables the microphone.|
| [OH_AudioEncInfo](_o_h___audio_enc_info.md) | Defines audio encoding information.<br>**NOTE**: This struct is reserved and will be provided in later versions.|
| [OH_VideoCaptureInfo](_o_h___video_capture_info.md) | Defines video capturing information.|
| [OH_VideoEncInfo](_o_h___video_enc_info.md) | Defines video encoding information.<br>**NOTE**: This struct is reserved and will be provided in later versions.|
| [OH_VideoInfo](_o_h___video_info.md) | Defines video capturing parameters.|
| [OH_AVScreenCaptureConfig](_o_h___a_v_screen_capture_config.md) | Defines the screen capture configuration.|
| [OH_AVScreenCaptureCallback](_o_h___a_v_screen_capture_callback.md) | Defines all the asynchronous callback function pointers of an **OH_AVScreenCapture** instance.|
| [OH_Rect](_o_h___rect.md) | Defines the width, height, and image information of the rectangle used for screen capture.|
| [OH_AudioBuffer](_o_h___audio_buffer.md) | Defines the configuration such as the size, type, and timestamp of audio data.|
### Types
| Name| Description|
| -------- | -------- |
| [OH_NativeBuffer](_a_v_screen_capture.md#oh_nativebuffer) | Defines the native video stream class for screen capture.|
| [OH_AVScreenCapture](_a_v_screen_capture.md#oh_avscreencapture) | Defines a screen capture instance used to obtain original video and audio streams.|
| [OH_CaptureMode](_a_v_screen_capture.md#oh_capturemode) | Defines an enum that enumerates the screen capture modes.|
| [OH_AudioCaptureSourceType](_a_v_screen_capture.md#oh_audiocapturesourcetype) | Defines an enum that enumerates the audio source types during screen capture.|
| [OH_AudioCodecFormat](_a_v_screen_capture.md#oh_audiocodecformat) | Defines an enum that enumerates the audio encoding formats.|
| [OH_VideoCodecFormat](_a_v_screen_capture.md#oh_videocodecformat) | Defines an enum that enumerates the video encoding formats.|
| [OH_DataType](_a_v_screen_capture.md#oh_datatype) | Defines an enum that enumerates the data types of screen capture streams.|
| [OH_VideoSourceType](_a_v_screen_capture.md#oh_videosourcetype) | Defines an enum that enumerates the video source formats.|
| [OH_ContainerFormatType](_a_v_screen_capture.md#oh_containerformattype) | Defines an enum that enumerates the types of files generated during screen capture.<br>**NOTE**: This type is reserved and will be provided in later versions.|
| [OH_AudioEncInfo](_a_v_screen_capture.md#oh_audioencinfo) | Defines audio encoding information.<br>**NOTE**: This type is reserved and will be provided in later versions.|
| [OH_VideoCaptureInfo](_a_v_screen_capture.md#oh_videocaptureinfo) | Defines video capturing information.|
| [OH_VideoEncInfo](_a_v_screen_capture.md#oh_videoencinfo) | Defines video encoding information.<br>**NOTE**: This type is reserved and will be provided in later versions.|
| [OH_VideoInfo](_a_v_screen_capture.md#oh_videoinfo) | Defines video capturing parameters.|
| [OH_AVScreenCaptureConfig](_a_v_screen_capture.md#oh_avscreencaptureconfig) | Defines the screen recording configuration.|
| (\*[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.|
| (\*[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.|
| (\*[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.|
| [OH_AVScreenCaptureCallback](_a_v_screen_capture.md#oh_avscreencapturecallback) | Defines all the asynchronous callback function pointers of an **OH_AVScreenCapture** instance.|
| [OH_Rect](_a_v_screen_capture.md#oh_rect) | Defines the width, height, and image information of the rectangle used for screen capture.|
| [OH_AudioBuffer](_a_v_screen_capture.md#oh_audiobuffer) | Defines the configuration such as the size, type, and timestamp of audio data.|
| [OH_DataType](_a_v_screen_capture.md#oh_datatype) { [OH_ORIGINAL_STREAM](_a_v_screen_capture.md) = 0, [OH_ENCODED_STREAM](_a_v_screen_capture.md) = 1, [OH_CAPTURE_FILE](_a_v_screen_capture.md) = 2, OH_INVAILD = -1 } | Enumerates the data sources of screen capture streams.|
| [OH_VideoSourceType](_a_v_screen_capture.md#oh_videosourcetype) { [OH_VIDEO_SOURCE_SURFACE_YUV](_a_v_screen_capture.md) = 0, [OH_VIDEO_SOURCE_SURFACE_ES](_a_v_screen_capture.md), [OH_VIDEO_SOURCE_SURFACE_RGBA](_a_v_screen_capture.md), [OH_VIDEO_SOURCE_BUTT](_a_v_screen_capture.md) } | Enumerates the video source formats.|
| [OH_ContainerFormatType](_a_v_screen_capture.md#oh_containerformattype) { [CFT_MPEG_4A](_a_v_screen_capture.md) = 0, [CFT_MPEG_4](_a_v_screen_capture.md) = 1 } | Enumerates the types of files generated during screen capture.<br>**NOTE**: This enum is reserved and will be provided in later versions.|
The **native_avscreen_capture_errors.h** file declares the error codes generated during screen capture.
**Since**
10
**Related Modules**
[AVScreenCapture](_a_v_screen_capture.md)
## Summary
### Types
| Name| Description|
| -------- | -------- |
| [OH_AVSCREEN_CAPTURE_ErrCode](_a_v_screen_capture.md#oh_avscreen_capture_errcode) | Defines an enum that enumerates the error codes generated during screen recording.|