From 6bf0a5cb5034a7e684dcc3500e841785237ce2dd Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 19:32:43 +0200 Subject: Adding upstream version 1:115.7.0. Signed-off-by: Daniel Baumann --- .../platforms/wmf/MFContentProtectionManager.h | 79 ++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 dom/media/platforms/wmf/MFContentProtectionManager.h (limited to 'dom/media/platforms/wmf/MFContentProtectionManager.h') diff --git a/dom/media/platforms/wmf/MFContentProtectionManager.h b/dom/media/platforms/wmf/MFContentProtectionManager.h new file mode 100644 index 0000000000..964c965c32 --- /dev/null +++ b/dom/media/platforms/wmf/MFContentProtectionManager.h @@ -0,0 +1,79 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef DOM_MEDIA_PLATFORM_WMF_MFCONTENTPROTECTIONMANAGER_H +#define DOM_MEDIA_PLATFORM_WMF_MFCONTENTPROTECTIONMANAGER_H + +#include +#include +#include +#include + +#include "MFCDMProxy.h" + +namespace mozilla { + +/** + * MFContentProtectionManager is used to enable the encrypted playback for the + * media engine. + * https://docs.microsoft.com/en-us/windows/win32/api/mfidl/nn-mfidl-imfcontentprotectionmanager + * https://docs.microsoft.com/en-us/uwp/api/windows.media.protection.mediaprotectionmanager + */ +class MFContentProtectionManager + : public Microsoft::WRL::RuntimeClass< + Microsoft::WRL::RuntimeClassFlags< + Microsoft::WRL::RuntimeClassType::WinRtClassicComMix | + Microsoft::WRL::RuntimeClassType::InhibitRoOriginateError>, + IMFContentProtectionManager, + ABI::Windows::Media::Protection::IMediaProtectionManager> { + public: + MFContentProtectionManager() = default; + ~MFContentProtectionManager() = default; + + HRESULT RuntimeClassInitialize(); + + // IMFContentProtectionManager. + IFACEMETHODIMP BeginEnableContent(IMFActivate* aEnablerActivate, + IMFTopology* aTopology, + IMFAsyncCallback* aCallback, + IUnknown* aState) override; + IFACEMETHODIMP EndEnableContent(IMFAsyncResult* aAsyncResult) override; + + // IMediaProtectionManager. + // MFMediaEngine can query this interface to invoke get_Properties(). + IFACEMETHODIMP add_ServiceRequested( + ABI::Windows::Media::Protection::IServiceRequestedEventHandler* aHandler, + EventRegistrationToken* aCookie) override; + IFACEMETHODIMP remove_ServiceRequested( + EventRegistrationToken aCookie) override; + IFACEMETHODIMP add_RebootNeeded( + ABI::Windows::Media::Protection::IRebootNeededEventHandler* aHandler, + EventRegistrationToken* aCookie) override; + IFACEMETHODIMP remove_RebootNeeded(EventRegistrationToken aCookie) override; + IFACEMETHODIMP add_ComponentLoadFailed( + ABI::Windows::Media::Protection::IComponentLoadFailedEventHandler* + aHandler, + EventRegistrationToken* aCookie) override; + IFACEMETHODIMP remove_ComponentLoadFailed( + EventRegistrationToken aCookie) override; + IFACEMETHODIMP get_Properties( + ABI::Windows::Foundation::Collections::IPropertySet** aValue) override; + + HRESULT SetCDMProxy(MFCDMProxy* aCDMProxy); + + MFCDMProxy* GetCDMProxy() const { return mCDMProxy; } + + private: + HRESULT SetPMPServer( + ABI::Windows::Media::Protection::IMediaProtectionPMPServer* aPMPServer); + + RefPtr mCDMProxy; + + Microsoft::WRL::ComPtr + mPMPServerSet; +}; + +} // namespace mozilla + +#endif // DOM_MEDIA_PLATFORM_WMF_MFCONTENTPROTECTIONMANAGER_H -- cgit v1.2.3