提交 a18d564a 编写于 作者: G Gloria

Update docs against 19905+19949

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 bdd68601
# Native API
# Native APIs
- Modules
- [Native XComponent](_o_h___native_x_component.md)
- [HiLog](_hi_log.md)
- [NativeWindow](_native_window.md)
- [OH_NativeBuffer](_o_h___native_buffer.md)
- [Drawing](_drawing.md)
- [OH_NativeImage](_o_h___native_image.md)
- [NativeVsync](_native_vsync.md)
- [Image](image.md)
- [Rawfile](rawfile.md)
- [RDB](_r_d_b.md)
- [MindSpore](_mind_spore.md)
- [NeuralNeworkRuntime](_neural_nework_runtime.md)
- [AVCapability](_a_v_capability.md)
- [AVMuxer](_a_v_muxer.md)
- [AudioDecoder](_audio_decoder.md)
- [AudioEncoder](_audio_encoder.md)
- [CodecBase](_codec_base.md)
- [Core](_core.md)
- [VideoDecoder](_video_decoder.md)
- [VideoEncoder](_video_encoder.md)
- [Core](_core.md)
- [AVDemuxer](_a_v_demuxer.md)
- [AVSource](_a_v_source.md)
- [OHAudio](_o_h_audio.md)
- [HuksKeyApi](_huks_key_api.md)
- [HuksParamSetApi](_huks_param_set_api.md)
- [HuksTypeApi](_huks_type_api.md)
......@@ -35,7 +43,10 @@
- [external_window.h](external__window_8h.md)
- [image_pixel_map_napi.h](image__pixel__map__napi_8h.md)
- [log.h](log_8h.md)
- [native_buffer.h](native__buffer_8h.md)
- [native_image.h](native__image_8h.md)
- [native_interface_xcomponent.h](native__interface__xcomponent_8h.md)
- [native_vsync.h](native__vsync_8h.md)
- [raw_dir.h](raw__dir_8h.md)
- [raw_file_manager.h](raw__file__manager_8h.md)
- [raw_file.h](raw__file_8h.md)
......@@ -48,14 +59,23 @@
- [types.h](types_8h.md)
- [neural_network_runtime_type.h](neural__network__runtime__type_8h.md)
- [neural_network_runtime.h](neural__network__runtime_8h.md)
- [avcodec_audio_channel_layout.h](avcodec__audio__channel__layout_8h.md)
- [native_avcapability.h](native__avcapability_8h.md)
- [native_avcodec_audiodecoder.h](native__avcodec__audiodecoder_8h.md)
- [native_avcodec_audioencoder.h](native__avcodec__audioencoder_8h.md)
- [native_avcodec_base.h](native__avcodec__base_8h.md)
- [native_avcodec_videodecoder.h](native__avcodec__videodecoder_8h.md)
- [native_avcodec_videoencoder.h](native__avcodec__videoencoder_8h.md)
- [native_avdemuxer.h](native__avdemuxer_8h.md)
- [native_averrors.h](native__averrors_8h.md)
- [native_avformat.h](native__avformat_8h.md)
- [native_avmemory.h](native__avmemory_8h.md)
- [native_avmuxer.h](native__avmuxer_8h.md)
- [native_avsource.h](native__avsource_8h.md)
- [native_audiocapturer.h](native__audiocapturer_8h.md)
- [native_audiorenderer.h](native__audiorenderer_8h.md)
- [native_audiostream_base.h](native__audiostream__base_8h.md)
- [native_audiostreambuilder.h](native__audiostreambuilder_8h.md)
- [native_huks_api.h](native__huks__api_8h.md)
- [native_huks_param.h](native__huks__param_8h.md)
- [native_huks_type.h](native__huks__type_8h.md)
......@@ -69,6 +89,7 @@
- [purgeable_memory.h](purgeable__memory_8h.md)
- Structs
- [OH_Drawing_BitmapFormat](_o_h___drawing___bitmap_format.md)
- [OH_NativeBuffer_Config](_o_h___native_buffer___config.md)
- [OH_NativeXComponent_Callback](_o_h___native_x_component___callback.md)
- [OH_NativeXComponent_MouseEvent](_o_h___native_x_component___mouse_event.md)
- [OH_NativeXComponent_MouseEvent_Callback](_o_h___native_x_component___mouse_event___callback.md)
......@@ -90,6 +111,9 @@
- [OH_NN_UInt32Array](_o_h___n_n___u_int32_array.md)
- [OH_AVCodecAsyncCallback](_o_h___a_v_codec_async_callback.md)
- [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md)
- [OH_AVRange](_o_h___a_v_range.md)
- [OH_AudioCapturer_Callbacks_Struct](_o_h___audio_capturer___callbacks___struct.md)
- [OH_AudioRenderer_Callbacks_Struct](_o_h___audio_renderer___callbacks___struct.md)
- [OH_Huks_Blob](_o_h___huks___blob.md)
- [OH_Huks_CertChain](_o_h___huks___cert_chain.md)
- [OH_Huks_KeyInfo](_o_h___huks___key_info.md)
......
# AVDemuxer
## Overview
The AVDemuxer module provides functions for audio and video decapsulation.
\@syscap SystemCapability.Multimedia.Media.Spliter
**Since**
10
## Summary
### File
| 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> |
### Functions
| Name| Description|
| -------- | -------- |
| \*[OH_AVDemuxer_CreateWithSource](#oh_avdemuxer_createwithsource) (OH_AVSource \*source) | Creates an **OH_AVDemuxer** instance based on an **OH_AVSource** instance.|
| [OH_AVDemuxer_Destroy](#oh_avdemuxer_destroy) (OH_AVDemuxer \*demuxer) | Destroys an **OH_AVDemuxer** instance and clears internal resources.|
| [OH_AVDemuxer_SelectTrackByID](#oh_avdemuxer_selecttrackbyid) (OH_AVDemuxer \*demuxer, uint32_t trackIndex) | Selects a track, from which the demuxer reads data.|
| [OH_AVDemuxer_UnselectTrackByID](#oh_avdemuxer_unselecttrackbyid) (OH_AVDemuxer \*demuxer, uint32_t trackIndex) | Deselects a track. The demuxer no longer reads data from a track after it is deselected.|
| [OH_AVDemuxer_ReadSample](#oh_avdemuxer_readsample) (OH_AVDemuxer \*demuxer, uint32_t trackIndex, OH_AVMemory \*sample, OH_AVCodecBufferAttr \*info) | Obtains the compressed frame and related information at the current position from the selected track.|
| [OH_AVDemuxer_SeekToTime](#oh_avdemuxer_seektotime) (OH_AVDemuxer \*demuxer, int64_t millisecond, OH_AVSeekMode mode) | Seeks to the specified time for all the selected tracks based on a seek mode.|
## Function Description
### OH_AVDemuxer_CreateWithSource()
```
OH_AVDemuxer* OH_AVDemuxer_CreateWithSource (OH_AVSource * source)
```
**Description**
Creates an **OH_AVDemuxer** instance based on an **OH_AVSource** instance. You can release the instance by calling **OH_AVDemuxer_Destroy**.
\@syscap SystemCapability.Multimedia.Media.Spliter
**Parameters**
| Name| Description|
| -------- | -------- |
| source | Pointer to an **OH_AVSource** instance.|
**Returns**
Returns the pointer to an **OH_AVDemuxer** instance.
**Since**
10
### OH_AVDemuxer_Destroy()
```
OH_AVErrCode OH_AVDemuxer_Destroy (OH_AVDemuxer * demuxer)
```
**Description**
Destroys an **OH_AVDemuxer** instance and clears internal resources. An instance can be destroyed only once.
The destroyed instance cannot be used until it is re-created. You are advised to set the pointer to **NULL** after the instance is destroyed.
\@syscap SystemCapability.Multimedia.Media.Spliter
**Parameters**
| Name| Description|
| -------- | -------- |
| demuxer | Pointer to an **OH_AVDemuxer** instance.|
**Returns**
Returns **AV_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode) otherwise.
**Since**
10
### OH_AVDemuxer_ReadSample()
```
OH_AVErrCode OH_AVDemuxer_ReadSample (OH_AVDemuxer * demuxer, uint32_t trackIndex, OH_AVMemory * sample, OH_AVCodecBufferAttr * info )
```
**Description**
Obtains the compressed frame and related information at the current position from the selected track.
You must select a track before reading data. After this API is called, the demuxer automatically proceeds to the next frame.
\@syscap SystemCapability.Multimedia.Media.Spliter
**Parameters**
| Name| Description|
| -------- | -------- |
| demuxer | Pointer to an **OH_AVDemuxer** instance.|
| trackIndex | Index of the track from which the compressed frame is to be read.|
| sample | Pointer to the **OH_AVMemory** instance for storing the compressed frame data.|
| info | Pointer to the **OH_AVCodecBufferAttr** instance for storing the compressed frame information.|
**Returns**
Returns **AV_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode) otherwise.
**Since**
10
### OH_AVDemuxer_SeekToTime()
```
OH_AVErrCode OH_AVDemuxer_SeekToTime (OH_AVDemuxer * demuxer, int64_t millisecond, OH_AVSeekMode mode )
```
**Description**
Seeks to the specified time for all the selected tracks based on a seek mode.
\@syscap SystemCapability.Multimedia.Media.Spliter
**Parameters**
| Name| Description|
| -------- | -------- |
| demuxer | Pointer to an **OH_AVDemuxer** instance.|
| millisecond | Time to seek to, in milliseconds. The timestamp is relative to the start position of the file.|
| mode | Seek mode. For details, see **OH_AVSeekMode**.|
**Returns**
Returns **AV_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode) otherwise.
**Since**
10
### OH_AVDemuxer_SelectTrackByID()
```
OH_AVErrCode OH_AVDemuxer_SelectTrackByID (OH_AVDemuxer * demuxer, uint32_t trackIndex )
```
**Description**
Selects a track, from which the demuxer reads data.
You can select multiple tracks by calling this API multiple times, with a different track index passed in each time.
When **OH_AVDemuxer_ReadSample** is called, only the data in the selected track is read. If the same track is selected multiple times, **AV_ERR_OK** is returned and the API call takes effect only once.
\@syscap SystemCapability.Multimedia.Media.Spliter
**Parameters**
| Name| Description|
| -------- | -------- |
| demuxer | Pointer to an **OH_AVDemuxer** instance.|
| trackIndex | Index of the track.|
**Returns**
Returns **AV_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode) otherwise.
**Since**
10
### OH_AVDemuxer_UnselectTrackByID()
```
OH_AVErrCode OH_AVDemuxer_UnselectTrackByID (OH_AVDemuxer * demuxer, uint32_t trackIndex )
```
**Description**
Deselects a track. The demuxer no longer reads data from a track after it is deselected.
You can deselect multiple tracks by calling this API multiple times, with a different track index passed in each time.
If the same track is deselected multiple times, **AV_ERR_OK** is returned and the API call takes effect only once.
\@syscap SystemCapability.Multimedia.Media.Spliter
**Parameters**
| Name| Description|
| -------- | -------- |
| demuxer | Pointer to an **OH_AVDemuxer** instance.|
| trackIndex | Index of the track.|
**Returns**
Returns **AV_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode) otherwise.
**Since**
10
# AVMuxer
## Overview
The **AVMuxer** module provides functions for audio and video encapsulation.
\@syscap SystemCapability.Multimedia.Media.Muxer
**Since**
10
## Summary
### Files
| Name| Description|
| -------- | -------- |
| [native_avmuxer.h](native__avmuxer_8h.md) | Declares native APIs used for audio and video encapsulation.<br>File to include: &lt;multimedia/native_avmuxer.h&gt;|
### Functions
| Name| Description|
| -------- | -------- |
| \*[OH_AVMuxer_Create](#oh_avmuxer_create) (int32_t fd, OH_AVOutputFormat format) | Creates an **OH_AVMuxer** instance by using the file descriptor and encapsulation format.|
| [OH_AVMuxer_SetRotation](#oh_avmuxer_setrotation) (OH_AVMuxer \*muxer, int32_t rotation) | Sets the rotation angle (clockwise) of an output video.|
| [OH_AVMuxer_AddTrack](#oh_avmuxer_addtrack) (OH_AVMuxer \*muxer, int32_t \*trackIndex, OH_AVFormat \*trackFormat) | Adds a media track to the muxer.|
| [OH_AVMuxer_Start](#oh_avmuxer_start) (OH_AVMuxer \*muxer) | Starts encapsulation.|
| [OH_AVMuxer_WriteSample](#oh_avmuxer_writesample) (OH_AVMuxer \*muxer, uint32_t trackIndex, OH_AVMemory \*sample, OH_AVCodecBufferAttr info) | Writes data to the muxer.|
| [OH_AVMuxer_Stop](#oh_avmuxer_stop) (OH_AVMuxer \*muxer) | Stops encapsulation.|
| [OH_AVMuxer_Destroy](#oh_avmuxer_destroy) (OH_AVMuxer \*muxer) | Clears internal resources and destroys an **OH_AVMuxer** instance.|
## Function Description
### OH_AVMuxer_AddTrack()
```
OH_AVErrCode OH_AVMuxer_AddTrack (OH_AVMuxer * muxer, int32_t * trackIndex, OH_AVFormat * trackFormat )
```
**Description**
Adds a media track to the muxer.
This function must be called before **OH_AVMuxer_Start**.
\@syscap SystemCapability.Multimedia.Media.Muxer
**Parameters**
| Name| Description|
| -------- | -------- |
| muxer | Pointer to an **OH_AVMuxer** instance.|
| trackIndex | Pointer to the index of the media track. The index will be used in the **OH_AVMuxer_WriteSample** function. If the media track is added, the index value is greater than or equal to 0; otherwise, the value is less than 0.|
| trackFormat | Pointer to an **OH_AVFormat** instance.|
**Returns**
Returns **AV_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode-1) otherwise.
**Since**
10
### OH_AVMuxer_Create()
```
OH_AVMuxer* OH_AVMuxer_Create (int32_t fd, OH_AVOutputFormat format )
```
**Description**
Creates an **OH_AVMuxer** instance by using the file descriptor and encapsulation format.
\@syscap SystemCapability.Multimedia.Media.Muxer
**Parameters**
| Name| Description|
| -------- | -------- |
| fd | File descriptor (FD). You must open the file in read/write mode (O_RDWR) and close the file after using it.|
| format | Format of the encapsulated output file. For details, see [OH_AVOutputFormat](_codec_base.md#oh_avoutputformat).|
**Returns**
Returns the pointer to the **OH_AVMuxer** instance created. You must call **OH_AVMuxer_Destroy** to destroy the instance when it is no longer needed.
**Since**
10
### OH_AVMuxer_Destroy()
```
OH_AVErrCode OH_AVMuxer_Destroy (OH_AVMuxer * muxer)
```
**Description**
Clears internal resources and destroys an **OH_AVMuxer** instance.
\@syscap SystemCapability.Multimedia.Media.Muxer
**Parameters**
| Name| Description|
| -------- | -------- |
| muxer | Pointer to an **OH_AVMuxer** instance.|
**Returns**
Returns **AV_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode-1) otherwise. You must set the muxer to null.
**Since**
10
### OH_AVMuxer_SetRotation()
```
OH_AVErrCode OH_AVMuxer_SetRotation (OH_AVMuxer * muxer, int32_t rotation )
```
**Description**
Sets the rotation angle (clockwise) of an output video.
This function must be called before **OH_AVMuxer_Start**.
\@syscap SystemCapability.Multimedia.Media.Muxer
**Parameters**
| Name| Description|
| -------- | -------- |
| muxer | Pointer to an **OH_AVMuxer** instance.|
| rotation | Angle to set. The value must be 0, 90, 180, or 270.|
**Returns**
Returns **AV_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode-1) otherwise.
**Since**
10
### OH_AVMuxer_Start()
```
OH_AVErrCode OH_AVMuxer_Start (OH_AVMuxer * muxer)
```
**Description**
Starts encapsulation.
This function must be called after **OH_AVMuxer_AddTrack** and before **OH_AVMuxer_WriteSample**.
\@syscap SystemCapability.Multimedia.Media.Muxer
**Parameters**
| Name| Description|
| -------- | -------- |
| muxer | Pointer to an **OH_AVMuxer** instance.|
**Returns**
Returns **AV_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode-1) otherwise.
**Since**
10
### OH_AVMuxer_Stop()
```
OH_AVErrCode OH_AVMuxer_Stop (OH_AVMuxer * muxer)
```
**Description**
Stops encapsulation.
Once encapsulation is stopped, it cannot be restarted.
\@syscap SystemCapability.Multimedia.Media.Muxer
**Parameters**
| Name| Description|
| -------- | -------- |
| muxer | Pointer to an **OH_AVMuxer** instance.|
**Returns**
Returns **AV_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode-1) otherwise.
**Since**
10
### OH_AVMuxer_WriteSample()
```
OH_AVErrCode OH_AVMuxer_WriteSample (OH_AVMuxer * muxer, uint32_t trackIndex, OH_AVMemory * sample, OH_AVCodecBufferAttr info )
```
**Description**
Writes data to the muxer.
This function must be called after **OH_AVMuxer_Start** and before **OH_AVMuxer_Stop**. You must ensure that the data is written to the correct media track in ascending order by time.
\@syscap SystemCapability.Multimedia.Media.Muxer
**Parameters**
| Name| Description|
| -------- | -------- |
| muxer | Pointer to an **OH_AVMuxer** instance.|
| trackIndex | Index of the media track corresponding to the data.|
| sample | Pointer to the buffer that stores the data written (data obtained after encoding or decapsulation).|
| info | Information about the data written. For details, see [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md).|
**Returns**
Returns **AV_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode-1) otherwise.
**Since**
10
# AVSource
## Overview
The AVSource module provides functions for constructing audio and video resource objects.
\@syscap SystemCapability.Multimedia.Media.Spliter
**Since**
10
## Summary
### File
| 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>|
### Functions
| Name| Description|
| -------- | -------- |
| \*[OH_AVSource_CreateWithURI](#oh_avsource_createwithuri) (char \*uri) | Creates an **OH_AVSource** instance based on a URI.|
| \*[OH_AVSource_CreateWithFD](#oh_avsource_createwithfd) (int32_t fd, int64_t offset, int64_t size) | Creates an **OH_AVSource** instance based on a file descriptor (FD).|
| [OH_AVSource_Destroy](#oh_avsource_destroy) (OH_AVSource \*source) | Destroys an **OH_AVSource** instance and clears internal resources. An instance can be destroyed only once.|
| \*[OH_AVSource_GetSourceFormat](#oh_avsource_getsourceformat) (OH_AVSource \*source) | Obtains the basic information about a media resource.|
| \*[OH_AVSource_GetTrackFormat](#oh_avsource_gettrackformat) (OH_AVSource \*source, uint32_t trackIndex) | Obtains the basic information about a track.|
## Function Description
### OH_AVSource_CreateWithFD()
```
OH_AVSource* OH_AVSource_CreateWithFD (int32_t fd, int64_t offset, int64_t size )
```
**Description**
Creates an **OH_AVSource** instance based on an FD.
You can release the instance by calling **OH_AVSource_Destroy**.
If **offset** is not the start position of the file or **size** is not the file size, undefined errors such as creation failure and decapsulation failure may occur due to incomplete data obtained.
\@syscap SystemCapability.Multimedia.Media.Spliter
**Parameters**
| Name| Description|
| -------- | -------- |
| fd | FD of a media resource file.|
| offset | Position from which data is to read.|
| size | File size, in bytes.|
**Returns**
Returns the pointer to an **OH_AVSource** instance.
**Since**
10
### OH_AVSource_CreateWithURI()
```
OH_AVSource* OH_AVSource_CreateWithURI (char * uri)
```
**Description**
Create an **OH_AVSource** instance object based on a URI. You can release the instance by calling **OH_AVSource_Destroy**.
\@syscap SystemCapability.Multimedia.Media.Spliter
**Parameters**
| Name| Description|
| -------- | -------- |
| uri | URI of the media resource.|
**Returns**
Returns the pointer to an **OH_AVSource** instance.
**Since**
10
### OH_AVSource_Destroy()
```
OH_AVErrCode OH_AVSource_Destroy (OH_AVSource * source)
```
**Description**
Destroys an **OH_AVSource** instance and clears internal resources.
An instance can be destroyed only once.
The destroyed instance cannot be used until it is re-created. You are advised to set the pointer to **NULL** after the instance is destroyed.
\@syscap SystemCapability.Multimedia.Media.Spliter
**Parameters**
| Name| Description|
| -------- | -------- |
| source | Pointer to an **OH_AVSource** instance.|
**Returns**
Returns **AV_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVErrCode](_core.md#oh_averrcode) otherwise.
**Since**
10
### OH_AVSource_GetSourceFormat()
```
OH_AVFormat* OH_AVSource_GetSourceFormat (OH_AVSource * source)
```
**Description**
Obtains the basic information about a media resource.
\@syscap SystemCapability.Multimedia.Media.Spliter
**Parameters**
| Name| Description|
| -------- | -------- |
| source | Pointer to an **OH_AVSource** instance.|
**Returns**
Returns the basic information obtained.
**Since**
10
### OH_AVSource_GetTrackFormat()
```
OH_AVFormat* OH_AVSource_GetTrackFormat (OH_AVSource * source, uint32_t trackIndex )
```
**Description**
Obtains the basic information about a track.
\@syscap SystemCapability.Multimedia.Media.Spliter
**Parameters**
| Name| Description|
| -------- | -------- |
| source | Pointer to an **OH_AVSource** instance.|
| trackIndex | Index of the track whose information is to be obtained.|
**Returns**
Returns the basic information obtained.
**Since**
10
# NativeVsync
## Overview
The **NativeVsync** module provides the capabilities of native virtual synchronization (VSync).
\@syscap SystemCapability.Graphic.Graphic2D.NativeVsync
**Since**
9
## Summary
### Files
| Name| Description|
| -------- | -------- |
| [native_vsync.h](native__vsync_8h.md) | Declares the functions for obtaining and using native VSync.<br>File to include: &lt;native_vsync/native_vsync.h&gt;|
### Types
| Name| Description|
| -------- | -------- |
| [OH_NativeVSync](#oh_nativevsync) | Provides the declaration of an **OH_NativeVSync** struct. |
| (\*[OH_NativeVSync_FrameCallback](#oh_nativevsync_framecallback)) (long long timestamp, void \*data) | Defines the pointer to a VSync callback function.|
### Functions
| Name| Description|
| -------- | -------- |
| [OH_NativeVSync_Create](#oh_nativevsync_create) (const char \*name, unsigned int length) | Creates an **OH_NativeVSync** instance. A new **OH_NativeVSync** instance is created each time this function is called.|
| [OH_NativeVSync_Destroy](#oh_nativevsync_destroy) ([OH_NativeVSync](#oh_nativevsync) \*nativeVsync) | Destroys an **OH_NativeVSync** instance.|
| [OH_NativeVSync_RequestFrame](#oh_nativevsync_requestframe) ([OH_NativeVSync](#oh_nativevsync) \*nativeVsync, [OH_NativeVSync_FrameCallback](#oh_nativevsync_framecallback) callback, void \*data) | Requests the next VSync signal. When the signal arrives, a callback function is invoked.|
## Type Description
### OH_NativeVSync
```
typedef struct OH_NativeVSync OH_NativeVSync
```
**Description**
Provides the declaration of a **OH_NativeVSync** struct.
### OH_NativeVSync_FrameCallback
```
typedef void(* OH_NativeVSync_FrameCallback) (long long timestamp, void *data)
```
**Description**
Defines the pointer to a VSync callback function.
\@syscap SystemCapability.Graphic.Graphic2D.NativeVsync
**Parameters**
| Name| Description|
| -------- | -------- |
| timestamp | VSync timestamp.|
| data | User-defined data.|
## Function Description
### OH_NativeVSync_Create()
```
OH_NativeVSync* OH_NativeVSync_Create (const char * name, unsigned int length )
```
**Description**
Creates an **OH_NativeVSync** instance. A new **OH_NativeVSync** instance is created each time this function is called.
\@syscap SystemCapability.Graphic.Graphic2D.NativeVsync
**Parameters**
| Name| Description|
| -------- | -------- |
| name | Pointer to the name that associates with an **OH_NativeVSync** instance.|
| length | Length of the name.|
**Returns**
Returns the pointer to an **OH_NativeVSync** instance.
### OH_NativeVSync_Destroy()
```
void OH_NativeVSync_Destroy (OH_NativeVSync * nativeVsync)
```
**Description**
Destroys an **OH_NativeVSync** instance.
\@syscap SystemCapability.Graphic.Graphic2D.NativeVsync
**Parameters**
| Name| Description|
| -------- | -------- |
| nativeVsync | Pointer to an **OH_NativeVSync** instance.|
### OH_NativeVSync_RequestFrame()
```
int OH_NativeVSync_RequestFrame (OH_NativeVSync * nativeVsync, OH_NativeVSync_FrameCallback callback, void * data )
```
**Description**
Requests the next VSync signal. When the signal arrives, a callback function is invoked.
\@syscap SystemCapability.Graphic.Graphic2D.NativeVsync
**Parameters**
| Name| Description|
| -------- | -------- |
| nativeVsync | Pointer to an **OH_NativeVSync** instance.|
| callback | Function pointer of the **OH_NativeVSync_FrameCallback** type. This function pointer will be called when the next VSync signal arrives.|
| data | Pointer to the user-defined data struct. The type is void\*.|
**Returns**
Returns **0** if the operation is successful.
......@@ -3,14 +3,15 @@
## Overview
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.
The **OH_AVCodecAsyncCallback** struct defines all the asynchronous callback function pointers of an **OH_AVCodec** instance. To ensure the normal running of **OH_AVCodec**, you must register the instance of this struct with the **OH_AVCodec** instance and process the information reported by the callback function.
\@syscap SystemCapability.Multimedia.Media.CodecBase
**Since:**
**Since**
9
**Related Modules:**
**Related Modules**
[CodecBase](_codec_base.md)
......@@ -20,9 +21,76 @@ Defines a collection of asynchronous callback functions for an **OH_AVCodec** in
### Member Variables
| Name | Description |
| Name| Description|
| -------- | -------- |
| **onError** | Indicates the callback used to report errors occurred during the running of the instance. For details, see [OH_AVCodecOnError](_codec_base.md#oh_avcodeconerror) |
| **onStreamChanged** | Indicates the callback used to report stream information. For details, see [OH_AVCodecOnStreamChanged](_codec_base.md#oh_avcodeconstreamchanged) |
| **onNeedInputData** | Indicates the callback used to report input data needed. For details, see [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata) |
| **onNeedOutputData** | Indicates the callback used to report output data needed. For details, see [OH_AVCodecOnNewOutputData](_codec_base.md#oh_avcodeconnewoutputdata) |
| [onError](#onerror) | Defines the callback used to report a codec operation error. For details, see [OH_AVCodecOnError](_codec_base.md#oh_avcodeconerror).|
| [onStreamChanged](#onstreamchanged) | Defines the callback used to report a codec stream change. For details, see [OH_AVCodecOnStreamChanged](_codec_base.md#oh_avcodeconstreamchanged).|
| [onNeedInputData](#onneedinputdata) | Defines the callback used to report input data required. For details, see [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata).|
| [onNeedOutputData](#onneedoutputdata) | Defines the callback used to report output data generated. For details, see [OH_AVCodecOnNewOutputData](_codec_base.md#oh_avcodeconnewoutputdata).|
## Member Variable Description
### onError
```
OH_AVCodecOnError onError
```
**Description**
Defines the callback used to report a codec operation error. For details, see [OH_AVCodecOnError](_codec_base.md#oh_avcodeconerror).
**Since**
9
### onNeedInputData
```
OH_AVCodecOnNeedInputData onNeedInputData
```
**Description**
Defines the callback used to report input data required. For details, see [OH_AVCodecOnNeedInputData](_codec_base.md#oh_avcodeconneedinputdata).
**Since**
9
### onNeedOutputData
```
OH_AVCodecOnNewOutputData onNeedOutputData
```
**Description**
Defines the callback used to report output data generated. For details, see [OH_AVCodecOnNewOutputData](_codec_base.md#oh_avcodeconnewoutputdata).
**Since**
9
### onStreamChanged
```
OH_AVCodecOnStreamChanged onStreamChanged
```
**Description**
Defines the callback used to report a codec stream change. For details, see [OH_AVCodecOnStreamChanged](_codec_base.md#oh_avcodeconstreamchanged).
**Since**
9
......@@ -3,14 +3,15 @@
## Overview
Defines the buffer attributes of an **OH_AVCodec** instance.
The **OH_AVCodecBufferAttr** struct defines the description information about the buffer of an **OH_AVCodec** instance.
\@syscap SystemCapability.Multimedia.Media.CodecBase
**Since:**
**Since**
9
**Related Modules:**
**Related Modules**
[CodecBase](_codec_base.md)
......@@ -20,9 +21,76 @@ Defines the buffer attributes of an **OH_AVCodec** instance.
### Member Variables
| Name | Description |
| Name| Description|
| -------- | -------- |
| [pts](_codec_base.md#pts) | Presentation timestamp of the buffer, in microseconds.|
| [size](_codec_base.md#size) | Size of the data contained in the buffer, in bytes. |
| [offset](_codec_base.md#offset) | Start offset of valid data in the buffer. |
| [flags](_codec_base.md#flags) | Buffer flag, which is a combination of multiple **OH_AVCodecBufferFlags**. |
| [pts](#pts) | Defines the display timestamp of the buffer, in microseconds.|
| [size](#size) | Defines the size of data contained in the buffer, in bytes.|
| [offset](#offset) | Defines the offset of valid data in the buffer.|
| [flags](#flags) | Defines the flags of the buffer. It is a combination of multiple [OH_AVCodecBufferFlags](_codec_base.md#oh_avcodecbufferflags).|
## Member Variable Description
### pts
```
int64_t pts
```
**Description**
Defines the display timestamp of the buffer, in microseconds.
**Since**
9
### size
```
int32_t size
```
**Description**
Defines the size of data contained in the buffer, in bytes.
**Since**
9
### offset
```
int32_t offset
```
**Description**
Defines the offset of valid data in the buffer.
**Since**
9
### flags
```
uint32_t flags
```
**Description**
Defines the flags of the buffer. It is a combination of multiple [OH_AVCodecBufferFlags](_codec_base.md#oh_avcodecbufferflags).
**Since**
9
# OH_AVRange
## Overview
The **OH_AVRange** struct defines the value range, which contains the minimum value and maximum value.
\@syscap SystemCapability.Multimedia.Media.CodecBase
**Since**
10
**Related Modules**
[AVCapability](_a_v_capability.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| [minVal](#minval) | Defines the minimum value.|
| [maxVal](#maxval) | Defines the maximum value.|
## Member Variable Description
### minVal
```
int32_t minVal
```
**Description**
Defines the minimum value.
**Since**
10
### maxVal
```
int32_t maxVal
```
**Description**
Defines the maximum value.
**Since**
10
# OH_AudioCapturer_Callbacks_Struct
## Overview
The **OH_AudioCapturer_Callbacks_Struct** struct defines a pointer to the callback functions related to an audio capturer.
\@syscap SystemCapability.Multimedia.Audio.Core
**Since**
10
**Related Modules**
[OHAudio](_o_h_audio.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| (\*[OH_AudioCapturer_OnReadData](_o_h_audio.md#oh_audiocapturer_onreaddata) )([OH_AudioCapturer](_o_h_audio.md#oh_audiocapturer) \*capturer, void \*userData, void \*buffer, int32_t lenth) | Defines a function pointer to the callback function used to read audio data.|
# OH_AudioRenderer_Callbacks_Struct
## Overview
The **OH_AudioRenderer_Callbacks_Struct** struct defines a pointer to the callback functions related to an audio renderer.
\@syscap SystemCapability.Multimedia.Audio.Core
**Since**
10
**Related Modules**
[OHAudio](_o_h_audio.md)
## Summary
### Member Variables
| Name| Description |
| -------- | -------- |
| (\*[OH_AudioRenderer_OnWriteData](_o_h_audio.md#oh_audiorenderer_onwritedata) )([OH_AudioRenderer](_o_h_audio.md#oh_audiorenderer) \*renderer, void \*userData, void \*buffer, int32_t lenth) | Defines a function pointer to the callback function used to write audio data.|
# OH_NativeBuffer_Config
## Overview
The **OH_NativeBuffer_Config** struct defines the **OH_NativeBuffer** attribute configuration, which is used when you apply for a new **OH_NativeBuffer** instance or query the attributes of an existing instance.
\@syscap SystemCapability.Graphic.Graphic2D.OH_NativeBuffer
**Since**
9
**Related Modules**
[OH_NativeBuffer](_o_h___native_buffer.md)
## Summary
### Member Variables
| Name| Description|
| -------- | -------- |
| width | Width, in pixels.|
| height | Height, in pixels.|
| format | Pixel map format.|
| usage | Description of the buffer usage.|
此差异已折叠。
# avcodec_audio_channel_layout.h
## Overview
The **avcodec_audio_channel_layout.h** file declares the enums used for audio codec.
**Since**
9
**Related Modules**
[AudioDecoder](_audio_decoder.md)
## Summary
### Enums
| Name| Description|
| -------- | -------- |
| [OHOS::Media::AudioChannelSet](_audio_decoder.md#audiochannelset) : uint64_t {<br>**FRONT_LEFT** = 1ULL &lt;&lt; 0U, **FRONT_RIGHT** = 1ULL &lt;&lt; 1U, **FRONT_CENTER** = 1ULL &lt;&lt; 2U, **LOW_FREQUENCY** = 1ULL &lt;&lt; 3U,<br>**BACK_LEFT** = 1ULL &lt;&lt; 4U, **BACK_RIGHT** = 1ULL &lt;&lt; 5U, **FRONT_LEFT_OF_CENTER** = 1ULL &lt;&lt; 6U, **FRONT_RIGHT_OF_CENTER** = 1ULL &lt;&lt; 7U,<br>**BACK_CENTER** = 1ULL &lt;&lt; 8U, **SIDE_LEFT** = 1ULL &lt;&lt; 9U, **SIDE_RIGHT** = 1ULL &lt;&lt; 10U, **TOP_CENTER** = 1ULL &lt;&lt; 11U,<br>**TOP_FRONT_LEFT** = 1ULL &lt;&lt; 12U, **TOP_FRONT_CENTER** = 1ULL &lt;&lt; 13U, **TOP_FRONT_RIGHT** = 1ULL &lt;&lt; 14U, **TOP_BACK_LEFT** = 1ULL &lt;&lt; 15U,<br>**TOP_BACK_CENTER** = 1ULL &lt;&lt; 16U, **TOP_BACK_RIGHT** = 1ULL &lt;&lt; 17U, **STEREO_LEFT** = 1ULL &lt;&lt; 29U, **STEREO_RIGHT** = 1ULL &lt;&lt; 30U,<br>**WIDE_LEFT** = 1ULL &lt;&lt; 31U, **WIDE_RIGHT** = 1ULL &lt;&lt; 32U, **SURROUND_DIRECT_LEFT** = 1ULL &lt;&lt; 33U, **SURROUND_DIRECT_RIGHT** = 1ULL &lt;&lt; 34U,<br>**LOW_FREQUENCY_2** = 1ULL &lt;&lt; 35U, **TOP_SIDE_LEFT** = 1ULL &lt;&lt; 36U, **TOP_SIDE_RIGHT** = 1ULL &lt;&lt; 37U, **BOTTOM_FRONT_CENTER** = 1ULL &lt;&lt; 38U,<br>**BOTTOM_FRONT_LEFT** = 1ULL &lt;&lt; 39U, **BOTTOM_FRONT_RIGHT** = 1ULL &lt;&lt; 40U, **AMBISONICS_ACN0** = 1ULL &lt;&lt; 41U, OHOS::Media::AMBISONICS_ACN1 = 1ULL &lt;&lt; 42U,<br>OHOS::Media::AMBISONICS_ACN2 = 1ULL &lt;&lt; 43U, OHOS::Media::AMBISONICS_ACN3 = 1ULL &lt;&lt; 44U, OHOS::Media::AMBISONICS_W = AMBISONICS_ACN0, OHOS::Media::AMBISONICS_Y = AMBISONICS_ACN1,<br>OHOS::Media::AMBISONICS_Z = AMBISONICS_ACN2, OHOS::Media::AMBISONICS_X = AMBISONICS_ACN3, OHOS::Media::AMBISONICS_ACN4 = 1ULL &lt;&lt; 45U, OHOS::Media::AMBISONICS_ACN5 = 1ULL &lt;&lt; 46U,<br>OHOS::Media::AMBISONICS_ACN6 = 1ULL &lt;&lt; 47U, OHOS::Media::AMBISONICS_ACN7 = 1ULL &lt;&lt; 48U, OHOS::Media::AMBISONICS_ACN8 = 1ULL &lt;&lt; 49U, OHOS::Media::AMBISONICS_ACN9 = 1ULL &lt;&lt; 50U,<br>OHOS::Media::AMBISONICS_ACN10 = 1ULL &lt;&lt; 51U, OHOS::Media::AMBISONICS_ACN11 = 1ULL &lt;&lt; 52U, OHOS::Media::AMBISONICS_ACN12 = 1ULL &lt;&lt; 53U, OHOS::Media::AMBISONICS_ACN13 = 1ULL &lt;&lt; 54U,<br>OHOS::Media::AMBISONICS_ACN14 = 1ULL &lt;&lt; 55U, OHOS::Media::AMBISONICS_ACN15 = 1ULL &lt;&lt; 56U<br>} | Enumerates the audio channel numbers. Each channel number is mapped to a variable of int64.|
| [OHOS::Media::AudioChannelLayout](_audio_decoder.md#audiochannellayout) : uint64_t {<br>**UNKNOWN_CHANNEL_LAYOUT** = 0, **MONO** = (AudioChannelSet::FRONT_CENTER), **STEREO** = (AudioChannelSet::FRONT_LEFT \| AudioChannelSet::FRONT_RIGHT), **CH_2POINT1** = (STEREO \| AudioChannelSet::LOW_FREQUENCY),<br>**CH_2_1** = (STEREO \| AudioChannelSet::BACK_CENTER), **SURROUND** = (STEREO \| AudioChannelSet::FRONT_CENTER), **CH_3POINT1** = (SURROUND \| AudioChannelSet::LOW_FREQUENCY), **CH_4POINT0** = (SURROUND \| AudioChannelSet::BACK_CENTER),<br>**CH_4POINT1** = (CH_4POINT0 \| AudioChannelSet::LOW_FREQUENCY), **CH_2_2** = (STEREO \| AudioChannelSet::SIDE_LEFT \| AudioChannelSet::SIDE_RIGHT), **QUAD** = (STEREO \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT), **CH_5POINT0** = (SURROUND \| AudioChannelSet::SIDE_LEFT \| AudioChannelSet::SIDE_RIGHT),<br>**CH_5POINT1** = (CH_5POINT0 \| AudioChannelSet::LOW_FREQUENCY), **CH_5POINT0_BACK** = (SURROUND \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT), **CH_5POINT1_BACK** = (CH_5POINT0_BACK \| AudioChannelSet::LOW_FREQUENCY), **CH_6POINT0** = (CH_5POINT0 \| AudioChannelSet::BACK_CENTER),<br>**CH_6POINT0_FRONT** = (CH_2_2 \| AudioChannelSet::FRONT_LEFT_OF_CENTER \| AudioChannelSet::FRONT_RIGHT_OF_CENTER), **HEXAGONAL** = (CH_5POINT0_BACK \| AudioChannelSet::BACK_CENTER), **CH_6POINT1** = (CH_5POINT1 \| AudioChannelSet::BACK_CENTER), **CH_6POINT1_BACK** = (CH_5POINT1_BACK \| AudioChannelSet::BACK_CENTER),<br>**CH_6POINT1_FRONT** = (CH_6POINT0_FRONT \| AudioChannelSet::LOW_FREQUENCY), **CH_7POINT0** = (CH_5POINT0 \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT), **CH_7POINT0_FRONT** = (CH_5POINT0 \| AudioChannelSet::FRONT_LEFT_OF_CENTER \| AudioChannelSet::FRONT_RIGHT_OF_CENTER), **CH_7POINT1** = (CH_5POINT1 \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_RIGHT),<br>**CH_7POINT1_WIDE** = (CH_5POINT1 \| AudioChannelSet::FRONT_LEFT_OF_CENTER \| AudioChannelSet::FRONT_RIGHT_OF_CENTER), **CH_7POINT1_WIDE_BACK**, **CH_3POINT1POINT2** = (CH_3POINT1 \| AudioChannelSet::TOP_FRONT_LEFT \| AudioChannelSet::TOP_FRONT_RIGHT), **CH_5POINT1POINT2** = (CH_5POINT1 \| AudioChannelSet::TOP_SIDE_LEFT \| AudioChannelSet::TOP_SIDE_RIGHT),<br>**CH_5POINT1POINT4**, **CH_7POINT1POINT2** = (CH_7POINT1 \| AudioChannelSet::TOP_SIDE_LEFT \| AudioChannelSet::TOP_SIDE_RIGHT), **CH_7POINT1POINT4**, **CH_9POINT1POINT4** = (CH_7POINT1POINT4 \| AudioChannelSet::WIDE_LEFT \| AudioChannelSet::WIDE_RIGHT),<br>**CH_9POINT1POINT6** = (CH_9POINT1POINT4 \| AudioChannelSet::TOP_SIDE_LEFT \| AudioChannelSet::TOP_SIDE_RIGHT), **CH_10POINT2**, **CH_22POINT2**, **OCTAGONAL** = (CH_5POINT0 \| AudioChannelSet::BACK_LEFT \| AudioChannelSet::BACK_CENTER \| AudioChannelSet::BACK_RIGHT),<br>**HEXADECAGONAL**, **STEREO_DOWNMIX** = (AudioChannelSet::STEREO_LEFT \| AudioChannelSet::STEREO_RIGHT), **HOA_FIRST**, **HOA_SECOND**,<br>**HOA_THIRD**<br>} | Enumerates the types of the audio channel numbers. The output format of the decoder is represented as the channel type of the codec.|
# native_audiocapturer.h
## Overview
The **native_audiocapturer.h** file declares the functions related to an audio capturer.
\@syscap SystemCapability.Multimedia.Audio.Core
**Since**
10
**Related Modules**
[OHAudio](_o_h_audio.md)
## Summary
### Functions
| Name| Description|
| -------- | -------- |
| [OH_AudioCapturer_Release](_o_h_audio.md#oh_audiocapturer_release) ([OH_AudioCapturer](_o_h_audio.md#oh_audiocapturer) \*capturer) | Releases an audio capturer.|
| [OH_AudioCapturer_Start](_o_h_audio.md#oh_audiocapturer_start) ([OH_AudioCapturer](_o_h_audio.md#oh_audiocapturer) \*capturer) | Starts an audio capturer.|
| [OH_AudioCapturer_Pause](_o_h_audio.md#oh_audiocapturer_pause) ([OH_AudioCapturer](_o_h_audio.md#oh_audiocapturer) \*capturer) | Pauses an audio capturer.|
| [OH_AudioCapturer_Stop](_o_h_audio.md#oh_audiocapturer_stop) ([OH_AudioCapturer](_o_h_audio.md#oh_audiocapturer) \*capturer) | Stops an audio capturer.|
| [OH_AudioCapturer_Flush](_o_h_audio.md#oh_audiocapturer_flush) ([OH_AudioCapturer](_o_h_audio.md#oh_audiocapturer) \*capturer) | Flushes obtained audio data.|
| [OH_AudioCapturer_GetCurrentState](_o_h_audio.md#oh_audiocapturer_getcurrentstate) ([OH_AudioCapturer](_o_h_audio.md#oh_audiocapturer) \*capturer, [OH_AudioStream_State](_o_h_audio.md#oh_audiostream_state) \*state) | Obtains the state of an audio stream.|
| [OH_AudioCapturer_GetLatencyMode](_o_h_audio.md#oh_audiocapturer_getlatencymode) ([OH_AudioCapturer](_o_h_audio.md#oh_audiocapturer) \*capturer, [OH_AudioStream_LatencyMode](_o_h_audio.md#oh_audiostream_latencymode) \*latencyMode) | Obtains the latency mode of an audio stream.|
| [OH_AudioCapturer_GetStreamId](_o_h_audio.md#oh_audiocapturer_getstreamid) ([OH_AudioCapturer](_o_h_audio.md#oh_audiocapturer) \*capturer, uint32_t \*streamId) | Obtains the stream ID of an audio stream.|
| [OH_AudioCapturer_GetSamplingRate](_o_h_audio.md#oh_audiocapturer_getsamplingrate) ([OH_AudioCapturer](_o_h_audio.md#oh_audiocapturer) \*capturer, int32_t \*rate) | Obtains the sampling rate of an audio stream.|
| [OH_AudioCapturer_GetChannelCount](_o_h_audio.md#oh_audiocapturer_getchannelcount) ([OH_AudioCapturer](_o_h_audio.md#oh_audiocapturer) \*capturer, int32_t \*channelCount) | Obtains the number of channels for an audio stream.|
| [OH_AudioCapturer_GetSampleFormat](_o_h_audio.md#oh_audiocapturer_getsampleformat) ([OH_AudioCapturer](_o_h_audio.md#oh_audiocapturer) \*capturer, [OH_AudioStream_SampleFormat](_o_h_audio.md#oh_audiostream_sampleformat) \*sampleFormat) | Obtains the sampling format of an audio stream.|
| [OH_AudioCapturer_GetEncodingType](_o_h_audio.md#oh_audiocapturer_getencodingtype) ([OH_AudioCapturer](_o_h_audio.md#oh_audiocapturer) \*capturer, [OH_AudioStream_EncodingType](_o_h_audio.md#oh_audiostream_encodingtype) \*encodingType) | Obtains the encoding type of an audio stream.|
| [OH_AudioCapturer_GetCapturerInfo](_o_h_audio.md#oh_audiocapturer_getcapturerinfo) ([OH_AudioCapturer](_o_h_audio.md#oh_audiocapturer) \*capturer, [OH_AudioStream_SourceType](_o_h_audio.md#oh_audiostream_sourcetype) \*sourceType) | Obtains the usage scenario of an audio capturer.|
# native_audiorenderer.h
## Overview
The **native_audiorenderer.h** file declares the functions related to an audio renderer.
\@syscap SystemCapability.Multimedia.Audio.Core
**Since**
10
**Related Modules**
[OHAudio](_o_h_audio.md)
## Summary
### Functions
| Name| Description|
| -------- | -------- |
| [OH_AudioRenderer_Release](_o_h_audio.md#oh_audiorenderer_release) ([OH_AudioRenderer](_o_h_audio.md#oh_audiorenderer) \*renderer) | Releases an audio renderer.|
| [OH_AudioRenderer_Start](_o_h_audio.md#oh_audiorenderer_start) ([OH_AudioRenderer](_o_h_audio.md#oh_audiorenderer) \*renderer) | Starts an audio renderer.|
| [OH_AudioRenderer_Pause](_o_h_audio.md#oh_audiorenderer_pause) ([OH_AudioRenderer](_o_h_audio.md#oh_audiorenderer) \*renderer) | Pauses an audio renderer.|
| [OH_AudioRenderer_Stop](_o_h_audio.md#oh_audiorenderer_stop) ([OH_AudioRenderer](_o_h_audio.md#oh_audiorenderer) \*renderer) | Stops an audio renderer.|
| [OH_AudioRenderer_Flush](_o_h_audio.md#oh_audiorenderer_flush) ([OH_AudioRenderer](_o_h_audio.md#oh_audiorenderer) \*renderer) | Flushes written audio data.|
| [OH_AudioRenderer_GetCurrentState](_o_h_audio.md#oh_audiorenderer_getcurrentstate) ([OH_AudioRenderer](_o_h_audio.md#oh_audiorenderer) \*renderer, [OH_AudioStream_State](_o_h_audio.md#oh_audiostream_state) \*state) | Obtains the state of an audio stream.|
| [OH_AudioRenderer_GetSamplingRate](_o_h_audio.md#oh_audiorenderer_getsamplingrate) ([OH_AudioRenderer](_o_h_audio.md#oh_audiorenderer) \*renderer, int32_t \*rate) | Obtains the sampling rate of an audio stream.|
| [OH_AudioRenderer_GetStreamId](_o_h_audio.md#oh_audiorenderer_getstreamid) ([OH_AudioRenderer](_o_h_audio.md#oh_audiorenderer) \*renderer, uint32_t \*streamId) | Obtains the stream ID of an audio stream.|
| [OH_AudioRenderer_GetChannelCount](_o_h_audio.md#oh_audiorenderer_getchannelcount) ([OH_AudioRenderer](_o_h_audio.md#oh_audiorenderer) \*renderer, int32_t \*channelCount) | Obtains the number of channels for an audio stream.|
| [OH_AudioRenderer_GetSampleFormat](_o_h_audio.md#oh_audiorenderer_getsampleformat) ([OH_AudioRenderer](_o_h_audio.md#oh_audiorenderer) \*renderer, [OH_AudioStream_SampleFormat](_o_h_audio.md#oh_audiostream_sampleformat) \*sampleFormat) | Obtains the sampling format of an audio stream.|
| [OH_AudioRenderer_GetLatencyMode](_o_h_audio.md#oh_audiorenderer_getlatencymode) ([OH_AudioRenderer](_o_h_audio.md#oh_audiorenderer) \*renderer, [OH_AudioStream_LatencyMode](_o_h_audio.md#oh_audiostream_latencymode) \*latencyMode) | Obtains the latency mode of an audio stream.|
| [OH_AudioRenderer_GetRendererInfo](_o_h_audio.md#oh_audiorenderer_getrendererinfo) ([OH_AudioRenderer](_o_h_audio.md#oh_audiorenderer) \*renderer, [OH_AudioStream_Usage](_o_h_audio.md#oh_audiostream_usage) \*usage) | Obtains the usage scenario of an audio renderer.|
| [OH_AudioRenderer_GetEncodingType](_o_h_audio.md#oh_audiorenderer_getencodingtype) ([OH_AudioRenderer](_o_h_audio.md#oh_audiorenderer) \*renderer, [OH_AudioStream_EncodingType](_o_h_audio.md#oh_audiostream_encodingtype) \*encodingType) | Obtains the encoding type of an audio stream.|
# native_audiostream_base.h
## Overview
The **native_audiostream_base.h** file declares the basic data structure of **OHAudio**.
\@syscap SystemCapability.Multimedia.Audio.Core
**Since**
10
**Related Modules**
[OHAudio](_o_h_audio.md)
## Summary
### Structs
| Name| Description|
| -------- | -------- |
| [OH_AudioRenderer_Callbacks_Struct](_o_h___audio_renderer___callbacks___struct.md) | Defines a pointer to the callback functions related to an audio renderer.|
| [OH_AudioCapturer_Callbacks_Struct](_o_h___audio_capturer___callbacks___struct.md) | Defines a pointer to the callback functions related to an audio capturer.|
### Types
| Name| Description|
| -------- | -------- |
| [OH_AudioStreamBuilder](_o_h_audio.md#oh_audiostreambuilder) | Defines an audio stream builder.|
| [OH_AudioRenderer](_o_h_audio.md#oh_audiorenderer) | Defines an audio renderer.|
| [OH_AudioCapturer](_o_h_audio.md#oh_audiocapturer) | Defines an audio capturer.|
| [OH_AudioRenderer_Callbacks](_o_h_audio.md#oh_audiorenderer_callbacks) | Defines a pointer to the callback functions related to an audio renderer.|
| [OH_AudioCapturer_Callbacks](_o_h_audio.md#oh_audiocapturer_callbacks) | Defines a pointer to the callback functions related to an audio capturer.|
### Enum
| Name| Description|
| -------- | -------- |
| [OH_AudioStream_Result](_o_h_audio.md#oh_audiostream_result) { [AUDIOSTREAM_SUCCESS](_o_h_audio.md), [AUDIOSTREAM_ERROR_INVALID_PARAM](_o_h_audio.md), [AUDIOSTREAM_ERROR_ILLEGAL_STATE](_o_h_audio.md), [AUDIOSTREAM_ERROR_SYSTEM](_o_h_audio.md) } | Enumerates the audio stream operation results.|
| [OH_AudioStream_Type](_o_h_audio.md#oh_audiostream_type) { [AUDIOSTREAM_TYPE_RENDERER](_o_h_audio.md) = 1, [AUDIOSTREAM_TYPE_CAPTURER](_o_h_audio.md) = 2 } | Enumerates the audio stream types.|
| [OH_AudioStream_SampleFormat](_o_h_audio.md#oh_audiostream_sampleformat) { [AUDIOSTREAM_SAMPLE_U8](_o_h_audio.md) = 0, [AUDIOSTREAM_SAMPLE_S16LE](_o_h_audio.md) = 1, [AUDIOSTREAM_SAMPLE_S24LE](_o_h_audio.md) = 2, [AUDIOSTREAM_SAMPLE_S32LE](_o_h_audio.md) = 3 } | Enumerates the sampling formats of audio streams.|
| [OH_AudioStream_EncodingType](_o_h_audio.md#oh_audiostream_encodingtype) { **AUDIOSTREAM_ENCODING_TYPE_RAW** = 0 } | Enumerates the encoding types of audio streams.|
| [OH_AudioStream_Usage](_o_h_audio.md#oh_audiostream_usage) { **AUDIOSTREAM_USAGE_UNKNOWN** = 0, **AUDIOSTREAM_USAGE_MUSIC** = 1, **AUDIOSTREAM_USAGE_COMMUNICATION** = 2, **AUDIOSTREAM_USAGE_GAME** = 11 } | Enumerates the usage scenarios of audio output streams.|
| [OH_AudioStream_LatencyMode](_o_h_audio.md#oh_audiostream_latencymode) { [AUDIOSTREAM_LATENCY_MODE_NORMAL](_o_h_audio.md) } | Enumerates the latency modes of audio streams.|
| [OH_AudioStream_State](_o_h_audio.md#oh_audiostream_state) {<br>[AUDIOSTREAM_STATE_INVALID](_o_h_audio.md) = -1, [AUDIOSTREAM_STATE_PREPARED](_o_h_audio.md) = 1, [AUDIOSTREAM_STATE_RUNNING](_o_h_audio.md) = 2, [AUDIOSTREAM_STATE_STOPPED](_o_h_audio.md) = 3,<br>[AUDIOSTREAM_STATE_RELEASED](_o_h_audio.md) = 4, [AUDIOSTREAM_STATE_PAUSED](_o_h_audio.md) = 5<br>} | Enumerates the audio stream states.|
| [OH_AudioStream_SourceType](_o_h_audio.md#oh_audiostream_sourcetype) { **AUDIOSTREAM_SOURCE_TYPE_INVALID** = -1, **AUDIOSTREAM_SOURCE_TYPE_MIC**, **AUDIOSTREAM_SOURCE_TYPE_VOICE_RECOGNITION** = 1, **AUDIOSTREAM_SOURCE_TYPE_VOICE_COMMUNICATION** = 7 } | Enumerates the usage scenarios of audio input streams.|
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册