mirror of
https://github.com/openharmony/multimedia_drm_framework.git
synced 2026-07-01 02:07:09 -04:00
补充clearplay1.1插件升级
Signed-off-by: m0_54007497 <liyangyang87@h-partners.com>
This commit is contained in:
@@ -68,6 +68,7 @@ ohos_fuzztest("drmserviceFuzzTest") {
|
||||
"bundle_framework:appexecfwk_core",
|
||||
"c_utils:utils",
|
||||
"drivers_interface_drm:libdrm_proxy_1.0",
|
||||
"drivers_interface_drm:libdrm_proxy_1.1",
|
||||
"hdf_core:libhdf_host",
|
||||
"hdf_core:libhdf_ipc_adapter",
|
||||
"hdf_core:libhdf_utils",
|
||||
|
||||
@@ -53,6 +53,7 @@ ohos_shared_library("drm_service") {
|
||||
"c_utils:utils",
|
||||
"data_share:datashare_consumer",
|
||||
"drivers_interface_drm:libdrm_proxy_1.0",
|
||||
"drivers_interface_drm:libdrm_proxy_1.1",
|
||||
"hdf_core:libhdf_host",
|
||||
"hdf_core:libhdf_ipc_adapter",
|
||||
"hdf_core:libhdf_utils",
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include "iservstat_listener_hdi.h"
|
||||
#include "v1_0/media_key_system_factory_proxy.h"
|
||||
#include "v1_0/media_key_system_proxy.h"
|
||||
#include "v1_1/media_key_system_factory_proxy.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace DrmStandard {
|
||||
@@ -110,6 +111,8 @@ public:
|
||||
void OnDrmPluginDied(std::string &name);
|
||||
void SetIsNetWork(const bool &isNetWork);
|
||||
bool GetIsNetWork();
|
||||
void SetBundleName(const std::string &BundleName);
|
||||
std::string GetBundleName();
|
||||
private:
|
||||
static void UnLoadOEMCertifaicateService(std::string &name, ExtraInfo info);
|
||||
static void GetHttpProxyParameter(std::string &host, int32_t &port, std::list<std::string> &exclusionList);
|
||||
@@ -136,6 +139,7 @@ private:
|
||||
std::string QueryBasicStatement();
|
||||
void WaitForNetwork();
|
||||
|
||||
std::string bundleName_;
|
||||
StatusCallback *statusCallback_;
|
||||
std::map<void *, sptr<IMediaKeySystem>> handleAndKeySystemMap;
|
||||
std::thread serviceThread;
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
|
||||
#include "v1_0/media_key_system_factory_proxy.h"
|
||||
#include "v1_0/media_key_system_proxy.h"
|
||||
#include "v1_1/media_key_system_factory_proxy.h"
|
||||
|
||||
namespace OHOS {
|
||||
namespace DrmStandard {
|
||||
|
||||
@@ -677,8 +677,17 @@ int32_t DrmHostManager::CreateMediaKeySystem(std::string &name, sptr<IMediaKeySy
|
||||
DRM_ERR_LOG("CreateMediaKeySystem faild.");
|
||||
return DRM_INNER_ERR_PLUGIN_ERROR;
|
||||
}
|
||||
|
||||
ret = drmHostServieProxys->CreateMediaKeySystem(hdiMediaKeySystem);
|
||||
auto drmHostServiceProxy_1_1 = OHOS::HDI::Drm::V1_1::IMediaKeySystemFactory::CastFrom(drmHostServieProxys);
|
||||
if (drmHostServiceProxy_1_1 != nullptr) {
|
||||
DRM_INFO_LOG("proxy 1.1 enter");
|
||||
ret = drmHostServiceProxy_1_1->CreateMediaKeySystemWithBundleName(bundleName_, hdiMediaKeySystem);
|
||||
hdiMediaKeySystemFactoryAndPluginNameMap[drmHostServiceProxy_1_1] = name;
|
||||
hdiMediaKeySystemFactoryAndPluginNameMap.erase(drmHostServieProxys);
|
||||
drmHostServieProxys = drmHostServiceProxy_1_1;
|
||||
} else {
|
||||
DRM_INFO_LOG("proxy 1.0 enter");
|
||||
ret = drmHostServieProxys->CreateMediaKeySystem(hdiMediaKeySystem);
|
||||
}
|
||||
if (ret != DRM_INNER_ERR_OK) {
|
||||
hdiMediaKeySystem = nullptr;
|
||||
ReleaseSevices(drmHostServieProxys);
|
||||
@@ -811,5 +820,15 @@ bool DrmHostManager::GetIsNetWork()
|
||||
{
|
||||
return this->isNetWork;
|
||||
}
|
||||
|
||||
void DrmHostManager::SetBundleName(const std::string &bundleName)
|
||||
{
|
||||
this->bundleName_ = bundleName;
|
||||
}
|
||||
|
||||
std::string DrmHostManager::GetBundleName()
|
||||
{
|
||||
return this->bundleName_;
|
||||
}
|
||||
} // namespace DrmStandard
|
||||
} // namespace OHOS
|
||||
|
||||
@@ -258,6 +258,8 @@ int32_t MediaKeySystemFactoryService::CreateMediaKeySystem(const std::string &na
|
||||
return DRM_INNER_ERR_MAX_SYSTEM_NUM_REACHED;
|
||||
}
|
||||
std::string systemName = name;
|
||||
std::string bundleName = GetClientBundleName(IPCSkeleton::GetCallingUid());
|
||||
drmHostManager_->SetBundleName(bundleName);
|
||||
int32_t ret = drmHostManager_->CreateMediaKeySystem(systemName, hdiMediaKeySystem);
|
||||
if (hdiMediaKeySystem == nullptr || ret != DRM_INNER_ERR_OK) {
|
||||
DRM_ERR_LOG("drmHostManager_ return hdiMediaKeySystem nullptr.");
|
||||
|
||||
Reference in New Issue
Block a user