Backed out 2 changesets (bug 1879680) for causing spidermonkey failures on dumpValue...
[gecko.git] / media / wmf-clearkey / WMFPMPServer.cpp
blob86036cc0c008c14887960eb5cd459536b8ffaa2b
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 #include "WMFPMPServer.h"
7 #include <mfapi.h>
8 #include <mferror.h>
10 #include "WMFClearKeyUtils.h"
12 namespace mozilla {
14 using Microsoft::WRL::ComPtr;
15 using Microsoft::WRL::MakeAndInitialize;
17 HRESULT WMFPMPServer::RuntimeClassInitialize(
18 ABI::Windows::Foundation::Collections::IPropertySet* aPropertyPmp) {
19 ENTRY_LOG();
20 mPropertyPmp = aPropertyPmp;
21 RETURN_IF_FAILED(MFCreatePMPMediaSession(MFPMPSESSION_IN_PROCESS, nullptr,
22 &mMediaSession, nullptr));
23 RETURN_IF_FAILED(MFGetService(mMediaSession.Get(), MF_PMP_SERVER_CONTEXT,
24 IID_PPV_ARGS(&mPmpServer)));
25 RETURN_IF_FAILED(MFGetService(mMediaSession.Get(), MF_PMP_SERVICE,
26 IID_PPV_ARGS(&mPmpHost)));
27 return S_OK;
30 STDMETHODIMP WMFPMPServer::GetIids(ULONG* aIidCount, IID** aIids) {
31 NOT_IMPLEMENTED();
32 return E_NOTIMPL;
35 STDMETHODIMP WMFPMPServer::GetRuntimeClassName(
36 _COM_Outptr_ HSTRING* aClassName) {
37 NOT_IMPLEMENTED();
38 return E_NOTIMPL;
41 STDMETHODIMP WMFPMPServer::GetTrustLevel(TrustLevel* aTrustLevel) {
42 NOT_IMPLEMENTED();
43 return E_NOTIMPL;
45 STDMETHODIMP WMFPMPServer::get_Properties(
46 ABI::Windows::Foundation::Collections::IPropertySet** aPpProperties) {
47 ENTRY_LOG();
48 RETURN_IF_FAILED(mPropertyPmp.CopyTo(aPpProperties));
49 return S_OK;
52 STDMETHODIMP WMFPMPServer::GetService(REFGUID aGuidService, REFIID aRiid,
53 LPVOID* aObject) {
54 ENTRY_LOG();
55 if (!aObject) {
56 return E_POINTER;
58 if (aGuidService == MF_PMP_SERVER_CONTEXT) {
59 RETURN_IF_FAILED(mPmpServer.CopyTo(aRiid, aObject));
60 } else if (aGuidService == MF_PMP_SERVICE && aRiid == IID_IMFPMPHost) {
61 RETURN_IF_FAILED(mPmpHost.CopyTo(aRiid, aObject));
62 } else {
63 RETURN_IF_FAILED(MF_E_UNSUPPORTED_SERVICE);
65 return S_OK;
68 } // namespace mozilla