diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /dom/media/eme/KeySystemConfig.h | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/media/eme/KeySystemConfig.h')
-rw-r--r-- | dom/media/eme/KeySystemConfig.h | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/dom/media/eme/KeySystemConfig.h b/dom/media/eme/KeySystemConfig.h index cc35ba76de..39027d4401 100644 --- a/dom/media/eme/KeySystemConfig.h +++ b/dom/media/eme/KeySystemConfig.h @@ -9,12 +9,23 @@ #include "nsString.h" #include "nsTArray.h" +#include "mozilla/MozPromise.h" #include "mozilla/dom/MediaKeysBinding.h" +#include "mozilla/dom/MediaKeySystemAccessBinding.h" namespace mozilla { +struct KeySystemConfigRequest; + struct KeySystemConfig { public: + using SupportedConfigsPromise = + MozPromise<nsTArray<KeySystemConfig>, bool /* aIgnored */, + /* IsExclusive = */ true>; + using KeySystemConfigPromise = + MozPromise<dom::MediaKeySystemConfiguration, bool /* aIgnored */, + /* IsExclusive = */ true>; + // EME MediaKeysRequirement: // https://www.w3.org/TR/encrypted-media/#dom-mediakeysrequirement enum class Requirement { @@ -129,9 +140,8 @@ struct KeySystemConfig { Software, Hardware, }; - static bool CreateKeySystemConfigs(const nsAString& aKeySystem, - const DecryptionInfo aDecryption, - nsTArray<KeySystemConfig>& aOutConfigs); + static RefPtr<SupportedConfigsPromise> CreateKeySystemConfigs( + const nsTArray<KeySystemConfigRequest>& aRequests); static void GetGMPKeySystemConfigs(dom::Promise* aPromise); KeySystemConfig() = default; @@ -169,10 +179,6 @@ struct KeySystemConfig { nsString GetDebugInfo() const; - // Return true if the given key system is equal to `mKeySystem`, or it can be - // mapped to the same key system - bool IsSameKeySystem(const nsAString& aKeySystem) const; - nsString mKeySystem; nsTArray<nsString> mInitDataTypes; Requirement mPersistentState = Requirement::NotAllowed; @@ -184,6 +190,22 @@ struct KeySystemConfig { ContainerSupport mMP4; ContainerSupport mWebM; bool mIsHDCP22Compatible = false; + + private: + static void CreateClearKeyKeySystemConfigs( + const KeySystemConfigRequest& aRequest, + nsTArray<KeySystemConfig>& aOutConfigs); + static void CreateWivineL3KeySystemConfigs( + const KeySystemConfigRequest& aRequest, + nsTArray<KeySystemConfig>& aOutConfigs); +}; + +struct KeySystemConfigRequest final { + KeySystemConfigRequest(const nsAString& aKeySystem, + KeySystemConfig::DecryptionInfo aDecryption) + : mKeySystem(aKeySystem), mDecryption(aDecryption) {} + const nsString mKeySystem; + const KeySystemConfig::DecryptionInfo mDecryption; }; KeySystemConfig::SessionType ConvertToKeySystemConfigSessionType( |