tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

WMFPMPServer.h (1941B)


      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_CLEARKEY_WMFPMPSERVER_H
      6 #define DOM_MEDIA_PLATFORM_WMF_CLEARKEY_WMFPMPSERVER_H
      7 
      8 #include <mfidl.h>
      9 #include <windows.h>
     10 #include <windows.media.protection.h>
     11 #include <wrl.h>
     12 
     13 #include "MFCDMExtra.h"
     14 
     15 namespace mozilla {
     16 
     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;
     29 
     30  HRESULT RuntimeClassInitialize(
     31      ABI::Windows::Foundation::Collections::IPropertySet* aPropertyPmp);
     32 
     33  // IInspectable
     34  STDMETHODIMP GetIids(ULONG* aIidCount, IID** aIids) override;
     35  STDMETHODIMP GetRuntimeClassName(HSTRING* aClassName) override;
     36  STDMETHODIMP GetTrustLevel(TrustLevel* aTrustLevel) override;
     37 
     38  // IMediaProtectionPMPServer
     39  STDMETHODIMP get_Properties(
     40      ABI::Windows::Foundation::Collections::IPropertySet** aPpProperties)
     41      override;
     42 
     43  // IMFGetService
     44  STDMETHODIMP GetService(REFGUID aGuidService, REFIID aRiid,
     45                          LPVOID* aObject) override;
     46 
     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;
     53 };
     54 
     55 }  // namespace mozilla
     56 
     57 #endif  // DOM_MEDIA_PLATFORM_WMF_CLEARKEY_WMFPMPSERVER_H