From 0fb5f7a158e0a5a610e1ba85cf408525964d746e Mon Sep 17 00:00:00 2001 From: adeshkp Date: Sat, 9 Nov 2019 21:42:45 +0530 Subject: Issue #1259 - Part 1. Remove Adobe Primetime support from tree --- dom/media/VideoUtils.cpp | 1 - dom/media/VideoUtils.h | 1 - dom/media/eme/EMEUtils.cpp | 11 ----------- dom/media/eme/EMEUtils.h | 4 ---- dom/media/eme/MediaKeySystemAccess.cpp | 23 ---------------------- dom/media/eme/MediaKeySystemAccessManager.cpp | 5 ++--- dom/media/gmp/GMPParent.cpp | 10 ---------- .../platforms/agnostic/gmp/GMPDecoderModule.cpp | 2 -- 8 files changed, 2 insertions(+), 55 deletions(-) (limited to 'dom') diff --git a/dom/media/VideoUtils.cpp b/dom/media/VideoUtils.cpp index c06ba9070..56033c2fa 100644 --- a/dom/media/VideoUtils.cpp +++ b/dom/media/VideoUtils.cpp @@ -31,7 +31,6 @@ namespace mozilla { NS_NAMED_LITERAL_CSTRING(kEMEKeySystemClearkey, "org.w3.clearkey"); NS_NAMED_LITERAL_CSTRING(kEMEKeySystemWidevine, "com.widevine.alpha"); -NS_NAMED_LITERAL_CSTRING(kEMEKeySystemPrimetime, "com.adobe.primetime"); using layers::PlanarYCbCrImage; diff --git a/dom/media/VideoUtils.h b/dom/media/VideoUtils.h index aaf0e9903..eee6561fd 100644 --- a/dom/media/VideoUtils.h +++ b/dom/media/VideoUtils.h @@ -47,7 +47,6 @@ class MediaContentType; // EME Key System String. extern const nsLiteralCString kEMEKeySystemClearkey; extern const nsLiteralCString kEMEKeySystemWidevine; -extern const nsLiteralCString kEMEKeySystemPrimetime; /** * ReentrantMonitorConditionallyEnter diff --git a/dom/media/eme/EMEUtils.cpp b/dom/media/eme/EMEUtils.cpp index c248b3a24..11eb0026e 100644 --- a/dom/media/eme/EMEUtils.cpp +++ b/dom/media/eme/EMEUtils.cpp @@ -53,12 +53,6 @@ IsClearkeyKeySystem(const nsAString& aKeySystem) return !CompareUTF8toUTF16(kEMEKeySystemClearkey, aKeySystem); } -bool -IsPrimetimeKeySystem(const nsAString& aKeySystem) -{ - return !CompareUTF8toUTF16(kEMEKeySystemPrimetime, aKeySystem); -} - bool IsWidevineKeySystem(const nsAString& aKeySystem) { @@ -68,9 +62,6 @@ IsWidevineKeySystem(const nsAString& aKeySystem) nsString KeySystemToGMPName(const nsAString& aKeySystem) { - if (IsPrimetimeKeySystem(aKeySystem)) { - return NS_LITERAL_STRING("gmp-eme-adobe"); - } if (IsClearkeyKeySystem(aKeySystem)) { return NS_LITERAL_STRING("gmp-clearkey"); } @@ -88,8 +79,6 @@ ToCDMTypeTelemetryEnum(const nsString& aKeySystem) return CDMType::eWidevine; } else if (IsClearkeyKeySystem(aKeySystem)) { return CDMType::eClearKey; - } else if (IsPrimetimeKeySystem(aKeySystem)) { - return CDMType::ePrimetime; } return CDMType::eUnknown; } diff --git a/dom/media/eme/EMEUtils.h b/dom/media/eme/EMEUtils.h index 1794f8462..4a2e5da18 100644 --- a/dom/media/eme/EMEUtils.h +++ b/dom/media/eme/EMEUtils.h @@ -86,15 +86,11 @@ KeySystemToGMPName(const nsAString& aKeySystem); bool IsClearkeyKeySystem(const nsAString& aKeySystem); -bool -IsPrimetimeKeySystem(const nsAString& aKeySystem); - bool IsWidevineKeySystem(const nsAString& aKeySystem); enum CDMType { eClearKey = 0, - ePrimetime = 1, eWidevine = 2, eUnknown = 3 }; diff --git a/dom/media/eme/MediaKeySystemAccess.cpp b/dom/media/eme/MediaKeySystemAccess.cpp index 4cff464e7..4a5a7a30c 100644 --- a/dom/media/eme/MediaKeySystemAccess.cpp +++ b/dom/media/eme/MediaKeySystemAccess.cpp @@ -134,16 +134,6 @@ MediaKeySystemAccess::GetKeySystemStatus(const nsAString& aKeySystem, return EnsureCDMInstalled(aKeySystem, aOutMessage); } - if (Preferences::GetBool("media.gmp-eme-adobe.visible", false)) { - if (IsPrimetimeKeySystem(aKeySystem)) { - if (!Preferences::GetBool("media.gmp-eme-adobe.enabled", false)) { - aOutMessage = NS_LITERAL_CSTRING("Adobe EME disabled"); - return MediaKeySystemStatus::Cdm_disabled; - } - return EnsureCDMInstalled(aKeySystem, aOutMessage); - } - } - if (IsWidevineKeySystem(aKeySystem)) { if (Preferences::GetBool("media.gmp-widevinecdm.visible", false)) { if (!Preferences::GetBool("media.gmp-widevinecdm.enabled", false)) { @@ -376,19 +366,6 @@ GetSupportedKeySystems() keySystemConfigs.AppendElement(Move(widevine)); } } - { - if (HavePluginForKeySystem(kEMEKeySystemPrimetime)) { - KeySystemConfig primetime; - primetime.mKeySystem = NS_ConvertUTF8toUTF16(kEMEKeySystemPrimetime); - primetime.mInitDataTypes.AppendElement(NS_LITERAL_STRING("cenc")); - primetime.mPersistentState = KeySystemFeatureSupport::Required; - primetime.mDistinctiveIdentifier = KeySystemFeatureSupport::Required; - primetime.mSessionTypes.AppendElement(MediaKeySessionType::Temporary); - primetime.mMP4.SetCanDecryptAndDecode(EME_CODEC_AAC); - primetime.mMP4.SetCanDecryptAndDecode(EME_CODEC_H264); - keySystemConfigs.AppendElement(Move(primetime)); - } - } return keySystemConfigs; } diff --git a/dom/media/eme/MediaKeySystemAccessManager.cpp b/dom/media/eme/MediaKeySystemAccessManager.cpp index 8fefc62ec..ed31059e2 100644 --- a/dom/media/eme/MediaKeySystemAccessManager.cpp +++ b/dom/media/eme/MediaKeySystemAccessManager.cpp @@ -95,8 +95,7 @@ MediaKeySystemAccessManager::Request(DetailedPromise* aPromise, // Ensure keysystem is supported. if (!IsWidevineKeySystem(aKeySystem) && - !IsClearkeyKeySystem(aKeySystem) && - !IsPrimetimeKeySystem(aKeySystem)) { + !IsClearkeyKeySystem(aKeySystem)) { // Not to inform user, because nothing to do if the keySystem is not // supported. aPromise->MaybeReject(NS_ERROR_DOM_NOT_SUPPORTED_ERR, @@ -132,7 +131,7 @@ MediaKeySystemAccessManager::Request(DetailedPromise* aPromise, LogToBrowserConsole(NS_ConvertUTF8toUTF16(msg)); if (status == MediaKeySystemStatus::Cdm_not_installed && - (IsPrimetimeKeySystem(aKeySystem) || IsWidevineKeySystem(aKeySystem))) { + IsWidevineKeySystem(aKeySystem)) { // These are cases which could be resolved by downloading a new(er) CDM. // When we send the status to chrome, chrome's GMPProvider will attempt to // download or update the CDM. In AwaitInstall() we add listeners to wait diff --git a/dom/media/gmp/GMPParent.cpp b/dom/media/gmp/GMPParent.cpp index 418f14736..234ed5c05 100644 --- a/dom/media/gmp/GMPParent.cpp +++ b/dom/media/gmp/GMPParent.cpp @@ -726,16 +726,6 @@ GMPParent::ReadGMPInfoFile(nsIFile* aFile) if (cap.mAPIName.EqualsLiteral(GMP_API_DECRYPTOR)) { mCanDecrypt = true; - -#ifdef XP_WIN - // Adobe GMP doesn't work without SSE2. Check the tags to see if - // the decryptor is for the Adobe GMP, and refuse to load it if - // SSE2 isn't supported. - if (cap.mAPITags.Contains(kEMEKeySystemPrimetime) && - !mozilla::supports_sse2()) { - return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__); - } -#endif // XP_WIN } mCapabilities.AppendElement(Move(cap)); diff --git a/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp b/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp index cc53d2c93..50a5097ac 100644 --- a/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp +++ b/dom/media/platforms/agnostic/gmp/GMPDecoderModule.cpp @@ -109,7 +109,6 @@ GMPDecoderModule::PreferredGMP(const nsACString& aMimeType) if (aMimeType.EqualsLiteral("audio/mp4a-latm")) { switch (MediaPrefs::GMPAACPreferred()) { case 1: rv.emplace(kEMEKeySystemClearkey); break; - case 2: rv.emplace(kEMEKeySystemPrimetime); break; default: break; } } @@ -117,7 +116,6 @@ GMPDecoderModule::PreferredGMP(const nsACString& aMimeType) if (MP4Decoder::IsH264(aMimeType)) { switch (MediaPrefs::GMPH264Preferred()) { case 1: rv.emplace(kEMEKeySystemClearkey); break; - case 2: rv.emplace(kEMEKeySystemPrimetime); break; default: break; } } -- cgit v1.2.3 From c74e21f18764e35fe8915b3644ff2a0c7fd37c0f Mon Sep 17 00:00:00 2001 From: adeshkp Date: Sat, 9 Nov 2019 21:43:24 +0530 Subject: Issue #1259 - Part 2. Remove Adobe Primetime localization strings --- dom/locales/en-US/chrome/plugins.properties | 1 - 1 file changed, 1 deletion(-) (limited to 'dom') diff --git a/dom/locales/en-US/chrome/plugins.properties b/dom/locales/en-US/chrome/plugins.properties index fe03be59e..6fa829bf1 100644 --- a/dom/locales/en-US/chrome/plugins.properties +++ b/dom/locales/en-US/chrome/plugins.properties @@ -28,7 +28,6 @@ gmp_privacy_info=Privacy Information openH264_name=OpenH264 Video Codec provided by Cisco Systems, Inc. openH264_description2=This plugin is automatically installed by Mozilla to comply with the WebRTC specification and to enable WebRTC calls with devices that require the H.264 video codec. Visit http://www.openh264.org/ to view the codec source code and learn more about the implementation. -eme-adobe_name=Primetime Content Decryption Module provided by Adobe Systems, Incorporated eme-adobe_description=Play back protected web video. widevine_description=Widevine Content Decryption Module provided by Google Inc. -- cgit v1.2.3 From 484200b01b146e09ae24114fbd88bae64d099759 Mon Sep 17 00:00:00 2001 From: adeshkp Date: Sat, 9 Nov 2019 23:07:27 +0530 Subject: Issue #1259 - Part 5. Remove migration path for Adobe GMP storage As a cleanup task, also remove GMP storage migration for Fx 42 era. --- dom/media/gmp/GMPServiceParent.cpp | 36 ------------------------------------ 1 file changed, 36 deletions(-) (limited to 'dom') diff --git a/dom/media/gmp/GMPServiceParent.cpp b/dom/media/gmp/GMPServiceParent.cpp index 2b4831cd6..fcf9fa920 100644 --- a/dom/media/gmp/GMPServiceParent.cpp +++ b/dom/media/gmp/GMPServiceParent.cpp @@ -203,29 +203,6 @@ MoveAndOverwrite(nsIFile* aOldParentDir, } } -static void -MigratePreGecko42StorageDir(nsIFile* aOldStorageDir, - nsIFile* aNewStorageDir) -{ - MoveAndOverwrite(aOldStorageDir, aNewStorageDir, NS_LITERAL_STRING("id")); - MoveAndOverwrite(aOldStorageDir, aNewStorageDir, NS_LITERAL_STRING("storage")); -} - -static void -MigratePreGecko45StorageDir(nsIFile* aStorageDirBase) -{ - nsCOMPtr adobeStorageDir(CloneAndAppend(aStorageDirBase, NS_LITERAL_STRING("gmp-eme-adobe"))); - if (NS_WARN_IF(!adobeStorageDir)) { - return; - } - - // The base storage dir in pre-45 contained "id" and "storage" subdirs. - // We assume all storage in the base storage dir that aren't known to GMP - // storage are records for the Adobe GMP. - MoveAndOverwrite(aStorageDirBase, adobeStorageDir, NS_LITERAL_STRING("id")); - MoveAndOverwrite(aStorageDirBase, adobeStorageDir, NS_LITERAL_STRING("storage")); -} - static nsresult GMPPlatformString(nsAString& aOutPlatform) { @@ -308,19 +285,6 @@ GeckoMediaPluginServiceParent::InitStorage() return rv; } - // Prior to 42, GMP storage was stored in $profileDir/gmp/. After 42, it's - // stored in $profileDir/gmp/$platform/. So we must migrate any old records - // from the old location to the new location, for forwards compatibility. - MigratePreGecko42StorageDir(gmpDirWithoutPlatform, mStorageBaseDir); - - // Prior to 45, GMP storage was not separated by plugin. In 45 and after, - // it's stored in $profile/gmp/$platform/$gmpName. So we must migrate old - // records from the old location to the new location, for forwards - // compatibility. We assume all directories in the base storage dir that - // aren't known to GMP storage are records for the Adobe GMP, since it - // was first. - MigratePreGecko45StorageDir(mStorageBaseDir); - return GeckoMediaPluginService::Init(); } -- cgit v1.2.3 From c43b770a0399b5e03a6f6e4d2292e0408b186433 Mon Sep 17 00:00:00 2001 From: adeshkp Date: Sat, 9 Nov 2019 22:27:08 +0530 Subject: Issue #1259 - Part 7. Update tests for Adobe EME removal --- .../external/external_media_harness/testcase.py | 26 ---------------------- 1 file changed, 26 deletions(-) (limited to 'dom') diff --git a/dom/media/test/external/external_media_harness/testcase.py b/dom/media/test/external/external_media_harness/testcase.py index 56350ccd9..35a944484 100644 --- a/dom/media/test/external/external_media_harness/testcase.py +++ b/dom/media/test/external/external_media_harness/testcase.py @@ -200,19 +200,6 @@ class NetworkBandwidthTestsMixin(object): self.run_videos(timeout=120) -reset_adobe_gmp_script = """ -navigator.requestMediaKeySystemAccess('com.adobe.primetime', -[{initDataTypes: ['cenc']}]).then( - function(access) { - marionetteScriptFinished('success'); - }, - function(ex) { - marionetteScriptFinished(ex); - } -); -""" - - reset_widevine_gmp_script = """ navigator.requestMediaKeySystemAccess('com.widevine.alpha', [{initDataTypes: ['cenc']}]).then( @@ -256,21 +243,12 @@ class EMESetupMixin(object): def reset_GMP_version(self): if EMESetupMixin.version_needs_reset: with self.marionette.using_context(Marionette.CONTEXT_CHROME): - if self.marionette.get_pref('media.gmp-eme-adobe.version'): - self.marionette.reset_pref('media.gmp-eme-adobe.version') if self.marionette.get_pref('media.gmp-widevinecdm.version'): self.marionette.reset_pref('media.gmp-widevinecdm.version') with self.marionette.using_context(Marionette.CONTEXT_CONTENT): - adobe_result = self.marionette.execute_async_script( - reset_adobe_gmp_script, - script_timeout=60000) widevine_result = self.marionette.execute_async_script( reset_widevine_gmp_script, script_timeout=60000) - if not adobe_result == 'success': - raise VideoException( - 'ERROR: Resetting Adobe GMP failed {}' - .format(adobe_result)) if not widevine_result == 'success': raise VideoException( 'ERROR: Resetting Widevine GMP failed {}' @@ -351,10 +329,6 @@ class EMESetupMixin(object): 'media.eme.enabled', True), self.check_and_log_boolean_pref( 'media.mediasource.mp4.enabled', True), - self.check_and_log_boolean_pref( - 'media.gmp-eme-adobe.enabled', True), - self.check_and_log_integer_pref( - 'media.gmp-eme-adobe.version', 1), self.check_and_log_boolean_pref( 'media.gmp-widevinecdm.enabled', True), self.chceck_and_log_version_string_pref( -- cgit v1.2.3