• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# native_avbuffer.h
2
3
4## Overview
5
6The file declares the functions of the media struct AVBuffer.
7
8**Library**: libnative_media_core.so
9
10**File to include**: <multimedia/player_framework/native_avbuffer.h>
11
12**System capability**: SystemCapability.Multimedia.Media.Core
13
14**Since**: 11
15
16**Related module**: [Core](_core.md)
17
18**Sample**: [AVCodec](https://gitcode.com/openharmony/applications_app_samples/tree/master/code/BasicFeature/Media/AVCodec)
19
20
21## Summary
22
23
24### Types
25
26| Name| Description|
27| -------- | -------- |
28| typedef struct [OH_AVBuffer](_core.md#oh_avbuffer) [OH_AVBuffer](_core.md#oh_avbuffer) | Defines a struct that describes a native object for the media memory interface. |
29| typedef struct [OH_NativeBuffer](_core.md#oh_nativebuffer) [OH_NativeBuffer](_core.md#oh_nativebuffer) | Defines a struct that describes a native object for the graphics memory interface. |
30
31
32### Functions
33
34| Name| Description|
35| -------- | -------- |
36| [OH_AVBuffer](_core.md#oh_avbuffer) \* [OH_AVBuffer_Create](_core.md#oh_avbuffer_create) (int32_t capacity) | Creates an OH_AVBuffer instance. You must call [OH_AVBuffer_Destroy](_core.md#oh_avbuffer_destroy) to manually release the OH_AVBuffer instance returned.|
37| [OH_AVErrCode](_core.md#oh_averrcode) [OH_AVBuffer_Destroy](_core.md#oh_avbuffer_destroy) (OH_AVBuffer \*buffer) | Releases an OH_AVBuffer instance.|
38| [OH_AVErrCode](_core.md#oh_averrcode) [OH_AVBuffer_GetBufferAttr](_core.md#oh_avbuffer_getbufferattr) (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.|
39| [OH_AVErrCode](_core.md#oh_averrcode) [OH_AVBuffer_SetBufferAttr](_core.md#oh_avbuffer_setbufferattr) (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.|
40| [OH_AVFormat](_core.md#oh_avformat) \* [OH_AVBuffer_GetParameter](_core.md#oh_avbuffer_getparameter) (OH_AVBuffer \*buffer) | Obtains parameters except basic attributes of a buffer. The information is carried in an OH_AVFormat instance.|
41| [OH_AVErrCode](_core.md#oh_averrcode) [OH_AVBuffer_SetParameter](_core.md#oh_avbuffer_setparameter) (OH_AVBuffer \*buffer, const OH_AVFormat \*format) | Sets parameters except basic attributes of a buffer. The information is carried in an OH_AVFormat instance.|
42| uint8_t \* [OH_AVBuffer_GetAddr](_core.md#oh_avbuffer_getaddr) (OH_AVBuffer \*buffer) | Obtains the virtual address of a data buffer.|
43| int32_t [OH_AVBuffer_GetCapacity](_core.md#oh_avbuffer_getcapacity) (OH_AVBuffer \*buffer) | Obtains the capacity (in bytes) of a buffer.|
44| [OH_NativeBuffer](_core.md#oh_nativebuffer) \* [OH_AVBuffer_GetNativeBuffer](_core.md#oh_avbuffer_getnativebuffer) (OH_AVBuffer \*buffer) | Obtains the pointer to an OH_NativeBuffer instance.|
45