Bug 1075182 - Package and load ClearKey Content Decryption Module at startup - r=Unfocused

This commit is contained in:
Edwin Flores 2014-11-12 11:33:28 +13:00
Родитель ea908adf75
Коммит 293e18a4d3
2 изменённых файлов: 21 добавлений и 0 удалений

Просмотреть файл

@ -922,3 +922,10 @@ bin/libfreebl_32int64_3.so
@BINPATH@/clang_rt.asan_dynamic-i386.dll @BINPATH@/clang_rt.asan_dynamic-i386.dll
#endif #endif
#endif #endif
; media
#ifdef MOZ_EME
@BINPATH@/gmp-clearkey/0.1/@DLL_PREFIX@clearkey@DLL_SUFFIX@
@BINPATH@/gmp-clearkey/0.1/clearkey.info
#endif

Просмотреть файл

@ -26,6 +26,10 @@ const STRING_TYPE_NAME = "type.%ID%.name";
const SEC_IN_A_DAY = 24 * 60 * 60; const SEC_IN_A_DAY = 24 * 60 * 60;
const EME_PREF_ENABLED = "media.eme.enabled";
const CLEARKEY_PLUGIN_ID = "gmp-clearkey";
const CLEARKEY_VERSION = "0.1";
const OPENH264_PLUGIN_ID = "gmp-gmpopenh264"; const OPENH264_PLUGIN_ID = "gmp-gmpopenh264";
const OPENH264_PREF_BRANCH = "media." + OPENH264_PLUGIN_ID + "."; const OPENH264_PREF_BRANCH = "media." + OPENH264_PLUGIN_ID + ".";
const OPENH264_PREF_ENABLED = "enabled"; const OPENH264_PREF_ENABLED = "enabled";
@ -277,6 +281,16 @@ let OpenH264Provider = {
} }
} }
if (Preferences.get(EME_PREF_ENABLED, false)) {
try {
gmpService.addPluginDirectory(OS.Path.join(OS.Constants.Path.libDir,
CLEARKEY_PLUGIN_ID,
CLEARKEY_VERSION));
} catch (e) {
this._log.warn("startup() - adding clearkey CDM failed", e);
}
}
let telemetry = {}; let telemetry = {};
if (this.isEnabled) { if (this.isEnabled) {
telemetry[OPENH264_PLUGIN_ID] = { telemetry[OPENH264_PLUGIN_ID] = {