From def92d1b8e9d373e2f6f27c366d578d97d8960c6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 15 May 2024 05:34:50 +0200 Subject: Merging upstream version 126.0. Signed-off-by: Daniel Baumann --- dom/media/eme/mediafoundation/WMFCDMImpl.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'dom/media/eme/mediafoundation/WMFCDMImpl.h') diff --git a/dom/media/eme/mediafoundation/WMFCDMImpl.h b/dom/media/eme/mediafoundation/WMFCDMImpl.h index b7e6308848..c5bf8234af 100644 --- a/dom/media/eme/mediafoundation/WMFCDMImpl.h +++ b/dom/media/eme/mediafoundation/WMFCDMImpl.h @@ -34,10 +34,6 @@ class WMFCDMImpl final { explicit WMFCDMImpl(const nsAString& aKeySystem) : mKeySystem(aKeySystem) {} - // TODO: make this async? - bool GetCapabilities(bool aIsHardwareDecryption, - nsTArray& aOutConfigs); - using InitPromise = GenericPromise; struct InitParams { nsString mOrigin; @@ -119,6 +115,26 @@ class WMFCDMImpl final { MozPromiseHolder mInitPromiseHolder; }; +// A helper class to get multiple capabilities from different key systems. +class WMFCDMCapabilites final { + public: + NS_INLINE_DECL_THREADSAFE_REFCOUNTING(WMFCDMCapabilites); + WMFCDMCapabilites() = default; + + using SupportedConfigsPromise = KeySystemConfig::SupportedConfigsPromise; + RefPtr GetCapabilities( + const nsTArray& aRequests); + + private: + ~WMFCDMCapabilites(); + + nsTArray> mCDMs; + MozPromiseHolder mCapabilitiesPromiseHolder; + MozPromiseRequestHolder< + MFCDMChild::CapabilitiesPromise::AllSettledPromiseType> + mCapabilitiesPromisesRequest; +}; + } // namespace mozilla #endif // DOM_MEDIA_EME_MEDIAFOUNDATION_WMFCDMIMPL_H_ -- cgit v1.2.3