diff options
Diffstat (limited to 'dom/media/eme/mediafoundation/WMFCDMImpl.h')
-rw-r--r-- | dom/media/eme/mediafoundation/WMFCDMImpl.h | 24 |
1 files changed, 20 insertions, 4 deletions
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<KeySystemConfig>& aOutConfigs); - using InitPromise = GenericPromise; struct InitParams { nsString mOrigin; @@ -119,6 +115,26 @@ class WMFCDMImpl final { MozPromiseHolder<InitPromise> 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<SupportedConfigsPromise> GetCapabilities( + const nsTArray<KeySystemConfigRequest>& aRequests); + + private: + ~WMFCDMCapabilites(); + + nsTArray<RefPtr<MFCDMChild>> mCDMs; + MozPromiseHolder<SupportedConfigsPromise> mCapabilitiesPromiseHolder; + MozPromiseRequestHolder< + MFCDMChild::CapabilitiesPromise::AllSettledPromiseType> + mCapabilitiesPromisesRequest; +}; + } // namespace mozilla #endif // DOM_MEDIA_EME_MEDIAFOUNDATION_WMFCDMIMPL_H_ |