1# native_avsource.h
2
3
4## Overview
5
6The **native_avsource.h** file declares the native APIs used for audio and video demuxing.
7
8**Library**: libnative_media_avsource.so
9
10**Since**: 10
11
12**Related module**: [AVSource](_a_v_source.md)
13
14
15## Summary
16
17
18### Types
19
20| Name| Description|
21| -------- | -------- |
22| typedef struct [OH_AVSource](_a_v_source.md#oh_avsource) [OH_AVSource](_a_v_source.md#oh_avsource) | Defines a struct that describes a native object for the media source interface. |
23
24
25### Functions
26
27| Name| Description|
28| -------- | -------- |
29| [OH_AVSource](_a_v_source.md#oh_avsource) \* [OH_AVSource_CreateWithDataSource](_a_v_source.md#oh_avsource_createwithdatasource) ([OH_AVDataSource](_o_h___a_v_data_source.md) \*dataSource) | Creates an **OH_AVSource** instance with a user-defined data source. You can release the instance by calling **OH_AVSource_Destroy**. |
30| [OH_AVSource](_a_v_source.md#oh_avsource) \* [OH_AVSource_CreateWithURI](_a_v_source.md#oh_avsource_createwithuri) (char \*uri) | Creates an **OH_AVSource** instance based on a URI.|
31| [OH_AVSource](_a_v_source.md#oh_avsource) \* [OH_AVSource_CreateWithFD](_a_v_source.md#oh_avsource_createwithfd) (int32_t fd, int64_t offset, int64_t size) | Creates an **OH_AVSource** instance based on a file descriptor (FD).|
32| [OH_AVErrCode](_core.md#oh_averrcode) [OH_AVSource_Destroy](_a_v_source.md#oh_avsource_destroy) ([OH_AVSource](_a_v_source.md#oh_avsource) \*source) | Destroys an **OH_AVSource** instance and clears internal resources.|
33| [OH_AVFormat](_core.md#oh_avformat) \* [OH_AVSource_GetSourceFormat](_a_v_source.md#oh_avsource_getsourceformat) ([OH_AVSource](_a_v_source.md#oh_avsource) \*source) | Obtains the basic information about a media resource.|
34| [OH_AVFormat](_core.md#oh_avformat) \* [OH_AVSource_GetTrackFormat](_a_v_source.md#oh_avsource_gettrackformat) ([OH_AVSource](_a_v_source.md#oh_avsource) \*source, uint32_t trackIndex) | Obtains the basic information about a track.|
35