MFPMPHostWrapper.h (1468B)
1 /* This Source Code Form is subject to the terms of the Mozilla Public 2 * License, v. 2.0. If a copy of the MPL was not distributed with this 3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 4 5 #ifndef DOM_MEDIA_PLATFORM_WMF_MPMPHOSTWRAPPER_H 6 #define DOM_MEDIA_PLATFORM_WMF_MPMPHOSTWRAPPER_H 7 8 #include <wrl.h> 9 #include <wrl/client.h> 10 11 #include "MFCDMExtra.h" 12 13 namespace mozilla { 14 15 // This class is used to create and manage PMP sessions. For PlayReady CDM, 16 // it needs to connect with IMFPMPHostApp first before generating any request. 17 // That behavior is undocumented on the mdsn, see more details in 18 // https://github.com/microsoft/media-foundation/issues/37#issuecomment-1197321484 19 class MFPMPHostWrapper : public Microsoft::WRL::RuntimeClass< 20 Microsoft::WRL::RuntimeClassFlags< 21 Microsoft::WRL::RuntimeClassType::ClassicCom>, 22 IMFPMPHostApp> { 23 public: 24 MFPMPHostWrapper(); 25 ~MFPMPHostWrapper(); 26 27 HRESULT RuntimeClassInitialize(Microsoft::WRL::ComPtr<IMFPMPHost>& aHost); 28 29 STDMETHODIMP LockProcess() override; 30 31 STDMETHODIMP UnlockProcess() override; 32 33 STDMETHODIMP ActivateClassById(LPCWSTR aId, IStream* aStream, REFIID aRiid, 34 void** aActivatedClass) override; 35 36 void Shutdown(); 37 38 private: 39 Microsoft::WRL::ComPtr<IMFPMPHost> mPMPHost; 40 }; 41 42 } // namespace mozilla 43 44 #endif // DOM_MEDIA_PLATFORM_WMF_MPMPHOSTWRAPPER_H