From 3f41f6984125c0c25fb5be45ea533a4ecb9ad51a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=99=93=E6=B8=AF?= Date: Mon, 1 Sep 2025 18:05:17 +0800 Subject: [PATCH 1/4] add 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 | 12 ++++++++++++ .../player_framework/avplayer/libavplayer.ndk.json | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/multimedia/player_framework/avplayer.h b/multimedia/player_framework/avplayer.h index 9f89bc00c2a..773d28fc1f9 100644 --- a/multimedia/player_framework/avplayer.h +++ b/multimedia/player_framework/avplayer.h @@ -644,6 +644,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 setFdSource 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 792b49933eac40a96333a25a49d5a73945a6f03d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=99=93=E6=B8=AF?= Date: Mon, 1 Sep 2025 10:18:15 +0000 Subject: [PATCH 2/4] 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 773d28fc1f9..9119046d5ea 100644 --- a/multimedia/player_framework/avplayer.h +++ b/multimedia/player_framework/avplayer.h @@ -648,7 +648,7 @@ 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 + * @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 setFdSource failed. -- Gitee From f0be871d78018523ca739609377dfc1e05079951 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=99=93=E6=B8=AF?= Date: Tue, 2 Sep 2025 08:48:21 +0000 Subject: [PATCH 3/4] 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 9119046d5ea..65cae0fb582 100644 --- a/multimedia/player_framework/avplayer.h +++ b/multimedia/player_framework/avplayer.h @@ -651,7 +651,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 setFdSource failed. + * {@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); -- Gitee From f7dc108ccba4c4f6e84dccb6157f3e61f061c1e9 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 08:12:56 +0000 Subject: [PATCH 4/4] 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/multimedia/player_framework/avplayer.h b/multimedia/player_framework/avplayer.h index 65cae0fb582..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" { -- Gitee