diff --git a/OpenCDMi/FrameworkRPC.cpp b/OpenCDMi/FrameworkRPC.cpp index 3f57918d1f..6ce58fd6d7 100644 --- a/OpenCDMi/FrameworkRPC.cpp +++ b/OpenCDMi/FrameworkRPC.cpp @@ -769,7 +769,7 @@ namespace Plugin { if (systemExt) { std::vector drmStoreHash(32); - Exchange::OCDM_RESULT hashResult = (Exchange::OCDM_RESULT) systemExt->GetSecureStoreHash(&drmStoreHash[0], drmStoreHash.size()); + Exchange::OCDM_RESULT hashResult = (Exchange::OCDM_RESULT) systemExt->GetSecureStoreHash(_keySystem, &drmStoreHash[0], drmStoreHash.size()); if (hashResult == Exchange::OCDM_SUCCESS) { ReportSecureStoreHash("StoreLicenseData", _keySystem, &drmStoreHash[0], drmStoreHash.size()); @@ -1110,7 +1110,7 @@ namespace Plugin { CDMi::IMediaKeysExt* systemExt = dynamic_cast(_parent.KeySystem(keySystem)); if (systemExt) { ODH_ERROR_REPORT_CTX_ERROR(0, "DeleteSecureStore", keySystem); - return (Exchange::OCDM_RESULT)systemExt->DeleteSecureStore(); + return (Exchange::OCDM_RESULT)systemExt->DeleteSecureStore(keySystem); } return Exchange::OCDM_RESULT::OCDM_S_FALSE; } @@ -1122,7 +1122,7 @@ namespace Plugin { { CDMi::IMediaKeysExt* systemExt = dynamic_cast(_parent.KeySystem(keySystem)); if (systemExt) { - return (Exchange::OCDM_RESULT)systemExt->GetSecureStoreHash(keyStoreHash, keyStoreHashLength); + return (Exchange::OCDM_RESULT)systemExt->GetSecureStoreHash(keySystem, keyStoreHash, keyStoreHashLength); } return Exchange::OCDM_RESULT::OCDM_S_FALSE; } @@ -1134,7 +1134,7 @@ namespace Plugin { { CDMi::IMediaKeysExt* systemExt = dynamic_cast(_parent.KeySystem(keySystem)); if (systemExt) { - Exchange::OCDM_RESULT result = (Exchange::OCDM_RESULT)systemExt->GetSecureStoreHash(secureStoreHash, secureStoreHashLength); + Exchange::OCDM_RESULT result = (Exchange::OCDM_RESULT)systemExt->GetSecureStoreHash(keySystem, secureStoreHash, secureStoreHashLength); if (result == Exchange::OCDM_SUCCESS) { ReportSecureStoreHash("GetSecureStoreHash", keySystem, secureStoreHash, secureStoreHashLength); @@ -1235,36 +1235,6 @@ namespace Plugin { Config(const Config&); Config& operator=(const Config&); - public: - class Libs : public Core::JSON::Container { - private: - Libs& operator=(const Libs&); - - public: - Libs() - : Core::JSON::Container() - , SystemName() - , LibFile() - { - Add("system_name", &SystemName); - Add("lib_file", &LibFile); - } - Libs(const Libs& copy) - : Core::JSON::Container() - , SystemName(copy.SystemName) - , LibFile(copy.LibFile) - { - Add("system_name", &SystemName); - Add("lib_file", &LibFile); - } - - virtual ~Libs() = default; - - public: - Core::JSON::String SystemName; - Core::JSON::String LibFile; - }; - public: class Systems : public Core::JSON::Container { private: @@ -1311,14 +1281,12 @@ namespace Plugin { , Connector(_T("/tmp/ocdm")) , SharePath(_T("/tmp/OCDM")) , ShareSize(8 * 1024) - , DrmLibs() , KeySystems() { Add(_T("location"), &Location); Add(_T("connector"), &Connector); Add(_T("sharepath"), &SharePath); Add(_T("sharesize"), &ShareSize); - Add(_T("drm_libs"), &DrmLibs); Add(_T("systems"), &KeySystems); } ~Config() @@ -1330,7 +1298,6 @@ namespace Plugin { Core::JSON::String Connector; Core::JSON::String SharePath; Core::JSON::DecUInt32 ShareSize; - Core::JSON::ArrayType DrmLibs; Core::JSON::ArrayType KeySystems; }; @@ -1416,12 +1383,11 @@ namespace Plugin { const string locator(_shell->DataPath() + config.Location.Value()); // Before we start loading the mapping of the Keys to the factories, load the factories :-) + Core::Directory entry(locator.c_str(), _T("*.drm")); std::map factories; - Core::JSON::ArrayType::ConstIterator libs(static_cast(config).DrmLibs.Elements()); - while (libs.Next() == true) { - const std::string libFullPath = locator + libs.Current().LibFile.Value(); - Core::Library library(libFullPath.c_str()); + while (entry.Next() == true) { + Core::Library library(entry.Current().c_str()); if (library.IsLoaded() == true) { GetDRMSystemFunction handle = reinterpret_cast(library.LoadFunction(_T("GetSystemFactory"))); @@ -1431,7 +1397,7 @@ namespace Plugin { if (entry != nullptr) { SystemFactory element; - element.Name = libs.Current().SystemName.Value().c_str(); + element.Name = Core::ClassNameOnly(entry->KeySystem()).Text(); element.Factory = entry; _keySystems.push_back(element.Name); factories.insert(std::pair(element.Name, element)); @@ -1439,7 +1405,7 @@ namespace Plugin { } } } else { - SYSLOG(Logging::Startup, (_T("Could not load factory [%s], error [%s]"), Core::File::FileNameExtended(libFullPath).c_str(), library.Error().c_str())); + SYSLOG(Logging::Startup, (_T("Could not load factory [%s], error [%s]"), Core::File::FileNameExtended(entry.Current()).c_str(), library.Error().c_str())); result = Core::ERROR_OPENING_FAILED; } } diff --git a/OpenCDMi/OCDM.config b/OpenCDMi/OCDM.config index 7553431b37..cb1acc4059 100644 --- a/OpenCDMi/OCDM.config +++ b/OpenCDMi/OCDM.config @@ -38,7 +38,6 @@ ans(rootobject) map() kv(sharepath "/tmp/OCDM") kv(connector "/tmp/OCDM/ocdm") - kv(drm_libs ___array___) kv(systems ___array___) if (NOT PLUGIN_OPENCDMI_MODE) kv(outofprocess ${PLUGIN_OPENCDMI_OOP}) @@ -46,32 +45,6 @@ map() end() ans(configuration) -if(PLUGIN_OPENCDMI_PLAYREADY OR PLUGIN_OPENCDMI_PLAYREADY_NEXUS OR PLUGIN_OPENCDMI_PLAYREADY_NEXUS_SVP OR PLUGIN_OPENCDMI_PLAYREADY_VGDRM) -map() - kv(system_name "PlayReady") - kv(lib_file "PlayReady.drm") -end() -ans(drm_lib) -map_append(${configuration} drm_libs ___array___ ${drm_lib}) -endif() - -if(PLUGIN_OPENCDMI_PLAYREADY_NETFLIX OR PLUGIN_OPENCDMI_PLAYREADY_NEXUS_NETFLIX OR PLUGIN_OPENCDMI_PLAYREADY_NEXUS_SVP_NETFLIX) -map() - kv(system_name "PlayReadyNetflix") - kv(lib_file "PlayReady.drm") -end() -ans(drm_lib) -map_append(${configuration} drm_libs ___array___ ${drm_lib}) -endif() - -if(PLUGIN_OPENCDMI_WIDEVINE OR OPENCDMI_WIDEVINE_NEXUS_SVP) -map() - kv(system_name "WideVine") - kv(lib_file "WideVine.drm") -end() -ans(drm_lib) -map_append(${configuration} drm_libs ___array___ ${drm_lib}) -endif() if(PLUGIN_OPENCDMI_CLEARKEY) map() @@ -85,7 +58,7 @@ endif() if(PLUGIN_OPENCDMI_PLAYREADY OR PLUGIN_OPENCDMI_PLAYREADY_NEXUS OR PLUGIN_OPENCDMI_PLAYREADY_NEXUS_SVP OR PLUGIN_OPENCDMI_PLAYREADY_VGDRM) map() kv(name "PlayReady") - kv(designators "com.youtube.playready;com.microsoft.playready;com.microsoft.playready.recommendation") + kv(designators "com.youtube.playready;com.microsoft.playready;com.netflix.playready;com.amazon.playready;com.disney.playready;com.microsoft.playready.recommendation") key(configuration) map() if(PLUGIN_OPENCDMI_PLAYREADY_METERING_CERTIFICATE) @@ -106,30 +79,6 @@ ans(keysystem) map_append(${configuration} systems ___array___ ${keysystem}) endif() -if(PLUGIN_OPENCDMI_PLAYREADY_NETFLIX OR PLUGIN_OPENCDMI_PLAYREADY_NEXUS_NETFLIX OR PLUGIN_OPENCDMI_PLAYREADY_NEXUS_SVP_NETFLIX) -map() - kv(name "PlayReadyNetflix") - kv(designators "___array___;com.netflix.playready") - key(configuration) - map() - if(PLUGIN_OPENCDMI_PLAYREADY_METERING_CERTIFICATE) - kv(metering ${PLUGIN_OPENCDMI_PLAYREADY_METERING_CERTIFICATE}) - endif() - if(PLUGIN_OCDM_PLAYREADY_READ_DIR) - kv(read-dir "${PLUGIN_OCDM_PLAYREADY_READ_DIR_NETFLIX}") - endif() - if(PLUGIN_OCDM_PLAYREADY_STORE_LOCATION_NETFLIX) - kv(store-location "${PLUGIN_OCDM_PLAYREADY_STORE_LOCATION_NETFLIX}") - endif() - if(PLUGIN_OPENCDMI_PLAYREADY_CERTIFICATE_LABEL) - kv(certificatelabel "${PLUGIN_OPENCDMI_PLAYREADY_CERTIFICATE_LABEL}") - endif() - end() -end() -ans(keysystem) -map_append(${configuration} systems ___array___ ${keysystem}) -endif() - if(PLUGIN_OPENCDMI_WIDEVINE OR OPENCDMI_WIDEVINE_NEXUS_SVP) map() kv(name "WideVine") diff --git a/OpenCDMi/OpenCDMiPlugin.json b/OpenCDMi/OpenCDMiPlugin.json index c7427ad658..5375dcbe2b 100644 --- a/OpenCDMi/OpenCDMiPlugin.json +++ b/OpenCDMi/OpenCDMiPlugin.json @@ -31,24 +31,6 @@ "description": "The sharesize", "type": "string" }, - "drm_libs": { - "description": "A list of DRM libs to load with assigned names that 'systems' entries can refer to", - "type": "array", - "items": { - "description": "DRM lib properties", - "type": "object", - "properties": { - "system_name": { - "description": "Name under which the loaded library can be referred by 'systems' entries", - "type": "string" - }, - "lib_file": { - "description": "*.drm file to load", - "type": "string" - } - } - } - }, "systems": { "description": "A list of key systems", "type": "array",