Bug 1815553 - follow the naming convention of existing code (mf -> wmf). r=alwu

Differential Revision: https://phabricator.services.mozilla.com/D169401
This commit is contained in:
John Lin 2023-02-11 01:48:59 +00:00
parent 1e64234ac7
commit 38b0fef2bc
14 changed files with 29 additions and 29 deletions

View file

@ -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;
}

View file

@ -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

View file

@ -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<WMFCDMImpl> cdm = MakeRefPtr<WMFCDMImpl>(aKeySystem);
return cdm->GetCapabilities(aConfig);

View file

@ -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";

View file

@ -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<KeySystemConfig> GetSupportedKeySystems() {
const nsTArray<nsString> keySystemNames{
NS_ConvertUTF8toUTF16(kClearKeyKeySystemName),
NS_ConvertUTF8toUTF16(kWidevineKeySystemName),
#ifdef MOZ_MF_CDM
#ifdef MOZ_WMF_CDM
NS_ConvertUTF8toUTF16(kPlayReadyKeySystemName),
NS_ConvertUTF8toUTF16(kPlayReadyKeySystemNameDeprecated),
#endif

View file

@ -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)) {

View file

@ -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<CDMProxy> MediaKeys::CreateCDMProxy() {
mConfig.mPersistentState == MediaKeysRequirement::Required);
} else
#endif
#ifdef MOZ_MF_CDM
#ifdef MOZ_WMF_CDM
if (IsPlayReadyKeySystem(mKeySystem)) {
proxy = new WMFCDMProxy(
this, mKeySystem,

View file

@ -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")

View file

@ -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,

View file

@ -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<MFCDMChild*>(actor)->IPDLActorDestroyed();
#endif
return true;

View file

@ -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<MFCDMParent*>(actor)->Destroy();
#endif
return true;

View file

@ -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",
]

View file

@ -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

View file

@ -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
# ==============================================================