Skip to content

Commit

Permalink
Bug 1815553 - follow the naming convention of existing code (mf -> wm…
Browse files Browse the repository at this point in the history
…f). r=alwu

Differential Revision: https://phabricator.services.mozilla.com/D169401
  • Loading branch information
jhlin committed Feb 11, 2023
1 parent 1e64234 commit 38b0fef
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions dom/media/eme/EMEUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion dom/media/eme/EMEUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions dom/media/eme/KeySystemConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# include "nsMimeTypes.h"
#endif

#ifdef MOZ_MF_CDM
#ifdef MOZ_WMF_CDM
# include "mediafoundation/WMFCDMImpl.h"
#endif

Expand All @@ -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;
}
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion dom/media/eme/KeySystemNames.h
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions dom/media/eme/MediaKeySystemAccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dom/media/eme/MediaKeySystemAccessManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions dom/media/eme/MediaKeys.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion dom/media/eme/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
6 changes: 3 additions & 3 deletions dom/media/ipc/PRemoteDecoderManager.ipdl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -45,15 +45,15 @@ sync protocol PRemoteDecoderManager
#ifdef MOZ_WMF_MEDIA_ENGINE
manages PMFMediaEngine;
#endif
#ifdef MOZ_MF_CDM
#ifdef MOZ_WMF_CDM
manages PMFCDM;
#endif

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,
Expand Down
4 changes: 2 additions & 2 deletions dom/media/ipc/RemoteDecoderManagerChild.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
# include "MFMediaEngineChild.h"
#endif

#ifdef MOZ_MF_CDM
#ifdef MOZ_WMF_CDM
# include "MFCDMChild.h"
#endif

Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions dom/media/ipc/RemoteDecoderManagerParent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
# include "MFMediaEngineParent.h"
#endif

#ifdef MOZ_MF_CDM
#ifdef MOZ_WMF_CDM
# include "MFCDMParent.h"
#endif

Expand Down Expand Up @@ -259,15 +259,15 @@ 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;
#endif
}

bool RemoteDecoderManagerParent::DeallocPMFCDMParent(PMFCDMParent* actor) {
#ifdef MOZ_MF_CDM
#ifdef MOZ_WMF_CDM
static_cast<MFCDMParent*>(actor)->Destroy();
#endif
return true;
Expand Down
2 changes: 1 addition & 1 deletion dom/media/ipc/moz.build
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down
2 changes: 1 addition & 1 deletion modules/libpref/init/StaticPrefList.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions toolkit/moz.configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ==============================================================
Expand Down

0 comments on commit 38b0fef

Please sign in to comment.