From d8bbc7858622b6d9c278469aab701ca0b609cddf Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:35:49 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- dom/media/gmp/ChromiumCDMChild.cpp | 2 +- dom/media/gmp/ChromiumCDMProxy.cpp | 9 ++++++++- dom/media/gmp/GMPChild.cpp | 11 ++++------- dom/media/gmp/moz.build | 2 ++ dom/media/gmp/mozIGeckoMediaPluginChromeService.idl | 4 ++-- dom/media/gmp/widevine-adapter/content_decryption_module.h | 1 - 6 files changed, 17 insertions(+), 12 deletions(-) (limited to 'dom/media/gmp') diff --git a/dom/media/gmp/ChromiumCDMChild.cpp b/dom/media/gmp/ChromiumCDMChild.cpp index 4592f2e291..343622d37f 100644 --- a/dom/media/gmp/ChromiumCDMChild.cpp +++ b/dom/media/gmp/ChromiumCDMChild.cpp @@ -450,7 +450,7 @@ mozilla::ipc::IPCResult ChromiumCDMChild::RecvCreateSessionAndGenerateRequest( "pid=%" PRIu32 ", sessionType=%" PRIu32 ", initDataType=%" PRIu32 ") initDataLen=%zu", aPromiseId, aSessionType, aInitDataType, aInitData.Length()); - MOZ_ASSERT(aSessionType <= cdm::SessionType::kPersistentUsageRecord); + MOZ_ASSERT(aSessionType <= cdm::SessionType::kPersistentLicense); MOZ_ASSERT(aInitDataType <= cdm::InitDataType::kWebM); if (mCDM) { mCDM->CreateSessionAndGenerateRequest( diff --git a/dom/media/gmp/ChromiumCDMProxy.cpp b/dom/media/gmp/ChromiumCDMProxy.cpp index 566b386b0b..43ce3e50af 100644 --- a/dom/media/gmp/ChromiumCDMProxy.cpp +++ b/dom/media/gmp/ChromiumCDMProxy.cpp @@ -7,6 +7,7 @@ #include "ChromiumCDMProxy.h" #include "ChromiumCDMCallbackProxy.h" #include "MediaResult.h" +#include "mozilla/StaticPrefs_media.h" #include "mozilla/dom/MediaKeySession.h" #include "mozilla/dom/MediaKeysBinding.h" #include "GMPUtils.h" @@ -382,13 +383,19 @@ void ChromiumCDMProxy::NotifyOutputProtectionStatus( } uint32_t linkMask{}; - uint32_t protectionMask{}; // Unused/always zeroed. + uint32_t protectionMask{}; if (aCheckStatus == OutputProtectionCheckStatus::CheckSuccessful && aCaptureStatus == OutputProtectionCaptureStatus::CapturePossilbe) { // The result indicates the capture is possible, so set the mask // to indicate this. linkMask |= cdm::OutputLinkTypes::kLinkTypeNetwork; } + // `kProtectionNone` can cause playback to stop if HDCP_V1 is required. Report + // HDCP protection if there's no potential capturing. + if (linkMask == cdm::OutputLinkTypes::kLinkTypeNone && + StaticPrefs::media_widevine_hdcp_protection_mask()) { + protectionMask = cdm::OutputProtectionMethods::kProtectionHDCP; + } mGMPThread->Dispatch(NewRunnableMethod( "gmp::ChromiumCDMParent::NotifyOutputProtectionStatus", cdm, &gmp::ChromiumCDMParent::NotifyOutputProtectionStatus, diff --git a/dom/media/gmp/GMPChild.cpp b/dom/media/gmp/GMPChild.cpp index d543d46387..ca8b6a4ed4 100644 --- a/dom/media/gmp/GMPChild.cpp +++ b/dom/media/gmp/GMPChild.cpp @@ -41,6 +41,7 @@ #include "nsXULAppAPI.h" #include "nsIXULRuntime.h" #include "nsXPCOM.h" +#include "nsXPCOMPrivate.h" // for XUL_DLL #include "prio.h" #ifdef XP_WIN # include // for _exit() @@ -348,15 +349,11 @@ static bool IsFileLeafEqualToASCII(const nsCOMPtr& aFile, #endif #if defined(XP_WIN) -# define FIREFOX_FILE u"firefox.exe"_ns -# define XUL_LIB_FILE u"xul.dll"_ns -#elif defined(XP_MACOSX) -# define FIREFOX_FILE u"firefox"_ns -# define XUL_LIB_FILE u"XUL"_ns +# define FIREFOX_FILE MOZ_APP_NAME u".exe"_ns #else -# define FIREFOX_FILE u"firefox"_ns -# define XUL_LIB_FILE u"libxul.so"_ns +# define FIREFOX_FILE MOZ_APP_NAME u""_ns #endif +#define XUL_LIB_FILE XUL_DLL u""_ns static nsCOMPtr GetFirefoxAppPath( nsCOMPtr aPluginContainerPath) { diff --git a/dom/media/gmp/moz.build b/dom/media/gmp/moz.build index 3c34021506..744209fa1c 100644 --- a/dom/media/gmp/moz.build +++ b/dom/media/gmp/moz.build @@ -129,6 +129,8 @@ PREPROCESSED_IPDL_SOURCES += [ if CONFIG["TARGET_OS"] in ["WINNT", "OSX"]: DEFINES["SUPPORT_STORAGE_ID"] = 1 +DEFINES["MOZ_APP_NAME"] = '"%s"' % CONFIG["MOZ_APP_NAME"] + include("/ipc/chromium/chromium-config.mozbuild") if CONFIG["MOZ_SANDBOX"]: diff --git a/dom/media/gmp/mozIGeckoMediaPluginChromeService.idl b/dom/media/gmp/mozIGeckoMediaPluginChromeService.idl index 51dc545092..bc782978c9 100644 --- a/dom/media/gmp/mozIGeckoMediaPluginChromeService.idl +++ b/dom/media/gmp/mozIGeckoMediaPluginChromeService.idl @@ -27,7 +27,7 @@ interface mozIGeckoMediaPluginChromeService : nsISupports * @note Main-thread API. */ void removeAndDeletePluginDirectory(in AString directory, - [optional] in bool defer); + [optional] in boolean defer); /** * Clears storage data associated with the site and the originAttributes @@ -48,7 +48,7 @@ interface mozIGeckoMediaPluginChromeService : nsISupports * persistently on disk. Private Browsing and local content are not * allowed to store persistent data. */ - bool isPersistentStorageAllowed(in ACString nodeId); + boolean isPersistentStorageAllowed(in ACString nodeId); /** * Returns the directory to use as the base for storing data about GMPs. diff --git a/dom/media/gmp/widevine-adapter/content_decryption_module.h b/dom/media/gmp/widevine-adapter/content_decryption_module.h index 68fee35195..f9101fbaf0 100644 --- a/dom/media/gmp/widevine-adapter/content_decryption_module.h +++ b/dom/media/gmp/widevine-adapter/content_decryption_module.h @@ -411,7 +411,6 @@ CHECK_TYPE(InitDataType, 4, 4); enum SessionType : uint32_t { kTemporary = 0, kPersistentLicense = 1, - kPersistentUsageRecord = 2 }; CHECK_TYPE(SessionType, 4, 4); -- cgit v1.2.3