From 38b0fef2bc0ac145bb5b398870a6d9c30ccd5cb9 Mon Sep 17 00:00:00 2001 From: John Lin Date: Sat, 11 Feb 2023 01:48:59 +0000 Subject: [PATCH] Bug 1815553 - follow the naming convention of existing code (mf -> wmf). r=alwu Differential Revision: https://phabricator.services.mozilla.com/D169401 --- dom/media/eme/EMEUtils.cpp | 4 ++-- dom/media/eme/EMEUtils.h | 2 +- dom/media/eme/KeySystemConfig.cpp | 6 +++--- dom/media/eme/KeySystemNames.h | 2 +- dom/media/eme/MediaKeySystemAccess.cpp | 4 ++-- dom/media/eme/MediaKeySystemAccessManager.cpp | 2 +- dom/media/eme/MediaKeys.cpp | 4 ++-- dom/media/eme/moz.build | 2 +- dom/media/ipc/PRemoteDecoderManager.ipdl | 6 +++--- dom/media/ipc/RemoteDecoderManagerChild.cpp | 4 ++-- dom/media/ipc/RemoteDecoderManagerParent.cpp | 6 +++--- dom/media/ipc/moz.build | 2 +- modules/libpref/init/StaticPrefList.yaml | 2 +- toolkit/moz.configure | 12 ++++++------ 14 files changed, 29 insertions(+), 29 deletions(-) diff --git a/dom/media/eme/EMEUtils.cpp b/dom/media/eme/EMEUtils.cpp index 78a6a46b63b27..f70e158b60b76 100644 --- a/dom/media/eme/EMEUtils.cpp +++ b/dom/media/eme/EMEUtils.cpp @@ -65,7 +65,7 @@ bool IsWidevineKeySystem(const nsAString& aKeySystem) { return aKeySystem.EqualsLiteral(kWidevineKeySystemName); } -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM bool IsPlayReadyKeySystem(const nsAString& aKeySystem) { return aKeySystem.EqualsLiteral(kPlayReadyKeySystemName) || aKeySystem.EqualsLiteral(kPlayReadyKeySystemNameDeprecated); @@ -79,7 +79,7 @@ nsString KeySystemToProxyName(const nsAString& aKeySystem) { if (IsWidevineKeySystem(aKeySystem)) { return u"gmp-widevinecdm"_ns; } -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM if (IsPlayReadyKeySystem(aKeySystem)) { return u"mfcdm-playready"_ns; } diff --git a/dom/media/eme/EMEUtils.h b/dom/media/eme/EMEUtils.h index c110278801fd7..0bdbf6cc9304c 100644 --- a/dom/media/eme/EMEUtils.h +++ b/dom/media/eme/EMEUtils.h @@ -82,7 +82,7 @@ bool IsClearkeyKeySystem(const nsAString& aKeySystem); bool IsWidevineKeySystem(const nsAString& aKeySystem); -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM bool IsPlayReadyKeySystem(const nsAString& aKeySystem); #endif diff --git a/dom/media/eme/KeySystemConfig.cpp b/dom/media/eme/KeySystemConfig.cpp index 8a60d0e0031e4..d26a5bc294c5b 100644 --- a/dom/media/eme/KeySystemConfig.cpp +++ b/dom/media/eme/KeySystemConfig.cpp @@ -20,7 +20,7 @@ # include "nsMimeTypes.h" #endif -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM # include "mediafoundation/WMFCDMImpl.h" #endif @@ -40,7 +40,7 @@ bool KeySystemConfig::Supports(const nsAString& aKeySystem) { return true; } #endif -#if MOZ_MF_CDM +#if MOZ_WMF_CDM if (IsPlayReadyKeySystem(aKeySystem) && WMFCDMImpl::Supports(aKeySystem)) { return true; } @@ -175,7 +175,7 @@ bool KeySystemConfig::GetConfig(const nsAString& aKeySystem, #endif return true; } -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM if (IsPlayReadyKeySystem(aKeySystem)) { RefPtr cdm = MakeRefPtr(aKeySystem); return cdm->GetCapabilities(aConfig); diff --git a/dom/media/eme/KeySystemNames.h b/dom/media/eme/KeySystemNames.h index 1c689ced3ad90..69d2cba3faf8d 100644 --- a/dom/media/eme/KeySystemNames.h +++ b/dom/media/eme/KeySystemNames.h @@ -21,7 +21,7 @@ inline constexpr char kClearKeyKeySystemName[] = "org.w3.clearkey"; inline constexpr char kClearKeyWithProtectionQueryKeySystemName[] = "org.mozilla.clearkey_with_protection_query"; inline constexpr char kWidevineKeySystemName[] = "com.widevine.alpha"; -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM // https://learn.microsoft.com/en-us/playready/overview/key-system-strings inline constexpr char kPlayReadyKeySystemName[] = "com.microsoft.playready.recommendation"; diff --git a/dom/media/eme/MediaKeySystemAccess.cpp b/dom/media/eme/MediaKeySystemAccess.cpp index 824412f8fbf59..86ce6573d638e 100644 --- a/dom/media/eme/MediaKeySystemAccess.cpp +++ b/dom/media/eme/MediaKeySystemAccess.cpp @@ -123,7 +123,7 @@ MediaKeySystemStatus MediaKeySystemAccess::GetKeySystemStatus( } } -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM if (IsPlayReadyKeySystem(aKeySystem)) { if (!StaticPrefs::media_eme_playready_enabled()) { aOutMessage = "PlayReady EME disabled"_ns; @@ -168,7 +168,7 @@ static nsTArray GetSupportedKeySystems() { const nsTArray keySystemNames{ NS_ConvertUTF8toUTF16(kClearKeyKeySystemName), NS_ConvertUTF8toUTF16(kWidevineKeySystemName), -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM NS_ConvertUTF8toUTF16(kPlayReadyKeySystemName), NS_ConvertUTF8toUTF16(kPlayReadyKeySystemNameDeprecated), #endif diff --git a/dom/media/eme/MediaKeySystemAccessManager.cpp b/dom/media/eme/MediaKeySystemAccessManager.cpp index 706ea7d908122..708f15b8980b7 100644 --- a/dom/media/eme/MediaKeySystemAccessManager.cpp +++ b/dom/media/eme/MediaKeySystemAccessManager.cpp @@ -376,7 +376,7 @@ void MediaKeySystemAccessManager::RequestMediaKeySystemAccess( // agent, reject promise with a NotSupportedError. String comparison is // case-sensitive. if (!IsWidevineKeySystem(aRequest->mKeySystem) && -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM !IsPlayReadyKeySystem(aRequest->mKeySystem) && #endif !IsClearkeyKeySystem(aRequest->mKeySystem)) { diff --git a/dom/media/eme/MediaKeys.cpp b/dom/media/eme/MediaKeys.cpp index ebefbd7e5736b..0244abcf7e10d 100644 --- a/dom/media/eme/MediaKeys.cpp +++ b/dom/media/eme/MediaKeys.cpp @@ -36,7 +36,7 @@ #ifdef XP_WIN # include "mozilla/WindowsVersion.h" #endif -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM # include "mozilla/WMFCDMProxy.h" #endif @@ -438,7 +438,7 @@ already_AddRefed MediaKeys::CreateCDMProxy() { mConfig.mPersistentState == MediaKeysRequirement::Required); } else #endif -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM if (IsPlayReadyKeySystem(mKeySystem)) { proxy = new WMFCDMProxy( this, mKeySystem, diff --git a/dom/media/eme/moz.build b/dom/media/eme/moz.build index 8af089e580736..76059a2790a70 100644 --- a/dom/media/eme/moz.build +++ b/dom/media/eme/moz.build @@ -46,7 +46,7 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "android": DIRS += ["mediadrm"] LOCAL_INCLUDES += ["/dom/media/platforms/android"] -if CONFIG["MOZ_MF_CDM"]: +if CONFIG["MOZ_WMF_CDM"]: DIRS += ["mediafoundation"] include("/ipc/chromium/chromium-config.mozbuild") diff --git a/dom/media/ipc/PRemoteDecoderManager.ipdl b/dom/media/ipc/PRemoteDecoderManager.ipdl index 5e46a3fb63eef..557a7ba68d6c6 100644 --- a/dom/media/ipc/PRemoteDecoderManager.ipdl +++ b/dom/media/ipc/PRemoteDecoderManager.ipdl @@ -6,7 +6,7 @@ #ifdef MOZ_WMF_MEDIA_ENGINE include protocol PMFMediaEngine; #endif -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM include protocol PMFCDM; #endif @@ -45,7 +45,7 @@ sync protocol PRemoteDecoderManager #ifdef MOZ_WMF_MEDIA_ENGINE manages PMFMediaEngine; #endif -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM manages PMFCDM; #endif @@ -53,7 +53,7 @@ parent: #ifdef MOZ_WMF_MEDIA_ENGINE async PMFMediaEngine(); #endif -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM async PMFCDM(nsString keySystem); #endif async PRemoteDecoder(RemoteDecoderInfoIPDL info, diff --git a/dom/media/ipc/RemoteDecoderManagerChild.cpp b/dom/media/ipc/RemoteDecoderManagerChild.cpp index ddfdf46653e10..4745cfd3d0df3 100644 --- a/dom/media/ipc/RemoteDecoderManagerChild.cpp +++ b/dom/media/ipc/RemoteDecoderManagerChild.cpp @@ -29,7 +29,7 @@ # include "MFMediaEngineChild.h" #endif -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM # include "MFCDMChild.h" #endif @@ -704,7 +704,7 @@ PMFCDMChild* RemoteDecoderManagerChild::AllocPMFCDMChild(const nsAString&) { } bool RemoteDecoderManagerChild::DeallocPMFCDMChild(PMFCDMChild* actor) { -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM static_cast(actor)->IPDLActorDestroyed(); #endif return true; diff --git a/dom/media/ipc/RemoteDecoderManagerParent.cpp b/dom/media/ipc/RemoteDecoderManagerParent.cpp index 86a3dc58237cd..39f422fd726d3 100644 --- a/dom/media/ipc/RemoteDecoderManagerParent.cpp +++ b/dom/media/ipc/RemoteDecoderManagerParent.cpp @@ -28,7 +28,7 @@ # include "MFMediaEngineParent.h" #endif -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM # include "MFCDMParent.h" #endif @@ -259,7 +259,7 @@ bool RemoteDecoderManagerParent::DeallocPMFMediaEngineParent( PMFCDMParent* RemoteDecoderManagerParent::AllocPMFCDMParent( const nsAString& aKeySystem) { -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM return new MFCDMParent(aKeySystem, this, sRemoteDecoderManagerParentThread); #else return nullptr; @@ -267,7 +267,7 @@ PMFCDMParent* RemoteDecoderManagerParent::AllocPMFCDMParent( } bool RemoteDecoderManagerParent::DeallocPMFCDMParent(PMFCDMParent* actor) { -#ifdef MOZ_MF_CDM +#ifdef MOZ_WMF_CDM static_cast(actor)->Destroy(); #endif return true; diff --git a/dom/media/ipc/moz.build b/dom/media/ipc/moz.build index 43eb9a44dc7d8..26f76363560ff 100644 --- a/dom/media/ipc/moz.build +++ b/dom/media/ipc/moz.build @@ -74,7 +74,7 @@ if CONFIG["MOZ_WMF_MEDIA_ENGINE"]: "../platforms/wmf", ] -if CONFIG["MOZ_MF_CDM"]: +if CONFIG["MOZ_WMF_CDM"]: IPDL_SOURCES += [ "PMFCDM.ipdl", ] diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index b017ff46d6e2b..0cd32d65bf9c5 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -10157,7 +10157,7 @@ # Enable PlayReady DRM for EME - name: media.eme.playready.enabled type: RelaxedAtomicBool -#if defined(MOZ_MF_CDM) && defined(NIGHTLY_BUILD) +#if defined(MOZ_WMF_CDM) && defined(NIGHTLY_BUILD) value: false # TODO: enable this when ready to play. #else value: false diff --git a/toolkit/moz.configure b/toolkit/moz.configure index 966ce0ed11fbc..78f3112885392 100644 --- a/toolkit/moz.configure +++ b/toolkit/moz.configure @@ -670,19 +670,19 @@ set_define("MOZ_WMF", wmf) set_config("MOZ_WMF_MEDIA_ENGINE", True, when=wmfmediaengine) set_define("MOZ_WMF_MEDIA_ENGINE", True, when=wmfmediaengine) -# PlayReady CDM support +# Media Foundation CDM support # ============================================================== -option("--disable-mf-cdm", help="Disable support for Media Foundation CDM") +option("--disable-wmf-cdm", help="Disable support for Media Foundation CDM") -@depends("--enable-mf-cdm", when=wmfmediaengine) -def mfcdm(value): +@depends("--enable-wmf-cdm", when=wmfmediaengine) +def wmfcdm(value): if value: return True -set_config("MOZ_MF_CDM", True, when=mfcdm) -set_define("MOZ_MF_CDM", True, when=mfcdm) +set_config("MOZ_WMF_CDM", True, when=wmfcdm) +set_define("MOZ_WMF_CDM", True, when=wmfcdm) # FFmpeg H264/AAC Decoding Support # ==============================================================