1# Native API Differences 2 3Compared with earlier versions, OpenHarmony 4.0.8.5 has the following API changes in its native APIs: 4 * 5## Standard System API Changes 6 7| Module| API | Change Type| Change Description | 8| -------- | ------------------------------------------------------------ | -------- | -------------------- | 9| avmuxer | OH_AVMuxer \*OH_AVMuxer_Create(int32_t fd, OH_AVOutputFormat format); | Added | This API is added to create an **OH_AVMuxer** instance. | 10| 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. | 11| 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. | 12| avmuxer | OH_AVErrCode OH_AVMuxer_Start(OH_AVMuxer \*muxer); | Added | This API is added to start encapsulation. | 13| 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. | 14| avmuxer | OH_AVErrCode OH_AVMuxer_Stop(OH_AVMuxer \*muxer); | Added | This API is added to stop encapsulation. | 15| avmuxer | OH_AVErrCode OH_AVMuxer_Destroy(OH_AVMuxer \*muxer); | Added | This API is added to destroy an **OH_AVMuxer** instance. | 16| avsource | OH_AVSource *OH_AVSource_CreateWithURI(char *uri); | Added | This API is added to create an **OH_AVSource** instance based on a URI. | 17| 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). | 18| avsource | OH_AVErrCode OH_AVSource_Destroy(OH_AVSource *source); | Added | This API is added to destroy an **OH_AVSource** instance. | 19| avsource | OH_AVFormat *OH_AVSource_GetSourceFormat(OH_AVSource *source); | Added | This API is added to obtain source information. | 20| avsource | OH_AVFormat *OH_AVSource_GetTrackFormat(OH_AVSource *source, uint32_t trackCount); | Added | This API is added to obtain track information. | 21| avdemuxer | OH_AVDemuxer *OH_AVDemuxer_CreateWithSource(OH_AVSource *source); | Added | This API is added to create an **OH_AVDemuxer** instance based on source information. | 22| avdemuxer | OH_AVErrCode OH_AVDemuxer_Destroy(OH_AVDemuxer *demuxer); | Added | This API is added to destroy an **OH_AVDemuxer** instance. | 23| 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. | 24| avdemuxer | OH_AVErrCode OH_AVDemuxer_UnselectTrackByID(OH_AVDemuxer *demuxer, uint32_t trackIndex); | Added | This API is added to deselect a track. | 25| 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**. | 26| 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. | 27|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.| 28|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.| 29|avcapability|bool OH_AVCapability_IsHardware(OH_AVCapability *capability);|Added|This API is added to check whether a codec capability instance describes a hardware codec.| 30|avcapability|const char *OH_AVCapability_GetName(OH_AVCapability *capability);|Added|This API is added to obtain the codec name.| 31|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.| 32|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.| 33|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.| 34|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.| 35|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.| 36|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.| 37|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.| 38|avcapability|OH_AVErrCode OH_AVCapability_GetVideoWidthAlignment(OH_AVCapability *capability, int32_t *widthAlignment);|Added|This API is added to obtain the video width alignment.| 39|avcapability|OH_AVErrCode OH_AVCapability_GetVideoHeightAlignment(OH_AVCapability *capability, int32_t *heightAlignment);|Added|This API is added to obtain the video height alignment.| 40|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.| 41|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.| 42|avcapability|OH_AVErrCode OH_AVCapability_GetVideoWidthRange(OH_AVCapability *capability, OH_AVRange *widthRange);|Added|This API is added to obtain the video width range.| 43|avcapability|OH_AVErrCode OH_AVCapability_GetVideoHeightRange(OH_AVCapability *capability, OH_AVRange *heightRange);|Added|This API is added to obtain the video height range.| 44|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.| 45|avcapability|OH_AVErrCode OH_AVCapability_GetVideoFrameRateRange(OH_AVCapability *capability, OH_AVRange *frameRateRange);|Added|This API is added to obtain the video frame rate range.| 46|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.| 47|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.| 48|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.| 49|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.| 50|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.| 51|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.| 52|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**).| 53|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).| 54|avmemory|OH_AVMemory \*OH_AVMemory_Create(int32_t size);|Added|This API is added to create an **OH_AVMemory** instance.| 55|avmemory|OH_AVErrCode OH_AVMemory_Destroy(struct OH_AVMemory \*mem);|Added|This API is added to destroy an **OH_AVMemory** instance.| 56| 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.| 57| 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.| 58| avcodec | OH_AVErrCode OH_VideoDecoder_IsValid(OH_AVCodec \*codec, bool \*isValid); | Added | This API is added to check whether a codec instance is valid. | 59| avcodec | OH_AVErrCode OH_VideoEncoder_IsValid(OH_AVCodec \*codec, bool \*isValid); | Added | This API is added to check whether a codec instance is valid. | 60| 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. | 61| avcodec | OH_AVFormat \*OH_VideoEncoder_GetInputDescription(OH_AVCodec \*codec); | Added | This API is added to obtain the description received by a video encoder. | 62