From 33367fd9a3806ce6862268244efda4082573147a Mon Sep 17 00:00:00 2001 From: wxkkk Date: Wed, 20 Aug 2025 08:44:50 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E5=BD=93=E5=AE=A2=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E4=B8=BA=E5=BA=94=E7=94=A8=E5=B8=82=E5=9C=BA=E6=97=B6IPC?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=E5=8F=98=E4=B8=BA=E5=90=8C=E6=AD=A5=E8=AF=B7?= =?UTF-8?q?=E6=B1=82=20Signed-off-by:=20wxkkk=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- interfaces/inner_api/native/BUILD.gn | 8 ++++---- services/services/sa_media/client/media_client.cpp | 14 ++++++++++++-- services/utils/BUILD.gn | 2 +- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/interfaces/inner_api/native/BUILD.gn b/interfaces/inner_api/native/BUILD.gn index 10b2a4ae0..047f7dc50 100644 --- a/interfaces/inner_api/native/BUILD.gn +++ b/interfaces/inner_api/native/BUILD.gn @@ -62,6 +62,7 @@ config("media_client_base_config") { "$MEDIA_ROOT_DIR/interfaces/inner_api/native", "$MEDIA_ROOT_DIR/services/include", "$MEDIA_ROOT_DIR/services/utils/include", + "$MEDIA_ROOT_DIR/services/services/engine_intf", ] cflags = [ @@ -79,11 +80,8 @@ config("media_client_base_config") { "-Wformat=2", "-Wfloat-equal", "-Wdate-time", - "-Werror", - "-Wextra", - "-Wimplicit-fallthrough", "-Wsign-compare", - "-Wunused-parameter", + "-Who-unused-but-set-variable", ] if (target_cpu == "arm") { @@ -204,6 +202,8 @@ ohos_shared_library("media_client") { deps = [ "$MEDIA_ROOT_DIR/services/utils:media_service_utils" ] external_deps = [ + "access_token:libaccesstoken_sdk", + "access_token:libtokenid_sdk", "audio_framework:audio_client", "av_codec:av_codec_client", "c_utils:utils", diff --git a/services/services/sa_media/client/media_client.cpp b/services/services/sa_media/client/media_client.cpp index fb4ea9e5a..fab3d1341 100644 --- a/services/services/sa_media/client/media_client.cpp +++ b/services/services/sa_media/client/media_client.cpp @@ -18,6 +18,7 @@ #include "iservice_registry.h" #include "system_ability_definition.h" #include "ipc_skeleton.h" +#include "accesstoken_kit.h" #include "i_standard_monitor_service.h" #include "monitor_client.h" #include @@ -46,6 +47,7 @@ #include "media_log.h" #include "media_errors.h" #include "player_xcollie.h" +#include "media_utils.h" namespace { constexpr OHOS::HiviewDFX::HiLogLabel LABEL = {LOG_CORE, LOG_DOMAIN_PLAYER, "MediaClient"}; @@ -234,8 +236,16 @@ std::shared_ptr MediaClient::CreatePlayerService() CreateMediaServiceInstance(IStandardMediaService::MediaSystemAbility::MEDIA_PLAYER, object, lock); #else CHECK_AND_RETURN_RET_LOG(IsAlived(), nullptr, "media service does not exist."); - object = mediaProxy_->GetSubSystemAbilityWithTimeOut( - IStandardMediaService::MediaSystemAbility::MEDIA_PLAYER, listenerStub_->AsObject(), MAX_WAIT_TIME); + auto playerAbility = IStandardMediaService::MediaSystemAbility::MEDIA_PLAYER; + std::string bundleName = GetClientBundleName(getuid()); + bool isHuaweiAppGallery = false; + if (bundleName.find("appgallery") != std::string::npos) { + uint64_t tokenId = IPCSkeleton::GetCallingFullTokenID(); + isHuaweiAppGallery = OHOS::Security::AccessToken::AccessTokenKit::IsSystemAppByFullTokenID(tokenId); + } + object = isHuaweiAppGallery? + mediaProxy_ -> GetSubSystemAbility(playerAbility, listenerStub_->AsObject()) + : mediaProxy_ ->GetSubSystemAbilityWithTimeOut(playerAbility, listenerStub_->AsObject(), MAX_WAIT_TIME); #endif CHECK_AND_RETURN_RET_LOG(object != nullptr, nullptr, "player proxy object is nullptr."); diff --git a/services/utils/BUILD.gn b/services/utils/BUILD.gn index 37c4cfd40..601a7516c 100644 --- a/services/utils/BUILD.gn +++ b/services/utils/BUILD.gn @@ -46,7 +46,7 @@ ohos_shared_library("media_service_utils") { include_dirs = [ "//foundation/multimedia/player_framework/interfaces/inner_api/native", - "$MEDIA_PLAYER_ROOT_DIR/services/services/engine_intf", + "//foundation/multimedia/player_framework/services/services/engine_intf", ] defines = [ "MEDIA_OHOS" ] -- Gitee From 0078c280bfa6ca75d5f9030c90ca5f7fe4bc8d70 Mon Sep 17 00:00:00 2001 From: wxkkk Date: Wed, 20 Aug 2025 12:59:00 +0800 Subject: [PATCH 2/8] =?UTF-8?q?test=E9=87=8C=E6=B7=BB=E5=8A=A0=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E8=B7=AF=E5=BE=84=20Signed-off-by:=20wxkkk=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/unittest/avmetadatahelper_test/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/test/unittest/avmetadatahelper_test/BUILD.gn b/test/unittest/avmetadatahelper_test/BUILD.gn index fc9a6f0b2..60f13dfef 100644 --- a/test/unittest/avmetadatahelper_test/BUILD.gn +++ b/test/unittest/avmetadatahelper_test/BUILD.gn @@ -88,6 +88,7 @@ ohos_unittest("avmetadatahelper_unit_test") { "$MEDIA_PLAYER_ROOT_DIR/services/services/avmetadatahelper/client", "$MEDIA_PLAYER_ROOT_DIR/services/services/avmetadatahelper/ipc", "$MEDIA_PLAYER_ROOT_DIR/services/services/common", + "$MEDIA_PLAYER_ROOT_DIR/services/services/engine_intf", ] if (player_framework_support_avsession_background) { -- Gitee From a73dbc068f4be03926f009e5eeed39509d764bf2 Mon Sep 17 00:00:00 2001 From: wxkkk Date: Wed, 20 Aug 2025 17:44:02 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E5=BD=93=E5=AE=A2=E6=88=B7=E7=AB=AF?= =?UTF-8?q?=E4=B8=BA=E5=BA=94=E7=94=A8=E5=B8=82=E5=9C=BA=E6=97=B6=EF=BC=8C?= =?UTF-8?q?IPC=E8=AF=B7=E6=B1=82=E6=94=B9=E4=B8=BA=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=20Signed-off-by:=20wxkkk=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frameworks/native/avmetadatahelper/test/unittest/BUILD.gn | 1 + test/unittest/avmetadatahelper_test/BUILD.gn | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/native/avmetadatahelper/test/unittest/BUILD.gn b/frameworks/native/avmetadatahelper/test/unittest/BUILD.gn index bce9c3ed4..1b064fe57 100644 --- a/frameworks/native/avmetadatahelper/test/unittest/BUILD.gn +++ b/frameworks/native/avmetadatahelper/test/unittest/BUILD.gn @@ -24,6 +24,7 @@ ohos_unittest("avmetadata_unit_test") { "//foundation/multimedia/player_framework/services/utils/include", "//foundation/multimedia/player_framework/frameworks/native/player", "//foundation/multimedia/player_framework/test/unittest/common/include", + "//foundation/multimedia/player_framework/services/services/engine_intf", ] cflags = [ diff --git a/test/unittest/avmetadatahelper_test/BUILD.gn b/test/unittest/avmetadatahelper_test/BUILD.gn index 60f13dfef..fc9a6f0b2 100644 --- a/test/unittest/avmetadatahelper_test/BUILD.gn +++ b/test/unittest/avmetadatahelper_test/BUILD.gn @@ -88,7 +88,6 @@ ohos_unittest("avmetadatahelper_unit_test") { "$MEDIA_PLAYER_ROOT_DIR/services/services/avmetadatahelper/client", "$MEDIA_PLAYER_ROOT_DIR/services/services/avmetadatahelper/ipc", "$MEDIA_PLAYER_ROOT_DIR/services/services/common", - "$MEDIA_PLAYER_ROOT_DIR/services/services/engine_intf", ] if (player_framework_support_avsession_background) { -- Gitee From 044d3075e8b4f4478a116877de158a564039445f Mon Sep 17 00:00:00 2001 From: wxkkk Date: Wed, 20 Aug 2025 18:08:28 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E5=BC=95=E7=94=A8=E5=A4=B4=E6=96=87?= =?UTF-8?q?=E4=BB=B6=20Signed-off-by:=20wxkkk=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frameworks/native/avmetadatahelper/test/unittest/BUILD.gn | 1 - 1 file changed, 1 deletion(-) diff --git a/frameworks/native/avmetadatahelper/test/unittest/BUILD.gn b/frameworks/native/avmetadatahelper/test/unittest/BUILD.gn index 1b064fe57..bce9c3ed4 100644 --- a/frameworks/native/avmetadatahelper/test/unittest/BUILD.gn +++ b/frameworks/native/avmetadatahelper/test/unittest/BUILD.gn @@ -24,7 +24,6 @@ ohos_unittest("avmetadata_unit_test") { "//foundation/multimedia/player_framework/services/utils/include", "//foundation/multimedia/player_framework/frameworks/native/player", "//foundation/multimedia/player_framework/test/unittest/common/include", - "//foundation/multimedia/player_framework/services/services/engine_intf", ] cflags = [ -- Gitee From ccd645f34597dfea94c1b5756127bf9b33ebe206 Mon Sep 17 00:00:00 2001 From: wxkkk Date: Sat, 30 Aug 2025 04:20:19 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=9C=A8=E6=B5=8B=E8=AF=95=E4=B8=AD?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wxkkk --- test/unittest/native_avmetadatahelper_unittest/BUILD.gn | 1 + 1 file changed, 1 insertion(+) diff --git a/test/unittest/native_avmetadatahelper_unittest/BUILD.gn b/test/unittest/native_avmetadatahelper_unittest/BUILD.gn index 768c1355a..c37167c2a 100644 --- a/test/unittest/native_avmetadatahelper_unittest/BUILD.gn +++ b/test/unittest/native_avmetadatahelper_unittest/BUILD.gn @@ -46,6 +46,7 @@ ohos_unittest("avmetadata_unittest") { "//foundation/multimedia/player_framework/services/services/screen_capture_monitor/server", "//foundation/multimedia/player_framework/services/services/transcoder/client", "//foundation/multimedia/player_framework/services/services/transcoder/ipc", + "//foundation/multimedia/player_framework/services/services/engine_intf", "//foundation/multimedia/player_framework/services/utils/include", "//foundation/multimedia/player_framework/frameworks/native/avmetadatahelper", "//foundation/multimedia/player_framework/frameworks/native/media_source_loading_request", -- Gitee From 59f458d514f498c65f048cea08f6653d51f227c5 Mon Sep 17 00:00:00 2001 From: wxkkk Date: Sat, 30 Aug 2025 13:34:06 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wxkkk --- test/unittest/native_avmetadatahelper_unittest/BUILD.gn | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/unittest/native_avmetadatahelper_unittest/BUILD.gn b/test/unittest/native_avmetadatahelper_unittest/BUILD.gn index c37167c2a..b6bd72553 100644 --- a/test/unittest/native_avmetadatahelper_unittest/BUILD.gn +++ b/test/unittest/native_avmetadatahelper_unittest/BUILD.gn @@ -132,6 +132,10 @@ ohos_unittest("avmetadata_unittest") { "window_manager:libwm", ] + if (player_framework_support_drm) { + external_deps += [ "drm_framework:drm_framework" ] + } + deps = [ "//foundation/multimedia/player_framework/interfaces/inner_api/native:media_client", "//foundation/multimedia/player_framework/services/utils:media_service_utils", -- Gitee From 9fe599f2f8a9f6b0c06eac74b14cf62d497b861c Mon Sep 17 00:00:00 2001 From: wxkkk Date: Fri, 5 Sep 2025 00:39:55 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E4=B8=BA?= =?UTF-8?q?=E5=8D=8E=E4=B8=BA=E5=BA=94=E7=94=A8=E5=B8=82=E5=9C=BA=E6=97=B6?= =?UTF-8?q?=EF=BC=8Cipc=E5=8F=98=E4=B8=BA=E5=90=8C=E6=AD=A5=E8=AF=B7?= =?UTF-8?q?=E6=B1=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wxkkk --- services/services/sa_media/client/media_client.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/services/sa_media/client/media_client.cpp b/services/services/sa_media/client/media_client.cpp index fab3d1341..878f1c3f3 100644 --- a/services/services/sa_media/client/media_client.cpp +++ b/services/services/sa_media/client/media_client.cpp @@ -238,12 +238,12 @@ std::shared_ptr MediaClient::CreatePlayerService() CHECK_AND_RETURN_RET_LOG(IsAlived(), nullptr, "media service does not exist."); auto playerAbility = IStandardMediaService::MediaSystemAbility::MEDIA_PLAYER; std::string bundleName = GetClientBundleName(getuid()); - bool isHuaweiAppGallery = false; + bool isSysAppGallery = false; if (bundleName.find("appgallery") != std::string::npos) { uint64_t tokenId = IPCSkeleton::GetCallingFullTokenID(); - isHuaweiAppGallery = OHOS::Security::AccessToken::AccessTokenKit::IsSystemAppByFullTokenID(tokenId); + isSysAppGallery = OHOS::Security::AccessToken::AccessTokenKit::IsSystemAppByFullTokenID(tokenId); } - object = isHuaweiAppGallery? + object = isSysAppGallery? mediaProxy_ -> GetSubSystemAbility(playerAbility, listenerStub_->AsObject()) : mediaProxy_ ->GetSubSystemAbilityWithTimeOut(playerAbility, listenerStub_->AsObject(), MAX_WAIT_TIME); #endif -- Gitee From 32c163f822f8d5578018cabdb4998fd0660302cb Mon Sep 17 00:00:00 2001 From: wxkkk Date: Fri, 5 Sep 2025 04:47:59 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E5=88=A0=E6=8E=89=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E5=90=8D=E5=AD=97=E5=9F=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wxkkk --- services/services/sa_media/client/media_client.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/services/sa_media/client/media_client.cpp b/services/services/sa_media/client/media_client.cpp index 878f1c3f3..af1bf5b0a 100644 --- a/services/services/sa_media/client/media_client.cpp +++ b/services/services/sa_media/client/media_client.cpp @@ -241,7 +241,7 @@ std::shared_ptr MediaClient::CreatePlayerService() bool isSysAppGallery = false; if (bundleName.find("appgallery") != std::string::npos) { uint64_t tokenId = IPCSkeleton::GetCallingFullTokenID(); - isSysAppGallery = OHOS::Security::AccessToken::AccessTokenKit::IsSystemAppByFullTokenID(tokenId); + isSysAppGallery = Security::AccessToken::AccessTokenKit::IsSystemAppByFullTokenID(tokenId); } object = isSysAppGallery? mediaProxy_ -> GetSubSystemAbility(playerAbility, listenerStub_->AsObject()) -- Gitee