summaryrefslogtreecommitdiffstats
path: root/dom/media/eme/MediaKeys.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:13:27 +0000
commit40a355a42d4a9444dc753c04c6608dade2f06a23 (patch)
tree871fc667d2de662f171103ce5ec067014ef85e61 /dom/media/eme/MediaKeys.cpp
parentAdding upstream version 124.0.1. (diff)
downloadfirefox-upstream/125.0.1.tar.xz
firefox-upstream/125.0.1.zip
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/eme/MediaKeys.cpp')
-rw-r--r--dom/media/eme/MediaKeys.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/dom/media/eme/MediaKeys.cpp b/dom/media/eme/MediaKeys.cpp
index c4340885a3..9a3f4bba7a 100644
--- a/dom/media/eme/MediaKeys.cpp
+++ b/dom/media/eme/MediaKeys.cpp
@@ -23,7 +23,6 @@
#include "mozilla/dom/UnionTypes.h"
#include "mozilla/dom/WindowContext.h"
#include "mozilla/dom/WindowGlobalChild.h"
-#include "nsContentCID.h"
#include "nsContentTypeParser.h"
#include "nsContentUtils.h"
#include "nsIScriptObjectPrincipal.h"
@@ -429,7 +428,8 @@ class MediaKeysGMPCrashHelper : public GMPCrashHelper {
already_AddRefed<CDMProxy> MediaKeys::CreateCDMProxy() {
const bool isHardwareDecryptionSupported =
- IsHardwareDecryptionSupported(mConfig);
+ IsHardwareDecryptionSupported(mConfig) ||
+ DoesKeySystemSupportHardwareDecryption(mKeySystem);
EME_LOG("MediaKeys[%p]::CreateCDMProxy(), isHardwareDecryptionSupported=%d",
this, isHardwareDecryptionSupported);
RefPtr<CDMProxy> proxy;
@@ -662,8 +662,12 @@ already_AddRefed<MediaKeySession> MediaKeys::CreateSession(
EME_LOG("MediaKeys[%p] Creating session", this);
- RefPtr<MediaKeySession> session = new MediaKeySession(
- GetParentObject(), this, mKeySystem, aSessionType, aRv);
+ const bool isHardwareDecryption =
+ IsHardwareDecryptionSupported(mConfig) ||
+ DoesKeySystemSupportHardwareDecryption(mKeySystem);
+ RefPtr<MediaKeySession> session =
+ new MediaKeySession(GetParentObject(), this, mKeySystem, aSessionType,
+ isHardwareDecryption, aRv);
if (aRv.Failed()) {
return nullptr;
@@ -792,8 +796,7 @@ void MediaKeys::GetSessionsInfo(nsString& sessionsInfo) {
sessionsInfo.AppendLiteral("(kid=");
sessionsInfo.Append(keyID);
sessionsInfo.AppendLiteral(" status=");
- sessionsInfo.AppendASCII(
- MediaKeyStatusValues::GetString(keyStatusMap->GetValueAtIndex(i)));
+ sessionsInfo.AppendASCII(GetEnumString(keyStatusMap->GetValueAtIndex(i)));
sessionsInfo.AppendLiteral(")");
}
sessionsInfo.AppendLiteral(")");
@@ -824,7 +827,7 @@ already_AddRefed<Promise> MediaKeys::GetStatusForPolicy(
}
EME_LOG("GetStatusForPolicy minHdcpVersion = %s.",
- HDCPVersionValues::GetString(aPolicy.mMinHdcpVersion.Value()).data());
+ GetEnumString(aPolicy.mMinHdcpVersion.Value()).get());
mProxy->GetStatusForPolicy(StorePromise(promise),
aPolicy.mMinHdcpVersion.Value());
return promise.forget();