“d73aa874b2abb0238f03bbca314dcbfcf5c7a5f3”上不存在“doc/git@gitcode.net:s920243400/PaddleDetection.git”
未验证 提交 dae9df53 编写于 作者: O openharmony_ci 提交者: Gitee

!19447 翻译完成:18990 敏感词修改 (cherry-pick)

Merge pull request !19447 from wusongqing/TR18990
...@@ -3,42 +3,41 @@ ...@@ -3,42 +3,41 @@
## Overview ## Overview
Provides the functions for audio decoding. Provides the functions for audio decoding. This module may not be supported on some devices. You can call [CanIUse](../syscap.md) to check whether this module is supported on your device.
\@syscap SystemCapability.Multimedia.Media.AudioDecoder @syscap SystemCapability.Multimedia.Media.AudioDecoder
**Since:** **Since**
9 9
## Summary ## Summary
### Files ### Files
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [native_avcodec_audiodecoder.h](native__avcodec__audiodecoder_8h.md) | Declares the native APIs used for audio decoding. <br>File to Include: <multimedia/player_framework/native_avcodec_audiodecoder.h> | | [native_avcodec_audiodecoder.h](native__avcodec__audiodecoder_8h.md) | Declares the native APIs used for audio decoding.<br>File to include: <multimedia/player_framework/native_avcodec_audiodecoder.h> |
### Functions ### Functions
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [OH_AudioDecoder_CreateByMime](#oh_audiodecoder_createbymime) (const char \*mime) | Creates an audio decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This API is recommended in most cases. | | [OH_AudioDecoder_CreateByMime](#oh_audiodecoder_createbymime) (const char \*mime) | Creates an audio decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This API is recommended in most cases. |
| [OH_AudioDecoder_CreateByName](#oh_audiodecoder_createbyname) (const char \*name) | Creates an audio decoder instance based on an audio decoder name. To use this API, you must know the exact name of the audio decoder. | | [OH_AudioDecoder_CreateByName](#oh_audiodecoder_createbyname) (const char \*name) | Creates an audio decoder instance based on an audio decoder name. To use this API, you must know the exact name of the audio decoder. |
| [OH_AudioDecoder_Destroy](#oh_audiodecoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of an audio decoder and destroys the audio decoder instance. | | [OH_AudioDecoder_Destroy](#oh_audiodecoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of an audio decoder and destroys the audio decoder instance. |
| [OH_AudioDecoder_SetCallback](#oh_audiodecoder_setcallback) (OH_AVCodec \*codec, [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio decoder. This API must be called prior to **Prepare**. | | [OH_AudioDecoder_SetCallback](#oh_audiodecoder_setcallback) (OH_AVCodec \*codec, [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio decoder. This API must be called prior to **Prepare**. |
| [OH_AudioDecoder_Configure](#oh_audiodecoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures an audio decoder. Typically, you need to configure the attributes, which can be extracted from the container, of the audio track that can be decoded. This API must be called prior to **Prepare**. | | [OH_AudioDecoder_Configure](#oh_audiodecoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures an audio decoder. Typically, you need to configure the attributes, which can be extracted from the container, of the audio track that can be decoded. This API must be called prior to **Prepare**. |
| [OH_AudioDecoder_Prepare](#oh_audiodecoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for an audio decoder. This API must be called after **Configure**. | | [OH_AudioDecoder_Prepare](#oh_audiodecoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for an audio decoder. This API must be called after **Configure**. |
| [OH_AudioDecoder_Start](#oh_audiodecoder_start) (OH_AVCodec \*codec) | Starts an audio decoder. This API can be called only after the decoder is prepared successfully. After being started, the decoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event. | | [OH_AudioDecoder_Start](#oh_audiodecoder_start) (OH_AVCodec \*codec) | Starts an audio decoder. This API can be called only after the decoder is prepared successfully. After being started, the decoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event. |
| [OH_AudioDecoder_Stop](#oh_audiodecoder_stop) (OH_AVCodec \*codec) | Stops an audio decoder. After the decoder is stopped, you can call **Start** to start it again. If you have passed codec-specific data in the previous **Start** for the decoder, you must pass it again. | | [OH_AudioDecoder_Stop](#oh_audiodecoder_stop) (OH_AVCodec \*codec) | Stops an audio decoder. After the decoder is stopped, you can call **Start** to start it again. If you have passed codec-specific data in the previous **Start** for the decoder, you must pass it again. |
| [OH_AudioDecoder_Flush](#oh_audiodecoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of an audio decoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required. | | [OH_AudioDecoder_Flush](#oh_audiodecoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of an audio decoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required. |
| [OH_AudioDecoder_Reset](#oh_audiodecoder_reset) (OH_AVCodec \*codec) | Resets an audio decoder. To continue decoding, you must call **Configure** and **Start** to configure and start the decoder again. | | [OH_AudioDecoder_Reset](#oh_audiodecoder_reset) (OH_AVCodec \*codec) | Resets an audio decoder. To continue decoding, you must call **Configure** and **Start** to configure and start the decoder again. |
| [OH_AudioDecoder_GetOutputDescription](#oh_audiodecoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the attributes of the output data of an audio decoder. The caller must manually release the **OH_AVFormat** instance in the return value. | | [OH_AudioDecoder_GetOutputDescription](#oh_audiodecoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the attributes of the output data of an audio decoder. The caller must manually release the **OH_AVFormat** instance in the return value. |
| [OH_AudioDecoder_SetParameter](#oh_audiodecoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio decoder. This API can be called only after the decoder is started. Incorrect parameter settings may cause decoding failure. | | [OH_AudioDecoder_SetParameter](#oh_audiodecoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio decoder. This API can be called only after the decoder is started. Incorrect parameter settings may cause decoding failure. |
| [OH_AudioDecoder_PushInputData](#oh_audiodecoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) attr) | Pushes the input buffer filled with data to an audio decoder. The [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback reports available input buffers and their indexes. After being pushed to the decoder, a buffer is not accessible until the buffer with the same index is reported again through the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback. In addition, some decoders require the input of codec-specific data to initialize the decoding process. | | [OH_AudioDecoder_PushInputData](#oh_audiodecoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) attr) | Pushes the input buffer filled with data to an audio decoder. The [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback reports available input buffers and their indexes. After being pushed to the decoder, a buffer is not accessible until the buffer with the same index is reported again through the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback. In addition, some decoders require the input of codec-specific data to initialize the decoding process. |
| [OH_AudioDecoder_FreeOutputData](#oh_audiodecoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of an audio decoder. | | [OH_AudioDecoder_FreeOutputData](#oh_audiodecoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of an audio decoder. |
## Function Description ## Function Description
...@@ -53,14 +52,14 @@ OH_AVErrCode OH_AudioDecoder_Configure (OH_AVCodec * codec, OH_AVFormat * format ...@@ -53,14 +52,14 @@ OH_AVErrCode OH_AudioDecoder_Configure (OH_AVCodec * codec, OH_AVFormat * format
**Description**<br> **Description**<br>
Configures an audio decoder. Typically, you need to configure the attributes, which can be extracted from the container, of the audio track that can be decoded. This API must be called prior to **Prepare**. Configures an audio decoder. Typically, you need to configure the attributes, which can be extracted from the container, of the audio track that can be decoded. This API must be called prior to **Prepare**.
\@syscap SystemCapability.Multimedia.Media.AudioDecoder @syscap SystemCapability.Multimedia.Media.AudioDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| format | Indicates the handle to an **OH_AVFormat** instance, which provides the attributes of the audio track to be decoded. | | format | Indicates the handle to an **OH_AVFormat** instance, which provides the attributes of the audio track to be decoded. |
**Returns** **Returns**
...@@ -76,15 +75,15 @@ Returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode) if the op ...@@ -76,15 +75,15 @@ Returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode) if the op
OH_AVCodec* OH_AudioDecoder_CreateByMime (const char * mime) OH_AVCodec* OH_AudioDecoder_CreateByMime (const char * mime)
``` ```
**Description**<br> **Description**<br>
Creates an audio decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This API is recommended in most cases. Creates an audio decoder instance based on a MIME type. This API is recommended in most cases.
\@syscap SystemCapability.Multimedia.Media.AudioDecoder @syscap SystemCapability.Multimedia.Media.AudioDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| mime | Indicates the pointer to a MIME type. For details, see [OH_AVCODEC_MIMETYPE_AUDIO_AAC](_codec_base.md#oh_avcodec_mimetype_audio_aac). | | mime | Indicates the pointer to a MIME type. For details, see [OH_AVCODEC_MIMETYPE_AUDIO_AAC](_codec_base.md#oh_avcodec_mimetype_audio_aac).|
**Returns** **Returns**
...@@ -100,13 +99,13 @@ OH_AVCodec* OH_AudioDecoder_CreateByName (const char * name) ...@@ -100,13 +99,13 @@ OH_AVCodec* OH_AudioDecoder_CreateByName (const char * name)
**Description**<br> **Description**<br>
Creates an audio decoder instance based on an audio decoder name. To use this API, you must know the exact name of the audio decoder. Creates an audio decoder instance based on an audio decoder name. To use this API, you must know the exact name of the audio decoder.
\@syscap SystemCapability.Multimedia.Media.AudioDecoder @syscap SystemCapability.Multimedia.Media.AudioDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| name | Indicates the pointer to an audio decoder name. | | name | Indicates the pointer to an audio decoder name. |
**Returns** **Returns**
...@@ -122,13 +121,13 @@ OH_AVErrCode OH_AudioDecoder_Destroy (OH_AVCodec * codec) ...@@ -122,13 +121,13 @@ OH_AVErrCode OH_AudioDecoder_Destroy (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Clears the internal resources of an audio decoder and destroys the audio decoder instance. Clears the internal resources of an audio decoder and destroys the audio decoder instance.
\@syscap SystemCapability.Multimedia.Media.AudioDecoder @syscap SystemCapability.Multimedia.Media.AudioDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -146,13 +145,13 @@ OH_AVErrCode OH_AudioDecoder_Flush (OH_AVCodec * codec) ...@@ -146,13 +145,13 @@ OH_AVErrCode OH_AudioDecoder_Flush (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Clears the input and output data in the internal buffer of an audio decoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required. Clears the input and output data in the internal buffer of an audio decoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required.
\@syscap SystemCapability.Multimedia.Media.AudioDecoder @syscap SystemCapability.Multimedia.Media.AudioDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -170,14 +169,14 @@ OH_AVErrCode OH_AudioDecoder_FreeOutputData (OH_AVCodec * codec, uint32_t index ...@@ -170,14 +169,14 @@ OH_AVErrCode OH_AudioDecoder_FreeOutputData (OH_AVCodec * codec, uint32_t index
**Description**<br> **Description**<br>
Frees an output buffer of an audio decoder. Frees an output buffer of an audio decoder.
\@syscap SystemCapability.Multimedia.Media.AudioDecoder @syscap SystemCapability.Multimedia.Media.AudioDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| index | Indicates the index of an output buffer. | | index | Indicates the index of an output buffer. |
**Returns** **Returns**
...@@ -195,13 +194,13 @@ OH_AVFormat* OH_AudioDecoder_GetOutputDescription (OH_AVCodec * codec) ...@@ -195,13 +194,13 @@ OH_AVFormat* OH_AudioDecoder_GetOutputDescription (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Obtains the attributes of the output data of an audio decoder. The caller must manually release the **OH_AVFormat** instance in the return value. Obtains the attributes of the output data of an audio decoder. The caller must manually release the **OH_AVFormat** instance in the return value.
\@syscap SystemCapability.Multimedia.Media.AudioDecoder @syscap SystemCapability.Multimedia.Media.AudioDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -217,13 +216,13 @@ OH_AVErrCode OH_AudioDecoder_Prepare (OH_AVCodec * codec) ...@@ -217,13 +216,13 @@ OH_AVErrCode OH_AudioDecoder_Prepare (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Prepares internal resources for an audio decoder. This API must be called after **Configure**. Prepares internal resources for an audio decoder. This API must be called after **Configure**.
\@syscap SystemCapability.Multimedia.Media.AudioDecoder @syscap SystemCapability.Multimedia.Media.AudioDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -241,15 +240,15 @@ OH_AVErrCode OH_AudioDecoder_PushInputData (OH_AVCodec * codec, uint32_t index, ...@@ -241,15 +240,15 @@ OH_AVErrCode OH_AudioDecoder_PushInputData (OH_AVCodec * codec, uint32_t index,
**Description**<br> **Description**<br>
Pushes the input buffer filled with data to an audio decoder. The [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback reports available input buffers and their indexes. After being pushed to the decoder, a buffer is not accessible until the buffer with the same index is reported again through the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback. In addition, some decoders require the input of codec-specific data to initialize the decoding process. Pushes the input buffer filled with data to an audio decoder. The [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback reports available input buffers and their indexes. After being pushed to the decoder, a buffer is not accessible until the buffer with the same index is reported again through the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback. In addition, some decoders require the input of codec-specific data to initialize the decoding process.
\@syscap SystemCapability.Multimedia.Media.AudioDecoder @syscap SystemCapability.Multimedia.Media.AudioDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| index | Indicates the index of an input buffer. | | index | Indicates the index of an input buffer. |
| attr | Indicates the attributes of the data contained in the buffer. | | attr | Indicates the attributes of the data contained in the buffer. |
**Returns** **Returns**
...@@ -267,13 +266,13 @@ OH_AVErrCode OH_AudioDecoder_Reset (OH_AVCodec * codec) ...@@ -267,13 +266,13 @@ OH_AVErrCode OH_AudioDecoder_Reset (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Resets an audio decoder. To continue decoding, you must call **Configure** and **Start** to configure and start the decoder again. Resets an audio decoder. To continue decoding, you must call **Configure** and **Start** to configure and start the decoder again.
\@syscap SystemCapability.Multimedia.Media.AudioDecoder @syscap SystemCapability.Multimedia.Media.AudioDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -291,15 +290,15 @@ OH_AVErrCode OH_AudioDecoder_SetCallback (OH_AVCodec * codec, OH_AVCodecAsyncCal ...@@ -291,15 +290,15 @@ OH_AVErrCode OH_AudioDecoder_SetCallback (OH_AVCodec * codec, OH_AVCodecAsyncCal
**Description**<br> **Description**<br>
Sets an asynchronous callback so that your application can respond to events generated by an audio decoder. This API must be called prior to **Prepare**. Sets an asynchronous callback so that your application can respond to events generated by an audio decoder. This API must be called prior to **Prepare**.
\@syscap SystemCapability.Multimedia.Media.AudioDecoder @syscap SystemCapability.Multimedia.Media.AudioDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| callback | Indicates a collection of all callback functions. For details, see [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md). | | callback | Indicates a collection of all callback functions. For details, see [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md).|
| userData | Indicates the pointer to user-specific data. | | userData | Indicates the pointer to user-specific data. |
**Returns** **Returns**
...@@ -317,14 +316,14 @@ OH_AVErrCode OH_AudioDecoder_SetParameter (OH_AVCodec * codec, OH_AVFormat * for ...@@ -317,14 +316,14 @@ OH_AVErrCode OH_AudioDecoder_SetParameter (OH_AVCodec * codec, OH_AVFormat * for
**Description**<br> **Description**<br>
Sets dynamic parameters for an audio decoder. This API can be called only after the decoder is started. Incorrect parameter settings may cause decoding failure. Sets dynamic parameters for an audio decoder. This API can be called only after the decoder is started. Incorrect parameter settings may cause decoding failure.
\@syscap SystemCapability.Multimedia.Media.AudioDecoder @syscap SystemCapability.Multimedia.Media.AudioDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| format | Indicates the handle to an **OH_AVFormat** instance. | | format | Indicates the handle to an **OH_AVFormat** instance. |
**Returns** **Returns**
...@@ -342,13 +341,13 @@ OH_AVErrCode OH_AudioDecoder_Start (OH_AVCodec * codec) ...@@ -342,13 +341,13 @@ OH_AVErrCode OH_AudioDecoder_Start (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Starts an audio decoder. This API can be called only after the decoder is prepared successfully. After being started, the decoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event. Starts an audio decoder. This API can be called only after the decoder is prepared successfully. After being started, the decoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event.
\@syscap SystemCapability.Multimedia.Media.AudioDecoder @syscap SystemCapability.Multimedia.Media.AudioDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -366,13 +365,13 @@ OH_AVErrCode OH_AudioDecoder_Stop (OH_AVCodec * codec) ...@@ -366,13 +365,13 @@ OH_AVErrCode OH_AudioDecoder_Stop (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Stops an audio decoder. After the decoder is stopped, you can call **Start** to start it again. If you have passed codec-specific data in the previous **Start** for the decoder, you must pass it again. Stops an audio decoder. After the decoder is stopped, you can call **Start** to start it again. If you have passed codec-specific data in the previous **Start** for the decoder, you must pass it again.
\@syscap SystemCapability.Multimedia.Media.AudioDecoder @syscap SystemCapability.Multimedia.Media.AudioDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
......
...@@ -3,42 +3,41 @@ ...@@ -3,42 +3,41 @@
## Overview ## Overview
Provides the functions for audio encoding. Provides the functions for audio encoding. This module may not be supported on some devices. You can call [CanIUse](../syscap.md) to check whether this module is supported on your device.
\@syscap SystemCapability.Multimedia.Media.AudioEncoder @syscap SystemCapability.Multimedia.Media.AudioEncoder
**Since:** **Since**
9 9
## Summary ## Summary
### Files ### Files
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [native_avcodec_audioencoder.h](native__avcodec__audioencoder_8h.md) | Declares the native APIs used for audio encoding. <br>File to Include: <multimedia/player_framework/native_avcodec_audioencoder.h> | | [native_avcodec_audioencoder.h](native__avcodec__audioencoder_8h.md) | Declares the native APIs used for audio encoding.<br>File to include: <multimedia/player_framework/native_avcodec_audioencoder.h> |
### Functions ### Functions
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [OH_AudioEncoder_CreateByMime](#oh_audioencoder_createbymime) (const char \*mime) | Creates an audio encoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This API is recommended in most cases. | | [OH_AudioEncoder_CreateByMime](#oh_audioencoder_createbymime) (const char \*mime) | Creates an audio encoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This API is recommended in most cases. |
| [OH_AudioEncoder_CreateByName](#oh_audioencoder_createbyname) (const char \*name) | Creates an audio encoder instance based on an audio encoder name. To use this API, you must know the exact name of the audio encoder. | | [OH_AudioEncoder_CreateByName](#oh_audioencoder_createbyname) (const char \*name) | Creates an audio encoder instance based on an audio encoder name. To use this API, you must know the exact name of the audio encoder. |
| [OH_AudioEncoder_Destroy](#oh_audioencoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of an audio encoder and destroys the audio encoder instance. | | [OH_AudioEncoder_Destroy](#oh_audioencoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of an audio encoder and destroys the audio encoder instance. |
| [OH_AudioEncoder_SetCallback](#oh_audioencoder_setcallback) (OH_AVCodec \*codec, [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio encoder. This API must be called prior to **Prepare**. | | [OH_AudioEncoder_SetCallback](#oh_audioencoder_setcallback) (OH_AVCodec \*codec, [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio encoder. This API must be called prior to **Prepare**. |
| [OH_AudioEncoder_Configure](#oh_audioencoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures an audio encoder. Typically, you need to configure the attributes of the audio track that can be encoded. This API must be called prior to **Prepare**. | | [OH_AudioEncoder_Configure](#oh_audioencoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures an audio encoder. Typically, you need to configure the attributes of the audio track that can be encoded. This API must be called prior to **Prepare**. |
| [OH_AudioEncoder_Prepare](#oh_audioencoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for an audio encoder. This API must be called after **Configure**. | | [OH_AudioEncoder_Prepare](#oh_audioencoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for an audio encoder. This API must be called after **Configure**. |
| [OH_AudioEncoder_Start](#oh_audioencoder_start) (OH_AVCodec \*codec) | Starts an audio encoder. This API can be called only after the encoder is prepared successfully. After being started, the encoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event. | | [OH_AudioEncoder_Start](#oh_audioencoder_start) (OH_AVCodec \*codec) | Starts an audio encoder. This API can be called only after the encoder is prepared successfully. After being started, the encoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event. |
| [OH_AudioEncoder_Stop](#oh_audioencoder_stop) (OH_AVCodec \*codec) | Stops an audio encoder. After the encoder is stopped, you can call **Start** to start it again. | | [OH_AudioEncoder_Stop](#oh_audioencoder_stop) (OH_AVCodec \*codec) | Stops an audio encoder. After the encoder is stopped, you can call **Start** to start it again. |
| [OH_AudioEncoder_Flush](#oh_audioencoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of an audio encoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required. | | [OH_AudioEncoder_Flush](#oh_audioencoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of an audio encoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required. |
| [OH_AudioEncoder_Reset](#oh_audioencoder_reset) (OH_AVCodec \*codec) | Resets an audio encoder. To continue encoding, you must call **Configure** and **Start** to configure and start the encoder again. | | [OH_AudioEncoder_Reset](#oh_audioencoder_reset) (OH_AVCodec \*codec) | Resets an audio encoder. To continue encoding, you must call **Configure** and **Start** to configure and start the encoder again. |
| [OH_AudioEncoder_GetOutputDescription](#oh_audioencoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the attributes of the output data of an audio encoder. The caller must manually release the **OH_AVFormat** instance in the return value. | | [OH_AudioEncoder_GetOutputDescription](#oh_audioencoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the attributes of the output data of an audio encoder. The caller must manually release the **OH_AVFormat** instance in the return value. |
| [OH_AudioEncoder_SetParameter](#oh_audioencoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio encoder. This API can be called only after the encoder is started. Incorrect parameter settings may cause encoding failure. | | [OH_AudioEncoder_SetParameter](#oh_audioencoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio encoder. This API can be called only after the encoder is started. Incorrect parameter settings may cause encoding failure. |
| [OH_AudioEncoder_PushInputData](#oh_audioencoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) attr) | Pushes the input buffer filled with data to an audio encoder. The [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback reports available input buffers and their indexes. After being pushed to the decoder, a buffer is not accessible until the buffer with the same index is reported again through the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback. | | [OH_AudioEncoder_PushInputData](#oh_audioencoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) attr) | Pushes the input buffer filled with data to an audio encoder. The [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback reports available input buffers and their indexes. After being pushed to the encoder, a buffer is not accessible until the buffer with the same index is reported again through the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback. |
| [OH_AudioEncoder_FreeOutputData](#oh_audioencoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of an audio encoder. | | [OH_AudioEncoder_FreeOutputData](#oh_audioencoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of an audio encoder. |
## Function Description ## Function Description
...@@ -53,14 +52,14 @@ OH_AVErrCode OH_AudioEncoder_Configure (OH_AVCodec * codec, OH_AVFormat * format ...@@ -53,14 +52,14 @@ OH_AVErrCode OH_AudioEncoder_Configure (OH_AVCodec * codec, OH_AVFormat * format
**Description**<br> **Description**<br>
Configures an audio encoder. Typically, you need to configure the attributes of the audio track that can be encoded. This API must be called prior to **Prepare**. Configures an audio encoder. Typically, you need to configure the attributes of the audio track that can be encoded. This API must be called prior to **Prepare**.
\@syscap SystemCapability.Multimedia.Media.AudioEncoder @syscap SystemCapability.Multimedia.Media.AudioEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| format | Indicates the handle to an **OH_AVFormat** instance. | | format | Indicates the handle to an **OH_AVFormat** instance. |
**Returns** **Returns**
...@@ -76,15 +75,15 @@ Returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode) if the op ...@@ -76,15 +75,15 @@ Returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode) if the op
OH_AVCodec* OH_AudioEncoder_CreateByMime (const char * mime) OH_AVCodec* OH_AudioEncoder_CreateByMime (const char * mime)
``` ```
**Description**<br> **Description**<br>
Creates an audio encoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This API is recommended in most cases. Creates an audio encoder instance based on a MIME type. This API is recommended in most cases.
\@syscap SystemCapability.Multimedia.Media.AudioEncoder @syscap SystemCapability.Multimedia.Media.AudioEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| mime | Indicates the pointer to a MIME type. For details, see [OH_AVCODEC_MIMETYPE_AUDIO_AAC](_codec_base.md#oh_avcodec_mimetype_audio_aac). | | mime | Indicates the pointer to a MIME type. For details, see [OH_AVCODEC_MIMETYPE_AUDIO_AAC](_codec_base.md#oh_avcodec_mimetype_audio_aac).|
**Returns** **Returns**
...@@ -100,13 +99,13 @@ OH_AVCodec* OH_AudioEncoder_CreateByName (const char * name) ...@@ -100,13 +99,13 @@ OH_AVCodec* OH_AudioEncoder_CreateByName (const char * name)
**Description**<br> **Description**<br>
Creates an audio encoder instance based on an audio encoder name. To use this API, you must know the exact name of the audio encoder. Creates an audio encoder instance based on an audio encoder name. To use this API, you must know the exact name of the audio encoder.
\@syscap SystemCapability.Multimedia.Media.AudioEncoder @syscap SystemCapability.Multimedia.Media.AudioEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| name | Indicates the pointer to an audio encoder name. | | name | Indicates the pointer to an audio encoder name. |
**Returns** **Returns**
...@@ -122,13 +121,13 @@ OH_AVErrCode OH_AudioEncoder_Destroy (OH_AVCodec * codec) ...@@ -122,13 +121,13 @@ OH_AVErrCode OH_AudioEncoder_Destroy (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Clears the internal resources of an audio encoder and destroys the audio encoder instance. Clears the internal resources of an audio encoder and destroys the audio encoder instance.
\@syscap SystemCapability.Multimedia.Media.AudioEncoder @syscap SystemCapability.Multimedia.Media.AudioEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -146,13 +145,13 @@ OH_AVErrCode OH_AudioEncoder_Flush (OH_AVCodec * codec) ...@@ -146,13 +145,13 @@ OH_AVErrCode OH_AudioEncoder_Flush (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Clears the input and output data in the internal buffer of an audio encoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required. Clears the input and output data in the internal buffer of an audio encoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required.
\@syscap SystemCapability.Multimedia.Media.AudioEncoder @syscap SystemCapability.Multimedia.Media.AudioEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -170,14 +169,14 @@ OH_AVErrCode OH_AudioEncoder_FreeOutputData (OH_AVCodec * codec, uint32_t index ...@@ -170,14 +169,14 @@ OH_AVErrCode OH_AudioEncoder_FreeOutputData (OH_AVCodec * codec, uint32_t index
**Description**<br> **Description**<br>
Frees an output buffer of an audio encoder. Frees an output buffer of an audio encoder.
\@syscap SystemCapability.Multimedia.Media.AudioEncoder @syscap SystemCapability.Multimedia.Media.AudioEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| index | Indicates the index of an output buffer. | | index | Indicates the index of an output buffer. |
**Returns** **Returns**
...@@ -195,13 +194,13 @@ OH_AVFormat* OH_AudioEncoder_GetOutputDescription (OH_AVCodec * codec) ...@@ -195,13 +194,13 @@ OH_AVFormat* OH_AudioEncoder_GetOutputDescription (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Obtains the attributes of the output data of an audio encoder. The caller must manually release the **OH_AVFormat** instance in the return value. Obtains the attributes of the output data of an audio encoder. The caller must manually release the **OH_AVFormat** instance in the return value.
\@syscap SystemCapability.Multimedia.Media.AudioEncoder @syscap SystemCapability.Multimedia.Media.AudioEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -217,13 +216,13 @@ OH_AVErrCode OH_AudioEncoder_Prepare (OH_AVCodec * codec) ...@@ -217,13 +216,13 @@ OH_AVErrCode OH_AudioEncoder_Prepare (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Prepares internal resources for an audio encoder. This API must be called after **Configure**. Prepares internal resources for an audio encoder. This API must be called after **Configure**.
\@syscap SystemCapability.Multimedia.Media.AudioEncoder @syscap SystemCapability.Multimedia.Media.AudioEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -239,17 +238,17 @@ Returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode) if the op ...@@ -239,17 +238,17 @@ Returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode) if the op
OH_AVErrCode OH_AudioEncoder_PushInputData (OH_AVCodec * codec, uint32_t index, OH_AVCodecBufferAttr attr ) OH_AVErrCode OH_AudioEncoder_PushInputData (OH_AVCodec * codec, uint32_t index, OH_AVCodecBufferAttr attr )
``` ```
**Description**<br> **Description**<br>
Pushes the input buffer filled with data to an audio encoder. The [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback reports available input buffers and their indexes. After being pushed to the decoder, a buffer is not accessible until the buffer with the same index is reported again through the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback. Pushes the input buffer filled with data to an audio encoder. The [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback reports available input buffers and their indexes. After being pushed to the encoder, a buffer is not accessible until the buffer with the same index is reported again through the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback.
\@syscap SystemCapability.Multimedia.Media.AudioEncoder @syscap SystemCapability.Multimedia.Media.AudioEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| index | Indicates the index of an input buffer. | | index | Indicates the index of an input buffer. |
| attr | Indicates the attributes of the data contained in the buffer. | | attr | Indicates the attributes of the data contained in the buffer. |
**Returns** **Returns**
...@@ -267,13 +266,13 @@ OH_AVErrCode OH_AudioEncoder_Reset (OH_AVCodec * codec) ...@@ -267,13 +266,13 @@ OH_AVErrCode OH_AudioEncoder_Reset (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Resets an audio encoder. To continue encoding, you must call **Configure** and **Start** to configure and start the encoder again. Resets an audio encoder. To continue encoding, you must call **Configure** and **Start** to configure and start the encoder again.
\@syscap SystemCapability.Multimedia.Media.AudioEncoder @syscap SystemCapability.Multimedia.Media.AudioEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -291,15 +290,15 @@ OH_AVErrCode OH_AudioEncoder_SetCallback (OH_AVCodec * codec, OH_AVCodecAsyncCal ...@@ -291,15 +290,15 @@ OH_AVErrCode OH_AudioEncoder_SetCallback (OH_AVCodec * codec, OH_AVCodecAsyncCal
**Description**<br> **Description**<br>
Sets an asynchronous callback so that your application can respond to events generated by an audio encoder. This API must be called prior to **Prepare**. Sets an asynchronous callback so that your application can respond to events generated by an audio encoder. This API must be called prior to **Prepare**.
\@syscap SystemCapability.Multimedia.Media.AudioEncoder @syscap SystemCapability.Multimedia.Media.AudioEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| callback | Indicates a collection of all callback functions. For details, see [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md). | | callback | Indicates a collection of all callback functions. For details, see [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md).|
| userData | Indicates the pointer to user-specific data. | | userData | Indicates the pointer to user-specific data. |
**Returns** **Returns**
...@@ -317,14 +316,14 @@ OH_AVErrCode OH_AudioEncoder_SetParameter (OH_AVCodec * codec, OH_AVFormat * for ...@@ -317,14 +316,14 @@ OH_AVErrCode OH_AudioEncoder_SetParameter (OH_AVCodec * codec, OH_AVFormat * for
**Description**<br> **Description**<br>
Sets dynamic parameters for an audio encoder. This API can be called only after the encoder is started. Incorrect parameter settings may cause encoding failure. Sets dynamic parameters for an audio encoder. This API can be called only after the encoder is started. Incorrect parameter settings may cause encoding failure.
\@syscap SystemCapability.Multimedia.Media.AudioEncoder @syscap SystemCapability.Multimedia.Media.AudioEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| format | Indicates the handle to an **OH_AVFormat** instance. | | format | Indicates the handle to an **OH_AVFormat** instance. |
**Returns** **Returns**
...@@ -342,13 +341,13 @@ OH_AVErrCode OH_AudioEncoder_Start (OH_AVCodec * codec) ...@@ -342,13 +341,13 @@ OH_AVErrCode OH_AudioEncoder_Start (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Starts an audio encoder. This API can be called only after the encoder is prepared successfully. After being started, the encoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event. Starts an audio encoder. This API can be called only after the encoder is prepared successfully. After being started, the encoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event.
\@syscap SystemCapability.Multimedia.Media.AudioEncoder @syscap SystemCapability.Multimedia.Media.AudioEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -366,13 +365,13 @@ OH_AVErrCode OH_AudioEncoder_Stop (OH_AVCodec * codec) ...@@ -366,13 +365,13 @@ OH_AVErrCode OH_AudioEncoder_Stop (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Stops an audio encoder. After the encoder is stopped, you can call **Start** to start it again. Stops an audio encoder. After the encoder is stopped, you can call **Start** to start it again.
\@syscap SystemCapability.Multimedia.Media.AudioEncoder @syscap SystemCapability.Multimedia.Media.AudioEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
......
...@@ -3,86 +3,85 @@ ...@@ -3,86 +3,85 @@
## Overview ## Overview
Provides the common structs, character constants, and enums for running **OH_AVCodec** instances. Provides the common structs, character constants, and enums for running **OH_AVCodec** instances. This module may not be supported on some devices. You can call [CanIUse](../syscap.md) to check whether this module is supported on your device.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
**Since:** **Since**
9 9
## Summary ## Summary
### Files ### 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. <br>File to Include: <multimedia/player_framework/native_avcodec_base.h> | | [native_avcodec_base.h](native__avcodec__base_8h.md) | Declares the common structs, character constants, and enums for running <b>OH_AVCodec</b> instances.<br>File to include: <multimedia/player_framework/native_avcodec_base.h> |
### Structs ### Structs
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) | Defines the buffer attributes of an **OH_AVCodec** instance. | | [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) | Defines the buffer attributes of an **OH_AVCodec** instance. |
| [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) | Defines a collection of asynchronous callback functions for an **OH_AVCodec** instance. You must register this struct instance for an **OH_AVCodec** instance and process the information reported through these callbacks to ensure the normal running of the instance. | | [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) | Defines a collection of asynchronous callback functions for an **OH_AVCodec** instance. You must register this struct instance for an **OH_AVCodec** instance and process the information reported through these callbacks to ensure the normal running of the instance. |
### Types ### Types
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [OH_AVCodecBufferFlags](#oh_avcodecbufferflags) | Enumerates the buffer flags of an **OH_AVCodec** instance. | | [OH_AVCodecBufferFlags](#oh_avcodecbufferflags) | Enumerates the buffer flags of an **OH_AVCodec** instance. |
| [OH_AVCodecBufferAttr](#oh_avcodecbufferattr) | Defines the buffer attributes of an **OH_AVCodec** instance. | | [OH_AVCodecBufferAttr](#oh_avcodecbufferattr) | Defines the buffer attributes of an **OH_AVCodec** instance. |
| [OH_AVCodecOnError](#oh_avcodeconerror)) (OH_AVCodec \*codec, int32_t errorCode, void \*userData) | Defines the function pointer that is called to report error information when an error occurs during the running of an **OH_AVCodec** instance. | | (\*[OH_AVCodecOnError](#oh_avcodeconerror)) (OH_AVCodec \*codec, int32_t errorCode, void \*userData) | Defines the function pointer 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 function pointer that is called to report the attributes of the new stream when the output stream changes. Note that the lifecycle of the pointer to the **OH_AVFormat** instance is valid only when the function pointer is being called. Do not access the pointer to the instance after the function pointer is called. | | (\*[OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged)) (OH_AVCodec \*codec, OH_AVFormat \*format, void \*userData) | Defines the function pointer that is called to report the attributes of the new stream when the output stream changes. Note that the lifecycle of the pointer to the **OH_AVFormat** instance is valid only when the function pointer is being called. Do not access the pointer to the instance after the function pointer is called. |
| [OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata)) (OH_AVCodec \*codec, uint32_t index, OH_AVMemory \*data, void \*userData) | Defines the function pointer that is called, with a new buffer to fill in new input data, when new input data is required during the running of an **OH_AVCodec** instance. | | (\*[OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata)) (OH_AVCodec \*codec, uint32_t index, OH_AVMemory \*data, void \*userData) | Defines the function pointer that is called, with a new buffer to fill in new input data, when new input data is required during the running of an **OH_AVCodec** instance. |
| [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 function pointer that is called, with a buffer containing new output data, when the new output data is generated during the running of an **OH_AVCodec** instance. Note that the lifecycle of the pointer to the **[OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md)** instance is valid only when the function pointer is being called. Do not access the pointer to the instance after the function pointer is called. | | (\*[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 function pointer that is called, with a buffer containing new output data, when the new output data is generated during the running of an **OH_AVCodec** instance. Note that the lifecycle of the pointer to the **OH_AVCodecBufferAttr** instance is valid only when the function pointer is being called. Do not access the pointer to the instance after the function pointer is called. |
| [OH_AVCodecAsyncCallback](#oh_avcodecasynccallback) | Defines a collection of asynchronous callback functions for an **OH_AVCodec** instance. You must register this struct instance for an **OH_AVCodec** instance and process the information reported through these callbacks to ensure the normal running of the instance. | | [OH_AVCodecAsyncCallback](#oh_avcodecasynccallback) | Defines a collection of asynchronous callback functions for an **OH_AVCodec** instance. You must register this struct instance for an **OH_AVCodec** instance and process the information reported through these callbacks to ensure the normal running of the instance. |
| [OH_MediaType](#oh_mediatype) | Enumerates the media types. | | [OH_MediaType](#oh_mediatype) | Enumerates the media types. |
| [OH_AVCProfile](#oh_avcprofile) | Enumerates the AVC profiles. | | [OH_AVCProfile](#oh_avcprofile) | Enumerates the AVC profiles. |
| [OH_AACProfile](#oh_aacprofile) | Enumerates the AAC profiles. | | [OH_AACProfile](#oh_aacprofile) | Enumerates the AAC profiles. |
### Enums ### Enums
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [OH_AVCodecBufferFlags](#oh_avcodecbufferflags) {<br/>**AVCODEC_BUFFER_FLAGS_NONE** = 0, AVCODEC_BUFFER_FLAGS_EOS = 1 &lt;&lt; 0, AVCODEC_BUFFER_FLAGS_SYNC_FRAME = 1 &lt;&lt; 1, AVCODEC_BUFFER_FLAGS_INCOMPLETE_FRAME = 1 &lt;&lt; 2,<br/>AVCODEC_BUFFER_FLAGS_CODEC_DATA = 1 &lt;&lt; 3<br/>} | Enumerates the buffer flags of an **OH_AVCodec** instance. | | [OH_AVCodecBufferFlags](#oh_avcodecbufferflags) {<br>**AVCODEC_BUFFER_FLAGS_NONE** = 0, **AVCODEC_BUFFER_FLAGS_EOS** = 1 &lt;&lt; 0, **AVCODEC_BUFFER_FLAGS_SYNC_FRAME** = 1 &lt;&lt; 1, **AVCODEC_BUFFER_FLAGS_INCOMPLETE_FRAME** = 1 &lt;&lt; 2, **AVCODEC_BUFFER_FLAGS_CODEC_DATA**= 1 &lt;&lt; 3<br>} | Enumerates the buffer flags of an **OH_AVCodec** instance. |
| [OH_MediaType](#oh_mediatype) { MEDIA_TYPE_AUD = 0, MEDIA_TYPE_VID = 1 } | Enumerates the media types. | | [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_AVCProfile](#oh_avcprofile) { **AVC_PROFILE_BASELINE** = 0, **AVC_PROFILE_HIGH** = 4, **AVC_PROFILE_MAIN** = 8 } | Enumerates the Advanced Video Coding (AVC) profiles. |
| [OH_AACProfile](#oh_aacprofile) { **AAC_PROFILE_LC** = 0 } | Enumerates the AAC profiles. | | [OH_AACProfile](#oh_aacprofile) { **AAC_PROFILE_LC** = 0 } | Enumerates the Advanced Audio Coding (AAC) profiles. |
### Variables ### Variables
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [OH_AVCodecBufferAttr::pts](#pts) | Presentation timestamp of the buffer, in microseconds. | | [OH_AVCodecBufferAttr::pts](#pts) | Defines the presentation timestamp of the buffer, in microseconds. |
| [OH_AVCodecBufferAttr::size](#size) | Size of the data contained in the buffer, in bytes. | | [OH_AVCodecBufferAttr::size](#size) | Defines the size of the data contained in the buffer, in bytes. |
| [OH_AVCodecBufferAttr::offset](#offset) | Start offset of valid data in the buffer. | | [OH_AVCodecBufferAttr::offset](#offset) | Defines the start offset of valid data in the buffer. |
| [OH_AVCodecBufferAttr::flags](#flags) | Buffer flag, which is a combination of multiple [OH_AVCodecBufferFlags](#oh_avcodecbufferflags). | | [OH_AVCodecBufferAttr::flags](#flags) | Defines a buffer flag, which is a combination of multiple [OH_AVCodecBufferFlags](#oh_avcodecbufferflags). |
| [OH_AVCODEC_MIMETYPE_VIDEO_AVC](#oh_avcodec_mimetype_video_avc) | Defines the Multipurpose Internet Mail Extension (MIME) type for Advanced Video Coding (AVC). | | [OH_AVCODEC_MIMETYPE_VIDEO_AVC](#oh_avcodec_mimetype_video_avc) | Defines the Multipurpose Internet Mail Extension (MIME) type for AVC. |
| [OH_AVCODEC_MIMETYPE_AUDIO_AAC](#oh_avcodec_mimetype_audio_aac) | Defines the MIME type for Advanced Audio Coding (AAC). | | [OH_AVCODEC_MIMETYPE_AUDIO_AAC](#oh_avcodec_mimetype_audio_aac) | Defines the MIME type for AAC. |
| [OH_ED_KEY_TIME_STAMP](#oh_ed_key_time_stamp) | Provides unified character descriptors for the auxiliary data of the surface buffer. | | [OH_ED_KEY_TIME_STAMP](#oh_ed_key_time_stamp) | Defines the unified character descriptors for the auxiliary data of the surface buffer. |
| [OH_ED_KEY_EOS](#oh_ed_key_eos) | Character descriptor of the end-of-stream in the surface auxiliary data. The value type is bool. | | [OH_ED_KEY_EOS](#oh_ed_key_eos) | Defines the character descriptor of the end-of-stream in the surface auxiliary data. The value type is bool. |
| [OH_MD_KEY_TRACK_TYPE](#oh_md_key_track_type) | Provides unified character descriptors for the media playback framework. | | [OH_MD_KEY_TRACK_TYPE](#oh_md_key_track_type) | Defines the unified character descriptors for the media playback framework. |
| [OH_MD_KEY_CODEC_MIME](#oh_md_key_codec_mime) | Character descriptor of the MIME type. The value type is string. | | [OH_MD_KEY_CODEC_MIME](#oh_md_key_codec_mime) | Defines the character descriptor of the MIME type. The value type is string. |
| [OH_MD_KEY_DURATION](#oh_md_key_duration) | Character descriptor of duration. The value type is int64_t. | | [OH_MD_KEY_DURATION](#oh_md_key_duration) | Defines the character descriptor of duration. The value type is int64_t. |
| [OH_MD_KEY_BITRATE](#oh_md_key_bitrate) | Character descriptor of the bit rate. The value type is uint32_t. | | [OH_MD_KEY_BITRATE](#oh_md_key_bitrate) | Defines the character descriptor of the bit rate. The value type is uint32_t. |
| [OH_MD_KEY_MAX_INPUT_SIZE](#oh_md_key_max_input_size) | Character descriptor of the maximum input size. The value type is uint32_t. | | [OH_MD_KEY_MAX_INPUT_SIZE](#oh_md_key_max_input_size) | Defines the character descriptor of the maximum input size. The value type is uint32_t. |
| [OH_MD_KEY_WIDTH](#oh_md_key_width) | Character descriptor of the video width. The value type is uint32_t. | | [OH_MD_KEY_WIDTH](#oh_md_key_width) | Defines the character descriptor of the video width. The value type is uint32_t. |
| [OH_MD_KEY_HEIGHT](#oh_md_key_height) | Character descriptor of the video height. The value type is uint32_t. | | [OH_MD_KEY_HEIGHT](#oh_md_key_height) | Defines the character descriptor of the video height. The value type is uint32_t. |
| [OH_MD_KEY_PIXEL_FORMAT](#oh_md_key_pixel_format) | Character descriptor of the video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat). | | [OH_MD_KEY_PIXEL_FORMAT](#oh_md_key_pixel_format) | Defines the character descriptor of the video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat).|
| [OH_MD_KEY_AUDIO_SAMPLE_FORMAT](#oh_md_key_audio_sample_format) | Character descriptor of the audio sample format. The value type is uint32_t. | | [OH_MD_KEY_AUDIO_SAMPLE_FORMAT](#oh_md_key_audio_sample_format) | Defines the character descriptor of the audio sample format. The value type is uint32_t. |
| [OH_MD_KEY_FRAME_RATE](#oh_md_key_frame_rate) | Character descriptor of the video frame rate. The value type is double. | | [OH_MD_KEY_FRAME_RATE](#oh_md_key_frame_rate) | Defines the character descriptor of the video frame rate. The value type is double. |
| [OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE](#oh_md_key_video_encode_bitrate_mode) | Character descriptor of 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_VIDEO_ENCODE_BITRATE_MODE](#oh_md_key_video_encode_bitrate_mode) | Defines the character descriptor of 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) | Character descriptor of the audio/video encoding capability. The value type is int32_t. For details, see [OH_AVCProfile](#oh_avcprofile) or [OH_AACProfile](#oh_aacprofile). | | [OH_MD_KEY_PROFILE](#oh_md_key_profile) | Defines the character descriptor of the audio/video encoding capability. The value type is int32_t. For details, see [OH_AVCProfile](#oh_avcprofile) or [OH_AACProfile](#oh_aacprofile).|
| [OH_MD_KEY_AUD_CHANNEL_COUNT](#oh_md_key_aud_channel_count) | Character descriptor of the number of audio channels. The value type is uint32_t. | | [OH_MD_KEY_AUD_CHANNEL_COUNT](#oh_md_key_aud_channel_count) | Defines the character descriptor of the number of audio channels. The value type is uint32_t. |
| [OH_MD_KEY_AUD_SAMPLE_RATE](#oh_md_key_aud_sample_rate) | Character descriptor of the audio sampling rate. The value type is uint32_t. | | [OH_MD_KEY_AUD_SAMPLE_RATE](#oh_md_key_aud_sample_rate) | Defines the character descriptor of the audio sampling rate. The value type is uint32_t. |
| [OH_MD_KEY_I_FRAME_INTERVAL](#oh_md_key_i_frame_interval) | Character descriptor of the I-frame interval. The value type is int32_t, and the unit is ms. | | [OH_MD_KEY_I_FRAME_INTERVAL](#oh_md_key_i_frame_interval) | Defines the character descriptor of the I-frame interval. The value type is int32_t, and the unit is ms. |
| [OH_MD_KEY_ROTATION](#oh_md_key_rotation) | Character descriptor of the surface rotation angle. The value type is int32_t. The value range is {0, 90, 180, 270}. The default value is 0. | | [OH_MD_KEY_ROTATION](#oh_md_key_rotation) | Defines the character descriptor of the surface rotation angle. The value type is int32_t. The value range is {0, 90, 180, 270}. The default value is 0. |
## Type Description ## Type Description
...@@ -97,7 +96,7 @@ typedef enum OH_AACProfileOH_AACProfile ...@@ -97,7 +96,7 @@ typedef enum OH_AACProfileOH_AACProfile
**Description**<br> **Description**<br>
Enumerates the AAC profiles. Enumerates the AAC profiles.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
### OH_AVCodecAsyncCallback ### OH_AVCodecAsyncCallback
...@@ -109,16 +108,16 @@ typedef struct OH_AVCodecAsyncCallbackOH_AVCodecAsyncCallback ...@@ -109,16 +108,16 @@ typedef struct OH_AVCodecAsyncCallbackOH_AVCodecAsyncCallback
**Description**<br> **Description**<br>
Defines a collection of asynchronous callback functions for an **OH_AVCodec** instance. You must register this struct instance for an **OH_AVCodec** instance and process the information reported through these callbacks to ensure the normal running of the instance. Defines a collection of asynchronous callback functions for an **OH_AVCodec** instance. You must register this struct instance for an **OH_AVCodec** instance and process the information reported through these callbacks to ensure the normal running of the instance.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| onError | Indicates the callback used to report errors occurred during the running of the instance. For details, see [OH_AVCodecOnError](#oh_avcodeconerror). | | onError | Indicates the callback used to report errors occurred during the running of the instance. For details, see [OH_AVCodecOnError](#oh_avcodeconerror).|
| onStreamChanged | Indicates the callback used to report stream information. For details, see [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged). | | onStreamChanged | Indicates the callback used to report stream information. For details, see [OH_AVCodecOnStreamChanged](#oh_avcodeconstreamchanged).|
| onNeedInputData | Indicates the callback used to report input data needed. For details, see [OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata). | | onNeedInputData | Indicates the callback used to report input data needed. For details, see [OH_AVCodecOnNeedInputData](#oh_avcodeconneedinputdata).|
| onNeedInputData | Indicates the callback used to report output data needed. For details, see [OH_AVCodecOnNewOutputData](#oh_avcodeconnewoutputdata). | | onNeedInputData | Indicates the callback used to report output data needed. For details, see [OH_AVCodecOnNewOutputData](#oh_avcodeconnewoutputdata).|
### OH_AVCodecBufferAttr ### OH_AVCodecBufferAttr
...@@ -130,7 +129,7 @@ typedef struct OH_AVCodecBufferAttrOH_AVCodecBufferAttr ...@@ -130,7 +129,7 @@ typedef struct OH_AVCodecBufferAttrOH_AVCodecBufferAttr
**Description**<br> **Description**<br>
Defines the buffer attributes of an **OH_AVCodec** instance. Defines the buffer attributes of an **OH_AVCodec** instance.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
### OH_AVCodecBufferFlags ### OH_AVCodecBufferFlags
...@@ -142,7 +141,7 @@ typedef enum OH_AVCodecBufferFlagsOH_AVCodecBufferFlags ...@@ -142,7 +141,7 @@ typedef enum OH_AVCodecBufferFlagsOH_AVCodecBufferFlags
**Description**<br> **Description**<br>
Enumerates the buffer flags of an **OH_AVCodec** instance. Enumerates the buffer flags of an **OH_AVCodec** instance.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
### OH_AVCodecOnError ### OH_AVCodecOnError
...@@ -154,15 +153,15 @@ typedef void(* OH_AVCodecOnError) (OH_AVCodec *codec, int32_t errorCode, void *u ...@@ -154,15 +153,15 @@ typedef void(* OH_AVCodecOnError) (OH_AVCodec *codec, int32_t errorCode, void *u
**Description**<br> **Description**<br>
Defines the function pointer that is called to report error information when an error occurs during the running of an **OH_AVCodec** instance. Defines the function pointer that is called to report error information when an error occurs during the running of an **OH_AVCodec** instance.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| errorCode | Indicates an error code. | | errorCode | Indicates an error code. |
| userData | Indicates the pointer to user-specific data. | | userData | Indicates the pointer to user-specific data. |
### OH_AVCodecOnNeedInputData ### OH_AVCodecOnNeedInputData
...@@ -174,16 +173,16 @@ typedef void(* OH_AVCodecOnNeedInputData) (OH_AVCodec *codec, uint32_t index, OH ...@@ -174,16 +173,16 @@ typedef void(* OH_AVCodecOnNeedInputData) (OH_AVCodec *codec, uint32_t index, OH
**Description**<br> **Description**<br>
Defines the function pointer that is called, with a new buffer to fill in new input data, when new input data is required during the running of an **OH_AVCodec** instance. Defines the function pointer that is called, with a new buffer to fill in new input data, when new input data is required during the running of an **OH_AVCodec** instance.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| index | Indicates the index of an input buffer. | | index | Indicates the index of an input buffer. |
| data | Indicates the pointer to the new input data. | | data | Indicates the pointer to the new input data. |
| userData | Indicates the pointer to user-specific data. | | userData | Indicates the pointer to user-specific data. |
### OH_AVCodecOnNewOutputData ### OH_AVCodecOnNewOutputData
...@@ -193,20 +192,19 @@ Defines the function pointer that is called, with a new buffer to fill in new in ...@@ -193,20 +192,19 @@ Defines the function pointer that is called, with a new buffer to fill in new in
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**<br> **Description**<br>
Defines the function pointer that is called, with a buffer containing new output data, when the new output data is generated during the running of an **OH_AVCodec** instance. Note that the lifecycle of the pointer to the **[OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md)** instance is valid only when the function pointer is being called. Do not access the pointer to the instance after the function pointer is called. Defines the function pointer that is called, with a buffer containing new output data, when the new output data is generated during the running of an **OH_AVCodec** instance. Note that the lifecycle of the pointer to the **OH_AVCodecBufferAttr** instance is valid only when the function pointer is being called. Do not access the pointer to the instance after the function pointer is called.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| index | Indicates the index of a new output buffer. | | index | Indicates the index of a new output buffer. |
| data | Indicates the pointer to the new output data. | | data | Indicates the pointer to the new output data. |
| attr | Indicates the pointer to the attributes of the new output buffer. For details, see [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md). | | attr | Indicates the pointer to the attributes of the new output buffer. For details, see [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md).|
| userData | Indicates the pointer to user-specific data. | | userData | Indicates the pointer to user-specific data. |
| userData | specified data |
### OH_AVCodecOnStreamChanged ### OH_AVCodecOnStreamChanged
...@@ -218,15 +216,15 @@ typedef void(* OH_AVCodecOnStreamChanged) (OH_AVCodec *codec, OH_AVFormat *forma ...@@ -218,15 +216,15 @@ typedef void(* OH_AVCodecOnStreamChanged) (OH_AVCodec *codec, OH_AVFormat *forma
**Description**<br> **Description**<br>
Defines the function pointer that is called to report the attributes of the new stream when the output stream changes. Note that the lifecycle of the pointer to the **OH_AVFormat** instance is valid only when the function pointer is being called. Do not access the pointer to the instance after the function pointer is called. Defines the function pointer that is called to report the attributes of the new stream when the output stream changes. Note that the lifecycle of the pointer to the **OH_AVFormat** instance is valid only when the function pointer is being called. Do not access the pointer to the instance after the function pointer is called.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| format | Indicates the handle to the attributes of the new output stream. | | format | Indicates the handle to the attributes of the new output stream. |
| userData | Indicates the pointer to user-specific data. | | userData | Indicates the pointer to user-specific data. |
### OH_AVCProfile ### OH_AVCProfile
...@@ -238,7 +236,7 @@ typedef enum OH_AVCProfileOH_AVCProfile ...@@ -238,7 +236,7 @@ typedef enum OH_AVCProfileOH_AVCProfile
**Description**<br> **Description**<br>
Enumerates the AVC profiles. Enumerates the AVC profiles.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
### OH_MediaType ### OH_MediaType
...@@ -250,7 +248,7 @@ typedef enum OH_MediaTypeOH_MediaType ...@@ -250,7 +248,7 @@ typedef enum OH_MediaTypeOH_MediaType
**Description**<br> **Description**<br>
Enumerates the media types. Enumerates the media types.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
## Enum Description ## Enum Description
...@@ -265,7 +263,7 @@ enum OH_AACProfile ...@@ -265,7 +263,7 @@ enum OH_AACProfile
**Description**<br> **Description**<br>
Enumerates the AAC profiles. Enumerates the AAC profiles.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
### OH_AVCodecBufferFlags ### OH_AVCodecBufferFlags
...@@ -277,14 +275,14 @@ enum OH_AVCodecBufferFlags ...@@ -277,14 +275,14 @@ enum OH_AVCodecBufferFlags
**Description**<br> **Description**<br>
Enumerates the buffer flags of an **OH_AVCodec** instance. Enumerates the buffer flags of an **OH_AVCodec** instance.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
| Name | Description | | Value| Description|
| -------- | -------- | | -------- | -------- |
| AVCODEC_BUFFER_FLAGS_EOS | The buffer contains an end-of-stream frame. | | AVCODEC_BUFFER_FLAGS_EOS | The buffer contains an end-of-stream frame.|
| AVCODEC_BUFFER_FLAGS_SYNC_FRAME | The buffer contains a sync frame. | | AVCODEC_BUFFER_FLAGS_SYNC_FRAME | The buffer contains a sync frame.|
| AVCODEC_BUFFER_FLAGS_INCOMPLETE_FRAME | The buffer contains part of a frame. | | AVCODEC_BUFFER_FLAGS_INCOMPLETE_FRAME | The buffer contains part of a frame.|
| AVCODEC_BUFFER_FLAGS_CODEC_DATA | The buffer contains codec-specific data. | | AVCODEC_BUFFER_FLAGS_CODEC_DATA | The buffer contains codec-specific data.|
### OH_AVCProfile ### OH_AVCProfile
...@@ -296,7 +294,7 @@ enum OH_AVCProfile ...@@ -296,7 +294,7 @@ enum OH_AVCProfile
**Description**<br> **Description**<br>
Enumerates the AVC profiles. Enumerates the AVC profiles.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
### OH_MediaType ### OH_MediaType
...@@ -308,12 +306,12 @@ enum OH_MediaType ...@@ -308,12 +306,12 @@ enum OH_MediaType
**Description**<br> **Description**<br>
Enumerates the media types. Enumerates the media types.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
| Name | Description | | Value| Description|
| -------- | -------- | | -------- | -------- |
| MEDIA_TYPE_AUD | Audio track. | | MEDIA_TYPE_AUD | Audio track.|
| MEDIA_TYPE_VID | Video track. | | MEDIA_TYPE_VID | Video track.|
## Variable Description ## Variable Description
...@@ -326,7 +324,7 @@ Enumerates the media types. ...@@ -326,7 +324,7 @@ Enumerates the media types.
uint32_t OH_AVCodecBufferAttr::flags uint32_t OH_AVCodecBufferAttr::flags
``` ```
**Description**<br> **Description**<br>
Buffer flag, which is a combination of multiple [OH_AVCodecBufferFlags](#oh_avcodecbufferflags). Defines a buffer flag, which is a combination of multiple [OH_AVCodecBufferFlags](#oh_avcodecbufferflags).
### offset ### offset
...@@ -346,9 +344,9 @@ Start offset of valid data in the buffer. ...@@ -346,9 +344,9 @@ Start offset of valid data in the buffer.
const char* OH_AVCODEC_MIMETYPE_AUDIO_AAC const char* OH_AVCODEC_MIMETYPE_AUDIO_AAC
``` ```
**Description**<br> **Description**<br>
Defines the MIME type for Advanced Audio Coding (AAC). Defines the MIME type for AAC.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
### OH_AVCODEC_MIMETYPE_VIDEO_AVC ### OH_AVCODEC_MIMETYPE_VIDEO_AVC
...@@ -358,9 +356,9 @@ Defines the MIME type for Advanced Audio Coding (AAC). ...@@ -358,9 +356,9 @@ Defines the MIME type for Advanced Audio Coding (AAC).
const char* OH_AVCODEC_MIMETYPE_VIDEO_AVC const char* OH_AVCODEC_MIMETYPE_VIDEO_AVC
``` ```
**Description**<br> **Description**<br>
Defines the Multipurpose Internet Mail Extension (MIME) type for Advanced Video Coding (AVC). Defines the MIME type for AVC.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
### OH_ED_KEY_EOS ### OH_ED_KEY_EOS
...@@ -370,7 +368,7 @@ Defines the Multipurpose Internet Mail Extension (MIME) type for Advanced Video ...@@ -370,7 +368,7 @@ Defines the Multipurpose Internet Mail Extension (MIME) type for Advanced Video
const char* OH_ED_KEY_EOS const char* OH_ED_KEY_EOS
``` ```
**Description**<br> **Description**<br>
Character descriptor of the end-of-stream in the surface auxiliary data. The value type is bool. Defines the character descriptor of the end-of-stream in the surface auxiliary data. The value type is bool.
### OH_ED_KEY_TIME_STAMP ### OH_ED_KEY_TIME_STAMP
...@@ -380,9 +378,9 @@ Character descriptor of the end-of-stream in the surface auxiliary data. The val ...@@ -380,9 +378,9 @@ Character descriptor of the end-of-stream in the surface auxiliary data. The val
const char* OH_ED_KEY_TIME_STAMP const char* OH_ED_KEY_TIME_STAMP
``` ```
**Description**<br> **Description**<br>
Provides unified character descriptors for the auxiliary data of the surface buffer. Defines the unified character descriptors for the auxiliary data of the surface buffer.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
### OH_MD_KEY_AUD_CHANNEL_COUNT ### OH_MD_KEY_AUD_CHANNEL_COUNT
...@@ -392,7 +390,7 @@ Provides unified character descriptors for the auxiliary data of the surface buf ...@@ -392,7 +390,7 @@ Provides unified character descriptors for the auxiliary data of the surface buf
const char* OH_MD_KEY_AUD_CHANNEL_COUNT const char* OH_MD_KEY_AUD_CHANNEL_COUNT
``` ```
**Description**<br> **Description**<br>
Character descriptor of the number of audio channels. The value type is uint32_t. Defines the character descriptor of the number of audio channels. The value type is uint32_t.
### OH_MD_KEY_AUD_SAMPLE_RATE ### OH_MD_KEY_AUD_SAMPLE_RATE
...@@ -402,7 +400,7 @@ Character descriptor of the number of audio channels. The value type is uint32_t ...@@ -402,7 +400,7 @@ Character descriptor of the number of audio channels. The value type is uint32_t
const char* OH_MD_KEY_AUD_SAMPLE_RATE const char* OH_MD_KEY_AUD_SAMPLE_RATE
``` ```
**Description**<br> **Description**<br>
Character descriptor of the audio sampling rate. The value type is uint32_t. Defines the character descriptor of the audio sampling rate. The value type is uint32_t.
### OH_MD_KEY_AUDIO_SAMPLE_FORMAT ### OH_MD_KEY_AUDIO_SAMPLE_FORMAT
...@@ -412,7 +410,7 @@ Character descriptor of the audio sampling rate. The value type is uint32_t. ...@@ -412,7 +410,7 @@ Character descriptor of the audio sampling rate. The value type is uint32_t.
const char* OH_MD_KEY_AUDIO_SAMPLE_FORMAT const char* OH_MD_KEY_AUDIO_SAMPLE_FORMAT
``` ```
**Description**<br> **Description**<br>
Character descriptor of the audio sample format. The value type is uint32_t. Defines the character descriptor of the audio sample format. The value type is uint32_t.
### OH_MD_KEY_BITRATE ### OH_MD_KEY_BITRATE
...@@ -422,7 +420,7 @@ Character descriptor of the audio sample format. The value type is uint32_t. ...@@ -422,7 +420,7 @@ Character descriptor of the audio sample format. The value type is uint32_t.
const char* OH_MD_KEY_BITRATE const char* OH_MD_KEY_BITRATE
``` ```
**Description**<br> **Description**<br>
Character descriptor of the bit rate. The value type is uint32_t. Defines the character descriptor of the bit rate. The value type is uint32_t.
### OH_MD_KEY_CODEC_MIME ### OH_MD_KEY_CODEC_MIME
...@@ -432,7 +430,7 @@ Character descriptor of the bit rate. The value type is uint32_t. ...@@ -432,7 +430,7 @@ Character descriptor of the bit rate. The value type is uint32_t.
const char* OH_MD_KEY_CODEC_MIME const char* OH_MD_KEY_CODEC_MIME
``` ```
**Description**<br> **Description**<br>
Character descriptor of the MIME type. The value type is string. Defines the character descriptor of the MIME type. The value type is string.
### OH_MD_KEY_DURATION ### OH_MD_KEY_DURATION
...@@ -442,7 +440,7 @@ Character descriptor of the MIME type. The value type is string. ...@@ -442,7 +440,7 @@ Character descriptor of the MIME type. The value type is string.
const char* OH_MD_KEY_DURATION const char* OH_MD_KEY_DURATION
``` ```
**Description**<br> **Description**<br>
Character descriptor of duration. The value type is int64_t. Defines the character descriptor of duration. The value type is int64_t.
### OH_MD_KEY_FRAME_RATE ### OH_MD_KEY_FRAME_RATE
...@@ -452,7 +450,7 @@ Character descriptor of duration. The value type is int64_t. ...@@ -452,7 +450,7 @@ Character descriptor of duration. The value type is int64_t.
const char* OH_MD_KEY_FRAME_RATE const char* OH_MD_KEY_FRAME_RATE
``` ```
**Description**<br> **Description**<br>
Character descriptor of the video frame rate. The value type is double. Defines the character descriptor of the video frame rate. The value type is double.
### OH_MD_KEY_HEIGHT ### OH_MD_KEY_HEIGHT
...@@ -462,7 +460,7 @@ Character descriptor of the video frame rate. The value type is double. ...@@ -462,7 +460,7 @@ Character descriptor of the video frame rate. The value type is double.
const char* OH_MD_KEY_HEIGHT const char* OH_MD_KEY_HEIGHT
``` ```
**Description**<br> **Description**<br>
Character descriptor of the video height. The value type is uint32_t. Defines the character descriptor of the video height. The value type is uint32_t.
### OH_MD_KEY_I_FRAME_INTERVAL ### OH_MD_KEY_I_FRAME_INTERVAL
...@@ -472,7 +470,7 @@ Character descriptor of the video height. The value type is uint32_t. ...@@ -472,7 +470,7 @@ Character descriptor of the video height. The value type is uint32_t.
const char* OH_MD_KEY_I_FRAME_INTERVAL const char* OH_MD_KEY_I_FRAME_INTERVAL
``` ```
**Description**<br> **Description**<br>
Character descriptor of the I-frame interval. The value type is int32_t, and the unit is ms. Defines the character descriptor of the I-frame interval. The value type is int32_t, and the unit is ms.
### OH_MD_KEY_MAX_INPUT_SIZE ### OH_MD_KEY_MAX_INPUT_SIZE
...@@ -482,7 +480,7 @@ Character descriptor of the I-frame interval. The value type is int32_t, and the ...@@ -482,7 +480,7 @@ Character descriptor of the I-frame interval. The value type is int32_t, and the
const char* OH_MD_KEY_MAX_INPUT_SIZE const char* OH_MD_KEY_MAX_INPUT_SIZE
``` ```
**Description**<br> **Description**<br>
Character descriptor of the maximum input size. The value type is uint32_t. Defines the character descriptor of the maximum input size. The value type is uint32_t.
### OH_MD_KEY_PIXEL_FORMAT ### OH_MD_KEY_PIXEL_FORMAT
...@@ -492,7 +490,7 @@ Character descriptor of the maximum input size. The value type is uint32_t. ...@@ -492,7 +490,7 @@ Character descriptor of the maximum input size. The value type is uint32_t.
const char* OH_MD_KEY_PIXEL_FORMAT const char* OH_MD_KEY_PIXEL_FORMAT
``` ```
**Description**<br> **Description**<br>
Character descriptor of the video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat). Defines the character descriptor of the video pixel format. The value type is int32_t. For details, see [OH_AVPixelFormat](_core.md#oh_avpixelformat).
### OH_MD_KEY_PROFILE ### OH_MD_KEY_PROFILE
...@@ -502,7 +500,7 @@ Character descriptor of the video pixel format. The value type is int32_t. For d ...@@ -502,7 +500,7 @@ Character descriptor of the video pixel format. The value type is int32_t. For d
const char* OH_MD_KEY_PROFILE const char* OH_MD_KEY_PROFILE
``` ```
**Description**<br> **Description**<br>
Character descriptor of the audio/video encoding capability. The value type is int32_t. For details, see [OH_AVCProfile](#oh_avcprofile) or [OH_AACProfile](#oh_aacprofile). Defines the character descriptor of the audio/video encoding capability. The value type is int32_t. For details, see [OH_AVCProfile](#oh_avcprofile) or [OH_AACProfile](#oh_aacprofile).
### OH_MD_KEY_ROTATION ### OH_MD_KEY_ROTATION
...@@ -512,7 +510,7 @@ Character descriptor of the audio/video encoding capability. The value type is i ...@@ -512,7 +510,7 @@ Character descriptor of the audio/video encoding capability. The value type is i
const char* OH_MD_KEY_ROTATION const char* OH_MD_KEY_ROTATION
``` ```
**Description**<br> **Description**<br>
Character descriptor of the surface rotation angle. The value type is int32_t. The value range is {0, 90, 180, 270}. The default value is 0. Defines the character descriptor of the surface rotation angle. The value type is int32_t. The value range is {0, 90, 180, 270}. The default value is 0.
### OH_MD_KEY_TRACK_TYPE ### OH_MD_KEY_TRACK_TYPE
...@@ -522,9 +520,9 @@ Character descriptor of the surface rotation angle. The value type is int32_t. T ...@@ -522,9 +520,9 @@ Character descriptor of the surface rotation angle. The value type is int32_t. T
const char* OH_MD_KEY_TRACK_TYPE const char* OH_MD_KEY_TRACK_TYPE
``` ```
**Description**<br> **Description**<br>
Provides unified character descriptors for the media playback framework. Defines the unified character descriptors for the media playback framework.
\@syscap SystemCapability.Multimedia.Media.CodecBase @syscap SystemCapability.Multimedia.Media.CodecBase
### OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE ### OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE
...@@ -534,7 +532,7 @@ Provides unified character descriptors for the media playback framework. ...@@ -534,7 +532,7 @@ Provides unified character descriptors for the media playback framework.
const char* OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE const char* OH_MD_KEY_VIDEO_ENCODE_BITRATE_MODE
``` ```
**Description**<br> **Description**<br>
Character descriptor of the video encoding bit rate mode. The value type is int32_t. For details, see [OH_VideoEncodeBitrateMode](_video_encoder.md#oh_videoencodebitratemode). Defines the character descriptor of 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_WIDTH ### OH_MD_KEY_WIDTH
...@@ -544,7 +542,7 @@ Character descriptor of the video encoding bit rate mode. The value type is int3 ...@@ -544,7 +542,7 @@ Character descriptor of the video encoding bit rate mode. The value type is int3
const char* OH_MD_KEY_WIDTH const char* OH_MD_KEY_WIDTH
``` ```
**Description**<br> **Description**<br>
Character descriptor of the video width. The value type is uint32_t. Defines the character descriptor of the video width. The value type is uint32_t.
### pts ### pts
...@@ -554,7 +552,7 @@ Character descriptor of the video width. The value type is uint32_t. ...@@ -554,7 +552,7 @@ Character descriptor of the video width. The value type is uint32_t.
int64_t OH_AVCodecBufferAttr::pts int64_t OH_AVCodecBufferAttr::pts
``` ```
**Description**<br> **Description**<br>
Presentation timestamp of the buffer, in microseconds. Defines the presentation timestamp of the buffer, in microseconds.
### size ### size
...@@ -564,4 +562,4 @@ Presentation timestamp of the buffer, in microseconds. ...@@ -564,4 +562,4 @@ Presentation timestamp of the buffer, in microseconds.
int32_t OH_AVCodecBufferAttr::size int32_t OH_AVCodecBufferAttr::size
``` ```
**Description**<br> **Description**<br>
Size of the data contained in the buffer, in bytes. Defines the size of the data contained in the buffer, in bytes.
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
## Overview ## Overview
Provides the functions for video decoding. Provides the functions for video decoding. This module may not be supported on some devices. You can call [CanIUse](../syscap.md) to check whether this module is supported on your device.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Since:** **Since**
9 9
...@@ -16,31 +16,31 @@ Provides the functions for video decoding. ...@@ -16,31 +16,31 @@ Provides the functions for video decoding.
### Files ### Files
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [native_avcodec_videodecoder.h](native__avcodec__videodecoder_8h.md) | Declares the native APIs used for video decoding. <br>File to Include: <multimedia/player_framework/native_avcodec_videodecoder.h> | | [native_avcodec_videodecoder.h](native__avcodec__videodecoder_8h.md) | Declares the native APIs used for video decoding.<br>File to include: <multimedia/player_framework/native_avcodec_videodecoder.h> |
### Functions ### Functions
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [OH_VideoDecoder_CreateByMime](#oh_videodecoder_createbymime) (const char \*mime) | Creates a video decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This API is recommended in most cases. | | [OH_VideoDecoder_CreateByMime](#oh_videodecoder_createbymime) (const char \*mime) | Creates a video decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This API is recommended in most cases. |
| [OH_VideoDecoder_CreateByName](#oh_videodecoder_createbyname) (const char \*name) | Creates a video decoder instance based on a video decoder name. To use this API, you must know the exact name of the video decoder. | | [OH_VideoDecoder_CreateByName](#oh_videodecoder_createbyname) (const char \*name) | Creates a video decoder instance based on a video decoder name. To use this API, you must know the exact name of the video decoder. |
| [OH_VideoDecoder_Destroy](#oh_videodecoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of a video decoder and destroys the video decoder instance. | | [OH_VideoDecoder_Destroy](#oh_videodecoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of a video decoder and destroys the video decoder instance. |
| [OH_VideoDecoder_SetCallback](#oh_videodecoder_setcallback) (OH_AVCodec \*codec, [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by a video decoder. This API must be called prior to **Prepare**. | | [OH_VideoDecoder_SetCallback](#oh_videodecoder_setcallback) (OH_AVCodec \*codec, [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by a video decoder. This API must be called prior to **Prepare**. |
| [OH_VideoDecoder_SetSurface](#oh_videodecoder_setsurface) (OH_AVCodec \*codec, [OHNativeWindow](_native_window.md) \*window) | Sets an output surface for a video decoder. This API must be called prior to **Prepare**. | | [OH_VideoDecoder_SetSurface](#oh_videodecoder_setsurface) (OH_AVCodec \*codec, OHNativeWindow \*window) | Sets an output surface for a video decoder. This API must be called prior to **Prepare**. |
| [OH_VideoDecoder_Configure](#oh_videodecoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures a video decoder. Typically, you need to configure the attributes, which can be extracted from the container, of the video track that can be decoded. This API must be called prior to **Prepare**. | | [OH_VideoDecoder_Configure](#oh_videodecoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures a video decoder. Typically, you need to configure the attributes, which can be extracted from the container, of the video track that can be decoded. This API must be called prior to **Prepare**. |
| [OH_VideoDecoder_Prepare](#oh_videodecoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for a video decoder. This API must be called after **Configure**. | | [OH_VideoDecoder_Prepare](#oh_videodecoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for a video decoder. This API must be called after **Configure**. |
| [OH_VideoDecoder_Start](#oh_videodecoder_start) (OH_AVCodec \*codec) | Starts a video decoder. This API can be called only after the decoder is prepared successfully. After being started, the decoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event. | | [OH_VideoDecoder_Start](#oh_videodecoder_start) (OH_AVCodec \*codec) | Starts a video decoder. This API can be called only after the decoder is prepared successfully. After being started, the decoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event. |
| [OH_VideoDecoder_Stop](#oh_videodecoder_stop) (OH_AVCodec \*codec) | Stops a video decoder. After the decoder is stopped, you can call **Start** to start it again. If you have passed codec-specific data in the previous **Start** for the decoder, you must pass it again. | | [OH_VideoDecoder_Stop](#oh_videodecoder_stop) (OH_AVCodec \*codec) | Stops a video decoder. After the decoder is stopped, you can call **Start** to start it again. If you have passed codec-specific data in the previous **Start** for the decoder, you must pass it again. |
| [OH_VideoDecoder_Flush](#oh_videodecoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of a video decoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required. | | [OH_VideoDecoder_Flush](#oh_videodecoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of a video decoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required. |
| [OH_VideoDecoder_Reset](#oh_videodecoder_reset) (OH_AVCodec \*codec) | Resets a video decoder. To continue decoding, you must call **Configure** and **Start** to configure and start the decoder again. | | [OH_VideoDecoder_Reset](#oh_videodecoder_reset) (OH_AVCodec \*codec) | Resets a video decoder. To continue decoding, you must call **Configure** and **Start** to configure and start the decoder again. |
| [OH_VideoDecoder_GetOutputDescription](#oh_videodecoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the attributes of the output data of a video decoder. The **OH_AVFormat** instance in the return value will become invalid when this API is called again or when the **OH_AVCodec** instance is destroyed. | | [OH_VideoDecoder_GetOutputDescription](#oh_videodecoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the attributes of the output data of a video decoder. The **OH_AVFormat** instance in the return value will become invalid when this API is called again or when the **OH_AVCodec** instance is destroyed. |
| [OH_VideoDecoder_SetParameter](#oh_videodecoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for a video decoder. This API can be called only after the decoder is started. Incorrect parameter settings may cause decoding failure. | | [OH_VideoDecoder_SetParameter](#oh_videodecoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for a video decoder. This API can be called only after the decoder is started. Incorrect parameter settings may cause decoding failure. |
| [OH_VideoDecoder_PushInputData](#oh_videodecoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) attr) | Pushes the input buffer filled with data to a video decoder. The [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback reports available input buffers and their indexes. After being pushed to the decoder, a buffer is not accessible until the buffer with the same index is reported again through the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback. In addition, some decoders require the input of codec-specific data, such as PPS/SPS data in H.264 format, to initialize the decoding process. | | [OH_VideoDecoder_PushInputData](#oh_videodecoder_pushinputdata) (OH_AVCodec \*codec, uint32_t index, [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) attr) | Pushes the input buffer filled with data to a video decoder. The [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback reports available input buffers and their indexes. After being pushed to the decoder, a buffer is not accessible until the buffer with the same index is reported again through the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback. In addition, some decoders require the input of codec-specific data, such as PPS/SPS data in H.264 format, to initialize the decoding process. |
| [OH_VideoDecoder_RenderOutputData](#oh_videodecoder_renderoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of a video decoder and instructs the decoder to render the decoded data in the buffer on the output surface. If no output surface is configured, calling this API only frees the output buffer. | | [OH_VideoDecoder_RenderOutputData](#oh_videodecoder_renderoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of a video decoder and instructs the decoder to render the decoded data in the buffer on the output surface. If no output surface is configured, calling this API only frees the output buffer. |
| [OH_VideoDecoder_FreeOutputData](#oh_videodecoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of a video decoder. | | [OH_VideoDecoder_FreeOutputData](#oh_videodecoder_freeoutputdata) (OH_AVCodec \*codec, uint32_t index) | Frees an output buffer of a video decoder. |
## Function Description ## Function Description
...@@ -55,14 +55,14 @@ OH_AVErrCode OH_VideoDecoder_Configure (OH_AVCodec * codec, OH_AVFormat * format ...@@ -55,14 +55,14 @@ OH_AVErrCode OH_VideoDecoder_Configure (OH_AVCodec * codec, OH_AVFormat * format
**Description**<br> **Description**<br>
Configures a video decoder. Typically, you need to configure the attributes, which can be extracted from the container, of the video track that can be decoded. This API must be called prior to **Prepare**. Configures a video decoder. Typically, you need to configure the attributes, which can be extracted from the container, of the video track that can be decoded. This API must be called prior to **Prepare**.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| format | Indicates the handle to an **OH_AVFormat** instance, which provides the attributes of the video track to be decoded. | | format | Indicates the handle to an **OH_AVFormat** instance, which provides the attributes of the video track to be decoded. |
**Returns** **Returns**
...@@ -80,13 +80,13 @@ OH_AVCodec* OH_VideoDecoder_CreateByMime (const char * mime) ...@@ -80,13 +80,13 @@ OH_AVCodec* OH_VideoDecoder_CreateByMime (const char * mime)
**Description**<br> **Description**<br>
Creates a video decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This API is recommended in most cases. Creates a video decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This API is recommended in most cases.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| mime | Indicates the pointer to a MIME type. For details, see [OH_AVCODEC_MIMETYPE_VIDEO_AVC](_codec_base.md#oh_avcodec_mimetype_video_avc). | | mime | Indicates the pointer to a MIME type. For details, see [OH_AVCODEC_MIMETYPE_VIDEO_AVC](_codec_base.md#oh_avcodec_mimetype_video_avc).|
**Returns** **Returns**
...@@ -102,13 +102,13 @@ OH_AVCodec* OH_VideoDecoder_CreateByName (const char * name) ...@@ -102,13 +102,13 @@ OH_AVCodec* OH_VideoDecoder_CreateByName (const char * name)
**Description**<br> **Description**<br>
Creates a video decoder instance based on a video decoder name. To use this API, you must know the exact name of the video decoder. Creates a video decoder instance based on a video decoder name. To use this API, you must know the exact name of the video decoder.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| name | Indicates the pointer to a video decoder name. | | name | Indicates the pointer to a video decoder name. |
**Returns** **Returns**
...@@ -124,13 +124,13 @@ OH_AVErrCode OH_VideoDecoder_Destroy (OH_AVCodec * codec) ...@@ -124,13 +124,13 @@ OH_AVErrCode OH_VideoDecoder_Destroy (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Clears the internal resources of a video decoder and destroys the video decoder instance. Clears the internal resources of a video decoder and destroys the video decoder instance.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -148,13 +148,13 @@ OH_AVErrCode OH_VideoDecoder_Flush (OH_AVCodec * codec) ...@@ -148,13 +148,13 @@ OH_AVErrCode OH_VideoDecoder_Flush (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Clears the input and output data in the internal buffer of a video decoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required. Clears the input and output data in the internal buffer of a video decoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -172,14 +172,14 @@ OH_AVErrCode OH_VideoDecoder_FreeOutputData (OH_AVCodec * codec, uint32_t index ...@@ -172,14 +172,14 @@ OH_AVErrCode OH_VideoDecoder_FreeOutputData (OH_AVCodec * codec, uint32_t index
**Description**<br> **Description**<br>
Frees an output buffer of a video decoder. Frees an output buffer of a video decoder.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| index | Indicates the index of an output buffer. | | index | Indicates the index of an output buffer. |
**Returns** **Returns**
...@@ -197,13 +197,13 @@ OH_AVFormat* OH_VideoDecoder_GetOutputDescription (OH_AVCodec * codec) ...@@ -197,13 +197,13 @@ OH_AVFormat* OH_VideoDecoder_GetOutputDescription (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Obtains the attributes of the output data of a video decoder. The **OH_AVFormat** instance in the return value will become invalid when this API is called again or when the **OH_AVCodec** instance is destroyed. Obtains the attributes of the output data of a video decoder. The **OH_AVFormat** instance in the return value will become invalid when this API is called again or when the **OH_AVCodec** instance is destroyed.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -219,13 +219,13 @@ OH_AVErrCode OH_VideoDecoder_Prepare (OH_AVCodec * codec) ...@@ -219,13 +219,13 @@ OH_AVErrCode OH_VideoDecoder_Prepare (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Prepares internal resources for a video decoder. This API must be called after **Configure**. Prepares internal resources for a video decoder. This API must be called after **Configure**.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -243,15 +243,15 @@ OH_AVErrCode OH_VideoDecoder_PushInputData (OH_AVCodec * codec, uint32_t index, ...@@ -243,15 +243,15 @@ OH_AVErrCode OH_VideoDecoder_PushInputData (OH_AVCodec * codec, uint32_t index,
**Description**<br> **Description**<br>
Pushes the input buffer filled with data to a video decoder. The [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback reports available input buffers and their indexes. After being pushed to the decoder, a buffer is not accessible until the buffer with the same index is reported again through the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback. In addition, some decoders require the input of codec-specific data, such as PPS/SPS data in H.264 format, to initialize the decoding process. Pushes the input buffer filled with data to a video decoder. The [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback reports available input buffers and their indexes. After being pushed to the decoder, a buffer is not accessible until the buffer with the same index is reported again through the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) callback. In addition, some decoders require the input of codec-specific data, such as PPS/SPS data in H.264 format, to initialize the decoding process.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| index | Indicates the index of an input buffer. | | index | Indicates the index of an input buffer. |
| attr | Indicates the attributes of the data contained in the buffer. | | attr | Indicates the attributes of the data contained in the buffer. |
**Returns** **Returns**
...@@ -269,14 +269,14 @@ OH_AVErrCode OH_VideoDecoder_RenderOutputData (OH_AVCodec * codec, uint32_t inde ...@@ -269,14 +269,14 @@ OH_AVErrCode OH_VideoDecoder_RenderOutputData (OH_AVCodec * codec, uint32_t inde
**Description**<br> **Description**<br>
Frees an output buffer of a video decoder and instructs the decoder to render the decoded data in the buffer on the output surface. If no output surface is configured, calling this API only frees the output buffer. Frees an output buffer of a video decoder and instructs the decoder to render the decoded data in the buffer on the output surface. If no output surface is configured, calling this API only frees the output buffer.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| index | Indicates the index of an output buffer. | | index | Indicates the index of an output buffer. |
**Returns** **Returns**
...@@ -294,13 +294,13 @@ OH_AVErrCode OH_VideoDecoder_Reset (OH_AVCodec * codec) ...@@ -294,13 +294,13 @@ OH_AVErrCode OH_VideoDecoder_Reset (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Resets a video decoder. To continue decoding, you must call **Configure** and **Start** to configure and start the decoder again. Resets a video decoder. To continue decoding, you must call **Configure** and **Start** to configure and start the decoder again.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -318,15 +318,15 @@ OH_AVErrCode OH_VideoDecoder_SetCallback (OH_AVCodec * codec, OH_AVCodecAsyncCal ...@@ -318,15 +318,15 @@ OH_AVErrCode OH_VideoDecoder_SetCallback (OH_AVCodec * codec, OH_AVCodecAsyncCal
**Description**<br> **Description**<br>
Sets an asynchronous callback so that your application can respond to events generated by a video decoder. This API must be called prior to **Prepare**. Sets an asynchronous callback so that your application can respond to events generated by a video decoder. This API must be called prior to **Prepare**.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| callback | Indicates a collection of all callback functions. For details, see [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md). | | callback | Indicates a collection of all callback functions. For details, see [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md).|
| userData | Indicates the pointer to user-specific data. | | userData | Indicates the pointer to user-specific data. |
**Returns** **Returns**
...@@ -344,14 +344,14 @@ OH_AVErrCode OH_VideoDecoder_SetParameter (OH_AVCodec * codec, OH_AVFormat * for ...@@ -344,14 +344,14 @@ OH_AVErrCode OH_VideoDecoder_SetParameter (OH_AVCodec * codec, OH_AVFormat * for
**Description**<br> **Description**<br>
Sets dynamic parameters for a video decoder. This API can be called only after the decoder is started. Incorrect parameter settings may cause decoding failure. Sets dynamic parameters for a video decoder. This API can be called only after the decoder is started. Incorrect parameter settings may cause decoding failure.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| format | Indicates the handle to an **OH_AVFormat** instance. | | format | Indicates the pointer to an **OH_AVFormat** instance. |
**Returns** **Returns**
...@@ -369,14 +369,14 @@ OH_AVErrCode OH_VideoDecoder_SetSurface (OH_AVCodec * codec, OHNativeWindow * wi ...@@ -369,14 +369,14 @@ OH_AVErrCode OH_VideoDecoder_SetSurface (OH_AVCodec * codec, OHNativeWindow * wi
**Description**<br> **Description**<br>
Sets an output surface for a video decoder. This API must be called prior to **Prepare**. Sets an output surface for a video decoder. This API must be called prior to **Prepare**.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| window | Indicates the pointer to an **OHNativeWindow** instance. | | window | Indicates the pointer to an **OHNativeWindow** instance. |
**Returns** **Returns**
...@@ -394,13 +394,13 @@ OH_AVErrCode OH_VideoDecoder_Start (OH_AVCodec * codec) ...@@ -394,13 +394,13 @@ OH_AVErrCode OH_VideoDecoder_Start (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Starts a video decoder. This API can be called only after the decoder is prepared successfully. After being started, the decoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event. Starts a video decoder. This API can be called only after the decoder is prepared successfully. After being started, the decoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -418,13 +418,13 @@ OH_AVErrCode OH_VideoDecoder_Stop (OH_AVCodec * codec) ...@@ -418,13 +418,13 @@ OH_AVErrCode OH_VideoDecoder_Stop (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Stops a video decoder. After the decoder is stopped, you can call **Start** to start it again. If you have passed codec-specific data in the previous **Start** for the decoder, you must pass it again. Stops a video decoder. After the decoder is stopped, you can call **Start** to start it again. If you have passed codec-specific data in the previous **Start** for the decoder, you must pass it again.
\@syscap SystemCapability.Multimedia.Media.VideoDecoder @syscap SystemCapability.Multimedia.Media.VideoDecoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
......
...@@ -3,57 +3,56 @@ ...@@ -3,57 +3,56 @@
## Overview ## Overview
Provides the functions and enums for video encoding. Provides the functions and enums for video encoding. This module may not be supported on some devices. You can call [CanIUse](../syscap.md) to check whether this module is supported on your device.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Since:** **Since**
9 9
## Summary ## Summary
### Files ### Files
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [native_avcodec_videoencoder.h](native__avcodec__videoencoder_8h.md) | Declares the native APIs used for video encoding. <br>File to Include: <multimedia/player_framework/native_avcodec_videoencoder.h> | | [native_avcodec_videoencoder.h](native__avcodec__videoencoder_8h.md) | Declares the native APIs used for video encoding.<br>File to include: <multimedia/player_framework/native_avcodec_videoencoder.h> |
### Types ### Types
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [OH_VideoEncodeBitrateMode](#oh_videoencodebitratemode) | Enumerates the bit rate modes of video encoding. | | [OH_VideoEncodeBitrateMode](#oh_videoencodebitratemode) | Enumerates the bit rate modes of video encoding. |
### Enums ### Enums
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| [OH_VideoEncodeBitrateMode](#oh_videoencodebitratemode) { CBR = 0, VBR = 1, CQ = 2 } | Enumerates the bit rate modes of video encoding. | | [OH_VideoEncodeBitrateMode](#oh_videoencodebitratemode) { **CBR** = 0, **VBR** = 1, **CQ** = 2 } | Enumerates the bit rate modes of video encoding. |
### Functions ### 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 API is recommended in most cases. | | [OH_VideoEncoder_CreateByMime](#oh_videoencoder_createbymime) (const char \*mime) | Creates a video encoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This API is recommended in most cases. |
| [OH_VideoEncoder_CreateByName](#oh_videoencoder_createbyname) (const char \*name) | Creates a video encoder instance based on a video encoder name. To use this API, you must know the exact name of the video encoder. | | [OH_VideoEncoder_CreateByName](#oh_videoencoder_createbyname) (const char \*name) | Creates a video encoder instance based on a video encoder name. To use this API, you must know the exact name of the video encoder. |
| [OH_VideoEncoder_Destroy](#oh_videoencoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of a video encoder and destroys the video encoder instance. | | [OH_VideoEncoder_Destroy](#oh_videoencoder_destroy) (OH_AVCodec \*codec) | Clears the internal resources of a video encoder and destroys the video encoder instance. |
| [OH_VideoEncoder_SetCallback](#oh_videoencoder_setcallback) (OH_AVCodec \*codec, [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by a video encoder. This API must be called prior to **Prepare**. | | [OH_VideoEncoder_SetCallback](#oh_videoencoder_setcallback) (OH_AVCodec \*codec, [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md) callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by a video encoder. This API must be called prior to **Prepare**. |
| [OH_VideoEncoder_Configure](#oh_videoencoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures a video encoder. Typically, you need to configure the attributes of the video track that can be encoded. This API must be called prior to **Prepare**. | | [OH_VideoEncoder_Configure](#oh_videoencoder_configure) (OH_AVCodec \*codec, OH_AVFormat \*format) | Configures a video encoder. Typically, you need to configure the attributes of the video track that can be encoded. This API must be called prior to **Prepare**. |
| [OH_VideoEncoder_Prepare](#oh_videoencoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for a video encoder. This API must be called after **Configure**. | | [OH_VideoEncoder_Prepare](#oh_videoencoder_prepare) (OH_AVCodec \*codec) | Prepares internal resources for a video encoder. This API must be called after **Configure**. |
| [OH_VideoEncoder_Start](#oh_videoencoder_start) (OH_AVCodec \*codec) | Starts a video encoder. This API can be called only after the encoder is prepared successfully. After being started, the encoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event. | | [OH_VideoEncoder_Start](#oh_videoencoder_start) (OH_AVCodec \*codec) | Starts a video encoder. This API can be called only after the encoder is prepared successfully. After being started, the encoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event. |
| [OH_VideoEncoder_Stop](#oh_videoencoder_stop) (OH_AVCodec \*codec) | Stops a video encoder. After the encoder is stopped, you can call **Start** to start it again. | | [OH_VideoEncoder_Stop](#oh_videoencoder_stop) (OH_AVCodec \*codec) | Stops a video encoder. After the encoder is stopped, you can call **Start** to start it again. |
| [OH_VideoEncoder_Flush](#oh_videoencoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of a video encoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required. | | [OH_VideoEncoder_Flush](#oh_videoencoder_flush) (OH_AVCodec \*codec) | Clears the input and output data in the internal buffer of a video encoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required. |
| [OH_VideoEncoder_Reset](#oh_videoencoder_reset) (OH_AVCodec \*codec) | Resets a video encoder. To continue encoding, you must call **Configure** and **Start** to configure and start the encoder again. | | [OH_VideoEncoder_Reset](#oh_videoencoder_reset) (OH_AVCodec \*codec) | Resets a video encoder. To continue encoding, you must call **Configure** and **Start** to configure and start the encoder again. |
| [OH_VideoEncoder_GetOutputDescription](#oh_videoencoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the attributes of the output data of a video encoder. The **OH_AVFormat** instance in the return value will become invalid when this API is called again or when the **OH_AVCodec** instance is destroyed. | | [OH_VideoEncoder_GetOutputDescription](#oh_videoencoder_getoutputdescription) (OH_AVCodec \*codec) | Obtains the attributes of the output data of a video encoder. The **OH_AVFormat** instance in the return value will become invalid when this API is called again or when the **OH_AVCodec** instance is destroyed. |
| [OH_VideoEncoder_SetParameter](#oh_videoencoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for a video encoder. This API can be called only after the encoder is started. Incorrect parameter settings may cause encoding failure. | | [OH_VideoEncoder_SetParameter](#oh_videoencoder_setparameter) (OH_AVCodec \*codec, OH_AVFormat \*format) | Sets dynamic parameters for a video encoder. This API can be called only after the encoder is started. Incorrect parameter settings may cause encoding failure. |
| [OH_VideoEncoder_GetSurface](#oh_videoencoder_getsurface) (OH_AVCodec \*codec, [OHNativeWindow](_native_window.md) \*\*window) | Obtains an input surface from a video encoder. This API must be called prior to **Prepare**. | | [OH_VideoEncoder_GetSurface](#oh_videoencoder_getsurface) (OH_AVCodec \*codec, OHNativeWindow \*\*window) | Obtains an input surface from a video encoder. This API 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_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. This API is recommended in surface mode. | | [OH_VideoEncoder_NotifyEndOfStream](#oh_videoencoder_notifyendofstream) (OH_AVCodec \*codec) | Notifies a video encoder that input streams end. This API is recommended in surface mode. |
## Type Description ## Type Description
...@@ -68,7 +67,7 @@ typedef enum OH_VideoEncodeBitrateModeOH_VideoEncodeBitrateMode ...@@ -68,7 +67,7 @@ typedef enum OH_VideoEncodeBitrateModeOH_VideoEncodeBitrateMode
**Description**<br> **Description**<br>
Enumerates the bit rate modes of video encoding. Enumerates the bit rate modes of video encoding.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
## Enum Description ## Enum Description
...@@ -83,13 +82,13 @@ enum OH_VideoEncodeBitrateMode ...@@ -83,13 +82,13 @@ enum OH_VideoEncodeBitrateMode
**Description**<br> **Description**<br>
Enumerates the bit rate modes of video encoding. Enumerates the bit rate modes of video encoding.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
| Name | Description | | Value| Description|
| -------- | -------- | | -------- | -------- |
| CBR | Constant bit rate. | | CBR | Constant bit rate.|
| VBR | Variable bit rate. | | VBR | Variable bit rate.|
| CQ | Constant quality. | | CQ | Constant quality.|
## Function Description ## Function Description
...@@ -104,14 +103,14 @@ OH_AVErrCode OH_VideoEncoder_Configure (OH_AVCodec * codec, OH_AVFormat * format ...@@ -104,14 +103,14 @@ OH_AVErrCode OH_VideoEncoder_Configure (OH_AVCodec * codec, OH_AVFormat * format
**Description**<br> **Description**<br>
Configures a video encoder. Typically, you need to configure the attributes of the video track that can be encoded. This API must be called prior to **Prepare**. Configures a video encoder. Typically, you need to configure the attributes of the video track that can be encoded. This API must be called prior to **Prepare**.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| format | Indicates the handle to an **OH_AVFormat** instance, which provides the attributes of the video track to be encoded. | | format | Indicates the handle to an **OH_AVFormat** instance, which provides the attributes of the video track to be encoded. |
**Returns** **Returns**
...@@ -127,15 +126,15 @@ Returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode) if the op ...@@ -127,15 +126,15 @@ Returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode) if the op
OH_AVCodec* OH_VideoEncoder_CreateByMime (const char * mime) OH_AVCodec* OH_VideoEncoder_CreateByMime (const char * mime)
``` ```
**Description**<br> **Description**<br>
Creates a video encoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This API is recommended in most cases. Creates a video encoder instance based on a MIME type. This API is recommended in most cases.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| mime | Indicates the pointer to a MIME type. For details, see [OH_AVCODEC_MIMETYPE_VIDEO_AVC](_codec_base.md#oh_avcodec_mimetype_video_avc). | | mime | Indicates the pointer to a MIME type. For details, see [OH_AVCODEC_MIMETYPE_VIDEO_AVC](_codec_base.md#oh_avcodec_mimetype_video_avc).|
**Returns** **Returns**
...@@ -151,13 +150,13 @@ OH_AVCodec* OH_VideoEncoder_CreateByName (const char * name) ...@@ -151,13 +150,13 @@ OH_AVCodec* OH_VideoEncoder_CreateByName (const char * name)
**Description**<br> **Description**<br>
Creates a video encoder instance based on a video encoder name. To use this API, you must know the exact name of the video encoder. Creates a video encoder instance based on a video encoder name. To use this API, you must know the exact name of the video encoder.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| name | Indicates the pointer to a video encoder name. | | name | Indicates the pointer to a video encoder name. |
**Returns** **Returns**
...@@ -173,13 +172,13 @@ OH_AVErrCode OH_VideoEncoder_Destroy (OH_AVCodec * codec) ...@@ -173,13 +172,13 @@ OH_AVErrCode OH_VideoEncoder_Destroy (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Clears the internal resources of a video encoder and destroys the video encoder instance. Clears the internal resources of a video encoder and destroys the video encoder instance.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -197,13 +196,13 @@ OH_AVErrCode OH_VideoEncoder_Flush (OH_AVCodec * codec) ...@@ -197,13 +196,13 @@ OH_AVErrCode OH_VideoEncoder_Flush (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Clears the input and output data in the internal buffer of a video encoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required. Clears the input and output data in the internal buffer of a video encoder. This API invalidates the indexes of all buffers previously reported through the asynchronous callback. Therefore, before calling this API, ensure that the buffers corresponding to the indexes are no longer required.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -221,14 +220,14 @@ OH_AVErrCode OH_VideoEncoder_FreeOutputData (OH_AVCodec * codec, uint32_t index ...@@ -221,14 +220,14 @@ OH_AVErrCode OH_VideoEncoder_FreeOutputData (OH_AVCodec * codec, uint32_t index
**Description**<br> **Description**<br>
Frees an output buffer of a video encoder. Frees an output buffer of a video encoder.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| index | Indicates the index of an output buffer. | | index | Indicates the index of an output buffer. |
**Returns** **Returns**
...@@ -246,13 +245,13 @@ OH_AVFormat* OH_VideoEncoder_GetOutputDescription (OH_AVCodec * codec) ...@@ -246,13 +245,13 @@ OH_AVFormat* OH_VideoEncoder_GetOutputDescription (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Obtains the attributes of the output data of a video encoder. The **OH_AVFormat** instance in the return value will become invalid when this API is called again or when the **OH_AVCodec** instance is destroyed. Obtains the attributes of the output data of a video encoder. The **OH_AVFormat** instance in the return value will become invalid when this API is called again or when the **OH_AVCodec** instance is destroyed.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -268,14 +267,14 @@ OH_AVErrCode OH_VideoEncoder_GetSurface (OH_AVCodec * codec, OHNativeWindow ** w ...@@ -268,14 +267,14 @@ OH_AVErrCode OH_VideoEncoder_GetSurface (OH_AVCodec * codec, OHNativeWindow ** w
**Description**<br> **Description**<br>
Obtains an input surface from a video encoder. This API must be called prior to **Prepare**. Obtains an input surface from a video encoder. This API must be called prior to **Prepare**.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| window | Indicates the double pointer to an **OHNativeWindow** instance. | | window | Indicates the double pointer to an **OHNativeWindow** instance. |
**Returns** **Returns**
...@@ -293,13 +292,13 @@ OH_AVErrCode OH_VideoEncoder_NotifyEndOfStream (OH_AVCodec * codec) ...@@ -293,13 +292,13 @@ OH_AVErrCode OH_VideoEncoder_NotifyEndOfStream (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Notifies a video encoder that input streams end. This API is recommended in surface mode. Notifies a video encoder that input streams end. This API is recommended in surface mode.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -317,13 +316,13 @@ OH_AVErrCode OH_VideoEncoder_Prepare (OH_AVCodec * codec) ...@@ -317,13 +316,13 @@ OH_AVErrCode OH_VideoEncoder_Prepare (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Prepares internal resources for a video encoder. This API must be called after **Configure**. Prepares internal resources for a video encoder. This API must be called after **Configure**.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -341,13 +340,13 @@ OH_AVErrCode OH_VideoEncoder_Reset (OH_AVCodec * codec) ...@@ -341,13 +340,13 @@ OH_AVErrCode OH_VideoEncoder_Reset (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Resets a video encoder. To continue encoding, you must call **Configure** and **Start** to configure and start the encoder again. Resets a video encoder. To continue encoding, you must call **Configure** and **Start** to configure and start the encoder again.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -365,15 +364,15 @@ OH_AVErrCode OH_VideoEncoder_SetCallback (OH_AVCodec * codec, OH_AVCodecAsyncCal ...@@ -365,15 +364,15 @@ OH_AVErrCode OH_VideoEncoder_SetCallback (OH_AVCodec * codec, OH_AVCodecAsyncCal
**Description**<br> **Description**<br>
Sets an asynchronous callback so that your application can respond to events generated by a video encoder. This API must be called prior to **Prepare**. Sets an asynchronous callback so that your application can respond to events generated by a video encoder. This API must be called prior to **Prepare**.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| callback | Indicates a collection of all callback functions. For details, see [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md). | | callback | Indicates a collection of all callback functions. For details, see [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md).|
| userData | Indicates the pointer to user-specific data. | | userData | Indicates the pointer to user-specific data. |
**Returns** **Returns**
...@@ -391,14 +390,14 @@ OH_AVErrCode OH_VideoEncoder_SetParameter (OH_AVCodec * codec, OH_AVFormat * for ...@@ -391,14 +390,14 @@ OH_AVErrCode OH_VideoEncoder_SetParameter (OH_AVCodec * codec, OH_AVFormat * for
**Description**<br> **Description**<br>
Sets dynamic parameters for a video encoder. This API can be called only after the encoder is started. Incorrect parameter settings may cause encoding failure. Sets dynamic parameters for a video encoder. This API can be called only after the encoder is started. Incorrect parameter settings may cause encoding failure.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
| format | Indicates the handle to an **OH_AVFormat** instance. | | format | Indicates the handle to an **OH_AVFormat** instance. |
**Returns** **Returns**
...@@ -416,13 +415,13 @@ OH_AVErrCode OH_VideoEncoder_Start (OH_AVCodec * codec) ...@@ -416,13 +415,13 @@ OH_AVErrCode OH_VideoEncoder_Start (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Starts a video encoder. This API can be called only after the encoder is prepared successfully. After being started, the encoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event. Starts a video encoder. This API can be called only after the encoder is prepared successfully. After being started, the encoder starts to report the [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) event.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
...@@ -440,13 +439,13 @@ OH_AVErrCode OH_VideoEncoder_Stop (OH_AVCodec * codec) ...@@ -440,13 +439,13 @@ OH_AVErrCode OH_VideoEncoder_Stop (OH_AVCodec * codec)
**Description**<br> **Description**<br>
Stops a video encoder. After the encoder is stopped, you can call **Start** to start it again. Stops a video encoder. After the encoder is stopped, you can call **Start** to start it again.
\@syscap SystemCapability.Multimedia.Media.VideoEncoder @syscap SystemCapability.Multimedia.Media.VideoEncoder
**Parameters** **Parameters**
| Name | Description | | Name| Description|
| -------- | -------- | | -------- | -------- |
| codec | Indicates the pointer to an **OH_AVCodec** instance. | | codec | Indicates the pointer to an **OH_AVCodec** instance. |
**Returns** **Returns**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册