From fb4601a4784c5366a527226945d8537f15673058 Mon Sep 17 00:00:00 2001 From: Gloria Date: Thu, 27 Jul 2023 09:26:45 +0800 Subject: [PATCH] Update docs against 20533+20633+20623+20541+20706 Signed-off-by: wusongqing --- .../reference/native-apis/_a_v_capability.md | 388 ++++++------- .../reference/native-apis/_a_v_demuxer.md | 80 +-- .../reference/native-apis/_a_v_muxer.md | 16 +- .../reference/native-apis/_a_v_source.md | 62 +-- .../reference/native-apis/_audio_decoder.md | 239 ++++---- .../reference/native-apis/_audio_encoder.md | 181 +++--- .../reference/native-apis/_codec_base.md | 442 +++++++-------- .../reference/native-apis/_core.md | 56 +- .../reference/native-apis/_o_h_audio.md | 526 +++++++++--------- .../reference/native-apis/_video_decoder.md | 36 +- .../reference/native-apis/_video_encoder.md | 226 ++++---- .../native-apis/native__avcapability_8h.md | 4 +- .../native__avcodec__audiodecoder_8h.md | 37 +- .../native__avcodec__audioencoder_8h.md | 37 +- .../native-apis/native__avcodec__base_8h.md | 192 +++---- .../native__avcodec__videoencoder_8h.md | 2 +- .../native-apis/native__averrors_8h.md | 2 +- .../native-apis/native__avformat_8h.md | 2 +- 18 files changed, 1223 insertions(+), 1305 deletions(-) diff --git a/en/application-dev/reference/native-apis/_a_v_capability.md b/en/application-dev/reference/native-apis/_a_v_capability.md index be81e92b4f..dce309b85e 100644 --- a/en/application-dev/reference/native-apis/_a_v_capability.md +++ b/en/application-dev/reference/native-apis/_a_v_capability.md @@ -17,72 +17,72 @@ The **AVCapability** module provides functions for querying the codec capability ### Files -| Name| Description| +| Name| Description| | -------- | -------- | -| [native_avcapability.h](native__avcapability_8h.md) | Declares the native APIs used to query the codec capability.
File to include: \| +| [native_avcapability.h](native__avcapability_8h.md) | Declares the native APIs used to query the codec capability.
**File to include**:
**Library**: libnative_media_codecbase.so| ### Structs -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_AVRange](_o_h___a_v_range.md) | Defines the value range, which contains the minimum value and maximum value.| +| [OH_AVRange](_o_h___a_v_range.md) | Defines the value range, which contains the minimum value and maximum value.| ### Types -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_BitrateMode](#oh_bitratemode) | Defines an enum that enumerates the bit rate modes of an encoder. | -| [OH_AVRange](#oh_avrange) | Defines a struct for the value range, which contains the minimum value and maximum value.| -| [OH_AVCodecCategory](#oh_avcodeccategory) | Defines an enum that enumerates the codec categories.| +| [OH_BitrateMode](#oh_bitratemode) | Defines an enum that enumerates the bit rate modes of an encoder.| +| [OH_AVRange](#oh_avrange) | Defines a struct for the value range, which contains the minimum value and maximum value.| +| [OH_AVCodecCategory](#oh_avcodeccategory) | Defines an enum that enumerates the codec categories.| ### Enums -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_BitrateMode](#oh_bitratemode) { **BITRATE_MODE_CBR** = 0, **BITRATE_MODE_VBR** = 1, **BITRATE_MODE_CQ** = 2 } | Enumerates the bit rate modes of an encoder. | -| [OH_AVCodecCategory](#oh_avcodeccategory) { **HARDWARE** = 0, **SOFTWARE** } | Enumerates the codec categories.| +| [OH_BitrateMode](#oh_bitratemode) { **BITRATE_MODE_CBR** = 0, **BITRATE_MODE_VBR** = 1, **BITRATE_MODE_CQ** = 2 } | Enumerates the bit rate modes of an encoder.| +| [OH_AVCodecCategory](#oh_avcodeccategory) { **HARDWARE** = 0, **SOFTWARE** } | Enumerates the codec categories.| ### Functions -| Name| Description| -| -------- | -------- | -| \*[OH_AVCodec_GetCapability](#oh_avcodec_getcapability) (const char \*mime, bool isEncoder) | Obtains the codec capability recommended by the system.| -| \*[OH_AVCodec_GetCapabilityByCategory](#oh_avcodec_getcapabilitybycategory) (const char \*mime, bool isEncoder, [OH_AVCodecCategory](#oh_avcodeccategory) category) | Obtains the codec capability by category, which can be a hardware codec or software codec.| -| [OH_AVCapability_IsHardware](#oh_avcapability_ishardware) (OH_AVCapability \*capability) | Checks whether a codec capability instance describes a hardware codec.| -| \*[OH_AVCapability_GetName](#oh_avcapability_getname) (OH_AVCapability \*capability) | Obtains the codec name.| -| [OH_AVCapability_GetMaxSupportedInstances](#oh_avcapability_getmaxsupportedinstances) (OH_AVCapability \*capability) | Obtains the maximum number of codec instances supported by a codec.| -| [OH_AVCapability_GetEncoderBitrateRange](#oh_avcapability_getencoderbitraterange) (OH_AVCapability \*capability, [OH_AVRange](_o_h___a_v_range.md) \*bitrateRange) | Obtains the bit rate range supported by an encoder.| -| [OH_AVCapability_IsEncoderBitrateModeSupported](#oh_avcapability_isencoderbitratemodesupported) (OH_AVCapability \*capability, [OH_BitrateMode](#oh_bitratemode) bitrateMode) | Checks whether an encoder supports a specific bit rate mode.| -| [OH_AVCapability_GetEncoderQualityRange](#oh_avcapability_getencoderqualityrange) (OH_AVCapability \*capability, [OH_AVRange](_o_h___a_v_range.md) \*qualityRange) | Obtains the quality range supported by an encoder.| -| [OH_AVCapability_GetEncoderComplexityRange](#oh_avcapability_getencodercomplexityrange) (OH_AVCapability \*capability, [OH_AVRange](_o_h___a_v_range.md) \*complexityRange) | Obtains the complexity range supported by an encoder.| -| [OH_AVCapability_GetAudioSupportedSampleRates](#oh_avcapability_getaudiosupportedsamplerates) (OH_AVCapability \*capability, const int32_t \*\*sampleRates, uint32_t \*sampleRateNum) | Obtains the sampling rates supported by an audio codec.| -| [OH_AVCapability_GetAudioChannelCountRange](#oh_avcapability_getaudiochannelcountrange) (OH_AVCapability \*capability, [OH_AVRange](_o_h___a_v_range.md) \*channelCountRange) | Obtains the count range of audio channels supported by an audio codec.| -| [OH_AVCapability_GetVideoWidthAlignment](#oh_avcapability_getvideowidthalignment) (OH_AVCapability \*capability, int32_t \*widthAlignment) | Obtains the video width alignment supported by a video codec.| -| [OH_AVCapability_GetVideoHeightAlignment](#oh_avcapability_getvideoheightalignment) (OH_AVCapability \*capability, int32_t \*heightAlignment) | Obtains the video height alignment supported by a video codec.| -| [OH_AVCapability_GetVideoWidthRangeForHeight](#oh_avcapability_getvideowidthrangeforheight) (OH_AVCapability \*capability, int32_t height, [OH_AVRange](_o_h___a_v_range.md) \*widthRange) | Obtains the video width range supported by a video codec based on a given height.| -| [OH_AVCapability_GetVideoHeightRangeForWidth](#oh_avcapability_getvideoheightrangeforwidth) (OH_AVCapability \*capability, int32_t width, [OH_AVRange](_o_h___a_v_range.md) \*heightRange) | Obtains the video height range supported by a video codec based on a given width.| -| [OH_AVCapability_GetVideoWidthRange](#oh_avcapability_getvideowidthrange) (OH_AVCapability \*capability, [OH_AVRange](_o_h___a_v_range.md) \*widthRange) | Obtains the video width range supported by a video codec.| -| [OH_AVCapability_GetVideoHeightRange](#oh_avcapability_getvideoheightrange) (OH_AVCapability \*capability, [OH_AVRange](_o_h___a_v_range.md) \*heightRange) | Obtains the video height range supported by a video codec.| -| [OH_AVCapability_IsVideoSizeSupported](#oh_avcapability_isvideosizesupported) (OH_AVCapability \*capability, int32_t width, int32_t height) | Checks whether a video codec supports a specific video size.| -| [OH_AVCapability_GetVideoFrameRateRange](#oh_avcapability_getvideoframeraterange) (OH_AVCapability \*capability, [OH_AVRange](_o_h___a_v_range.md) \*frameRateRange) | Obtains the video frame rate range supported by a video codec.| -| [OH_AVCapability_GetVideoFrameRateRangeForSize](#oh_avcapability_getvideoframeraterangeforsize) (OH_AVCapability \*capability, int32_t width, int32_t height, [OH_AVRange](_o_h___a_v_range.md) \*frameRateRange) | Obtains the video frame rate range supported by a video codec based on a given video size.| -| [OH_AVCapability_AreVideoSizeAndFrameRateSupported](#oh_avcapability_arevideosizeandframeratesupported) (OH_AVCapability \*capability, int32_t width, int32_t height, int32_t frameRate) | Checks whether a video codec supports the combination of a video size and frame rate.| -| [OH_AVCapability_GetVideoSupportedPixelFormats](#oh_avcapability_getvideosupportedpixelformats) (OH_AVCapability \*capability, const int32_t \*\*pixelFormats, uint32_t \*pixelFormatNum) | Obtains the video pixel formats supported by a video codec.| -| [OH_AVCapability_GetSupportedProfiles](#oh_avcapability_getsupportedprofiles) (OH_AVCapability \*capability, const int32_t \*\*profiles, uint32_t \*profileNum) | Obtains the profiles supported by a codec.| -| [OH_AVCapability_GetSupportedLevelsForProfile](#oh_avcapability_getsupportedlevelsforprofile) (OH_AVCapability \*capability, int32_t profile, const int32_t \*\*levels, uint32_t \*levelNum) | Obtains the codec levels supported by a profile.| -| [OH_AVCapability_AreProfileAndLevelSupported](#oh_avcapability_areprofileandlevelsupported) (OH_AVCapability \*capability, int32_t profile, int32_t level) | Checks whether a codec supports the combination of a profile and level.| +| Name| Description| +| -------- | -------- | +| \*[OH_AVCodec_GetCapability](#oh_avcodec_getcapability) (const char \*mime, bool isEncoder) | Obtains the codec capability recommended by the system.| +| \*[OH_AVCodec_GetCapabilityByCategory](#oh_avcodec_getcapabilitybycategory) (const char \*mime, bool isEncoder, [OH_AVCodecCategory](#oh_avcodeccategory) category) | Obtains the codec capability by category, which can be a hardware codec or software codec.| +| [OH_AVCapability_IsHardware](#oh_avcapability_ishardware) (OH_AVCapability \*capability) | Checks whether a codec capability instance describes a hardware codec.| +| \*[OH_AVCapability_GetName](#oh_avcapability_getname) (OH_AVCapability \*capability) | Obtains the codec name.| +| [OH_AVCapability_GetMaxSupportedInstances](#oh_avcapability_getmaxsupportedinstances) (OH_AVCapability \*capability) | Obtains the maximum number of codec instances supported by a codec.| +| [OH_AVCapability_GetEncoderBitrateRange](#oh_avcapability_getencoderbitraterange) (OH_AVCapability \*capability, [OH_AVRange](_o_h___a_v_range.md) \*bitrateRange) | Obtains the bit rate range supported by an encoder.| +| [OH_AVCapability_IsEncoderBitrateModeSupported](#oh_avcapability_isencoderbitratemodesupported) (OH_AVCapability \*capability, [OH_BitrateMode](#oh_bitratemode) bitrateMode) | Checks whether an encoder supports a specific bit rate mode.| +| [OH_AVCapability_GetEncoderQualityRange](#oh_avcapability_getencoderqualityrange) (OH_AVCapability \*capability, [OH_AVRange](_o_h___a_v_range.md) \*qualityRange) | Obtains the quality range supported by an encoder.| +| [OH_AVCapability_GetEncoderComplexityRange](#oh_avcapability_getencodercomplexityrange) (OH_AVCapability \*capability, [OH_AVRange](_o_h___a_v_range.md) \*complexityRange) | Obtains the complexity range supported by an encoder.| +| [OH_AVCapability_GetAudioSupportedSampleRates](#oh_avcapability_getaudiosupportedsamplerates) (OH_AVCapability \*capability, const int32_t \*\*sampleRates, uint32_t \*sampleRateNum) | Obtains the sampling rates supported by an audio codec.| +| [OH_AVCapability_GetAudioChannelCountRange](#oh_avcapability_getaudiochannelcountrange) (OH_AVCapability \*capability, [OH_AVRange](_o_h___a_v_range.md) \*channelCountRange) | Obtains the count range of audio channels supported by an audio codec.| +| [OH_AVCapability_GetVideoWidthAlignment](#oh_avcapability_getvideowidthalignment) (OH_AVCapability \*capability, int32_t \*widthAlignment) | Obtains the video width alignment supported by a video codec.| +| [OH_AVCapability_GetVideoHeightAlignment](#oh_avcapability_getvideoheightalignment) (OH_AVCapability \*capability, int32_t \*heightAlignment) | Obtains the video height alignment supported by a video codec.| +| [OH_AVCapability_GetVideoWidthRangeForHeight](#oh_avcapability_getvideowidthrangeforheight) (OH_AVCapability \*capability, int32_t height, [OH_AVRange](_o_h___a_v_range.md) \*widthRange) | Obtains the video width range supported by a video codec based on a given height.| +| [OH_AVCapability_GetVideoHeightRangeForWidth](#oh_avcapability_getvideoheightrangeforwidth) (OH_AVCapability \*capability, int32_t width, [OH_AVRange](_o_h___a_v_range.md) \*heightRange) | Obtains the video height range supported by a video codec based on a given width.| +| [OH_AVCapability_GetVideoWidthRange](#oh_avcapability_getvideowidthrange) (OH_AVCapability \*capability, [OH_AVRange](_o_h___a_v_range.md) \*widthRange) | Obtains the video width range supported by a video codec.| +| [OH_AVCapability_GetVideoHeightRange](#oh_avcapability_getvideoheightrange) (OH_AVCapability \*capability, [OH_AVRange](_o_h___a_v_range.md) \*heightRange) | Obtains the video height range supported by a video codec.| +| [OH_AVCapability_IsVideoSizeSupported](#oh_avcapability_isvideosizesupported) (OH_AVCapability \*capability, int32_t width, int32_t height) | Checks whether a video codec supports a specific video size.| +| [OH_AVCapability_GetVideoFrameRateRange](#oh_avcapability_getvideoframeraterange) (OH_AVCapability \*capability, [OH_AVRange](_o_h___a_v_range.md) \*frameRateRange) | Obtains the video frame rate range supported by a video codec.| +| [OH_AVCapability_GetVideoFrameRateRangeForSize](#oh_avcapability_getvideoframeraterangeforsize) (OH_AVCapability \*capability, int32_t width, int32_t height, [OH_AVRange](_o_h___a_v_range.md) \*frameRateRange) | Obtains the video frame rate range supported by a video codec based on a given video size.| +| [OH_AVCapability_AreVideoSizeAndFrameRateSupported](#oh_avcapability_arevideosizeandframeratesupported) (OH_AVCapability \*capability, int32_t width, int32_t height, int32_t frameRate) | Checks whether a video codec supports the combination of a video size and frame rate.| +| [OH_AVCapability_GetVideoSupportedPixelFormats](#oh_avcapability_getvideosupportedpixelformats) (OH_AVCapability \*capability, const int32_t \*\*pixelFormats, uint32_t \*pixelFormatNum) | Obtains the video pixel formats supported by a video codec.| +| [OH_AVCapability_GetSupportedProfiles](#oh_avcapability_getsupportedprofiles) (OH_AVCapability \*capability, const int32_t \*\*profiles, uint32_t \*profileNum) | Obtains the profiles supported by a codec.| +| [OH_AVCapability_GetSupportedLevelsForProfile](#oh_avcapability_getsupportedlevelsforprofile) (OH_AVCapability \*capability, int32_t profile, const int32_t \*\*levels, uint32_t \*levelNum) | Obtains the codec levels supported by a profile.| +| [OH_AVCapability_AreProfileAndLevelSupported](#oh_avcapability_areprofileandlevelsupported) (OH_AVCapability \*capability, int32_t profile, int32_t level) | Checks whether a codec supports the combination of a profile and level.| ### Variables -| Name| Description| +| Name| Description| | -------- | -------- | -| **OH_AVRange::minVal** | Defines the minimum value.| -| **OH_AVRange::maxVal** | Defines the maximum value.| +| **OH_AVRange::minVal** | Defines the minimum value.| +| **OH_AVRange::maxVal** | Defines the maximum value.| ## Type Description @@ -90,9 +90,9 @@ The **AVCapability** module provides functions for querying the codec capability ### OH_AVCodecCategory - + ``` -typedef enum OH_AVCodecCategoryOH_AVCodecCategory +typedef enum OH_AVCodecCategory OH_AVCodecCategory ``` **Description** @@ -108,9 +108,9 @@ Defines an enum that enumerates the codec categories. ### OH_AVRange - + ``` -typedef struct OH_AVRangeOH_AVRange +typedef struct OH_AVRange OH_AVRange ``` **Description** @@ -126,9 +126,9 @@ Defines a struct for the value range, which contains the minimum value and maxim ### OH_BitrateMode - + ``` -typedef enum OH_BitrateModeOH_BitrateMode +typedef enum OH_BitrateMode OH_BitrateMode ``` **Description** @@ -147,14 +147,14 @@ Defines an enum that enumerates the bit rate modes of an encoder. ### OH_AVCodecCategory - + ``` enum OH_AVCodecCategory ``` **Description** -Enumerates the codec categories. +Defines an enum that enumerates the codec categories. \@syscap SystemCapability.Multimedia.Media.CodecBase @@ -164,20 +164,20 @@ Enumerates the codec categories. | Value| Description| | -------- | -------- | -| HARDWARE | Hardware codec.| -| SOFTWARE | Software codec.| +| HARDWARE | Hardware codec.| +| SOFTWARE | Software codec.| ### OH_BitrateMode - + ``` enum OH_BitrateMode ``` **Description** -Enumerates the bit rate modes of an encoder. +Defines an enum that enumerates the bit rate modes of an encoder. \@syscap SystemCapability.Multimedia.Media.CodecBase @@ -187,9 +187,9 @@ Enumerates the bit rate modes of an encoder. | Value| Description| | -------- | -------- | -| BITRATE_MODE_CBR | Constant bit rate.| -| BITRATE_MODE_VBR | Variable bit rate.| -| BITRATE_MODE_CQ | Constant quality.| +| BITRATE_MODE_CBR | Constant bit rate.| +| BITRATE_MODE_VBR | Variable bit rate.| +| BITRATE_MODE_CQ | Constant quality.| ## Function Description @@ -197,9 +197,9 @@ Enumerates the bit rate modes of an encoder. ### OH_AVCapability_AreProfileAndLevelSupported() - + ``` -bool OH_AVCapability_AreProfileAndLevelSupported (OH_AVCapability *capability, int32_t profile, int32_t level ) +bool OH_AVCapability_AreProfileAndLevelSupported (OH_AVCapability *capability, int32_t profile, int32_t level) ``` **Description** @@ -210,11 +210,11 @@ Checks whether a codec supports the combination of a profile and level. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the codec capability.| -| profile | Profile of the codec.| -| level | Level of the codec.| +| capability | Pointer to the codec capability.| +| profile | Profile of the codec.| +| level | Level of the codec.| **Returns** @@ -227,9 +227,9 @@ Returns **true** if the combination of the profile and level is supported; retur ### OH_AVCapability_AreVideoSizeAndFrameRateSupported() - + ``` -bool OH_AVCapability_AreVideoSizeAndFrameRateSupported (OH_AVCapability *capability, int32_t width, int32_t height, int32_t frameRate ) +bool OH_AVCapability_AreVideoSizeAndFrameRateSupported (OH_AVCapability *capability, int32_t width, int32_t height, int32_t frameRate) ``` **Description** @@ -240,12 +240,12 @@ Checks whether a video codec supports the combination of a video size and frame **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| -| width | Number of horizontal video pixels.| -| height | Number of vertical video pixels.| -| frameRate | Number of frames per second.| +| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| +| width | Number of horizontal video pixels.| +| height | Number of vertical video pixels.| +| frameRate | Number of frames per second.| **Returns** @@ -258,9 +258,9 @@ Returns **true** if the combination of the video size and frame rate is supporte ### OH_AVCapability_GetAudioChannelCountRange() - + ``` -OH_AVErrCode OH_AVCapability_GetAudioChannelCountRange (OH_AVCapability * capability, OH_AVRange * channelCountRange ) +OH_AVErrCode OH_AVCapability_GetAudioChannelCountRange (OH_AVCapability *capability, OH_AVRange *channelCountRange) ``` **Description** @@ -271,10 +271,10 @@ Obtains the count range of audio channels supported by an audio codec. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the audio codec capability. A pointer to the video codec capability cannot be filled in.| -| channelCountRange | Output parameter. Pointer to the count range of audio channels supported.| +| capability | Pointer to the audio codec capability. A pointer to the video codec capability cannot be filled in.| +| channelCountRange | Output parameter. Pointer to the count range of audio channels supported.| **Returns** @@ -287,9 +287,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_GetAudioSupportedSampleRates() - + ``` -OH_AVErrCode OH_AVCapability_GetAudioSupportedSampleRates (OH_AVCapability * capability, const int32_t ** sampleRates, uint32_t * sampleRateNum ) +OH_AVErrCode OH_AVCapability_GetAudioSupportedSampleRates (OH_AVCapability *capability, const int32_t **sampleRates, uint32_t *sampleRateNum) ``` **Description** @@ -300,11 +300,11 @@ Obtains the sampling rates supported by an audio codec. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the audio codec capability. A pointer to the video codec capability cannot be filled in.| -| sampleRates | Output parameter. Double pointer to the sampling rate array.| -| sampleRateNum | Output parameter. Pointer to the number of elements in the array.| +| capability | Pointer to the audio codec capability. A pointer to the video codec capability cannot be filled in.| +| sampleRates | Output parameter. Double pointer to the sampling rate array.| +| sampleRateNum | Output parameter. Pointer to the number of elements in the array.| **Returns** @@ -317,9 +317,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_GetEncoderBitrateRange() - + ``` -OH_AVErrCode OH_AVCapability_GetEncoderBitrateRange (OH_AVCapability * capability, OH_AVRange * bitrateRange ) +OH_AVErrCode OH_AVCapability_GetEncoderBitrateRange (OH_AVCapability *capability, OH_AVRange *bitrateRange) ``` **Description** @@ -330,10 +330,10 @@ Obtains the bit rate range supported by an encoder. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the encoder capability. A pointer to the decoder capability cannot be filled in.| -| bitrateRange | Output parameter. Pointer to the bit rate range supported.| +| capability | Pointer to the encoder capability. A pointer to the decoder capability cannot be filled in.| +| bitrateRange | Output parameter. Pointer to the bit rate range supported.| **Returns** @@ -346,9 +346,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_GetEncoderComplexityRange() - + ``` -OH_AVErrCode OH_AVCapability_GetEncoderComplexityRange (OH_AVCapability * capability, OH_AVRange * complexityRange ) +OH_AVErrCode OH_AVCapability_GetEncoderComplexityRange (OH_AVCapability *capability, OH_AVRange *complexityRange) ``` **Description** @@ -359,10 +359,10 @@ Obtains the complexity range supported by an encoder. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the encoder capability. A pointer to the decoder capability cannot be filled in.| -| complexityRange | Output parameter. Pointer to the complexity range supported.| +| capability | Pointer to the encoder capability. A pointer to the decoder capability cannot be filled in.| +| complexityRange | Output parameter. Pointer to the complexity range supported.| **Returns** @@ -375,9 +375,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_GetEncoderQualityRange() - + ``` -OH_AVErrCode OH_AVCapability_GetEncoderQualityRange (OH_AVCapability * capability, OH_AVRange * qualityRange ) +OH_AVErrCode OH_AVCapability_GetEncoderQualityRange (OH_AVCapability *capability, OH_AVRange *qualityRange) ``` **Description** @@ -388,10 +388,10 @@ Obtains the quality range supported by an encoder. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the encoder capability. A pointer to the decoder capability cannot be filled in.| -| qualityRange | Output parameter. Pointer to the quality range supported.| +| capability | Pointer to the encoder capability. A pointer to the decoder capability cannot be filled in.| +| qualityRange | Output parameter. Pointer to the quality range supported.| **Returns** @@ -404,9 +404,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_GetMaxSupportedInstances() - + ``` -int32_t OH_AVCapability_GetMaxSupportedInstances (OH_AVCapability * capability) +int32_t OH_AVCapability_GetMaxSupportedInstances (OH_AVCapability *capability) ``` **Description** @@ -417,9 +417,9 @@ Obtains the maximum number of codec instances supported by a codec. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the codec capability.| +| capability | Pointer to the codec capability.| **Returns** @@ -432,9 +432,9 @@ Returns the maximum number of codec instances supported. ### OH_AVCapability_GetName() - + ``` -const char* OH_AVCapability_GetName (OH_AVCapability * capability) +const char* OH_AVCapability_GetName (OH_AVCapability *capability) ``` **Description** @@ -445,9 +445,9 @@ Obtains the codec name. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the codec capability.| +| capability | Pointer to the codec capability.| **Returns** @@ -460,9 +460,9 @@ Returns the codec name string. ### OH_AVCapability_GetSupportedLevelsForProfile() - + ``` -OH_AVErrCode OH_AVCapability_GetSupportedLevelsForProfile (OH_AVCapability * capability, int32_t profile, const int32_t ** levels, uint32_t * levelNum ) +OH_AVErrCode OH_AVCapability_GetSupportedLevelsForProfile (OH_AVCapability *capability, int32_t profile, const int32_t **levels, uint32_t *levelNum) ``` **Description** @@ -473,12 +473,12 @@ Obtains the codec levels supported by a profile. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the codec capability.| -| profile | Profile of the codec.| -| levels | Output parameter. Double pointer to the codec level array.| -| levelNum | Output parameter. Pointer to the number of elements in the array.| +| capability | Pointer to the codec capability.| +| profile | Profile of the codec.| +| levels | Output parameter. Double pointer to the codec level array.| +| levelNum | Output parameter. Pointer to the number of elements in the array.| **Returns** @@ -491,9 +491,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_GetSupportedProfiles() - + ``` -OH_AVErrCode OH_AVCapability_GetSupportedProfiles (OH_AVCapability * capability, const int32_t ** profiles, uint32_t * profileNum ) +OH_AVErrCode OH_AVCapability_GetSupportedProfiles (OH_AVCapability *capability, const int32_t **profiles, uint32_t *profileNum) ``` **Description** @@ -504,11 +504,11 @@ Obtains the profiles supported by a codec. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the codec capability.| -| profiles | Output parameter. Double pointer to the profile array.| -| profileNum | Output parameter. Pointer to the number of elements in the array.| +| capability | Pointer to the codec capability.| +| profiles | Output parameter. Double pointer to the profile array.| +| profileNum | Output parameter. Pointer to the number of elements in the array.| **Returns** @@ -521,9 +521,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_GetVideoFrameRateRange() - + ``` -OH_AVErrCode OH_AVCapability_GetVideoFrameRateRange (OH_AVCapability * capability, OH_AVRange * frameRateRange ) +OH_AVErrCode OH_AVCapability_GetVideoFrameRateRange (OH_AVCapability *capability, OH_AVRange *frameRateRange) ``` **Description** @@ -534,10 +534,10 @@ Obtains the video frame rate range supported by a video codec. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| -| frameRateRange | Output parameter. Pointer to the video frame rate range supported.| +| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| +| frameRateRange | Output parameter. Pointer to the video frame rate range supported.| **Returns** @@ -550,9 +550,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_GetVideoFrameRateRangeForSize() - + ``` -OH_AVErrCode OH_AVCapability_GetVideoFrameRateRangeForSize (OH_AVCapability * capability, int32_t width, int32_t height, OH_AVRange * frameRateRange ) +OH_AVErrCode OH_AVCapability_GetVideoFrameRateRangeForSize (OH_AVCapability *capability, int32_t width, int32_t height, OH_AVRange *frameRateRange) ``` **Description** @@ -563,12 +563,12 @@ Obtains the video frame rate range supported by a video codec based on a given v **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| -| width | Number of horizontal video pixels.| -| height | Number of vertical video pixels.| -| frameRateRange | Output parameter. Pointer to the video frame rate range supported.| +| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| +| width | Number of horizontal video pixels.| +| height | Number of vertical video pixels.| +| frameRateRange | Output parameter. Pointer to the video frame rate range supported.| **Returns** @@ -581,9 +581,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_GetVideoHeightAlignment() - + ``` -OH_AVErrCode OH_AVCapability_GetVideoHeightAlignment (OH_AVCapability * capability, int32_t * heightAlignment ) +OH_AVErrCode OH_AVCapability_GetVideoHeightAlignment (OH_AVCapability *capability, int32_t *heightAlignment) ``` **Description** @@ -594,10 +594,10 @@ Obtains the video height alignment supported by a video codec. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| -| heightAlignment | Output parameter. Pointer to the video height alignment supported.| +| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| +| heightAlignment | Output parameter. Pointer to the video height alignment supported.| **Returns** @@ -610,9 +610,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_GetVideoHeightRange() - + ``` -OH_AVErrCode OH_AVCapability_GetVideoHeightRange (OH_AVCapability * capability, OH_AVRange * heightRange ) +OH_AVErrCode OH_AVCapability_GetVideoHeightRange (OH_AVCapability *capability, OH_AVRange *heightRange) ``` **Description** @@ -623,10 +623,10 @@ Obtains the video height range supported by a video codec. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| -| heightRange | Output parameter. Pointer to the video height range supported.| +| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| +| heightRange | Output parameter. Pointer to the video height range supported.| **Returns** @@ -639,9 +639,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_GetVideoHeightRangeForWidth() - + ``` -OH_AVErrCode OH_AVCapability_GetVideoHeightRangeForWidth (OH_AVCapability * capability, int32_t width, OH_AVRange * heightRange ) +OH_AVErrCode OH_AVCapability_GetVideoHeightRangeForWidth (OH_AVCapability *capability, int32_t width, OH_AVRange *heightRange) ``` **Description** @@ -652,11 +652,11 @@ Obtains the video height range supported by a video codec based on a given width **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| -| width | Number of horizontal video pixels.| -| heightRange | Output parameter. Pointer to the video height range supported.| +| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| +| width | Number of horizontal video pixels.| +| heightRange | Output parameter. Pointer to the video height range supported.| **Returns** @@ -669,9 +669,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_GetVideoSupportedPixelFormats() - + ``` -OH_AVErrCode OH_AVCapability_GetVideoSupportedPixelFormats (OH_AVCapability * capability, const int32_t ** pixelFormats, uint32_t * pixelFormatNum ) +OH_AVErrCode OH_AVCapability_GetVideoSupportedPixelFormats (OH_AVCapability *capability, const int32_t **pixelFormats, uint32_t *pixelFormatNum) ``` **Description** @@ -682,11 +682,11 @@ Obtains the video pixel formats supported by a video codec. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| -| pixelFormats | Output parameter. Double pointer to the video pixel format array.| -| pixelFormatNum | Output parameter. Pointer to the number of elements in the array.| +| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| +| pixelFormats | Output parameter. Double pointer to the video pixel format array.| +| pixelFormatNum | Output parameter. Pointer to the number of elements in the array.| **Returns** @@ -699,9 +699,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_GetVideoWidthAlignment() - + ``` -OH_AVErrCode OH_AVCapability_GetVideoWidthAlignment (OH_AVCapability * capability, int32_t * widthAlignment ) +OH_AVErrCode OH_AVCapability_GetVideoWidthAlignment (OH_AVCapability *capability, int32_t *widthAlignment) ``` **Description** @@ -712,10 +712,10 @@ Obtains the video width alignment supported by a video codec. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| -| widthAlignment | Output parameter. Pointer to the video width alignment supported.| +| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| +| widthAlignment | Output parameter. Pointer to the video width alignment supported.| **Returns** @@ -728,9 +728,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_GetVideoWidthRange() - + ``` -OH_AVErrCode OH_AVCapability_GetVideoWidthRange (OH_AVCapability * capability, OH_AVRange * widthRange ) +OH_AVErrCode OH_AVCapability_GetVideoWidthRange (OH_AVCapability *capability, OH_AVRange *widthRange) ``` **Description** @@ -741,10 +741,10 @@ Obtains the video width range supported by a video codec. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| -| widthRange | Output parameter. Pointer to the video width range supported.| +| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| +| widthRange | Output parameter. Pointer to the video width range supported.| **Returns** @@ -757,9 +757,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_GetVideoWidthRangeForHeight() - + ``` -OH_AVErrCode OH_AVCapability_GetVideoWidthRangeForHeight (OH_AVCapability * capability, int32_t height, OH_AVRange * widthRange ) +OH_AVErrCode OH_AVCapability_GetVideoWidthRangeForHeight (OH_AVCapability *capability, int32_t height, OH_AVRange *widthRange) ``` **Description** @@ -770,11 +770,11 @@ Obtains the video width range supported by a video codec based on a given height **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| -| height | Number of vertical video pixels.| -| widthRange | Output parameter. Pointer to the video width range supported.| +| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| +| height | Number of vertical video pixels.| +| widthRange | Output parameter. Pointer to the video width range supported.| **Returns** @@ -787,9 +787,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVCapability_IsEncoderBitrateModeSupported() - + ``` -bool OH_AVCapability_IsEncoderBitrateModeSupported (OH_AVCapability * capability, OH_BitrateMode bitrateMode ) +bool OH_AVCapability_IsEncoderBitrateModeSupported (OH_AVCapability *capability, OH_BitrateMode bitrateMode) ``` **Description** @@ -800,10 +800,10 @@ Checks whether an encoder supports a specific bit rate mode. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the encoder capability. A pointer to the decoder capability cannot be filled in.| -| bitrateMode | Bit rate mode.| +| capability | Pointer to the encoder capability. A pointer to the decoder capability cannot be filled in.| +| bitrateMode | Bit rate mode.| **Returns** @@ -816,9 +816,9 @@ Returns **true** if the bit rate mode is supported; returns **false** otherwise. ### OH_AVCapability_IsHardware() - + ``` -bool OH_AVCapability_IsHardware (OH_AVCapability * capability) +bool OH_AVCapability_IsHardware (OH_AVCapability *capability) ``` **Description** @@ -829,9 +829,9 @@ Checks whether a codec capability instance describes a hardware codec. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the codec capability.| +| capability | Pointer to the codec capability.| **Returns** @@ -844,9 +844,9 @@ Returns **true** if the codec capability instance describes a hardware codec; re ### OH_AVCapability_IsVideoSizeSupported() - + ``` -bool OH_AVCapability_IsVideoSizeSupported (OH_AVCapability * capability, int32_t width, int32_t height ) +bool OH_AVCapability_IsVideoSizeSupported (OH_AVCapability *capability, int32_t width, int32_t height) ``` **Description** @@ -857,11 +857,11 @@ Checks whether a video codec supports a specific video size. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| -| width | Number of horizontal video pixels.| -| height | Number of vertical video pixels.| +| capability | Pointer to the video codec capability. A pointer to the audio codec capability cannot be filled in.| +| width | Number of horizontal video pixels.| +| height | Number of vertical video pixels.| **Returns** @@ -874,9 +874,9 @@ Returns **true** if the video size is supported; returns **false** otherwise. ### OH_AVCodec_GetCapability() - + ``` -OH_AVCapability* OH_AVCodec_GetCapability (const char * mime, bool isEncoder ) +OH_AVCapability* OH_AVCodec_GetCapability (const char *mime, bool isEncoder) ``` **Description** @@ -887,10 +887,10 @@ Obtains the codec capability recommended by the system. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| mime | Pointer to the MIME type.| -| isEncoder | Whether the instance is an encoder. The value **true** means an encoder and **false** means a decoder.| +| mime | Pointer to the MIME type.| +| isEncoder | Whether the instance is an encoder. The value **true** means an encoder and **false** means a decoder.| **Returns** @@ -903,24 +903,26 @@ Returns a pointer to the codec capability instance if an existing codec matches; ### OH_AVCodec_GetCapabilityByCategory() - + ``` -OH_AVCapability* OH_AVCodec_GetCapabilityByCategory (const char * mime, bool isEncoder, OH_AVCodecCategory category ) +OH_AVCapability* OH_AVCodec_GetCapabilityByCategory (const char *mime, bool isEncoder, OH_AVCodecCategory category) ``` **Description** -Obtains the codec capability by category, which can be a hardware codec or software codec. +Obtains the codec capability by category, + +which can be a hardware codec or software codec. \@syscap SystemCapability.Multimedia.Media.CodecBase **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| mime | Pointer to the MIME type.| -| isEncoder | Whether the instance is an encoder. The value **true** means an encoder and **false** means a decoder.| -| category | Codec category.| +| mime | Pointer to the MIME type.| +| isEncoder | Whether the instance is an encoder. The value **true** means an encoder and **false** means a decoder.| +| category | Codec category.| **Returns** diff --git a/en/application-dev/reference/native-apis/_a_v_demuxer.md b/en/application-dev/reference/native-apis/_a_v_demuxer.md index fb51de7abb..b82727c280 100644 --- a/en/application-dev/reference/native-apis/_a_v_demuxer.md +++ b/en/application-dev/reference/native-apis/_a_v_demuxer.md @@ -17,21 +17,21 @@ The AVDemuxer module provides functions for audio and video decapsulation. ### File -| Name| Description| +| Name| Description| | -------- | -------- | -| [native_avdemuxer.h](native__avdemuxer_8h.md) | Declares the native APIs used for audio and video decapsulation.
File to include: \ | +| [native_avdemuxer.h](native__avdemuxer_8h.md) | Declares the native APIs used for audio and video decapsulation.
**File to include**:
**Library**: libnative_media_avdemuxer.so| ### Functions -| Name| Description| +| Name| Description| | -------- | -------- | -| \*[OH_AVDemuxer_CreateWithSource](#oh_avdemuxer_createwithsource) (OH_AVSource \*source) | Creates an **OH_AVDemuxer** instance based on an **OH_AVSource** instance.| -| [OH_AVDemuxer_Destroy](#oh_avdemuxer_destroy) (OH_AVDemuxer \*demuxer) | Destroys an **OH_AVDemuxer** instance and clears internal resources.| -| [OH_AVDemuxer_SelectTrackByID](#oh_avdemuxer_selecttrackbyid) (OH_AVDemuxer \*demuxer, uint32_t trackIndex) | Selects a track, from which the demuxer reads data.| -| [OH_AVDemuxer_UnselectTrackByID](#oh_avdemuxer_unselecttrackbyid) (OH_AVDemuxer \*demuxer, uint32_t trackIndex) | Deselects a track. The demuxer no longer reads data from a track after it is deselected.| -| [OH_AVDemuxer_ReadSample](#oh_avdemuxer_readsample) (OH_AVDemuxer \*demuxer, uint32_t trackIndex, OH_AVMemory \*sample, OH_AVCodecBufferAttr \*info) | Obtains the compressed frame and related information at the current position from the selected track.| -| [OH_AVDemuxer_SeekToTime](#oh_avdemuxer_seektotime) (OH_AVDemuxer \*demuxer, int64_t millisecond, OH_AVSeekMode mode) | Seeks to the specified time for all the selected tracks based on a seek mode.| +| \*[OH_AVDemuxer_CreateWithSource](#oh_avdemuxer_createwithsource) (OH_AVSource \*source) | Creates an **OH_AVDemuxer** instance based on an **OH_AVSource** instance.| +| [OH_AVDemuxer_Destroy](#oh_avdemuxer_destroy) (OH_AVDemuxer \*demuxer) | Destroys an **OH_AVDemuxer** instance and clears internal resources.| +| [OH_AVDemuxer_SelectTrackByID](#oh_avdemuxer_selecttrackbyid) (OH_AVDemuxer \*demuxer, uint32_t trackIndex) | Selects a track, from which the demuxer reads data.| +| [OH_AVDemuxer_UnselectTrackByID](#oh_avdemuxer_unselecttrackbyid) (OH_AVDemuxer \*demuxer, uint32_t trackIndex) | Deselects a track. The demuxer no longer reads data from a track after it is deselected.| +| [OH_AVDemuxer_ReadSample](#oh_avdemuxer_readsample) (OH_AVDemuxer \*demuxer, uint32_t trackIndex, OH_AVMemory \*sample, OH_AVCodecBufferAttr \*info) | Obtains the compressed frame and related information at the current position from the selected track.| +| [OH_AVDemuxer_SeekToTime](#oh_avdemuxer_seektotime) (OH_AVDemuxer \*demuxer, int64_t millisecond, OH_AVSeekMode mode) | Seeks to the specified time for all the selected tracks based on a seek mode.| ## Function Description @@ -39,9 +39,9 @@ The AVDemuxer module provides functions for audio and video decapsulation. ### OH_AVDemuxer_CreateWithSource() - + ``` -OH_AVDemuxer* OH_AVDemuxer_CreateWithSource (OH_AVSource * source) +OH_AVDemuxer* OH_AVDemuxer_CreateWithSource (OH_AVSource *source) ``` **Description** @@ -52,9 +52,9 @@ Creates an **OH_AVDemuxer** instance based on an **OH_AVSource** instance. You c **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| source | Pointer to an **OH_AVSource** instance.| +| source | Pointer to an **OH_AVSource** instance.| **Returns** @@ -67,9 +67,9 @@ Returns the pointer to an **OH_AVDemuxer** instance. ### OH_AVDemuxer_Destroy() - + ``` -OH_AVErrCode OH_AVDemuxer_Destroy (OH_AVDemuxer * demuxer) +OH_AVErrCode OH_AVDemuxer_Destroy (OH_AVDemuxer *demuxer) ``` **Description** @@ -82,9 +82,9 @@ The destroyed instance cannot be used until it is re-created. You are advised to **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| demuxer | Pointer to an **OH_AVDemuxer** instance.| +| demuxer | Pointer to an **OH_AVDemuxer** instance.| **Returns** @@ -97,9 +97,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVDemuxer_ReadSample() - + ``` -OH_AVErrCode OH_AVDemuxer_ReadSample (OH_AVDemuxer * demuxer, uint32_t trackIndex, OH_AVMemory * sample, OH_AVCodecBufferAttr * info ) +OH_AVErrCode OH_AVDemuxer_ReadSample (OH_AVDemuxer *demuxer, uint32_t trackIndex, OH_AVMemory *sample, OH_AVCodecBufferAttr *info) ``` **Description** @@ -112,12 +112,12 @@ You must select a track before reading data. After this API is called, the demux **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| demuxer | Pointer to an **OH_AVDemuxer** instance.| -| trackIndex | Index of the track from which the compressed frame is to be read.| -| sample | Pointer to the **OH_AVMemory** instance for storing the compressed frame data.| -| info | Pointer to the **OH_AVCodecBufferAttr** instance for storing the compressed frame information.| +| demuxer | Pointer to an **OH_AVDemuxer** instance.| +| trackIndex | Index of the track from which the compressed frame is to be read.| +| sample | Pointer to the **OH_AVMemory** instance for storing the compressed frame data.| +| info | Pointer to the **OH_AVCodecBufferAttr** instance for storing the compressed frame information.| **Returns** @@ -130,9 +130,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVDemuxer_SeekToTime() - + ``` -OH_AVErrCode OH_AVDemuxer_SeekToTime (OH_AVDemuxer * demuxer, int64_t millisecond, OH_AVSeekMode mode ) +OH_AVErrCode OH_AVDemuxer_SeekToTime (OH_AVDemuxer *demuxer, int64_t millisecond, OH_AVSeekMode mode) ``` **Description** @@ -143,11 +143,11 @@ Seeks to the specified time for all the selected tracks based on a seek mode. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| demuxer | Pointer to an **OH_AVDemuxer** instance.| -| millisecond | Time to seek to, in milliseconds. The timestamp is relative to the start position of the file.| -| mode | Seek mode. For details, see **OH_AVSeekMode**.| +| demuxer | Pointer to an **OH_AVDemuxer** instance.| +| millisecond | Time to seek to, in milliseconds. The timestamp is relative to the start position of the file.| +| mode | Seek mode. For details, see **OH_AVSeekMode**.| **Returns** @@ -160,9 +160,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVDemuxer_SelectTrackByID() - + ``` -OH_AVErrCode OH_AVDemuxer_SelectTrackByID (OH_AVDemuxer * demuxer, uint32_t trackIndex ) +OH_AVErrCode OH_AVDemuxer_SelectTrackByID (OH_AVDemuxer *demuxer, uint32_t trackIndex) ``` **Description** @@ -177,10 +177,10 @@ When **OH_AVDemuxer_ReadSample** is called, only the data in the selected track **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| demuxer | Pointer to an **OH_AVDemuxer** instance.| -| trackIndex | Index of the track.| +| demuxer | Pointer to an **OH_AVDemuxer** instance.| +| trackIndex | Index of the track.| **Returns** @@ -193,9 +193,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVDemuxer_UnselectTrackByID() - + ``` -OH_AVErrCode OH_AVDemuxer_UnselectTrackByID (OH_AVDemuxer * demuxer, uint32_t trackIndex ) +OH_AVErrCode OH_AVDemuxer_UnselectTrackByID (OH_AVDemuxer *demuxer, uint32_t trackIndex) ``` **Description** @@ -210,10 +210,10 @@ If the same track is deselected multiple times, **AV_ERR_OK** is returned and th **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| demuxer | Pointer to an **OH_AVDemuxer** instance.| -| trackIndex | Index of the track.| +| demuxer | Pointer to an **OH_AVDemuxer** instance.| +| trackIndex | Index of the track.| **Returns** diff --git a/en/application-dev/reference/native-apis/_a_v_muxer.md b/en/application-dev/reference/native-apis/_a_v_muxer.md index 2f5e17e9d9..1fd51d2881 100644 --- a/en/application-dev/reference/native-apis/_a_v_muxer.md +++ b/en/application-dev/reference/native-apis/_a_v_muxer.md @@ -19,7 +19,7 @@ The **AVMuxer** module provides functions for audio and video encapsulation. | Name| Description| | -------- | -------- | -| [native_avmuxer.h](native__avmuxer_8h.md) | Declares native APIs used for audio and video encapsulation.
File to include: <multimedia/native_avmuxer.h>| +| [native_avmuxer.h](native__avmuxer_8h.md) | Declares native APIs used for audio and video encapsulation.
**File to include**:
**Library**: libnative_media_avmuxer.so| ### Functions @@ -42,7 +42,7 @@ The **AVMuxer** module provides functions for audio and video encapsulation. ``` -OH_AVErrCode OH_AVMuxer_AddTrack (OH_AVMuxer * muxer, int32_t * trackIndex, OH_AVFormat * trackFormat ) +OH_AVErrCode OH_AVMuxer_AddTrack (OH_AVMuxer *muxer, int32_t *trackIndex, OH_AVFormat *trackFormat) ``` **Description** @@ -74,7 +74,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVMuxer* OH_AVMuxer_Create (int32_t fd, OH_AVOutputFormat format ) +OH_AVMuxer* OH_AVMuxer_Create (int32_t fd, OH_AVOutputFormat format) ``` **Description** @@ -103,7 +103,7 @@ Returns the pointer to the **OH_AVMuxer** instance created. You must call **OH_A ``` -OH_AVErrCode OH_AVMuxer_Destroy (OH_AVMuxer * muxer) +OH_AVErrCode OH_AVMuxer_Destroy (OH_AVMuxer *muxer) ``` **Description** @@ -131,7 +131,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVErrCode OH_AVMuxer_SetRotation (OH_AVMuxer * muxer, int32_t rotation ) +OH_AVErrCode OH_AVMuxer_SetRotation (OH_AVMuxer *muxer, int32_t rotation) ``` **Description** @@ -162,7 +162,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVErrCode OH_AVMuxer_Start (OH_AVMuxer * muxer) +OH_AVErrCode OH_AVMuxer_Start (OH_AVMuxer *muxer) ``` **Description** @@ -192,7 +192,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVErrCode OH_AVMuxer_Stop (OH_AVMuxer * muxer) +OH_AVErrCode OH_AVMuxer_Stop (OH_AVMuxer *muxer) ``` **Description** @@ -222,7 +222,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVErrCode OH_AVMuxer_WriteSample (OH_AVMuxer * muxer, uint32_t trackIndex, OH_AVMemory * sample, OH_AVCodecBufferAttr info ) +OH_AVErrCode OH_AVMuxer_WriteSample (OH_AVMuxer *muxer, uint32_t trackIndex, OH_AVMemory *sample, OH_AVCodecBufferAttr info) ``` **Description** diff --git a/en/application-dev/reference/native-apis/_a_v_source.md b/en/application-dev/reference/native-apis/_a_v_source.md index 5c07b9a923..116fca38aa 100644 --- a/en/application-dev/reference/native-apis/_a_v_source.md +++ b/en/application-dev/reference/native-apis/_a_v_source.md @@ -17,20 +17,20 @@ The AVSource module provides functions for constructing audio and video resource ### File -| Name| Description| +| Name| Description| | -------- | -------- | -| [native_avsource.h](native__avsource_8h.md) | Declares the native APIs used to construct audio and video resource objects.
File to include: \| +| [native_avsource.h](native__avsource_8h.md) | Declares the native APIs used to construct audio and video resource objects.
**File to include**:
**Library**: libnative_media_avsource.so| ### Functions -| Name| Description| +| Name| Description| | -------- | -------- | -| \*[OH_AVSource_CreateWithURI](#oh_avsource_createwithuri) (char \*uri) | Creates an **OH_AVSource** instance based on a URI.| -| \*[OH_AVSource_CreateWithFD](#oh_avsource_createwithfd) (int32_t fd, int64_t offset, int64_t size) | Creates an **OH_AVSource** instance based on a file descriptor (FD).| -| [OH_AVSource_Destroy](#oh_avsource_destroy) (OH_AVSource \*source) | Destroys an **OH_AVSource** instance and clears internal resources. An instance can be destroyed only once.| -| \*[OH_AVSource_GetSourceFormat](#oh_avsource_getsourceformat) (OH_AVSource \*source) | Obtains the basic information about a media resource.| -| \*[OH_AVSource_GetTrackFormat](#oh_avsource_gettrackformat) (OH_AVSource \*source, uint32_t trackIndex) | Obtains the basic information about a track.| +| \*[OH_AVSource_CreateWithURI](#oh_avsource_createwithuri) (char \*uri) | Creates an **OH_AVSource** instance based on a URI.| +| \*[OH_AVSource_CreateWithFD](#oh_avsource_createwithfd) (int32_t fd, int64_t offset, int64_t size) | Creates an **OH_AVSource** instance based on a file descriptor (FD).| +| [OH_AVSource_Destroy](#oh_avsource_destroy) (OH_AVSource \*source) | Destroys an **OH_AVSource** instance and clears internal resources. An instance can be destroyed only once.| +| \*[OH_AVSource_GetSourceFormat](#oh_avsource_getsourceformat) (OH_AVSource \*source) | Obtains the basic information about a media resource.| +| \*[OH_AVSource_GetTrackFormat](#oh_avsource_gettrackformat) (OH_AVSource \*source, uint32_t trackIndex) | Obtains the basic information about a track.| ## Function Description @@ -38,9 +38,9 @@ The AVSource module provides functions for constructing audio and video resource ### OH_AVSource_CreateWithFD() - + ``` -OH_AVSource* OH_AVSource_CreateWithFD (int32_t fd, int64_t offset, int64_t size ) +OH_AVSource* OH_AVSource_CreateWithFD (int32_t fd, int64_t offset, int64_t size) ``` **Description** @@ -55,11 +55,11 @@ If **offset** is not the start position of the file or **size** is not the file **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| fd | FD of a media resource file.| -| offset | Position from which data is to read.| -| size | File size, in bytes.| +| fd | FD of a media resource file.| +| offset | Position from which data is to read.| +| size | File size, in bytes.| **Returns** @@ -72,9 +72,9 @@ Returns the pointer to an **OH_AVSource** instance. ### OH_AVSource_CreateWithURI() - + ``` -OH_AVSource* OH_AVSource_CreateWithURI (char * uri) +OH_AVSource* OH_AVSource_CreateWithURI (char *uri) ``` **Description** @@ -85,9 +85,9 @@ Create an **OH_AVSource** instance object based on a URI. You can release the in **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| uri | URI of the media resource.| +| uri | URI of the media resource.| **Returns** @@ -100,9 +100,9 @@ Returns the pointer to an **OH_AVSource** instance. ### OH_AVSource_Destroy() - + ``` -OH_AVErrCode OH_AVSource_Destroy (OH_AVSource * source) +OH_AVErrCode OH_AVSource_Destroy (OH_AVSource *source) ``` **Description** @@ -117,9 +117,9 @@ The destroyed instance cannot be used until it is re-created. You are advised to **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| source | Pointer to an **OH_AVSource** instance.| +| source | Pointer to an **OH_AVSource** instance.| **Returns** @@ -132,9 +132,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_AVSource_GetSourceFormat() - + ``` -OH_AVFormat* OH_AVSource_GetSourceFormat (OH_AVSource * source) +OH_AVFormat* OH_AVSource_GetSourceFormat (OH_AVSource *source) ``` **Description** @@ -145,9 +145,9 @@ Obtains the basic information about a media resource. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| source | Pointer to an **OH_AVSource** instance.| +| source | Pointer to an **OH_AVSource** instance.| **Returns** @@ -160,9 +160,9 @@ Returns the basic information obtained. ### OH_AVSource_GetTrackFormat() - + ``` -OH_AVFormat* OH_AVSource_GetTrackFormat (OH_AVSource * source, uint32_t trackIndex ) +OH_AVFormat* OH_AVSource_GetTrackFormat (OH_AVSource *source, uint32_t trackIndex) ``` **Description** @@ -173,10 +173,10 @@ Obtains the basic information about a track. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| source | Pointer to an **OH_AVSource** instance.| -| trackIndex | Index of the track whose information is to be obtained.| +| source | Pointer to an **OH_AVSource** instance.| +| trackIndex | Index of the track whose information is to be obtained.| **Returns** diff --git a/en/application-dev/reference/native-apis/_audio_decoder.md b/en/application-dev/reference/native-apis/_audio_decoder.md index 05b527261f..e8cdd215f9 100644 --- a/en/application-dev/reference/native-apis/_audio_decoder.md +++ b/en/application-dev/reference/native-apis/_audio_decoder.md @@ -1,6 +1,5 @@ # AudioDecoder - ## Overview The **AudioDecoder** module provides the functions for audio decoding. This module may not be supported on some devices. You can call [CanIUse](../syscap.md) to check whether your device supports this module. @@ -11,53 +10,46 @@ The **AudioDecoder** module provides the functions for audio decoding. This modu 9 - ## Summary - ### Files -| Name| Description| -| -------- | -------- | -| [native_avcodec_audiodecoder.h](native__avcodec__audiodecoder_8h.md) | Declares the native APIs used for audio decoding.
File to include: | -| [avcodec_audio_channel_layout.h](avcodec__audio__channel__layout_8h.md) | Declares the enums used for audio codec.
File to include: \| - +| Name | Description | +| -------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| [native_avcodec_audiodecoder.h](native__avcodec__audiodecoder_8h.md) | Declares the native APIs used for audio decoding.
**File to include**:
**Library**: libnative_media_adec.so| +| [avcodec_audio_channel_layout.h](avcodec__audio__channel__layout_8h.md) | Declares the enums used for audio codec.
**File to include**:
**Library**: libnative_media_codecbase.so | ### Enums -| Name| Description| -| -------- | -------- | -| [OHOS::Media::AudioChannelSet](#audiochannelset) : uint64_t {
**FRONT_LEFT** = 1ULL << 0U, **FRONT_RIGHT** = 1ULL << 1U, **FRONT_CENTER** = 1ULL << 2U, **LOW_FREQUENCY** = 1ULL << 3U,
**BACK_LEFT** = 1ULL << 4U, **BACK_RIGHT** = 1ULL << 5U, **FRONT_LEFT_OF_CENTER** = 1ULL << 6U, **FRONT_RIGHT_OF_CENTER** = 1ULL << 7U,
**BACK_CENTER** = 1ULL << 8U, **SIDE_LEFT** = 1ULL << 9U, **SIDE_RIGHT** = 1ULL << 10U, **TOP_CENTER** = 1ULL << 11U,
**TOP_FRONT_LEFT** = 1ULL << 12U, **TOP_FRONT_CENTER** = 1ULL << 13U, **TOP_FRONT_RIGHT** = 1ULL << 14U, **TOP_BACK_LEFT** = 1ULL << 15U,
**TOP_BACK_CENTER** = 1ULL << 16U, **TOP_BACK_RIGHT** = 1ULL << 17U, **STEREO_LEFT** = 1ULL << 29U, **STEREO_RIGHT** = 1ULL << 30U,
**WIDE_LEFT** = 1ULL << 31U, **WIDE_RIGHT** = 1ULL << 32U, **SURROUND_DIRECT_LEFT** = 1ULL << 33U, **SURROUND_DIRECT_RIGHT** = 1ULL << 34U,
**LOW_FREQUENCY_2** = 1ULL << 35U, **TOP_SIDE_LEFT** = 1ULL << 36U, **TOP_SIDE_RIGHT** = 1ULL << 37U, **BOTTOM_FRONT_CENTER** = 1ULL << 38U,
**BOTTOM_FRONT_LEFT** = 1ULL << 39U, **BOTTOM_FRONT_RIGHT** = 1ULL << 40U, **AMBISONICS_ACN0** = 1ULL << 41U, OHOS::Media::AMBISONICS_ACN1 = 1ULL << 42U,
OHOS::Media::AMBISONICS_ACN2 = 1ULL << 43U, OHOS::Media::AMBISONICS_ACN3 = 1ULL << 44U, OHOS::Media::AMBISONICS_W = AMBISONICS_ACN0, OHOS::Media::AMBISONICS_Y = AMBISONICS_ACN1,
OHOS::Media::AMBISONICS_Z = AMBISONICS_ACN2, OHOS::Media::AMBISONICS_X = AMBISONICS_ACN3, OHOS::Media::AMBISONICS_ACN4 = 1ULL << 45U, OHOS::Media::AMBISONICS_ACN5 = 1ULL << 46U,
OHOS::Media::AMBISONICS_ACN6 = 1ULL << 47U, OHOS::Media::AMBISONICS_ACN7 = 1ULL << 48U, OHOS::Media::AMBISONICS_ACN8 = 1ULL << 49U, OHOS::Media::AMBISONICS_ACN9 = 1ULL << 50U,
OHOS::Media::AMBISONICS_ACN10 = 1ULL << 51U, OHOS::Media::AMBISONICS_ACN11 = 1ULL << 52U, OHOS::Media::AMBISONICS_ACN12 = 1ULL << 53U, OHOS::Media::AMBISONICS_ACN13 = 1ULL << 54U,
OHOS::Media::AMBISONICS_ACN14 = 1ULL << 55U, OHOS::Media::AMBISONICS_ACN15 = 1ULL << 56U
} | Enumerates the audio channel numbers. Each channel number is mapped to a variable of int64.| -| [OHOS::Media::AudioChannelLayout](#audiochannellayout) : uint64_t {
**UNKNOWN_CHANNEL_LAYOUT** = 0, **MONO** = (AudioChannelSet::FRONT_CENTER), **STEREO** = (AudioChannelSet::FRONT_LEFT \| AudioChannelSet::FRONT_RIGHT), **CH_2POINT1** = (STEREO \| AudioChannelSet::LOW_FREQUENCY),
**CH_2_1** = (STEREO \| AudioChannelSet::BACK_CENTER), **SURROUND** = (STEREO \| AudioChannelSet::FRONT_CENTER), **CH_3POINT1** = (SURROUND \| AudioChannelSet::LOW_FREQUENCY), **CH_4POINT0** = (SURROUND \| AudioChannelSet::BACK_CENTER),
**CH_4POINT1** = (CH_4POINT0 \| AudioChannelSet::LOW_FREQUENCY), **CH_2_2** = (STEREO \| AudioChannelSet::SIDE_LEFT \| AudioChannelSet::SIDE_RIGHT), **QUAD** = (STEREO \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT), **CH_5POINT0** = (SURROUND \| AudioChannelSet::SIDE_LEFT \| AudioChannelSet::SIDE_RIGHT),
**CH_5POINT1** = (CH_5POINT0 \| AudioChannelSet::LOW_FREQUENCY), **CH_5POINT0_BACK** = (SURROUND \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT), **CH_5POINT1_BACK** = (CH_5POINT0_BACK \| AudioChannelSet::LOW_FREQUENCY), **CH_6POINT0** = (CH_5POINT0 \| AudioChannelSet::BACK_CENTER),
**CH_6POINT0_FRONT** = (CH_2_2 \| AudioChannelSet::FRONT_LEFT_OF_CENTER \| AudioChannelSet::FRONT_RIGHT_OF_CENTER), **HEXAGONAL** = (CH_5POINT0_BACK \| AudioChannelSet::BACK_CENTER), **CH_6POINT1** = (CH_5POINT1 \| AudioChannelSet::BACK_CENTER), **CH_6POINT1_BACK** = (CH_5POINT1_BACK \| AudioChannelSet::BACK_CENTER),
**CH_6POINT1_FRONT** = (CH_6POINT0_FRONT \| AudioChannelSet::LOW_FREQUENCY), **CH_7POINT0** = (CH_5POINT0 \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT), **CH_7POINT0_FRONT** = (CH_5POINT0 \| AudioChannelSet::FRONT_LEFT_OF_CENTER \| AudioChannelSet::FRONT_RIGHT_OF_CENTER), **CH_7POINT1** = (CH_5POINT1 \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT),
**CH_7POINT1_WIDE** = (CH_5POINT1 \| AudioChannelSet::FRONT_LEFT_OF_CENTER \| AudioChannelSet::FRONT_RIGHT_OF_CENTER), **CH_7POINT1_WIDE_BACK**, **CH_3POINT1POINT2** = (CH_3POINT1 \| AudioChannelSet::TOP_FRONT_LEFT \| AudioChannelSet::TOP_FRONT_RIGHT), **CH_5POINT1POINT2** = (CH_5POINT1 \| AudioChannelSet::TOP_SIDE_LEFT \| AudioChannelSet::TOP_SIDE_RIGHT),
**CH_5POINT1POINT4**, **CH_7POINT1POINT2** = (CH_7POINT1 \| AudioChannelSet::TOP_SIDE_LEFT \| AudioChannelSet::TOP_SIDE_RIGHT), **CH_7POINT1POINT4**, **CH_9POINT1POINT4** = (CH_7POINT1POINT4 \| AudioChannelSet::WIDE_LEFT \| AudioChannelSet::WIDE_RIGHT),
**CH_9POINT1POINT6** = (CH_9POINT1POINT4 \| AudioChannelSet::TOP_SIDE_LEFT \| AudioChannelSet::TOP_SIDE_RIGHT), **CH_10POINT2**, **CH_22POINT2**, **OCTAGONAL** = (CH_5POINT0 \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_CENTER \| AudioChannelSet::BACK_RIGHT),
**HEXADECAGONAL**, **STEREO_DOWNMIX** = (AudioChannelSet::STEREO_LEFT \| AudioChannelSet::STEREO_RIGHT), **HOA_FIRST**, **HOA_SECOND**,
**HOA_THIRD**
} | Enumerates the types of the audio channel numbers. The output format of the decoder is represented as the channel type of the codec.| - +| Name | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | +| [OHOS::Media::AudioChannelSet](#audiochannelset) : uint64_t {`**FRONT_LEFT** = 1ULL << 0U, **FRONT_RIGHT** = 1ULL << 1U, **FRONT_CENTER** = 1ULL << 2U, **LOW_FREQUENCY** = 1ULL << 3U,`**BACK_LEFT** = 1ULL << 4U, **BACK_RIGHT** = 1ULL << 5U, **FRONT_LEFT_OF_CENTER** = 1ULL << 6U, **FRONT_RIGHT_OF_CENTER** = 1ULL << 7U,`**BACK_CENTER** = 1ULL << 8U, **SIDE_LEFT** = 1ULL << 9U, **SIDE_RIGHT** = 1ULL << 10U, **TOP_CENTER** = 1ULL << 11U,`**TOP_FRONT_LEFT** = 1ULL << 12U, **TOP_FRONT_CENTER** = 1ULL << 13U, **TOP_FRONT_RIGHT** = 1ULL << 14U, **TOP_BACK_LEFT** = 1ULL << 15U,`**TOP_BACK_CENTER** = 1ULL << 16U, **TOP_BACK_RIGHT** = 1ULL << 17U, **STEREO_LEFT** = 1ULL << 29U, **STEREO_RIGHT** = 1ULL << 30U,`**WIDE_LEFT** = 1ULL << 31U, **WIDE_RIGHT** = 1ULL << 32U, **SURROUND_DIRECT_LEFT** = 1ULL << 33U, **SURROUND_DIRECT_RIGHT** = 1ULL << 34U,`**LOW_FREQUENCY_2** = 1ULL << 35U, **TOP_SIDE_LEFT** = 1ULL << 36U, **TOP_SIDE_RIGHT** = 1ULL << 37U, **BOTTOM_FRONT_CENTER** = 1ULL << 38U,`**BOTTOM_FRONT_LEFT** = 1ULL << 39U, **BOTTOM_FRONT_RIGHT** = 1ULL << 40U, **AMBISONICS_ACN0** = 1ULL << 41U, OHOS::Media::AMBISONICS_ACN1 = 1ULL << 42U,`OHOS::Media::AMBISONICS_ACN2 = 1ULL << 43U, OHOS::Media::AMBISONICS_ACN3 = 1ULL << 44U, OHOS::Media::AMBISONICS_W = AMBISONICS_ACN0, OHOS::Media::AMBISONICS_Y = AMBISONICS_ACN1,`OHOS::Media::AMBISONICS_Z = AMBISONICS_ACN2, OHOS::Media::AMBISONICS_X = AMBISONICS_ACN3, OHOS::Media::AMBISONICS_ACN4 = 1ULL << 45U, OHOS::Media::AMBISONICS_ACN5 = 1ULL << 46U,`OHOS::Media::AMBISONICS_ACN6 = 1ULL << 47U, OHOS::Media::AMBISONICS_ACN7 = 1ULL << 48U, OHOS::Media::AMBISONICS_ACN8 = 1ULL << 49U, OHOS::Media::AMBISONICS_ACN9 = 1ULL << 50U,`OHOS::Media::AMBISONICS_ACN10 = 1ULL << 51U, OHOS::Media::AMBISONICS_ACN11 = 1ULL << 52U, OHOS::Media::AMBISONICS_ACN12 = 1ULL << 53U, OHOS::Media::AMBISONICS_ACN13 = 1ULL << 54U,`OHOS::Media::AMBISONICS_ACN14 = 1ULL << 55U, OHOS::Media::AMBISONICS_ACN15 = 1ULL << 56U`} | Enumerates the audio channel numbers. Each channel number is mapped to a variable of int64. | +| [OHOS::Media::AudioChannelLayout](#audiochannellayout) : uint64_t {``**UNKNOWN_CHANNEL_LAYOUT** = 0, **MONO** = (AudioChannelSet::FRONT_CENTER), **STEREO** = (AudioChannelSet::FRONT_LEFT \| AudioChannelSet::FRONT_RIGHT), **CH_2POINT1** = (STEREO \| AudioChannelSet::LOW_FREQUENCY),``**CH_2_1** = (STEREO \| AudioChannelSet::BACK_CENTER), **SURROUND** = (STEREO \| AudioChannelSet::FRONT_CENTER), **CH_3POINT1** = (SURROUND \| AudioChannelSet::LOW_FREQUENCY), **CH_4POINT0** = (SURROUND \| AudioChannelSet::BACK_CENTER),``**CH_4POINT1** = (CH_4POINT0 \| AudioChannelSet::LOW_FREQUENCY), **CH_2_2** = (STEREO \| AudioChannelSet::SIDE_LEFT \| AudioChannelSet::SIDE_RIGHT), **QUAD** = (STEREO \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT), **CH_5POINT0** = (SURROUND \| AudioChannelSet::SIDE_LEFT \| AudioChannelSet::SIDE_RIGHT),``**CH_5POINT1** = (CH_5POINT0 \| AudioChannelSet::LOW_FREQUENCY), **CH_5POINT0_BACK** = (SURROUND \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT), **CH_5POINT1_BACK** = (CH_5POINT0_BACK \| AudioChannelSet::LOW_FREQUENCY), **CH_6POINT0** = (CH_5POINT0 \| AudioChannelSet::BACK_CENTER),``**CH_6POINT0_FRONT** = (CH_2_2 \| AudioChannelSet::FRONT_LEFT_OF_CENTER \| AudioChannelSet::FRONT_RIGHT_OF_CENTER), **HEXAGONAL** = (CH_5POINT0_BACK \| AudioChannelSet::BACK_CENTER), **CH_6POINT1** = (CH_5POINT1 \| AudioChannelSet::BACK_CENTER), **CH_6POINT1_BACK** = (CH_5POINT1_BACK \| AudioChannelSet::BACK_CENTER),``**CH_6POINT1_FRONT** = (CH_6POINT0_FRONT \| AudioChannelSet::LOW_FREQUENCY), **CH_7POINT0** = (CH_5POINT0 \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT), **CH_7POINT0_FRONT** = (CH_5POINT0 \| AudioChannelSet::FRONT_LEFT_OF_CENTER \| AudioChannelSet::FRONT_RIGHT_OF_CENTER), **CH_7POINT1** = (CH_5POINT1 \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT),``**CH_7POINT1_WIDE** = (CH_5POINT1 \| AudioChannelSet::FRONT_LEFT_OF_CENTER \| AudioChannelSet::FRONT_RIGHT_OF_CENTER), **CH_7POINT1_WIDE_BACK**, **CH_3POINT1POINT2** = (CH_3POINT1 \| AudioChannelSet::TOP_FRONT_LEFT \| AudioChannelSet::TOP_FRONT_RIGHT), **CH_5POINT1POINT2** = (CH_5POINT1 \| AudioChannelSet::TOP_SIDE_LEFT \| AudioChannelSet::TOP_SIDE_RIGHT),``**CH_5POINT1POINT4**, **CH_7POINT1POINT2** = (CH_7POINT1 \| AudioChannelSet::TOP_SIDE_LEFT \| AudioChannelSet::TOP_SIDE_RIGHT), **CH_7POINT1POINT4**, **CH_9POINT1POINT4** = (CH_7POINT1POINT4 \| AudioChannelSet::WIDE_LEFT \| AudioChannelSet::WIDE_RIGHT),``**CH_9POINT1POINT6** = (CH_9POINT1POINT4 \| AudioChannelSet::TOP_SIDE_LEFT \| AudioChannelSet::TOP_SIDE_RIGHT), **CH_10POINT2**, **CH_22POINT2**, **OCTAGONAL** = (CH_5POINT0 \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_CENTER \| AudioChannelSet::BACK_RIGHT),``**HEXADECAGONAL**, **STEREO_DOWNMIX** = (AudioChannelSet::STEREO_LEFT \| AudioChannelSet::STEREO_RIGHT), **HOA_FIRST**, **HOA_SECOND**,`**HOA_THIRD**`} | Enumerates the types of the audio channel numbers. The output format of the decoder is represented as the channel type of the codec.| ### Functions -| Name| Description| -| -------- | -------- | -| \*[OHOS::Media::OH_AudioDecoder_CreateByMime](#oh_audiodecoder_createbymime) (const char \*mime) | Creates an audio decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases.| -| \*[OHOS::Media::OH_AudioDecoder_CreateByName](#oh_audiodecoder_createbyname) (const char \*name) | Creates an audio decoder instance based on a decoder name. To use this function, you must know the exact name of the decoder.| -| [OHOS::Media::OH_AudioDecoder_Destroy](#oh_audiodecoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of an audio decoder and destroys the decoder instance.| -| [OHOS::Media::OH_AudioDecoder_SetCallback](#oh_audiodecoder_setcallback) (OH_AVCodec \*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio decoder.| -| [OHOS::Media::OH_AudioDecoder_Configure](#oh_audiodecoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures an audio decoder. Typically, you need to configure the audio description information that can be extracted from the container.| -| [OHOS::Media::OH_AudioDecoder_Prepare](#oh_audiodecoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for an audio decoder. This function must be called after **Configure**.| -| [OHOS::Media::OH_AudioDecoder_Start](#oh_audiodecoder_start) (OH_AVCodec \*codec) | Starts an audio decoder. This function can be called only after the decoder is prepared successfully.| -| [OHOS::Media::OH_AudioDecoder_Stop](#oh_audiodecoder_stop) (OH_AVCodec \*codec) | Stops an audio decoder.| -| [OHOS::Media::OH_AudioDecoder_Flush](#oh_audiodecoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of an audio decoder.| -| [OHOS::Media::OH_AudioDecoder_Reset](#oh_audiodecoder_reset) (OH_AVCodec \*codec) | Resets an audio decoder. To continue decoding, you must call **Configure** to configure the decoder again.| -| \*[OHOS::Media::OH_AudioDecoder_GetOutputDescription](#oh_audiodecoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the description information about the output data of an audio decoder. For details, see **OH_AVFormat**.| -| [OHOS::Media::OH_AudioDecoder_SetParameter](#oh_audiodecoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio decoder. This function can be called only after the decoder is started. Incorrect parameter settings may cause decoding failure.| -| [OHOS::Media::OH_AudioDecoder_PushInputData](#oh_audiodecoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio decoder.| -| [OHOS::Media::OH_AudioDecoder_FreeOutputData](#oh_audiodecoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of an audio decoder.| -| [OHOS::Media::OH_AudioDecoder_IsValid](#oh_audiodecoder_isvalid) (OH_AVCodec \*codec, bool \*isValid) | Checks whether an audio decoder instance is valid.| - +| Name | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| \*[OHOS::Media::OH_AudioDecoder_CreateByMime](#oh_audiodecoder_createbymime) (const char \*mime) | Creates an audio decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases. | +| \*[OHOS::Media::OH_AudioDecoder_CreateByName](#oh_audiodecoder_createbyname) (const char \*name) | Creates an audio decoder instance based on a decoder name. To use this function, you must know the exact name of the decoder. | +| [OHOS::Media::OH_AudioDecoder_Destroy](#oh_audiodecoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of an audio decoder and destroys the decoder instance. | +| [OHOS::Media::OH_AudioDecoder_SetCallback](#oh_audiodecoder_setcallback) (OH_AVCodec \*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio decoder. | +| [OHOS::Media::OH_AudioDecoder_Configure](#oh_audiodecoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures an audio decoder. Typically, you need to configure the audio description information that can be extracted from the container. | +| [OHOS::Media::OH_AudioDecoder_Prepare](#oh_audiodecoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for an audio decoder. This function must be called after **Configure**. | +| [OHOS::Media::OH_AudioDecoder_Start](#oh_audiodecoder_start) (OH_AVCodec \*codec) | Starts an audio decoder. This function can be called only after the decoder is prepared successfully. | +| [OHOS::Media::OH_AudioDecoder_Stop](#oh_audiodecoder_stop) (OH_AVCodec \*codec) | Stops an audio decoder. | +| [OHOS::Media::OH_AudioDecoder_Flush](#oh_audiodecoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of an audio decoder. | +| [OHOS::Media::OH_AudioDecoder_Reset](#oh_audiodecoder_reset) (OH_AVCodec \*codec) | Resets an audio decoder. To continue decoding, you must call **Configure** to configure the decoder again. | +| \*[OHOS::Media::OH_AudioDecoder_GetOutputDescription](#oh_audiodecoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the description information about the output data of an audio decoder. For details, see **OH_AVFormat**. | +| [OHOS::Media::OH_AudioDecoder_SetParameter](#oh_audiodecoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio decoder. This function can be called only after the decoder is started. Incorrect parameter settings may cause decoding failure.| +| [OHOS::Media::OH_AudioDecoder_PushInputData](#oh_audiodecoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio decoder. | +| [OHOS::Media::OH_AudioDecoder_FreeOutputData](#oh_audiodecoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of an audio decoder. | +| [OHOS::Media::OH_AudioDecoder_IsValid](#oh_audiodecoder_isvalid) (OH_AVCodec \*codec, bool \*isValid) | Checks whether an audio decoder instance is valid. | ## Enum Description - ### AudioChannelLayout - ``` enum OHOS::Media::AudioChannelLayout : uint64_t ``` @@ -72,10 +64,8 @@ Enumerates the types of the audio channel numbers. The output format of the deco 10 - ### AudioChannelSet - ``` enum OHOS::Media::AudioChannelSet : uint64_t ``` @@ -90,35 +80,32 @@ Enumerates the audio channel numbers. Each channel number is mapped to a variabl 10 -| Value| Description| -| -------- | -------- | -| AMBISONICS_ACN1 | Channel 0 for the zero-order stereo.| -| AMBISONICS_ACN2 | Channel 1 for the first-order stereo.| -| AMBISONICS_ACN3 | Channel 2 for the first-order stereo.| -| AMBISONICS_W | Channel 3 for the first-order stereo.| -| AMBISONICS_Y | Equivalent to channel 0 for the zero-order stereo.| -| AMBISONICS_Z | Equivalent to channel 1 for the first-order stereo.| -| AMBISONICS_X | Equivalent to channel 2 for the first-order stereo.| -| AMBISONICS_ACN4 | Equivalent to channel 3 for the first-order stereo.| -| AMBISONICS_ACN5 | Channel 4 for the second-order stereo.| -| AMBISONICS_ACN6 | Channel 5 for the second-order stereo.| -| AMBISONICS_ACN7 | Channel 6 for the second-order stereo.| -| AMBISONICS_ACN8 | Channel 7 for the second-order stereo.| -| AMBISONICS_ACN9 | Channel 8 for the second-order stereo.| -| AMBISONICS_ACN10 | Channel 9 for the third-order stereo.| -| AMBISONICS_ACN11 | Channel 10 for the third-order stereo.| -| AMBISONICS_ACN12 | Channel 11 for the third-order stereo.| -| AMBISONICS_ACN13 | Channel 12 for the third-order stereo.| -| AMBISONICS_ACN14 | Channel 13 for the third-order stereo.| -| AMBISONICS_ACN15 | Channel 14 for the third-order stereo.| - +| Value | Description | +| ---------------- | ---------------------- | +| AMBISONICS_ACN1 | Channel 0 for the zero-order stereo. | +| AMBISONICS_ACN2 | Channel 1 for the first-order stereo. | +| AMBISONICS_ACN3 | Channel 2 for the first-order stereo. | +| AMBISONICS_W | Channel 3 for the first-order stereo. | +| AMBISONICS_Y | Equivalent to channel 0 for the zero-order stereo.| +| AMBISONICS_Z | Equivalent to channel 1 for the first-order stereo.| +| AMBISONICS_X | Equivalent to channel 2 for the first-order stereo.| +| AMBISONICS_ACN4 | Equivalent to channel 3 for the first-order stereo.| +| AMBISONICS_ACN5 | Channel 4 for the second-order stereo. | +| AMBISONICS_ACN6 | Channel 5 for the second-order stereo. | +| AMBISONICS_ACN7 | Channel 6 for the second-order stereo. | +| AMBISONICS_ACN8 | Channel 7 for the second-order stereo. | +| AMBISONICS_ACN9 | Channel 8 for the second-order stereo. | +| AMBISONICS_ACN10 | Channel 9 for the third-order stereo. | +| AMBISONICS_ACN11 | Channel 10 for the third-order stereo. | +| AMBISONICS_ACN12 | Channel 11 for the third-order stereo. | +| AMBISONICS_ACN13 | Channel 12 for the third-order stereo. | +| AMBISONICS_ACN14 | Channel 13 for the third-order stereo. | +| AMBISONICS_ACN15 | Channel 14 for the third-order stereo. | ## Function Description - ### OH_AudioDecoder_Configure() - ``` OH_AVErrCode OHOS::Media::OH_AudioDecoder_Configure (OH_AVCodec * codec, OH_AVFormat * format ) ``` @@ -133,10 +120,10 @@ This function must be called prior to **Prepare**. **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| format | Pointer to the **OH_AVFormat** instance, which provides the description information about the audio track to be decoded.| +| Name | Description | +| ------ | --------------------------------------------------- | +| codec | Pointer to an **OH_AVCodec** instance. | +| format | Pointer to the **OH_AVFormat** instance, which provides the description information about the audio track to be decoded.| **Returns** @@ -146,10 +133,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioDecoder_CreateByMime() - ``` OH_AVCodec* OHOS::Media::OH_AudioDecoder_CreateByMime (const char * mime) ``` @@ -162,9 +147,9 @@ Creates an audio decoder instance based on a MIME type. This function is recomme **Parameters** -| Name| Description| -| -------- | -------- | -| mime | Pointer to a string that describes the MIME type. For details, see **AVCODEC_MIME_TYPE**.| +| Name| Description | +| ---- | ------------------------------------------------------- | +| mime | Pointer to a string that describes the MIME type. For details, see **AVCODEC_MIME_TYPE**.| **Returns** @@ -174,10 +159,8 @@ Returns the pointer to an **OH_AVCodec** instance. 9 - ### OH_AudioDecoder_CreateByName() - ``` OH_AVCodec* OHOS::Media::OH_AudioDecoder_CreateByName (const char * name) ``` @@ -190,9 +173,9 @@ Creates an audio decoder instance based on a decoder name. To use this function, **Parameters** -| Name| Description| -| -------- | -------- | -| name | Pointer to an audio decoder name.| +| Name| Description | +| ---- | ---------------- | +| name | Pointer to an audio decoder name.| **Returns** @@ -202,10 +185,8 @@ Returns the pointer to an **OH_AVCodec** instance. 9 - ### OH_AudioDecoder_Destroy() - ``` OH_AVErrCode OHOS::Media::OH_AudioDecoder_Destroy (OH_AVCodec * codec) ``` @@ -218,9 +199,9 @@ Clears the internal resources of an audio decoder and destroys the decoder insta **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| Name | Description | +| ----- | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -230,10 +211,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioDecoder_Flush() - ``` OH_AVErrCode OHOS::Media::OH_AudioDecoder_Flush (OH_AVCodec * codec) ``` @@ -248,9 +227,9 @@ This function invalidates the indexes of all buffers previously reported through **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| Name | Description | +| ----- | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -260,10 +239,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioDecoder_FreeOutputData() - ``` OH_AVErrCode OHOS::Media::OH_AudioDecoder_FreeOutputData (OH_AVCodec * codec, uint32_t index ) ``` @@ -276,10 +253,10 @@ Frees an output buffer of an audio decoder. **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| index | Index of the output buffer.| +| Name | Description | +| ----- | ------------------------------ | +| codec | Pointer to an **OH_AVCodec** instance. | +| index | Index of the output buffer.| **Returns** @@ -289,10 +266,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioDecoder_GetOutputDescription() - ``` OH_AVFormat* OHOS::Media::OH_AudioDecoder_GetOutputDescription (OH_AVCodec * codec) ``` @@ -305,9 +280,9 @@ Obtains the description information about the output data of an audio decoder. F **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| Name | Description | +| ----- | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -317,10 +292,8 @@ Returns the handle to an **OH_AVFormat** instance. The lifecycle of this instanc 9 - ### OH_AudioDecoder_IsValid() - ``` OH_AVErrCode OHOS::Media::OH_AudioDecoder_IsValid (OH_AVCodec * codec, bool * isValid ) ``` @@ -333,10 +306,10 @@ Checks whether an audio decoder instance is valid. **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| isValid | Pointer to an instance of the Boolean type. The value **true** means that the decoder instance is valid and **false** means the opposite.| +| Name | Description | +| ------- | ----------------------------------------------------------------- | +| codec | Pointer to an **OH_AVCodec** instance. | +| isValid | Pointer to an instance of the Boolean type. The value **true** means that the decoder instance is valid and **false** means the opposite.| **Returns** @@ -346,10 +319,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 10 - ### OH_AudioDecoder_Prepare() - ``` OH_AVErrCode OHOS::Media::OH_AudioDecoder_Prepare (OH_AVCodec * codec) ``` @@ -362,9 +333,9 @@ Prepares internal resources for an audio decoder. This function must be called a **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| Name | Description | +| ----- | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -374,10 +345,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioDecoder_PushInputData() - ``` OH_AVErrCode OHOS::Media::OH_AudioDecoder_PushInputData (OH_AVCodec * codec, uint32_t index, OH_AVCodecBufferAttr attr ) ``` @@ -392,11 +361,11 @@ The **OH_AVCodecOnNeedInputData** callback reports the available input buffer an **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| index | Index of the input buffer.| -| attr | Description information about the data in the buffer.| +| Name | Description | +| ----- | ------------------------------ | +| codec | Pointer to an **OH_AVCodec** instance. | +| index | Index of the input buffer.| +| attr | Description information about the data in the buffer.| **Returns** @@ -406,10 +375,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioDecoder_Reset() - ``` OH_AVErrCode OHOS::Media::OH_AudioDecoder_Reset (OH_AVCodec * codec) ``` @@ -422,9 +389,9 @@ Resets an audio decoder. To continue decoding, you must call **Configure** to co **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| Name | Description | +| ----- | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -434,10 +401,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioDecoder_SetCallback() - ``` OH_AVErrCode OHOS::Media::OH_AudioDecoder_SetCallback (OH_AVCodec * codec, OH_AVCodecAsyncCallback callback, void * userData ) ``` @@ -452,11 +417,11 @@ This function must be called prior to **Prepare**. **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| callback | Callback function to set. For details, see **OH_AVCodecAsyncCallback**.| -| userData | User-specific data.| +| Name | Description | +| -------- | ------------------------------------------------------------- | +| codec | Pointer to an **OH_AVCodec** instance. | +| callback | Callback function to set. For details, see **OH_AVCodecAsyncCallback**.| +| userData | User-specific data. | **Returns** @@ -466,10 +431,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioDecoder_SetParameter() - ``` OH_AVErrCode OHOS::Media::OH_AudioDecoder_SetParameter (OH_AVCodec * codec, OH_AVFormat * format ) ``` @@ -484,10 +447,10 @@ This function can be called only after the decoder is started. Incorrect paramet **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| format | Handle to an **OH_AVFormat** instance.| +| Name | Description | +| ------ | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| +| format | Handle to an **OH_AVFormat** instance. | **Returns** @@ -497,10 +460,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioDecoder_Start() - ``` OH_AVErrCode OHOS::Media::OH_AudioDecoder_Start (OH_AVCodec * codec) ``` @@ -515,9 +476,9 @@ After being started, the decoder starts to report the **OH_AVCodecOnNeedInputDat **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| Name | Description | +| ----- | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -527,10 +488,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioDecoder_Stop() - ``` OH_AVErrCode OHOS::Media::OH_AudioDecoder_Stop (OH_AVCodec * codec) ``` @@ -545,9 +504,9 @@ After the decoder is stopped, you can call **Start** to start it again. If you h **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| Name | Description | +| ----- | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** diff --git a/en/application-dev/reference/native-apis/_audio_encoder.md b/en/application-dev/reference/native-apis/_audio_encoder.md index 2fe3afb0f7..cd0ea5d471 100644 --- a/en/application-dev/reference/native-apis/_audio_encoder.md +++ b/en/application-dev/reference/native-apis/_audio_encoder.md @@ -1,6 +1,5 @@ # AudioEncoder - ## Overview The **AudioEncoder** module provides the functions for audio encoding. This module may not be supported on some devices. You can call [CanIUse](../syscap.md) to check whether your device supports this module. @@ -11,44 +10,38 @@ The **AudioEncoder** module provides the functions for audio encoding. This modu 9 - ## Summary - ### Files -| Name| Description| -| -------- | -------- | -| [native_avcodec_audioencoder.h](native__avcodec__audioencoder_8h.md) | Declares the native APIs used for audio encoding.
File to include: | - +| Name | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | +| [native_avcodec_audioencoder.h](native__avcodec__audioencoder_8h.md) | Declares the native APIs used for audio encoding.
**File to include**:
**Library**: libnative_media_aenc.so| ### Functions -| Name| Description| -| -------- | -------- | -| \*[OHOS::Media::OH_AudioEncoder_CreateByMime](#oh_audioencoder_createbymime) (const char \*mime) | Creates an audio encoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases.| -| \*[OHOS::Media::OH_AudioEncoder_CreateByName](#oh_audioencoder_createbyname) (const char \*name) | Creates an audio encoder instance based on an encoder name. To use this function, you must know the exact name of the encoder.| -| [OHOS::Media::OH_AudioEncoder_Destroy](#oh_audioencoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of an audio encoder and destroys the encoder instance.| -| [OHOS::Media::OH_AudioEncoder_SetCallback](#oh_audioencoder_setcallback) (OH_AVCodec \*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio encoder.| -| [OHOS::Media::OH_AudioEncoder_Configure](#oh_audioencoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures an audio encoder. Typically, you need to configure the description information about the audio track to be encoded.| -| [OHOS::Media::OH_AudioEncoder_Prepare](#oh_audioencoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for an audio encoder. This function must be called after **Configure**.| -| [OHOS::Media::OH_AudioEncoder_Start](#oh_audioencoder_start) (OH_AVCodec \*codec) | Starts an audio encoder. This function can be called only after the encoder is prepared successfully.| -| [OHOS::Media::OH_AudioEncoder_Stop](#oh_audioencoder_stop) (OH_AVCodec \*codec) | Stops an audio encoder.| -| [OHOS::Media::OH_AudioEncoder_Flush](#oh_audioencoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of an audio encoder.| -| [OHOS::Media::OH_AudioEncoder_Reset](#oh_audioencoder_reset) (OH_AVCodec \*codec) | Resets an audio encoder.| -| \*[OHOS::Media::OH_AudioEncoder_GetOutputDescription](#oh_audioencoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the description information about the output data of an audio encoder. For details, see **OH_AVFormat**.| -| [OHOS::Media::OH_AudioEncoder_SetParameter](#oh_audioencoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio encoder.| -| [OHOS::Media::OH_AudioEncoder_PushInputData](#oh_audioencoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio encoder.| -| [OHOS::Media::OH_AudioEncoder_FreeOutputData](#oh_audioencoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of an audio encoder.| -| [OHOS::Media::OH_AudioEncoder_IsValid](#oh_audioencoder_isvalid) (OH_AVCodec \*codec, bool \*isValid) | Checks whether an audio encoder instance is valid.| - +| Name | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | +| \*[OHOS::Media::OH_AudioEncoder_CreateByMime](#oh_audioencoder_createbymime) (const char \*mime) | Creates an audio encoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases. | +| \*[OHOS::Media::OH_AudioEncoder_CreateByName](#oh_audioencoder_createbyname) (const char \*name) | Creates an audio encoder instance based on an encoder name. To use this function, you must know the exact name of the encoder. | +| [OHOS::Media::OH_AudioEncoder_Destroy](#oh_audioencoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of an audio encoder and destroys the encoder instance. | +| [OHOS::Media::OH_AudioEncoder_SetCallback](#oh_audioencoder_setcallback) (OH_AVCodec \*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio encoder. | +| [OHOS::Media::OH_AudioEncoder_Configure](#oh_audioencoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures an audio encoder. Typically, you need to configure the description information about the audio track to be encoded. | +| [OHOS::Media::OH_AudioEncoder_Prepare](#oh_audioencoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for an audio encoder. This function must be called after **Configure**. | +| [OHOS::Media::OH_AudioEncoder_Start](#oh_audioencoder_start) (OH_AVCodec \*codec) | Starts an audio encoder. This function can be called only after the encoder is prepared successfully. | +| [OHOS::Media::OH_AudioEncoder_Stop](#oh_audioencoder_stop) (OH_AVCodec \*codec) | Stops an audio encoder. | +| [OHOS::Media::OH_AudioEncoder_Flush](#oh_audioencoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of an audio encoder. | +| [OHOS::Media::OH_AudioEncoder_Reset](#oh_audioencoder_reset) (OH_AVCodec \*codec) | Resets an audio encoder. | +| \*[OHOS::Media::OH_AudioEncoder_GetOutputDescription](#oh_audioencoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the description information about the output data of an audio encoder. For details, see **OH_AVFormat**.| +| [OHOS::Media::OH_AudioEncoder_SetParameter](#oh_audioencoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio encoder. | +| [OHOS::Media::OH_AudioEncoder_PushInputData](#oh_audioencoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio encoder. | +| [OHOS::Media::OH_AudioEncoder_FreeOutputData](#oh_audioencoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of an audio encoder. | +| [OHOS::Media::OH_AudioEncoder_IsValid](#oh_audioencoder_isvalid) (OH_AVCodec \*codec, bool \*isValid) | Checks whether an audio encoder instance is valid. | ## Function Description - ### OH_AudioEncoder_Configure() - ``` OH_AVErrCode OHOS::Media::OH_AudioEncoder_Configure (OH_AVCodec * codec, OH_AVFormat * format ) ``` @@ -63,10 +56,10 @@ This function must be called prior to **Prepare**. **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| format | Pointer to an **OH_AVFormat** instance, which provides the description information about the audio track to be encoded.| +| Name | Description | +| ------ | --------------------------------------------------- | +| codec | Pointer to an **OH_AVCodec** instance. | +| format | Pointer to an **OH_AVFormat** instance, which provides the description information about the audio track to be encoded.| **Returns** @@ -76,10 +69,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioEncoder_CreateByMime() - ``` OH_AVCodec* OHOS::Media::OH_AudioEncoder_CreateByMime (const char * mime) ``` @@ -92,9 +83,9 @@ Creates an audio encoder instance based on a MIME type. This function is recomme **Parameters** -| Name| Description| -| -------- | -------- | -| mime | Pointer to a string that describes the MIME type. For details, see **AVCODEC_MIME_TYPE**.| +| Name| Description | +| ---- | ------------------------------------------------------- | +| mime | Pointer to a string that describes the MIME type. For details, see **AVCODEC_MIME_TYPE**.| **Returns** @@ -104,10 +95,8 @@ Returns the pointer to an **OH_AVCodec** instance. 9 - ### OH_AudioEncoder_CreateByName() - ``` OH_AVCodec* OHOS::Media::OH_AudioEncoder_CreateByName (const char * name) ``` @@ -120,9 +109,9 @@ Creates an audio encoder instance based on an encoder name. To use this function **Parameters** -| Name| Description| -| -------- | -------- | -| name | Pointer to an audio encoder name.| +| Name| Description | +| ---- | ---------------- | +| name | Pointer to an audio encoder name.| **Returns** @@ -132,10 +121,8 @@ Returns the pointer to an **OH_AVCodec** instance. 9 - ### OH_AudioEncoder_Destroy() - ``` OH_AVErrCode OHOS::Media::OH_AudioEncoder_Destroy (OH_AVCodec * codec) ``` @@ -148,9 +135,9 @@ Clears the internal resources of an audio encoder and destroys the encoder insta **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| Name | Description | +| ----- | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -160,10 +147,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioEncoder_Flush() - ``` OH_AVErrCode OHOS::Media::OH_AudioEncoder_Flush (OH_AVCodec * codec) ``` @@ -178,9 +163,9 @@ This function invalidates the indexes of all buffers previously reported through **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| Name | Description | +| ----- | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -190,10 +175,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioEncoder_FreeOutputData() - ``` OH_AVErrCode OHOS::Media::OH_AudioEncoder_FreeOutputData (OH_AVCodec * codec, uint32_t index ) ``` @@ -206,10 +189,10 @@ Frees an output buffer of an audio encoder. **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| index | Index of the output buffer.| +| Name | Description | +| ----- | ------------------------------ | +| codec | Pointer to an **OH_AVCodec** instance. | +| index | Index of the output buffer.| **Returns** @@ -219,10 +202,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioEncoder_GetOutputDescription() - ``` OH_AVFormat* OHOS::Media::OH_AudioEncoder_GetOutputDescription (OH_AVCodec * codec) ``` @@ -237,9 +218,9 @@ The caller must manually release the **OH_AVFormat** instance in the return valu **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| Name | Description | +| ----- | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -249,10 +230,8 @@ Returns the handle to an **OH_AVFormat** instance. The lifecycle of this instanc 9 - ### OH_AudioEncoder_IsValid() - ``` OH_AVErrCode OHOS::Media::OH_AudioEncoder_IsValid (OH_AVCodec * codec, bool * isValid ) ``` @@ -265,10 +244,10 @@ Checks whether an audio encoder instance is valid. **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| isValid | Pointer to an instance of the Boolean type. The value **true** means that the encoder instance is valid and **false** means the opposite.| +| Name | Description | +| ------- | ----------------------------------------------------------------- | +| codec | Pointer to an **OH_AVCodec** instance. | +| isValid | Pointer to an instance of the Boolean type. The value **true** means that the encoder instance is valid and **false** means the opposite.| **Returns** @@ -278,10 +257,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 10 - ### OH_AudioEncoder_Prepare() - ``` OH_AVErrCode OHOS::Media::OH_AudioEncoder_Prepare (OH_AVCodec * codec) ``` @@ -294,9 +271,9 @@ Prepares internal resources for an audio encoder. This function must be called a **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| Name | Description | +| ----- | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -306,10 +283,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioEncoder_PushInputData() - ``` OH_AVErrCode OHOS::Media::OH_AudioEncoder_PushInputData (OH_AVCodec * codec, uint32_t index, OH_AVCodecBufferAttr attr ) ``` @@ -324,11 +299,11 @@ The **OH_AVCodecOnNeedInputData** callback reports the available input buffer an **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| index | Index of the input buffer.| -| attr | Description information about the data in the buffer.| +| Name | Description | +| ----- | ------------------------------ | +| codec | Pointer to an **OH_AVCodec** instance. | +| index | Index of the input buffer.| +| attr | Description information about the data in the buffer.| **Returns** @@ -338,10 +313,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioEncoder_Reset() - ``` OH_AVErrCode OHOS::Media::OH_AudioEncoder_Reset (OH_AVCodec * codec) ``` @@ -354,18 +327,16 @@ Resets an audio encoder. To continue encoding, you must call **Configure** to co **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| Name | Description | +| ----- | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** Returns **AV_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode) otherwise. - ### OH_AudioEncoder_SetCallback() - ``` OH_AVErrCode OHOS::Media::OH_AudioEncoder_SetCallback (OH_AVCodec * codec, OH_AVCodecAsyncCallback callback, void * userData ) ``` @@ -380,11 +351,11 @@ This function must be called prior to **Prepare**. **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| callback | Callback function to set. For details, see **OH_AVCodecAsyncCallback**.| -| userData | User-specific data.| +| Name | Description | +| -------- | ------------------------------------------------------------- | +| codec | Pointer to an **OH_AVCodec** instance. | +| callback | Callback function to set. For details, see **OH_AVCodecAsyncCallback**.| +| userData | User-specific data. | **Returns** @@ -394,10 +365,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioEncoder_SetParameter() - ``` OH_AVErrCode OHOS::Media::OH_AudioEncoder_SetParameter (OH_AVCodec * codec, OH_AVFormat * format ) ``` @@ -412,10 +381,10 @@ This function can be called only after the encoder is started. Incorrect paramet **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| format | Handle to an **OH_AVFormat** instance.| +| Name | Description | +| ------ | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| +| format | Handle to an **OH_AVFormat** instance. | **Returns** @@ -425,10 +394,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioEncoder_Start() - ``` OH_AVErrCode OHOS::Media::OH_AudioEncoder_Start (OH_AVCodec * codec) ``` @@ -443,9 +410,9 @@ After being started, the encoder starts to report the **OH_AVCodecOnNeedInputDat **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| Name | Description | +| ----- | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -455,10 +422,8 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi 9 - ### OH_AudioEncoder_Stop() - ``` OH_AVErrCode OHOS::Media::OH_AudioEncoder_Stop (OH_AVCodec * codec) ``` @@ -471,9 +436,9 @@ Stops an audio encoder. After the encoder is stopped, you can call **Start** to **Parameters** -| Name| Description| -| -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| Name | Description | +| ----- | -------------------------- | +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** diff --git a/en/application-dev/reference/native-apis/_codec_base.md b/en/application-dev/reference/native-apis/_codec_base.md index 613927e330..4872cdc17e 100644 --- a/en/application-dev/reference/native-apis/_codec_base.md +++ b/en/application-dev/reference/native-apis/_codec_base.md @@ -17,125 +17,125 @@ The **CodecBase** module provides the common structs, character constants, and e ### Files -| Name| Description| +| Name| Description| | -------- | -------- | -| [native_avcodec_base.h](native__avcodec__base_8h.md) | Declares the common structs, character constants, and enums for running **OH_AVCodec** instances.
File to include: \| +| [native_avcodec_base.h](native__avcodec__base_8h.md) | Declares the common structs, character constants, and enums for running **OH_AVCodec** instances.
**File to include**:
**Library**: libnative_media_codecbase.so| ### Structs -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) | Defines the description information about the buffer of an **OH_AVCodec** instance.| -| [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) | Defines all the asynchronous callback function pointers of an **OH_AVCodec** instance.| +| [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) | Defines the description information about the buffer of an **OH_AVCodec** instance.| +| [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) | Defines all the asynchronous callback function pointers of an **OH_AVCodec** instance.| ### Types -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_AVCodecBufferFlags](#oh_avcodecbufferflags) | Defines an enum that enumerates the flags for the buffer of an **OH_AVCodec** instance.| -| [OH_AVOutputFormat](#oh_avoutputformat) | Defines an enum that enumerates the output file formats of a muxer.| -| [OH_AVCodecBufferAttr](#oh_avcodecbufferattr) | Defines a struct for the description information about the buffer of an **OH_AVCodec** instance.| -| (\*[OH_AVCodecOnError](#oh_avcodeconerror)) (OH_AVCodec \*codec, int32_t errorCode, void \*userData) | Defines the pointer to the function that is called to report error information when an error occurs during the running of an **OH_AVCodec** instance.| -| (\*[OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged)) (OH_AVCodec \*codec, OH_AVFormat \*format, void \*userData) | Defines the pointer to the function that is called to report the new stream description when the output stream changes.| -| (\*[OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata)) (OH_AVCodec \*codec, uint32_t index, OH_AVMemory \*data, void \*userData) | Defines the pointer to the function that is called when new input data is required during the running of an **OH_AVCodec** instance. The function carries a buffer to fill in new input data.| -| (\*[OH_AVCodecOnNewOutputData](#oh_avcodeconnewoutputdata)) (OH_AVCodec \*codec, uint32_t index, OH_AVMemory \*data, [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) \*attr, void \*userData) | Defines the pointer to the function that is called when new output data is generated during the running of an **OH_AVCodec** instance. The function carries a buffer filled with new output data.| -| [OH_AVCodecAsyncCallback](#oh_avcodecasynccallback) | Defines a struct for all the asynchronous callback function pointers of an **OH_AVCodec** instance.| -| [OH_MediaType](#oh_mediatype) | Defines an enum that enumerates the media types.| -| [OH_AVCProfile](#oh_avcprofile) | Defines an enum that enumerates the Advanced Video Coding (AVC) profiles.| -| [OH_HEVCProfile](#oh_hevcprofile) | Defines an enum that enumerates the High Efficiency Video Coding (HEVC) profiles.| -| [OH_AACProfile](#oh_aacprofile) | Defines an enum that enumerates the Advanced Audio Coding (AAC) profiles.| -| [OH_AVSeekMode](#oh_avseekmode) | Defines an enum that enumerates the seek modes.| -| [OH_ColorPrimary](#oh_colorprimary) | Defines an enum that enumerates the primary colors.| -| [OH_TransferCharacteristic](#oh_transfercharacteristic) | Defines an enum that enumerates the transfer characteristics.| -| [OH_MatrixCoefficient](#oh_matrixcoefficient) | Defines an enum that enumerates the matrix coefficients.| -| [OH_BitsPerSample](#oh_bitspersample) | Defines an enum that enumerates the number of audio bits for each coded sample.| +| [OH_AVCodecBufferFlags](#oh_avcodecbufferflags) | Defines an enum that enumerates the flags for the buffer of an **OH_AVCodec** instance.| +| [OH_AVOutputFormat](#oh_avoutputformat) | Defines an enum that enumerates the output file formats of a muxer.| +| [OH_AVCodecBufferAttr](#oh_avcodecbufferattr) | Defines a struct for the description information about the buffer of an **OH_AVCodec** instance.| +| (\*[OH_AVCodecOnError](#oh_avcodeconerror)) (OH_AVCodec \*codec, int32_t errorCode, void \*userData) | Defines the pointer to the function that is called to report error information when an error occurs during the running of an **OH_AVCodec** instance.| +| (\*[OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged)) (OH_AVCodec \*codec, OH_AVFormat \*format, void \*userData) | Defines the pointer to the function that is called to report the new stream description when the output stream changes.| +| (\*[OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata)) (OH_AVCodec \*codec, uint32_t index, OH_AVMemory \*data, void \*userData) | Defines the pointer to the function that is called when new input data is required during the running of an **OH_AVCodec** instance. The function carries a buffer to fill in new input data.| +| (\*[OH_AVCodecOnNewOutputData](#oh_avcodeconnewoutputdata)) (OH_AVCodec \*codec, uint32_t index, OH_AVMemory \*data, [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) \*attr, void \*userData) | Defines the pointer to the function that is called when new output data is generated during the running of an **OH_AVCodec** instance. The function carries a buffer filled with new output data.| +| [OH_AVCodecAsyncCallback](#oh_avcodecasynccallback) | Defines a struct for all the asynchronous callback function pointers of an **OH_AVCodec** instance.| +| [OH_MediaType](#oh_mediatype) | Defines an enum that enumerates the media types.| +| [OH_AVCProfile](#oh_avcprofile) | Defines an enum that enumerates the Advanced Video Coding (AVC) profiles.| +| [OH_HEVCProfile](#oh_hevcprofile) | Defines an enum that enumerates the High Efficiency Video Coding (HEVC) profiles.| +| [OH_AACProfile](#oh_aacprofile) | Defines an enum that enumerates the Advanced Audio Coding (AAC) profiles.| +| [OH_AVSeekMode](#oh_avseekmode) | Defines an enum that enumerates the seek modes.| +| [OH_ColorPrimary](#oh_colorprimary) | Defines an enum that enumerates the primary colors.| +| [OH_TransferCharacteristic](#oh_transfercharacteristic) | Defines an enum that enumerates the transfer characteristics.| +| [OH_MatrixCoefficient](#oh_matrixcoefficient) | Defines an enum that enumerates the matrix coefficients.| +| [OH_BitsPerSample](#oh_bitspersample) | Defines an enum that enumerates the number of audio bits for each coded sample.| ### Enums -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_AVCodecBufferFlags](#oh_avcodecbufferflags) {
**AVCODEC_BUFFER_FLAGS_NONE** = 0, **AVCODEC_BUFFER_FLAGS_EOS** = 1 << 0, **AVCODEC_BUFFER_FLAGS_SYNC_FRAME** = 1 << 1, **AVCODEC_BUFFER_FLAGS_INCOMPLETE_FRAME** = 1 << 2,
**AVCODEC_BUFFER_FLAGS_CODEC_DATA** = 1 << 3
} | Enumerates the flags for the buffer of an **OH_AVCodec** instance.| -| [OH_AVOutputFormat](#oh_avoutputformat) { **AV_OUTPUT_FORMAT_DEFAULT** = 0, **AV_OUTPUT_FORMAT_MPEG_4** = 2, **AV_OUTPUT_FORMAT_M4A** = 6 } | Enumerates the output file formats of a muxer.| -| [OH_MediaType](#oh_mediatype) { **MEDIA_TYPE_AUD** = 0, **MEDIA_TYPE_VID** = 1 } | Enumerates the media types.| -| [OH_AVCProfile](#oh_avcprofile) { **AVC_PROFILE_BASELINE** = 0, **AVC_PROFILE_HIGH** = 4, **AVC_PROFILE_MAIN** = 8 } | Enumerates the AVC profiles.| -| [OH_HEVCProfile](#oh_hevcprofile) {
**HEVC_PROFILE_MAIN** = 0, **HEVC_PROFILE_MAIN_10** = 1, **HEVC_PROFILE_MAIN_STILL** = 2, **HEVC_PROFILE_MAIN_10_HDR10** = 3,
**HEVC_PROFILE_MAIN_10_HDR10_PLUS** = 4
} | Enumerates the HEVC profiles.| -| [OH_AACProfile](#oh_aacprofile) { **AAC_PROFILE_LC** = 0 } | Enumerates the AAC profiles.| -| [OH_AVSeekMode](#oh_avseekmode) { **SEEK_MODE_NEXT_SYNC** = 0, **SEEK_MODE_PREVIOUS_SYNC**, **SEEK_MODE_CLOSEST_SYNC** } | Enumerates the seek modes.| -| [OH_ColorPrimary](#oh_colorprimary) {
**COLOR_PRIMARY_BT709** = 1, **COLOR_PRIMARY_UNSPECIFIED** = 2, **COLOR_PRIMARY_BT470_M** = 4, **COLOR_PRIMARY_BT601_625** = 5,
**COLOR_PRIMARY_BT601_525** = 6, **COLOR_PRIMARY_SMPTE_ST240** = 7, **COLOR_PRIMARY_GENERIC_FILM** = 8, **COLOR_PRIMARY_BT2020** = 9,
**COLOR_PRIMARY_SMPTE_ST428** = 10, **COLOR_PRIMARY_P3DCI** = 11, **COLOR_PRIMARY_P3D65** = 12
} | Enumerates the primary colors.| -| [OH_TransferCharacteristic](#oh_transfercharacteristic) {
**TRANSFER_CHARACTERISTIC_BT709** = 1, **TRANSFER_CHARACTERISTIC_UNSPECIFIED** = 2, **TRANSFER_CHARACTERISTIC_GAMMA_2_2** = 4, **TRANSFER_CHARACTERISTIC_GAMMA_2_8** = 5,
**TRANSFER_CHARACTERISTIC_BT601** = 6, **TRANSFER_CHARACTERISTIC_SMPTE_ST240** = 7, **TRANSFER_CHARACTERISTIC_LINEAR** = 8, **TRANSFER_CHARACTERISTIC_LOG** = 9,
**TRANSFER_CHARACTERISTIC_LOG_SQRT** = 10, **TRANSFER_CHARACTERISTIC_IEC_61966_2_4** = 11, **TRANSFER_CHARACTERISTIC_BT1361** = 12, **TRANSFER_CHARACTERISTIC_IEC_61966_2_1** = 13,
**TRANSFER_CHARACTERISTIC_BT2020_10BIT** = 14, **TRANSFER_CHARACTERISTIC_BT2020_12BIT** = 15, **TRANSFER_CHARACTERISTIC_PQ** = 16, **TRANSFER_CHARACTERISTIC_SMPTE_ST428** = 17,
**TRANSFER_CHARACTERISTIC_HLG** = 18
} | Enumerates the transfer characteristics.| -| [OH_MatrixCoefficient](#oh_matrixcoefficient) {
**MATRIX_COEFFICIENT_IDENTITY** = 0, **MATRIX_COEFFICIENT_BT709** = 1, **MATRIX_COEFFICIENT_UNSPECIFIED** = 2, **MATRIX_COEFFICIENT_FCC** = 4,
**MATRIX_COEFFICIENT_BT601_625** = 5, **MATRIX_COEFFICIENT_BT601_525** = 6, **MATRIX_COEFFICIENT_SMPTE_ST240** = 7, **MATRIX_COEFFICIENT_YCGCO** = 8,
**MATRIX_COEFFICIENT_BT2020_NCL** = 9, **MATRIX_COEFFICIENT_BT2020_CL** = 10, **MATRIX_COEFFICIENT_SMPTE_ST2085** = 11, **MATRIX_COEFFICIENT_CHROMATICITY_NCL** = 12,
**MATRIX_COEFFICIENT_CHROMATICITY_CL** = 13, **MATRIX_COEFFICIENT_ICTCP** = 14
} | Enumerates the matrix coefficients.| -| [OH_BitsPerSample](#oh_bitspersample) {
**SAMPLE_U8** = 0, **SAMPLE_S16LE** = 1, **SAMPLE_S24LE** = 2, **SAMPLE_S32LE** = 3,
**SAMPLE_F32LE** = 4, **SAMPLE_U8P** = 5, **SAMPLE_S16P** = 6, **SAMPLE_S24P** = 7,
**SAMPLE_S32P** = 8, **SAMPLE_F32P** = 9, **INVALID_WIDTH** = -1
} | Enumerates the number of audio bits for each coded sample.| +| [OH_AVCodecBufferFlags](#oh_avcodecbufferflags) {
    **AVCODEC_BUFFER_FLAGS_NONE** = 0,
    **AVCODEC_BUFFER_FLAGS_EOS** = 1 << 0,
    **AVCODEC_BUFFER_FLAGS_SYNC_FRAME** = 1 << 1,
    **AVCODEC_BUFFER_FLAGS_INCOMPLETE_FRAME** = 1 << 2,
    **AVCODEC_BUFFER_FLAGS_CODEC_DATA** = 1 << 3
} | Enumerates the flags for the buffer of an **OH_AVCodec** instance. | +| [OH_AVOutputFormat](#oh_avoutputformat) {
    **AV_OUTPUT_FORMAT_DEFAULT** = 0,
    **AV_OUTPUT_FORMAT_MPEG_4** = 2,
    **AV_OUTPUT_FORMAT_M4A** = 6
} | Enumerates the output file formats of a muxer. | +| [OH_MediaType](#oh_mediatype) {
    **MEDIA_TYPE_AUD** = 0,
    **MEDIA_TYPE_VID** = 1
} | Enumerates the media types. | +| [OH_AVCProfile](#oh_avcprofile) {
    **AVC_PROFILE_BASELINE** = 0,
    **AVC_PROFILE_HIGH** = 4,
    **AVC_PROFILE_MAIN** = 8
} | Enumerates the AVC profiles. | +| [OH_HEVCProfile](#oh_hevcprofile) {
    **HEVC_PROFILE_MAIN** = 0,
    **HEVC_PROFILE_MAIN_10** = 1,
    **HEVC_PROFILE_MAIN_STILL** = 2,
    **HEVC_PROFILE_MAIN_10_HDR10** = 3,
    **HEVC_PROFILE_MAIN_10_HDR10_PLUS** = 4
} | Enumerates the HEVC profiles. | +| [OH_AACProfile](#oh_aacprofile) {
    **AAC_PROFILE_LC** = 0
} | Enumerates the AAC profiles. | +| [OH_AVSeekMode](#oh_avseekmode) {
    **SEEK_MODE_NEXT_SYNC** = 0,
    **SEEK_MODE_PREVIOUS_SYNC**,
    **SEEK_MODE_CLOSEST_SYNC**
} | Enumerates the seek modes. | +| [OH_ColorPrimary](#oh_colorprimary) {
    **COLOR_PRIMARY_BT709** = 1,
    **COLOR_PRIMARY_UNSPECIFIED** = 2,
    **COLOR_PRIMARY_BT470_M** = 4,
    **COLOR_PRIMARY_BT601_625** = 5,
    **COLOR_PRIMARY_BT601_525** = 6,
    **COLOR_PRIMARY_SMPTE_ST240** = 7,
    **COLOR_PRIMARY_GENERIC_FILM** = 8,
    **COLOR_PRIMARY_BT2020** = 9,
    **COLOR_PRIMARY_SMPTE_ST428** = 10,
    **COLOR_PRIMARY_P3DCI** = 11,
    **COLOR_PRIMARY_P3D65** = 12
} | Enumerates the primary colors.| +| [OH_TransferCharacteristic](#oh_transfercharacteristic) {
    **TRANSFER_CHARACTERISTIC_BT709** = 1,
    **TRANSFER_CHARACTERISTIC_UNSPECIFIED** = 2,
    **TRANSFER_CHARACTERISTIC_GAMMA_2_2** = 4,
    **TRANSFER_CHARACTERISTIC_GAMMA_2_8** = 5,
    **TRANSFER_CHARACTERISTIC_BT601** = 6,
    **TRANSFER_CHARACTERISTIC_SMPTE_ST240** = 7,
    **TRANSFER_CHARACTERISTIC_LINEAR** = 8,
    **TRANSFER_CHARACTERISTIC_LOG** = 9,
    **TRANSFER_CHARACTERISTIC_LOG_SQRT** = 10,
    **TRANSFER_CHARACTERISTIC_IEC_61966_2_4** = 11,
    **TRANSFER_CHARACTERISTIC_BT1361** = 12,
    **TRANSFER_CHARACTERISTIC_IEC_61966_2_1** = 13,
    **TRANSFER_CHARACTERISTIC_BT2020_10BIT** = 14,
    **TRANSFER_CHARACTERISTIC_BT2020_12BIT** = 15,
    **TRANSFER_CHARACTERISTIC_PQ** = 16,
    **TRANSFER_CHARACTERISTIC_SMPTE_ST428** = 17,
    **TRANSFER_CHARACTERISTIC_HLG** = 18
} | Enumerates the transfer characteristics.| +| [OH_MatrixCoefficient](#oh_matrixcoefficient) {
    **MATRIX_COEFFICIENT_IDENTITY** = 0,
    **MATRIX_COEFFICIENT_BT709** = 1,
    **MATRIX_COEFFICIENT_UNSPECIFIED** = 2,
    **MATRIX_COEFFICIENT_FCC** = 4,
    **MATRIX_COEFFICIENT_BT601_625** = 5,
    **MATRIX_COEFFICIENT_BT601_525** = 6,
    **MATRIX_COEFFICIENT_SMPTE_ST240** = 7,
    **MATRIX_COEFFICIENT_YCGCO** = 8,
    **MATRIX_COEFFICIENT_BT2020_NCL** = 9,
    **MATRIX_COEFFICIENT_BT2020_CL** = 10,
    **MATRIX_COEFFICIENT_SMPTE_ST2085** = 11,
    **MATRIX_COEFFICIENT_CHROMATICITY_NCL** = 12,
    **MATRIX_COEFFICIENT_CHROMATICITY_CL** = 13,
    **MATRIX_COEFFICIENT_ICTCP** = 14
} | Enumerates the matrix coefficients.| +| [OH_BitsPerSample](#oh_bitspersample) {
    **SAMPLE_U8** = 0,
    **SAMPLE_S16LE** = 1,
    **SAMPLE_S24LE** = 2,
    **SAMPLE_S32LE** = 3,
    **SAMPLE_F32LE** = 4,
    **SAMPLE_U8P** = 5,
    **SAMPLE_S16P** = 6,
    **SAMPLE_S24P** = 7,
    **SAMPLE_S32P** = 8,
    **SAMPLE_F32P** = 9,
    **INVALID_WIDTH** = -1
} | Enumerates the number of audio bits for each coded sample.| ### Variables -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_AVCodecBufferAttr::pts](_o_h___a_v_codec_buffer_attr.md#pts) | Defines the display timestamp of the buffer, in microseconds.| -| [OH_AVCodecBufferAttr::size](_o_h___a_v_codec_buffer_attr.md#size) | Defines the size of data contained in the buffer, in bytes.| -| [OH_AVCodecBufferAttr::offset](_o_h___a_v_codec_buffer_attr.md#offset) | Defines the offset of valid data in the buffer.| -| [OH_AVCodecBufferAttr::flags](_o_h___a_v_codec_buffer_attr.md#flags) | Defines the flags of the buffer. It is a combination of multiple [OH_AVCodecBufferFlags](#oh_avcodecbufferflags).| -| [OH_AVCodecAsyncCallback::onError](_o_h___a_v_codec_async_callback.md#onerror) | Defines the callback used to report a codec operation error. For details, see [OH_AVCodecOnError](#oh_avcodeconerror).| -| [OH_AVCodecAsyncCallback::onStreamChanged](_o_h___a_v_codec_async_callback.md#onstreamchanged) | Defines the callback used to report a codec stream change. For details, see [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged).| -| [OH_AVCodecAsyncCallback::onNeedInputData](_o_h___a_v_codec_async_callback.md#onneedinputdata) | Defines the callback used to report input data required. For details, see [OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata).| -| [OH_AVCodecAsyncCallback::onNeedOutputData](_o_h___a_v_codec_async_callback.md#onneedinputdata) | Defines the callback used to report output data generated. For details, see [OH_AVCodecOnNewOutputData](#oh_avcodeconnewoutputdata).| -| \*[OH_AVCODEC_MIMETYPE_VIDEO_AVC](#oh_avcodec_mimetype_video_avc) | Defines the pointer to the Multipurpose Internet Mail Extension (MIME) type for AVC video codec.| -| \*[OH_AVCODEC_MIMETYPE_AUDIO_AAC](#oh_avcodec_mimetype_audio_aac) | Defines the pointer to the MIME type for AAC audio codec.| -| \*[OH_AVCODEC_MIMETYPE_VIDEO_MPEG4](#oh_avcodec_mimetype_video_mpeg4) | Defines the pointer to the MIME type for MPEG4 video codec.| -| \*[OH_AVCODEC_MIMETYPE_VIDEO_HEVC](#oh_avcodec_mimetype_video_hevc) | Defines the pointer to the MIME type for HEVC video codec.| -| \*[OH_AVCODEC_MIMETYPE_AUDIO_MPEG](#oh_avcodec_mimetype_audio_mpeg) | Defines the pointer to the MIME type for MPEG audio codec.| -| \*[OH_AVCODEC_MIMETYPE_IMAGE_JPG](#oh_avcodec_mimetype_image_jpg) | Defines the pointer to the MIME type for JPG image codec.| -| \*[OH_AVCODEC_MIMETYPE_IMAGE_PNG](#oh_avcodec_mimetype_image_png) | Defines the pointer to the MIME type for PNG image codec.| -| \*[OH_AVCODEC_MIMETYPE_IMAGE_BMP](#oh_avcodec_mimetype_image_bmp) | Defines the pointer to the MIME type for BMP image codec.| -| \*[OH_AVCODEC_MIMETYPE_AUDIO_FLAC](#oh_avcodec_mimetype_audio_flac) | Defines the pointer to the MIME type for FLAC audio codec.| -| \*[OH_AVCODEC_MIMETYPE_AUDIO_VORBIS](#oh_avcodec_mimetype_audio_vorbis) | Defines the pointer to the MIME type for VORBIS audio codec.| -| \*[OH_ED_KEY_TIME_STAMP](#oh_ed_key_time_stamp) | Defines the pointer to the timestamp in the extra data of the surface. The value type is int64.| -| \*[OH_ED_KEY_EOS](#oh_ed_key_eos) | Defines the pointer to the end of stream (EOS) in the extra data of the surface. The value type is Boolean.| -| \*[OH_MD_KEY_TRACK_TYPE](#oh_md_key_track_type) | Defines the pointer to a container for storing media descriptions.| -| \*[OH_MD_KEY_CODEC_MIME](#oh_md_key_codec_mime) | Define the pointer to the MIME type of codec. The value is a string.| -| \*[OH_MD_KEY_DURATION](#oh_md_key_duration) | Defines the pointer to the duration. The value type is int64_t.| -| \*[OH_MD_KEY_BITRATE](#oh_md_key_bitrate) | Defines the pointer to the bit rate. The value type is uint32_t.| -| \*[OH_MD_KEY_MAX_INPUT_SIZE](#oh_md_key_max_input_size) | Defines the pointer to the maximum input size. The value type is uint32_t.| -| \*[OH_MD_KEY_WIDTH](#oh_md_key_width) | Defines the pointer to the video width. The value type is uint32_t.| -| \*[OH_MD_KEY_HEIGHT](#oh_md_key_height) | Defines the pointer to the video height. The value type is uint32_t.| -| \*[OH_MD_KEY_PIXEL_FORMAT](#oh_md_key_pixel_format) | Defines the pointer to the video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat).| -| \*[OH_MD_KEY_RANGE_FLAG](#oh_md_key_range_flag) | Defines the pointer to the video YUV value range flag. The value type is Boolean.| -| \*[OH_MD_KEY_COLOR_PRIMARIES](#oh_md_key_color_primaries) | Defines the pointer to the primary color of the video. The value type is int32_t.| -| \*[OH_MD_KEY_TRANSFER_CHARACTERISTICS](#oh_md_key_transfer_characteristics) | Defines the pointer to the video transfer characteristics. The value type is int32_t.| -| \*[OH_MD_KEY_MATRIX_COEFFICIENTS](#oh_md_key_matrix_coefficients) | Defines the pointer to the video matrix coefficient. The value type is int32_t.| -| \*[OH_MD_KEY_AUDIO_SAMPLE_FORMAT](#oh_md_key_audio_sample_format) | Defines the pointer to the original audio format. The value type is uint32_t.| -| \*[OH_MD_KEY_FRAME_RATE](#oh_md_key_frame_rate) | Defines the pointer to the video frame rate. The value is a double-precision floating point number.| -| \*[OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE](#oh_md_key_video_encode_bitrate_mode) | Defines the pointer to the video encoding bit rate mode. The value type is int32_t. For details, see [OH_VideoEncodeBitrateMode](_video_encoder.md#oh_videoencodebitratemode).| -| \*[OH_MD_KEY_PROFILE](#oh_md_key_profile) | Defines the pointer to the encoding template. The value is a number. For details, see [OH_AVCProfile](#oh_avcprofile), [OH_AACProfile](#oh_aacprofile), or [OH_HEVCProfile](#oh_hevcprofile).| -| \*[OH_MD_KEY_AUD_CHANNEL_COUNT](#oh_md_key_aud_channel_count) | Defines the pointer to the number of audio channels. The value type is uint32_t.| -| \*[OH_MD_KEY_AUD_SAMPLE_RATE](#oh_md_key_aud_sample_rate) | Defines the pointer to the audio sampling rate. The value type is uint32_t.| -| \*[OH_MD_KEY_I_FRAME_INTERVAL](#oh_md_key_i_frame_interval) | Defines the pointer to the key frame interval, in milliseconds. The value type is int32_t.| -| \*[OH_MD_KEY_ROTATION](#oh_md_key_rotation) | Defines the pointer to the rotation angle of the surface. The value type is int32_t, and the value range is {0, 90, 180, 270}. The default value is 0.| -| \*[OH_MD_KEY_CODEC_CONFIG](#oh_md_key_codec_config) | Defines the pointer to the codec-specific data. The value type is uint8_t\*.| -| \*[OH_MD_KEY_REQUEST_I_FRAME](#oh_md_key_request_i_frame) | Defines the pointer to the request for immediate encoding of I-frames. The value type is Boolean.| -| \*[OH_MD_KEY_QUALITY](#oh_md_key_quality) | Defines the pointer to the required encoding quality. The value type is uint32_t. This key applies only to encoders configured in constant quality mode.| -| \*[OH_MD_KEY_CHANNEL_LAYOUT](#oh_md_key_channel_layout) | Defines the pointer to the required encoding channel layout. The value type is int64_t. This key applies only to encoders.| -| \*[OH_MD_KEY_BITS_PER_CODED_SAMPLE](#oh_md_key_bits_per_coded_sample) | Defines the pointer to the number of bits for each coded sample. The value type is uint32_t. This key applies to FLAC encoders. For details, see **\@OH_BitsPerSample**.| -| \*[OH_MD_KEY_AAC_IS_ADTS](#oh_md_key_aac_is_adts) | Defines the pointer to the AAC format. The value type is uint32_t. This key applies to AAC decoders.| -| \*[OH_MD_KEY_SBR](#oh_md_key_sbr) | Defines the pointer to the AAC SBR format. The value type is uint32_t. This key applies to AAC encoders.| -| \*[OH_MD_KEY_COMPLIANCE_LEVEL](#oh_md_key_compliance_level) | Defines the pointer to the FLAC compliance level. The value type is int32_t.| -| \*[OH_MD_KEY_IDENTIFICATION_HEADER](#oh_md_key_identification_header) | Defines the pointer to the VORBIS identification header. The value type is uint8_t\*. This key applies only to VORBIS decoders.| -| \*[OH_MD_KEY_SETUP_HEADER](#oh_md_key_setup_header) | Defines the pointer to the VORBIS setup header. The value type is uint8_t\*. This key applies only to VORBIS decoders.| -| \*[OH_MD_KEY_TITLE](#oh_md_key_title) | Defines the pointer to the title of the input media. The value is a string.| -| \*[OH_MD_KEY_ARTIST](#oh_md_key_artist) | Defines the pointer to the artist of the input media. The value is a string.| -| \*[OH_MD_KEY_ALBUM](#oh_md_key_album) | Defines the pointer to the album of the input media. The value is a string.| -| \*[OH_MD_KEY_ALBUM_ARTIST](#oh_md_key_album_artist) | Defines the pointer to the album_artist of the input media. The value is a string.| -| \*[OH_MD_KEY_DATE](#oh_md_key_date) | Defines the pointer to the date of the input media. The value is a string.| -| \*[OH_MD_KEY_COMMENT](#oh_md_key_comment) | Defines the pointer to the comment of the input media. The value is a string.| -| \*[OH_MD_KEY_GENRE](#oh_md_key_genre) | Defines the pointer to the genre of the input media. The value is a string.| -| \*[OH_MD_KEY_COPYRIGHT](#oh_md_key_copyright) | Defines the pointer to the copyright of the input media. The value is a string.| -| \*[OH_MD_KEY_LANGUAGE](#oh_md_key_language) | Defines the pointer to the language of the input media. The value is a string.| -| \*[OH_MD_KEY_DESCRIPTION](#oh_md_key_description) | Defines the pointer to the description of the input media. The value is a string.| -| \*[OH_MD_KEY_LYRICS](#oh_md_key_lyrics) | Defines the pointer to the lyrics of the input media. The value is a string.| -| \*[OH_MD_KEY_TRACK_COUNT](#oh_md_key_track_count) | Defines the pointer to the track count of the input media. The value type is uint32_t.| +| [OH_AVCodecBufferAttr::pts](_o_h___a_v_codec_buffer_attr.md#pts) | Defines the display timestamp of the buffer, in microseconds.| +| [OH_AVCodecBufferAttr::size](_o_h___a_v_codec_buffer_attr.md#size) | Defines the size of data contained in the buffer, in bytes.| +| [OH_AVCodecBufferAttr::offset](_o_h___a_v_codec_buffer_attr.md#offset) | Defines the offset of valid data in the buffer.| +| [OH_AVCodecBufferAttr::flags](_o_h___a_v_codec_buffer_attr.md#flags) | Defines the flags of the buffer. It is a combination of multiple [OH_AVCodecBufferFlags](#oh_avcodecbufferflags).| +| [OH_AVCodecAsyncCallback::onError](_o_h___a_v_codec_async_callback.md#onerror) | Defines the callback used to report a codec operation error. For details, see [OH_AVCodecOnError](#oh_avcodeconerror).| +| [OH_AVCodecAsyncCallback::onStreamChanged](_o_h___a_v_codec_async_callback.md#onstreamchanged) | Defines the callback used to report a codec stream change. For details, see [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged).| +| [OH_AVCodecAsyncCallback::onNeedInputData](_o_h___a_v_codec_async_callback.md#onneedinputdata) | Defines the callback used to report input data required. For details, see [OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata).| +| [OH_AVCodecAsyncCallback::onNeedOutputData](_o_h___a_v_codec_async_callback.md#onneedinputdata) | Defines the callback used to report output data generated. For details, see [OH_AVCodecOnNewOutputData](#oh_avcodeconnewoutputdata).| +| \*[OH_AVCODEC_MIMETYPE_VIDEO_AVC](#oh_avcodec_mimetype_video_avc) | Defines the pointer to the Multipurpose Internet Mail Extension (MIME) type for AVC video codec.| +| \*[OH_AVCODEC_MIMETYPE_AUDIO_AAC](#oh_avcodec_mimetype_audio_aac) | Defines the pointer to the MIME type for AAC audio codec.| +| \*[OH_AVCODEC_MIMETYPE_VIDEO_MPEG4](#oh_avcodec_mimetype_video_mpeg4) | Defines the pointer to the MIME type for MPEG4 video codec.| +| \*[OH_AVCODEC_MIMETYPE_VIDEO_HEVC](#oh_avcodec_mimetype_video_hevc) | Defines the pointer to the MIME type for HEVC video codec.| +| \*[OH_AVCODEC_MIMETYPE_AUDIO_MPEG](#oh_avcodec_mimetype_audio_mpeg) | Defines the pointer to the MIME type for MPEG audio codec.| +| \*[OH_AVCODEC_MIMETYPE_IMAGE_JPG](#oh_avcodec_mimetype_image_jpg) | Defines the pointer to the MIME type for JPG image codec.| +| \*[OH_AVCODEC_MIMETYPE_IMAGE_PNG](#oh_avcodec_mimetype_image_png) | Defines the pointer to the MIME type for PNG image codec.| +| \*[OH_AVCODEC_MIMETYPE_IMAGE_BMP](#oh_avcodec_mimetype_image_bmp) | Defines the pointer to the MIME type for BMP image codec.| +| \*[OH_AVCODEC_MIMETYPE_AUDIO_FLAC](#oh_avcodec_mimetype_audio_flac) | Defines the pointer to the MIME type for FLAC audio codec.| +| \*[OH_AVCODEC_MIMETYPE_AUDIO_VORBIS](#oh_avcodec_mimetype_audio_vorbis) | Defines the pointer to the MIME type for VORBIS audio codec.| +| \*[OH_ED_KEY_TIME_STAMP](#oh_ed_key_time_stamp) | Defines the pointer to the timestamp in the extra data of the surface. The value type is int64.| +| \*[OH_ED_KEY_EOS](#oh_ed_key_eos) | Defines the pointer to the end of stream (EOS) in the extra data of the surface. The value type is Boolean.| +| \*[OH_MD_KEY_TRACK_TYPE](#oh_md_key_track_type) | Defines the pointer to a container for storing media descriptions.| +| \*[OH_MD_KEY_CODEC_MIME](#oh_md_key_codec_mime) | Define the pointer to the MIME type of codec. The value is a string.| +| \*[OH_MD_KEY_DURATION](#oh_md_key_duration) | Defines the pointer to the duration. The value type is int64_t.| +| \*[OH_MD_KEY_BITRATE](#oh_md_key_bitrate) | Defines the pointer to the bit rate. The value type is uint32_t.| +| \*[OH_MD_KEY_MAX_INPUT_SIZE](#oh_md_key_max_input_size) | Defines the pointer to the maximum input size. The value type is uint32_t.| +| \*[OH_MD_KEY_WIDTH](#oh_md_key_width) | Defines the pointer to the video width. The value type is uint32_t.| +| \*[OH_MD_KEY_HEIGHT](#oh_md_key_height) | Defines the pointer to the video height. The value type is uint32_t.| +| \*[OH_MD_KEY_PIXEL_FORMAT](#oh_md_key_pixel_format) | Defines the pointer to the video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat).| +| \*[OH_MD_KEY_RANGE_FLAG](#oh_md_key_range_flag) | Defines the pointer to the video YUV value range flag. The value type is Boolean.| +| \*[OH_MD_KEY_COLOR_PRIMARIES](#oh_md_key_color_primaries) | Defines the pointer to the primary color of the video. The value type is int32_t.| +| \*[OH_MD_KEY_TRANSFER_CHARACTERISTICS](#oh_md_key_transfer_characteristics) | Defines the pointer to the video transfer characteristics. The value type is int32_t.| +| \*[OH_MD_KEY_MATRIX_COEFFICIENTS](#oh_md_key_matrix_coefficients) | Defines the pointer to the video matrix coefficient. The value type is int32_t.| +| \*[OH_MD_KEY_AUDIO_SAMPLE_FORMAT](#oh_md_key_audio_sample_format) | Defines the pointer to the original audio format. The value type is uint32_t.| +| \*[OH_MD_KEY_FRAME_RATE](#oh_md_key_frame_rate) | Defines the pointer to the video frame rate. The value is a double-precision floating point number.| +| \*[OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE](#oh_md_key_video_encode_bitrate_mode) | Defines the pointer to the video encoding bit rate mode. The value type is int32_t. For details, see [OH_VideoEncodeBitrateMode](_video_encoder.md#oh_videoencodebitratemode).| +| \*[OH_MD_KEY_PROFILE](#oh_md_key_profile) | Defines the pointer to the encoding template. The value is a number. For details, see [OH_AVCProfile](#oh_avcprofile), [OH_AACProfile](#oh_aacprofile), or [OH_HEVCProfile](#oh_hevcprofile).| +| \*[OH_MD_KEY_AUD_CHANNEL_COUNT](#oh_md_key_aud_channel_count) | Defines the pointer to the number of audio channels. The value type is uint32_t.| +| \*[OH_MD_KEY_AUD_SAMPLE_RATE](#oh_md_key_aud_sample_rate) | Defines the pointer to the audio sampling rate. The value type is uint32_t.| +| \*[OH_MD_KEY_I_FRAME_INTERVAL](#oh_md_key_i_frame_interval) | Defines the pointer to the key frame interval, in milliseconds. The value type is int32_t.| +| \*[OH_MD_KEY_ROTATION](#oh_md_key_rotation) | Defines the pointer to the rotation angle of the surface. The value type is int32_t, and the value range is {0, 90, 180, 270}. The default value is 0.| +| \*[OH_MD_KEY_CODEC_CONFIG](#oh_md_key_codec_config) | Defines the pointer to the codec-specific data. The value type is uint8_t\*.| +| \*[OH_MD_KEY_REQUEST_I_FRAME](#oh_md_key_request_i_frame) | Defines the pointer to the request for immediate encoding of I-frames. The value type is Boolean.| +| \*[OH_MD_KEY_QUALITY](#oh_md_key_quality) | Defines the pointer to the required encoding quality. The value type is uint32_t. This key applies only to encoders configured in constant quality mode.| +| \*[OH_MD_KEY_CHANNEL_LAYOUT](#oh_md_key_channel_layout) | Defines the pointer to the required encoding channel layout. The value type is int64_t. This key applies only to encoders.| +| \*[OH_MD_KEY_BITS_PER_CODED_SAMPLE](#oh_md_key_bits_per_coded_sample) | Defines the pointer to the number of bits for each coded sample. The value type is uint32_t. This key applies to FLAC encoders. For details, see **\@OH_BitsPerSample**.| +| \*[OH_MD_KEY_AAC_IS_ADTS](#oh_md_key_aac_is_adts) | Defines the pointer to the AAC format. The value type is uint32_t. This key applies to AAC decoders.| +| \*[OH_MD_KEY_SBR](#oh_md_key_sbr) | Defines the pointer to the AAC SBR format. The value type is uint32_t. This key applies to AAC encoders.| +| \*[OH_MD_KEY_COMPLIANCE_LEVEL](#oh_md_key_compliance_level) | Defines the pointer to the FLAC compliance level. The value type is int32_t.| +| \*[OH_MD_KEY_IDENTIFICATION_HEADER](#oh_md_key_identification_header) | Defines the pointer to the VORBIS identification header. The value type is uint8_t\*. This key applies only to VORBIS decoders.| +| \*[OH_MD_KEY_SETUP_HEADER](#oh_md_key_setup_header) | Defines the pointer to the VORBIS setup header. The value type is uint8_t\*. This key applies only to VORBIS decoders.| +| \*[OH_MD_KEY_TITLE](#oh_md_key_title) | Defines the pointer to the title of the input media. The value is a string.| +| \*[OH_MD_KEY_ARTIST](#oh_md_key_artist) | Defines the pointer to the artist of the input media. The value is a string.| +| \*[OH_MD_KEY_ALBUM](#oh_md_key_album) | Defines the pointer to the album of the input media. The value is a string.| +| \*[OH_MD_KEY_ALBUM_ARTIST](#oh_md_key_album_artist) | Defines the pointer to the album_artist of the input media. The value is a string.| +| \*[OH_MD_KEY_DATE](#oh_md_key_date) | Defines the pointer to the date of the input media. The value is a string.| +| \*[OH_MD_KEY_COMMENT](#oh_md_key_comment) | Defines the pointer to the comment of the input media. The value is a string.| +| \*[OH_MD_KEY_GENRE](#oh_md_key_genre) | Defines the pointer to the genre of the input media. The value is a string.| +| \*[OH_MD_KEY_COPYRIGHT](#oh_md_key_copyright) | Defines the pointer to the copyright of the input media. The value is a string.| +| \*[OH_MD_KEY_LANGUAGE](#oh_md_key_language) | Defines the pointer to the language of the input media. The value is a string.| +| \*[OH_MD_KEY_DESCRIPTION](#oh_md_key_description) | Defines the pointer to the description of the input media. The value is a string.| +| \*[OH_MD_KEY_LYRICS](#oh_md_key_lyrics) | Defines the pointer to the lyrics of the input media. The value is a string.| +| \*[OH_MD_KEY_TRACK_COUNT](#oh_md_key_track_count) | Defines the pointer to the track count of the input media. The value type is uint32_t.| ## Type Description @@ -143,9 +143,9 @@ The **CodecBase** module provides the common structs, character constants, and e ### OH_AACProfile - + ``` -typedef enum OH_AACProfileOH_AACProfile +typedef enum OH_AACProfile OH_AACProfile ``` **Description** @@ -157,9 +157,9 @@ Defines an enum that enumerates the AAC profiles. ### OH_AVCodecAsyncCallback - + ``` -typedef struct OH_AVCodecAsyncCallbackOH_AVCodecAsyncCallback +typedef struct OH_AVCodecAsyncCallback OH_AVCodecAsyncCallback ``` **Description** @@ -170,19 +170,19 @@ Defines a struct for all the asynchronous callback function pointers of an **OH_ **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| [onError](_o_h___a_v_codec_async_callback.md#onerror) | Callback used to report a codec operation error. For details, see [OH_AVCodecOnError](#oh_avcodeconerror).| -| [onStreamChanged](_o_h___a_v_codec_async_callback.md#onstreamchanged) | Callback used to report a codec stream change. For details, see [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged).| -| [onNeedInputData](_o_h___a_v_codec_async_callback.md#onneedinputdata) | Callback used to report input data required. For details, see [OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata).| -| [onNeedOutputData](_o_h___a_v_codec_async_callback.md#onneedoutputdata) | Callback used to report output data generated. For details, see [OH_AVCodecOnNewOutputData](#oh_avcodeconnewoutputdata).| +| [onError](_o_h___a_v_codec_async_callback.md#onerror) | Callback used to report a codec operation error. For details, see [OH_AVCodecOnError](#oh_avcodeconerror).| +| [onStreamChanged](_o_h___a_v_codec_async_callback.md#onstreamchanged) | Callback used to report a codec stream change. For details, see [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged).| +| [onNeedInputData](_o_h___a_v_codec_async_callback.md#onneedinputdata) | Callback used to report input data required. For details, see [OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata).| +| [onNeedOutputData](_o_h___a_v_codec_async_callback.md#onneedoutputdata) | Callback used to report output data generated. For details, see [OH_AVCodecOnNewOutputData](#oh_avcodeconnewoutputdata).| ### OH_AVCodecBufferAttr - + ``` -typedef struct OH_AVCodecBufferAttrOH_AVCodecBufferAttr +typedef struct OH_AVCodecBufferAttr OH_AVCodecBufferAttr ``` **Description** @@ -194,9 +194,9 @@ Defines a struct for the description information about the buffer of an **OH_AVC ### OH_AVCodecBufferFlags - + ``` -typedef enum OH_AVCodecBufferFlagsOH_AVCodecBufferFlags +typedef enum OH_AVCodecBufferFlags OH_AVCodecBufferFlags ``` **Description** @@ -208,9 +208,9 @@ Defines an enum that enumerates the flags for the buffer of an **OH_AVCodec** in ### OH_AVCodecOnError - + ``` -typedef void(* OH_AVCodecOnError) (OH_AVCodec *codec, int32_t errorCode, void *userData) +typedef void (*OH_AVCodecOnError) (OH_AVCodec *codec, int32_t errorCode, void *userData) ``` **Description** @@ -221,18 +221,18 @@ Defines the pointer to the function that is called to report error information w **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| errorCode | Error code.| -| userData | Pointer to user-specific data.| +| codec | Pointer to an **OH_AVCodec** instance.| +| errorCode | Error code.| +| userData | Pointer to user-specific data.| ### OH_AVCodecOnNeedInputData - + ``` -typedef void(* OH_AVCodecOnNeedInputData) (OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, void *userData) +typedef void (*OH_AVCodecOnNeedInputData) (OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, void *userData) ``` **Description** @@ -243,19 +243,19 @@ Defines the pointer to the function that is called when new input data is requir **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| index | Index of the new input buffer.| -| data | Pointer to the data to fill in the new input buffer.| -| userData | Pointer to user-specific data.| +| codec | Pointer to an **OH_AVCodec** instance.| +| index | Index of the new input buffer.| +| data | Pointer to the data to fill in the new input buffer.| +| userData | Pointer to user-specific data.| ### OH_AVCodecOnNewOutputData - + ``` -typedef void(* OH_AVCodecOnNewOutputData) (OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, OH_AVCodecBufferAttr *attr, void *userData) +typedef void (*OH_AVCodecOnNewOutputData) (OH_AVCodec *codec, uint32_t index, OH_AVMemory *data, OH_AVCodecBufferAttr *attr, void *userData) ``` **Description** @@ -266,20 +266,20 @@ Defines the pointer to the function that is called when new output data is gener **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| index | Index of the new output buffer.| -| data | Pointer to the data filled in the new output buffer.| -| attr | Pointer to the description information about the new output buffer. For details, see [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md).| -| userData | Pointer to user-specific data.| +| codec | Pointer to an **OH_AVCodec** instance.| +| index | Index of the new output buffer.| +| data | Pointer to the data filled in the new output buffer.| +| attr | Pointer to the description information about the new output buffer. For details, see [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md).| +| userData | Pointer to user-specific data.| ### OH_AVCodecOnStreamChanged - + ``` -typedef void(* OH_AVCodecOnStreamChanged) (OH_AVCodec *codec, OH_AVFormat *format, void *userData) +typedef void (*OH_AVCodecOnStreamChanged) (OH_AVCodec *codec, OH_AVFormat *format, void *userData) ``` **Description** @@ -290,18 +290,18 @@ Defines the pointer to the function that is called to report the new stream desc **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| format | Pointer to the description information about the new output stream.| -| userData | Pointer to user-specific data.| +| codec | Pointer to an **OH_AVCodec** instance.| +| format | Pointer to the description information about the new output stream.| +| userData | Pointer to user-specific data.| ### OH_AVCProfile - + ``` -typedef enum OH_AVCProfileOH_AVCProfile +typedef enum OH_AVCProfile OH_AVCProfile ``` **Description** @@ -313,9 +313,9 @@ Defines an enum that enumerates the AVC profiles. ### OH_AVOutputFormat - + ``` -typedef enum OH_AVOutputFormatOH_AVOutputFormat +typedef enum OH_AVOutputFormat OH_AVOutputFormat ``` **Description** @@ -325,9 +325,9 @@ Defines an enum that enumerates the output file formats of a muxer. ### OH_AVSeekMode - + ``` -typedef enum OH_AVSeekModeOH_AVSeekMode +typedef enum OH_AVSeekMode OH_AVSeekMode ``` **Description** @@ -339,9 +339,9 @@ Defines an enum that enumerates the seek modes. ### OH_BitsPerSample - + ``` -typedef enum OH_BitsPerSampleOH_BitsPerSample +typedef enum OH_BitsPerSample OH_BitsPerSample ``` **Description** @@ -353,9 +353,9 @@ Defines an enum that enumerates the number of audio bits for each coded sample. ### OH_ColorPrimary - + ``` -typedef enum OH_ColorPrimaryOH_ColorPrimary +typedef enum OH_ColorPrimary OH_ColorPrimary ``` **Description** @@ -367,9 +367,9 @@ Defines an enum that enumerates the primary colors. ### OH_HEVCProfile - + ``` -typedef enum OH_HEVCProfileOH_HEVCProfile +typedef enum OH_HEVCProfile OH_HEVCProfile ``` **Description** @@ -381,9 +381,9 @@ Defines an enum that enumerates the HEVC profiles. ### OH_MatrixCoefficient - + ``` -typedef enum OH_MatrixCoefficientOH_MatrixCoefficient +typedef enum OH_MatrixCoefficient OH_MatrixCoefficient ``` **Description** @@ -395,9 +395,9 @@ Defines an enum that enumerates the matrix coefficients. ### OH_MediaType - + ``` -typedef enum OH_MediaTypeOH_MediaType +typedef enum OH_MediaType OH_MediaType ``` **Description** @@ -409,9 +409,9 @@ Defines an enum that enumerates the media types. ### OH_TransferCharacteristic - + ``` -typedef enum OH_TransferCharacteristicOH_TransferCharacteristic +typedef enum OH_TransferCharacteristic OH_TransferCharacteristic ``` **Description** @@ -426,7 +426,7 @@ Defines an enum that enumerates the transfer characteristics. ### OH_AACProfile - + ``` enum OH_AACProfile ``` @@ -440,7 +440,7 @@ Enumerates the AAC profiles. ### OH_AVCodecBufferFlags - + ``` enum OH_AVCodecBufferFlags ``` @@ -454,7 +454,7 @@ Enumerates the flags for the buffer of an **OH_AVCodec** instance. ### OH_AVCProfile - + ``` enum OH_AVCProfile ``` @@ -468,7 +468,7 @@ Enumerates the AVC profiles. ### OH_AVOutputFormat - + ``` enum OH_AVOutputFormat ``` @@ -480,7 +480,7 @@ Enumerates the output file formats of a muxer. ### OH_AVSeekMode - + ``` enum OH_AVSeekMode ``` @@ -494,7 +494,7 @@ Enumerates the seek modes. ### OH_BitsPerSample - + ``` enum OH_BitsPerSample ``` @@ -508,7 +508,7 @@ Enumerates the number of audio bits for each coded sample. ### OH_ColorPrimary - + ``` enum OH_ColorPrimary ``` @@ -522,7 +522,7 @@ Enumerates the primary colors. ### OH_HEVCProfile - + ``` enum OH_HEVCProfile ``` @@ -536,7 +536,7 @@ Enumerates the HEVC profiles. ### OH_MatrixCoefficient - + ``` enum OH_MatrixCoefficient ``` @@ -550,7 +550,7 @@ Enumerates the matrix coefficients. ### OH_MediaType - + ``` enum OH_MediaType ``` @@ -564,7 +564,7 @@ Enumerates the media types. ### OH_TransferCharacteristic - + ``` enum OH_TransferCharacteristic ``` @@ -581,7 +581,7 @@ Enumerates the transfer characteristics. ### OH_AVCODEC_MIMETYPE_AUDIO_AAC - + ``` const char* OH_AVCODEC_MIMETYPE_AUDIO_AAC ``` @@ -595,7 +595,7 @@ Defines the pointer to the MIME type for AAC audio codec. ### OH_AVCODEC_MIMETYPE_AUDIO_FLAC - + ``` const char* OH_AVCODEC_MIMETYPE_AUDIO_FLAC ``` @@ -609,7 +609,7 @@ Defines the pointer to the MIME type for FLAC audio codec. ### OH_AVCODEC_MIMETYPE_AUDIO_MPEG - + ``` const char* OH_AVCODEC_MIMETYPE_AUDIO_MPEG ``` @@ -623,7 +623,7 @@ Defines the pointer to the MIME type for MPEG audio codec. ### OH_AVCODEC_MIMETYPE_AUDIO_VORBIS - + ``` const char* OH_AVCODEC_MIMETYPE_AUDIO_VORBIS ``` @@ -637,7 +637,7 @@ Defines the pointer to the MIME type for VORBIS audio codec. ### OH_AVCODEC_MIMETYPE_IMAGE_BMP - + ``` const char* OH_AVCODEC_MIMETYPE_IMAGE_BMP ``` @@ -651,7 +651,7 @@ Defines the pointer to the MIME type for BMP image codec. ### OH_AVCODEC_MIMETYPE_IMAGE_JPG - + ``` const char* OH_AVCODEC_MIMETYPE_IMAGE_JPG ``` @@ -665,7 +665,7 @@ Defines the pointer to the MIME type for JPG image codec. ### OH_AVCODEC_MIMETYPE_IMAGE_PNG - + ``` const char* OH_AVCODEC_MIMETYPE_IMAGE_PNG ``` @@ -679,7 +679,7 @@ Defines the pointer to the MIME type for PNG image codec. ### OH_AVCODEC_MIMETYPE_VIDEO_AVC - + ``` const char* OH_AVCODEC_MIMETYPE_VIDEO_AVC ``` @@ -693,7 +693,7 @@ Defines the pointer to the MIME type for AVC video codec. ### OH_AVCODEC_MIMETYPE_VIDEO_HEVC - + ``` const char* OH_AVCODEC_MIMETYPE_VIDEO_HEVC ``` @@ -707,7 +707,7 @@ Defines the pointer to the MIME type for HEVC video codec. ### OH_AVCODEC_MIMETYPE_VIDEO_MPEG4 - + ``` const char* OH_AVCODEC_MIMETYPE_VIDEO_MPEG4 ``` @@ -721,7 +721,7 @@ Defines the pointer to the MIME type for MPEG4 video codec. ### OH_ED_KEY_EOS - + ``` const char* OH_ED_KEY_EOS ``` @@ -735,7 +735,7 @@ Defines the pointer to the EOS in the extra data of the surface. The value type ### OH_ED_KEY_TIME_STAMP - + ``` const char* OH_ED_KEY_TIME_STAMP ``` @@ -749,7 +749,7 @@ Defines the pointer to the timestamp in the extra data of the surface. The value ### OH_MD_KEY_AAC_IS_ADTS - + ``` const char* OH_MD_KEY_AAC_IS_ADTS ``` @@ -761,7 +761,7 @@ Defines the pointer to the AAC format. The value type is uint32_t. This key appl ### OH_MD_KEY_ALBUM - + ``` const char* OH_MD_KEY_ALBUM ``` @@ -773,7 +773,7 @@ Defines the pointer to the album of the input media. The value is a string. ### OH_MD_KEY_ALBUM_ARTIST - + ``` const char* OH_MD_KEY_ALBUM_ARTIST ``` @@ -785,7 +785,7 @@ Defines the pointer to the album_artist of the input media. The value is a strin ### OH_MD_KEY_ARTIST - + ``` const char* OH_MD_KEY_ARTIST ``` @@ -797,7 +797,7 @@ Defines the pointer to the artist of the input media. The value is a string. ### OH_MD_KEY_AUD_CHANNEL_COUNT - + ``` const char* OH_MD_KEY_AUD_CHANNEL_COUNT ``` @@ -809,7 +809,7 @@ Defines the pointer to the number of audio channels. The value type is uint32_t. ### OH_MD_KEY_AUD_SAMPLE_RATE - + ``` const char* OH_MD_KEY_AUD_SAMPLE_RATE ``` @@ -821,7 +821,7 @@ Defines the pointer to the audio sampling rate. The value type is uint32_t. ### OH_MD_KEY_AUDIO_SAMPLE_FORMAT - + ``` const char* OH_MD_KEY_AUDIO_SAMPLE_FORMAT ``` @@ -833,7 +833,7 @@ Defines the pointer to the original audio format. The value type is uint32_t. ### OH_MD_KEY_BITRATE - + ``` const char* OH_MD_KEY_BITRATE ``` @@ -845,7 +845,7 @@ Defines the pointer to the bit rate. The value type is uint32_t. ### OH_MD_KEY_BITS_PER_CODED_SAMPLE - + ``` const char* OH_MD_KEY_BITS_PER_CODED_SAMPLE ``` @@ -857,7 +857,7 @@ Defines the pointer to the number of bits for each coded sample. The value type ### OH_MD_KEY_CHANNEL_LAYOUT - + ``` const char* OH_MD_KEY_CHANNEL_LAYOUT ``` @@ -869,7 +869,7 @@ Defines the pointer to the required encoding channel layout. The value type is i ### OH_MD_KEY_CODEC_CONFIG - + ``` const char* OH_MD_KEY_CODEC_CONFIG ``` @@ -881,7 +881,7 @@ Defines the pointer to the codec-specific data. The value type is uint8_t\*. ### OH_MD_KEY_CODEC_MIME - + ``` const char* OH_MD_KEY_CODEC_MIME ``` @@ -893,7 +893,7 @@ Define the pointer to the MIME type of codec. The value is a string. ### OH_MD_KEY_COLOR_PRIMARIES - + ``` const char* OH_MD_KEY_COLOR_PRIMARIES ``` @@ -905,7 +905,7 @@ Defines the pointer to the primary color of the video. The value type is int32_t ### OH_MD_KEY_COMMENT - + ``` const char* OH_MD_KEY_COMMENT ``` @@ -917,7 +917,7 @@ Defines the pointer to the comment of the input media. The value is a string. ### OH_MD_KEY_COMPLIANCE_LEVEL - + ``` const char* OH_MD_KEY_COMPLIANCE_LEVEL ``` @@ -929,7 +929,7 @@ Defines the pointer to the FLAC compliance level. The value type is int32_t. ### OH_MD_KEY_COPYRIGHT - + ``` const char* OH_MD_KEY_COPYRIGHT ``` @@ -941,7 +941,7 @@ Defines the pointer to the copyright of the input media. The value is a string. ### OH_MD_KEY_DATE - + ``` const char* OH_MD_KEY_DATE ``` @@ -953,7 +953,7 @@ Defines the pointer to the date of the input media. The value is a string. ### OH_MD_KEY_DESCRIPTION - + ``` const char* OH_MD_KEY_DESCRIPTION ``` @@ -965,7 +965,7 @@ Defines the pointer to the description of the input media. The value is a string ### OH_MD_KEY_DURATION - + ``` const char* OH_MD_KEY_DURATION ``` @@ -977,7 +977,7 @@ Defines the pointer to the duration. The value type is int64_t. ### OH_MD_KEY_FRAME_RATE - + ``` const char* OH_MD_KEY_FRAME_RATE ``` @@ -989,7 +989,7 @@ Defines the pointer to the video frame rate. The value is a double-precision flo ### OH_MD_KEY_GENRE - + ``` const char* OH_MD_KEY_GENRE ``` @@ -1001,7 +1001,7 @@ Defines the pointer to the genre of the input media. The value is a string. ### OH_MD_KEY_HEIGHT - + ``` const char* OH_MD_KEY_HEIGHT ``` @@ -1013,7 +1013,7 @@ Defines the pointer to the video height. The value type is uint32_t. ### OH_MD_KEY_I_FRAME_INTERVAL - + ``` const char* OH_MD_KEY_I_FRAME_INTERVAL ``` @@ -1025,7 +1025,7 @@ Defines the pointer to the key frame interval, in milliseconds. The value type i ### OH_MD_KEY_IDENTIFICATION_HEADER - + ``` const char* OH_MD_KEY_IDENTIFICATION_HEADER ``` @@ -1037,7 +1037,7 @@ Defines the pointer to the VORBIS identification header. The value type is uint8 ### OH_MD_KEY_LANGUAGE - + ``` const char* OH_MD_KEY_LANGUAGE ``` @@ -1049,7 +1049,7 @@ Defines the pointer to the language of the input media. The value is a string. ### OH_MD_KEY_LYRICS - + ``` const char* OH_MD_KEY_LYRICS ``` @@ -1061,7 +1061,7 @@ Defines the pointer to the lyrics of the input media. The value is a string. ### OH_MD_KEY_MATRIX_COEFFICIENTS - + ``` const char* OH_MD_KEY_MATRIX_COEFFICIENTS ``` @@ -1073,7 +1073,7 @@ Defines the pointer to the video matrix coefficient. The value type is int32_t. ### OH_MD_KEY_MAX_INPUT_SIZE - + ``` const char* OH_MD_KEY_MAX_INPUT_SIZE ``` @@ -1085,7 +1085,7 @@ Defines the pointer to the maximum input size. The value type is uint32_t. ### OH_MD_KEY_PIXEL_FORMAT - + ``` const char* OH_MD_KEY_PIXEL_FORMAT ``` @@ -1097,7 +1097,7 @@ Defines the pointer to the video pixel format. The value type is int32_t. For de ### OH_MD_KEY_PROFILE - + ``` const char* OH_MD_KEY_PROFILE ``` @@ -1109,7 +1109,7 @@ Defines the pointer to the encoding template. The value is a number. For details ### OH_MD_KEY_QUALITY - + ``` const char* OH_MD_KEY_QUALITY ``` @@ -1121,7 +1121,7 @@ Defines the pointer to the required encoding quality. The value type is uint32_t ### OH_MD_KEY_RANGE_FLAG - + ``` const char* OH_MD_KEY_RANGE_FLAG ``` @@ -1133,7 +1133,7 @@ Defines the pointer to the video YUV value range flag. The value type is Boolean ### OH_MD_KEY_REQUEST_I_FRAME - + ``` const char* OH_MD_KEY_REQUEST_I_FRAME ``` @@ -1145,7 +1145,7 @@ Defines the pointer to the request for immediate encoding of I-frames. The value ### OH_MD_KEY_ROTATION - + ``` const char* OH_MD_KEY_ROTATION ``` @@ -1157,7 +1157,7 @@ Defines the pointer to the rotation angle of the surface. The value type is int3 ### OH_MD_KEY_SBR - + ``` const char* OH_MD_KEY_SBR ``` @@ -1169,7 +1169,7 @@ Defines the pointer to the AAC SBR format. The value type is uint32_t. This key ### OH_MD_KEY_SETUP_HEADER - + ``` const char* OH_MD_KEY_SETUP_HEADER ``` @@ -1181,7 +1181,7 @@ Defines the pointer to the VORBIS setup header. The value type is uint8_t\*. Thi ### OH_MD_KEY_TITLE - + ``` const char* OH_MD_KEY_TITLE ``` @@ -1193,7 +1193,7 @@ Defines the pointer to the title of the input media. The value is a string. ### OH_MD_KEY_TRACK_COUNT - + ``` const char* OH_MD_KEY_TRACK_COUNT ``` @@ -1205,7 +1205,7 @@ Defines the pointer to the track count of the input media. The value type is uin ### OH_MD_KEY_TRACK_TYPE - + ``` const char* OH_MD_KEY_TRACK_TYPE ``` @@ -1219,7 +1219,7 @@ Defines the pointer to a container for storing media descriptions. ### OH_MD_KEY_TRANSFER_CHARACTERISTICS - + ``` const char* OH_MD_KEY_TRANSFER_CHARACTERISTICS ``` @@ -1231,7 +1231,7 @@ Defines the pointer to the video transfer characteristics. The value type is int ### OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE - + ``` const char* OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE ``` @@ -1243,7 +1243,7 @@ Defines the pointer to the video encoding bit rate mode. The value type is int32 ### OH_MD_KEY_WIDTH - + ``` const char* OH_MD_KEY_WIDTH ``` diff --git a/en/application-dev/reference/native-apis/_core.md b/en/application-dev/reference/native-apis/_core.md index f4fbb00279..b437d1a68d 100644 --- a/en/application-dev/reference/native-apis/_core.md +++ b/en/application-dev/reference/native-apis/_core.md @@ -19,9 +19,9 @@ The **Core** module provides the basic backbone capabilities for the media playb | Name| Description| | -------- | -------- | -| [native_averrors.h](native__averrors_8h.md) | Declares the error codes used by the media playback framework.
File to include: \ | -| [native_avformat.h](native__avformat_8h.md) | Declares the format-related functions and enums.
File to include: \ | -| [native_avmemory.h](native__avmemory_8h.md) | Declares the memory-related functions.
File to include: \ | +| [native_averrors.h](native__averrors_8h.md) | Declares the error codes used by the media playback framework.
**File to include**:
**Library**: libnative_media_core.so| +| [native_avformat.h](native__avformat_8h.md) | Declares the format-related functions and enums.
**File to include**:
**Library**: libnative_media_core.so| +| [native_avmemory.h](native__avmemory_8h.md) | Declares the memory-related functions.
**File to include**:
**Library**: libnative_media_core.so| ### Types @@ -36,8 +36,8 @@ The **Core** module provides the basic backbone capabilities for the media playb | Name| Description| | -------- | -------- | -| [OH_AVErrCode](#oh_averrcode) {
AV_ERR_OK = 0, AV_ERR_NO_MEMORY = 1, AV_ERR_OPERATE_NOT_PERMIT = 2, AV_ERR_INVALID_VAL = 3,
AV_ERR_IO = 4, AV_ERR_TIMEOUT = 5, AV_ERR_UNKNOWN = 6, AV_ERR_SERVICE_DIED = 7,
AV_ERR_INVALID_STATE = 8, AV_ERR_UNSUPPORT = 9, AV_ERR_EXTEND_START = 100
} | Enumerates the audio and video error codes.| -| [OH_AVPixelFormat](#oh_avpixelformat) {
AV_PIXEL_FORMAT_YUVI420 = 1, AV_PIXEL_FORMAT_NV12 = 2, AV_PIXEL_FORMAT_NV21 = 3, AV_PIXEL_FORMAT_SURFACE_FORMAT = 4,
AV_PIXEL_FORMAT_RGBA = 5
} | Enumerates the video pixel formats.| +| [OH_AVErrCode](#oh_averrcode) {
    AV_ERR_OK = 0,
    AV_ERR_NO_MEMORY = 1,
    AV_ERR_OPERATE_NOT_PERMIT = 2,
    AV_ERR_INVALID_VAL = 3,
    AV_ERR_IO = 4,
    AV_ERR_TIMEOUT = 5,
    AV_ERR_UNKNOWN = 6,
    AV_ERR_SERVICE_DIED = 7,
    AV_ERR_INVALID_STATE = 8,
    AV_ERR_UNSUPPORT = 9,
    AV_ERR_EXTEND_START = 100
} | Enumerates the audio and video error codes.| +| [OH_AVPixelFormat](#oh_avpixelformat) {
    AV_PIXEL_FORMAT_YUVI420 = 1,
    AV_PIXEL_FORMAT_NV12 = 2,
    AV_PIXEL_FORMAT_NV21 = 3,
    AV_PIXEL_FORMAT_SURFACE_FORMAT = 4,
    AV_PIXEL_FORMAT_RGBA = 5
} | Enumerates the video pixel formats.| ### Functions @@ -75,7 +75,7 @@ The **Core** module provides the basic backbone capabilities for the media playb ``` -typedef enum OH_AVErrCodeOH_AVErrCode +typedef enum OH_AVErrCode OH_AVErrCode ``` **Description** @@ -93,7 +93,7 @@ Defines an enum that enumerates the audio and video error codes. ``` -typedef enum OH_AVPixelFormatOH_AVPixelFormat +typedef enum OH_AVPixelFormat OH_AVPixelFormat ``` **Description** @@ -175,7 +175,7 @@ Enumerates the video pixel formats. ``` -bool OH_AVFormat_Copy (struct OH_AVFormat * to, struct OH_AVFormat * from ) +bool OH_AVFormat_Copy (struct OH_AVFormat *to, struct OH_AVFormat *from) ``` **Description** @@ -204,7 +204,7 @@ Returns **true** if the operation is successful; returns **false** otherwise. ``` -struct OH_AVFormat* OH_AVFormat_Create (void ) +struct OH_AVFormat* OH_AVFormat_Create (void) ``` **Description** @@ -226,7 +226,7 @@ Returns the pointer to an **OH_AVFormat** instance. ``` -struct OH_AVFormat* OH_AVFormat_CreateAudioFormat (const char * mimeType, int32_t sampleRate, int32_t channelCount ) +struct OH_AVFormat* OH_AVFormat_CreateAudioFormat (const char *mimeType, int32_t sampleRate, int32_t channelCount) ``` **Description** @@ -256,7 +256,7 @@ Returns the pointer to an **OH_AVFormat** instance. ``` -struct OH_AVFormat* OH_AVFormat_CreateVideoFormat (const char * mimeType, int32_t width, int32_t height ) +struct OH_AVFormat* OH_AVFormat_CreateVideoFormat (const char *mimeType, int32_t width, int32_t height) ``` **Description** @@ -286,7 +286,7 @@ Returns the pointer to an **OH_AVFormat** instance. ``` -void OH_AVFormat_Destroy (struct OH_AVFormat * format) +void OH_AVFormat_Destroy (struct OH_AVFormat *format) ``` **Description** @@ -310,7 +310,7 @@ Destroys an **OH_AVFormat** instance. ``` -const char* OH_AVFormat_DumpInfo (struct OH_AVFormat * format) +const char* OH_AVFormat_DumpInfo (struct OH_AVFormat *format) ``` **Description** @@ -338,7 +338,7 @@ Returns the pointer to a collection of strings, each of which consists of a key ``` -bool OH_AVFormat_GetBuffer (struct OH_AVFormat * format, const char * key, uint8_t ** addr, size_t * size ) +bool OH_AVFormat_GetBuffer (struct OH_AVFormat *format, const char *key, uint8_t **addr, size_t *size) ``` **Description** @@ -369,7 +369,7 @@ Returns **true** if the operation is successful; returns **false** otherwise. ``` -bool OH_AVFormat_GetDoubleValue (struct OH_AVFormat * format, const char * key, double * out ) +bool OH_AVFormat_GetDoubleValue (struct OH_AVFormat *format, const char *key, double *out) ``` **Description** @@ -399,7 +399,7 @@ Returns **true** if the operation is successful; returns **false** otherwise. ``` -bool OH_AVFormat_GetFloatValue (struct OH_AVFormat * format, const char * key, float * out ) +bool OH_AVFormat_GetFloatValue (struct OH_AVFormat *format, const char *key, float *out) ``` **Description** @@ -429,7 +429,7 @@ Returns **true** if the operation is successful; returns **false** otherwise. ``` -bool OH_AVFormat_GetIntValue (struct OH_AVFormat * format, const char * key, int32_t * out ) +bool OH_AVFormat_GetIntValue (struct OH_AVFormat *format, const char *key, int32_t *out) ``` **Description** @@ -455,7 +455,7 @@ Returns **true** if the operation is successful; returns **false** otherwise. ``` -bool OH_AVFormat_GetLongValue (struct OH_AVFormat * format, const char * key, int64_t * out ) +bool OH_AVFormat_GetLongValue (struct OH_AVFormat *format, const char *key, int64_t *out) ``` **Description** @@ -485,7 +485,7 @@ Returns **true** if the operation is successful; returns **false** otherwise. ``` -bool OH_AVFormat_GetStringValue (struct OH_AVFormat * format, const char * key, const char ** out ) +bool OH_AVFormat_GetStringValue (struct OH_AVFormat *format, const char *key, const char **out) ``` **Description** @@ -515,7 +515,7 @@ Returns **true** if the operation is successful; returns **false** otherwise. ``` -bool OH_AVFormat_SetBuffer (struct OH_AVFormat * format, const char * key, const uint8_t * addr, size_t size ) +bool OH_AVFormat_SetBuffer (struct OH_AVFormat *format, const char *key, const uint8_t *addr, size_t size) ``` **Description** @@ -546,7 +546,7 @@ Returns **true** if the operation is successful; returns **false** otherwise. ``` -bool OH_AVFormat_SetDoubleValue (struct OH_AVFormat * format, const char * key, double value ) +bool OH_AVFormat_SetDoubleValue (struct OH_AVFormat *format, const char *key, double value) ``` **Description** @@ -576,7 +576,7 @@ Returns **true** if the operation is successful; returns **false** otherwise. ``` -bool OH_AVFormat_SetFloatValue (struct OH_AVFormat * format, const char * key, float value ) +bool OH_AVFormat_SetFloatValue (struct OH_AVFormat *format, const char *key, float value) ``` **Description** @@ -606,7 +606,7 @@ Returns **true** if the operation is successful; returns **false** otherwise. ``` -bool OH_AVFormat_SetIntValue (struct OH_AVFormat * format, const char * key, int32_t value ) +bool OH_AVFormat_SetIntValue (struct OH_AVFormat *format, const char *key, int32_t value) ``` **Description** @@ -636,7 +636,7 @@ Returns **true** if the operation is successful; returns **false** otherwise. ``` -bool OH_AVFormat_SetLongValue (struct OH_AVFormat * format, const char * key, int64_t value ) +bool OH_AVFormat_SetLongValue (struct OH_AVFormat *format, const char *key, int64_t value) ``` **Description** @@ -666,7 +666,7 @@ Returns **true** if the operation is successful; returns **false** otherwise. ``` -bool OH_AVFormat_SetStringValue (struct OH_AVFormat * format, const char * key, const char * value ) +bool OH_AVFormat_SetStringValue (struct OH_AVFormat *format, const char *key, const char *value) ``` **Description** @@ -724,7 +724,7 @@ Returns the pointer to the **OH_AVMemory** instance created if the operation is ``` -OH_AVErrCode OH_AVMemory_Destroy (struct OH_AVMemory * mem) +OH_AVErrCode OH_AVMemory_Destroy (struct OH_AVMemory *mem) ``` **Description** @@ -752,7 +752,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -uint8_t* OH_AVMemory_GetAddr (struct OH_AVMemory * mem) +uint8_t* OH_AVMemory_GetAddr (struct OH_AVMemory *mem) ``` **Description** @@ -780,7 +780,7 @@ Returns the pointer to the virtual memory address if the memory is valid; return ``` -int32_t OH_AVMemory_GetSize (struct OH_AVMemory * mem) +int32_t OH_AVMemory_GetSize (struct OH_AVMemory *mem) ``` **Description** diff --git a/en/application-dev/reference/native-apis/_o_h_audio.md b/en/application-dev/reference/native-apis/_o_h_audio.md index 6107a06b17..28358436b7 100644 --- a/en/application-dev/reference/native-apis/_o_h_audio.md +++ b/en/application-dev/reference/native-apis/_o_h_audio.md @@ -17,98 +17,98 @@ The **OHAudio** module provides native APIs of the audio module. ### Files -| Name| Description| +| Name| Description| | -------- | -------- | -| [native_audiocapturer.h](native__audiocapturer_8h.md) | Declares the functions related to an audio capturer.
**File to include**: <ohaudio/native_audiocapturer.h>
**Library**: libohaudio.so| -| [native_audiorenderer.h](native__audiorenderer_8h.md) | Declares the functions related to an audio renderer.
**File to include**: <ohaudio/native_audiorenderer.h>
**Library**: libohaudio.so| -| [native_audiostream_base.h](native__audiostream__base_8h.md) | Declares the basic data structure of **OHAudio**.
**File to include**: <ohaudio/native_audiostream_base.h>
**Library**: libohaudio.so| -| [native_audiostreambuilder.h](native__audiostreambuilder_8h.md) | Declares the functions related to the audio stream builder.
**File to include**: <ohaudio/native_audiostreambuilder.h>
**Library**: libohaudio.so| +| [native_audiocapturer.h](native__audiocapturer_8h.md) | Declares the functions related to an audio capturer.
**File to include**: <ohaudio/native_audiocapturer.h>
**Library**: libohaudio.so| +| [native_audiorenderer.h](native__audiorenderer_8h.md) | Declares the functions related to an audio renderer.
**File to include**: <ohaudio/native_audiorenderer.h>
**Library**: libohaudio.so| +| [native_audiostream_base.h](native__audiostream__base_8h.md) | Declares the basic data structure of **OHAudio**.
**File to include**: <ohaudio/native_audiostream_base.h>
**Library**: libohaudio.so| +| [native_audiostreambuilder.h](native__audiostreambuilder_8h.md) | Declares the functions related to the audio stream builder.
**File to include**: <ohaudio/native_audiostreambuilder.h>
**Library**: libohaudio.so| ### Structs -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_AudioRenderer_Callbacks_Struct](_o_h___audio_renderer___callbacks___struct.md) | Defines a pointer to the callback functions related to an audio renderer.| -| [OH_AudioCapturer_Callbacks_Struct](_o_h___audio_capturer___callbacks___struct.md) | Defines a pointer to the callback functions related to an audio capturer.| +| [OH_AudioRenderer_Callbacks_Struct](_o_h___audio_renderer___callbacks___struct.md) | Defines a pointer to the callback functions related to an audio renderer.| +| [OH_AudioCapturer_Callbacks_Struct](_o_h___audio_capturer___callbacks___struct.md) | Defines a pointer to the callback functions related to an audio capturer.| ### Types -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_AudioStreamBuilder](#oh_audiostreambuilder) | Defines an audio stream builder.| -| [OH_AudioRenderer](#oh_audiorenderer) | Defines an audio renderer.| -| [OH_AudioCapturer](#oh_audiocapturer) | Defines an audio capturer.| -| [OH_AudioRenderer_Callbacks](#oh_audiorenderer_callbacks) | Defines a pointer to the callback functions related to an audio renderer.| -| [OH_AudioCapturer_Callbacks](#oh_audiocapturer_callbacks) | Defines a pointer to the callback functions related to an audio capturer.| +| [OH_AudioStreamBuilder](#oh_audiostreambuilder) | Defines an audio stream builder.| +| [OH_AudioRenderer](#oh_audiorenderer) | Defines an audio renderer.| +| [OH_AudioCapturer](#oh_audiocapturer) | Defines an audio capturer.| +| [OH_AudioRenderer_Callbacks](#oh_audiorenderer_callbacks) | Defines a pointer to the callback functions related to an audio renderer.| +| [OH_AudioCapturer_Callbacks](#oh_audiocapturer_callbacks) | Defines a pointer to the callback functions related to an audio capturer.| ### Enums -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_AudioStream_Result](#oh_audiostream_result) { AUDIOSTREAM_SUCCESS, AUDIOSTREAM_ERROR_INVALID_PARAM, AUDIOSTREAM_ERROR_ILLEGAL_STATE, AUDIOSTREAM_ERROR_SYSTEM } | Enumerates the audio stream operation results.| -| [OH_AudioStream_Type](#oh_audiostream_type) { AUDIOSTREAM_TYPE_RENDERER = 1, AUDIOSTREAM_TYPE_CAPTURER = 2 } | Enumerates the audio stream types.| -| [OH_AudioStream_SampleFormat](#oh_audiostream_sampleformat) { AUDIOSTREAM_SAMPLE_U8 = 0, AUDIOSTREAM_SAMPLE_S16LE = 1, AUDIOSTREAM_SAMPLE_S24LE = 2, AUDIOSTREAM_SAMPLE_S32LE = 3 } | Enumerates the sampling formats of audio streams.| -| [OH_AudioStream_EncodingType](#oh_audiostream_encodingtype) { **AUDIOSTREAM_ENCODING_TYPE_RAW** = 0 } | Enumerates the encoding types of audio streams.| -| [OH_AudioStream_Usage](#oh_audiostream_usage) { **AUDIOSTREAM_USAGE_UNKNOWN** = 0, **AUDIOSTREAM_USAGE_MUSIC** = 1, **AUDIOSTREAM_USAGE_COMMUNICATION** = 2, **AUDIOSTREAM_USAGE_GAME** = 11 } | Enumerates the usage scenarios of audio output streams.| -| [OH_AudioStream_LatencyMode](#oh_audiostream_latencymode) { AUDIOSTREAM_LATENCY_MODE_NORMAL } | Enumerates the latency modes of audio streams.| -| [OH_AudioStream_State](#oh_audiostream_state) {
AUDIOSTREAM_STATE_INVALID = -1, AUDIOSTREAM_STATE_PREPARED = 1, AUDIOSTREAM_STATE_RUNNING = 2, AUDIOSTREAM_STATE_STOPPED = 3,
AUDIOSTREAM_STATE_RELEASED = 4, AUDIOSTREAM_STATE_PAUSED = 5
} | Enumerates the audio stream states.| -| [OH_AudioStream_SourceType](#oh_audiostream_sourcetype) { **AUDIOSTREAM_SOURCE_TYPE_INVALID** = -1, **AUDIOSTREAM_SOURCE_TYPE_MIC**, **AUDIOSTREAM_SOURCE_TYPE_VOICE_RECOGNITION** = 1, **AUDIOSTREAM_SOURCE_TYPE_VOICE_COMMUNICATION** = 7 } | Enumerates the usage scenarios of audio input streams.| +| [OH_AudioStream_Result](#oh_audiostream_result) { AUDIOSTREAM_SUCCESS, AUDIOSTREAM_ERROR_INVALID_PARAM, AUDIOSTREAM_ERROR_ILLEGAL_STATE, AUDIOSTREAM_ERROR_SYSTEM } | Enumerates the audio stream operation results.| +| [OH_AudioStream_Type](#oh_audiostream_type) { AUDIOSTREAM_TYPE_RENDERER = 1, AUDIOSTREAM_TYPE_CAPTURER = 2 } | Enumerates the audio stream types.| +| [OH_AudioStream_SampleFormat](#oh_audiostream_sampleformat) { AUDIOSTREAM_SAMPLE_U8 = 0, AUDIOSTREAM_SAMPLE_S16LE = 1, AUDIOSTREAM_SAMPLE_S24LE = 2, AUDIOSTREAM_SAMPLE_S32LE = 3 } | Enumerates the sampling formats of audio streams.| +| [OH_AudioStream_EncodingType](#oh_audiostream_encodingtype) { **AUDIOSTREAM_ENCODING_TYPE_RAW** = 0 } | Enumerates the encoding types of audio streams.| +| [OH_AudioStream_Usage](#oh_audiostream_usage) { **AUDIOSTREAM_USAGE_UNKNOWN** = 0, **AUDIOSTREAM_USAGE_MUSIC** = 1, **AUDIOSTREAM_USAGE_COMMUNICATION** = 2, **AUDIOSTREAM_USAGE_GAME** = 11 } | Enumerates the usage scenarios of audio output streams.| +| [OH_AudioStream_LatencyMode](#oh_audiostream_latencymode) { AUDIOSTREAM_LATENCY_MODE_NORMAL } | Enumerates the latency modes of audio streams.| +| [OH_AudioStream_State](#oh_audiostream_state) {
AUDIOSTREAM_STATE_INVALID = -1, AUDIOSTREAM_STATE_PREPARED = 1, AUDIOSTREAM_STATE_RUNNING = 2, AUDIOSTREAM_STATE_STOPPED = 3,
AUDIOSTREAM_STATE_RELEASED = 4, AUDIOSTREAM_STATE_PAUSED = 5
} | Enumerates the audio stream states.| +| [OH_AudioStream_SourceType](#oh_audiostream_sourcetype) { **AUDIOSTREAM_SOURCE_TYPE_INVALID** = -1, **AUDIOSTREAM_SOURCE_TYPE_MIC**, **AUDIOSTREAM_SOURCE_TYPE_VOICE_RECOGNITION** = 1, **AUDIOSTREAM_SOURCE_TYPE_VOICE_COMMUNICATION** = 7 } | Enumerates the usage scenarios of audio input streams.| ### Functions -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_AudioCapturer_Release](#oh_audiocapturer_release) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer) | Releases an audio capturer.| -| [OH_AudioCapturer_Start](#oh_audiocapturer_start) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer) | Starts an audio capturer.| -| [OH_AudioCapturer_Pause](#oh_audiocapturer_pause) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer) | Pauses an audio capturer.| -| [OH_AudioCapturer_Stop](#oh_audiocapturer_stop) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer) | Stops an audio capturer.| -| [OH_AudioCapturer_Flush](#oh_audiocapturer_flush) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer) | Flushes obtained audio data.| -| [OH_AudioCapturer_GetCurrentState](#oh_audiocapturer_getcurrentstate) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, [OH_AudioStream_State](#oh_audiostream_state) \*state) | Obtains the state of an audio stream.| -| [OH_AudioCapturer_GetLatencyMode](#oh_audiocapturer_getlatencymode) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, [OH_AudioStream_LatencyMode](#oh_audiostream_latencymode) \*latencyMode) | Obtains the latency mode of an audio stream.| -| [OH_AudioCapturer_GetStreamId](#oh_audiocapturer_getstreamid) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, uint32_t \*streamId) | Obtains the stream ID of an audio stream.| -| [OH_AudioCapturer_GetSamplingRate](#oh_audiocapturer_getsamplingrate) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, int32_t \*rate) | Obtains the sampling rate of an audio stream.| -| [OH_AudioCapturer_GetChannelCount](#oh_audiocapturer_getchannelcount) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, int32_t \*channelCount) | Obtains the number of channels for an audio stream.| -| [OH_AudioCapturer_GetSampleFormat](#oh_audiocapturer_getsampleformat) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, [OH_AudioStream_SampleFormat](#oh_audiostream_sampleformat) \*sampleFormat) | Obtains the sampling format of an audio stream.| -| [OH_AudioCapturer_GetEncodingType](#oh_audiocapturer_getencodingtype) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, [OH_AudioStream_EncodingType](#oh_audiostream_encodingtype) \*encodingType) | Obtains the encoding type of an audio stream.| -| [OH_AudioCapturer_GetCapturerInfo](#oh_audiocapturer_getcapturerinfo) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, [OH_AudioStream_SourceType](#oh_audiostream_sourcetype) \*sourceType) | Obtains the usage scenario of an audio renderer.| -| [OH_AudioRenderer_Release](#oh_audiorenderer_release) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer) | Releases an audio renderer.| -| [OH_AudioRenderer_Start](#oh_audiorenderer_start) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer) | Starts an audio renderer.| -| [OH_AudioRenderer_Pause](#oh_audiorenderer_pause) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer) | Pauses an audio renderer.| -| [OH_AudioRenderer_Stop](#oh_audiorenderer_stop) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer) | Stops an audio renderer.| -| [OH_AudioRenderer_Flush](#oh_audiorenderer_flush) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer) | Flushes written audio data.| -| [OH_AudioRenderer_GetCurrentState](#oh_audiorenderer_getcurrentstate) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, [OH_AudioStream_State](#oh_audiostream_state) \*state) | Obtains the state of an audio stream.| -| [OH_AudioRenderer_GetSamplingRate](#oh_audiorenderer_getsamplingrate) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, int32_t \*rate) | Obtains the sampling rate of an audio stream.| -| [OH_AudioRenderer_GetStreamId](#oh_audiorenderer_getstreamid) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, uint32_t \*streamId) | Obtains the stream ID of an audio stream.| -| [OH_AudioRenderer_GetChannelCount](#oh_audiorenderer_getchannelcount) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, int32_t \*channelCount) | Obtains the number of channels for an audio stream.| -| [OH_AudioRenderer_GetSampleFormat](#oh_audiorenderer_getsampleformat) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, [OH_AudioStream_SampleFormat](#oh_audiostream_sampleformat) \*sampleFormat) | Obtains the sampling format of an audio stream.| -| [OH_AudioRenderer_GetLatencyMode](#oh_audiorenderer_getlatencymode) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, [OH_AudioStream_LatencyMode](#oh_audiostream_latencymode) \*latencyMode) | Obtains the latency mode of an audio stream.| -| [OH_AudioRenderer_GetRendererInfo](#oh_audiorenderer_getrendererinfo) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, [OH_AudioStream_Usage](#oh_audiostream_usage) \*usage) | Obtains the usage scenario of an audio renderer.| -| [OH_AudioRenderer_GetEncodingType](#oh_audiorenderer_getencodingtype) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, [OH_AudioStream_EncodingType](#oh_audiostream_encodingtype) \*encodingType) | Obtains the encoding type of an audio stream.| -| [OH_AudioStreamBuilder_Create](#oh_audiostreambuilder_create) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*\*builder, [OH_AudioStream_Type](#oh_audiostream_type) type) | Creates an audio stream builder, which can be an audio renderer or capturer.| -| [OH_AudioStreamBuilder_Destroy](#oh_audiostreambuilder_destroy) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder) | Destroys an audio stream builder.| -| [OH_AudioStreamBuilder_SetSamplingRate](#oh_audiostreambuilder_setsamplingrate) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, int32_t rate) | Sets the sampling rate of an audio stream.| -| [OH_AudioStreamBuilder_SetChannelCount](#oh_audiostreambuilder_setchannelcount) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, int32_t channelCount) | Sets the number of channels for an audio stream.| -| [OH_AudioStreamBuilder_SetSampleFormat](#oh_audiostreambuilder_setsampleformat) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioStream_SampleFormat](#oh_audiostream_sampleformat) format) | Sets the sampling format of an audio stream.| -| [OH_AudioStreamBuilder_SetEncodingType](#oh_audiostreambuilder_setencodingtype) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioStream_EncodingType](#oh_audiostream_encodingtype) encodingType) | Sets the encoding type of an audio stream.| -| [OH_AudioStreamBuilder_SetLatencyMode](#oh_audiostreambuilder_setlatencymode) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioStream_LatencyMode](#oh_audiostream_latencymode) latencyMode) | Sets the latency mode of an audio stream.| -| [OH_AudioStreamBuilder_SetRendererInfo](#oh_audiostreambuilder_setrendererinfo) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioStream_Usage](#oh_audiostream_usage) usage) | Sets the usage scenario of an audio renderer.| -| [OH_AudioStreamBuilder_SetCapturerInfo](#oh_audiostreambuilder_setcapturerinfo) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioStream_SourceType](#oh_audiostream_sourcetype) sourceType) | Sets the usage scenario of an audio capturer.| -| [OH_AudioStreamBuilder_SetRendererCallback](#oh_audiostreambuilder_setrenderercallback) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioRenderer_Callbacks](#oh_audiorenderer_callbacks) callbacks, void \*userData) | Sets callbacks for an audio renderer.| -| [OH_AudioStreamBuilder_SetCapturerCallback](#oh_audiostreambuilder_setcapturercallback) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioCapturer_Callbacks](#oh_audiocapturer_callbacks) callbacks, void \*userData) | Sets callbacks for an audio capturer.| -| [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioRenderer](#oh_audiorenderer) \*\*audioRenderer) | Creates an audio renderer instance.| -| [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioCapturer](#oh_audiocapturer) \*\*audioCapturer) | Creates an audio capturer instance.| +| [OH_AudioCapturer_Release](#oh_audiocapturer_release) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer) | Releases an audio capturer.| +| [OH_AudioCapturer_Start](#oh_audiocapturer_start) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer) | Starts an audio capturer.| +| [OH_AudioCapturer_Pause](#oh_audiocapturer_pause) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer) | Pauses an audio capturer.| +| [OH_AudioCapturer_Stop](#oh_audiocapturer_stop) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer) | Stops an audio capturer.| +| [OH_AudioCapturer_Flush](#oh_audiocapturer_flush) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer) | Flushes obtained audio data.| +| [OH_AudioCapturer_GetCurrentState](#oh_audiocapturer_getcurrentstate) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, [OH_AudioStream_State](#oh_audiostream_state) \*state) | Obtains the state of an audio stream.| +| [OH_AudioCapturer_GetLatencyMode](#oh_audiocapturer_getlatencymode) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, [OH_AudioStream_LatencyMode](#oh_audiostream_latencymode) \*latencyMode) | Obtains the latency mode of an audio stream.| +| [OH_AudioCapturer_GetStreamId](#oh_audiocapturer_getstreamid) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, uint32_t \*streamId) | Obtains the stream ID of an audio stream.| +| [OH_AudioCapturer_GetSamplingRate](#oh_audiocapturer_getsamplingrate) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, int32_t \*rate) | Obtains the sampling rate of an audio stream.| +| [OH_AudioCapturer_GetChannelCount](#oh_audiocapturer_getchannelcount) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, int32_t \*channelCount) | Obtains the number of channels for an audio stream.| +| [OH_AudioCapturer_GetSampleFormat](#oh_audiocapturer_getsampleformat) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, [OH_AudioStream_SampleFormat](#oh_audiostream_sampleformat) \*sampleFormat) | Obtains the sampling format of an audio stream.| +| [OH_AudioCapturer_GetEncodingType](#oh_audiocapturer_getencodingtype) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, [OH_AudioStream_EncodingType](#oh_audiostream_encodingtype) \*encodingType) | Obtains the encoding type of an audio stream.| +| [OH_AudioCapturer_GetCapturerInfo](#oh_audiocapturer_getcapturerinfo) ([OH_AudioCapturer](#oh_audiocapturer) \*capturer, [OH_AudioStream_SourceType](#oh_audiostream_sourcetype) \*sourceType) | Obtains the usage scenario of an audio renderer.| +| [OH_AudioRenderer_Release](#oh_audiorenderer_release) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer) | Releases an audio renderer.| +| [OH_AudioRenderer_Start](#oh_audiorenderer_start) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer) | Starts an audio renderer.| +| [OH_AudioRenderer_Pause](#oh_audiorenderer_pause) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer) | Pauses an audio renderer.| +| [OH_AudioRenderer_Stop](#oh_audiorenderer_stop) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer) | Stops an audio renderer.| +| [OH_AudioRenderer_Flush](#oh_audiorenderer_flush) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer) | Flushes written audio data.| +| [OH_AudioRenderer_GetCurrentState](#oh_audiorenderer_getcurrentstate) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, [OH_AudioStream_State](#oh_audiostream_state) \*state) | Obtains the state of an audio stream.| +| [OH_AudioRenderer_GetSamplingRate](#oh_audiorenderer_getsamplingrate) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, int32_t \*rate) | Obtains the sampling rate of an audio stream.| +| [OH_AudioRenderer_GetStreamId](#oh_audiorenderer_getstreamid) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, uint32_t \*streamId) | Obtains the stream ID of an audio stream.| +| [OH_AudioRenderer_GetChannelCount](#oh_audiorenderer_getchannelcount) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, int32_t \*channelCount) | Obtains the number of channels for an audio stream.| +| [OH_AudioRenderer_GetSampleFormat](#oh_audiorenderer_getsampleformat) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, [OH_AudioStream_SampleFormat](#oh_audiostream_sampleformat) \*sampleFormat) | Obtains the sampling format of an audio stream.| +| [OH_AudioRenderer_GetLatencyMode](#oh_audiorenderer_getlatencymode) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, [OH_AudioStream_LatencyMode](#oh_audiostream_latencymode) \*latencyMode) | Obtains the latency mode of an audio stream.| +| [OH_AudioRenderer_GetRendererInfo](#oh_audiorenderer_getrendererinfo) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, [OH_AudioStream_Usage](#oh_audiostream_usage) \*usage) | Obtains the usage scenario of an audio renderer.| +| [OH_AudioRenderer_GetEncodingType](#oh_audiorenderer_getencodingtype) ([OH_AudioRenderer](#oh_audiorenderer) \*renderer, [OH_AudioStream_EncodingType](#oh_audiostream_encodingtype) \*encodingType) | Obtains the encoding type of an audio stream.| +| [OH_AudioStreamBuilder_Create](#oh_audiostreambuilder_create) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*\*builder, [OH_AudioStream_Type](#oh_audiostream_type) type) | Creates an audio stream builder, which can be an audio renderer or capturer.| +| [OH_AudioStreamBuilder_Destroy](#oh_audiostreambuilder_destroy) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder) | Destroys an audio stream builder.| +| [OH_AudioStreamBuilder_SetSamplingRate](#oh_audiostreambuilder_setsamplingrate) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, int32_t rate) | Sets the sampling rate of an audio stream.| +| [OH_AudioStreamBuilder_SetChannelCount](#oh_audiostreambuilder_setchannelcount) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, int32_t channelCount) | Sets the number of channels for an audio stream.| +| [OH_AudioStreamBuilder_SetSampleFormat](#oh_audiostreambuilder_setsampleformat) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioStream_SampleFormat](#oh_audiostream_sampleformat) format) | Sets the sampling format of an audio stream.| +| [OH_AudioStreamBuilder_SetEncodingType](#oh_audiostreambuilder_setencodingtype) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioStream_EncodingType](#oh_audiostream_encodingtype) encodingType) | Sets the encoding type of an audio stream.| +| [OH_AudioStreamBuilder_SetLatencyMode](#oh_audiostreambuilder_setlatencymode) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioStream_LatencyMode](#oh_audiostream_latencymode) latencyMode) | Sets the latency mode of an audio stream.| +| [OH_AudioStreamBuilder_SetRendererInfo](#oh_audiostreambuilder_setrendererinfo) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioStream_Usage](#oh_audiostream_usage) usage) | Sets the usage scenario of an audio renderer.| +| [OH_AudioStreamBuilder_SetCapturerInfo](#oh_audiostreambuilder_setcapturerinfo) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioStream_SourceType](#oh_audiostream_sourcetype) sourceType) | Sets the usage scenario of an audio capturer.| +| [OH_AudioStreamBuilder_SetRendererCallback](#oh_audiostreambuilder_setrenderercallback) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioRenderer_Callbacks](#oh_audiorenderer_callbacks) callbacks, void \*userData) | Sets callbacks for an audio renderer.| +| [OH_AudioStreamBuilder_SetCapturerCallback](#oh_audiostreambuilder_setcapturercallback) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioCapturer_Callbacks](#oh_audiocapturer_callbacks) callbacks, void \*userData) | Sets callbacks for an audio capturer.| +| [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioRenderer](#oh_audiorenderer) \*\*audioRenderer) | Creates an audio renderer instance.| +| [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer) ([OH_AudioStreamBuilder](#oh_audiostreambuilder) \*builder, [OH_AudioCapturer](#oh_audiocapturer) \*\*audioCapturer) | Creates an audio capturer instance.| ### Variables -| Name| Description| +| Name| Description| | -------- | -------- | -| (\*[OH_AudioRenderer_Callbacks_Struct::OH_AudioRenderer_OnWriteData](#oh_audiorenderer_onwritedata) )([OH_AudioRenderer](#oh_audiorenderer) \*renderer, void \*userData, void \*buffer, int32_t lenth) | Defines a function pointer to the callback function used to write audio data.| -| (\*[OH_AudioCapturer_Callbacks_Struct::OH_AudioCapturer_OnReadData](#oh_audiocapturer_onreaddata) )([OH_AudioCapturer](#oh_audiocapturer) \*capturer, void \*userData, void \*buffer, int32_t lenth) | Defines a function pointer to the callback function used to read audio data.| +| (\*[OH_AudioRenderer_Callbacks_Struct::OH_AudioRenderer_OnWriteData](#oh_audiorenderer_onwritedata) )([OH_AudioRenderer](#oh_audiorenderer) \*renderer, void \*userData, void \*buffer, int32_t lenth) | Defines a function pointer to the callback function used to write audio data.| +| (\*[OH_AudioCapturer_Callbacks_Struct::OH_AudioCapturer_OnReadData](#oh_audiocapturer_onreaddata) )([OH_AudioCapturer](#oh_audiocapturer) \*capturer, void \*userData, void \*buffer, int32_t lenth) | Defines a function pointer to the callback function used to read audio data.| ## Type Description @@ -116,7 +116,7 @@ The **OHAudio** module provides native APIs of the audio module. ### OH_AudioCapturer - + ``` typedef struct OH_AudioCapturerStruct OH_AudioCapturer ``` @@ -136,7 +136,7 @@ An audio capturer instance is used to capture audio data. ### OH_AudioCapturer_Callbacks - + ``` typedef struct OH_AudioCapturer_Callbacks_StructOH_AudioCapturer_Callbacks ``` @@ -154,7 +154,7 @@ Defines a pointer to the callback functions related to an audio capturer. ### OH_AudioRenderer - + ``` typedef struct OH_AudioRendererStruct OH_AudioRenderer ``` @@ -174,7 +174,7 @@ An audio renderer instance is used to render audio data. ### OH_AudioRenderer_Callbacks - + ``` typedef struct OH_AudioRenderer_Callbacks_StructOH_AudioRenderer_Callbacks ``` @@ -192,7 +192,7 @@ Defines a pointer to the callback functions related to an audio renderer. ### OH_AudioStreamBuilder - + ``` typedef struct OH_AudioStreamBuilderStruct OH_AudioStreamBuilder ``` @@ -215,7 +215,7 @@ An audio stream builder instance is often used to create an audio stream and set ### OH_AudioStream_EncodingType - + ``` enum OH_AudioStream_EncodingType ``` @@ -230,14 +230,14 @@ Enumerates the encoding types of audio streams. 10 -| Value| Description| + | Value| Description| | -------- | -------- | -| AUDIOSTREAM_ENCODING_TYPE_RAW | PCM encoding.| +| AUDIOSTREAM_ENCODING_TYPE_RAW | PCM encoding.| ### OH_AudioStream_LatencyMode - + ``` enum OH_AudioStream_LatencyMode ``` @@ -252,14 +252,14 @@ Enumerates the latency modes of audio streams. 10 -| Value| Description| + | Value| Description| | -------- | -------- | -| AUDIOSTREAM_LATENCY_MODE_NORMAL | Normal latency mode.| +| AUDIOSTREAM_LATENCY_MODE_NORMAL | Normal latency mode.| ### OH_AudioStream_Result - + ``` enum OH_AudioStream_Result ``` @@ -274,17 +274,17 @@ Enumerates the audio stream operation results. 10 -| Value| Description| + | Value| Description| | -------- | -------- | -| AUDIOSTREAM_SUCCESS | Operation successful.| -| AUDIOSTREAM_ERROR_INVALID_PARAM | Invalid input parameter.| -| AUDIOSTREAM_ERROR_ILLEGAL_STATE | Invalid state.| -| AUDIOSTREAM_ERROR_SYSTEM | System error.| +| AUDIOSTREAM_SUCCESS | Operation successful.| +| AUDIOSTREAM_ERROR_INVALID_PARAM | Invalid input parameter.| +| AUDIOSTREAM_ERROR_ILLEGAL_STATE | Invalid state.| +| AUDIOSTREAM_ERROR_SYSTEM | System error.| ### OH_AudioStream_SampleFormat - + ``` enum OH_AudioStream_SampleFormat ``` @@ -299,17 +299,17 @@ Enumerates the sampling formats of audio streams. 10 -| Value| Description| + | Value| Description| | -------- | -------- | -| AUDIOSTREAM_SAMPLE_U8 | Unsigned 8-bit.| -| AUDIOSTREAM_SAMPLE_S16LE | Short 16-bit little-endian.| -| AUDIOSTREAM_SAMPLE_S24LE | Short 24-bit little-endian.| -| AUDIOSTREAM_SAMPLE_S32LE | Short 32-bit little-endian.| +| AUDIOSTREAM_SAMPLE_U8 | Unsigned 8-bit.| +| AUDIOSTREAM_SAMPLE_S16LE | Short 16-bit little-endian.| +| AUDIOSTREAM_SAMPLE_S24LE | Short 24-bit little-endian.| +| AUDIOSTREAM_SAMPLE_S32LE | Short 32-bit little-endian.| ### OH_AudioStream_SourceType - + ``` enum OH_AudioStream_SourceType ``` @@ -324,17 +324,17 @@ Enumerates the usage scenarios of an audio capturer, that is, the usage scenario 10 -| Value| Description| + | Value| Description| | -------- | -------- | -| AUDIOSTREAM_SOURCE_TYPE_INVALID | Invalid state.| -| AUDIOSTREAM_SOURCE_TYPE_MIC | Audio recording.| -| AUDIOSTREAM_SOURCE_TYPE_VOICE_RECOGNITION | Voice recognition.| -| AUDIOSTREAM_SOURCE_TYPE_VOICE_COMMUNICATION | Voice communication.| +| AUDIOSTREAM_SOURCE_TYPE_INVALID | Invalid state.| +| AUDIOSTREAM_SOURCE_TYPE_MIC | Audio recording.| +| AUDIOSTREAM_SOURCE_TYPE_VOICE_RECOGNITION | Voice recognition.| +| AUDIOSTREAM_SOURCE_TYPE_VOICE_COMMUNICATION | Voice communication.| ### OH_AudioStream_State - + ``` enum OH_AudioStream_State ``` @@ -349,19 +349,19 @@ Enumerates the audio stream states. 10 -| Value| Description| + | Value| Description| | -------- | -------- | -| AUDIOSTREAM_STATE_INVALID | Invalid state.| -| AUDIOSTREAM_STATE_PREPARED | Prepared.| -| AUDIOSTREAM_STATE_RUNNING | Running.| -| AUDIOSTREAM_STATE_STOPPED | Stopped.| -| AUDIOSTREAM_STATE_RELEASED | Released.| -| AUDIOSTREAM_STATE_PAUSED | Paused.| +| AUDIOSTREAM_STATE_INVALID | Invalid state.| +| AUDIOSTREAM_STATE_PREPARED | Prepared.| +| AUDIOSTREAM_STATE_RUNNING | Running.| +| AUDIOSTREAM_STATE_STOPPED | Stopped.| +| AUDIOSTREAM_STATE_RELEASED | Released.| +| AUDIOSTREAM_STATE_PAUSED | Paused.| ### OH_AudioStream_Type - + ``` enum OH_AudioStream_Type ``` @@ -376,15 +376,15 @@ Enumerates the audio stream types. 10 -| Value| Description| + | Value| Description| | -------- | -------- | -| AUDIOSTREAM_TYPE_RENDERER | The audio stream is an output stream.| -| AUDIOSTREAM_TYPE_CAPTURER | The audio stream is an input stream.| +| AUDIOSTREAM_TYPE_RENDERER | The audio stream is an output stream.| +| AUDIOSTREAM_TYPE_CAPTURER | The audio stream is an input stream.| ### OH_AudioStream_Usage - + ``` enum OH_AudioStream_Usage ``` @@ -399,12 +399,12 @@ Enumerates the usage scenarios of an audio renderer, that is, the usage scenario 10 -| Value| Description| + | Value| Description| | -------- | -------- | -| AUDIOSTREAM_USAGE_UNKNOWN | Undefined.| -| AUDIOSTREAM_USAGE_MUSIC | Music.| -| AUDIOSTREAM_USAGE_COMMUNICATION | Voice communication.| -| AUDIOSTREAM_USAGE_GAME | Gaming.| +| AUDIOSTREAM_USAGE_UNKNOWN | Undefined.| +| AUDIOSTREAM_USAGE_MUSIC | Music.| +| AUDIOSTREAM_USAGE_COMMUNICATION | Voice communication.| +| AUDIOSTREAM_USAGE_GAME | Gaming.| ## Function Description @@ -412,7 +412,7 @@ Enumerates the usage scenarios of an audio renderer, that is, the usage scenario ### OH_AudioCapturer_Flush() - + ``` OH_AudioStream_Result OH_AudioCapturer_Flush (OH_AudioCapturer * capturer) ``` @@ -423,9 +423,9 @@ Flushes obtained audio data. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| +| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| **Returns** @@ -438,7 +438,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioCapturer_GetCapturerInfo() - + ``` OH_AudioStream_Result OH_AudioCapturer_GetCapturerInfo (OH_AudioCapturer * capturer, OH_AudioStream_SourceType * sourceType ) ``` @@ -449,10 +449,10 @@ Obtains the usage scenario of an audio capturer. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| -| sourceType | Pointer to a variable used to receive the usage scenario.| +| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| +| sourceType | Pointer to a variable used to receive the usage scenario.| **Returns** @@ -465,7 +465,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioCapturer_GetChannelCount() - + ``` OH_AudioStream_Result OH_AudioCapturer_GetChannelCount (OH_AudioCapturer * capturer, int32_t * channelCount ) ``` @@ -476,10 +476,10 @@ Obtains the number of channels for an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| -| channelCount | Pointer to a variable used to receive the number of channels.| +| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| +| channelCount | Pointer to a variable used to receive the number of channels.| **Returns** @@ -492,7 +492,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioCapturer_GetCurrentState() - + ``` OH_AudioStream_Result OH_AudioCapturer_GetCurrentState (OH_AudioCapturer * capturer, OH_AudioStream_State * state ) ``` @@ -503,10 +503,10 @@ Obtains the state of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| -| state | Pointer to a variable used to receive the state.| +| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| +| state | Pointer to a variable used to receive the state.| **Returns** @@ -519,7 +519,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioCapturer_GetEncodingType() - + ``` OH_AudioStream_Result OH_AudioCapturer_GetEncodingType (OH_AudioCapturer * capturer, OH_AudioStream_EncodingType * encodingType ) ``` @@ -530,10 +530,10 @@ Obtains the encoding type of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| -| encodingType | Pointer to a variable used to receive the encoding type.| +| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| +| encodingType | Pointer to a variable used to receive the encoding type.| **Returns** @@ -546,7 +546,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioCapturer_GetLatencyMode() - + ``` OH_AudioStream_Result OH_AudioCapturer_GetLatencyMode (OH_AudioCapturer * capturer, OH_AudioStream_LatencyMode * latencyMode ) ``` @@ -557,10 +557,10 @@ Obtains the latency mode of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| -| latencyMode | Pointer to a variable used to receive the latency mode.| +| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| +| latencyMode | Pointer to a variable used to receive the latency mode.| **Returns** @@ -573,7 +573,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioCapturer_GetSampleFormat() - + ``` OH_AudioStream_Result OH_AudioCapturer_GetSampleFormat (OH_AudioCapturer * capturer, OH_AudioStream_SampleFormat * sampleFormat ) ``` @@ -584,10 +584,10 @@ Obtains the sampling format of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| -| sampleFormat | Pointer to a variable used to receive the sampling format.| +| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| +| sampleFormat | Pointer to a variable used to receive the sampling format.| **Returns** @@ -600,7 +600,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioCapturer_GetSamplingRate() - + ``` OH_AudioStream_Result OH_AudioCapturer_GetSamplingRate (OH_AudioCapturer * capturer, int32_t * rate ) ``` @@ -611,10 +611,10 @@ Obtains the sampling rate of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| -| rate | Pointer to a variable used to receive the sampling rate.| +| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| +| rate | Pointer to a variable used to receive the sampling rate.| **Returns** @@ -627,7 +627,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioCapturer_GetStreamId() - + ``` OH_AudioStream_Result OH_AudioCapturer_GetStreamId (OH_AudioCapturer * capturer, uint32_t * streamId ) ``` @@ -638,10 +638,10 @@ Obtains the stream ID of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| -| streamId | Pointer to a variable used to receive the stream ID.| +| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| +| streamId | Pointer to a variable used to receive the stream ID.| **Returns** @@ -654,7 +654,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioCapturer_Pause() - + ``` OH_AudioStream_Result OH_AudioCapturer_Pause (OH_AudioCapturer * capturer) ``` @@ -665,9 +665,9 @@ Pauses an audio capturer. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| +| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| **Returns** @@ -680,7 +680,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioCapturer_Release() - + ``` OH_AudioStream_Result OH_AudioCapturer_Release (OH_AudioCapturer * capturer) ``` @@ -691,9 +691,9 @@ Releases an audio capturer. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| +| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| **Returns** @@ -706,7 +706,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioCapturer_Start() - + ``` OH_AudioStream_Result OH_AudioCapturer_Start (OH_AudioCapturer * capturer) ``` @@ -717,9 +717,9 @@ Starts an audio capturer. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| +| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| **Returns** @@ -732,7 +732,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioCapturer_Stop() - + ``` OH_AudioStream_Result OH_AudioCapturer_Stop (OH_AudioCapturer * capturer) ``` @@ -743,9 +743,9 @@ Stops an audio capturer. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| +| capturer | Pointer to an audio capturer instance created by [OH_AudioStreamBuilder_GenerateCapturer](#oh_audiostreambuilder_generatecapturer).| **Returns** @@ -758,7 +758,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioRenderer_Flush() - + ``` OH_AudioStream_Result OH_AudioRenderer_Flush (OH_AudioRenderer * renderer) ``` @@ -769,9 +769,9 @@ Flushes written audio data. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| +| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| **Returns** @@ -784,7 +784,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioRenderer_GetChannelCount() - + ``` OH_AudioStream_Result OH_AudioRenderer_GetChannelCount (OH_AudioRenderer * renderer, int32_t * channelCount ) ``` @@ -795,10 +795,10 @@ Obtains the number of channels for an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| -| channelCount | Pointer to a variable used to receive the number of channels.| +| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| +| channelCount | Pointer to a variable used to receive the number of channels.| **Returns** @@ -811,7 +811,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioRenderer_GetCurrentState() - + ``` OH_AudioStream_Result OH_AudioRenderer_GetCurrentState (OH_AudioRenderer * renderer, OH_AudioStream_State * state ) ``` @@ -822,10 +822,10 @@ Obtains the state of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| -| state | Pointer to a variable used to receive the state.| +| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| +| state | Pointer to a variable used to receive the state.| **Returns** @@ -838,7 +838,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioRenderer_GetEncodingType() - + ``` OH_AudioStream_Result OH_AudioRenderer_GetEncodingType (OH_AudioRenderer * renderer, OH_AudioStream_EncodingType * encodingType ) ``` @@ -849,10 +849,10 @@ Obtains the encoding type of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| -| encodingType | Pointer to a variable used to receive the encoding type.| +| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| +| encodingType | Pointer to a variable used to receive the encoding type.| **Returns** @@ -865,7 +865,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioRenderer_GetLatencyMode() - + ``` OH_AudioStream_Result OH_AudioRenderer_GetLatencyMode (OH_AudioRenderer * renderer, OH_AudioStream_LatencyMode * latencyMode ) ``` @@ -876,10 +876,10 @@ Obtains the latency mode of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| -| latencyMode | Pointer to a variable used to receive the latency mode.| +| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| +| latencyMode | Pointer to a variable used to receive the latency mode.| **Returns** @@ -892,7 +892,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioRenderer_GetRendererInfo() - + ``` OH_AudioStream_Result OH_AudioRenderer_GetRendererInfo (OH_AudioRenderer * renderer, OH_AudioStream_Usage * usage ) ``` @@ -901,14 +901,12 @@ OH_AudioStream_Result OH_AudioRenderer_GetRendererInfo (OH_AudioRenderer * rende Obtains the usage scenario of an audio renderer. -The renderer information includes the values of [OH_AudioStream_Usage](#oh_audiostream_usage) and **OH_AudioStream_Content**. - **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| -| usage | Pointer to a variable used to receive the usage scenario.| +| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| +| usage | Pointer to a variable used to receive the usage scenario.| **Returns** @@ -921,7 +919,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioRenderer_GetSampleFormat() - + ``` OH_AudioStream_Result OH_AudioRenderer_GetSampleFormat (OH_AudioRenderer * renderer, OH_AudioStream_SampleFormat * sampleFormat ) ``` @@ -932,10 +930,10 @@ Obtains the sampling format of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| -| sampleFormat | Pointer to a variable used to receive the sampling format.| +| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| +| sampleFormat | Pointer to a variable used to receive the sampling format.| **Returns** @@ -948,7 +946,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioRenderer_GetSamplingRate() - + ``` OH_AudioStream_Result OH_AudioRenderer_GetSamplingRate (OH_AudioRenderer * renderer, int32_t * rate ) ``` @@ -959,10 +957,10 @@ Obtains the sampling rate of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| -| rate | Pointer to a variable used to receive the sampling rate.| +| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| +| rate | Pointer to a variable used to receive the sampling rate.| **Returns** @@ -975,7 +973,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioRenderer_GetStreamId() - + ``` OH_AudioStream_Result OH_AudioRenderer_GetStreamId (OH_AudioRenderer * renderer, uint32_t * streamId ) ``` @@ -986,10 +984,10 @@ Obtains the stream ID of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| -| streamId | Pointer to a variable used to receive the stream ID.| +| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| +| streamId | Pointer to a variable used to receive the stream ID.| **Returns** @@ -1002,7 +1000,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioRenderer_Pause() - + ``` OH_AudioStream_Result OH_AudioRenderer_Pause (OH_AudioRenderer * renderer) ``` @@ -1013,9 +1011,9 @@ Pauses an audio renderer. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| +| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| **Returns** @@ -1028,7 +1026,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioRenderer_Release() - + ``` OH_AudioStream_Result OH_AudioRenderer_Release (OH_AudioRenderer * renderer) ``` @@ -1039,9 +1037,9 @@ Releases an audio renderer. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| +| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| **Returns** @@ -1054,7 +1052,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioRenderer_Start() - + ``` OH_AudioStream_Result OH_AudioRenderer_Start (OH_AudioRenderer * renderer) ``` @@ -1065,9 +1063,9 @@ Starts an audio renderer. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| +| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| **Returns** @@ -1080,7 +1078,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioRenderer_Stop() - + ``` OH_AudioStream_Result OH_AudioRenderer_Stop (OH_AudioRenderer * renderer) ``` @@ -1091,9 +1089,9 @@ Stops an audio renderer. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| +| renderer | Pointer to an audio renderer instance created by [OH_AudioStreamBuilder_GenerateRenderer](#oh_audiostreambuilder_generaterenderer).| **Returns** @@ -1106,7 +1104,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioStreamBuilder_Create() - + ``` OH_AudioStream_Result OH_AudioStreamBuilder_Create (OH_AudioStreamBuilder ** builder, OH_AudioStream_Type type ) ``` @@ -1119,10 +1117,10 @@ You need to call **OH_AudioStreamBuilder_Destroy()** to destroy the builder when **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| builder | Double pointer to the audio stream builder created.| -| type | Type of the audio stream builder, which can be **AUDIOSTREAM_TYPE_RENDERER** or **AUDIOSTREAM_TYPE_CAPTURER**.| +| builder | Double pointer to the audio stream builder created.| +| type | Type of the audio stream builder, which can be **AUDIOSTREAM_TYPE_RENDERER** or **AUDIOSTREAM_TYPE_CAPTURER**.| **Returns** @@ -1135,7 +1133,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioStreamBuilder_Destroy() - + ``` OH_AudioStream_Result OH_AudioStreamBuilder_Destroy (OH_AudioStreamBuilder * builder) ``` @@ -1146,9 +1144,9 @@ Destroys an audio stream builder when it is no longer required. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| +| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| **Returns** @@ -1161,7 +1159,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioStreamBuilder_GenerateCapturer() - + ``` OH_AudioStream_Result OH_AudioStreamBuilder_GenerateCapturer (OH_AudioStreamBuilder * builder, OH_AudioCapturer ** audioCapturer ) ``` @@ -1172,10 +1170,10 @@ Creates an audio capturer instance. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| -| audioCapturer | Double pointer to the audio capturer instance created.| +| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| +| audioCapturer | Double pointer to the audio capturer instance created.| **Returns** @@ -1188,7 +1186,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioStreamBuilder_GenerateRenderer() - + ``` OH_AudioStream_Result OH_AudioStreamBuilder_GenerateRenderer (OH_AudioStreamBuilder * builder, OH_AudioRenderer ** audioRenderer ) ``` @@ -1199,10 +1197,10 @@ Creates an audio renderer instance. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| -| audioRenderer | Double pointer to the audio renderer instance created.| +| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| +| audioRenderer | Double pointer to the audio renderer instance created.| **Returns** @@ -1215,7 +1213,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioStreamBuilder_SetCapturerCallback() - + ``` OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerCallback (OH_AudioStreamBuilder * builder, OH_AudioCapturer_Callbacks callbacks, void * userData ) ``` @@ -1226,11 +1224,11 @@ Sets callbacks for an audio capturer. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| -| callbacks | Callback functions that will be used to process events related to input audio streams.| -| userData | Pointer to the application data passed through the callback functions.| +| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| +| callbacks | Callback functions that will be used to process events related to input audio streams.| +| userData | Pointer to the application data passed through the callback functions.| **Returns** @@ -1243,7 +1241,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioStreamBuilder_SetCapturerInfo() - + ``` OH_AudioStream_Result OH_AudioStreamBuilder_SetCapturerInfo (OH_AudioStreamBuilder * builder, OH_AudioStream_SourceType sourceType ) ``` @@ -1254,10 +1252,10 @@ Sets the usage scenario of an audio capturer. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| -| sourceType | Usage scenario of the audio capturer.| +| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| +| sourceType | Usage scenario of the audio capturer.| **Returns** @@ -1270,7 +1268,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioStreamBuilder_SetChannelCount() - + ``` OH_AudioStream_Result OH_AudioStreamBuilder_SetChannelCount (OH_AudioStreamBuilder * builder, int32_t channelCount ) ``` @@ -1281,10 +1279,10 @@ Sets the number of channels for an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| -| channelCount | Number of channels.| +| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| +| channelCount | Number of channels.| **Returns** @@ -1297,7 +1295,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioStreamBuilder_SetEncodingType() - + ``` OH_AudioStream_Result OH_AudioStreamBuilder_SetEncodingType (OH_AudioStreamBuilder * builder, OH_AudioStream_EncodingType encodingType ) ``` @@ -1308,10 +1306,10 @@ Sets the encoding type of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| -| encodingType | Encoding type, which can be **AUDIOSTREAM_ENCODING_PCM**.| +| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| +| encodingType | Encoding type, which can be **AUDIOSTREAM_ENCODING_PCM**.| **Returns** @@ -1324,7 +1322,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioStreamBuilder_SetLatencyMode() - + ``` OH_AudioStream_Result OH_AudioStreamBuilder_SetLatencyMode (OH_AudioStreamBuilder * builder, OH_AudioStream_LatencyMode latencyMode ) ``` @@ -1335,10 +1333,10 @@ Sets the latency mode of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| -| latencyMode | Latency mode.| +| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| +| latencyMode | Latency mode.| **Returns** @@ -1351,7 +1349,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioStreamBuilder_SetRendererCallback() - + ``` OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererCallback (OH_AudioStreamBuilder * builder, OH_AudioRenderer_Callbacks callbacks, void * userData ) ``` @@ -1362,11 +1360,11 @@ Sets callbacks for an audio renderer. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| -| callbacks | Callback functions that will be used to process events related to output audio streams.| -| userData | Pointer to the application data passed through the callback functions.| +| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| +| callbacks | Callback functions that will be used to process events related to output audio streams.| +| userData | Pointer to the application data passed through the callback functions.| **Returns** @@ -1379,7 +1377,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioStreamBuilder_SetRendererInfo() - + ``` OH_AudioStream_Result OH_AudioStreamBuilder_SetRendererInfo (OH_AudioStreamBuilder * builder, OH_AudioStream_Usage usage ) ``` @@ -1390,10 +1388,10 @@ Sets the usage scenario of an audio renderer. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| -| usage | Usage scenario of the audio renderer.| +| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| +| usage | Usage scenario of the audio renderer.| **Returns** @@ -1406,7 +1404,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioStreamBuilder_SetSampleFormat() - + ``` OH_AudioStream_Result OH_AudioStreamBuilder_SetSampleFormat (OH_AudioStreamBuilder * builder, OH_AudioStream_SampleFormat format ) ``` @@ -1417,10 +1415,10 @@ Sets the sampling format of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| -| format | Sampling format.| +| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| +| format | Sampling format.| **Returns** @@ -1433,7 +1431,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioStreamBuilder_SetSamplingRate() - + ``` OH_AudioStream_Result OH_AudioStreamBuilder_SetSamplingRate (OH_AudioStreamBuilder * builder, int32_t rate ) ``` @@ -1444,10 +1442,10 @@ Sets the sampling rate of an audio stream. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| -| channelCount | Sampling rate.| +| builder | Pointer to an audio stream builder instance created by **OH_AudioStreamBuilder_Create()**.| +| channelCount | Sampling rate.| **Returns** @@ -1463,7 +1461,7 @@ Returns **AUDIOSTREAM_SUCCESS** if the operation is successful; returns an error ### OH_AudioCapturer_OnReadData - + ``` int32_t(* OH_AudioCapturer_Callbacks_Struct::OH_AudioCapturer_OnReadData) (OH_AudioCapturer *capturer, void *userData, void *buffer, int32_t lenth) ``` @@ -1479,7 +1477,7 @@ Defines a function pointer to the callback function used to read audio data. ### OH_AudioRenderer_OnWriteData - + ``` int32_t(* OH_AudioRenderer_Callbacks_Struct::OH_AudioRenderer_OnWriteData) (OH_AudioRenderer *renderer, void *userData, void *buffer, int32_t lenth) ``` diff --git a/en/application-dev/reference/native-apis/_video_decoder.md b/en/application-dev/reference/native-apis/_video_decoder.md index 56496df042..5c81067ce6 100644 --- a/en/application-dev/reference/native-apis/_video_decoder.md +++ b/en/application-dev/reference/native-apis/_video_decoder.md @@ -19,7 +19,7 @@ The VideoDecoder module provides the functions for video decoding. | Name| Description| | -------- | -------- | -| [native_avcodec_videodecoder.h](native__avcodec__videodecoder_8h.md) | Declares the native APIs used for video decoding.
File to include: | +| [native_avcodec_videodecoder.h](native__avcodec__videodecoder_8h.md) | Declares the native APIs used for video decoding.
**File to include**:
**Library**: libnative_media_vdec.so | ### Functions @@ -52,7 +52,7 @@ The VideoDecoder module provides the functions for video decoding. ``` -OH_AVErrCode OH_VideoDecoder_Configure (OH_AVCodec * codec, OH_AVFormat * format ) +OH_AVErrCode OH_VideoDecoder_Configure (OH_AVCodec *codec, OH_AVFormat *format) ``` **Description** @@ -83,7 +83,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVCodec* OH_VideoDecoder_CreateByMime (const char * mime) +OH_AVCodec* OH_VideoDecoder_CreateByMime (const char *mime) ``` **Description** @@ -111,7 +111,7 @@ Returns the pointer to an **OH_AVCodec** instance. ``` -OH_AVCodec* OH_VideoDecoder_CreateByName (const char * name) +OH_AVCodec* OH_VideoDecoder_CreateByName (const char *name) ``` **Description** @@ -139,7 +139,7 @@ Returns the pointer to an **OH_AVCodec** instance. ``` -OH_AVErrCode OH_VideoDecoder_Destroy (OH_AVCodec * codec) +OH_AVErrCode OH_VideoDecoder_Destroy (OH_AVCodec *codec) ``` **Description** @@ -167,7 +167,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVErrCode OH_VideoDecoder_Flush (OH_AVCodec * codec) +OH_AVErrCode OH_VideoDecoder_Flush (OH_AVCodec *codec) ``` **Description** @@ -197,7 +197,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVErrCode OH_VideoDecoder_FreeOutputData (OH_AVCodec * codec, uint32_t index ) +OH_AVErrCode OH_VideoDecoder_FreeOutputData (OH_AVCodec *codec, uint32_t index) ``` **Description** @@ -226,7 +226,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVFormat* OH_VideoDecoder_GetOutputDescription (OH_AVCodec * codec) +OH_AVFormat* OH_VideoDecoder_GetOutputDescription (OH_AVCodec *codec) ``` **Description** @@ -256,7 +256,7 @@ Returns the pointer to an **OH_AVFormat** instance. ``` -OH_AVErrCode OH_VideoDecoder_IsValid (OH_AVCodec * codec, bool * isValid ) +OH_AVErrCode OH_VideoDecoder_IsValid (OH_AVCodec *codec, bool *isValid) ``` **Description** @@ -285,7 +285,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVErrCode OH_VideoDecoder_Prepare (OH_AVCodec * codec) +OH_AVErrCode OH_VideoDecoder_Prepare (OH_AVCodec *codec) ``` **Description** @@ -313,7 +313,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVErrCode OH_VideoDecoder_PushInputData (OH_AVCodec * codec, uint32_t index, OH_AVCodecBufferAttr attr ) +OH_AVErrCode OH_VideoDecoder_PushInputData (OH_AVCodec *codec, uint32_t index, OH_AVCodecBufferAttr attr) ``` **Description** @@ -349,7 +349,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVErrCode OH_VideoDecoder_RenderOutputData (OH_AVCodec * codec, uint32_t index ) +OH_AVErrCode OH_VideoDecoder_RenderOutputData (OH_AVCodec *codec, uint32_t index) ``` **Description** @@ -380,7 +380,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVErrCode OH_VideoDecoder_Reset (OH_AVCodec * codec) +OH_AVErrCode OH_VideoDecoder_Reset (OH_AVCodec *codec) ``` **Description** @@ -408,7 +408,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVErrCode OH_VideoDecoder_SetCallback (OH_AVCodec * codec, OH_AVCodecAsyncCallback callback, void * userData ) +OH_AVErrCode OH_VideoDecoder_SetCallback (OH_AVCodec *codec, OH_AVCodecAsyncCallback callback, void *userData) ``` **Description** @@ -440,7 +440,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVErrCode OH_VideoDecoder_SetParameter (OH_AVCodec * codec, OH_AVFormat * format ) +OH_AVErrCode OH_VideoDecoder_SetParameter (OH_AVCodec *codec, OH_AVFormat *format) ``` **Description** @@ -471,7 +471,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVErrCode OH_VideoDecoder_SetSurface (OH_AVCodec * codec, OHNativeWindow * window ) +OH_AVErrCode OH_VideoDecoder_SetSurface (OH_AVCodec *codec, OHNativeWindow *window) ``` **Description** @@ -500,7 +500,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVErrCode OH_VideoDecoder_Start (OH_AVCodec * codec) +OH_AVErrCode OH_VideoDecoder_Start (OH_AVCodec *codec) ``` **Description** @@ -530,7 +530,7 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ``` -OH_AVErrCode OH_VideoDecoder_Stop (OH_AVCodec * codec) +OH_AVErrCode OH_VideoDecoder_Stop (OH_AVCodec *codec) ``` **Description** diff --git a/en/application-dev/reference/native-apis/_video_encoder.md b/en/application-dev/reference/native-apis/_video_encoder.md index 07a51ce127..1d4e5066eb 100644 --- a/en/application-dev/reference/native-apis/_video_encoder.md +++ b/en/application-dev/reference/native-apis/_video_encoder.md @@ -17,47 +17,47 @@ The **VideoEncoder** module provides the functions for video encoding. ### Files -| Name| Description| +| Name| Description| | -------- | -------- | -| [native_avcodec_videoencoder.h](native__avcodec__videoencoder_8h.md) | Declares the native APIs used for video encoding.
File to include: | +| [native_avcodec_videoencoder.h](native__avcodec__videoencoder_8h.md) | Declares the native APIs used for video encoding.
**File to include**:
**Library**: libnative_media_venc.so| ### Types -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_VideoEncodeBitrateMode](#oh_videoencodebitratemode) | Defines an enum that enumerates the bit rate modes of a video encoder. | +| [OH_VideoEncodeBitrateMode](#oh_videoencodebitratemode) | Defines an enum that enumerates the bit rate modes of a video encoder.| ### Enums -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_VideoEncodeBitrateMode](#oh_videoencodebitratemode) { **CBR** = 0, **VBR** = 1, **CQ** = 2 } | Enumerates the bit rate modes of a video encoder.| +| [OH_VideoEncodeBitrateMode](#oh_videoencodebitratemode) {
    **CBR** = 0,
    **VBR** = 1,
    **CQ** = 2
} | Enumerates the bit rate modes of a video encoder.| ### Functions -| Name| Description| +| Name| Description| | -------- | -------- | -| \*[OH_VideoEncoder_CreateByMime](#oh_videoencoder_createbymime) (const char \*mime) | Creates a video encoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases.| -| \*[OH_VideoEncoder_CreateByName](#oh_videoencoder_createbyname) (const char \*name) | Creates a video encoder instance based on an encoder name. To use this function, you must know the exact name of the encoder.| -| [OH_VideoEncoder_Destroy](#oh_videoencoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of a video encoder and destroys the encoder instance.| -| [OH_VideoEncoder_SetCallback](#oh_videoencoder_setcallback) (OH_AVCodec \*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by a video encoder.| -| [OH_VideoEncoder_Configure](#oh_videoencoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures a video encoder. Typically, you need to configure the description information about the video track to be encoded.| -| [OH_VideoEncoder_Prepare](#oh_videoencoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for a video encoder. This function must be called after **Configure**.| -| [OH_VideoEncoder_Start](#oh_videoencoder_start) (OH_AVCodec \*codec) | Starts a video encoder. This function can be called only after the encoder is prepared successfully.| -| [OH_VideoEncoder_Stop](#oh_videoencoder_stop) (OH_AVCodec \*codec) | Stops a video encoder.| -| [OH_VideoEncoder_Flush](#oh_videoencoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of a video encoder.| -| [OH_VideoEncoder_Reset](#oh_videoencoder_reset) (OH_AVCodec \*codec) | Resets a video encoder.| -| \*[OH_VideoEncoder_GetOutputDescription](#oh_videoencoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the description information about the output data of a video encoder. For details, see **OH_AVFormat**.| -| [OH_VideoEncoder_SetParameter](#oh_videoencoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for a video encoder.| -| [OH_VideoEncoder_GetSurface](#oh_videoencoder_getsurface) (OH_AVCodec \*codec, OHNativeWindow \*\*window) | Sets an input surface for a video encoder. This function must be called prior to **Prepare**.| -| [OH_VideoEncoder_FreeOutputData](#oh_videoencoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of a video encoder.| -| [OH_VideoEncoder_NotifyEndOfStream](#oh_videoencoder_notifyendofstream) (OH_AVCodec \*codec) | Notifies a video encoder that input streams end. You are advised to use this function for notification.| -| [OH_VideoEncoder_PushInputData](#oh_videoencoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to a video encoder.| -| \*[OH_VideoEncoder_GetInputDescription](#oh_videoencoder_getinputdescription) (OH_AVCodec \*codec) | Obtains the description information received by the video encoder. This function must be called after **Configure**. For details, see **OH_AVFormat**.| -| [OH_VideoEncoder_IsValid](#oh_videoencoder_isvalid) (OH_AVCodec \*codec, bool \*isValid) | Checks whether a video encoder instance is valid.| +| \*[OH_VideoEncoder_CreateByMime](#oh_videoencoder_createbymime) (const char \*mime) | Creates a video encoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases.| +| \*[OH_VideoEncoder_CreateByName](#oh_videoencoder_createbyname) (const char \*name) | Creates a video encoder instance based on an encoder name. To use this function, you must know the exact name of the encoder.| +| [OH_VideoEncoder_Destroy](#oh_videoencoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of a video encoder and destroys the encoder instance.| +| [OH_VideoEncoder_SetCallback](#oh_videoencoder_setcallback) (OH_AVCodec \*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by a video encoder.| +| [OH_VideoEncoder_Configure](#oh_videoencoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures a video encoder. Typically, you need to configure the description information about the video track to be encoded.| +| [OH_VideoEncoder_Prepare](#oh_videoencoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for a video encoder. This function must be called after **Configure**.| +| [OH_VideoEncoder_Start](#oh_videoencoder_start) (OH_AVCodec \*codec) | Starts a video encoder. This function can be called only after the encoder is prepared successfully.| +| [OH_VideoEncoder_Stop](#oh_videoencoder_stop) (OH_AVCodec \*codec) | Stops a video encoder.| +| [OH_VideoEncoder_Flush](#oh_videoencoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of a video encoder.| +| [OH_VideoEncoder_Reset](#oh_videoencoder_reset) (OH_AVCodec \*codec) | Resets a video encoder.| +| \*[OH_VideoEncoder_GetOutputDescription](#oh_videoencoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the description information about the output data of a video encoder. For details, see **OH_AVFormat**.| +| [OH_VideoEncoder_SetParameter](#oh_videoencoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for a video encoder.| +| [OH_VideoEncoder_GetSurface](#oh_videoencoder_getsurface) (OH_AVCodec \*codec, OHNativeWindow \*\*window) | Sets an input surface for a video encoder. This function must be called prior to **Prepare**.| +| [OH_VideoEncoder_FreeOutputData](#oh_videoencoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of a video encoder.| +| [OH_VideoEncoder_NotifyEndOfStream](#oh_videoencoder_notifyendofstream) (OH_AVCodec \*codec) | Notifies a video encoder that input streams end. You are advised to use this function for notification.| +| [OH_VideoEncoder_PushInputData](#oh_videoencoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to a video encoder.| +| \*[OH_VideoEncoder_GetInputDescription](#oh_videoencoder_getinputdescription) (OH_AVCodec \*codec) | Obtains the description information received by the video encoder. This function must be called after **Configure**. For details, see **OH_AVFormat**.| +| [OH_VideoEncoder_IsValid](#oh_videoencoder_isvalid) (OH_AVCodec \*codec, bool \*isValid) | Checks whether a video encoder instance is valid.| ## Type Description @@ -65,9 +65,9 @@ The **VideoEncoder** module provides the functions for video encoding. ### OH_VideoEncodeBitrateMode - + ``` -typedef enum OH_VideoEncodeBitrateModeOH_VideoEncodeBitrateMode +typedef enum OH_VideoEncodeBitrateMode OH_VideoEncodeBitrateMode ``` **Description** @@ -86,9 +86,9 @@ Defines the bit rate mode of a video encoder. ### OH_VideoEncodeBitrateMode - + ``` -enum OH_VideoEncodeBitrateMode +enum OH_VideoEncode BitrateMode ``` **Description** @@ -103,9 +103,9 @@ Enumerates the bit rate modes of a video encoder. | Value| Description| | -------- | -------- | -| CBR | Constant bit rate.| -| VBR | Variable bit rate.| -| CQ | Constant quality.| +| CBR | Constant bit rate.| +| VBR | Variable bit rate.| +| CQ | Constant quality.| ## Function Description @@ -113,9 +113,9 @@ Enumerates the bit rate modes of a video encoder. ### OH_VideoEncoder_Configure() - + ``` -OH_AVErrCode OH_VideoEncoder_Configure (OH_AVCodec * codec, OH_AVFormat * format ) +OH_AVErrCode OH_VideoEncoder_Configure (OH_AVCodec *codec, OH_AVFormat *format) ``` **Description** @@ -128,10 +128,10 @@ This function must be called prior to **Prepare**. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| format | Pointer to an **OH_AVFormat** instance, which provides the description information about the video track to be encoded.| +| codec | Pointer to an **OH_AVCodec** instance.| +| format | Pointer to an **OH_AVFormat** instance, which provides the description information about the video track to be encoded.| **Returns** @@ -144,9 +144,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_VideoEncoder_CreateByMime() - + ``` -OH_AVCodec* OH_VideoEncoder_CreateByMime (const char * mime) +OH_AVCodec* OH_VideoEncoder_CreateByMime (const char *mime) ``` **Description** @@ -157,9 +157,9 @@ Creates a video encoder instance based on a MIME type. This function is recommen **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| mime | Pointer to a string that describes the MIME type. For details, see **AVCODEC_MIME_TYPE**.| +| mime | Pointer to a string that describes the MIME type. For details, see **AVCODEC_MIME_TYPE**.| **Returns** @@ -172,9 +172,9 @@ Returns the pointer to the **OH_AVCodec** instance created. You must call **OH_V ### OH_VideoEncoder_CreateByName() - + ``` -OH_AVCodec* OH_VideoEncoder_CreateByName (const char * name) +OH_AVCodec* OH_VideoEncoder_CreateByName (const char *name) ``` **Description** @@ -185,9 +185,9 @@ Creates a video encoder instance based on an encoder name. To use this function, **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| name | Pointer to a video encoder name.| +| name | Pointer to a video encoder name.| **Returns** @@ -200,9 +200,9 @@ Returns the pointer to an **OH_AVCodec** instance. ### OH_VideoEncoder_Destroy() - + ``` -OH_AVErrCode OH_VideoEncoder_Destroy (OH_AVCodec * codec) +OH_AVErrCode OH_VideoEncoder_Destroy (OH_AVCodec *codec) ``` **Description** @@ -213,9 +213,9 @@ Clears the internal resources of a video encoder and destroys the encoder instan **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -228,9 +228,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_VideoEncoder_Flush() - + ``` -OH_AVErrCode OH_VideoEncoder_Flush (OH_AVCodec * codec) +OH_AVErrCode OH_VideoEncoder_Flush (OH_AVCodec *codec) ``` **Description** @@ -243,9 +243,9 @@ This function invalidates the indexes of all buffers previously reported through **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -258,9 +258,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_VideoEncoder_FreeOutputData() - + ``` -OH_AVErrCode OH_VideoEncoder_FreeOutputData (OH_AVCodec * codec, uint32_t index ) +OH_AVErrCode OH_VideoEncoder_FreeOutputData (OH_AVCodec *codec, uint32_t index) ``` **Description** @@ -271,10 +271,10 @@ Frees an output buffer of a video encoder. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| index | Index of the output buffer.| +| codec | Pointer to an **OH_AVCodec** instance.| +| index | Index of the output buffer.| **Returns** @@ -287,9 +287,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_VideoEncoder_GetInputDescription() - + ``` -OH_AVFormat* OH_VideoEncoder_GetInputDescription (OH_AVCodec * codec) +OH_AVFormat* OH_VideoEncoder_GetInputDescription (OH_AVCodec *codec) ``` **Description** @@ -302,9 +302,9 @@ The caller must manually release the **OH_AVFormat** instance in the return valu **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -317,9 +317,9 @@ Returns the pointer to an **OH_AVFormat** instance. ### OH_VideoEncoder_GetOutputDescription() - + ``` -OH_AVFormat* OH_VideoEncoder_GetOutputDescription (OH_AVCodec * codec) +OH_AVFormat* OH_VideoEncoder_GetOutputDescription (OH_AVCodec *codec) ``` **Description** @@ -332,9 +332,9 @@ The caller must manually release the **OH_AVFormat** instance in the return valu **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -347,9 +347,9 @@ Returns the pointer to an **OH_AVFormat** instance. ### OH_VideoEncoder_GetSurface() - + ``` -OH_AVErrCode OH_VideoEncoder_GetSurface (OH_AVCodec * codec, OHNativeWindow ** window ) +OH_AVErrCode OH_VideoEncoder_GetSurface (OH_AVCodec *codec, OHNativeWindow **window) ``` **Description** @@ -360,10 +360,10 @@ Sets an input surface for a video encoder. This function must be called prior to **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| window | Pointer to an **OHNativeWindow** instance. For details, see **OHNativeWindow**.| +| codec | Pointer to an **OH_AVCodec** instance.| +| window | Pointer to an **OHNativeWindow** instance. For details, see **OHNativeWindow**.| **Returns** @@ -376,9 +376,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_VideoEncoder_IsValid() - + ``` -OH_AVErrCode OH_VideoEncoder_IsValid (OH_AVCodec * codec, bool * isValid ) +OH_AVErrCode OH_VideoEncoder_IsValid (OH_AVCodec *codec, bool *isValid) ``` **Description** @@ -389,10 +389,10 @@ Checks whether a video encoder instance is valid. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| isValid | Pointer to an instance of the Boolean type. The value **true** means that the encoder instance is valid and **false** means the opposite.| +| codec | Pointer to an **OH_AVCodec** instance.| +| isValid | Pointer to an instance of the Boolean type. The value **true** means that the encoder instance is valid and **false** means the opposite.| **Returns** @@ -405,9 +405,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_VideoEncoder_NotifyEndOfStream() - + ``` -OH_AVErrCode OH_VideoEncoder_NotifyEndOfStream (OH_AVCodec * codec) +OH_AVErrCode OH_VideoEncoder_NotifyEndOfStream (OH_AVCodec *codec) ``` **Description** @@ -420,9 +420,9 @@ This function is recommended in surface mode. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -435,9 +435,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_VideoEncoder_Prepare() - + ``` -OH_AVErrCode OH_VideoEncoder_Prepare (OH_AVCodec * codec) +OH_AVErrCode OH_VideoEncoder_Prepare (OH_AVCodec *codec) ``` **Description** @@ -448,9 +448,9 @@ Prepares internal resources for a video encoder. This function must be called af **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -463,9 +463,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_VideoEncoder_PushInputData() - + ``` -OH_AVErrCode OH_VideoEncoder_PushInputData (OH_AVCodec * codec, uint32_t index, OH_AVCodecBufferAttr attr ) +OH_AVErrCode OH_VideoEncoder_PushInputData (OH_AVCodec *codec, uint32_t index, OH_AVCodecBufferAttr attr) ``` **Description** @@ -476,11 +476,11 @@ Pushes the input buffer filled with data to a video encoder. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| index | Index of the input buffer.| -| attr | Description of the data contained in the buffer.| +| codec | Pointer to an **OH_AVCodec** instance.| +| index | Index of the input buffer.| +| attr | Description of the data contained in the buffer.| **Returns** @@ -493,9 +493,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_VideoEncoder_Reset() - + ``` -OH_AVErrCode OH_VideoEncoder_Reset (OH_AVCodec * codec) +OH_AVErrCode OH_VideoEncoder_Reset (OH_AVCodec *codec) ``` **Description** @@ -506,9 +506,9 @@ Resets a video encoder. To continue encoding, you must call **Configure** to con **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -521,9 +521,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_VideoEncoder_SetCallback() - + ``` -OH_AVErrCode OH_VideoEncoder_SetCallback (OH_AVCodec * codec, OH_AVCodecAsyncCallback callback, void * userData ) +OH_AVErrCode OH_VideoEncoder_SetCallback (OH_AVCodec *codec, OH_AVCodecAsyncCallback callback, void *userData) ``` **Description** @@ -536,11 +536,11 @@ This function must be called prior to **Prepare**. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| callback | Callback function to set. For details, see **OH_AVCodecAsyncCallback**.| -| userData | User-specific data.| +| codec | Pointer to an **OH_AVCodec** instance.| +| callback | Callback function to set. For details, see **OH_AVCodecAsyncCallback**.| +| userData | User-specific data.| **Returns** @@ -553,9 +553,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_VideoEncoder_SetParameter() - + ``` -OH_AVErrCode OH_VideoEncoder_SetParameter (OH_AVCodec * codec, OH_AVFormat * format ) +OH_AVErrCode OH_VideoEncoder_SetParameter (OH_AVCodec *codec, OH_AVFormat *format) ``` **Description** @@ -568,10 +568,10 @@ This function can be called only after the encoder is started. Incorrect paramet **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| -| format | Handle to an **OH_AVFormat** instance.| +| codec | Pointer to an **OH_AVCodec** instance.| +| format | Handle to an **OH_AVFormat** instance.| **Returns** @@ -584,9 +584,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_VideoEncoder_Start() - + ``` -OH_AVErrCode OH_VideoEncoder_Start (OH_AVCodec * codec) +OH_AVErrCode OH_VideoEncoder_Start (OH_AVCodec *codec) ``` **Description** @@ -599,9 +599,9 @@ After being started, the encoder starts to report the **NeedInputData** event. **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** @@ -614,9 +614,9 @@ Returns **AV_ERR_OK** if the operation is successful; returns an error code defi ### OH_VideoEncoder_Stop() - + ``` -OH_AVErrCode OH_VideoEncoder_Stop (OH_AVCodec * codec) +OH_AVErrCode OH_VideoEncoder_Stop (OH_AVCodec *codec) ``` **Description** @@ -627,9 +627,9 @@ Stops a video encoder. After the encoder is stopped, you can call **Start** to s **Parameters** -| Name| Description| +| Name| Description| | -------- | -------- | -| codec | Pointer to an **OH_AVCodec** instance.| +| codec | Pointer to an **OH_AVCodec** instance.| **Returns** diff --git a/en/application-dev/reference/native-apis/native__avcapability_8h.md b/en/application-dev/reference/native-apis/native__avcapability_8h.md index 3182bae505..2123ee843c 100644 --- a/en/application-dev/reference/native-apis/native__avcapability_8h.md +++ b/en/application-dev/reference/native-apis/native__avcapability_8h.md @@ -37,8 +37,8 @@ The **native_avcapability.h** file declares the native APIs used to query the co | Name| Description| | -------- | -------- | -| [OH_BitrateMode](_a_v_capability.md#oh_bitratemode) { **BITRATE_MODE_CBR** = 0, **BITRATE_MODE_VBR** = 1, **BITRATE_MODE_CQ** = 2 } | Enumerates the bit rate modes of an encoder.| -| [OH_AVCodecCategory](_a_v_capability.md#oh_avcodeccategory) { **HARDWARE** = 0, **SOFTWARE** } | Enumerates the codec categories.| +| [OH_BitrateMode](_a_v_capability.md#oh_bitratemode) {
    **BITRATE_MODE_CBR** = 0,
    **BITRATE_MODE_VBR** = 1,
    **BITRATE_MODE_CQ** = 2
} | Enumerates the bit rate modes of an encoder.| +| [OH_AVCodecCategory](_a_v_capability.md#oh_avcodeccategory) {
    **HARDWARE** = 0,
    **SOFTWARE**
} | Enumerates the codec categories.| ### Functions diff --git a/en/application-dev/reference/native-apis/native__avcodec__audiodecoder_8h.md b/en/application-dev/reference/native-apis/native__avcodec__audiodecoder_8h.md index da13a59955..2dc20aa3ab 100644 --- a/en/application-dev/reference/native-apis/native__avcodec__audiodecoder_8h.md +++ b/en/application-dev/reference/native-apis/native__avcodec__audiodecoder_8h.md @@ -1,6 +1,5 @@ # native_avcodec_audiodecoder.h - ## Overview The **native_avcodec_audiodecoder.h** file declares the native APIs used for audio decoding. @@ -13,26 +12,24 @@ The **native_avcodec_audiodecoder.h** file declares the native APIs used for aud [AudioDecoder](_audio_decoder.md) - ## Summary - ### Functions -| Name| Description| -| -------- | -------- | -| \*[OHOS::Media::OH_AudioDecoder_CreateByMime](_audio_decoder.md#oh_audiodecoder_createbymime) (const char \*mime) | Creates an audio decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases.| -| \*[OHOS::Media::OH_AudioDecoder_CreateByName](_audio_decoder.md#oh_audiodecoder_createbyname) (const char \*name) | Creates an audio decoder instance based on a decoder name. To use this function, you must know the exact name of the decoder.| -| [OHOS::Media::OH_AudioDecoder_Destroy](_audio_decoder.md#oh_audiodecoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of an audio decoder and destroys the decoder instance.| -| [OHOS::Media::OH_AudioDecoder_SetCallback](_audio_decoder.md#oh_audiodecoder_setcallback) (OH_AVCodec \*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio decoder.| -| [OHOS::Media::OH_AudioDecoder_Configure](_audio_decoder.md#oh_audiodecoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures an audio decoder. Typically, you need to configure the audio description information that can be extracted from the container.| -| [OHOS::Media::OH_AudioDecoder_Prepare](_audio_decoder.md#oh_audiodecoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for an audio decoder. This function must be called after **Configure**.| -| [OHOS::Media::OH_AudioDecoder_Start](_audio_decoder.md#oh_audiodecoder_start) (OH_AVCodec \*codec) | Starts an audio decoder. This function can be called only after the decoder is prepared successfully.| -| [OHOS::Media::OH_AudioDecoder_Stop](_audio_decoder.md#oh_audiodecoder_stop) (OH_AVCodec \*codec) | Stops an audio decoder.| -| [OHOS::Media::OH_AudioDecoder_Flush](_audio_decoder.md#oh_audiodecoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of an audio decoder.| -| [OHOS::Media::OH_AudioDecoder_Reset](_audio_decoder.md#oh_audiodecoder_reset) (OH_AVCodec \*codec) | Resets an audio decoder. To continue decoding, you must call **Configure** to configure the decoder again.| -| \*[OHOS::Media::OH_AudioDecoder_GetOutputDescription](_audio_decoder.md#oh_audiodecoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the description information about the output data of an audio decoder. For details, see **OH_AVFormat**.| -| [OHOS::Media::OH_AudioDecoder_SetParameter](_audio_decoder.md#oh_audiodecoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio decoder. This function can be called only after the decoder is started. Incorrect parameter settings may cause decoding failure.| -| [OHOS::Media::OH_AudioDecoder_PushInputData](_audio_decoder.md#oh_audiodecoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio decoder.| -| [OHOS::Media::OH_AudioDecoder_FreeOutputData](_audio_decoder.md#oh_audiodecoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of an audio decoder.| -| [OHOS::Media::OH_AudioDecoder_IsValid](_audio_decoder.md#oh_audiodecoder_isvalid) (OH_AVCodec \*codec, bool \*isValid) | Checks whether an audio decoder instance is valid.| +| Name | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +| \*[OHOS::Media::OH_AudioDecoder_CreateByMime](_audio_decoder.md#oh_audiodecoder_createbymime) (const char \*mime) | Creates an audio decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases. | +| \*[OHOS::Media::OH_AudioDecoder_CreateByName](_audio_decoder.md#oh_audiodecoder_createbyname) (const char \*name) | Creates an audio decoder instance based on a decoder name. To use this function, you must know the exact name of the decoder. | +| [OHOS::Media::OH_AudioDecoder_Destroy](_audio_decoder.md#oh_audiodecoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of an audio decoder and destroys the decoder instance. | +| [OHOS::Media::OH_AudioDecoder_SetCallback](_audio_decoder.md#oh_audiodecoder_setcallback) (OH_AVCodec \*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio decoder. | +| [OHOS::Media::OH_AudioDecoder_Configure](_audio_decoder.md#oh_audiodecoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures an audio decoder. Typically, you need to configure the audio description information that can be extracted from the container. | +| [OHOS::Media::OH_AudioDecoder_Prepare](_audio_decoder.md#oh_audiodecoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for an audio decoder. This function must be called after **Configure**. | +| [OHOS::Media::OH_AudioDecoder_Start](_audio_decoder.md#oh_audiodecoder_start) (OH_AVCodec \*codec) | Starts an audio decoder. This function can be called only after the decoder is prepared successfully. | +| [OHOS::Media::OH_AudioDecoder_Stop](_audio_decoder.md#oh_audiodecoder_stop) (OH_AVCodec \*codec) | Stops an audio decoder. | +| [OHOS::Media::OH_AudioDecoder_Flush](_audio_decoder.md#oh_audiodecoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of an audio decoder. | +| [OHOS::Media::OH_AudioDecoder_Reset](_audio_decoder.md#oh_audiodecoder_reset) (OH_AVCodec \*codec) | Resets an audio decoder. To continue decoding, you must call **Configure** to configure the decoder again. | +| \*[OHOS::Media::OH_AudioDecoder_GetOutputDescription](_audio_decoder.md#oh_audiodecoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the description information about the output data of an audio decoder. For details, see **OH_AVFormat**. | +| [OHOS::Media::OH_AudioDecoder_SetParameter](_audio_decoder.md#oh_audiodecoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio decoder. This function can be called only after the decoder is started. Incorrect parameter settings may cause decoding failure.| +| [OHOS::Media::OH_AudioDecoder_PushInputData](_audio_decoder.md#oh_audiodecoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio decoder. | +| [OHOS::Media::OH_AudioDecoder_FreeOutputData](_audio_decoder.md#oh_audiodecoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of an audio decoder. | +| [OHOS::Media::OH_AudioDecoder_IsValid](_audio_decoder.md#oh_audiodecoder_isvalid) (OH_AVCodec \*codec, bool \*isValid) | Checks whether an audio decoder instance is valid. | diff --git a/en/application-dev/reference/native-apis/native__avcodec__audioencoder_8h.md b/en/application-dev/reference/native-apis/native__avcodec__audioencoder_8h.md index d501dddfc1..b193a3f776 100644 --- a/en/application-dev/reference/native-apis/native__avcodec__audioencoder_8h.md +++ b/en/application-dev/reference/native-apis/native__avcodec__audioencoder_8h.md @@ -1,6 +1,5 @@ # native_avcodec_audioencoder.h - ## Overview The **native_avcodec_audioencoder.h** file declares the native APIs used for audio encoding. @@ -13,26 +12,24 @@ The **native_avcodec_audioencoder.h** file declares the native APIs used for aud [AudioEncoder](_audio_encoder.md) - ## Summary - ### Functions -| Name| Description| -| -------- | -------- | -| \*[OHOS::Media::OH_AudioEncoder_CreateByMime](_audio_encoder.md#oh_audioencoder_createbymime) (const char \*mime) | Creates an audio encoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases.| -| \*[OHOS::Media::OH_AudioEncoder_CreateByName](_audio_encoder.md#oh_audioencoder_createbyname) (const char \*name) | Creates an audio encoder instance based on an encoder name. To use this function, you must know the exact name of the encoder.| -| [OHOS::Media::OH_AudioEncoder_Destroy](_audio_encoder.md#oh_audioencoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of an audio encoder and destroys the encoder instance.| -| [OHOS::Media::OH_AudioEncoder_SetCallback](_audio_encoder.md#oh_audioencoder_setcallback) (OH_AVCodec \*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio encoder.| -| [OHOS::Media::OH_AudioEncoder_Configure](_audio_encoder.md#oh_audioencoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures an audio encoder. Typically, you need to configure the description information about the audio track to be encoded.| -| [OHOS::Media::OH_AudioEncoder_Prepare](_audio_encoder.md#oh_audioencoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for an audio encoder. This function must be called after **Configure**.| -| [OHOS::Media::OH_AudioEncoder_Start](_audio_encoder.md#oh_audioencoder_start) (OH_AVCodec \*codec) | Starts an audio encoder. This function can be called only after the encoder is prepared successfully.| -| [OHOS::Media::OH_AudioEncoder_Stop](_audio_encoder.md#oh_audioencoder_stop) (OH_AVCodec \*codec) | Stops an audio encoder.| -| [OHOS::Media::OH_AudioEncoder_Flush](_audio_encoder.md#oh_audioencoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of an audio encoder.| -| [OHOS::Media::OH_AudioEncoder_Reset](_audio_encoder.md#oh_audioencoder_reset) (OH_AVCodec \*codec) | Resets an audio encoder.| -| \*[OHOS::Media::OH_AudioEncoder_GetOutputDescription](_audio_encoder.md#oh_audioencoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the description information about the output data of an audio encoder. For details, see **OH_AVFormat**.| -| [OHOS::Media::OH_AudioEncoder_SetParameter](_audio_encoder.md#oh_audioencoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio encoder.| -| [OHOS::Media::OH_AudioEncoder_PushInputData](_audio_encoder.md#oh_audioencoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio encoder.| -| [OHOS::Media::OH_AudioEncoder_FreeOutputData](_audio_encoder.md#oh_audioencoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of an audio encoder.| -| [OHOS::Media::OH_AudioEncoder_IsValid](_audio_encoder.md#oh_audioencoder_isvalid) (OH_AVCodec \*codec, bool \*isValid) | Checks whether an audio encoder instance is valid.| +| Name | Description | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | +| \*[OHOS::Media::OH_AudioEncoder_CreateByMime](_audio_encoder.md#oh_audioencoder_createbymime) (const char \*mime) | Creates an audio encoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases. | +| \*[OHOS::Media::OH_AudioEncoder_CreateByName](_audio_encoder.md#oh_audioencoder_createbyname) (const char \*name) | Creates an audio encoder instance based on an encoder name. To use this function, you must know the exact name of the encoder.| +| [OHOS::Media::OH_AudioEncoder_Destroy](_audio_encoder.md#oh_audioencoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of an audio encoder and destroys the encoder instance. | +| [OHOS::Media::OH_AudioEncoder_SetCallback](_audio_encoder.md#oh_audioencoder_setcallback) (OH_AVCodec \*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio encoder. | +| [OHOS::Media::OH_AudioEncoder_Configure](_audio_encoder.md#oh_audioencoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures an audio encoder. Typically, you need to configure the description information about the audio track to be encoded. | +| [OHOS::Media::OH_AudioEncoder_Prepare](_audio_encoder.md#oh_audioencoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for an audio encoder. This function must be called after **Configure**. | +| [OHOS::Media::OH_AudioEncoder_Start](_audio_encoder.md#oh_audioencoder_start) (OH_AVCodec \*codec) | Starts an audio encoder. This function can be called only after the encoder is prepared successfully. | +| [OHOS::Media::OH_AudioEncoder_Stop](_audio_encoder.md#oh_audioencoder_stop) (OH_AVCodec \*codec) | Stops an audio encoder. | +| [OHOS::Media::OH_AudioEncoder_Flush](_audio_encoder.md#oh_audioencoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of an audio encoder. | +| [OHOS::Media::OH_AudioEncoder_Reset](_audio_encoder.md#oh_audioencoder_reset) (OH_AVCodec \*codec) | Resets an audio encoder. | +| \*[OHOS::Media::OH_AudioEncoder_GetOutputDescription](_audio_encoder.md#oh_audioencoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the description information about the output data of an audio encoder. For details, see **OH_AVFormat**. | +| [OHOS::Media::OH_AudioEncoder_SetParameter](_audio_encoder.md#oh_audioencoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio encoder. | +| [OHOS::Media::OH_AudioEncoder_PushInputData](_audio_encoder.md#oh_audioencoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio encoder. | +| [OHOS::Media::OH_AudioEncoder_FreeOutputData](_audio_encoder.md#oh_audioencoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of an audio encoder. | +| [OHOS::Media::OH_AudioEncoder_IsValid](_audio_encoder.md#oh_audioencoder_isvalid) (OH_AVCodec \*codec, bool \*isValid) | Checks whether an audio encoder instance is valid. | diff --git a/en/application-dev/reference/native-apis/native__avcodec__base_8h.md b/en/application-dev/reference/native-apis/native__avcodec__base_8h.md index 34ea191f75..7fbfa133f6 100644 --- a/en/application-dev/reference/native-apis/native__avcodec__base_8h.md +++ b/en/application-dev/reference/native-apis/native__avcodec__base_8h.md @@ -19,115 +19,115 @@ The **native_avcodec_base.h** file declares the common structs, character consta ### Structs -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) | Defines the description information about the buffer of an **OH_AVCodec** instance.| -| [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) | Defines all the asynchronous callback function pointers of an **OH_AVCodec** instance.| +| [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) | Defines the description information about the buffer of an **OH_AVCodec** instance.| +| [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) | Defines all the asynchronous callback function pointers of an **OH_AVCodec** instance.| ### Types -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_AVCodecBufferFlags](_codec_base.md#oh_avcodecbufferflags) | Defines an enum that enumerates the flags for the buffer of an **OH_AVCodec** instance.| -| [OH_AVOutputFormat](_codec_base.md#oh_avoutputformat) | Defines an enum that enumerates the output file formats of a muxer.| -| [OH_AVCodecBufferAttr](_codec_base.md#oh_avcodecbufferattr) | Defines a struct for the description information about the buffer of an **OH_AVCodec** instance.| -| (\*[OH_AVCodecOnError](_codec_base.md#oh_avcodeconerror)) (OH_AVCodec \*codec, int32_t errorCode, void \*userData) | Defines the pointer to the function that is called to report error information when an error occurs during the running of an **OH_AVCodec** instance.| -| (\*[OH_AVCodecOnStreamChanged](_codec_base.md#oh_avcodeconstreamchanged)) (OH_AVCodec \*codec, OH_AVFormat \*format, void \*userData) | Defines the pointer to the function that is called to report the new stream description when the output stream changes.| -| (\*[OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata)) (OH_AVCodec \*codec, uint32_t index, OH_AVMemory \*data, void \*userData) | Defines the pointer to the function that is called when new input data is required during the running of an **OH_AVCodec** instance. The function carries a buffer to fill in new input data.| -| (\*[OH_AVCodecOnNewOutputData](_codec_base.md#oh_avcodeconnewoutputdata)) (OH_AVCodec \*codec, uint32_t index, OH_AVMemory \*data, [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) \*attr, void \*userData) | Defines the pointer to the function that is called when new output data is generated during the running of an **OH_AVCodec** instance. The function carries a buffer filled with new output data.| -| [OH_AVCodecAsyncCallback](_codec_base.md#oh_avcodecasynccallback) | Defines a struct for all the asynchronous callback function pointers of an **OH_AVCodec** instance.| -| [OH_MediaType](_codec_base.md#oh_mediatype) | Defines an enum that enumerates the media types.| -| [OH_AVCProfile](_codec_base.md#oh_avcprofile) | Defines an enum that enumerates the Advanced Video Coding (AVC) profiles.| -| [OH_HEVCProfile](_codec_base.md#oh_hevcprofile) | Defines an enum that enumerates the High Efficiency Video Coding (HEVC) profiles.| -| [OH_AACProfile](_codec_base.md#oh_aacprofile) | Defines an enum that enumerates the Advanced Audio Coding (AAC) profiles.| -| [OH_AVSeekMode](_codec_base.md#oh_avseekmode) | Defines an enum that enumerates the seek modes.| -| [OH_ColorPrimary](_codec_base.md#oh_colorprimary) | Defines an enum that enumerates the primary colors.| -| [OH_TransferCharacteristic](_codec_base.md#oh_transfercharacteristic) | Defines an enum that enumerates the transfer characteristics.| -| [OH_MatrixCoefficient](_codec_base.md#oh_matrixcoefficient) | Defines an enum that enumerates the matrix coefficients.| -| [OH_BitsPerSample](_codec_base.md#oh_bitspersample) | Defines an enum that enumerates the number of audio bits for each coded sample.| +| [OH_AVCodecBufferFlags](_codec_base.md#oh_avcodecbufferflags) | Defines an enum that enumerates the flags for the buffer of an **OH_AVCodec** instance.| +| [OH_AVOutputFormat](_codec_base.md#oh_avoutputformat) | Defines an enum that enumerates the output file formats of a muxer.| +| [OH_AVCodecBufferAttr](_codec_base.md#oh_avcodecbufferattr) | Defines a struct for the description information about the buffer of an **OH_AVCodec** instance.| +| (\*[OH_AVCodecOnError](_codec_base.md#oh_avcodeconerror)) (OH_AVCodec \*codec, int32_t errorCode, void \*userData) | Defines the pointer to the function that is called to report error information when an error occurs during the running of an **OH_AVCodec** instance.| +| (\*[OH_AVCodecOnStreamChanged](_codec_base.md#oh_avcodeconstreamchanged)) (OH_AVCodec \*codec, OH_AVFormat \*format, void \*userData) | Defines the pointer to the function that is called to report the new stream description when the output stream changes.| +| (\*[OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata)) (OH_AVCodec \*codec, uint32_t index, OH_AVMemory \*data, void \*userData) | Defines the pointer to the function that is called when new input data is required during the running of an **OH_AVCodec** instance. The function carries a buffer to fill in new input data.| +| (\*[OH_AVCodecOnNewOutputData](_codec_base.md#oh_avcodeconnewoutputdata)) (OH_AVCodec \*codec, uint32_t index, OH_AVMemory \*data, [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) \*attr, void \*userData) | Defines the pointer to the function that is called when new output data is generated during the running of an **OH_AVCodec** instance. The function carries a buffer filled with new output data.| +| [OH_AVCodecAsyncCallback](_codec_base.md#oh_avcodecasynccallback) | Defines a struct for all the asynchronous callback function pointers of an **OH_AVCodec** instance.| +| [OH_MediaType](_codec_base.md#oh_mediatype) | Defines an enum that enumerates the media types.| +| [OH_AVCProfile](_codec_base.md#oh_avcprofile) | Defines an enum that enumerates the Advanced Video Coding (AVC) profiles.| +| [OH_HEVCProfile](_codec_base.md#oh_hevcprofile) | Defines an enum that enumerates the High Efficiency Video Coding (HEVC) profiles.| +| [OH_AACProfile](_codec_base.md#oh_aacprofile) | Defines an enum that enumerates the Advanced Audio Coding (AAC) profiles.| +| [OH_AVSeekMode](_codec_base.md#oh_avseekmode) | Defines an enum that enumerates the seek modes.| +| [OH_ColorPrimary](_codec_base.md#oh_colorprimary) | Defines an enum that enumerates the primary colors.| +| [OH_TransferCharacteristic](_codec_base.md#oh_transfercharacteristic) | Defines an enum that enumerates the transfer characteristics.| +| [OH_MatrixCoefficient](_codec_base.md#oh_matrixcoefficient) | Defines an enum that enumerates the matrix coefficients.| +| [OH_BitsPerSample](_codec_base.md#oh_bitspersample) | Defines an enum that enumerates the number of audio bits for each coded sample.| ### Enums -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_AVCodecBufferFlags](_codec_base.md#oh_avcodecbufferflags) {
**AVCODEC_BUFFER_FLAGS_NONE** = 0, **AVCODEC_BUFFER_FLAGS_EOS** = 1 << 0, **AVCODEC_BUFFER_FLAGS_SYNC_FRAME** = 1 << 1, **AVCODEC_BUFFER_FLAGS_INCOMPLETE_FRAME** = 1 << 2,
**AVCODEC_BUFFER_FLAGS_CODEC_DATA** = 1 << 3
} | Enumerates the flags for the buffer of an **OH_AVCodec** instance.| -| [OH_AVOutputFormat](_codec_base.md#oh_avoutputformat) { **AV_OUTPUT_FORMAT_DEFAULT** = 0, **AV_OUTPUT_FORMAT_MPEG_4** = 2, **AV_OUTPUT_FORMAT_M4A** = 6 } | Enumerates the output file formats of a muxer.| -| [OH_MediaType](_codec_base.md#oh_mediatype) { **MEDIA_TYPE_AUD** = 0, **MEDIA_TYPE_VID** = 1 } | Enumerates the media types.| -| [OH_AVCProfile](_codec_base.md#oh_avcprofile) { **AVC_PROFILE_BASELINE** = 0, **AVC_PROFILE_HIGH** = 4, **AVC_PROFILE_MAIN** = 8 } | Enumerates the AVC profiles.| -| [OH_HEVCProfile](_codec_base.md#oh_hevcprofile) {
**HEVC_PROFILE_MAIN** = 0, **HEVC_PROFILE_MAIN_10** = 1, **HEVC_PROFILE_MAIN_STILL** = 2, **HEVC_PROFILE_MAIN_10_HDR10** = 3,
**HEVC_PROFILE_MAIN_10_HDR10_PLUS** = 4
} | Enumerates the HEVC profiles.| -| [OH_AACProfile](_codec_base.md#oh_aacprofile) { **AAC_PROFILE_LC** = 0 } | Enumerates the AAC profiles.| -| [OH_AVSeekMode](_codec_base.md#oh_avseekmode) { **SEEK_MODE_NEXT_SYNC** = 0, **SEEK_MODE_PREVIOUS_SYNC**, **SEEK_MODE_CLOSEST_SYNC** } | Enumerates the seek modes.| -| [OH_ColorPrimary](_codec_base.md#oh_colorprimary) {
**COLOR_PRIMARY_BT709** = 1, **COLOR_PRIMARY_UNSPECIFIED** = 2, **COLOR_PRIMARY_BT470_M** = 4, **COLOR_PRIMARY_BT601_625** = 5,
**COLOR_PRIMARY_BT601_525** = 6, **COLOR_PRIMARY_SMPTE_ST240** = 7, **COLOR_PRIMARY_GENERIC_FILM** = 8, **COLOR_PRIMARY_BT2020** = 9,
**COLOR_PRIMARY_SMPTE_ST428** = 10, **COLOR_PRIMARY_P3DCI** = 11, **COLOR_PRIMARY_P3D65** = 12
} | Enumerates the primary colors.| -| [OH_TransferCharacteristic](_codec_base.md#oh_transfercharacteristic) {
**TRANSFER_CHARACTERISTIC_BT709** = 1, **TRANSFER_CHARACTERISTIC_UNSPECIFIED** = 2, **TRANSFER_CHARACTERISTIC_GAMMA_2_2** = 4, **TRANSFER_CHARACTERISTIC_GAMMA_2_8** = 5,
**TRANSFER_CHARACTERISTIC_BT601** = 6, **TRANSFER_CHARACTERISTIC_SMPTE_ST240** = 7, **TRANSFER_CHARACTERISTIC_LINEAR** = 8, **TRANSFER_CHARACTERISTIC_LOG** = 9,
**TRANSFER_CHARACTERISTIC_LOG_SQRT** = 10, **TRANSFER_CHARACTERISTIC_IEC_61966_2_4** = 11, **TRANSFER_CHARACTERISTIC_BT1361** = 12, **TRANSFER_CHARACTERISTIC_IEC_61966_2_1** = 13,
**TRANSFER_CHARACTERISTIC_BT2020_10BIT** = 14, **TRANSFER_CHARACTERISTIC_BT2020_12BIT** = 15, **TRANSFER_CHARACTERISTIC_PQ** = 16, **TRANSFER_CHARACTERISTIC_SMPTE_ST428** = 17,
**TRANSFER_CHARACTERISTIC_HLG** = 18
} | Enumerates the transfer characteristics.| -| [OH_MatrixCoefficient](_codec_base.md#oh_matrixcoefficient) {
**MATRIX_COEFFICIENT_IDENTITY** = 0, **MATRIX_COEFFICIENT_BT709** = 1, **MATRIX_COEFFICIENT_UNSPECIFIED** = 2, **MATRIX_COEFFICIENT_FCC** = 4,
**MATRIX_COEFFICIENT_BT601_625** = 5, **MATRIX_COEFFICIENT_BT601_525** = 6, **MATRIX_COEFFICIENT_SMPTE_ST240** = 7, **MATRIX_COEFFICIENT_YCGCO** = 8,
**MATRIX_COEFFICIENT_BT2020_NCL** = 9, **MATRIX_COEFFICIENT_BT2020_CL** = 10, **MATRIX_COEFFICIENT_SMPTE_ST2085** = 11, **MATRIX_COEFFICIENT_CHROMATICITY_NCL** = 12,
**MATRIX_COEFFICIENT_CHROMATICITY_CL** = 13, **MATRIX_COEFFICIENT_ICTCP** = 14
} | Enumerates the matrix coefficients.| -| [OH_BitsPerSample](_codec_base.md#oh_bitspersample) {
**SAMPLE_U8** = 0, **SAMPLE_S16LE** = 1, **SAMPLE_S24LE** = 2, **SAMPLE_S32LE** = 3,
**SAMPLE_F32LE** = 4, **SAMPLE_U8P** = 5, **SAMPLE_S16P** = 6, **SAMPLE_S24P** = 7,
**SAMPLE_S32P** = 8, **SAMPLE_F32P** = 9, **INVALID_WIDTH** = -1
} | Enumerates the number of audio bits for each coded sample.| +| [OH_AVCodecBufferFlags](_codec_base.md#oh_avcodecbufferflags) {
    **AVCODEC_BUFFER_FLAGS_NONE** = 0,
    **AVCODEC_BUFFER_FLAGS_EOS** = 1 << 0,
    **AVCODEC_BUFFER_FLAGS_SYNC_FRAME** = 1 << 1,
    **AVCODEC_BUFFER_FLAGS_INCOMPLETE_FRAME** = 1 << 2,
    **AVCODEC_BUFFER_FLAGS_CODEC_DATA** = 1 << 3
} | Enumerates the flags for the buffer of an **OH_AVCodec** instance. | +| [OH_AVOutputFormat](_codec_base.md#oh_avoutputformat) {
    **AV_OUTPUT_FORMAT_DEFAULT** = 0,
    **AV_OUTPUT_FORMAT_MPEG_4** = 2,
    **AV_OUTPUT_FORMAT_M4A** = 6
} | Enumerates the output file formats of a muxer. | +| [OH_MediaType](_codec_base.md#oh_mediatype) {
    **MEDIA_TYPE_AUD** = 0,
    **MEDIA_TYPE_VID** = 1
} | Enumerates the media types. | +| [OH_AVCProfile](_codec_base.md#oh_avcprofile) {
    **AVC_PROFILE_BASELINE** = 0,
    **AVC_PROFILE_HIGH** = 4,
    **AVC_PROFILE_MAIN** = 8
} | Enumerates the AVC profiles. | +| [OH_HEVCProfile](_codec_base.md#oh_hevcprofile) {
    **HEVC_PROFILE_MAIN** = 0,
    **HEVC_PROFILE_MAIN_10** = 1,
    **HEVC_PROFILE_MAIN_STILL** = 2,
    **HEVC_PROFILE_MAIN_10_HDR10** = 3,
    **HEVC_PROFILE_MAIN_10_HDR10_PLUS** = 4
} | Enumerates the HEVC profiles. | +| [OH_AACProfile](_codec_base.md#oh_aacprofile) {
    **AAC_PROFILE_LC** = 0
} | Enumerates the AAC profiles. | +| [OH_AVSeekMode](_codec_base.md#oh_avseekmode) {
    **SEEK_MODE_NEXT_SYNC** = 0,
    **SEEK_MODE_PREVIOUS_SYNC**,
    **SEEK_MODE_CLOSEST_SYNC**
} | Enumerates the seek modes. | +| [OH_ColorPrimary](_codec_base.md#oh_colorprimary) {
    **COLOR_PRIMARY_BT709** = 1,
    **COLOR_PRIMARY_UNSPECIFIED** = 2,
    **COLOR_PRIMARY_BT470_M** = 4,
    **COLOR_PRIMARY_BT601_625** = 5,
    **COLOR_PRIMARY_BT601_525** = 6,
    **COLOR_PRIMARY_SMPTE_ST240** = 7,
    **COLOR_PRIMARY_GENERIC_FILM** = 8,
    **COLOR_PRIMARY_BT2020** = 9,
    **COLOR_PRIMARY_SMPTE_ST428** = 10,
    **COLOR_PRIMARY_P3DCI** = 11,
    **COLOR_PRIMARY_P3D65** = 12
} | Enumerates the primary colors.| +| [OH_TransferCharacteristic](_codec_base.md#oh_transfercharacteristic) {
    **TRANSFER_CHARACTERISTIC_BT709** = 1,
    **TRANSFER_CHARACTERISTIC_UNSPECIFIED** = 2,
    **TRANSFER_CHARACTERISTIC_GAMMA_2_2** = 4,
    **TRANSFER_CHARACTERISTIC_GAMMA_2_8** = 5,
    **TRANSFER_CHARACTERISTIC_BT601** = 6,
    **TRANSFER_CHARACTERISTIC_SMPTE_ST240** = 7,
    **TRANSFER_CHARACTERISTIC_LINEAR** = 8,
    **TRANSFER_CHARACTERISTIC_LOG** = 9,
    **TRANSFER_CHARACTERISTIC_LOG_SQRT** = 10,
    **TRANSFER_CHARACTERISTIC_IEC_61966_2_4** = 11,
    **TRANSFER_CHARACTERISTIC_BT1361** = 12,
    **TRANSFER_CHARACTERISTIC_IEC_61966_2_1** = 13,
    **TRANSFER_CHARACTERISTIC_BT2020_10BIT** = 14,
    **TRANSFER_CHARACTERISTIC_BT2020_12BIT** = 15,
    **TRANSFER_CHARACTERISTIC_PQ** = 16,
    **TRANSFER_CHARACTERISTIC_SMPTE_ST428** = 17,
    **TRANSFER_CHARACTERISTIC_HLG** = 18
} | Enumerates the transfer characteristics.| +| [OH_MatrixCoefficient](_codec_base.md#oh_matrixcoefficient) {
    **MATRIX_COEFFICIENT_IDENTITY** = 0,
    **MATRIX_COEFFICIENT_BT709** = 1,
    **MATRIX_COEFFICIENT_UNSPECIFIED** = 2,
    **MATRIX_COEFFICIENT_FCC** = 4,
    **MATRIX_COEFFICIENT_BT601_625** = 5,
    **MATRIX_COEFFICIENT_BT601_525** = 6,
    **MATRIX_COEFFICIENT_SMPTE_ST240** = 7,
    **MATRIX_COEFFICIENT_YCGCO** = 8,
    **MATRIX_COEFFICIENT_BT2020_NCL** = 9,
    **MATRIX_COEFFICIENT_BT2020_CL** = 10,
    **MATRIX_COEFFICIENT_SMPTE_ST2085** = 11,
    **MATRIX_COEFFICIENT_CHROMATICITY_NCL** = 12,
    **MATRIX_COEFFICIENT_CHROMATICITY_CL** = 13,
    **MATRIX_COEFFICIENT_ICTCP** = 14
} | Enumerates the matrix coefficients.| +| [OH_BitsPerSample](_codec_base.md#oh_bitspersample) {
    **SAMPLE_U8** = 0,
    **SAMPLE_S16LE** = 1,
    **SAMPLE_S24LE** = 2,
    **SAMPLE_S32LE** = 3,
    **SAMPLE_F32LE** = 4,i
    **SAMPLE_U8P** = 5,
    **SAMPLE_S16P** = 6,
    **SAMPLE_S24P** = 7,
    **SAMPLE_S32P** = 8,
    **SAMPLE_F32P** = 9,
    **INVALID_WIDTH** = -1
} | Enumerates the number of audio bits for each coded sample.| ### Variables -| Name| Description| +| Name| Description| | -------- | -------- | -| [OH_AVCodecBufferAttr::pts](_o_h___a_v_codec_buffer_attr.md#pts) | Defines the display timestamp of the buffer, in microseconds.| -| [OH_AVCodecBufferAttr::size](_o_h___a_v_codec_buffer_attr.md#size) | Defines the size of data contained in the buffer, in bytes.| -| [OH_AVCodecBufferAttr::offset](_o_h___a_v_codec_buffer_attr.md#offset) | Defines the offset of valid data in the buffer.| -| [OH_AVCodecBufferAttr::flags](_o_h___a_v_codec_buffer_attr.md#flags) | Defines the flags of the buffer. It is a combination of multiple [OH_AVCodecBufferFlags](_codec_base.md#oh_avcodecbufferflags).| -| [OH_AVCodecAsyncCallback::onError](_o_h___a_v_codec_async_callback.md#onerror) | Defines the callback used to report a codec operation error. For details, see [OH_AVCodecOnError](_codec_base.md#oh_avcodeconerror).| -| [OH_AVCodecAsyncCallback::onStreamChanged](_o_h___a_v_codec_async_callback.md#onstreamchanged) | Defines the callback used to report a codec stream change. For details, see [OH_AVCodecOnStreamChanged](_codec_base.md#oh_avcodeconstreamchanged).| -| [OH_AVCodecAsyncCallback::onNeedInputData](_o_h___a_v_codec_async_callback.md#onneedinputdata) | Defines the callback used to report input data required. For details, see [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata).| -| [OH_AVCodecAsyncCallback::onNeedOutputData](_o_h___a_v_codec_async_callback.md#onneedinputdata) | Defines the callback used to report output data generated. For details, see [OH_AVCodecOnNewOutputData](_codec_base.md#oh_avcodeconnewoutputdata).| -| \*[OH_AVCODEC_MIMETYPE_VIDEO_AVC](_codec_base.md#oh_avcodec_mimetype_video_avc) | Defines the pointer to the Multipurpose Internet Mail Extension (MIME) type for AVC video codec.| -| \*[OH_AVCODEC_MIMETYPE_AUDIO_AAC](_codec_base.md#oh_avcodec_mimetype_audio_aac) | Defines the pointer to the MIME type for AAC audio codec.| -| \*[OH_AVCODEC_MIMETYPE_VIDEO_MPEG4](_codec_base.md#oh_avcodec_mimetype_video_mpeg4) | Defines the pointer to the MIME type for MPEG4 video codec.| -| \*[OH_AVCODEC_MIMETYPE_VIDEO_HEVC](_codec_base.md#oh_avcodec_mimetype_video_hevc) | Defines the pointer to the MIME type for HEVC video codec.| -| \*[OH_AVCODEC_MIMETYPE_AUDIO_MPEG](_codec_base.md#oh_avcodec_mimetype_audio_mpeg) | Defines the pointer to the MIME type for MPEG audio codec.| -| \*[OH_AVCODEC_MIMETYPE_IMAGE_JPG](_codec_base.md#oh_avcodec_mimetype_image_jpg) | Defines the pointer to the MIME type for JPG image codec.| -| \*[OH_AVCODEC_MIMETYPE_IMAGE_PNG](_codec_base.md#oh_avcodec_mimetype_image_png) | Defines the pointer to the MIME type for PNG image codec.| -| \*[OH_AVCODEC_MIMETYPE_IMAGE_BMP](_codec_base.md#oh_avcodec_mimetype_image_bmp) | Defines the pointer to the MIME type for BMP image codec.| -| \*[OH_AVCODEC_MIMETYPE_AUDIO_FLAC](_codec_base.md#oh_avcodec_mimetype_audio_flac) | Defines the pointer to the MIME type for FLAC audio codec.| -| \*[OH_AVCODEC_MIMETYPE_AUDIO_VORBIS](_codec_base.md#oh_avcodec_mimetype_audio_vorbis) | Defines the pointer to the MIME type for VORBIS audio codec.| -| \*[OH_ED_KEY_TIME_STAMP](_codec_base.md#oh_ed_key_time_stamp) | Defines the pointer to the timestamp in the extra data of the surface. The value type is int64.| -| \*[OH_ED_KEY_EOS](_codec_base.md#oh_ed_key_eos) | Defines the pointer to the end of stream (EOS) in the extra data of the surface. The value type is Boolean.| -| \*[OH_MD_KEY_TRACK_TYPE](_codec_base.md#oh_md_key_track_type) | Defines the pointer to a container for storing media descriptions.| -| \*[OH_MD_KEY_CODEC_MIME](_codec_base.md#oh_md_key_codec_mime) | Define the pointer to the MIME type of codec. The value is a string.| -| \*[OH_MD_KEY_DURATION](_codec_base.md#oh_md_key_duration) | Defines the pointer to the duration. The value type is int64_t.| -| \*[OH_MD_KEY_BITRATE](_codec_base.md#oh_md_key_bitrate) | Defines the pointer to the bit rate. The value type is uint32_t.| -| \*[OH_MD_KEY_MAX_INPUT_SIZE](_codec_base.md#oh_md_key_max_input_size) | Defines the pointer to the maximum input size. The value type is uint32_t.| -| \*[OH_MD_KEY_WIDTH](_codec_base.md#oh_md_key_width) | Defines the pointer to the video width. The value type is uint32_t.| -| \*[OH_MD_KEY_HEIGHT](_codec_base.md#oh_md_key_height) | Defines the pointer to the video height. The value type is uint32_t.| -| \*[OH_MD_KEY_PIXEL_FORMAT](_codec_base.md#oh_md_key_pixel_format) | Defines the pointer to the video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat).| -| \*[OH_MD_KEY_RANGE_FLAG](_codec_base.md#oh_md_key_range_flag) | Defines the pointer to the video YUV value range flag. The value type is Boolean.| -| \*[OH_MD_KEY_COLOR_PRIMARIES](_codec_base.md#oh_md_key_color_primaries) | Defines the pointer to the primary color of the video. The value type is int32_t.| -| \*[OH_MD_KEY_TRANSFER_CHARACTERISTICS](_codec_base.md#oh_md_key_transfer_characteristics) | Defines the pointer to the video transfer characteristics. The value type is int32_t.| -| \*[OH_MD_KEY_MATRIX_COEFFICIENTS](_codec_base.md#oh_md_key_matrix_coefficients) | Defines the pointer to the video matrix coefficient. The value type is int32_t.| -| \*[OH_MD_KEY_AUDIO_SAMPLE_FORMAT](_codec_base.md#oh_md_key_audio_sample_format) | Defines the pointer to the original audio format. The value type is uint32_t.| -| \*[OH_MD_KEY_FRAME_RATE](_codec_base.md#oh_md_key_frame_rate) | Defines the pointer to the video frame rate. The value is a double-precision floating point number.| -| \*[OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE](_codec_base.md#oh_md_key_video_encode_bitrate_mode) | Defines the pointer to the video encoding bit rate mode. The value type is int32_t. For details, see [OH_VideoEncodeBitrateMode](_video_encoder.md#oh_videoencodebitratemode).| -| \*[OH_MD_KEY_PROFILE](_codec_base.md#oh_md_key_profile) | Defines the pointer to the encoding template. The value is a number. For details, see [OH_AVCProfile](_codec_base.md#oh_avcprofile), [OH_AACProfile](_codec_base.md#oh_aacprofile), or [CodecBase](_codec_base.md#oh_hevcprofile).| -| \*[OH_MD_KEY_AUD_CHANNEL_COUNT](_codec_base.md#oh_md_key_aud_channel_count) | Defines the pointer to the number of audio channels. The value type is uint32_t.| -| \*[OH_MD_KEY_AUD_SAMPLE_RATE](_codec_base.md#oh_md_key_aud_sample_rate) | Defines the pointer to the audio sampling rate. The value type is uint32_t.| -| \*[OH_MD_KEY_I_FRAME_INTERVAL](_codec_base.md#oh_md_key_i_frame_interval) | Defines the pointer to the key frame interval, in milliseconds. The value type is int32_t.| -| \*[OH_MD_KEY_ROTATION](_codec_base.md#oh_md_key_rotation) | Defines the pointer to the rotation angle of the surface. The value type is int32_t, and the value range is {0, 90, 180, 270}. The default value is 0.| -| \*[OH_MD_KEY_CODEC_CONFIG](_codec_base.md#oh_md_key_codec_config) | Defines the pointer to the codec-specific data. The value type is uint8_t\*.| -| \*[OH_MD_KEY_REQUEST_I_FRAME](_codec_base.md#oh_md_key_request_i_frame) | Defines the pointer to the request for immediate encoding of I-frames. The value type is Boolean.| -| \*[OH_MD_KEY_QUALITY](_codec_base.md#oh_md_key_quality) | Defines the pointer to the required encoding quality. The value type is uint32_t. This key applies only to encoders configured in constant quality mode.| -| \*[OH_MD_KEY_CHANNEL_LAYOUT](_codec_base.md#oh_md_key_channel_layout) | Defines the pointer to the required encoding channel layout. The value type is int64_t. This key applies only to encoders.| -| \*[OH_MD_KEY_BITS_PER_CODED_SAMPLE](_codec_base.md#oh_md_key_bits_per_coded_sample) | Defines the pointer to the number of bits for each coded sample. The value type is uint32_t. This key applies to FLAC encoders.| -| \*[OH_MD_KEY_AAC_IS_ADTS](_codec_base.md#oh_md_key_aac_is_adts) | Defines the pointer to the AAC format. The value type is uint32_t. This key applies to AAC decoders.| -| \*[OH_MD_KEY_SBR](_codec_base.md#oh_md_key_sbr) | Defines the pointer to the AAC SBR format. The value type is uint32_t. This key applies to AAC encoders.| -| \*[OH_MD_KEY_COMPLIANCE_LEVEL](_codec_base.md#oh_md_key_compliance_level) | Defines the pointer to the FLAC compliance level. The value type is int32_t.| -| \*[OH_MD_KEY_IDENTIFICATION_HEADER](_codec_base.md#oh_md_key_identification_header) | Defines the pointer to the VORBIS identification header. The value type is uint8_t\*. This key applies only to VORBIS decoders.| -| \*[OH_MD_KEY_SETUP_HEADER](_codec_base.md#oh_md_key_setup_header) | Defines the pointer to the VORBIS setup header. The value type is uint8_t\*. This key applies only to VORBIS decoders.| -| \*[OH_MD_KEY_TITLE](_codec_base.md#oh_md_key_title) | Defines the pointer to the title of the input media. The value is a string.| -| \*[OH_MD_KEY_ARTIST](_codec_base.md#oh_md_key_artist) | Defines the pointer to the artist of the input media. The value is a string.| -| \*[OH_MD_KEY_ALBUM](_codec_base.md#oh_md_key_album) | Defines the pointer to the album of the input media. The value is a string.| -| \*[OH_MD_KEY_ALBUM_ARTIST](_codec_base.md#oh_md_key_album_artist) | Defines the pointer to the album_artist of the input media. The value is a string.| -| \*[OH_MD_KEY_DATE](_codec_base.md#oh_md_key_date) | Defines the pointer to the date of the input media. The value is a string.| -| \*[OH_MD_KEY_COMMENT](_codec_base.md#oh_md_key_comment) | Defines the pointer to the comment of the input media. The value is a string.| -| \*[OH_MD_KEY_GENRE](_codec_base.md#oh_md_key_genre) | Defines the pointer to the genre of the input media. The value is a string.| -| \*[OH_MD_KEY_COPYRIGHT](_codec_base.md#oh_md_key_copyright) | Defines the pointer to the copyright of the input media. The value is a string.| -| \*[OH_MD_KEY_LANGUAGE](_codec_base.md#oh_md_key_language) | Defines the pointer to the language of the input media. The value is a string.| -| \*[OH_MD_KEY_DESCRIPTION](_codec_base.md#oh_md_key_description) | Defines the pointer to the description of the input media. The value is a string.| -| \*[OH_MD_KEY_LYRICS](_codec_base.md#oh_md_key_lyrics) | Defines the pointer to the lyrics of the input media. The value is a string.| -| \*[OH_MD_KEY_TRACK_COUNT](_codec_base.md#oh_md_key_track_count) | Defines the pointer to the track count of the input media. The value type is uint32_t.| +| [OH_AVCodecBufferAttr::pts](_o_h___a_v_codec_buffer_attr.md#pts) | Defines the display timestamp of the buffer, in microseconds.| +| [OH_AVCodecBufferAttr::size](_o_h___a_v_codec_buffer_attr.md#size) | Defines the size of data contained in the buffer, in bytes.| +| [OH_AVCodecBufferAttr::offset](_o_h___a_v_codec_buffer_attr.md#offset) | Defines the offset of valid data in the buffer.| +| [OH_AVCodecBufferAttr::flags](_o_h___a_v_codec_buffer_attr.md#flags) | Defines the flags of the buffer. It is a combination of multiple [OH_AVCodecBufferFlags](_codec_base.md#oh_avcodecbufferflags).| +| [OH_AVCodecAsyncCallback::onError](_o_h___a_v_codec_async_callback.md#onerror) | Defines the callback used to report a codec operation error. For details, see [OH_AVCodecOnError](_codec_base.md#oh_avcodeconerror).| +| [OH_AVCodecAsyncCallback::onStreamChanged](_o_h___a_v_codec_async_callback.md#onstreamchanged) | Defines the callback used to report a codec stream change. For details, see [OH_AVCodecOnStreamChanged](_codec_base.md#oh_avcodeconstreamchanged).| +| [OH_AVCodecAsyncCallback::onNeedInputData](_o_h___a_v_codec_async_callback.md#onneedinputdata) | Defines the callback used to report input data required. For details, see [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata).| +| [OH_AVCodecAsyncCallback::onNeedOutputData](_o_h___a_v_codec_async_callback.md#onneedinputdata) | Defines the callback used to report output data generated. For details, see [OH_AVCodecOnNewOutputData](_codec_base.md#oh_avcodeconnewoutputdata).| +| \*[OH_AVCODEC_MIMETYPE_VIDEO_AVC](_codec_base.md#oh_avcodec_mimetype_video_avc) | Defines the pointer to the Multipurpose Internet Mail Extension (MIME) type for AVC video codec.| +| \*[OH_AVCODEC_MIMETYPE_AUDIO_AAC](_codec_base.md#oh_avcodec_mimetype_audio_aac) | Defines the pointer to the MIME type for AAC audio codec.| +| \*[OH_AVCODEC_MIMETYPE_VIDEO_MPEG4](_codec_base.md#oh_avcodec_mimetype_video_mpeg4) | Defines the pointer to the MIME type for MPEG4 video codec.| +| \*[OH_AVCODEC_MIMETYPE_VIDEO_HEVC](_codec_base.md#oh_avcodec_mimetype_video_hevc) | Defines the pointer to the MIME type for HEVC video codec.| +| \*[OH_AVCODEC_MIMETYPE_AUDIO_MPEG](_codec_base.md#oh_avcodec_mimetype_audio_mpeg) | Defines the pointer to the MIME type for MPEG audio codec.| +| \*[OH_AVCODEC_MIMETYPE_IMAGE_JPG](_codec_base.md#oh_avcodec_mimetype_image_jpg) | Defines the pointer to the MIME type for JPG image codec.| +| \*[OH_AVCODEC_MIMETYPE_IMAGE_PNG](_codec_base.md#oh_avcodec_mimetype_image_png) | Defines the pointer to the MIME type for PNG image codec.| +| \*[OH_AVCODEC_MIMETYPE_IMAGE_BMP](_codec_base.md#oh_avcodec_mimetype_image_bmp) | Defines the pointer to the MIME type for BMP image codec.| +| \*[OH_AVCODEC_MIMETYPE_AUDIO_FLAC](_codec_base.md#oh_avcodec_mimetype_audio_flac) | Defines the pointer to the MIME type for FLAC audio codec.| +| \*[OH_AVCODEC_MIMETYPE_AUDIO_VORBIS](_codec_base.md#oh_avcodec_mimetype_audio_vorbis) | Defines the pointer to the MIME type for VORBIS audio codec.| +| \*[OH_ED_KEY_TIME_STAMP](_codec_base.md#oh_ed_key_time_stamp) | Defines the pointer to the timestamp in the extra data of the surface. The value type is int64.| +| \*[OH_ED_KEY_EOS](_codec_base.md#oh_ed_key_eos) | Defines the pointer to the end of stream (EOS) in the extra data of the surface. The value type is Boolean.| +| \*[OH_MD_KEY_TRACK_TYPE](_codec_base.md#oh_md_key_track_type) | Defines the pointer to a container for storing media descriptions.| +| \*[OH_MD_KEY_CODEC_MIME](_codec_base.md#oh_md_key_codec_mime) | Define the pointer to the MIME type of codec. The value is a string.| +| \*[OH_MD_KEY_DURATION](_codec_base.md#oh_md_key_duration) | Defines the pointer to the duration. The value type is int64_t.| +| \*[OH_MD_KEY_BITRATE](_codec_base.md#oh_md_key_bitrate) | Defines the pointer to the bit rate. The value type is uint32_t.| +| \*[OH_MD_KEY_MAX_INPUT_SIZE](_codec_base.md#oh_md_key_max_input_size) | Defines the pointer to the maximum input size. The value type is uint32_t.| +| \*[OH_MD_KEY_WIDTH](_codec_base.md#oh_md_key_width) | Defines the pointer to the video width. The value type is uint32_t.| +| \*[OH_MD_KEY_HEIGHT](_codec_base.md#oh_md_key_height) | Defines the pointer to the video height. The value type is uint32_t.| +| \*[OH_MD_KEY_PIXEL_FORMAT](_codec_base.md#oh_md_key_pixel_format) | Defines the pointer to the video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat).| +| \*[OH_MD_KEY_RANGE_FLAG](_codec_base.md#oh_md_key_range_flag) | Defines the pointer to the video YUV value range flag. The value type is Boolean.| +| \*[OH_MD_KEY_COLOR_PRIMARIES](_codec_base.md#oh_md_key_color_primaries) | Defines the pointer to the primary color of the video. The value type is int32_t.| +| \*[OH_MD_KEY_TRANSFER_CHARACTERISTICS](_codec_base.md#oh_md_key_transfer_characteristics) | Defines the pointer to the video transfer characteristics. The value type is int32_t.| +| \*[OH_MD_KEY_MATRIX_COEFFICIENTS](_codec_base.md#oh_md_key_matrix_coefficients) | Defines the pointer to the video matrix coefficient. The value type is int32_t.| +| \*[OH_MD_KEY_AUDIO_SAMPLE_FORMAT](_codec_base.md#oh_md_key_audio_sample_format) | Defines the pointer to the original audio format. The value type is uint32_t.| +| \*[OH_MD_KEY_FRAME_RATE](_codec_base.md#oh_md_key_frame_rate) | Defines the pointer to the video frame rate. The value is a double-precision floating point number.| +| \*[OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE](_codec_base.md#oh_md_key_video_encode_bitrate_mode) | Defines the pointer to the video encoding bit rate mode. The value type is int32_t. For details, see [OH_VideoEncodeBitrateMode](_video_encoder.md#oh_videoencodebitratemode).| +| \*[OH_MD_KEY_PROFILE](_codec_base.md#oh_md_key_profile) | Defines the pointer to the encoding template. The value is a number. For details, see [OH_AVCProfile](_codec_base.md#oh_avcprofile), [OH_AACProfile](_codec_base.md#oh_aacprofile), or [CodecBase](_codec_base.md#oh_hevcprofile).| +| \*[OH_MD_KEY_AUD_CHANNEL_COUNT](_codec_base.md#oh_md_key_aud_channel_count) | Defines the pointer to the number of audio channels. The value type is uint32_t.| +| \*[OH_MD_KEY_AUD_SAMPLE_RATE](_codec_base.md#oh_md_key_aud_sample_rate) | Defines the pointer to the audio sampling rate. The value type is uint32_t.| +| \*[OH_MD_KEY_I_FRAME_INTERVAL](_codec_base.md#oh_md_key_i_frame_interval) | Defines the pointer to the key frame interval, in milliseconds. The value type is int32_t.| +| \*[OH_MD_KEY_ROTATION](_codec_base.md#oh_md_key_rotation) | Defines the pointer to the rotation angle of the surface. The value type is int32_t, and the value range is {0, 90, 180, 270}. The default value is 0.| +| \*[OH_MD_KEY_CODEC_CONFIG](_codec_base.md#oh_md_key_codec_config) | Defines the pointer to the codec-specific data. The value type is uint8_t\*.| +| \*[OH_MD_KEY_REQUEST_I_FRAME](_codec_base.md#oh_md_key_request_i_frame) | Defines the pointer to the request for immediate encoding of I-frames. The value type is Boolean.| +| \*[OH_MD_KEY_QUALITY](_codec_base.md#oh_md_key_quality) | Defines the pointer to the required encoding quality. The value type is uint32_t. This key applies only to encoders configured in constant quality mode.| +| \*[OH_MD_KEY_CHANNEL_LAYOUT](_codec_base.md#oh_md_key_channel_layout) | Defines the pointer to the required encoding channel layout. The value type is int64_t. This key applies only to encoders.| +| \*[OH_MD_KEY_BITS_PER_CODED_SAMPLE](_codec_base.md#oh_md_key_bits_per_coded_sample) | Defines the pointer to the number of bits for each coded sample. The value type is uint32_t. This key applies to FLAC encoders.| +| \*[OH_MD_KEY_AAC_IS_ADTS](_codec_base.md#oh_md_key_aac_is_adts) | Defines the pointer to the AAC format. The value type is uint32_t. This key applies to AAC decoders.| +| \*[OH_MD_KEY_SBR](_codec_base.md#oh_md_key_sbr) | Defines the pointer to the AAC SBR format. The value type is uint32_t. This key applies to AAC encoders.| +| \*[OH_MD_KEY_COMPLIANCE_LEVEL](_codec_base.md#oh_md_key_compliance_level) | Defines the pointer to the FLAC compliance level. The value type is int32_t.| +| \*[OH_MD_KEY_IDENTIFICATION_HEADER](_codec_base.md#oh_md_key_identification_header) | Defines the pointer to the VORBIS identification header. The value type is uint8_t\*. This key applies only to VORBIS decoders.| +| \*[OH_MD_KEY_SETUP_HEADER](_codec_base.md#oh_md_key_setup_header) | Defines the pointer to the VORBIS setup header. The value type is uint8_t\*. This key applies only to VORBIS decoders.| +| \*[OH_MD_KEY_TITLE](_codec_base.md#oh_md_key_title) | Defines the pointer to the title of the input media. The value is a string.| +| \*[OH_MD_KEY_ARTIST](_codec_base.md#oh_md_key_artist) | Defines the pointer to the artist of the input media. The value is a string.| +| \*[OH_MD_KEY_ALBUM](_codec_base.md#oh_md_key_album) | Defines the pointer to the album of the input media. The value is a string.| +| \*[OH_MD_KEY_ALBUM_ARTIST](_codec_base.md#oh_md_key_album_artist) | Defines the pointer to the album_artist of the input media. The value is a string.| +| \*[OH_MD_KEY_DATE](_codec_base.md#oh_md_key_date) | Defines the pointer to the date of the input media. The value is a string.| +| \*[OH_MD_KEY_COMMENT](_codec_base.md#oh_md_key_comment) | Defines the pointer to the comment of the input media. The value is a string.| +| \*[OH_MD_KEY_GENRE](_codec_base.md#oh_md_key_genre) | Defines the pointer to the genre of the input media. The value is a string.| +| \*[OH_MD_KEY_COPYRIGHT](_codec_base.md#oh_md_key_copyright) | Defines the pointer to the copyright of the input media. The value is a string.| +| \*[OH_MD_KEY_LANGUAGE](_codec_base.md#oh_md_key_language) | Defines the pointer to the language of the input media. The value is a string.| +| \*[OH_MD_KEY_DESCRIPTION](_codec_base.md#oh_md_key_description) | Defines the pointer to the description of the input media. The value is a string.| +| \*[OH_MD_KEY_LYRICS](_codec_base.md#oh_md_key_lyrics) | Defines the pointer to the lyrics of the input media. The value is a string.| +| \*[OH_MD_KEY_TRACK_COUNT](_codec_base.md#oh_md_key_track_count) | Defines the pointer to the track count of the input media. The value type is uint32_t.| diff --git a/en/application-dev/reference/native-apis/native__avcodec__videoencoder_8h.md b/en/application-dev/reference/native-apis/native__avcodec__videoencoder_8h.md index 373c59db66..2c1ea2bf24 100644 --- a/en/application-dev/reference/native-apis/native__avcodec__videoencoder_8h.md +++ b/en/application-dev/reference/native-apis/native__avcodec__videoencoder_8h.md @@ -28,7 +28,7 @@ The **native_avcodec_videoencoder.h** file declares the native APIs used for vid | Name| Description| | -------- | -------- | -| [OH_VideoEncodeBitrateMode](_video_encoder.md#oh_videoencodebitratemode) { **CBR** = 0, **VBR** = 1, **CQ** = 2 } | Enumerates the bit rate modes of a video encoder.| +| [OH_VideoEncodeBitrateMode](_video_encoder.md#oh_videoencodebitratemode) {
    **CBR** = 0,
    **VBR** = 1,
    **CQ** = 2
} | Enumerates the bit rate modes of a video encoder.| ### Functions diff --git a/en/application-dev/reference/native-apis/native__averrors_8h.md b/en/application-dev/reference/native-apis/native__averrors_8h.md index 94436441c9..e2b1d472c4 100644 --- a/en/application-dev/reference/native-apis/native__averrors_8h.md +++ b/en/application-dev/reference/native-apis/native__averrors_8h.md @@ -28,4 +28,4 @@ The **native_averrors.h** file declares the error codes used by the media playba | Name| Description| | -------- | -------- | -| [OH_AVErrCode](_core.md#oh_averrcode) {
AV_ERR_OK = 0, AV_ERR_NO_MEMORY = 1, AV_ERR_OPERATE_NOT_PERMIT = 2, AV_ERR_INVALID_VAL = 3,
AV_ERR_IO = 4, AV_ERR_TIMEOUT = 5, AV_ERR_UNKNOWN = 6, AV_ERR_SERVICE_DIED = 7,
AV_ERR_INVALID_STATE = 8, AV_ERR_UNSUPPORT = 9, AV_ERR_EXTEND_START = 100
} | Enumerates the audio and video error codes.| +| [OH_AVErrCode](_core.md#oh_averrcode) {
    AV_ERR_OK = 0,
    AV_ERR_NO_MEMORY = 1,
    AV_ERR_OPERATE_NOT_PERMIT = 2,
    AV_ERR_INVALID_VAL = 3,
    AV_ERR_IO = 4,
    AV_ERR_TIMEOUT = 5,
    AV_ERR_UNKNOWN = 6,
    AV_ERR_SERVICE_DIED = 7,
    AV_ERR_INVALID_STATE = 8,
    AV_ERR_UNSUPPORT = 9,
    AV_ERR_EXTEND_START = 100
} | Enumerates the audio and video error codes.| diff --git a/en/application-dev/reference/native-apis/native__avformat_8h.md b/en/application-dev/reference/native-apis/native__avformat_8h.md index ac80fbc159..6ad4928265 100644 --- a/en/application-dev/reference/native-apis/native__avformat_8h.md +++ b/en/application-dev/reference/native-apis/native__avformat_8h.md @@ -28,7 +28,7 @@ The **native_avformat.h** file declares the format-related functions and enums. | Name| Description| | -------- | -------- | -| [OH_AVPixelFormat](_core.md#oh_avpixelformat) {
AV_PIXEL_FORMAT_YUVI420 = 1, AV_PIXEL_FORMAT_NV12 = 2, AV_PIXEL_FORMAT_NV21 = 3, AV_PIXEL_FORMAT_SURFACE_FORMAT = 4,
AV_PIXEL_FORMAT_RGBA = 5
} | Enumerates the video pixel formats.| +| [OH_AVPixelFormat](_core.md#oh_avpixelformat) {
    AV_PIXEL_FORMAT_YUVI420 = 1,
    AV_PIXEL_FORMAT_NV12 = 2,
    AV_PIXEL_FORMAT_NV21 = 3,
    AV_PIXEL_FORMAT_SURFACE_FORMAT = 4,
    AV_PIXEL_FORMAT_RGBA = 5
} | Enumerates the video pixel formats.| ### Functions -- GitLab