lowpower_audio_sink_base.h
Overview
The file declares the structs and enums of the LowPowerAudioSink.
File to include: <multimedia/player_framework/lowpower_audio_sink_base.h>
Library: liblowpower_avsink.so
System capability: SystemCapability.Multimedia.Media.LowPowerAVSink
Since: 20
Related module: LowPowerAudioSink
Summary
Structs
| Name | typedef Keyword | Description |
|---|---|---|
| OH_LowPowerAudioSink | OH_LowPowerAudioSink | Describes the declaration for the LowPowerAudioSink. |
| OH_LowPowerAudioSinkCallback | OH_LowPowerAudioSinkCallback | Contains a set of callback function pointers for the LowPowerAudioSink. To ensure the normal running of the LowPowerAudioSink, you must register the instance of this struct with the OH_LowPowerAudioSink instance and process the information reported by the callback functions. |
Functions
Function Description
OH_LowPowerAudioSink_OnError()
typedef void (*OH_LowPowerAudioSink_OnError)(OH_LowPowerAudioSink* sink,OH_AVErrCode errCode,const char* errorMsg,void* userData)
Description
Called when an error occurs in the LowPowerAudioSink.
Since: 20
Parameters
| Name | Description |
|---|---|
| OH_LowPowerAudioSink* sink | Pointer to an OH_LowPowerAudioSink instance. |
| OH_AVErrCode errCode | Error code reported when an error occurs. |
| const char* errorMsg | Pointer to an error message. |
| void* userData | Pointer to user-defined data. |
OH_LowPowerAudioSink_OnPositionUpdated()
typedef void (*OH_LowPowerAudioSink_OnPositionUpdated)(OH_LowPowerAudioSink* sink,int64_t currentPosition,void* userData)
Description
Called when the playback position is updated in the LowPowerAudioSink.
Since: 20
Parameters
| Name | Description |
|---|---|
| OH_LowPowerAudioSink* sink | Pointer to an OH_LowPowerAudioSink instance. |
| int64_t currentPosition | Current playback position. |
| void* userData | Pointer to user-defined data. |
OH_LowPowerAudioSink_OnDataNeeded()
typedef void (*OH_LowPowerAudioSink_OnDataNeeded)(OH_LowPowerAudioSink* sink,OH_AVSamplesBuffer* samples,void* userData)
Description
Called when the LowPowerAudioSink needs more data.
Since: 20
Parameters
| Name | Description |
|---|---|
| OH_LowPowerAudioSink* sink | Pointer to an OH_LowPowerAudioSink instance. |
| OH_AVSamplesBuffer* samples | Pointer to the AVSamplesBuffer instance to be written. |
| void* userData | Pointer to user-defined data. |
OH_LowPowerAudioSink_OnInterrupted()
typedef void (*OH_LowPowerAudioSink_OnInterrupted)(OH_LowPowerAudioSink* sink,OH_AudioInterrupt_ForceType type,OH_AudioInterrupt_Hint hint,void* userData)
Description
Called when the audio focus is interrupted in the LowPowerAudioSink.
Since: 20
Parameters
| Name | Description |
|---|---|
| OH_LowPowerAudioSink* sink | Pointer to an OH_LowPowerAudioSink instance. |
| OH_AudioInterrupt_ForceType type | Type of force that causes the audio interruption. |
| OH_AudioInterrupt_Hint hint | Hint provided along with audio interruption. |
| void* userData | Pointer to user-defined data. |
OH_LowPowerAudioSink_OnDeviceChanged()
typedef void (*OH_LowPowerAudioSink_OnDeviceChanged)(OH_LowPowerAudioSink* sink,OH_AudioStream_DeviceChangeReason reason,void* userData)
Description
Called when the audio device changes in the LowPowerAudioSink.
Since: 20
Parameters
| Name | Description |
|---|---|
| OH_LowPowerAudioSink* sink | Pointer to an OH_LowPowerAudioSink instance. |
| OH_AudioStream_DeviceChangeReason reason | Reason for the output device changes. |
| void* userData | Pointer to user-defined data. |
OH_LowPowerAudioSink_OnEos()
typedef void (*OH_LowPowerAudioSink_OnEos)(OH_LowPowerAudioSink* sink, void* userData)
Description
Called when the playback is complete in the LowPowerAudioSink. This callback is included in OH_LowPowerAudioSinkCallback.
Since: 20
Parameters
| Name | Description |
|---|---|
| OH_LowPowerAudioSink* sink | Pointer to an OH_LowPowerAudioSink instance. |
| void* userData | Pointer to user-defined data. |
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 capi-avrecorder-oh-avrecorder-range
openharmony 鸿蒙 errorcode-media
openharmony 鸿蒙 capi-avplayer-base-h
openharmony 鸿蒙 capi-avimage-generator-h
openharmony 鸿蒙 capi-avscreencapture-oh-rect
openharmony 鸿蒙 capi-videoprocessing-videoprocessing-callback
openharmony 鸿蒙 capi-avsinkbase
openharmony 鸿蒙 capi-avmetadataextractor
openharmony 鸿蒙 capi-avscreencapture-oh-multidisplaycapability