1e41f4b71Sopenharmony_ci# Native API Differences
2e41f4b71Sopenharmony_ci
3e41f4b71Sopenharmony_ciCompared with earlier versions, OpenHarmony 4.0.8.5 has the following API changes in its native APIs:
4e41f4b71Sopenharmony_ci *
5e41f4b71Sopenharmony_ci## Standard System API Changes
6e41f4b71Sopenharmony_ci
7e41f4b71Sopenharmony_ci| Module| API                                                    | Change Type| Change Description            |
8e41f4b71Sopenharmony_ci| -------- | ------------------------------------------------------------ | -------- | -------------------- |
9e41f4b71Sopenharmony_ci| avmuxer  | OH_AVMuxer \*OH_AVMuxer_Create(int32_t fd, OH_AVOutputFormat format); | Added    | This API is added to create an **OH_AVMuxer** instance.      |
10e41f4b71Sopenharmony_ci| avmuxer  | OH_AVErrCode OH_AVMuxer_SetRotation(OH_AVMuxer \*muxer, int32_t rotation); | Added    | This API is added to set the rotation angle of an output video.    |
11e41f4b71Sopenharmony_ci| avmuxer  | OH_AVErrCode OH_AVMuxer_AddTrack(OH_AVMuxer \*muxer, int32_t \*trackIndex, OH_AVFormat \*trackFormat); | Added    | This API is added to add a media track.          |
12e41f4b71Sopenharmony_ci| avmuxer  | OH_AVErrCode OH_AVMuxer_Start(OH_AVMuxer \*muxer);           | Added    | This API is added to start encapsulation.            |
13e41f4b71Sopenharmony_ci| avmuxer  | OH_AVErrCode OH_AVMuxer_WriteSample(OH_AVMuxer \*muxer, uint32_t trackIndex, OH_AVMemory \*sample, OH_AVCodecBufferAttr info); | Added    | This API is added to write data to the muxer.    |
14e41f4b71Sopenharmony_ci| avmuxer  | OH_AVErrCode OH_AVMuxer_Stop(OH_AVMuxer \*muxer);            | Added    | This API is added to stop encapsulation.            |
15e41f4b71Sopenharmony_ci| avmuxer  | OH_AVErrCode OH_AVMuxer_Destroy(OH_AVMuxer \*muxer);         | Added    | This API is added to destroy an **OH_AVMuxer** instance.      |
16e41f4b71Sopenharmony_ci| avsource  | OH_AVSource *OH_AVSource_CreateWithURI(char *uri);         | Added    | This API is added to create an **OH_AVSource** instance based on a URI.      |
17e41f4b71Sopenharmony_ci| avsource  | OH_AVSource *OH_AVSource_CreateWithFD(int32_t fd, int64_t offset, int64_t size);         | Added    | This API is added to create an **OH_AVSource** instance based on a file descriptor (FD).      |
18e41f4b71Sopenharmony_ci| avsource  | OH_AVErrCode OH_AVSource_Destroy(OH_AVSource *source);         | Added    | This API is added to destroy an **OH_AVSource** instance.      |
19e41f4b71Sopenharmony_ci| avsource  | OH_AVFormat *OH_AVSource_GetSourceFormat(OH_AVSource *source);         | Added    | This API is added to obtain source information.      |
20e41f4b71Sopenharmony_ci| avsource  | OH_AVFormat *OH_AVSource_GetTrackFormat(OH_AVSource *source, uint32_t trackCount);         | Added    | This API is added to obtain track information.      |
21e41f4b71Sopenharmony_ci| avdemuxer  | OH_AVDemuxer *OH_AVDemuxer_CreateWithSource(OH_AVSource *source);         | Added    | This API is added to create an **OH_AVDemuxer** instance based on source information.      |
22e41f4b71Sopenharmony_ci| avdemuxer  | OH_AVErrCode OH_AVDemuxer_Destroy(OH_AVDemuxer *demuxer);         | Added    | This API is added to destroy an **OH_AVDemuxer** instance.      |
23e41f4b71Sopenharmony_ci| avdemuxer  | OH_AVErrCode OH_AVDemuxer_SelectTrackByID(OH_AVDemuxer *demuxer, uint32_t trackIndex);         | Added    | This API is added to select a track, from which the demuxer reads data.     |
24e41f4b71Sopenharmony_ci| avdemuxer  | OH_AVErrCode OH_AVDemuxer_UnselectTrackByID(OH_AVDemuxer *demuxer, uint32_t trackIndex);         | Added    | This API is added to deselect a track.      |
25e41f4b71Sopenharmony_ci| avdemuxer  | OH_AVErrCode OH_AVDemuxer_ReadSample(OH_AVDemuxer *demuxer, uint32_t trackIndex, OH_AVMemory *sample, OH_AVCodecBufferAttr *info);         | Added    | This API is added to read the frame from a track specified by **trackIndex**.    |
26e41f4b71Sopenharmony_ci| avdemuxer  | OH_AVErrCode OH_AVDemuxer_SeekToTime(OH_AVDemuxer *demuxer, int64_t millisecond, OH_AVSeekMode mode);         | Added    | This API is added to seek to the specified time.      |
27e41f4b71Sopenharmony_ci|avcapability|OH_AVCapability *OH_AVCodec_GetCapability(const char *mime, bool isEncoder);|Added|This API is added to obtain a handle to the codec capability recommended by the system.|
28e41f4b71Sopenharmony_ci|avcapability|OH_AVCapability *OH_AVCodec_GetCapabilityByCategory(const char *mime, bool isEncoder, OH_AVCodecCategory category);|Added|This API is added to obtain a handle to the codec capability by category, which can be a hardware codec or software codec.|
29e41f4b71Sopenharmony_ci|avcapability|bool OH_AVCapability_IsHardware(OH_AVCapability *capability);|Added|This API is added to check whether a codec capability instance describes a hardware codec.|
30e41f4b71Sopenharmony_ci|avcapability|const char *OH_AVCapability_GetName(OH_AVCapability *capability);|Added|This API is added to obtain the codec name.|
31e41f4b71Sopenharmony_ci|avcapability|int32_t OH_AVCapability_GetMaxSupportedInstances(OH_AVCapability *capability);|Added|This API is added to obtain the maximum number of codec instances supported by a codec.|
32e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetEncoderBitrateRange(OH_AVCapability *capability, OH_AVRange *bitrateRange);|Added|This API is added to obtain the bit rate range supported by an encoder.|
33e41f4b71Sopenharmony_ci|avcapability|bool OH_AVCapability_IsEncoderBitrateModeSupported(OH_AVCapability *capability, OH_BitrateMode bitrateMode);|Added|This API is added to check whether a specific bit rate mode is supported.|
34e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetEncoderQualityRange(OH_AVCapability *capability, OH_AVRange *qualityRange);|Added|This API is added to obtain the quality range supported by an encoder.|
35e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetEncoderComplexityRange(OH_AVCapability *capability, OH_AVRange *complexityRange);|Added|This API is added to obtain the complexity range supported by an encoder.|
36e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetAudioSupportedSampleRates(OH_AVCapability *capability, const int32_t **sampleRates, uint32_t *sampleRateNum);|Added|This API is added to obtain the sampling rates supported by an audio codec.|
37e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetAudioChannelCountRange(OH_AVCapability *capability, OH_AVRange *channelCountRange);|Added|This API is added to obtain the count range of audio channels supported by an audio codec.|
38e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetVideoWidthAlignment(OH_AVCapability *capability, int32_t *widthAlignment);|Added|This API is added to obtain the video width alignment.|
39e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetVideoHeightAlignment(OH_AVCapability *capability, int32_t *heightAlignment);|Added|This API is added to obtain the video height alignment.|
40e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetVideoWidthRangeForHeight(OH_AVCapability *capability, int32_t height, OH_AVRange *widthRange);|Added|This API is added to obtain the video width range based on a given height.|
41e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetVideoHeightRangeForWidth(OH_AVCapability *capability, int32_t width, OH_AVRange *heightRange);|Added|This API is added to obtain the video height range based on a given width.|
42e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetVideoWidthRange(OH_AVCapability *capability, OH_AVRange *widthRange);|Added|This API is added to obtain the video width range.|
43e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetVideoHeightRange(OH_AVCapability *capability, OH_AVRange *heightRange);|Added|This API is added to obtain the video height range.|
44e41f4b71Sopenharmony_ci|avcapability|bool OH_AVCapability_IsVideoSizeSupported(OH_AVCapability *capability, int32_t width, int32_t height);|Added|This API is added to check whether a video size is supported.|
45e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetVideoFrameRateRange(OH_AVCapability *capability, OH_AVRange *frameRateRange);|Added|This API is added to obtain the video frame rate range.|
46e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetVideoFrameRateRangeForSize(OH_AVCapability *capability, int32_t width, int32_t height, OH_AVRange *frameRateRange);|Added|This API is added to obtain the video frame rate range based on a given size.|
47e41f4b71Sopenharmony_ci|avcapability|bool OH_AVCapability_AreVideoSizeAndFrameRateSupported(OH_AVCapability *capability, int32_t width, int32_t height, int32_t frameRate);|Added|This API is added to check whether the combination of a video size and frame rate is supported.|
48e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetVideoSupportedPixelFormats(OH_AVCapability *capability, const int32_t **pixFormats, uint32_t *pixFormatNum);|Added|This API is added to obtain the video pixel formats supported.|
49e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetSupportedProfiles(OH_AVCapability *capability, const int32_t **profiles, uint32_t *profileNum);|Added|This API is added to obtain the profiles supported.|
50e41f4b71Sopenharmony_ci|avcapability|OH_AVErrCode OH_AVCapability_GetSupportedLevelsForProfile(OH_AVCapability *capability, int32_t profile, const int32_t **levels,uint32_t *levelNum);|Added|This API is added to obtain the codec levels supported by a profile.|
51e41f4b71Sopenharmony_ci|avcapability|bool OH_AVCapability_AreProfileAndLevelSupported(OH_AVCapability *capability, int32_t profile, int32_t level);|Added|This API is added to check whether the combination of a profile and level is supported.|
52e41f4b71Sopenharmony_ci|avformat|struct OH_AVFormat \*OH_AVFormat_CreateAudioFormat(const char \*mimeType, int32_t sampleRate, int32_t channelCount);|Added|This API is added to create an **OH_AVFormat** instance for an audio track (used in **avmuxer**).|
53e41f4b71Sopenharmony_ci|avformat|struct OH_AVFormat \*OH_AVFormat_CreateVideoFormat(const char \*mimeType, int32_t width, int32_t height);|Added|This API is added to create an **OH_AVFormat** instance for a video track (used in avmuxer).|
54e41f4b71Sopenharmony_ci|avmemory|OH_AVMemory \*OH_AVMemory_Create(int32_t size);|Added|This API is added to create an **OH_AVMemory** instance.|
55e41f4b71Sopenharmony_ci|avmemory|OH_AVErrCode OH_AVMemory_Destroy(struct OH_AVMemory \*mem);|Added|This API is added to destroy an **OH_AVMemory** instance.|
56e41f4b71Sopenharmony_ci| avcodec | OH_AVErrCode OH_AudioDecoder_IsValid(OH_AVCodec \*codec, bool \*isValid); | Added| This API is added to check whether a codec instance is valid. It is used for fault rectification.|
57e41f4b71Sopenharmony_ci| avcodec | OH_AVErrCode OH_AudioEncoder_IsValid(OH_AVCodec \*codec, bool \*isValid); | Added| This API is added to check whether a codec instance is valid. It is used for fault rectification.|
58e41f4b71Sopenharmony_ci| avcodec  | OH_AVErrCode OH_VideoDecoder_IsValid(OH_AVCodec \*codec, bool \*isValid);         | Added    | This API is added to check whether a codec instance is valid.     |
59e41f4b71Sopenharmony_ci| avcodec  | OH_AVErrCode OH_VideoEncoder_IsValid(OH_AVCodec \*codec, bool \*isValid);         | Added    | This API is added to check whether a codec instance is valid.     |
60e41f4b71Sopenharmony_ci| avcodec  | OH_AVErrCode OH_VideoEncoder_PushInputData(OH_AVCodec \*codec, uint32_t index, OH_AVCodecBufferAttr attr);         | Added    | This API is added to push the input buffer filled with data to a video encoder.     |
61e41f4b71Sopenharmony_ci| avcodec  | OH_AVFormat \*OH_VideoEncoder_GetInputDescription(OH_AVCodec \*codec);         | Added    | This API is added to obtain the description received by a video encoder.     |
62