From f9b549ac1d6d2c2267dd2fb4f2efc5213cad1330 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=99=93=E6=B8=AF?= Date: Thu, 4 Sep 2025 22:20:02 +0800 Subject: [PATCH 1/2] add AVplayer capi SetDataSource MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李晓港 --- multimedia/player_framework/avplayer.h | 13 +++++++++++++ .../player_framework/avplayer/libavplayer.ndk.json | 4 ++++ 2 files changed, 17 insertions(+) diff --git a/multimedia/player_framework/avplayer.h b/multimedia/player_framework/avplayer.h index 9f89bc00c2a..ed9bfacb256 100644 --- a/multimedia/player_framework/avplayer.h +++ b/multimedia/player_framework/avplayer.h @@ -47,6 +47,7 @@ #include "avplayer_base.h" #include "native_window/external_window.h" #include "ohaudio/native_audiostream_base.h" +#include "native_avcodec_base.h" #ifdef __cplusplus extern "C" { @@ -644,6 +645,18 @@ OH_AVErrCode OH_AVPlayer_SetVolumeMode(OH_AVPlayer *player, OH_AudioStream_Volum */ OH_AVErrCode OH_AVPlayer_SetLoudnessGain(OH_AVPlayer *player, float loudnessGain); +/** + * @brief Set the media source of the player. The data of this media source is provided by the application. + * @param {OH_AVPlayer*} player Pointer to an OH_AVPlayer instance + * @param {OH_AVDataSourceExt*} datasrc Pointer to an OH_AVDataSourceExt instance + * @param {void*} userData The handle passed in by the user is used to pass in the callback + * @return Function result code. + * {@link AV_ERR_OK} if the execution is successful. + * {@link AV_ERR_INVALID_VAL} if input player is nullptr or player setDataSource failed. + * @since 21 + */ +OH_AVErrCode OH_AVPlayer_SetDataSource(OH_AVPlayer *player, OH_AVDataSourceExt* datasrc, void* userData); + #ifdef __cplusplus } #endif diff --git a/multimedia/player_framework/avplayer/libavplayer.ndk.json b/multimedia/player_framework/avplayer/libavplayer.ndk.json index 787c34354f8..2b372fe8fa0 100644 --- a/multimedia/player_framework/avplayer/libavplayer.ndk.json +++ b/multimedia/player_framework/avplayer/libavplayer.ndk.json @@ -150,5 +150,9 @@ { "first_introduced": "21", "name": "OH_AVPlayer_SetLoudnessGain" + }, + { + "first_introduced": "21", + "name": "OH_AVPlayer_SetDataSource" } ] \ No newline at end of file -- Gitee From 519496f4ea7e104f2edf5e2bdac118458a2b02ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=99=93=E6=B8=AF?= Date: Fri, 5 Sep 2025 08:24:36 +0000 Subject: [PATCH 2/2] update multimedia/player_framework/avplayer.h. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李晓港 --- multimedia/player_framework/avplayer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multimedia/player_framework/avplayer.h b/multimedia/player_framework/avplayer.h index ed9bfacb256..6108618a41f 100644 --- a/multimedia/player_framework/avplayer.h +++ b/multimedia/player_framework/avplayer.h @@ -652,7 +652,7 @@ OH_AVErrCode OH_AVPlayer_SetLoudnessGain(OH_AVPlayer *player, float loudnessGain * @param {void*} userData The handle passed in by the user is used to pass in the callback * @return Function result code. * {@link AV_ERR_OK} if the execution is successful. - * {@link AV_ERR_INVALID_VAL} if input player is nullptr or player setDataSource failed. + * {@link AV_ERR_INVALID_VAL} if input player is nullptr or player setFdSource failed. * @since 21 */ OH_AVErrCode OH_AVPlayer_SetDataSource(OH_AVPlayer *player, OH_AVDataSourceExt* datasrc, void* userData); -- Gitee