Bug 1874684 - Part 28: Return DateDuration from DifferenceISODateTime. r=mgaudet
[gecko.git] / media / wmf-clearkey / WMFPMPServer.h
blob15d9116baccab9b37e0a1828e86ea107194b4d86
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/. */
5 #ifndef DOM_MEDIA_PLATFORM_WMF_CLEARKEY_WMFPMPSERVER_H
6 #define DOM_MEDIA_PLATFORM_WMF_CLEARKEY_WMFPMPSERVER_H
8 #include <mfidl.h>
9 #include <windows.h>
10 #include <windows.media.protection.h>
11 #include <wrl.h>
13 #include "MFCDMExtra.h"
15 namespace mozilla {
17 // A mock PMP server in order to allow media engine to create in-process PMP
18 // server.
19 class WMFPMPServer final
20 : public Microsoft::WRL::RuntimeClass<
21 Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>,
22 ABI::Windows::Media::Protection::IMediaProtectionPMPServer,
23 IMFGetService, Microsoft::WRL::FtmBase> {
24 public:
25 WMFPMPServer() = default;
26 ~WMFPMPServer() = default;
27 WMFPMPServer(const WMFPMPServer&) = delete;
28 WMFPMPServer& operator=(const WMFPMPServer&) = delete;
30 HRESULT RuntimeClassInitialize(
31 ABI::Windows::Foundation::Collections::IPropertySet* aPropertyPmp);
33 // IInspectable
34 STDMETHODIMP GetIids(ULONG* aIidCount, IID** aIids) override;
35 STDMETHODIMP GetRuntimeClassName(HSTRING* aClassName) override;
36 STDMETHODIMP GetTrustLevel(TrustLevel* aTrustLevel) override;
38 // IMediaProtectionPMPServer
39 STDMETHODIMP get_Properties(
40 ABI::Windows::Foundation::Collections::IPropertySet** aPpProperties)
41 override;
43 // IMFGetService
44 STDMETHODIMP GetService(REFGUID aGuidService, REFIID aRiid,
45 LPVOID* aObject) override;
47 private:
48 Microsoft::WRL::ComPtr<ABI::Windows::Foundation::Collections::IPropertySet>
49 mPropertyPmp;
50 Microsoft::WRL::ComPtr<IMFPMPServer> mPmpServer;
51 Microsoft::WRL::ComPtr<IMFPMPHost> mPmpHost;
52 Microsoft::WRL::ComPtr<IMFMediaSession> mMediaSession;
55 } // namespace mozilla
57 #endif // DOM_MEDIA_PLATFORM_WMF_CLEARKEY_WMFPMPSERVER_H