1e41f4b71Sopenharmony_ci# Core 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci## Overview 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ciThe Core module provides the basic backbone capabilities for the media framework, including functions related to the memory, error code, and media struct. 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci**Since**: 9 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci 13e41f4b71Sopenharmony_ci## Summary 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ci### Files 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci| Name| Description| 19e41f4b71Sopenharmony_ci| -------- | -------- | 20e41f4b71Sopenharmony_ci| [native_audio_channel_layout.h](native__audio__channel__layout_8h.md) | Declares the functions related to the speaker layout during recording and playback.| 21e41f4b71Sopenharmony_ci| [native_avbuffer.h](native__avbuffer_8h.md) | Declares the functions of the media struct **AVBuffer**.| 22e41f4b71Sopenharmony_ci| [native_avbuffer_info.h](native__avbuffer__info_8h.md) | Declares the attribute definition of the media struct **AVBuffer**.| 23e41f4b71Sopenharmony_ci| [native_averrors.h](native__averrors_8h.md) | Declares the error codes used by the media framework.| 24e41f4b71Sopenharmony_ci| [native_avformat.h](native__avformat_8h.md) | Declares the functions and enums related to **OH_AVFormat**.| 25e41f4b71Sopenharmony_ci| [native_avmemory.h](native__avmemory_8h.md) | Declares the attribute definition of the media struct **AVMemory**.| 26e41f4b71Sopenharmony_ci 27e41f4b71Sopenharmony_ci 28e41f4b71Sopenharmony_ci### Structs 29e41f4b71Sopenharmony_ci 30e41f4b71Sopenharmony_ci| Name| Description| 31e41f4b71Sopenharmony_ci| -------- | -------- | 32e41f4b71Sopenharmony_ci| struct [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) | Describes the description information about the buffer of an **OH_AVCodec** instance. | 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci### Types 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci| Name| Description| 38e41f4b71Sopenharmony_ci| -------- | -------- | 39e41f4b71Sopenharmony_ci| typedef enum [OH_AudioChannelSet](#oh_audiochannelset-1) [OH_AudioChannelSet](#oh_audiochannelset) | Defines an enum for the audio channel sets.| 40e41f4b71Sopenharmony_ci| typedef enum [OH_AmbAttributeSet](#oh_ambattributeset-1) [OH_AmbAttributeSet](#oh_ambattributeset) | Defines an enum for the Hi-Fi stereo reverberation settings.| 41e41f4b71Sopenharmony_ci| typedef enum [OH_AudioChannelLayout](#oh_audiochannellayout-1) [OH_AudioChannelLayout](#oh_audiochannellayout) | Defines an enum for the audio channel layouts.| 42e41f4b71Sopenharmony_ci| typedef struct [OH_AVBuffer](#oh_avbuffer) [OH_AVBuffer](#oh_avbuffer) | Defines a struct that describes a native object for the media memory interface.| 43e41f4b71Sopenharmony_ci| typedef struct [OH_NativeBuffer](#oh_nativebuffer) [OH_NativeBuffer](#oh_nativebuffer) | Defines a struct that describes a native object for the graphics memory interface.| 44e41f4b71Sopenharmony_ci| typedef enum [OH_AVCodecBufferFlags](#oh_avcodecbufferflags-1) [OH_AVCodecBufferFlags](#oh_avcodecbufferflags) | Defines an enum for the flags for the buffer of an **OH_AVCodec** instance.| 45e41f4b71Sopenharmony_ci| typedef struct [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) [OH_AVCodecBufferAttr](#oh_avcodecbufferattr) | Defines the description information about the buffer of an **OH_AVCodec** instance.| 46e41f4b71Sopenharmony_ci| typedef enum [OH_AVErrCode](#oh_averrcode-1) [OH_AVErrCode](#oh_averrcode) | Defines an enum for the error codes used by the media framework.| 47e41f4b71Sopenharmony_ci| typedef struct [OH_AVFormat](#oh_avformat) [OH_AVFormat](#oh_avformat) | Defines a struct for a native object for the **OH_AVFormat** interface.| 48e41f4b71Sopenharmony_ci| typedef enum [OH_AVPixelFormat](#oh_avpixelformat-1) [OH_AVPixelFormat](#oh_avpixelformat) | Defines an enum for the video pixel formats.| 49e41f4b71Sopenharmony_ci| typedef struct [OH_AVMemory](#oh_avmemory) [OH_AVMemory](#oh_avmemory) | Defines a struct that describes a native object for the audio and video memory interface.| 50e41f4b71Sopenharmony_ci 51e41f4b71Sopenharmony_ci 52e41f4b71Sopenharmony_ci### Enums 53e41f4b71Sopenharmony_ci 54e41f4b71Sopenharmony_ci| Name| Description| 55e41f4b71Sopenharmony_ci| -------- | -------- | 56e41f4b71Sopenharmony_ci| [OH_AudioChannelSet](#oh_audiochannelset-1) {<br>CH_SET_FRONT_LEFT = 1ULL << 0U,<br>CH_SET_FRONT_RIGHT = 1ULL << 1U,<br>CH_SET_FRONT_CENTER = 1ULL << 2U,<br>CH_SET_LOW_FREQUENCY = 1ULL << 3U,<br>CH_SET_BACK_LEFT = 1ULL << 4U,<br>CH_SET_BACK_RIGHT = 1ULL << 5U,<br>CH_SET_FRONT_LEFT_OF_CENTER = 1ULL << 6U,<br>CH_SET_FRONT_RIGHT_OF_CENTER = 1ULL << 7U,<br>CH_SET_BACK_CENTER = 1ULL << 8U,<br>CH_SET_SIDE_LEFT = 1ULL << 9U,<br>CH_SET_SIDE_RIGHT = 1ULL << 10U,<br>CH_SET_TOP_CENTER = 1ULL << 11U,<br>CH_SET_TOP_FRONT_LEFT = 1ULL << 12U,<br>CH_SET_TOP_FRONT_CENTER = 1ULL << 13U,<br>CH_SET_TOP_FRONT_RIGHT = 1ULL << 14U,<br>CH_SET_TOP_BACK_LEFT = 1ULL << 15U,<br>CH_SET_TOP_BACK_CENTER = 1ULL << 16U,<br>CH_SET_TOP_BACK_RIGHT = 1ULL << 17U,<br>CH_SET_STEREO_LEFT = 1ULL << 29U,<br>CH_SET_STEREO_RIGHT = 1ULL << 30U,<br>CH_SET_WIDE_LEFT = 1ULL << 31U,<br>CH_SET_WIDE_RIGHT = 1ULL << 32U,<br>CH_SET_SURROUND_DIRECT_LEFT = 1ULL << 33U,<br>CH_SET_SURROUND_DIRECT_RIGHT = 1ULL << 34U,<br>CH_SET_LOW_FREQUENCY_2 = 1ULL << 35U,<br>CH_SET_TOP_SIDE_LEFT = 1ULL << 36U,<br>CH_SET_TOP_SIDE_RIGHT = 1ULL << 37U,<br>CH_SET_BOTTOM_FRONT_CENTER = 1ULL << 38U,<br>CH_SET_BOTTOM_FRONT_LEFT = 1ULL << 39U,<br>CH_SET_BOTTOM_FRONT_RIGHT = 1ULL << 40U<br>} | Enumerates the audio channel sets.| 57e41f4b71Sopenharmony_ci| [OH_AmbAttributeSet](#oh_ambattributeset-1) {<br>AMB_ORD_1 = 1ULL << 0U,<br>AMB_ORD_2 = 2ULL << 0U,<br>AMB_ORD_3 = 3ULL << 0U,<br>AMB_COM_ACN = 0ULL << 8U,<br>AMB_COM_FUMA = 1ULL << 8U,<br>AMB_NOR_N3D = 0ULL << 12U,<br>AMB_NOR_SN3D = 1ULL << 12U,<br>AMB_MODE = 1ULL << 44U<br>} | Enumerates the Hi-Fi stereo reverberation settings.| 58e41f4b71Sopenharmony_ci| [OH_AudioChannelLayout](#oh_audiochannellayout-1) {<br>CH_LAYOUT_UNKNOWN = 0ULL,<br>CH_LAYOUT_MONO = CH_SET_FRONT_CENTER,<br>CH_LAYOUT_STEREO = CH_SET_FRONT_LEFT \| CH_SET_FRONT_RIGHT,<br>CH_LAYOUT_STEREO_DOWNMIX = CH_SET_STEREO_LEFT \| CH_SET_STEREO_RIGHT,<br>CH_LAYOUT_2POINT1 = CH_LAYOUT_STEREO \| CH_SET_LOW_FREQUENCY,<br>CH_LAYOUT_3POINT0 = CH_LAYOUT_STEREO \| CH_SET_BACK_CENTER,<br>CH_LAYOUT_SURROUND = CH_LAYOUT_STEREO \| CH_SET_FRONT_CENTER,<br>CH_LAYOUT_3POINT1 = CH_LAYOUT_SURROUND \| CH_SET_LOW_FREQUENCY,<br>CH_LAYOUT_4POINT0 = CH_LAYOUT_SURROUND \| CH_SET_BACK_CENTER,<br>CH_LAYOUT_QUAD_SIDE = CH_LAYOUT_STEREO \| CH_SET_SIDE_LEFT \| CH_SET_SIDE_RIGHT,<br>CH_LAYOUT_QUAD = CH_LAYOUT_STEREO \| CH_SET_BACK_LEFT \| CH_SET_BACK_RIGHT,<br>CH_LAYOUT_2POINT0POINT2 = CH_LAYOUT_STEREO \| CH_SET_TOP_SIDE_LEFT \| CH_SET_TOP_SIDE_RIGHT,<br>CH_LAYOUT_AMB_ORDER1_ACN_N3D = AMB_MODE \| AMB_ORD_1 \| AMB_COM_ACN \| AMB_NOR_N3D, CH_LAYOUT_AMB_ORDER1_ACN_SN3D = AMB_MODE \| AMB_ORD_1 \| AMB_COM_ACN \| AMB_NOR_SN3D,<br>CH_LAYOUT_AMB_ORDER1_FUMA = AMB_MODE \| AMB_ORD_1 \| AMB_COM_FUMA,<br>CH_LAYOUT_4POINT1 = CH_LAYOUT_4POINT0 \| CH_SET_LOW_FREQUENCY,<br>CH_LAYOUT_5POINT0 = CH_LAYOUT_SURROUND \| CH_SET_SIDE_LEFT \| CH_SET_SIDE_RIGHT,<br>CH_LAYOUT_5POINT0_BACK = CH_LAYOUT_SURROUND \| CH_SET_BACK_LEFT \| CH_SET_BACK_RIGHT,<br>CH_LAYOUT_2POINT1POINT2 = CH_LAYOUT_2POINT0POINT2 \| CH_SET_LOW_FREQUENCY,<br>CH_LAYOUT_3POINT0POINT2 = CH_LAYOUT_2POINT0POINT2 \| CH_SET_FRONT_CENTER,<br>CH_LAYOUT_5POINT1 = CH_LAYOUT_5POINT0 \| CH_SET_LOW_FREQUENCY,<br>CH_LAYOUT_5POINT1_BACK = CH_LAYOUT_5POINT0_BACK \| CH_SET_LOW_FREQUENCY,<br>CH_LAYOUT_6POINT0 = CH_LAYOUT_5POINT0 \| CH_SET_BACK_CENTER,<br>CH_LAYOUT_3POINT1POINT2 = CH_LAYOUT_3POINT1 \| CH_SET_TOP_FRONT_LEFT \| CH_SET_TOP_FRONT_RIGHT,<br>CH_LAYOUT_6POINT0_FRONT = CH_LAYOUT_QUAD_SIDE \| CH_SET_FRONT_LEFT_OF_CENTER \| CH_SET_FRONT_RIGHT_OF_CENTER,<br>CH_LAYOUT_HEXAGONAL = CH_LAYOUT_5POINT0_BACK \| CH_SET_BACK_CENTER,<br>CH_LAYOUT_6POINT1 = CH_LAYOUT_5POINT1 \| CH_SET_BACK_CENTER,<br>CH_LAYOUT_6POINT1_BACK = CH_LAYOUT_5POINT1_BACK \| CH_SET_BACK_CENTER,<br>CH_LAYOUT_6POINT1_FRONT = CH_LAYOUT_6POINT0_FRONT \| CH_SET_LOW_FREQUENCY,<br>CH_LAYOUT_7POINT0 = CH_LAYOUT_5POINT0 \| CH_SET_BACK_LEFT \| CH_SET_BACK_RIGHT,<br>CH_LAYOUT_7POINT0_FRONT = CH_LAYOUT_5POINT0 \| CH_SET_FRONT_LEFT_OF_CENTER \| CH_SET_FRONT_RIGHT_OF_CENTER,<br>CH_LAYOUT_7POINT1 = CH_LAYOUT_5POINT1 \| CH_SET_BACK_LEFT \| CH_SET_BACK_RIGHT,<br>CH_LAYOUT_OCTAGONAL = CH_LAYOUT_5POINT0 \| CH_SET_BACK_LEFT \| CH_SET_BACK_CENTER \| CH_SET_BACK_RIGHT,<br>CH_LAYOUT_5POINT1POINT2 = CH_LAYOUT_5POINT1 \| CH_SET_TOP_SIDE_LEFT \| CH_SET_TOP_SIDE_RIGHT,<br>CH_LAYOUT_7POINT1_WIDE = CH_LAYOUT_5POINT1 \| CH_SET_FRONT_LEFT_OF_CENTER \| CH_SET_FRONT_RIGHT_OF_CENTER,<br>CH_LAYOUT_7POINT1_WIDE_BACK = CH_LAYOUT_5POINT1_BACK \| CH_SET_FRONT_LEFT_OF_CENTER \| CH_SET_FRONT_RIGHT_OF_CENTER,<br>CH_LAYOUT_AMB_ORDER2_ACN_N3D = AMB_MODE \| AMB_ORD_2 \| AMB_COM_ACN \| AMB_NOR_N3D,<br>CH_LAYOUT_AMB_ORDER2_ACN_SN3D = AMB_MODE \| AMB_ORD_2 \| AMB_COM_ACN \| AMB_NOR_SN3D,<br>CH_LAYOUT_AMB_ORDER2_FUMA = AMB_MODE \| AMB_ORD_2 \| AMB_COM_FUMA,<br>CH_LAYOUT_5POINT1POINT4,<br>CH_LAYOUT_7POINT1POINT2 = CH_LAYOUT_7POINT1 \| CH_SET_TOP_SIDE_LEFT \| CH_SET_TOP_SIDE_RIGHT,<br>CH_LAYOUT_7POINT1POINT4,<br>CH_LAYOUT_10POINT2,<br>CH_LAYOUT_9POINT1POINT4 = CH_LAYOUT_7POINT1POINT4 \| CH_SET_WIDE_LEFT \| CH_SET_WIDE_RIGHT,<br>CH_LAYOUT_9POINT1POINT6 = CH_LAYOUT_9POINT1POINT4 \| CH_SET_TOP_SIDE_LEFT \| CH_SET_TOP_SIDE_RIGHT,<br>CH_LAYOUT_HEXADECAGONAL,<br>CH_LAYOUT_AMB_ORDER3_ACN_N3D = AMB_MODE \| AMB_ORD_3 \| AMB_COM_ACN \| AMB_NOR_N3D,<br>CH_LAYOUT_AMB_ORDER3_ACN_SN3D = AMB_MODE \| AMB_ORD_3 \| AMB_COM_ACN \| AMB_NOR_SN3D,<br>CH_LAYOUT_AMB_ORDER3_FUMA = AMB_MODE \| AMB_ORD_3 \| AMB_COM_FUMA,<br>CH_LAYOUT_22POINT2<br>} | Enumerates the audio channel layouts.| 59e41f4b71Sopenharmony_ci| [OH_AVCodecBufferFlags](#oh_avcodecbufferflags-1) {<br>AVCODEC_BUFFER_FLAGS_NONE = 0,<br>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>AVCODEC_BUFFER_FLAGS_DISCARD = 1 << 4, <br>AVCODEC_BUFFER_FLAGS_DISPOSABLE = 1 << 5<br>} | Enumerates the flags for the buffer of an **OH_AVCodec** instance. | 60e41f4b71Sopenharmony_ci| [OH_AVErrCode](#oh_averrcode-1) {<br>AV_ERR_OK = 0,<br>AV_ERR_NO_MEMORY = 1,<br>AV_ERR_OPERATE_NOT_PERMIT = 2,<br>AV_ERR_INVALID_VAL = 3,<br>AV_ERR_IO = 4,<br>AV_ERR_TIMEOUT = 5,<br>AV_ERR_UNKNOWN = 6,<br>AV_ERR_SERVICE_DIED = 7,<br>AV_ERR_INVALID_STATE = 8,<br>AV_ERR_UNSUPPORT = 9,<br>AV_ERR_EXTEND_START = 100,<br>AV_ERR_DRM_BASE = 200,<br>AV_ERR_DRM_DECRYPT_FAILED = 201,<br>AV_ERR_VIDEO_BASE = 300,<br>AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION = 301<br>} | Enumerates the error codes used by the media framework. | 61e41f4b71Sopenharmony_ci| [OH_AVPixelFormat](#oh_avpixelformat-1) {<br>AV_PIXEL_FORMAT_YUVI420 = 1,<br>AV_PIXEL_FORMAT_NV12 = 2,<br>AV_PIXEL_FORMAT_NV21 = 3,<br>AV_PIXEL_FORMAT_SURFACE_FORMAT = 4,<br>AV_PIXEL_FORMAT_RGBA = 5<br>} | Enumerates the video pixel formats.| 62e41f4b71Sopenharmony_ci 63e41f4b71Sopenharmony_ci 64e41f4b71Sopenharmony_ci### Functions 65e41f4b71Sopenharmony_ci 66e41f4b71Sopenharmony_ci| Name| Description| 67e41f4b71Sopenharmony_ci| -------- | -------- | 68e41f4b71Sopenharmony_ci| [OH_AVBuffer](#oh_avbuffer) \* [OH_AVBuffer_Create](#oh_avbuffer_create) (int32_t capacity) | Creates an **OH_AVBuffer** instance. The caller must call [OH_AVBuffer_Destroy](#oh_avbuffer_destroy) to manually release the **OH_AVBuffer** instance returned.| 69e41f4b71Sopenharmony_ci| [OH_AVErrCode](#oh_averrcode) [OH_AVBuffer_Destroy](#oh_avbuffer_destroy) ([OH_AVBuffer](#oh_avbuffer) \*buffer) | Releases an **OH_AVBuffer** instance.| 70e41f4b71Sopenharmony_ci| [OH_AVErrCode](#oh_averrcode) [OH_AVBuffer_GetBufferAttr](#oh_avbuffer_getbufferattr) ([OH_AVBuffer](#oh_avbuffer) \*buffer, [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) \*attr) | Obtains the basic attributes, including **pts**, **size**, **offset**, and **flags**, of a buffer.| 71e41f4b71Sopenharmony_ci| [OH_AVErrCode](#oh_averrcode) [OH_AVBuffer_SetBufferAttr](#oh_avbuffer_setbufferattr) ([OH_AVBuffer](#oh_avbuffer) \*buffer, const [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) \*attr) | Sets the basic attributes, including **pts**, **size**, **offset**, and **flags**, of a buffer.| 72e41f4b71Sopenharmony_ci| [OH_AVFormat](#oh_avformat) \* [OH_AVBuffer_GetParameter](#oh_avbuffer_getparameter) ([OH_AVBuffer](#oh_avbuffer) \*buffer) | Obtains parameters except basic attributes of a buffer. The information is carried in an **OH_AVFormat** instance.| 73e41f4b71Sopenharmony_ci| [OH_AVErrCode](#oh_averrcode) [OH_AVBuffer_SetParameter](#oh_avbuffer_setparameter) ([OH_AVBuffer](#oh_avbuffer) \*buffer, const [OH_AVFormat](#oh_avformat) \*format) | Sets parameters except basic attributes of a buffer. The information is carried in an **OH_AVFormat** instance.| 74e41f4b71Sopenharmony_ci| uint8_t \* [OH_AVBuffer_GetAddr](#oh_avbuffer_getaddr) ([OH_AVBuffer](#oh_avbuffer) \*buffer) | Obtains the virtual address of a data buffer.| 75e41f4b71Sopenharmony_ci| int32_t [OH_AVBuffer_GetCapacity](#oh_avbuffer_getcapacity) ([OH_AVBuffer](#oh_avbuffer) \*buffer) | Obtains the capacity (in bytes) of a buffer.| 76e41f4b71Sopenharmony_ci| [OH_NativeBuffer](#oh_nativebuffer) \* [OH_AVBuffer_GetNativeBuffer](#oh_avbuffer_getnativebuffer) ([OH_AVBuffer](#oh_avbuffer) \*buffer) | Obtains the pointer to an **OH_NativeBuffer** instance.| 77e41f4b71Sopenharmony_ci| struct [OH_AVFormat](#oh_avformat) \* [OH_AVFormat_Create](#oh_avformat_create) (void) | Create an **OH_AVFormat** instance for reading and writing data.| 78e41f4b71Sopenharmony_ci| struct [OH_AVFormat](#oh_avformat) \* [OH_AVFormat_CreateAudioFormat](#oh_avformat_createaudioformat) (const char \*mimeType, int32_t sampleRate, int32_t channelCount) | Creates an audio **OH_AVFormat** instance with specified parameters for reading and writing data.| 79e41f4b71Sopenharmony_ci| struct [OH_AVFormat](#oh_avformat) \* [OH_AVFormat_CreateVideoFormat](#oh_avformat_createvideoformat) (const char \*mimeType, int32_t width, int32_t height) | Creates a video **OH_AVFormat** instance with specified parameters for reading and writing data.| 80e41f4b71Sopenharmony_ci| void [OH_AVFormat_Destroy](#oh_avformat_destroy) (struct [OH_AVFormat](#oh_avformat) \*format) | Destroys an **OH_AVFormat** instance.| 81e41f4b71Sopenharmony_ci| bool [OH_AVFormat_Copy](#oh_avformat_copy) (struct [OH_AVFormat](#oh_avformat) \*to, struct [OH_AVFormat](#oh_avformat) \*from) | Copies an **OH_AVFormat** instance.| 82e41f4b71Sopenharmony_ci| bool [OH_AVFormat_SetIntValue](#oh_avformat_setintvalue) (struct [OH_AVFormat](#oh_avformat) \*format, const char \*key, int32_t value) | Assigns a value of the int type to a key contained in an **OH_AVFormat**.| 83e41f4b71Sopenharmony_ci| bool [OH_AVFormat_SetLongValue](#oh_avformat_setlongvalue) (struct [OH_AVFormat](#oh_avformat) \*format, const char \*key, int64_t value) | Assigns a value of the long type to a key contained in an **OH_AVFormat**.| 84e41f4b71Sopenharmony_ci| bool [OH_AVFormat_SetFloatValue](#oh_avformat_setfloatvalue) (struct [OH_AVFormat](#oh_avformat) \*format, const char \*key, float value) | Assigns a value of the float type to a key contained in an **OH_AVFormat**.| 85e41f4b71Sopenharmony_ci| bool [OH_AVFormat_SetDoubleValue](#oh_avformat_setdoublevalue) (struct [OH_AVFormat](#oh_avformat) \*format, const char \*key, double value) | Assigns a value of the double type to a key contained in an **OH_AVFormat**.| 86e41f4b71Sopenharmony_ci| bool [OH_AVFormat_SetStringValue](#oh_avformat_setstringvalue) (struct [OH_AVFormat](#oh_avformat) \*format, const char \*key, const char \*value) | Assigns a value of the string type to a key contained in an **OH_AVFormat**.| 87e41f4b71Sopenharmony_ci| bool [OH_AVFormat_SetBuffer](#oh_avformat_setbuffer) (struct [OH_AVFormat](#oh_avformat) \*format, const char \*key, const uint8_t \*addr, size_t size) | Writes data blocks of a specified length to an **OH_AVFormat** instance.| 88e41f4b71Sopenharmony_ci| bool [OH_AVFormat_GetIntValue](#oh_avformat_getintvalue) (struct [OH_AVFormat](#oh_avformat) \*format, const char \*key, int32_t \*out) | Obtains the value of the int type of a key contained in an **OH_AVFormat**.| 89e41f4b71Sopenharmony_ci| bool [OH_AVFormat_GetLongValue](#oh_avformat_getlongvalue) (struct [OH_AVFormat](#oh_avformat) \*format, const char \*key, int64_t \*out) | Obtains the value of the long type of a key contained in an **OH_AVFormat**.| 90e41f4b71Sopenharmony_ci| bool [OH_AVFormat_GetFloatValue](#oh_avformat_getfloatvalue) (struct [OH_AVFormat](#oh_avformat) \*format, const char \*key, float \*out) | Obtains the value of the float type of a key contained in an **OH_AVFormat**.| 91e41f4b71Sopenharmony_ci| bool [OH_AVFormat_GetDoubleValue](#oh_avformat_getdoublevalue) (struct [OH_AVFormat](#oh_avformat) \*format, const char \*key, double \*out) | Obtains the value of the double type of a key contained in an **OH_AVFormat**.| 92e41f4b71Sopenharmony_ci| bool [OH_AVFormat_GetStringValue](#oh_avformat_getstringvalue) (struct [OH_AVFormat](#oh_avformat) \*format, const char \*key, const char \*\*out) | Obtains the value of the string type of a key contained in an **OH_AVFormat**.| 93e41f4b71Sopenharmony_ci| bool [OH_AVFormat_GetBuffer](#oh_avformat_getbuffer) (struct [OH_AVFormat](#oh_avformat) \*format, const char \*key, uint8_t \*\*addr, size_t \*size) | Reads data blocks of a specified length from an **OH_AVFormat** instance.| 94e41f4b71Sopenharmony_ci| const char \* [OH_AVFormat_DumpInfo](#oh_avformat_dumpinfo) (struct [OH_AVFormat](#oh_avformat) \*format) | Returns a string consisting of key-value pairs contained in an **OH_AVFormat**.| 95e41f4b71Sopenharmony_ci| [OH_AVMemory](#oh_avmemory) \* [OH_AVMemory_Create](#oh_avmemory_create) (int32_t size) | Creates an **OH_AVMemory** instance. (This function is deprecated in API version 11.)| 96e41f4b71Sopenharmony_ci| uint8_t \* [OH_AVMemory_GetAddr](#oh_avmemory_getaddr) (struct [OH_AVMemory](#oh_avmemory) \*mem) | Obtains the virtual memory address. (This function is deprecated in API version 11.)| 97e41f4b71Sopenharmony_ci| int32_t [OH_AVMemory_GetSize](#oh_avmemory_getsize) (struct [OH_AVMemory](#oh_avmemory) \*mem) | Obtains the memory length. (This function is deprecated in API version 11.)| 98e41f4b71Sopenharmony_ci| [OH_AVErrCode](#oh_averrcode) [OH_AVMemory_Destroy](#oh_avmemory_destroy) (struct [OH_AVMemory](#oh_avmemory) \*mem) | Releases an **OH_AVMemory** instance. (This function is deprecated in API version 11.)| 99e41f4b71Sopenharmony_ci 100e41f4b71Sopenharmony_ci 101e41f4b71Sopenharmony_ci## Type Description 102e41f4b71Sopenharmony_ci 103e41f4b71Sopenharmony_ci 104e41f4b71Sopenharmony_ci### OH_AmbAttributeSet 105e41f4b71Sopenharmony_ci 106e41f4b71Sopenharmony_ci``` 107e41f4b71Sopenharmony_citypedef enum OH_AmbAttributeSet OH_AmbAttributeSet 108e41f4b71Sopenharmony_ci``` 109e41f4b71Sopenharmony_ci 110e41f4b71Sopenharmony_ci**Description** 111e41f4b71Sopenharmony_ci 112e41f4b71Sopenharmony_ciDefines an enum for the Hi-Fi stereo reverberation settings. 113e41f4b71Sopenharmony_ci 114e41f4b71Sopenharmony_ciInt64 integers are used to indicate the Hi-Fi stereo reverberation attributes. 115e41f4b71Sopenharmony_ci 116e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 117e41f4b71Sopenharmony_ci 118e41f4b71Sopenharmony_ci**Since**: 11 119e41f4b71Sopenharmony_ci 120e41f4b71Sopenharmony_ci 121e41f4b71Sopenharmony_ci### OH_AudioChannelLayout 122e41f4b71Sopenharmony_ci 123e41f4b71Sopenharmony_ci``` 124e41f4b71Sopenharmony_citypedef enum OH_AudioChannelLayout OH_AudioChannelLayout 125e41f4b71Sopenharmony_ci``` 126e41f4b71Sopenharmony_ci 127e41f4b71Sopenharmony_ci**Description** 128e41f4b71Sopenharmony_ci 129e41f4b71Sopenharmony_ciDefines an enum for the audio channel layouts. 130e41f4b71Sopenharmony_ci 131e41f4b71Sopenharmony_ciInt64 integers are used to indicate the appearance and sequence of speakers during recording or playback. 132e41f4b71Sopenharmony_ci 133e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 134e41f4b71Sopenharmony_ci 135e41f4b71Sopenharmony_ci**Since**: 11 136e41f4b71Sopenharmony_ci 137e41f4b71Sopenharmony_ci 138e41f4b71Sopenharmony_ci### OH_AudioChannelSet 139e41f4b71Sopenharmony_ci 140e41f4b71Sopenharmony_ci``` 141e41f4b71Sopenharmony_citypedef enum OH_AudioChannelSet OH_AudioChannelSet 142e41f4b71Sopenharmony_ci``` 143e41f4b71Sopenharmony_ci 144e41f4b71Sopenharmony_ci**Description** 145e41f4b71Sopenharmony_ci 146e41f4b71Sopenharmony_ciDefines an enum for the audio channel sets. 147e41f4b71Sopenharmony_ci 148e41f4b71Sopenharmony_ciEach audio channel is mapped to an int64 variable. 149e41f4b71Sopenharmony_ci 150e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 151e41f4b71Sopenharmony_ci 152e41f4b71Sopenharmony_ci**Since**: 11 153e41f4b71Sopenharmony_ci 154e41f4b71Sopenharmony_ci 155e41f4b71Sopenharmony_ci### OH_AVBuffer 156e41f4b71Sopenharmony_ci 157e41f4b71Sopenharmony_ci``` 158e41f4b71Sopenharmony_citypedef struct OH_AVBuffer OH_AVBuffer 159e41f4b71Sopenharmony_ci``` 160e41f4b71Sopenharmony_ci**Description** 161e41f4b71Sopenharmony_ci 162e41f4b71Sopenharmony_ciDefines a struct that describes a native object for the media memory interface. 163e41f4b71Sopenharmony_ci 164e41f4b71Sopenharmony_ci**Since**: 11 165e41f4b71Sopenharmony_ci 166e41f4b71Sopenharmony_ci 167e41f4b71Sopenharmony_ci### OH_AVCodecBufferAttr 168e41f4b71Sopenharmony_ci 169e41f4b71Sopenharmony_ci``` 170e41f4b71Sopenharmony_citypedef struct OH_AVCodecBufferAttr OH_AVCodecBufferAttr 171e41f4b71Sopenharmony_ci``` 172e41f4b71Sopenharmony_ci 173e41f4b71Sopenharmony_ci**Description** 174e41f4b71Sopenharmony_ci 175e41f4b71Sopenharmony_ciDefines the description information about the buffer of an **OH_AVCodec** instance. 176e41f4b71Sopenharmony_ci 177e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 178e41f4b71Sopenharmony_ci 179e41f4b71Sopenharmony_ci**Since**: 9 180e41f4b71Sopenharmony_ci 181e41f4b71Sopenharmony_ci 182e41f4b71Sopenharmony_ci### OH_AVCodecBufferFlags 183e41f4b71Sopenharmony_ci 184e41f4b71Sopenharmony_ci``` 185e41f4b71Sopenharmony_citypedef enum OH_AVCodecBufferFlags OH_AVCodecBufferFlags 186e41f4b71Sopenharmony_ci``` 187e41f4b71Sopenharmony_ci 188e41f4b71Sopenharmony_ci**Description** 189e41f4b71Sopenharmony_ci 190e41f4b71Sopenharmony_ciDefines an enum for the flags for the buffer of an **OH_AVCodec** instance. 191e41f4b71Sopenharmony_ci 192e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 193e41f4b71Sopenharmony_ci 194e41f4b71Sopenharmony_ci**Since**: 9 195e41f4b71Sopenharmony_ci 196e41f4b71Sopenharmony_ci 197e41f4b71Sopenharmony_ci### OH_AVErrCode 198e41f4b71Sopenharmony_ci 199e41f4b71Sopenharmony_ci``` 200e41f4b71Sopenharmony_citypedef enum OH_AVErrCode OH_AVErrCode 201e41f4b71Sopenharmony_ci``` 202e41f4b71Sopenharmony_ci 203e41f4b71Sopenharmony_ci**Description** 204e41f4b71Sopenharmony_ci 205e41f4b71Sopenharmony_ciDefines an enum for the error codes used by the media framework. 206e41f4b71Sopenharmony_ci 207e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 208e41f4b71Sopenharmony_ci 209e41f4b71Sopenharmony_ci**Since**: 9 210e41f4b71Sopenharmony_ci 211e41f4b71Sopenharmony_ci 212e41f4b71Sopenharmony_ci### OH_AVFormat 213e41f4b71Sopenharmony_ci 214e41f4b71Sopenharmony_ci``` 215e41f4b71Sopenharmony_citypedef struct OH_AVFormat OH_AVFormat 216e41f4b71Sopenharmony_ci``` 217e41f4b71Sopenharmony_ci**Description** 218e41f4b71Sopenharmony_ci 219e41f4b71Sopenharmony_ciDefines a struct for a native object for the **OH_AVFormat** interface. 220e41f4b71Sopenharmony_ci 221e41f4b71Sopenharmony_ci**Since**: 9 222e41f4b71Sopenharmony_ci 223e41f4b71Sopenharmony_ci 224e41f4b71Sopenharmony_ci### OH_AVMemory 225e41f4b71Sopenharmony_ci 226e41f4b71Sopenharmony_ci``` 227e41f4b71Sopenharmony_citypedef struct OH_AVMemory OH_AVMemory 228e41f4b71Sopenharmony_ci``` 229e41f4b71Sopenharmony_ci**Description** 230e41f4b71Sopenharmony_ci 231e41f4b71Sopenharmony_ciDefines a struct that describes a native object for the audio and video memory interface. 232e41f4b71Sopenharmony_ci 233e41f4b71Sopenharmony_ci**Since**: 9 234e41f4b71Sopenharmony_ci 235e41f4b71Sopenharmony_ci 236e41f4b71Sopenharmony_ci### OH_AVPixelFormat 237e41f4b71Sopenharmony_ci 238e41f4b71Sopenharmony_ci``` 239e41f4b71Sopenharmony_citypedef enum OH_AVPixelFormat OH_AVPixelFormat 240e41f4b71Sopenharmony_ci``` 241e41f4b71Sopenharmony_ci 242e41f4b71Sopenharmony_ci**Description** 243e41f4b71Sopenharmony_ci 244e41f4b71Sopenharmony_ciDefines an enum for the video pixel formats. 245e41f4b71Sopenharmony_ci 246e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 247e41f4b71Sopenharmony_ci 248e41f4b71Sopenharmony_ci**Since**: 9 249e41f4b71Sopenharmony_ci 250e41f4b71Sopenharmony_ci 251e41f4b71Sopenharmony_ci### OH_NativeBuffer 252e41f4b71Sopenharmony_ci 253e41f4b71Sopenharmony_ci``` 254e41f4b71Sopenharmony_citypedef struct OH_NativeBuffer OH_NativeBuffer 255e41f4b71Sopenharmony_ci``` 256e41f4b71Sopenharmony_ci**Description** 257e41f4b71Sopenharmony_ci 258e41f4b71Sopenharmony_ciDefines a struct that describes a native object for the graphics memory interface. 259e41f4b71Sopenharmony_ci 260e41f4b71Sopenharmony_ci**Since**: 11 261e41f4b71Sopenharmony_ci 262e41f4b71Sopenharmony_ci 263e41f4b71Sopenharmony_ci## Enum Description 264e41f4b71Sopenharmony_ci 265e41f4b71Sopenharmony_ci 266e41f4b71Sopenharmony_ci### OH_AmbAttributeSet 267e41f4b71Sopenharmony_ci 268e41f4b71Sopenharmony_ci``` 269e41f4b71Sopenharmony_cienum OH_AmbAttributeSet 270e41f4b71Sopenharmony_ci``` 271e41f4b71Sopenharmony_ci 272e41f4b71Sopenharmony_ci**Description** 273e41f4b71Sopenharmony_ci 274e41f4b71Sopenharmony_ciEnumerates the Hi-Fi stereo reverberation settings. 275e41f4b71Sopenharmony_ci 276e41f4b71Sopenharmony_ciInt64 integers are used to indicate the Hi-Fi stereo reverberation attributes. 277e41f4b71Sopenharmony_ci 278e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 279e41f4b71Sopenharmony_ci 280e41f4b71Sopenharmony_ci**Since**: 11 281e41f4b71Sopenharmony_ci 282e41f4b71Sopenharmony_ci| Value| Description| 283e41f4b71Sopenharmony_ci| -------- | -------- | 284e41f4b71Sopenharmony_ci| AMB_ORD_1 | First-order Hi-Fi stereo reverberation.| 285e41f4b71Sopenharmony_ci| AMB_ORD_2 | Second-order Hi-Fi stereo reverberation.| 286e41f4b71Sopenharmony_ci| AMB_ORD_3 | Third-order Hi-Fi stereo reverberation.| 287e41f4b71Sopenharmony_ci| AMB_COM_ACN | Hi-Fi stereo reverberation with ACN channel sorting.| 288e41f4b71Sopenharmony_ci| AMB_COM_FUMA | Hi-Fi stereo reverberation with FUMA channel sorting.| 289e41f4b71Sopenharmony_ci| AMB_NOR_N3D | N3D normalized Hi-Fi stereo reverberation.| 290e41f4b71Sopenharmony_ci| AMB_NOR_SN3D | SN3D normalized Hi-Fi stereo reverberation.| 291e41f4b71Sopenharmony_ci| AMB_MODE | Audio channel layout for Hi-Fi stereo reverberation.| 292e41f4b71Sopenharmony_ci 293e41f4b71Sopenharmony_ci 294e41f4b71Sopenharmony_ci### OH_AudioChannelLayout 295e41f4b71Sopenharmony_ci 296e41f4b71Sopenharmony_ci``` 297e41f4b71Sopenharmony_cienum OH_AudioChannelLayout 298e41f4b71Sopenharmony_ci``` 299e41f4b71Sopenharmony_ci 300e41f4b71Sopenharmony_ci**Description** 301e41f4b71Sopenharmony_ci 302e41f4b71Sopenharmony_ciEnumerates the audio channel layouts. 303e41f4b71Sopenharmony_ci 304e41f4b71Sopenharmony_ciInt64 integers are used to indicate the appearance and sequence of speakers during recording or playback. 305e41f4b71Sopenharmony_ci 306e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 307e41f4b71Sopenharmony_ci 308e41f4b71Sopenharmony_ci**Since**: 11 309e41f4b71Sopenharmony_ci 310e41f4b71Sopenharmony_ci| Value| Description| 311e41f4b71Sopenharmony_ci| -------- | -------- | 312e41f4b71Sopenharmony_ci| CH_LAYOUT_UNKNOWN | Unknown.| 313e41f4b71Sopenharmony_ci| CH_LAYOUT_MONO | Mono layout; 1 audio channel in total.| 314e41f4b71Sopenharmony_ci| CH_LAYOUT_STEREO | Stereo layout; 2 audio channels in total.| 315e41f4b71Sopenharmony_ci| CH_LAYOUT_STEREO_DOWNMIX | Stereo downmix layout; 2 audio channels in total.| 316e41f4b71Sopenharmony_ci| CH_LAYOUT_2POINT1 | 2.1 layout; 3 audio channels in total.| 317e41f4b71Sopenharmony_ci| CH_LAYOUT_3POINT0 | 3.0 layout; 3 audio channels in total.| 318e41f4b71Sopenharmony_ci| CH_LAYOUT_SURROUND | Surround; 3 audio channels in total.| 319e41f4b71Sopenharmony_ci| CH_LAYOUT_3POINT1 | 3.1 layout; 4 audio channels in total.| 320e41f4b71Sopenharmony_ci| CH_LAYOUT_4POINT0 | 4.0 layout; 4 audio channels in total.| 321e41f4b71Sopenharmony_ci| CH_LAYOUT_QUAD_SIDE | Quad side layout; 4 audio channels in total.| 322e41f4b71Sopenharmony_ci| CH_LAYOUT_QUAD | Quad layout; 4 audio channels in total.| 323e41f4b71Sopenharmony_ci| CH_LAYOUT_2POINT0POINT2 | 2.0.2 layout; 4 audio channels in total.| 324e41f4b71Sopenharmony_ci| CH_LAYOUT_AMB_ORDER1_ACN_N3D | First-order FOA layout in ACN_N3D (ITU standards); 4 audio channels in total| 325e41f4b71Sopenharmony_ci| CH_LAYOUT_AMB_ORDER1_ACN_SN3D | First-order FOA layout in ACN_SN3D (ITU standards); 4 audio channels in total| 326e41f4b71Sopenharmony_ci| CH_LAYOUT_AMB_ORDER1_FUMA | First-order FOA layout in FUMA (ITU standards); 4 audio channels in total| 327e41f4b71Sopenharmony_ci| CH_LAYOUT_4POINT1 | 4.1 layout; 5 audio channels in total.| 328e41f4b71Sopenharmony_ci| CH_LAYOUT_5POINT0 | 5.0 layout; 5 audio channels in total.| 329e41f4b71Sopenharmony_ci| CH_LAYOUT_5POINT0_BACK | 5.0 rear layout; 5 audio channels in total.| 330e41f4b71Sopenharmony_ci| CH_LAYOUT_2POINT1POINT2 | 2.1.2 layout; 5 audio channels in total.| 331e41f4b71Sopenharmony_ci| CH_LAYOUT_3POINT0POINT2 | 3.0.2 layout; 5 audio channels in total.| 332e41f4b71Sopenharmony_ci| CH_LAYOUT_5POINT1 | 5.1 layout; 6 audio channels in total.| 333e41f4b71Sopenharmony_ci| CH_LAYOUT_5POINT1_BACK | 5.1 rear layout; 6 audio channels in total.| 334e41f4b71Sopenharmony_ci| CH_LAYOUT_6POINT0 | 6.0 layout; 6 audio channels in total.| 335e41f4b71Sopenharmony_ci| CH_LAYOUT_3POINT1POINT2 | 3.1.2 layout; 6 audio channels in total.| 336e41f4b71Sopenharmony_ci| CH_LAYOUT_6POINT0_FRONT | 6.0 front layout; 6 audio channels in total.| 337e41f4b71Sopenharmony_ci| CH_LAYOUT_HEXAGONAL | Hexagonal layout; 6 audio channels in total.| 338e41f4b71Sopenharmony_ci| CH_LAYOUT_6POINT1 | 6.1 layout; 7 audio channels in total.| 339e41f4b71Sopenharmony_ci| CH_LAYOUT_6POINT1_BACK | 6.1 rear layout; 7 audio channels in total.| 340e41f4b71Sopenharmony_ci| CH_LAYOUT_6POINT1_FRONT | 6.1 front layout; 7 audio channels in total.| 341e41f4b71Sopenharmony_ci| CH_LAYOUT_7POINT0 | 7.0 layout; 7 audio channels in total.| 342e41f4b71Sopenharmony_ci| CH_LAYOUT_7POINT0_FRONT | 7.0 front layout; 7 audio channels in total.| 343e41f4b71Sopenharmony_ci| CH_LAYOUT_7POINT1 | 7.1 layout; 8 audio channels in total.| 344e41f4b71Sopenharmony_ci| CH_LAYOUT_OCTAGONAL | Octagonal layout; 8 audio channels in total.| 345e41f4b71Sopenharmony_ci| CH_LAYOUT_5POINT1POINT2 | 5.1.2 layout; 8 audio channels in total.| 346e41f4b71Sopenharmony_ci| CH_LAYOUT_7POINT1_WIDE | 7.1 wide layout; 8 audio channels in total.| 347e41f4b71Sopenharmony_ci| CH_LAYOUT_7POINT1_WIDE_BACK | 7.1 rear wide layout; 8 audio channels in total.| 348e41f4b71Sopenharmony_ci| CH_LAYOUT_AMB_ORDER2_ACN_N3D | Second-order HOA layout in ACN_N3D (ITU standards); 9 audio channels in total| 349e41f4b71Sopenharmony_ci| CH_LAYOUT_AMB_ORDER2_ACN_SN3D | Second-order HOA layout in ACN_SN3D (ITU standards); 9 audio channels in total| 350e41f4b71Sopenharmony_ci| CH_LAYOUT_AMB_ORDER2_FUMA | Second-order HOA layout in FUMA (ITU standards); 9 audio channels in total| 351e41f4b71Sopenharmony_ci| CH_LAYOUT_5POINT1POINT4 | 5.1.4 layout; 10 audio channels in total.| 352e41f4b71Sopenharmony_ci| CH_LAYOUT_7POINT1POINT2 | 7.1.2 layout; 10 audio channels in total.| 353e41f4b71Sopenharmony_ci| CH_LAYOUT_7POINT1POINT4 | 7.1.4 layout; 12 audio channels in total.| 354e41f4b71Sopenharmony_ci| CH_LAYOUT_10POINT2 | 10.2 layout; 12 audio channels in total.| 355e41f4b71Sopenharmony_ci| CH_LAYOUT_9POINT1POINT4 | 9.1.4 layout; 14 audio channels in total.| 356e41f4b71Sopenharmony_ci| CH_LAYOUT_9POINT1POINT6 | 9.1.6 layout; 16 audio channels in total.| 357e41f4b71Sopenharmony_ci| CH_LAYOUT_HEXADECAGONAL | Hexadecagonal layout; 16 audio channels in total.| 358e41f4b71Sopenharmony_ci| CH_LAYOUT_AMB_ORDER3_ACN_N3D | Third-order HOA layout in ACN_N3D (ITU standards); 16 audio channels in total| 359e41f4b71Sopenharmony_ci| CH_LAYOUT_AMB_ORDER3_ACN_SN3D | Third-order HOA layout in ACN_SN3D (ITU standards); 16 audio channels in total| 360e41f4b71Sopenharmony_ci| CH_LAYOUT_AMB_ORDER3_FUMA | Third-order HOA layout in FUMA (ITU standards); 16 audio channels in total| 361e41f4b71Sopenharmony_ci| CH_LAYOUT_22POINT2 | 22.2 layout; 24 audio channels in total.| 362e41f4b71Sopenharmony_ci 363e41f4b71Sopenharmony_ci 364e41f4b71Sopenharmony_ci### OH_AudioChannelSet 365e41f4b71Sopenharmony_ci 366e41f4b71Sopenharmony_ci``` 367e41f4b71Sopenharmony_cienum OH_AudioChannelSet 368e41f4b71Sopenharmony_ci``` 369e41f4b71Sopenharmony_ci 370e41f4b71Sopenharmony_ci**Description** 371e41f4b71Sopenharmony_ci 372e41f4b71Sopenharmony_ciEnumerates the audio channel sets. 373e41f4b71Sopenharmony_ci 374e41f4b71Sopenharmony_ciEach audio channel is mapped to an int64 variable. 375e41f4b71Sopenharmony_ci 376e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 377e41f4b71Sopenharmony_ci 378e41f4b71Sopenharmony_ci**Since**: 11 379e41f4b71Sopenharmony_ci 380e41f4b71Sopenharmony_ci| Value| Description| 381e41f4b71Sopenharmony_ci| -------- | -------- | 382e41f4b71Sopenharmony_ci| CH_SET_FRONT_LEFT | Front left channel.| 383e41f4b71Sopenharmony_ci| CH_SET_FRONT_RIGHT | Front right channel| 384e41f4b71Sopenharmony_ci| CH_SET_FRONT_CENTER | Front center channel.| 385e41f4b71Sopenharmony_ci| CH_SET_LOW_FREQUENCY | Low-frequency channel.| 386e41f4b71Sopenharmony_ci| CH_SET_BACK_LEFT | Rear left channel.| 387e41f4b71Sopenharmony_ci| CH_SET_BACK_RIGHT | Rear right channel| 388e41f4b71Sopenharmony_ci| CH_SET_FRONT_LEFT_OF_CENTER | Front left center channel.| 389e41f4b71Sopenharmony_ci| CH_SET_FRONT_RIGHT_OF_CENTER | Front right center channel.| 390e41f4b71Sopenharmony_ci| CH_SET_BACK_CENTER | Rear center channel.| 391e41f4b71Sopenharmony_ci| CH_SET_SIDE_LEFT | Left channel.| 392e41f4b71Sopenharmony_ci| CH_SET_SIDE_RIGHT | Right channel.| 393e41f4b71Sopenharmony_ci| CH_SET_TOP_CENTER | Top center channel.| 394e41f4b71Sopenharmony_ci| CH_SET_TOP_FRONT_LEFT | Top left front channel.| 395e41f4b71Sopenharmony_ci| CH_SET_TOP_FRONT_CENTER | Top center front channel.| 396e41f4b71Sopenharmony_ci| CH_SET_TOP_FRONT_RIGHT | Top right front channel.| 397e41f4b71Sopenharmony_ci| CH_SET_TOP_BACK_LEFT | Top left rear channel.| 398e41f4b71Sopenharmony_ci| CH_SET_TOP_BACK_CENTER | Top center rear channel.| 399e41f4b71Sopenharmony_ci| CH_SET_TOP_BACK_RIGHT | Top right rear channel.| 400e41f4b71Sopenharmony_ci| CH_SET_STEREO_LEFT | Stereo left channel.| 401e41f4b71Sopenharmony_ci| CH_SET_STEREO_RIGHT | Stereo right channel.| 402e41f4b71Sopenharmony_ci| CH_SET_WIDE_LEFT | Wide left channel.| 403e41f4b71Sopenharmony_ci| CH_SET_WIDE_RIGHT | Wide right channel.| 404e41f4b71Sopenharmony_ci| CH_SET_SURROUND_DIRECT_LEFT | Left surround channel.| 405e41f4b71Sopenharmony_ci| CH_SET_SURROUND_DIRECT_RIGHT | Right surround channel.| 406e41f4b71Sopenharmony_ci| CH_SET_LOW_FREQUENCY_2 | Low-frequency channel 2.| 407e41f4b71Sopenharmony_ci| CH_SET_TOP_SIDE_LEFT | Top left channel.| 408e41f4b71Sopenharmony_ci| CH_SET_TOP_SIDE_RIGHT | Top right channel.| 409e41f4b71Sopenharmony_ci| CH_SET_BOTTOM_FRONT_CENTER | Bottom center front channel.| 410e41f4b71Sopenharmony_ci| CH_SET_BOTTOM_FRONT_LEFT | Bottom left front channel.| 411e41f4b71Sopenharmony_ci| CH_SET_BOTTOM_FRONT_RIGHT | Bottom right front channel.| 412e41f4b71Sopenharmony_ci 413e41f4b71Sopenharmony_ci 414e41f4b71Sopenharmony_ci### OH_AVCodecBufferFlags 415e41f4b71Sopenharmony_ci 416e41f4b71Sopenharmony_ci``` 417e41f4b71Sopenharmony_cienum OH_AVCodecBufferFlags 418e41f4b71Sopenharmony_ci``` 419e41f4b71Sopenharmony_ci 420e41f4b71Sopenharmony_ci**Description** 421e41f4b71Sopenharmony_ci 422e41f4b71Sopenharmony_ciEnumerates the flags for the buffer of an **OH_AVCodec** instance. 423e41f4b71Sopenharmony_ci 424e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 425e41f4b71Sopenharmony_ci 426e41f4b71Sopenharmony_ci**Since**: 9 427e41f4b71Sopenharmony_ci 428e41f4b71Sopenharmony_ci| Value| Description| 429e41f4b71Sopenharmony_ci| -------- | -------- | 430e41f4b71Sopenharmony_ci| AVCODEC_BUFFER_FLAGS_NONE | Common frame.| 431e41f4b71Sopenharmony_ci| AVCODEC_BUFFER_FLAGS_EOS | The buffer is an end-of-stream frame.| 432e41f4b71Sopenharmony_ci| AVCODEC_BUFFER_FLAGS_SYNC_FRAME | The buffer contains key frames.| 433e41f4b71Sopenharmony_ci| AVCODEC_BUFFER_FLAGS_INCOMPLETE_FRAME | The data in the buffer is only part of the frame.| 434e41f4b71Sopenharmony_ci| AVCODEC_BUFFER_FLAGS_CODEC_DATA | The buffer contains codec-specific data.| 435e41f4b71Sopenharmony_ci| AVCODEC_BUFFER_FLAGS_DISCARD | The decoding process depends on the buffer, and the decoded data can be discarded.<br>**Since**: 12| 436e41f4b71Sopenharmony_ci| AVCODEC_BUFFER_FLAGS_DISPOSABLE | The buffer can be disposed directly.<br>**Since**: 12| 437e41f4b71Sopenharmony_ci 438e41f4b71Sopenharmony_ci 439e41f4b71Sopenharmony_ci### OH_AVErrCode 440e41f4b71Sopenharmony_ci 441e41f4b71Sopenharmony_ci``` 442e41f4b71Sopenharmony_cienum OH_AVErrCode 443e41f4b71Sopenharmony_ci``` 444e41f4b71Sopenharmony_ci 445e41f4b71Sopenharmony_ci**Description** 446e41f4b71Sopenharmony_ci 447e41f4b71Sopenharmony_ciEnumerates the error codes used by the media framework. 448e41f4b71Sopenharmony_ci 449e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 450e41f4b71Sopenharmony_ci 451e41f4b71Sopenharmony_ci**Since**: 9 452e41f4b71Sopenharmony_ci 453e41f4b71Sopenharmony_ci| Value| Description| 454e41f4b71Sopenharmony_ci| -------- | -------- | 455e41f4b71Sopenharmony_ci| AV_ERR_OK | Operation successful. | 456e41f4b71Sopenharmony_ci| AV_ERR_NO_MEMORY | No memory. | 457e41f4b71Sopenharmony_ci| AV_ERR_OPERATE_NOT_PERMIT | Operation not allowed. | 458e41f4b71Sopenharmony_ci| AV_ERR_INVALID_VAL | Invalid value. | 459e41f4b71Sopenharmony_ci| AV_ERR_IO | I/O error. | 460e41f4b71Sopenharmony_ci| AV_ERR_TIMEOUT | Timeout. | 461e41f4b71Sopenharmony_ci| AV_ERR_UNKNOWN | Unknown error. | 462e41f4b71Sopenharmony_ci| AV_ERR_SERVICE_DIED | Unavailable service. | 463e41f4b71Sopenharmony_ci| AV_ERR_INVALID_STATE | Unsupported operation in this state. | 464e41f4b71Sopenharmony_ci| AV_ERR_UNSUPPORT | Unsupported feature. | 465e41f4b71Sopenharmony_ci| AV_ERR_EXTEND_START | Initial value for extended error codes. | 466e41f4b71Sopenharmony_ci| AV_ERR_DRM_BASE | DRM start error code.<br>**Since**: 12| 467e41f4b71Sopenharmony_ci| AV_ERR_DRM_DECRYPT_FAILED | DRM decryption failed.<br>**Since**: 12| 468e41f4b71Sopenharmony_ci| AV_ERR_VIDEO_BASE | Video start error code.<br>**Since**: 12| 469e41f4b71Sopenharmony_ci| AV_ERR_VIDEO_UNSUPPORTED_COLOR_SPACE_CONVERSION | Color Space Conversion (CSC) is not supported.<br>**Since**: 12| 470e41f4b71Sopenharmony_ci 471e41f4b71Sopenharmony_ci### OH_AVPixelFormat 472e41f4b71Sopenharmony_ci 473e41f4b71Sopenharmony_ci``` 474e41f4b71Sopenharmony_cienum OH_AVPixelFormat 475e41f4b71Sopenharmony_ci``` 476e41f4b71Sopenharmony_ci 477e41f4b71Sopenharmony_ci**Description** 478e41f4b71Sopenharmony_ci 479e41f4b71Sopenharmony_ciEnumerates the video pixel formats. 480e41f4b71Sopenharmony_ci 481e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 482e41f4b71Sopenharmony_ci 483e41f4b71Sopenharmony_ci**Since**: 9 484e41f4b71Sopenharmony_ci 485e41f4b71Sopenharmony_ci| Value| Description| 486e41f4b71Sopenharmony_ci| -------- | -------- | 487e41f4b71Sopenharmony_ci| AV_PIXEL_FORMAT_YUVI420 | YUV 420 Planar.| 488e41f4b71Sopenharmony_ci| AV_PIXEL_FORMAT_NV12 | NV12. YUV 420 semi-planar.| 489e41f4b71Sopenharmony_ci| AV_PIXEL_FORMAT_NV21 | NV21. YUV 420 semi-planar.| 490e41f4b71Sopenharmony_ci| AV_PIXEL_FORMAT_SURFACE_FORMAT | Pixel format obtained from the surface.| 491e41f4b71Sopenharmony_ci| AV_PIXEL_FORMAT_RGBA | RGBA8888.| 492e41f4b71Sopenharmony_ci 493e41f4b71Sopenharmony_ci 494e41f4b71Sopenharmony_ci## Function Description 495e41f4b71Sopenharmony_ci 496e41f4b71Sopenharmony_ci 497e41f4b71Sopenharmony_ci### OH_AVBuffer_Create() 498e41f4b71Sopenharmony_ci 499e41f4b71Sopenharmony_ci``` 500e41f4b71Sopenharmony_ciOH_AVBuffer* OH_AVBuffer_Create (int32_t capacity) 501e41f4b71Sopenharmony_ci``` 502e41f4b71Sopenharmony_ci 503e41f4b71Sopenharmony_ci**Description** 504e41f4b71Sopenharmony_ci 505e41f4b71Sopenharmony_ciCreates an **OH_AVBuffer** instance. The caller must call [OH_AVBuffer_Destroy](#oh_avbuffer_destroy) to manually release the **OH_AVBuffer** instance returned. 506e41f4b71Sopenharmony_ci 507e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 508e41f4b71Sopenharmony_ci 509e41f4b71Sopenharmony_ci**Since**: 11 510e41f4b71Sopenharmony_ci 511e41f4b71Sopenharmony_ci**Parameters** 512e41f4b71Sopenharmony_ci 513e41f4b71Sopenharmony_ci| Name| Description| 514e41f4b71Sopenharmony_ci| -------- | -------- | 515e41f4b71Sopenharmony_ci| capacity | Size of the created memory, in bytes.| 516e41f4b71Sopenharmony_ci 517e41f4b71Sopenharmony_ci**Returns** 518e41f4b71Sopenharmony_ci 519e41f4b71Sopenharmony_ciReturns the pointer to the **OH_AVBuffer** instance created if the operation is successful; returns NULL otherwise. 520e41f4b71Sopenharmony_ci 521e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 522e41f4b71Sopenharmony_ci 523e41f4b71Sopenharmony_ci1. The value of **capacity** is less than or equal to 0. 524e41f4b71Sopenharmony_ci2. An internal error occurs, or the system does not have resources. 525e41f4b71Sopenharmony_ci 526e41f4b71Sopenharmony_ci 527e41f4b71Sopenharmony_ci### OH_AVBuffer_Destroy() 528e41f4b71Sopenharmony_ci 529e41f4b71Sopenharmony_ci``` 530e41f4b71Sopenharmony_ciOH_AVErrCode OH_AVBuffer_Destroy (OH_AVBuffer *buffer) 531e41f4b71Sopenharmony_ci``` 532e41f4b71Sopenharmony_ci 533e41f4b71Sopenharmony_ci**Description** 534e41f4b71Sopenharmony_ci 535e41f4b71Sopenharmony_ciReleases an **OH_AVBuffer** instance. A buffer cannot be destroyed repeatedly. 536e41f4b71Sopenharmony_ci 537e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 538e41f4b71Sopenharmony_ci 539e41f4b71Sopenharmony_ci**Since**: 11 540e41f4b71Sopenharmony_ci 541e41f4b71Sopenharmony_ci**Parameters** 542e41f4b71Sopenharmony_ci 543e41f4b71Sopenharmony_ci| Name| Description| 544e41f4b71Sopenharmony_ci| -------- | -------- | 545e41f4b71Sopenharmony_ci| buffer | Pointer to an **OH_AVBuffer** instance.| 546e41f4b71Sopenharmony_ci 547e41f4b71Sopenharmony_ci**Returns** 548e41f4b71Sopenharmony_ci 549e41f4b71Sopenharmony_ciReturns any of the following result code: 550e41f4b71Sopenharmony_ci 551e41f4b71Sopenharmony_ci**AV_ERR_OK**: The operation is successful. 552e41f4b71Sopenharmony_ci 553e41f4b71Sopenharmony_ci**AV_ERR_INVALID_VAL**: The passed-in value of **buffer** is a null pointer or fails parameter structure verification. 554e41f4b71Sopenharmony_ci 555e41f4b71Sopenharmony_ci**AV_ERR_OPERATE_NOT_PERMIT**: The input buffer is not created by the user. 556e41f4b71Sopenharmony_ci 557e41f4b71Sopenharmony_ci 558e41f4b71Sopenharmony_ci### OH_AVBuffer_GetAddr() 559e41f4b71Sopenharmony_ci 560e41f4b71Sopenharmony_ci``` 561e41f4b71Sopenharmony_ciuint8_t* OH_AVBuffer_GetAddr (OH_AVBuffer *buffer) 562e41f4b71Sopenharmony_ci``` 563e41f4b71Sopenharmony_ci 564e41f4b71Sopenharmony_ci**Description** 565e41f4b71Sopenharmony_ci 566e41f4b71Sopenharmony_ciObtains the virtual address of a data buffer. 567e41f4b71Sopenharmony_ci 568e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 569e41f4b71Sopenharmony_ci 570e41f4b71Sopenharmony_ci**Since**: 11 571e41f4b71Sopenharmony_ci 572e41f4b71Sopenharmony_ci**Parameters** 573e41f4b71Sopenharmony_ci 574e41f4b71Sopenharmony_ci| Name| Description| 575e41f4b71Sopenharmony_ci| -------- | -------- | 576e41f4b71Sopenharmony_ci| buffer | Pointer to an **OH_AVBuffer** instance.| 577e41f4b71Sopenharmony_ci 578e41f4b71Sopenharmony_ci**Returns** 579e41f4b71Sopenharmony_ci 580e41f4b71Sopenharmony_ciReturns the virtual address if the operation is successful; returns NULL otherwise. 581e41f4b71Sopenharmony_ci 582e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 583e41f4b71Sopenharmony_ci 584e41f4b71Sopenharmony_ci1. The passed-in value of **buffer** is a null pointer. 585e41f4b71Sopenharmony_ci2. The passed-in value of **OH_AVBuffer** fails parameter structure verification. 586e41f4b71Sopenharmony_ci3. An internal error occurred. 587e41f4b71Sopenharmony_ci 588e41f4b71Sopenharmony_ci 589e41f4b71Sopenharmony_ci### OH_AVBuffer_GetBufferAttr() 590e41f4b71Sopenharmony_ci 591e41f4b71Sopenharmony_ci``` 592e41f4b71Sopenharmony_ciOH_AVErrCode OH_AVBuffer_GetBufferAttr (OH_AVBuffer *buffer, OH_AVCodecBufferAttr *attr) 593e41f4b71Sopenharmony_ci``` 594e41f4b71Sopenharmony_ci 595e41f4b71Sopenharmony_ci**Description** 596e41f4b71Sopenharmony_ci 597e41f4b71Sopenharmony_ciObtains the basic attributes, including **pts**, **size**, **offset**, and **flags**, of a buffer. 598e41f4b71Sopenharmony_ci 599e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 600e41f4b71Sopenharmony_ci 601e41f4b71Sopenharmony_ci**Since**: 11 602e41f4b71Sopenharmony_ci 603e41f4b71Sopenharmony_ci**Parameters** 604e41f4b71Sopenharmony_ci 605e41f4b71Sopenharmony_ci| Name| Description| 606e41f4b71Sopenharmony_ci| -------- | -------- | 607e41f4b71Sopenharmony_ci| buffer | Pointer to an **OH_AVBuffer** instance.| 608e41f4b71Sopenharmony_ci| attr | Pointer to an [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) instance.| 609e41f4b71Sopenharmony_ci 610e41f4b71Sopenharmony_ci**Returns** 611e41f4b71Sopenharmony_ci 612e41f4b71Sopenharmony_ciReturns any of the following result code: 613e41f4b71Sopenharmony_ci 614e41f4b71Sopenharmony_ci**AV_ERR_OK**: The operation is successful. 615e41f4b71Sopenharmony_ci 616e41f4b71Sopenharmony_ci**AV_ERR_INVALID_VAL**: The operation fails. 617e41f4b71Sopenharmony_ci 618e41f4b71Sopenharmony_ci Possible causes are as follows: 619e41f4b71Sopenharmony_ci 1. The passed-in value of **buffer** or **attr** is a null pointer. 620e41f4b71Sopenharmony_ci 2. The passed-in value of **buffer** fails parameter structure verification. 621e41f4b71Sopenharmony_ci 622e41f4b71Sopenharmony_ci 623e41f4b71Sopenharmony_ci### OH_AVBuffer_GetCapacity() 624e41f4b71Sopenharmony_ci 625e41f4b71Sopenharmony_ci``` 626e41f4b71Sopenharmony_ciint32_t OH_AVBuffer_GetCapacity (OH_AVBuffer *buffer) 627e41f4b71Sopenharmony_ci``` 628e41f4b71Sopenharmony_ci 629e41f4b71Sopenharmony_ci**Description** 630e41f4b71Sopenharmony_ci 631e41f4b71Sopenharmony_ciObtains the capacity (in bytes) of a buffer. 632e41f4b71Sopenharmony_ci 633e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 634e41f4b71Sopenharmony_ci 635e41f4b71Sopenharmony_ci**Since**: 11 636e41f4b71Sopenharmony_ci 637e41f4b71Sopenharmony_ci**Parameters** 638e41f4b71Sopenharmony_ci 639e41f4b71Sopenharmony_ci| Name| Description| 640e41f4b71Sopenharmony_ci| -------- | -------- | 641e41f4b71Sopenharmony_ci| buffer | Pointer to an **OH_AVBuffer** instance.| 642e41f4b71Sopenharmony_ci 643e41f4b71Sopenharmony_ci**Returns** 644e41f4b71Sopenharmony_ci 645e41f4b71Sopenharmony_ciReturns the capacity if the operation is successful; returns **-1** otherwise. 646e41f4b71Sopenharmony_ci 647e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 648e41f4b71Sopenharmony_ci 649e41f4b71Sopenharmony_ci1. The passed-in value of **buffer** is a null pointer. 650e41f4b71Sopenharmony_ci2. The passed-in value of **OH_AVBuffer** fails parameter structure verification. 651e41f4b71Sopenharmony_ci3. An internal error occurred. 652e41f4b71Sopenharmony_ci 653e41f4b71Sopenharmony_ci 654e41f4b71Sopenharmony_ci### OH_AVBuffer_GetNativeBuffer() 655e41f4b71Sopenharmony_ci 656e41f4b71Sopenharmony_ci``` 657e41f4b71Sopenharmony_ciOH_NativeBuffer* OH_AVBuffer_GetNativeBuffer (OH_AVBuffer *buffer) 658e41f4b71Sopenharmony_ci``` 659e41f4b71Sopenharmony_ci 660e41f4b71Sopenharmony_ci**Description** 661e41f4b71Sopenharmony_ci 662e41f4b71Sopenharmony_ciObtains the pointer to an **OH_NativeBuffer** instance. The caller must call [OH_NativeBuffer_Unreference](../apis-arkgraphics2d/_o_h___native_buffer.md#oh_nativebuffer_unreference) to manually release the **OH_NativeBuffer** instance returned. 663e41f4b71Sopenharmony_ci 664e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 665e41f4b71Sopenharmony_ci 666e41f4b71Sopenharmony_ci**Since**: 11 667e41f4b71Sopenharmony_ci 668e41f4b71Sopenharmony_ci**Parameters** 669e41f4b71Sopenharmony_ci 670e41f4b71Sopenharmony_ci| Name| Description| 671e41f4b71Sopenharmony_ci| -------- | -------- | 672e41f4b71Sopenharmony_ci| buffer | Pointer to an **OH_AVBuffer** instance.| 673e41f4b71Sopenharmony_ci 674e41f4b71Sopenharmony_ci**Returns** 675e41f4b71Sopenharmony_ci 676e41f4b71Sopenharmony_ciReturns the pointer to the **OH_NativeBuffer** instance created if the operation is successful; returns NULL otherwise. 677e41f4b71Sopenharmony_ci 678e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 679e41f4b71Sopenharmony_ci 680e41f4b71Sopenharmony_ci1. The passed-in value of **buffer** is a null pointer. 681e41f4b71Sopenharmony_ci2. The passed-in value of **OH_AVBuffer** fails parameter structure verification. 682e41f4b71Sopenharmony_ci3. An internal error occurred. 683e41f4b71Sopenharmony_ci 684e41f4b71Sopenharmony_ci 685e41f4b71Sopenharmony_ci### OH_AVBuffer_GetParameter() 686e41f4b71Sopenharmony_ci 687e41f4b71Sopenharmony_ci``` 688e41f4b71Sopenharmony_ciOH_AVFormat* OH_AVBuffer_GetParameter (OH_AVBuffer *buffer) 689e41f4b71Sopenharmony_ci``` 690e41f4b71Sopenharmony_ci 691e41f4b71Sopenharmony_ci**Description** 692e41f4b71Sopenharmony_ci 693e41f4b71Sopenharmony_ciObtains parameters except basic attributes of a buffer. The information is carried in an **OH_AVFormat** instance. The caller must call [OH_AVFormat_Destroy](#oh_avformat_destroy) to manually release the **OH_AVFormat** instance returned. 694e41f4b71Sopenharmony_ci 695e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 696e41f4b71Sopenharmony_ci 697e41f4b71Sopenharmony_ci**Since**: 11 698e41f4b71Sopenharmony_ci 699e41f4b71Sopenharmony_ci**Parameters** 700e41f4b71Sopenharmony_ci 701e41f4b71Sopenharmony_ci| Name| Description| 702e41f4b71Sopenharmony_ci| -------- | -------- | 703e41f4b71Sopenharmony_ci| buffer | Pointer to an **OH_AVBuffer** instance.| 704e41f4b71Sopenharmony_ci 705e41f4b71Sopenharmony_ci**Returns** 706e41f4b71Sopenharmony_ci 707e41f4b71Sopenharmony_ciReturns any of the following result code: 708e41f4b71Sopenharmony_ci 709e41f4b71Sopenharmony_ci**AV_ERR_OK**: The operation is successful. 710e41f4b71Sopenharmony_ci 711e41f4b71Sopenharmony_ci**AV_ERR_INVALID_VAL**: The operation fails. 712e41f4b71Sopenharmony_ci 713e41f4b71Sopenharmony_ci Possible causes are as follows: 714e41f4b71Sopenharmony_ci 1. The passed-in value of **buffer** is a null pointer. 715e41f4b71Sopenharmony_ci 2. The meta of the buffer is a null pointer. 716e41f4b71Sopenharmony_ci 3. The passed-in value of **buffer** fails parameter structure verification. 717e41f4b71Sopenharmony_ci 718e41f4b71Sopenharmony_ci 719e41f4b71Sopenharmony_ci### OH_AVBuffer_SetBufferAttr() 720e41f4b71Sopenharmony_ci 721e41f4b71Sopenharmony_ci``` 722e41f4b71Sopenharmony_ciOH_AVErrCode OH_AVBuffer_SetBufferAttr (OH_AVBuffer *buffer, const OH_AVCodecBufferAttr *attr) 723e41f4b71Sopenharmony_ci``` 724e41f4b71Sopenharmony_ci 725e41f4b71Sopenharmony_ci**Description** 726e41f4b71Sopenharmony_ci 727e41f4b71Sopenharmony_ciSets the basic attributes, including **pts**, **size**, **offset**, and **flags**, of a buffer. 728e41f4b71Sopenharmony_ci 729e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 730e41f4b71Sopenharmony_ci 731e41f4b71Sopenharmony_ci**Since**: 11 732e41f4b71Sopenharmony_ci 733e41f4b71Sopenharmony_ci**Parameters** 734e41f4b71Sopenharmony_ci 735e41f4b71Sopenharmony_ci| Name| Description| 736e41f4b71Sopenharmony_ci| -------- | -------- | 737e41f4b71Sopenharmony_ci| buffer | Pointer to an **OH_AVBuffer** instance.| 738e41f4b71Sopenharmony_ci| attr | Pointer to an [OH_AVCodecBufferAttr](_o_h___a_v_codec_buffer_attr.md) instance.| 739e41f4b71Sopenharmony_ci 740e41f4b71Sopenharmony_ci**Returns** 741e41f4b71Sopenharmony_ci 742e41f4b71Sopenharmony_ciReturns any of the following result code: 743e41f4b71Sopenharmony_ci 744e41f4b71Sopenharmony_ci**AV_ERR_OK**: The operation is successful. 745e41f4b71Sopenharmony_ci 746e41f4b71Sopenharmony_ci**AV_ERR_INVALID_VAL**: The operation fails. 747e41f4b71Sopenharmony_ci 748e41f4b71Sopenharmony_ci Possible causes are as follows: 749e41f4b71Sopenharmony_ci 1. The passed-in value of **buffer** or **attr** is a null pointer. 750e41f4b71Sopenharmony_ci 2. The passed-in value of **buffer** fails parameter structure verification. 751e41f4b71Sopenharmony_ci 3. The memory size or offset of the buffer is invalid. 752e41f4b71Sopenharmony_ci 753e41f4b71Sopenharmony_ci 754e41f4b71Sopenharmony_ci### OH_AVBuffer_SetParameter() 755e41f4b71Sopenharmony_ci 756e41f4b71Sopenharmony_ci``` 757e41f4b71Sopenharmony_ciOH_AVErrCode OH_AVBuffer_SetParameter (OH_AVBuffer *buffer, const OH_AVFormat *format) 758e41f4b71Sopenharmony_ci``` 759e41f4b71Sopenharmony_ci 760e41f4b71Sopenharmony_ci**Description** 761e41f4b71Sopenharmony_ci 762e41f4b71Sopenharmony_ciSets parameters except basic attributes of a buffer. The information is carried in an **OH_AVFormat** instance. 763e41f4b71Sopenharmony_ci 764e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 765e41f4b71Sopenharmony_ci 766e41f4b71Sopenharmony_ci**Since**: 11 767e41f4b71Sopenharmony_ci 768e41f4b71Sopenharmony_ci**Parameters** 769e41f4b71Sopenharmony_ci 770e41f4b71Sopenharmony_ci| Name| Description| 771e41f4b71Sopenharmony_ci| -------- | -------- | 772e41f4b71Sopenharmony_ci| buffer | Pointer to an **OH_AVBuffer** instance.| 773e41f4b71Sopenharmony_ci| format | Pointer to an **OH_AVFormat** instance.| 774e41f4b71Sopenharmony_ci 775e41f4b71Sopenharmony_ci**Returns** 776e41f4b71Sopenharmony_ci 777e41f4b71Sopenharmony_ciReturns any of the following result code: 778e41f4b71Sopenharmony_ci 779e41f4b71Sopenharmony_ci**AV_ERR_OK**: The operation is successful. 780e41f4b71Sopenharmony_ci 781e41f4b71Sopenharmony_ci**AV_ERR_INVALID_VAL**: The operation fails. 782e41f4b71Sopenharmony_ci 783e41f4b71Sopenharmony_ci Possible causes are as follows: 784e41f4b71Sopenharmony_ci 1. The passed-in value of **buffer** or **format** is a null pointer. 785e41f4b71Sopenharmony_ci 2. The meta of the buffer is a null pointer. 786e41f4b71Sopenharmony_ci 3. The passed-in value of **buffer** fails parameter structure verification. 787e41f4b71Sopenharmony_ci 788e41f4b71Sopenharmony_ci 789e41f4b71Sopenharmony_ci### OH_AVFormat_Copy() 790e41f4b71Sopenharmony_ci 791e41f4b71Sopenharmony_ci``` 792e41f4b71Sopenharmony_cibool OH_AVFormat_Copy (struct OH_AVFormat *to, struct OH_AVFormat *from) 793e41f4b71Sopenharmony_ci``` 794e41f4b71Sopenharmony_ci 795e41f4b71Sopenharmony_ci**Description** 796e41f4b71Sopenharmony_ci 797e41f4b71Sopenharmony_ciCopies an **OH_AVFormat** instance. 798e41f4b71Sopenharmony_ci 799e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 800e41f4b71Sopenharmony_ci 801e41f4b71Sopenharmony_ci**Since**: 9 802e41f4b71Sopenharmony_ci 803e41f4b71Sopenharmony_ci**Parameters** 804e41f4b71Sopenharmony_ci 805e41f4b71Sopenharmony_ci| Name| Description| 806e41f4b71Sopenharmony_ci| -------- | -------- | 807e41f4b71Sopenharmony_ci| to | Pointer to the **OH_AVFormat** instance to which the data will be copied.| 808e41f4b71Sopenharmony_ci| from | Pointer to the **OH_AVFormat** instance from which the data will be copied.| 809e41f4b71Sopenharmony_ci 810e41f4b71Sopenharmony_ci**Returns** 811e41f4b71Sopenharmony_ci 812e41f4b71Sopenharmony_ciReturns **TRUE** if the operation is successful; returns **FALSE** otherwise. 813e41f4b71Sopenharmony_ci 814e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 815e41f4b71Sopenharmony_ci 816e41f4b71Sopenharmony_ci1. The input parameter is a null pointer. 817e41f4b71Sopenharmony_ci2. The passed-in value of **OH_AVFormat** fails parameter structure verification. 818e41f4b71Sopenharmony_ci 819e41f4b71Sopenharmony_ci 820e41f4b71Sopenharmony_ci### OH_AVFormat_Create() 821e41f4b71Sopenharmony_ci 822e41f4b71Sopenharmony_ci``` 823e41f4b71Sopenharmony_cistruct OH_AVFormat* OH_AVFormat_Create (void) 824e41f4b71Sopenharmony_ci``` 825e41f4b71Sopenharmony_ci 826e41f4b71Sopenharmony_ci**Description** 827e41f4b71Sopenharmony_ci 828e41f4b71Sopenharmony_ciCreate an **OH_AVFormat** instance for reading and writing data. 829e41f4b71Sopenharmony_ci 830e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 831e41f4b71Sopenharmony_ci 832e41f4b71Sopenharmony_ci**Since**: 9 833e41f4b71Sopenharmony_ci 834e41f4b71Sopenharmony_ci**Returns** 835e41f4b71Sopenharmony_ci 836e41f4b71Sopenharmony_ciReturns the pointer to an **OH_AVFormat** instance; returns NULL if system resources are insufficient. 837e41f4b71Sopenharmony_ci 838e41f4b71Sopenharmony_ci 839e41f4b71Sopenharmony_ci### OH_AVFormat_CreateAudioFormat() 840e41f4b71Sopenharmony_ci 841e41f4b71Sopenharmony_ci``` 842e41f4b71Sopenharmony_cistruct OH_AVFormat* OH_AVFormat_CreateAudioFormat (const char *mimeType, int32_t sampleRate, int32_t channelCount) 843e41f4b71Sopenharmony_ci``` 844e41f4b71Sopenharmony_ci 845e41f4b71Sopenharmony_ci**Description** 846e41f4b71Sopenharmony_ci 847e41f4b71Sopenharmony_ciCreates an audio **OH_AVFormat** instance with specified parameters for reading and writing data. 848e41f4b71Sopenharmony_ci 849e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 850e41f4b71Sopenharmony_ci 851e41f4b71Sopenharmony_ci**Since**: 10 852e41f4b71Sopenharmony_ci 853e41f4b71Sopenharmony_ci**Parameters** 854e41f4b71Sopenharmony_ci 855e41f4b71Sopenharmony_ci| Name| Description| 856e41f4b71Sopenharmony_ci| -------- | -------- | 857e41f4b71Sopenharmony_ci| mimeType | Pointer to a string that describes the MIME type. For details, see [AVCODEC_MIMETYPE](_codec_base.md#variables).| 858e41f4b71Sopenharmony_ci| sampleRate | Sampling rate, in Hz.| 859e41f4b71Sopenharmony_ci| channelCount | Number of audio channels. For example, 1 indicates mono and 2 indicates stereo.| 860e41f4b71Sopenharmony_ci 861e41f4b71Sopenharmony_ci**Returns** 862e41f4b71Sopenharmony_ci 863e41f4b71Sopenharmony_ciReturns the pointer to an **OH_AVFormat** instance; returns NULL if the passed-in value of **mimeType** is NULL or system resources are insufficient. 864e41f4b71Sopenharmony_ci 865e41f4b71Sopenharmony_ci 866e41f4b71Sopenharmony_ci### OH_AVFormat_CreateVideoFormat() 867e41f4b71Sopenharmony_ci 868e41f4b71Sopenharmony_ci``` 869e41f4b71Sopenharmony_cistruct OH_AVFormat* OH_AVFormat_CreateVideoFormat (const char *mimeType, int32_t width, int32_t height) 870e41f4b71Sopenharmony_ci``` 871e41f4b71Sopenharmony_ci 872e41f4b71Sopenharmony_ci**Description** 873e41f4b71Sopenharmony_ci 874e41f4b71Sopenharmony_ciCreates a video **OH_AVFormat** instance with specified parameters for reading and writing data. 875e41f4b71Sopenharmony_ci 876e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 877e41f4b71Sopenharmony_ci 878e41f4b71Sopenharmony_ci**Since**: 10 879e41f4b71Sopenharmony_ci 880e41f4b71Sopenharmony_ci**Parameters** 881e41f4b71Sopenharmony_ci 882e41f4b71Sopenharmony_ci| Name| Description| 883e41f4b71Sopenharmony_ci| -------- | -------- | 884e41f4b71Sopenharmony_ci| mimeType | Pointer to a string that describes the MIME type. For details, see [AVCODEC_MIMETYPE](_codec_base.md#variables).| 885e41f4b71Sopenharmony_ci| width | Luminance width, in pixels.| 886e41f4b71Sopenharmony_ci| height | Luminance height, in pixels.| 887e41f4b71Sopenharmony_ci 888e41f4b71Sopenharmony_ci**Returns** 889e41f4b71Sopenharmony_ci 890e41f4b71Sopenharmony_ciReturns the pointer to an **OH_AVFormat** instance; returns NULL if the passed-in value of **mimeType** is NULL or system resources are insufficient. 891e41f4b71Sopenharmony_ci 892e41f4b71Sopenharmony_ci 893e41f4b71Sopenharmony_ci### OH_AVFormat_Destroy() 894e41f4b71Sopenharmony_ci 895e41f4b71Sopenharmony_ci``` 896e41f4b71Sopenharmony_civoid OH_AVFormat_Destroy (struct OH_AVFormat *format) 897e41f4b71Sopenharmony_ci``` 898e41f4b71Sopenharmony_ci 899e41f4b71Sopenharmony_ci**Description** 900e41f4b71Sopenharmony_ci 901e41f4b71Sopenharmony_ciDestroys an **OH_AVFormat** instance. The instance cannot be destroyed repeatedly. 902e41f4b71Sopenharmony_ci 903e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 904e41f4b71Sopenharmony_ci 905e41f4b71Sopenharmony_ci**Since**: 9 906e41f4b71Sopenharmony_ci 907e41f4b71Sopenharmony_ci**Parameters** 908e41f4b71Sopenharmony_ci 909e41f4b71Sopenharmony_ci| Name| Description| 910e41f4b71Sopenharmony_ci| -------- | -------- | 911e41f4b71Sopenharmony_ci| format | Pointer to an **OH_AVFormat** instance.| 912e41f4b71Sopenharmony_ci 913e41f4b71Sopenharmony_ci**Returns** 914e41f4b71Sopenharmony_ci 915e41f4b71Sopenharmony_ciNo return value. 916e41f4b71Sopenharmony_ci 917e41f4b71Sopenharmony_ci### OH_AVFormat_DumpInfo() 918e41f4b71Sopenharmony_ci 919e41f4b71Sopenharmony_ci``` 920e41f4b71Sopenharmony_ciconst char* OH_AVFormat_DumpInfo (struct OH_AVFormat *format) 921e41f4b71Sopenharmony_ci``` 922e41f4b71Sopenharmony_ci 923e41f4b71Sopenharmony_ci**Description** 924e41f4b71Sopenharmony_ci 925e41f4b71Sopenharmony_ciReturns a string consisting of key-value pairs contained in an **OH_AVFormat**. A string of up to 1024 bytes can be returned. The string pointer is released when the **OH_AVFormat** instance is destroyed. 926e41f4b71Sopenharmony_ci 927e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 928e41f4b71Sopenharmony_ci 929e41f4b71Sopenharmony_ci**Since**: 9 930e41f4b71Sopenharmony_ci 931e41f4b71Sopenharmony_ci**Parameters** 932e41f4b71Sopenharmony_ci 933e41f4b71Sopenharmony_ci| Name| Description| 934e41f4b71Sopenharmony_ci| -------- | -------- | 935e41f4b71Sopenharmony_ci| format | Pointer to an **OH_AVFormat** instance.| 936e41f4b71Sopenharmony_ci 937e41f4b71Sopenharmony_ci**Returns** 938e41f4b71Sopenharmony_ci 939e41f4b71Sopenharmony_ciReturns the pointer to a collection of strings, in the format of key-value pairs; returns NULL if the passed-in value of **format** is NULL or system resources are insufficient. 940e41f4b71Sopenharmony_ci 941e41f4b71Sopenharmony_ci 942e41f4b71Sopenharmony_ci### OH_AVFormat_GetBuffer() 943e41f4b71Sopenharmony_ci 944e41f4b71Sopenharmony_ci``` 945e41f4b71Sopenharmony_cibool OH_AVFormat_GetBuffer (struct OH_AVFormat *format, const char *key, uint8_t ** addr, size_t *size) 946e41f4b71Sopenharmony_ci``` 947e41f4b71Sopenharmony_ci 948e41f4b71Sopenharmony_ci**Description** 949e41f4b71Sopenharmony_ci 950e41f4b71Sopenharmony_ciReads data blocks of a specified length from an **OH_AVFormat** instance. 951e41f4b71Sopenharmony_ci 952e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 953e41f4b71Sopenharmony_ci 954e41f4b71Sopenharmony_ci**Since**: 9 955e41f4b71Sopenharmony_ci 956e41f4b71Sopenharmony_ci**Parameters** 957e41f4b71Sopenharmony_ci 958e41f4b71Sopenharmony_ci| Name| Description| 959e41f4b71Sopenharmony_ci| -------- | -------- | 960e41f4b71Sopenharmony_ci| format | Pointer to an **OH_AVFormat** instance.| 961e41f4b71Sopenharmony_ci| key | Pointer to the key of the data to read.| 962e41f4b71Sopenharmony_ci| addr | Double pointer to the address where the data read is stored. The data read is destroyed when the **OH_AVFormat** instance is destroyed. To hold the data for an extended period of time, copy it to the memory.| 963e41f4b71Sopenharmony_ci| size | Pointer to the size of the data read.| 964e41f4b71Sopenharmony_ci 965e41f4b71Sopenharmony_ci**Returns** 966e41f4b71Sopenharmony_ci 967e41f4b71Sopenharmony_ciReturns **TRUE** if the operation is successful; returns **FALSE** otherwise. 968e41f4b71Sopenharmony_ci 969e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 970e41f4b71Sopenharmony_ci 971e41f4b71Sopenharmony_ci1. The passed-in value of **format** is a null pointer. 972e41f4b71Sopenharmony_ci2. The passed-in value of **format** fails parameter structure verification. 973e41f4b71Sopenharmony_ci3. The passed-in value of **key** is a null pointer. 974e41f4b71Sopenharmony_ci4. The passed-in value of **addr** is a null pointer. 975e41f4b71Sopenharmony_ci5. The passed-in value of **size** is a null pointer. 976e41f4b71Sopenharmony_ci6. The obtained key does not exist or is not set. 977e41f4b71Sopenharmony_ci 978e41f4b71Sopenharmony_ci 979e41f4b71Sopenharmony_ci### OH_AVFormat_GetDoubleValue() 980e41f4b71Sopenharmony_ci 981e41f4b71Sopenharmony_ci``` 982e41f4b71Sopenharmony_cibool OH_AVFormat_GetDoubleValue (struct OH_AVFormat *format, const char *key, double *out) 983e41f4b71Sopenharmony_ci``` 984e41f4b71Sopenharmony_ci 985e41f4b71Sopenharmony_ci**Description** 986e41f4b71Sopenharmony_ci 987e41f4b71Sopenharmony_ciObtains the value of the double type of a key contained in an **OH_AVFormat**. 988e41f4b71Sopenharmony_ci 989e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 990e41f4b71Sopenharmony_ci 991e41f4b71Sopenharmony_ci**Since**: 9 992e41f4b71Sopenharmony_ci 993e41f4b71Sopenharmony_ci**Parameters** 994e41f4b71Sopenharmony_ci 995e41f4b71Sopenharmony_ci| Name| Description| 996e41f4b71Sopenharmony_ci| -------- | -------- | 997e41f4b71Sopenharmony_ci| format | Pointer to an **OH_AVFormat** instance.| 998e41f4b71Sopenharmony_ci| key | Pointer to the key of the data to read.| 999e41f4b71Sopenharmony_ci| out | Pointer to the value of the data read.| 1000e41f4b71Sopenharmony_ci 1001e41f4b71Sopenharmony_ci**Returns** 1002e41f4b71Sopenharmony_ci 1003e41f4b71Sopenharmony_ciReturns **TRUE** if the operation is successful; returns **FALSE** otherwise. 1004e41f4b71Sopenharmony_ci 1005e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 1006e41f4b71Sopenharmony_ci 1007e41f4b71Sopenharmony_ci1. The passed-in value of **format** is a null pointer. 1008e41f4b71Sopenharmony_ci2. The passed-in value of **format** fails parameter structure verification. 1009e41f4b71Sopenharmony_ci3. The passed-in value of **key** is a null pointer. 1010e41f4b71Sopenharmony_ci4. The passed-in value of **out** is a null pointer. 1011e41f4b71Sopenharmony_ci5. The obtained key does not exist or is not set. 1012e41f4b71Sopenharmony_ci 1013e41f4b71Sopenharmony_ci 1014e41f4b71Sopenharmony_ci### OH_AVFormat_GetFloatValue() 1015e41f4b71Sopenharmony_ci 1016e41f4b71Sopenharmony_ci``` 1017e41f4b71Sopenharmony_cibool OH_AVFormat_GetFloatValue (struct OH_AVFormat *format, const char *key, float *out) 1018e41f4b71Sopenharmony_ci``` 1019e41f4b71Sopenharmony_ci 1020e41f4b71Sopenharmony_ci**Description** 1021e41f4b71Sopenharmony_ci 1022e41f4b71Sopenharmony_ciObtains the value of the float type of a key contained in an **OH_AVFormat**. 1023e41f4b71Sopenharmony_ci 1024e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 1025e41f4b71Sopenharmony_ci 1026e41f4b71Sopenharmony_ci**Since**: 9 1027e41f4b71Sopenharmony_ci 1028e41f4b71Sopenharmony_ci**Parameters** 1029e41f4b71Sopenharmony_ci 1030e41f4b71Sopenharmony_ci| Name| Description| 1031e41f4b71Sopenharmony_ci| -------- | -------- | 1032e41f4b71Sopenharmony_ci| format | Pointer to an **OH_AVFormat** instance.| 1033e41f4b71Sopenharmony_ci| key | Pointer to the key of the data to read.| 1034e41f4b71Sopenharmony_ci| out | Pointer to the value of the data read.| 1035e41f4b71Sopenharmony_ci 1036e41f4b71Sopenharmony_ci**Returns** 1037e41f4b71Sopenharmony_ci 1038e41f4b71Sopenharmony_ciReturns **TRUE** if the operation is successful; returns **FALSE** otherwise. 1039e41f4b71Sopenharmony_ci 1040e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 1041e41f4b71Sopenharmony_ci 1042e41f4b71Sopenharmony_ci1. The passed-in value of **format** is a null pointer. 1043e41f4b71Sopenharmony_ci2. The passed-in value of **format** fails parameter structure verification. 1044e41f4b71Sopenharmony_ci3. The passed-in value of **key** is a null pointer. 1045e41f4b71Sopenharmony_ci4. The passed-in value of **out** is a null pointer. 1046e41f4b71Sopenharmony_ci5. The obtained key does not exist or is not set. 1047e41f4b71Sopenharmony_ci 1048e41f4b71Sopenharmony_ci 1049e41f4b71Sopenharmony_ci### OH_AVFormat_GetIntValue() 1050e41f4b71Sopenharmony_ci 1051e41f4b71Sopenharmony_ci``` 1052e41f4b71Sopenharmony_cibool OH_AVFormat_GetIntValue (struct OH_AVFormat *format, const char *key, int32_t *out) 1053e41f4b71Sopenharmony_ci``` 1054e41f4b71Sopenharmony_ci 1055e41f4b71Sopenharmony_ci**Description** 1056e41f4b71Sopenharmony_ci 1057e41f4b71Sopenharmony_ciObtains the value of the int type of a key contained in an **OH_AVFormat**. 1058e41f4b71Sopenharmony_ci 1059e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 1060e41f4b71Sopenharmony_ci 1061e41f4b71Sopenharmony_ci**Since**: 9 1062e41f4b71Sopenharmony_ci 1063e41f4b71Sopenharmony_ci**Parameters** 1064e41f4b71Sopenharmony_ci 1065e41f4b71Sopenharmony_ci| Name| Description| 1066e41f4b71Sopenharmony_ci| -------- | -------- | 1067e41f4b71Sopenharmony_ci| format | Pointer to an **OH_AVFormat** instance.| 1068e41f4b71Sopenharmony_ci| key | Pointer to the key of the data to read.| 1069e41f4b71Sopenharmony_ci| out | Pointer to the value of the data read.| 1070e41f4b71Sopenharmony_ci 1071e41f4b71Sopenharmony_ci**Returns** 1072e41f4b71Sopenharmony_ci 1073e41f4b71Sopenharmony_ciReturns **TRUE** if the operation is successful; returns **FALSE** otherwise. 1074e41f4b71Sopenharmony_ci 1075e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 1076e41f4b71Sopenharmony_ci 1077e41f4b71Sopenharmony_ci1. The passed-in value of **format** is a null pointer. 1078e41f4b71Sopenharmony_ci2. The passed-in value of **format** fails parameter structure verification. 1079e41f4b71Sopenharmony_ci3. The passed-in value of **key** is a null pointer. 1080e41f4b71Sopenharmony_ci4. The passed-in value of **out** is a null pointer. 1081e41f4b71Sopenharmony_ci5. The obtained key does not exist or is not set. 1082e41f4b71Sopenharmony_ci 1083e41f4b71Sopenharmony_ci 1084e41f4b71Sopenharmony_ci### OH_AVFormat_GetLongValue() 1085e41f4b71Sopenharmony_ci 1086e41f4b71Sopenharmony_ci``` 1087e41f4b71Sopenharmony_cibool OH_AVFormat_GetLongValue (struct OH_AVFormat *format, const char *key, int64_t *out) 1088e41f4b71Sopenharmony_ci``` 1089e41f4b71Sopenharmony_ci 1090e41f4b71Sopenharmony_ci**Description** 1091e41f4b71Sopenharmony_ci 1092e41f4b71Sopenharmony_ciObtains the value of the long type of a key contained in an **OH_AVFormat**. 1093e41f4b71Sopenharmony_ci 1094e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 1095e41f4b71Sopenharmony_ci 1096e41f4b71Sopenharmony_ci**Since**: 9 1097e41f4b71Sopenharmony_ci 1098e41f4b71Sopenharmony_ci**Parameters** 1099e41f4b71Sopenharmony_ci 1100e41f4b71Sopenharmony_ci| Name| Description| 1101e41f4b71Sopenharmony_ci| -------- | -------- | 1102e41f4b71Sopenharmony_ci| format | Pointer to an **OH_AVFormat** instance.| 1103e41f4b71Sopenharmony_ci| key | Pointer to the key of the data to read.| 1104e41f4b71Sopenharmony_ci| out | Pointer to the value of the data read.| 1105e41f4b71Sopenharmony_ci 1106e41f4b71Sopenharmony_ci**Returns** 1107e41f4b71Sopenharmony_ci 1108e41f4b71Sopenharmony_ciReturns **TRUE** if the operation is successful; returns **FALSE** otherwise. 1109e41f4b71Sopenharmony_ci 1110e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 1111e41f4b71Sopenharmony_ci 1112e41f4b71Sopenharmony_ci1. The passed-in value of **format** is a null pointer. 1113e41f4b71Sopenharmony_ci2. The passed-in value of **format** fails parameter structure verification. 1114e41f4b71Sopenharmony_ci3. The passed-in value of **key** is a null pointer. 1115e41f4b71Sopenharmony_ci4. The passed-in value of **out** is a null pointer. 1116e41f4b71Sopenharmony_ci5. The obtained key does not exist or is not set. 1117e41f4b71Sopenharmony_ci 1118e41f4b71Sopenharmony_ci 1119e41f4b71Sopenharmony_ci### OH_AVFormat_GetStringValue() 1120e41f4b71Sopenharmony_ci 1121e41f4b71Sopenharmony_ci``` 1122e41f4b71Sopenharmony_cibool OH_AVFormat_GetStringValue (struct OH_AVFormat *format, const char *key, const char ** out) 1123e41f4b71Sopenharmony_ci``` 1124e41f4b71Sopenharmony_ci 1125e41f4b71Sopenharmony_ci**Description** 1126e41f4b71Sopenharmony_ci 1127e41f4b71Sopenharmony_ciObtains the value of the string type of a key contained in an **OH_AVFormat**. 1128e41f4b71Sopenharmony_ci 1129e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 1130e41f4b71Sopenharmony_ci 1131e41f4b71Sopenharmony_ci**Since**: 9 1132e41f4b71Sopenharmony_ci 1133e41f4b71Sopenharmony_ci**Parameters** 1134e41f4b71Sopenharmony_ci 1135e41f4b71Sopenharmony_ci| Name| Description| 1136e41f4b71Sopenharmony_ci| -------- | -------- | 1137e41f4b71Sopenharmony_ci| format | Pointer to an **OH_AVFormat** instance.| 1138e41f4b71Sopenharmony_ci| key | Pointer to the key of the data to read.| 1139e41f4b71Sopenharmony_ci| out | Double-pointer to the string obtained. The lifecycle of the data of **out** corresponds to that of the string in the **OH_AVFormat** instance. The maximum length of the output string is 256 bytes. To hold the data for an extended period of time, copy it to the memory.| 1140e41f4b71Sopenharmony_ci 1141e41f4b71Sopenharmony_ci**Returns** 1142e41f4b71Sopenharmony_ci 1143e41f4b71Sopenharmony_ciReturns **TRUE** if the operation is successful; returns **FALSE** otherwise. 1144e41f4b71Sopenharmony_ci 1145e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 1146e41f4b71Sopenharmony_ci 1147e41f4b71Sopenharmony_ci1. The passed-in value of **format** is a null pointer. 1148e41f4b71Sopenharmony_ci2. The passed-in value of **format** fails parameter structure verification. 1149e41f4b71Sopenharmony_ci3. The passed-in value of **key** is a null pointer. 1150e41f4b71Sopenharmony_ci4. The passed-in value of **out** is a null pointer. 1151e41f4b71Sopenharmony_ci5. The system resources are insufficient. 1152e41f4b71Sopenharmony_ci6. The obtained key does not exist or is not set. 1153e41f4b71Sopenharmony_ci 1154e41f4b71Sopenharmony_ci 1155e41f4b71Sopenharmony_ci### OH_AVFormat_SetBuffer() 1156e41f4b71Sopenharmony_ci 1157e41f4b71Sopenharmony_ci``` 1158e41f4b71Sopenharmony_cibool OH_AVFormat_SetBuffer (struct OH_AVFormat *format, const char *key, const uint8_t *addr, size_t size) 1159e41f4b71Sopenharmony_ci``` 1160e41f4b71Sopenharmony_ci 1161e41f4b71Sopenharmony_ci**Description** 1162e41f4b71Sopenharmony_ci 1163e41f4b71Sopenharmony_ciWrites data blocks of a specified length to an **OH_AVFormat** instance. This function can be used to set only parameters of the buffer type. For details, see [CodecBase](_codec_base.md). 1164e41f4b71Sopenharmony_ci 1165e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 1166e41f4b71Sopenharmony_ci 1167e41f4b71Sopenharmony_ci**Since**: 9 1168e41f4b71Sopenharmony_ci 1169e41f4b71Sopenharmony_ci**Parameters** 1170e41f4b71Sopenharmony_ci 1171e41f4b71Sopenharmony_ci| Name| Description| 1172e41f4b71Sopenharmony_ci| -------- | -------- | 1173e41f4b71Sopenharmony_ci| format | Pointer to an **OH_AVFormat** instance.| 1174e41f4b71Sopenharmony_ci| key | Pointer to the key of the data to write.| 1175e41f4b71Sopenharmony_ci| addr | Double-pointer to the address to which data is written. The lifecycle is managed by the developer.| 1176e41f4b71Sopenharmony_ci| size | Length of the data written, in MB. The value range is (0, 1).| 1177e41f4b71Sopenharmony_ci 1178e41f4b71Sopenharmony_ci**Returns** 1179e41f4b71Sopenharmony_ci 1180e41f4b71Sopenharmony_ciReturns **TRUE** if the operation is successful; returns **FALSE** otherwise. 1181e41f4b71Sopenharmony_ci 1182e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 1183e41f4b71Sopenharmony_ci 1184e41f4b71Sopenharmony_ci1. The passed-in value of **format** is a null pointer. 1185e41f4b71Sopenharmony_ci2. The passed-in value of **format** fails parameter structure verification. 1186e41f4b71Sopenharmony_ci3. The passed-in value of **key** is a null pointer. 1187e41f4b71Sopenharmony_ci4. The passed-in value of **addr** is a null pointer. 1188e41f4b71Sopenharmony_ci5. The size is 0 or exceeds the upper limit 1 MB. 1189e41f4b71Sopenharmony_ci6. The value type corresponding to the key is incorrect. 1190e41f4b71Sopenharmony_ci 1191e41f4b71Sopenharmony_ci 1192e41f4b71Sopenharmony_ci### OH_AVFormat_SetDoubleValue() 1193e41f4b71Sopenharmony_ci 1194e41f4b71Sopenharmony_ci``` 1195e41f4b71Sopenharmony_cibool OH_AVFormat_SetDoubleValue (struct OH_AVFormat *format, const char *key, double value) 1196e41f4b71Sopenharmony_ci``` 1197e41f4b71Sopenharmony_ci 1198e41f4b71Sopenharmony_ci**Description** 1199e41f4b71Sopenharmony_ci 1200e41f4b71Sopenharmony_ciAssigns a value of the double type to a key contained in an **OH_AVFormat**. This function can be used to set only parameters of the double type. For details, see [CodecBase](_codec_base.md). 1201e41f4b71Sopenharmony_ci 1202e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 1203e41f4b71Sopenharmony_ci 1204e41f4b71Sopenharmony_ci**Since**: 9 1205e41f4b71Sopenharmony_ci 1206e41f4b71Sopenharmony_ci**Parameters** 1207e41f4b71Sopenharmony_ci 1208e41f4b71Sopenharmony_ci| Name| Description| 1209e41f4b71Sopenharmony_ci| -------- | -------- | 1210e41f4b71Sopenharmony_ci| format | Pointer to an **OH_AVFormat** instance.| 1211e41f4b71Sopenharmony_ci| key | Pointer to the key of the data to write.| 1212e41f4b71Sopenharmony_ci| value | Value of the data to write.| 1213e41f4b71Sopenharmony_ci 1214e41f4b71Sopenharmony_ci**Returns** 1215e41f4b71Sopenharmony_ci 1216e41f4b71Sopenharmony_ciReturns **TRUE** if the operation is successful; returns **FALSE** otherwise. 1217e41f4b71Sopenharmony_ci 1218e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 1219e41f4b71Sopenharmony_ci 1220e41f4b71Sopenharmony_ci1. The passed-in value of **format** is a null pointer. 1221e41f4b71Sopenharmony_ci2. The passed-in value of **format** fails parameter structure verification. 1222e41f4b71Sopenharmony_ci3. The passed-in value of **key** is a null pointer. 1223e41f4b71Sopenharmony_ci4. The value type corresponding to the key is incorrect. 1224e41f4b71Sopenharmony_ci 1225e41f4b71Sopenharmony_ci 1226e41f4b71Sopenharmony_ci### OH_AVFormat_SetFloatValue() 1227e41f4b71Sopenharmony_ci 1228e41f4b71Sopenharmony_ci``` 1229e41f4b71Sopenharmony_cibool OH_AVFormat_SetFloatValue (struct OH_AVFormat *format, const char *key, float value) 1230e41f4b71Sopenharmony_ci``` 1231e41f4b71Sopenharmony_ci 1232e41f4b71Sopenharmony_ci**Description** 1233e41f4b71Sopenharmony_ci 1234e41f4b71Sopenharmony_ciAssigns a value of the float type to a key contained in an **OH_AVFormat**. This function can be used to set only parameters of the float type. For details, see [CodecBase](_codec_base.md). 1235e41f4b71Sopenharmony_ci 1236e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 1237e41f4b71Sopenharmony_ci 1238e41f4b71Sopenharmony_ci**Since**: 9 1239e41f4b71Sopenharmony_ci 1240e41f4b71Sopenharmony_ci**Parameters** 1241e41f4b71Sopenharmony_ci 1242e41f4b71Sopenharmony_ci| Name| Description| 1243e41f4b71Sopenharmony_ci| -------- | -------- | 1244e41f4b71Sopenharmony_ci| format | Pointer to an **OH_AVFormat** instance.| 1245e41f4b71Sopenharmony_ci| key | Pointer to the key of the data to write.| 1246e41f4b71Sopenharmony_ci| value | Value of the data to write.| 1247e41f4b71Sopenharmony_ci 1248e41f4b71Sopenharmony_ci**Returns** 1249e41f4b71Sopenharmony_ci 1250e41f4b71Sopenharmony_ciReturns **TRUE** if the operation is successful; returns **FALSE** otherwise. 1251e41f4b71Sopenharmony_ci 1252e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 1253e41f4b71Sopenharmony_ci 1254e41f4b71Sopenharmony_ci1. The passed-in value of **format** is a null pointer. 1255e41f4b71Sopenharmony_ci2. The passed-in value of **format** fails parameter structure verification. 1256e41f4b71Sopenharmony_ci3. The passed-in value of **key** is a null pointer. 1257e41f4b71Sopenharmony_ci4. The value type corresponding to the key is incorrect. 1258e41f4b71Sopenharmony_ci 1259e41f4b71Sopenharmony_ci### OH_AVFormat_SetIntValue() 1260e41f4b71Sopenharmony_ci 1261e41f4b71Sopenharmony_ci``` 1262e41f4b71Sopenharmony_cibool OH_AVFormat_SetIntValue (struct OH_AVFormat *format, const char *key, int32_t value) 1263e41f4b71Sopenharmony_ci``` 1264e41f4b71Sopenharmony_ci 1265e41f4b71Sopenharmony_ci**Description** 1266e41f4b71Sopenharmony_ci 1267e41f4b71Sopenharmony_ciAssigns a value of the int type to a key contained in an **OH_AVFormat**. This function can be used to set only parameters of the int type. For details, see [CodecBase](_codec_base.md). 1268e41f4b71Sopenharmony_ci 1269e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 1270e41f4b71Sopenharmony_ci 1271e41f4b71Sopenharmony_ci**Since**: 9 1272e41f4b71Sopenharmony_ci 1273e41f4b71Sopenharmony_ci**Parameters** 1274e41f4b71Sopenharmony_ci 1275e41f4b71Sopenharmony_ci| Name| Description| 1276e41f4b71Sopenharmony_ci| -------- | -------- | 1277e41f4b71Sopenharmony_ci| format | Pointer to an **OH_AVFormat** instance.| 1278e41f4b71Sopenharmony_ci| key | Pointer to the key of the data to write.| 1279e41f4b71Sopenharmony_ci| value | Value of the data to write.| 1280e41f4b71Sopenharmony_ci 1281e41f4b71Sopenharmony_ci**Returns** 1282e41f4b71Sopenharmony_ci 1283e41f4b71Sopenharmony_ciReturns **TRUE** if the operation is successful; returns **FALSE** otherwise. 1284e41f4b71Sopenharmony_ci 1285e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 1286e41f4b71Sopenharmony_ci 1287e41f4b71Sopenharmony_ci1. The passed-in value of **format** is a null pointer. 1288e41f4b71Sopenharmony_ci2. The passed-in value of **format** fails parameter structure verification. 1289e41f4b71Sopenharmony_ci3. The passed-in value of **key** is a null pointer. 1290e41f4b71Sopenharmony_ci4. The value type corresponding to the key is incorrect. 1291e41f4b71Sopenharmony_ci 1292e41f4b71Sopenharmony_ci 1293e41f4b71Sopenharmony_ci### OH_AVFormat_SetLongValue() 1294e41f4b71Sopenharmony_ci 1295e41f4b71Sopenharmony_ci``` 1296e41f4b71Sopenharmony_cibool OH_AVFormat_SetLongValue (struct OH_AVFormat *format, const char *key, int64_t value) 1297e41f4b71Sopenharmony_ci``` 1298e41f4b71Sopenharmony_ci 1299e41f4b71Sopenharmony_ci**Description** 1300e41f4b71Sopenharmony_ci 1301e41f4b71Sopenharmony_ciAssigns a value of the long type to a key contained in an **OH_AVFormat**. This function can be used to set only parameters of the long type. For details, see [CodecBase](_codec_base.md). 1302e41f4b71Sopenharmony_ci 1303e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 1304e41f4b71Sopenharmony_ci 1305e41f4b71Sopenharmony_ci**Since**: 9 1306e41f4b71Sopenharmony_ci 1307e41f4b71Sopenharmony_ci**Parameters** 1308e41f4b71Sopenharmony_ci 1309e41f4b71Sopenharmony_ci| Name| Description| 1310e41f4b71Sopenharmony_ci| -------- | -------- | 1311e41f4b71Sopenharmony_ci| format | Pointer to an **OH_AVFormat** instance.| 1312e41f4b71Sopenharmony_ci| key | Pointer to the key of the data to write.| 1313e41f4b71Sopenharmony_ci| value | Value of the data to write.| 1314e41f4b71Sopenharmony_ci 1315e41f4b71Sopenharmony_ci**Returns** 1316e41f4b71Sopenharmony_ci 1317e41f4b71Sopenharmony_ciReturns **TRUE** if the operation is successful; returns **FALSE** otherwise. 1318e41f4b71Sopenharmony_ci 1319e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 1320e41f4b71Sopenharmony_ci 1321e41f4b71Sopenharmony_ci1. The passed-in value of **format** is a null pointer. 1322e41f4b71Sopenharmony_ci2. The passed-in value of **format** fails parameter structure verification. 1323e41f4b71Sopenharmony_ci3. The passed-in value of **key** is a null pointer. 1324e41f4b71Sopenharmony_ci4. The value type corresponding to the key is incorrect. 1325e41f4b71Sopenharmony_ci 1326e41f4b71Sopenharmony_ci 1327e41f4b71Sopenharmony_ci### OH_AVFormat_SetStringValue() 1328e41f4b71Sopenharmony_ci 1329e41f4b71Sopenharmony_ci``` 1330e41f4b71Sopenharmony_cibool OH_AVFormat_SetStringValue (struct OH_AVFormat *format, const char *key, const char *value) 1331e41f4b71Sopenharmony_ci``` 1332e41f4b71Sopenharmony_ci 1333e41f4b71Sopenharmony_ci**Description** 1334e41f4b71Sopenharmony_ci 1335e41f4b71Sopenharmony_ciAssigns a value of the string type to a key contained in an **OH_AVFormat**. This function can be used to set only parameters of the string type. For details, see [CodecBase](_codec_base.md). 1336e41f4b71Sopenharmony_ci 1337e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 1338e41f4b71Sopenharmony_ci 1339e41f4b71Sopenharmony_ci**Since**: 9 1340e41f4b71Sopenharmony_ci 1341e41f4b71Sopenharmony_ci**Parameters** 1342e41f4b71Sopenharmony_ci 1343e41f4b71Sopenharmony_ci| Name| Description| 1344e41f4b71Sopenharmony_ci| -------- | -------- | 1345e41f4b71Sopenharmony_ci| format | Pointer to an **OH_AVFormat** instance.| 1346e41f4b71Sopenharmony_ci| key | Pointer to the key of the data to write.| 1347e41f4b71Sopenharmony_ci| value | Pointer to the string to write. If the length exceeds 256 bytes, the system truncates the data.| 1348e41f4b71Sopenharmony_ci 1349e41f4b71Sopenharmony_ci**Returns** 1350e41f4b71Sopenharmony_ci 1351e41f4b71Sopenharmony_ciReturns **TRUE** if the operation is successful; returns **FALSE** otherwise. 1352e41f4b71Sopenharmony_ci 1353e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 1354e41f4b71Sopenharmony_ci 1355e41f4b71Sopenharmony_ci1. The passed-in value of **format** is a null pointer. 1356e41f4b71Sopenharmony_ci2. The passed-in value of **format** fails parameter structure verification. 1357e41f4b71Sopenharmony_ci3. The passed-in value of **key** is a null pointer. 1358e41f4b71Sopenharmony_ci4. The passed-in value of **value** is a null pointer. 1359e41f4b71Sopenharmony_ci5. The value type corresponding to the key is incorrect. 1360e41f4b71Sopenharmony_ci 1361e41f4b71Sopenharmony_ci 1362e41f4b71Sopenharmony_ci### OH_AVMemory_Create() 1363e41f4b71Sopenharmony_ci 1364e41f4b71Sopenharmony_ci``` 1365e41f4b71Sopenharmony_ciOH_AVMemory* OH_AVMemory_Create (int32_t size) 1366e41f4b71Sopenharmony_ci``` 1367e41f4b71Sopenharmony_ci 1368e41f4b71Sopenharmony_ci**Description** 1369e41f4b71Sopenharmony_ci 1370e41f4b71Sopenharmony_ciCreates an **OH_AVMemory** instance. 1371e41f4b71Sopenharmony_ci 1372e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 1373e41f4b71Sopenharmony_ci 1374e41f4b71Sopenharmony_ci**Since**: 10 1375e41f4b71Sopenharmony_ci 1376e41f4b71Sopenharmony_ci**Deprecated from**: 11 1377e41f4b71Sopenharmony_ci 1378e41f4b71Sopenharmony_ci**Substitute**: [OH_AVBuffer_Create](#oh_avbuffer_create) 1379e41f4b71Sopenharmony_ci 1380e41f4b71Sopenharmony_ci**Parameters** 1381e41f4b71Sopenharmony_ci 1382e41f4b71Sopenharmony_ci| Name| Description| 1383e41f4b71Sopenharmony_ci| -------- | -------- | 1384e41f4b71Sopenharmony_ci| size | Size of the created memory, in bytes.| 1385e41f4b71Sopenharmony_ci 1386e41f4b71Sopenharmony_ci**Returns** 1387e41f4b71Sopenharmony_ci 1388e41f4b71Sopenharmony_ciReturns the pointer to the **OH_AVMemory** instance created if the operation is successful; returns NULL otherwise. The instance must be released by calling **OH_AVMemory_Destroy** when it is no longer required. 1389e41f4b71Sopenharmony_ci 1390e41f4b71Sopenharmony_ci 1391e41f4b71Sopenharmony_ci### OH_AVMemory_Destroy() 1392e41f4b71Sopenharmony_ci 1393e41f4b71Sopenharmony_ci``` 1394e41f4b71Sopenharmony_ciOH_AVErrCode OH_AVMemory_Destroy (struct OH_AVMemory *mem) 1395e41f4b71Sopenharmony_ci``` 1396e41f4b71Sopenharmony_ci 1397e41f4b71Sopenharmony_ci**Description** 1398e41f4b71Sopenharmony_ci 1399e41f4b71Sopenharmony_ciReleases an **OH_AVMemory** instance. 1400e41f4b71Sopenharmony_ci 1401e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 1402e41f4b71Sopenharmony_ci 1403e41f4b71Sopenharmony_ci**Since**: 10 1404e41f4b71Sopenharmony_ci 1405e41f4b71Sopenharmony_ci**Deprecated from**: 11 1406e41f4b71Sopenharmony_ci 1407e41f4b71Sopenharmony_ci**Substitute**: [OH_AVBuffer_Destroy](#oh_avbuffer_destroy) 1408e41f4b71Sopenharmony_ci 1409e41f4b71Sopenharmony_ci**Parameters** 1410e41f4b71Sopenharmony_ci 1411e41f4b71Sopenharmony_ci| Name| Description| 1412e41f4b71Sopenharmony_ci| -------- | -------- | 1413e41f4b71Sopenharmony_ci| mem | Pointer to an **OH_AVMemory** instance.| 1414e41f4b71Sopenharmony_ci 1415e41f4b71Sopenharmony_ci**Returns** 1416e41f4b71Sopenharmony_ci 1417e41f4b71Sopenharmony_ciReturns **AV_ERR_OK** if the operation is successful; returns an error code defined in [OH_AVErrCode](#oh_averrcode-1) otherwise. 1418e41f4b71Sopenharmony_ci 1419e41f4b71Sopenharmony_ci 1420e41f4b71Sopenharmony_ci### OH_AVMemory_GetAddr() 1421e41f4b71Sopenharmony_ci 1422e41f4b71Sopenharmony_ci``` 1423e41f4b71Sopenharmony_ciuint8_t* OH_AVMemory_GetAddr (struct OH_AVMemory *mem) 1424e41f4b71Sopenharmony_ci``` 1425e41f4b71Sopenharmony_ci 1426e41f4b71Sopenharmony_ci**Description** 1427e41f4b71Sopenharmony_ci 1428e41f4b71Sopenharmony_ciObtains the virtual memory address. 1429e41f4b71Sopenharmony_ci 1430e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 1431e41f4b71Sopenharmony_ci 1432e41f4b71Sopenharmony_ci**Since**: 9 1433e41f4b71Sopenharmony_ci 1434e41f4b71Sopenharmony_ci**Deprecated from**: 11 1435e41f4b71Sopenharmony_ci 1436e41f4b71Sopenharmony_ci**Substitute**: [OH_AVBuffer_GetAddr](#oh_avbuffer_getaddr) 1437e41f4b71Sopenharmony_ci 1438e41f4b71Sopenharmony_ci**Parameters** 1439e41f4b71Sopenharmony_ci 1440e41f4b71Sopenharmony_ci| Name| Description| 1441e41f4b71Sopenharmony_ci| -------- | -------- | 1442e41f4b71Sopenharmony_ci| mem | Pointer to an **OH_AVMemory** instance.| 1443e41f4b71Sopenharmony_ci 1444e41f4b71Sopenharmony_ci**Returns** 1445e41f4b71Sopenharmony_ci 1446e41f4b71Sopenharmony_ciReturns the pointer to the virtual memory address if the memory is valid; returns NULL otherwise. 1447e41f4b71Sopenharmony_ci 1448e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 1449e41f4b71Sopenharmony_ci 1450e41f4b71Sopenharmony_ci1. The passed-in value of **mem** is a null pointer. 1451e41f4b71Sopenharmony_ci2. The passed-in value of **mem** fails parameter structure verification. 1452e41f4b71Sopenharmony_ci3. The memory in the passed-in value of **mem** is a null pointer. 1453e41f4b71Sopenharmony_ci 1454e41f4b71Sopenharmony_ci 1455e41f4b71Sopenharmony_ci### OH_AVMemory_GetSize() 1456e41f4b71Sopenharmony_ci 1457e41f4b71Sopenharmony_ci``` 1458e41f4b71Sopenharmony_ciint32_t OH_AVMemory_GetSize (struct OH_AVMemory *mem) 1459e41f4b71Sopenharmony_ci``` 1460e41f4b71Sopenharmony_ci 1461e41f4b71Sopenharmony_ci**Description** 1462e41f4b71Sopenharmony_ci 1463e41f4b71Sopenharmony_ciObtains the memory length. 1464e41f4b71Sopenharmony_ci 1465e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Multimedia.Media.Core 1466e41f4b71Sopenharmony_ci 1467e41f4b71Sopenharmony_ci**Since**: 9 1468e41f4b71Sopenharmony_ci 1469e41f4b71Sopenharmony_ci**Deprecated from**: 11 1470e41f4b71Sopenharmony_ci 1471e41f4b71Sopenharmony_ci**Substitute**: [OH_AVBuffer_GetCapacity](#oh_avbuffer_getcapacity) 1472e41f4b71Sopenharmony_ci 1473e41f4b71Sopenharmony_ci**Parameters** 1474e41f4b71Sopenharmony_ci 1475e41f4b71Sopenharmony_ci| Name| Description| 1476e41f4b71Sopenharmony_ci| -------- | -------- | 1477e41f4b71Sopenharmony_ci| mem | Pointer to an **OH_AVMemory** instance.| 1478e41f4b71Sopenharmony_ci 1479e41f4b71Sopenharmony_ci**Returns** 1480e41f4b71Sopenharmony_ci 1481e41f4b71Sopenharmony_ciReturns the memory size if the memory is valid; returns **-1** otherwise. 1482e41f4b71Sopenharmony_ci 1483e41f4b71Sopenharmony_ciThe possible causes of an operation failure are as follows: 1484e41f4b71Sopenharmony_ci 1485e41f4b71Sopenharmony_ci1. The passed-in value of **mem** is a null pointer. 1486e41f4b71Sopenharmony_ci2. The passed-in value of **mem** fails parameter structure verification. 1487e41f4b71Sopenharmony_ci3. The memory in the passed-in value of **mem** is a null pointer. 1488