1# lowpower_avsink_base.h 2 3## Overview 4 5The file declares the basic dependencies for OH_LowPowerAudioSink and OH_LowPowerVideoSink. 6 7**File to include**: <multimedia/player_framework/lowpower_avsink_base.h> 8 9**Library**: liblowpower_avsink.so 10 11**System capability**: SystemCapability.Multimedia.Media.LowPowerAVSink 12 13**Since**: 20 14 15**Related module**: [AVSinkBase](capi-avsinkbase.md) 16 17## Summary 18 19### Structs 20 21| Name| typedef Keyword| Description| 22| -- | -- | -- | 23| [OH_AVSamplesBuffer](capi-avsinkbase-oh-avsamplesbuffer.md) | OH_AVSamplesBuffer | Describes the input data of the LowPowerAVSink. After receiving the DataNeeded callback, the application must pack data into an OH_AVSamplesBuffer instance and pass it to the corresponding lowpower_avsink.| 24 25### Functions 26 27| Name| Description| 28| -- | -- | 29| [OH_AVErrCode OH_AVSamplesBuffer_AppendOneBuffer(OH_AVSamplesBuffer *samplesBuffer, OH_AVBuffer *avBuffer)](#oh_avsamplesbuffer_appendonebuffer) | Appends data from an OH_AVBuffer instance to an OH_AVSamplesBuffer instance.| 30| [int32_t OH_AVSamplesBuffer_GetRemainedCapacity(OH_AVSamplesBuffer *samplesBuffer)](#oh_avsamplesbuffer_getremainedcapacity) | Obtains the remaining capacity available in an OH_AVSamplesBuffer instance.| 31 32## Function Description 33 34### OH_AVSamplesBuffer_AppendOneBuffer() 35 36``` 37OH_AVErrCode OH_AVSamplesBuffer_AppendOneBuffer(OH_AVSamplesBuffer *samplesBuffer, OH_AVBuffer *avBuffer) 38``` 39 40**Description** 41 42Appends data from an OH_AVBuffer instance to an OH_AVSamplesBuffer instance. 43 44**Since**: 20 45 46 47**Parameters** 48 49| Name| Description| 50| -- | -- | 51| [OH_AVSamplesBuffer](capi-avsinkbase-oh-avsamplesbuffer.md) *samplesBuffer | Pointer to an OH_AVSamplesBuffer instance.| 52| [OH_AVBuffer](../apis-avcodec-kit/_core.md#oh_avbuffer) *avBuffer | Pointer to an OH_AVBuffer instance.| 53 54**Returns** 55 56| Type| Description| 57| -- | -- | 58| [OH_AVErrCode](../apis-avcodec-kit/_core.md#oh_averrcode-1) | **AV_ERR_OK**: The operation is successful.<br> **AV_ERR_INVALID_VAL**: An input parameter is nullptr or invalid.<br> **AV_ERR_NO_MEMORY**: The framePacketBuffer does not have sufficient remaining capacity to append an OH_AVBuffer.<br> **AV_ERR_UNKNOW**: An unknown error occurs.| 59 60### OH_AVSamplesBuffer_GetRemainedCapacity() 61 62``` 63int32_t OH_AVSamplesBuffer_GetRemainedCapacity(OH_AVSamplesBuffer *samplesBuffer) 64``` 65 66**Description** 67 68Obtains the remaining capacity available in an OH_AVSamplesBuffer instance. 69 70**Since**: 20 71 72 73**Parameters** 74 75| Name| Description| 76| -- | -- | 77| [OH_AVSamplesBuffer](capi-avsinkbase-oh-avsamplesbuffer.md) *samplesBuffer | Pointer to an OH_AVSamplesBuffer instance.| 78 79**Returns** 80 81| Type| Description| 82| -- | -- | 83| int32_t | Remaining capacity available in the OH_AVSamplesBuffer instance, in bytes. If **sampleBuffer** or data poniter is nullptr or invalid, **-1** is returned.| 84