diff --git a/multimedia/player_framework/avplayer.h b/multimedia/player_framework/avplayer.h index 22725740d7b52b721f0c9f12233d79abb4b4e171..fa63c5ae3c6e5a772738b10d3c58b9f5a6dc3fe0 100644 --- a/multimedia/player_framework/avplayer.h +++ b/multimedia/player_framework/avplayer.h @@ -43,6 +43,7 @@ #include "native_averrors.h" #include "avplayer_base.h" #include "native_window/external_window.h" +#include "ohaudio/native_audiostream_base.h" #ifdef __cplusplus extern "C" { @@ -317,6 +318,44 @@ OH_AVErrCode OH_AVPlayer_SetPlaybackSpeed(OH_AVPlayer *player, AVPlaybackSpeed s */ OH_AVErrCode OH_AVPlayer_GetPlaybackSpeed(OH_AVPlayer *player, AVPlaybackSpeed *speed); +/** + * @brief Set the renderer information of the player's audio renderer + * @param player Pointer to an OH_AVPlayer instance + * @param streamUsage The value {@link OH_AudioStream_Usage} used for the stream usage of the player audio render. + * @return Function result code. + * {@link AV_ERR_OK} if the execution is successful. + * {@link AV_ERR_INVALID_VAL} if input player is nullptr or streamUsage value is invalid. + * @since 12 + * @version 1.0 + */ +OH_AVErrCode OH_AVPlayer_SetAudioRendererInfo(OH_AVPlayer *player, OH_AudioStream_Usage streamUsage); + +/** + * @brief Set the interruption mode of the player's audio stream + * @param player Pointer to an OH_AVPlayer instance + * @param interruptMode The value {@link OH_AudioInterrupt_Mode} used for the interruption mode of + * the player audio stream. + * @return Function result code. + * {@link AV_ERR_OK} if the execution is successful. + * {@link AV_ERR_INVALID_VAL} if input player is nullptr or interruptMode value is invalid. + * @since 12 + * @version 1.0 + */ +OH_AVErrCode OH_AVPlayer_SetAudioInterruptMode(OH_AVPlayer *player, OH_AudioInterrupt_Mode interruptMode); + +/** + * @brief Set the effect mode of the player's audio stream + * @param player Pointer to an OH_AVPlayer instance + * @param effectMode The value {@link OH_AudioStream_AudioEffectMode} used for the effect mode of + * the player audio stream. + * @return Function result code. + * {@link AV_ERR_OK} if the execution is successful. + * {@link AV_ERR_INVALID_VAL} if input player is nullptr or effectMode value is invalid. + * @since 12 + * @version 1.0 + */ +OH_AVErrCode OH_AVPlayer_SetAudioEffectMode(OH_AVPlayer *player, OH_AudioStream_AudioEffectMode effectMode); + /** * @brief set the bit rate use for hls player * diff --git a/multimedia/player_framework/avplayer/libavplayer.ndk.json b/multimedia/player_framework/avplayer/libavplayer.ndk.json index 5c260ec089b7a9e6340f2a5075226dc48d831041..dbfa420edf150b49c60963d92591da2fcb4bb7b2 100644 --- a/multimedia/player_framework/avplayer/libavplayer.ndk.json +++ b/multimedia/player_framework/avplayer/libavplayer.ndk.json @@ -38,5 +38,17 @@ { "first_introduced": "12", "name": "OH_AVPlayer_SetDecryptionConfig" + }, + { + "first_introduced": "12", + "name": "OH_AVPlayer_SetAudioRendererInfo" + }, + { + "first_introduced": "12", + "name": "OH_AVPlayer_SetAudioInterruptMode" + }, + { + "first_introduced": "12", + "name": "OH_AVPlayer_SetAudioEffectMode" } ] \ No newline at end of file