@@ -19,7 +19,7 @@ The **AVCapability** module provides functions for querying the codec capability
| Name| Description|
| -------- | -------- |
| [native_avcapability.h](native__avcapability_8h.md) | Declares the native APIs used to query the codec capability.<br>File to include: \<multimedia/native_avcapability.h>|
| [native_avcapability.h](native__avcapability_8h.md) | Declares the native APIs used to query the codec capability.<br>**File to include**: <multimedia/player_framework/native_avcapability.h><br>**Library**: libnative_media_codecbase.so|
### Structs
...
...
@@ -33,7 +33,7 @@ The **AVCapability** module provides functions for querying the codec capability
| Name| Description|
| -------- | -------- |
| [OH_BitrateMode](#oh_bitratemode) | Defines an enum that enumerates the bit rate modes of an encoder. |
| [OH_BitrateMode](#oh_bitratemode) | Defines an enum that enumerates the bit rate modes of an encoder.|
| [OH_AVRange](#oh_avrange) | Defines a struct for the value range, which contains the minimum value and maximum value.|
| [OH_AVCodecCategory](#oh_avcodeccategory) | Defines an enum that enumerates the codec categories.|
...
...
@@ -42,7 +42,7 @@ The **AVCapability** module provides functions for querying the codec capability
| Name| Description|
| -------- | -------- |
| [OH_BitrateMode](#oh_bitratemode) { **BITRATE_MODE_CBR** = 0, **BITRATE_MODE_VBR** = 1, **BITRATE_MODE_CQ** = 2 } | Enumerates the bit rate modes of an encoder. |
| [OH_BitrateMode](#oh_bitratemode) { **BITRATE_MODE_CBR** = 0, **BITRATE_MODE_VBR** = 1, **BITRATE_MODE_CQ** = 2 } | Enumerates the bit rate modes of an encoder.|
@@ -19,7 +19,7 @@ The AVDemuxer module provides functions for audio and video decapsulation.
| Name| Description|
| -------- | -------- |
| [native_avdemuxer.h](native__avdemuxer_8h.md) | Declares the native APIs used for audio and video decapsulation.<br>File to include: \<multimedia/native_avdemuxer.h> |
| [native_avdemuxer.h](native__avdemuxer_8h.md) | Declares the native APIs used for audio and video decapsulation.<br>**File to include**: <multimedia/player_framework/native_avdemuxer.h><br>**Library**: libnative_media_avdemuxer.so|
### Functions
...
...
@@ -41,7 +41,7 @@ The AVDemuxer module provides functions for audio and video decapsulation.
@@ -19,7 +19,7 @@ The **AVMuxer** module provides functions for audio and video encapsulation.
| Name| Description|
| -------- | -------- |
| [native_avmuxer.h](native__avmuxer_8h.md) | Declares native APIs used for audio and video encapsulation.<br>File to include: <multimedia/native_avmuxer.h>|
| [native_avmuxer.h](native__avmuxer_8h.md) | Declares native APIs used for audio and video encapsulation.<br>**File to include**: <multimedia/player_framework/native_avmuxer.h><br>**Library**: libnative_media_avmuxer.so|
### Functions
...
...
@@ -42,7 +42,7 @@ The **AVMuxer** module provides functions for audio and video encapsulation.
@@ -19,7 +19,7 @@ The AVSource module provides functions for constructing audio and video resource
| Name| Description|
| -------- | -------- |
| [native_avsource.h](native__avsource_8h.md) | Declares the native APIs used to construct audio and video resource objects.<br>File to include: \<multimedia/native_avsource.h>|
| [native_avsource.h](native__avsource_8h.md) | Declares the native APIs used to construct audio and video resource objects.<br>**File to include**: <multimedia/player_framework/native_avsource.h><br>**Library**: libnative_media_avsource.so|
### Functions
...
...
@@ -40,7 +40,7 @@ The AVSource module provides functions for constructing audio and video resource
The **AudioDecoder** module provides the functions for audio decoding. This module may not be supported on some devices. You can call [CanIUse](../syscap.md) to check whether your device supports this module.
...
...
@@ -11,53 +10,46 @@ The **AudioDecoder** module provides the functions for audio decoding. This modu
9
## Summary
### Files
| Name| Description|
| -------- | -------- |
| [native_avcodec_audiodecoder.h](native__avcodec__audiodecoder_8h.md) | Declares the native APIs used for audio decoding.<br>File to include: <multimedia/player_framework/native_avcodec_audiodecoder.h>|
| [avcodec_audio_channel_layout.h](avcodec__audio__channel__layout_8h.md) | Declares the enums used for audio codec.<br>File to include: \<multimedia/avcodec_audio_channel_layout.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><br>**Library**: libnative_media_adec.so|
| [avcodec_audio_channel_layout.h](avcodec__audio__channel__layout_8h.md) | Declares the enums used for audio codec.<br>**File to include**: <multimedia/player_framework/avcodec_audio_channel_layout.h><br>**Library**: libnative_media_codecbase.so |
| \*[OHOS::Media::OH_AudioDecoder_CreateByMime](#oh_audiodecoder_createbymime)(const char \*mime) | Creates an audio decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases.|
| \*[OHOS::Media::OH_AudioDecoder_CreateByName](#oh_audiodecoder_createbyname)(const char \*name) | Creates an audio decoder instance based on a decoder name. To use this function, you must know the exact name of the decoder.|
| [OHOS::Media::OH_AudioDecoder_Destroy](#oh_audiodecoder_destroy)(OH_AVCodec\*codec) | Clears the internal resources of an audio decoder and destroys the decoder instance.|
| [OHOS::Media::OH_AudioDecoder_SetCallback](#oh_audiodecoder_setcallback)(OH_AVCodec\*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio decoder.|
| [OHOS::Media::OH_AudioDecoder_Configure](#oh_audiodecoder_configure)(OH_AVCodec\*codec, OH_AVFormat \*format) | Configures an audio decoder. Typically, you need to configure the audio description information that can be extracted from the container.|
| [OHOS::Media::OH_AudioDecoder_Prepare](#oh_audiodecoder_prepare)(OH_AVCodec\*codec) | Prepares internal resources for an audio decoder. This function must be called after **Configure**.|
| [OHOS::Media::OH_AudioDecoder_Start](#oh_audiodecoder_start)(OH_AVCodec\*codec) | Starts an audio decoder. This function can be called only after the decoder is prepared successfully.|
| [OHOS::Media::OH_AudioDecoder_Stop](#oh_audiodecoder_stop)(OH_AVCodec\*codec) | Stops an audio decoder.|
| [OHOS::Media::OH_AudioDecoder_Flush](#oh_audiodecoder_flush)(OH_AVCodec\*codec) | Clears the input and output data in the internal buffer of an audio decoder.|
| [OHOS::Media::OH_AudioDecoder_Reset](#oh_audiodecoder_reset)(OH_AVCodec\*codec) | Resets an audio decoder. To continue decoding, you must call **Configure** to configure the decoder again.|
| \*[OHOS::Media::OH_AudioDecoder_GetOutputDescription](#oh_audiodecoder_getoutputdescription)(OH_AVCodec\*codec) | Obtains the description information about the output data of an audio decoder. For details, see **OH_AVFormat**.|
| \*[OHOS::Media::OH_AudioDecoder_CreateByMime](#oh_audiodecoder_createbymime)(const char \*mime) | Creates an audio decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases. |
| \*[OHOS::Media::OH_AudioDecoder_CreateByName](#oh_audiodecoder_createbyname)(const char \*name) | Creates an audio decoder instance based on a decoder name. To use this function, you must know the exact name of the decoder. |
| [OHOS::Media::OH_AudioDecoder_Destroy](#oh_audiodecoder_destroy)(OH_AVCodec\*codec) | Clears the internal resources of an audio decoder and destroys the decoder instance. |
| [OHOS::Media::OH_AudioDecoder_SetCallback](#oh_audiodecoder_setcallback)(OH_AVCodec\*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio decoder. |
| [OHOS::Media::OH_AudioDecoder_Configure](#oh_audiodecoder_configure)(OH_AVCodec\*codec, OH_AVFormat \*format) | Configures an audio decoder. Typically, you need to configure the audio description information that can be extracted from the container. |
| [OHOS::Media::OH_AudioDecoder_Prepare](#oh_audiodecoder_prepare)(OH_AVCodec\*codec) | Prepares internal resources for an audio decoder. This function must be called after **Configure**. |
| [OHOS::Media::OH_AudioDecoder_Start](#oh_audiodecoder_start)(OH_AVCodec\*codec) | Starts an audio decoder. This function can be called only after the decoder is prepared successfully. |
| [OHOS::Media::OH_AudioDecoder_Stop](#oh_audiodecoder_stop)(OH_AVCodec\*codec) | Stops an audio decoder. |
| [OHOS::Media::OH_AudioDecoder_Flush](#oh_audiodecoder_flush)(OH_AVCodec\*codec) | Clears the input and output data in the internal buffer of an audio decoder. |
| [OHOS::Media::OH_AudioDecoder_Reset](#oh_audiodecoder_reset)(OH_AVCodec\*codec) | Resets an audio decoder. To continue decoding, you must call **Configure** to configure the decoder again. |
| \*[OHOS::Media::OH_AudioDecoder_GetOutputDescription](#oh_audiodecoder_getoutputdescription)(OH_AVCodec\*codec) | Obtains the description information about the output data of an audio decoder. For details, see **OH_AVFormat**. |
| [OHOS::Media::OH_AudioDecoder_SetParameter](#oh_audiodecoder_setparameter)(OH_AVCodec\*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio decoder. This function can be called only after the decoder is started. Incorrect parameter settings may cause decoding failure.|
| [OHOS::Media::OH_AudioDecoder_PushInputData](#oh_audiodecoder_pushinputdata)(OH_AVCodec\*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio decoder.|
| [OHOS::Media::OH_AudioDecoder_FreeOutputData](#oh_audiodecoder_freeoutputdata)(OH_AVCodec\*codec, uint32_t index) | Frees an output buffer of an audio decoder.|
| [OHOS::Media::OH_AudioDecoder_IsValid](#oh_audiodecoder_isvalid)(OH_AVCodec\*codec, bool \*isValid) | Checks whether an audio decoder instance is valid.|
| [OHOS::Media::OH_AudioDecoder_PushInputData](#oh_audiodecoder_pushinputdata)(OH_AVCodec\*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio decoder. |
| [OHOS::Media::OH_AudioDecoder_FreeOutputData](#oh_audiodecoder_freeoutputdata)(OH_AVCodec\*codec, uint32_t index) | Frees an output buffer of an audio decoder. |
| [OHOS::Media::OH_AudioDecoder_IsValid](#oh_audiodecoder_isvalid)(OH_AVCodec\*codec, bool \*isValid) | Checks whether an audio decoder instance is valid. |
## Enum Description
### AudioChannelLayout
```
enum OHOS::Media::AudioChannelLayout : uint64_t
```
...
...
@@ -72,10 +64,8 @@ Enumerates the types of the audio channel numbers. The output format of the deco
10
### AudioChannelSet
```
enum OHOS::Media::AudioChannelSet : uint64_t
```
...
...
@@ -90,35 +80,32 @@ Enumerates the audio channel numbers. Each channel number is mapped to a variabl
10
| Value| Description|
| -------- | -------- |
| AMBISONICS_ACN1 | Channel 0 for the zero-order stereo.|
| AMBISONICS_ACN2 | Channel 1 for the first-order stereo.|
| AMBISONICS_ACN3 | Channel 2 for the first-order stereo.|
| AMBISONICS_W | Channel 3 for the first-order stereo.|
| Value | Description |
| ---------------- | ---------------------- |
| AMBISONICS_ACN1 | Channel 0 for the zero-order stereo. |
| AMBISONICS_ACN2 | Channel 1 for the first-order stereo. |
| AMBISONICS_ACN3 | Channel 2 for the first-order stereo. |
| AMBISONICS_W | Channel 3 for the first-order stereo. |
| AMBISONICS_Y | Equivalent to channel 0 for the zero-order stereo.|
| AMBISONICS_Z | Equivalent to channel 1 for the first-order stereo.|
| AMBISONICS_X | Equivalent to channel 2 for the first-order stereo.|
| AMBISONICS_ACN4 | Equivalent to channel 3 for the first-order stereo.|
| AMBISONICS_ACN5 | Channel 4 for the second-order stereo.|
| AMBISONICS_ACN6 | Channel 5 for the second-order stereo.|
| AMBISONICS_ACN7 | Channel 6 for the second-order stereo.|
| AMBISONICS_ACN8 | Channel 7 for the second-order stereo.|
| AMBISONICS_ACN9 | Channel 8 for the second-order stereo.|
| AMBISONICS_ACN10 | Channel 9 for the third-order stereo.|
| AMBISONICS_ACN11 | Channel 10 for the third-order stereo.|
| AMBISONICS_ACN12 | Channel 11 for the third-order stereo.|
| AMBISONICS_ACN13 | Channel 12 for the third-order stereo.|
| AMBISONICS_ACN14 | Channel 13 for the third-order stereo.|
| AMBISONICS_ACN15 | Channel 14 for the third-order stereo.|
| AMBISONICS_ACN5 | Channel 4 for the second-order stereo. |
| AMBISONICS_ACN6 | Channel 5 for the second-order stereo. |
| AMBISONICS_ACN7 | Channel 6 for the second-order stereo. |
| AMBISONICS_ACN8 | Channel 7 for the second-order stereo. |
| AMBISONICS_ACN9 | Channel 8 for the second-order stereo. |
| AMBISONICS_ACN10 | Channel 9 for the third-order stereo. |
| AMBISONICS_ACN11 | Channel 10 for the third-order stereo. |
| AMBISONICS_ACN12 | Channel 11 for the third-order stereo. |
| AMBISONICS_ACN13 | Channel 12 for the third-order stereo. |
| AMBISONICS_ACN14 | Channel 13 for the third-order stereo. |
| AMBISONICS_ACN15 | Channel 14 for the third-order stereo. |
## Function Description
### OH_AudioDecoder_Configure()
```
OH_AVErrCode OHOS::Media::OH_AudioDecoder_Configure (OH_AVCodec * codec, OH_AVFormat * format )
```
...
...
@@ -133,9 +120,9 @@ This function must be called prior to **Prepare**.
The **AudioEncoder** module provides the functions for audio encoding. This module may not be supported on some devices. You can call [CanIUse](../syscap.md) to check whether your device supports this module.
...
...
@@ -11,44 +10,38 @@ The **AudioEncoder** module provides the functions for audio encoding. This modu
9
## Summary
### Files
| Name| Description|
| -------- | -------- |
| [native_avcodec_audioencoder.h](native__avcodec__audioencoder_8h.md) | Declares the native APIs used for audio encoding.<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><br>**Library**: libnative_media_aenc.so|
### Functions
| Name| Description|
| -------- | -------- |
| \*[OHOS::Media::OH_AudioEncoder_CreateByMime](#oh_audioencoder_createbymime)(const char \*mime) | Creates an audio encoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases.|
| \*[OHOS::Media::OH_AudioEncoder_CreateByName](#oh_audioencoder_createbyname)(const char \*name) | Creates an audio encoder instance based on an encoder name. To use this function, you must know the exact name of the encoder.|
| [OHOS::Media::OH_AudioEncoder_Destroy](#oh_audioencoder_destroy)(OH_AVCodec\*codec) | Clears the internal resources of an audio encoder and destroys the encoder instance.|
| [OHOS::Media::OH_AudioEncoder_SetCallback](#oh_audioencoder_setcallback)(OH_AVCodec\*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio encoder.|
| [OHOS::Media::OH_AudioEncoder_Configure](#oh_audioencoder_configure)(OH_AVCodec\*codec, OH_AVFormat \*format) | Configures an audio encoder. Typically, you need to configure the description information about the audio track to be encoded.|
| [OHOS::Media::OH_AudioEncoder_Prepare](#oh_audioencoder_prepare)(OH_AVCodec\*codec) | Prepares internal resources for an audio encoder. This function must be called after **Configure**.|
| [OHOS::Media::OH_AudioEncoder_Start](#oh_audioencoder_start)(OH_AVCodec\*codec) | Starts an audio encoder. This function can be called only after the encoder is prepared successfully.|
| [OHOS::Media::OH_AudioEncoder_Stop](#oh_audioencoder_stop)(OH_AVCodec\*codec) | Stops an audio encoder.|
| [OHOS::Media::OH_AudioEncoder_Flush](#oh_audioencoder_flush)(OH_AVCodec\*codec) | Clears the input and output data in the internal buffer of an audio encoder.|
| [OHOS::Media::OH_AudioEncoder_Reset](#oh_audioencoder_reset)(OH_AVCodec\*codec) | Resets an audio encoder.|
| \*[OHOS::Media::OH_AudioEncoder_CreateByMime](#oh_audioencoder_createbymime)(const char \*mime) | Creates an audio encoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases. |
| \*[OHOS::Media::OH_AudioEncoder_CreateByName](#oh_audioencoder_createbyname)(const char \*name) | Creates an audio encoder instance based on an encoder name. To use this function, you must know the exact name of the encoder. |
| [OHOS::Media::OH_AudioEncoder_Destroy](#oh_audioencoder_destroy)(OH_AVCodec\*codec) | Clears the internal resources of an audio encoder and destroys the encoder instance. |
| [OHOS::Media::OH_AudioEncoder_SetCallback](#oh_audioencoder_setcallback)(OH_AVCodec\*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio encoder. |
| [OHOS::Media::OH_AudioEncoder_Configure](#oh_audioencoder_configure)(OH_AVCodec\*codec, OH_AVFormat \*format) | Configures an audio encoder. Typically, you need to configure the description information about the audio track to be encoded. |
| [OHOS::Media::OH_AudioEncoder_Prepare](#oh_audioencoder_prepare)(OH_AVCodec\*codec) | Prepares internal resources for an audio encoder. This function must be called after **Configure**. |
| [OHOS::Media::OH_AudioEncoder_Start](#oh_audioencoder_start)(OH_AVCodec\*codec) | Starts an audio encoder. This function can be called only after the encoder is prepared successfully. |
| [OHOS::Media::OH_AudioEncoder_Stop](#oh_audioencoder_stop)(OH_AVCodec\*codec) | Stops an audio encoder. |
| [OHOS::Media::OH_AudioEncoder_Flush](#oh_audioencoder_flush)(OH_AVCodec\*codec) | Clears the input and output data in the internal buffer of an audio encoder. |
| [OHOS::Media::OH_AudioEncoder_Reset](#oh_audioencoder_reset)(OH_AVCodec\*codec) | Resets an audio encoder. |
| \*[OHOS::Media::OH_AudioEncoder_GetOutputDescription](#oh_audioencoder_getoutputdescription)(OH_AVCodec\*codec) | Obtains the description information about the output data of an audio encoder. For details, see **OH_AVFormat**.|
| [OHOS::Media::OH_AudioEncoder_SetParameter](#oh_audioencoder_setparameter)(OH_AVCodec\*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio encoder.|
| [OHOS::Media::OH_AudioEncoder_PushInputData](#oh_audioencoder_pushinputdata)(OH_AVCodec\*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio encoder.|
| [OHOS::Media::OH_AudioEncoder_FreeOutputData](#oh_audioencoder_freeoutputdata)(OH_AVCodec\*codec, uint32_t index) | Frees an output buffer of an audio encoder.|
| [OHOS::Media::OH_AudioEncoder_IsValid](#oh_audioencoder_isvalid)(OH_AVCodec\*codec, bool \*isValid) | Checks whether an audio encoder instance is valid.|
| [OHOS::Media::OH_AudioEncoder_SetParameter](#oh_audioencoder_setparameter)(OH_AVCodec\*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio encoder. |
| [OHOS::Media::OH_AudioEncoder_PushInputData](#oh_audioencoder_pushinputdata)(OH_AVCodec\*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio encoder. |
| [OHOS::Media::OH_AudioEncoder_FreeOutputData](#oh_audioencoder_freeoutputdata)(OH_AVCodec\*codec, uint32_t index) | Frees an output buffer of an audio encoder. |
| [OHOS::Media::OH_AudioEncoder_IsValid](#oh_audioencoder_isvalid)(OH_AVCodec\*codec, bool \*isValid) | Checks whether an audio encoder instance is valid. |
## Function Description
### OH_AudioEncoder_Configure()
```
OH_AVErrCode OHOS::Media::OH_AudioEncoder_Configure (OH_AVCodec * codec, OH_AVFormat * format )
```
...
...
@@ -63,9 +56,9 @@ This function must be called prior to **Prepare**.
@@ -19,7 +19,7 @@ The **CodecBase** module provides the common structs, character constants, and e
| 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 **OH_AVCodec** instances.<br>**File to include**: <multimedia/player_framework/native_avcodec_base.h><br>**Library**: libnative_media_codecbase.so|
### Structs
...
...
@@ -57,17 +57,17 @@ The **CodecBase** module provides the common structs, character constants, and e
| Name| Description|
| -------- | -------- |
| [OH_AVCodecBufferFlags](#oh_avcodecbufferflags) {<br>**AVCODEC_BUFFER_FLAGS_NONE** = 0, **AVCODEC_BUFFER_FLAGS_EOS** = 1 << 0, **AVCODEC_BUFFER_FLAGS_SYNC_FRAME** = 1 << 1, **AVCODEC_BUFFER_FLAGS_INCOMPLETE_FRAME** = 1 << 2,<br>**AVCODEC_BUFFER_FLAGS_CODEC_DATA** = 1 << 3<br>} | Enumerates the flags for the buffer of an **OH_AVCodec** instance.|
| [OH_AVOutputFormat](#oh_avoutputformat) {**AV_OUTPUT_FORMAT_DEFAULT** = 0, **AV_OUTPUT_FORMAT_MPEG_4** = 2, **AV_OUTPUT_FORMAT_M4A** = 6 } | Enumerates the output file formats of a muxer.|
| [OH_MediaType](#oh_mediatype) {**MEDIA_TYPE_AUD** = 0, **MEDIA_TYPE_VID** = 1 } | Enumerates the media types.|
@@ -19,9 +19,9 @@ The **Core** module provides the basic backbone capabilities for the media playb
| Name| Description|
| -------- | -------- |
| [native_averrors.h](native__averrors_8h.md) | Declares the error codes used by the media playback framework.<br>File to include: \<multimedia/player_framework/native_averrors.h> |
| [native_avformat.h](native__avformat_8h.md) | Declares the format-related functions and enums.<br>File to include: \<multimedia/player_framework/native_avformat.h> |
| [native_avmemory.h](native__avmemory_8h.md) | Declares the memory-related functions.<br>File to include: \<multimedia/player_framework/native_avmemory.h> |
| [native_averrors.h](native__averrors_8h.md) | Declares the error codes used by the media playback framework.<br>**File to include**: <multimedia/player_framework/native_averrors.h><br>**Library**: libnative_media_core.so|
| [native_avformat.h](native__avformat_8h.md) | Declares the format-related functions and enums.<br>**File to include**: <multimedia/player_framework/native_avformat.h><br>**Library**: libnative_media_core.so|
| [native_avmemory.h](native__avmemory_8h.md) | Declares the memory-related functions.<br>**File to include**: <multimedia/player_framework/native_avmemory.h><br>**Library**: libnative_media_core.so|
### Types
...
...
@@ -36,8 +36,8 @@ The **Core** module provides the basic backbone capabilities for the media playb
@@ -19,7 +19,7 @@ The VideoDecoder module provides the functions for video decoding.
| Name| Description|
| -------- | -------- |
| [native_avcodec_videodecoder.h](native__avcodec__videodecoder_8h.md) | Declares the native APIs used for video decoding.<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><br>**Library**: libnative_media_vdec.so |
### Functions
...
...
@@ -52,7 +52,7 @@ The VideoDecoder module provides the functions for video decoding.
```
OH_AVErrCode OH_VideoDecoder_Configure (OH_AVCodec * codec, OH_AVFormat * format )
@@ -19,21 +19,21 @@ The **VideoEncoder** module provides the functions for video encoding.
| 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><br>**Library**: libnative_media_venc.so|
### Types
| Name| Description|
| -------- | -------- |
| [OH_VideoEncodeBitrateMode](#oh_videoencodebitratemode) | Defines an enum that enumerates the bit rate modes of a video encoder. |
| [OH_VideoEncodeBitrateMode](#oh_videoencodebitratemode) | Defines an enum that enumerates the bit rate modes of a video encoder.|
### Enums
| Name| Description|
| -------- | -------- |
| [OH_VideoEncodeBitrateMode](#oh_videoencodebitratemode) {**CBR** = 0, **VBR** = 1, **CQ** = 2 } | Enumerates the bit rate modes of a video encoder.|
| [OH_VideoEncodeBitrateMode](#oh_videoencodebitratemode) {<br> **CBR** = 0,<br> **VBR** = 1,<br> **CQ** = 2<br>} | Enumerates the bit rate modes of a video encoder.|
### Functions
...
...
@@ -67,7 +67,7 @@ The **VideoEncoder** module provides the functions for video encoding.
| [OH_BitrateMode](_a_v_capability.md#oh_bitratemode) {<br> **BITRATE_MODE_CBR** = 0,<br> **BITRATE_MODE_VBR** = 1,<br> **BITRATE_MODE_CQ** = 2<br>} | Enumerates the bit rate modes of an encoder.|
| [OH_AVCodecCategory](_a_v_capability.md#oh_avcodeccategory) {<br> **HARDWARE** = 0,<br> **SOFTWARE**<br>} | Enumerates the codec categories.|
The **native_avcodec_audiodecoder.h** file declares the native APIs used for audio decoding.
...
...
@@ -13,26 +12,24 @@ The **native_avcodec_audiodecoder.h** file declares the native APIs used for aud
[AudioDecoder](_audio_decoder.md)
## Summary
### Functions
| Name| Description|
| -------- | -------- |
| \*[OHOS::Media::OH_AudioDecoder_CreateByMime](_audio_decoder.md#oh_audiodecoder_createbymime)(const char \*mime) | Creates an audio decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases.|
| \*[OHOS::Media::OH_AudioDecoder_CreateByName](_audio_decoder.md#oh_audiodecoder_createbyname)(const char \*name) | Creates an audio decoder instance based on a decoder name. To use this function, you must know the exact name of the decoder.|
| [OHOS::Media::OH_AudioDecoder_Destroy](_audio_decoder.md#oh_audiodecoder_destroy)(OH_AVCodec\*codec) | Clears the internal resources of an audio decoder and destroys the decoder instance.|
| [OHOS::Media::OH_AudioDecoder_SetCallback](_audio_decoder.md#oh_audiodecoder_setcallback)(OH_AVCodec\*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio decoder.|
| [OHOS::Media::OH_AudioDecoder_Configure](_audio_decoder.md#oh_audiodecoder_configure)(OH_AVCodec\*codec, OH_AVFormat \*format) | Configures an audio decoder. Typically, you need to configure the audio description information that can be extracted from the container.|
| [OHOS::Media::OH_AudioDecoder_Prepare](_audio_decoder.md#oh_audiodecoder_prepare)(OH_AVCodec\*codec) | Prepares internal resources for an audio decoder. This function must be called after **Configure**.|
| [OHOS::Media::OH_AudioDecoder_Start](_audio_decoder.md#oh_audiodecoder_start)(OH_AVCodec\*codec) | Starts an audio decoder. This function can be called only after the decoder is prepared successfully.|
| [OHOS::Media::OH_AudioDecoder_Stop](_audio_decoder.md#oh_audiodecoder_stop)(OH_AVCodec\*codec) | Stops an audio decoder.|
| [OHOS::Media::OH_AudioDecoder_Flush](_audio_decoder.md#oh_audiodecoder_flush)(OH_AVCodec\*codec) | Clears the input and output data in the internal buffer of an audio decoder.|
| [OHOS::Media::OH_AudioDecoder_Reset](_audio_decoder.md#oh_audiodecoder_reset)(OH_AVCodec\*codec) | Resets an audio decoder. To continue decoding, you must call **Configure** to configure the decoder again.|
| \*[OHOS::Media::OH_AudioDecoder_GetOutputDescription](_audio_decoder.md#oh_audiodecoder_getoutputdescription)(OH_AVCodec\*codec) | Obtains the description information about the output data of an audio decoder. For details, see **OH_AVFormat**.|
| \*[OHOS::Media::OH_AudioDecoder_CreateByMime](_audio_decoder.md#oh_audiodecoder_createbymime)(const char \*mime) | Creates an audio decoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases. |
| \*[OHOS::Media::OH_AudioDecoder_CreateByName](_audio_decoder.md#oh_audiodecoder_createbyname)(const char \*name) | Creates an audio decoder instance based on a decoder name. To use this function, you must know the exact name of the decoder. |
| [OHOS::Media::OH_AudioDecoder_Destroy](_audio_decoder.md#oh_audiodecoder_destroy)(OH_AVCodec\*codec) | Clears the internal resources of an audio decoder and destroys the decoder instance. |
| [OHOS::Media::OH_AudioDecoder_SetCallback](_audio_decoder.md#oh_audiodecoder_setcallback)(OH_AVCodec\*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio decoder. |
| [OHOS::Media::OH_AudioDecoder_Configure](_audio_decoder.md#oh_audiodecoder_configure)(OH_AVCodec\*codec, OH_AVFormat \*format) | Configures an audio decoder. Typically, you need to configure the audio description information that can be extracted from the container. |
| [OHOS::Media::OH_AudioDecoder_Prepare](_audio_decoder.md#oh_audiodecoder_prepare)(OH_AVCodec\*codec) | Prepares internal resources for an audio decoder. This function must be called after **Configure**. |
| [OHOS::Media::OH_AudioDecoder_Start](_audio_decoder.md#oh_audiodecoder_start)(OH_AVCodec\*codec) | Starts an audio decoder. This function can be called only after the decoder is prepared successfully. |
| [OHOS::Media::OH_AudioDecoder_Stop](_audio_decoder.md#oh_audiodecoder_stop)(OH_AVCodec\*codec) | Stops an audio decoder. |
| [OHOS::Media::OH_AudioDecoder_Flush](_audio_decoder.md#oh_audiodecoder_flush)(OH_AVCodec\*codec) | Clears the input and output data in the internal buffer of an audio decoder. |
| [OHOS::Media::OH_AudioDecoder_Reset](_audio_decoder.md#oh_audiodecoder_reset)(OH_AVCodec\*codec) | Resets an audio decoder. To continue decoding, you must call **Configure** to configure the decoder again. |
| \*[OHOS::Media::OH_AudioDecoder_GetOutputDescription](_audio_decoder.md#oh_audiodecoder_getoutputdescription)(OH_AVCodec\*codec) | Obtains the description information about the output data of an audio decoder. For details, see **OH_AVFormat**. |
| [OHOS::Media::OH_AudioDecoder_SetParameter](_audio_decoder.md#oh_audiodecoder_setparameter)(OH_AVCodec\*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio decoder. This function can be called only after the decoder is started. Incorrect parameter settings may cause decoding failure.|
| [OHOS::Media::OH_AudioDecoder_PushInputData](_audio_decoder.md#oh_audiodecoder_pushinputdata)(OH_AVCodec\*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio decoder.|
| [OHOS::Media::OH_AudioDecoder_FreeOutputData](_audio_decoder.md#oh_audiodecoder_freeoutputdata)(OH_AVCodec\*codec, uint32_t index) | Frees an output buffer of an audio decoder.|
| [OHOS::Media::OH_AudioDecoder_IsValid](_audio_decoder.md#oh_audiodecoder_isvalid)(OH_AVCodec\*codec, bool \*isValid) | Checks whether an audio decoder instance is valid.|
| [OHOS::Media::OH_AudioDecoder_PushInputData](_audio_decoder.md#oh_audiodecoder_pushinputdata)(OH_AVCodec\*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio decoder. |
| [OHOS::Media::OH_AudioDecoder_FreeOutputData](_audio_decoder.md#oh_audiodecoder_freeoutputdata)(OH_AVCodec\*codec, uint32_t index) | Frees an output buffer of an audio decoder. |
| [OHOS::Media::OH_AudioDecoder_IsValid](_audio_decoder.md#oh_audiodecoder_isvalid)(OH_AVCodec\*codec, bool \*isValid) | Checks whether an audio decoder instance is valid. |
The **native_avcodec_audioencoder.h** file declares the native APIs used for audio encoding.
...
...
@@ -13,26 +12,24 @@ The **native_avcodec_audioencoder.h** file declares the native APIs used for aud
[AudioEncoder](_audio_encoder.md)
## Summary
### Functions
| Name| Description|
| -------- | -------- |
| \*[OHOS::Media::OH_AudioEncoder_CreateByMime](_audio_encoder.md#oh_audioencoder_createbymime)(const char \*mime) | Creates an audio encoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases.|
| \*[OHOS::Media::OH_AudioEncoder_CreateByMime](_audio_encoder.md#oh_audioencoder_createbymime)(const char \*mime) | Creates an audio encoder instance based on a Multipurpose Internet Mail Extension (MIME) type. This function is recommended in most cases. |
| \*[OHOS::Media::OH_AudioEncoder_CreateByName](_audio_encoder.md#oh_audioencoder_createbyname)(const char \*name) | Creates an audio encoder instance based on an encoder name. To use this function, you must know the exact name of the encoder.|
| [OHOS::Media::OH_AudioEncoder_Destroy](_audio_encoder.md#oh_audioencoder_destroy)(OH_AVCodec\*codec) | Clears the internal resources of an audio encoder and destroys the encoder instance.|
| [OHOS::Media::OH_AudioEncoder_SetCallback](_audio_encoder.md#oh_audioencoder_setcallback)(OH_AVCodec\*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio encoder.|
| [OHOS::Media::OH_AudioEncoder_Configure](_audio_encoder.md#oh_audioencoder_configure)(OH_AVCodec\*codec, OH_AVFormat \*format) | Configures an audio encoder. Typically, you need to configure the description information about the audio track to be encoded.|
| [OHOS::Media::OH_AudioEncoder_Prepare](_audio_encoder.md#oh_audioencoder_prepare)(OH_AVCodec\*codec) | Prepares internal resources for an audio encoder. This function must be called after **Configure**.|
| [OHOS::Media::OH_AudioEncoder_Start](_audio_encoder.md#oh_audioencoder_start)(OH_AVCodec\*codec) | Starts an audio encoder. This function can be called only after the encoder is prepared successfully.|
| [OHOS::Media::OH_AudioEncoder_Stop](_audio_encoder.md#oh_audioencoder_stop)(OH_AVCodec\*codec) | Stops an audio encoder.|
| [OHOS::Media::OH_AudioEncoder_Flush](_audio_encoder.md#oh_audioencoder_flush)(OH_AVCodec\*codec) | Clears the input and output data in the internal buffer of an audio encoder.|
| [OHOS::Media::OH_AudioEncoder_Reset](_audio_encoder.md#oh_audioencoder_reset)(OH_AVCodec\*codec) | Resets an audio encoder.|
| \*[OHOS::Media::OH_AudioEncoder_GetOutputDescription](_audio_encoder.md#oh_audioencoder_getoutputdescription)(OH_AVCodec\*codec) | Obtains the description information about the output data of an audio encoder. For details, see **OH_AVFormat**.|
| [OHOS::Media::OH_AudioEncoder_SetParameter](_audio_encoder.md#oh_audioencoder_setparameter)(OH_AVCodec\*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio encoder.|
| [OHOS::Media::OH_AudioEncoder_PushInputData](_audio_encoder.md#oh_audioencoder_pushinputdata)(OH_AVCodec\*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio encoder.|
| [OHOS::Media::OH_AudioEncoder_FreeOutputData](_audio_encoder.md#oh_audioencoder_freeoutputdata)(OH_AVCodec\*codec, uint32_t index) | Frees an output buffer of an audio encoder.|
| [OHOS::Media::OH_AudioEncoder_IsValid](_audio_encoder.md#oh_audioencoder_isvalid)(OH_AVCodec\*codec, bool \*isValid) | Checks whether an audio encoder instance is valid.|
| [OHOS::Media::OH_AudioEncoder_Destroy](_audio_encoder.md#oh_audioencoder_destroy)(OH_AVCodec\*codec) | Clears the internal resources of an audio encoder and destroys the encoder instance. |
| [OHOS::Media::OH_AudioEncoder_SetCallback](_audio_encoder.md#oh_audioencoder_setcallback)(OH_AVCodec\*codec, OH_AVCodecAsyncCallback callback, void \*userData) | Sets an asynchronous callback so that your application can respond to events generated by an audio encoder. |
| [OHOS::Media::OH_AudioEncoder_Configure](_audio_encoder.md#oh_audioencoder_configure)(OH_AVCodec\*codec, OH_AVFormat \*format) | Configures an audio encoder. Typically, you need to configure the description information about the audio track to be encoded. |
| [OHOS::Media::OH_AudioEncoder_Prepare](_audio_encoder.md#oh_audioencoder_prepare)(OH_AVCodec\*codec) | Prepares internal resources for an audio encoder. This function must be called after **Configure**. |
| [OHOS::Media::OH_AudioEncoder_Start](_audio_encoder.md#oh_audioencoder_start)(OH_AVCodec\*codec) | Starts an audio encoder. This function can be called only after the encoder is prepared successfully. |
| [OHOS::Media::OH_AudioEncoder_Stop](_audio_encoder.md#oh_audioencoder_stop)(OH_AVCodec\*codec) | Stops an audio encoder. |
| [OHOS::Media::OH_AudioEncoder_Flush](_audio_encoder.md#oh_audioencoder_flush)(OH_AVCodec\*codec) | Clears the input and output data in the internal buffer of an audio encoder. |
| [OHOS::Media::OH_AudioEncoder_Reset](_audio_encoder.md#oh_audioencoder_reset)(OH_AVCodec\*codec) | Resets an audio encoder. |
| \*[OHOS::Media::OH_AudioEncoder_GetOutputDescription](_audio_encoder.md#oh_audioencoder_getoutputdescription)(OH_AVCodec\*codec) | Obtains the description information about the output data of an audio encoder. For details, see **OH_AVFormat**. |
| [OHOS::Media::OH_AudioEncoder_SetParameter](_audio_encoder.md#oh_audioencoder_setparameter)(OH_AVCodec\*codec, OH_AVFormat \*format) | Sets dynamic parameters for an audio encoder. |
| [OHOS::Media::OH_AudioEncoder_PushInputData](_audio_encoder.md#oh_audioencoder_pushinputdata)(OH_AVCodec\*codec, uint32_t index, OH_AVCodecBufferAttr attr) | Pushes the input buffer filled with data to an audio encoder. |
| [OHOS::Media::OH_AudioEncoder_FreeOutputData](_audio_encoder.md#oh_audioencoder_freeoutputdata)(OH_AVCodec\*codec, uint32_t index) | Frees an output buffer of an audio encoder. |
| [OHOS::Media::OH_AudioEncoder_IsValid](_audio_encoder.md#oh_audioencoder_isvalid)(OH_AVCodec\*codec, bool \*isValid) | Checks whether an audio encoder instance is valid. |
@@ -28,7 +28,7 @@ The **native_avcodec_videoencoder.h** file declares the native APIs used for vid
| Name| Description|
| -------- | -------- |
| [OH_VideoEncodeBitrateMode](_video_encoder.md#oh_videoencodebitratemode) {**CBR** = 0, **VBR** = 1, **CQ** = 2 } | Enumerates the bit rate modes of a video encoder.|
| [OH_VideoEncodeBitrateMode](_video_encoder.md#oh_videoencodebitratemode) {<br> **CBR** = 0,<br> **VBR** = 1,<br> **CQ** = 2<br>} | Enumerates the bit rate modes of a video encoder.|