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 "WMFClearKeyCDMAccess.h"
10 #include "WMFClearKeyCDM.h"
11 #include "WMFClearKeyUtils.h"
15 using Microsoft::WRL::ComPtr
;
16 using Microsoft::WRL::MakeAndInitialize
;
18 STDMETHODIMP
WMFClearKeyCDMAccess::CreateContentDecryptionModule(
19 IPropertyStore
* aProperties
, IMFContentDecryptionModule
** aCdm
) {
22 ENTRY_LOG_ARGS("Null properties!");
23 return MF_E_UNEXPECTED
;
27 ComPtr
<IMFContentDecryptionModule
> cdm
;
29 (MakeAndInitialize
<WMFClearKeyCDM
, IMFContentDecryptionModule
>(
32 ENTRY_LOG_ARGS("Created clearkey CDM!");
36 STDMETHODIMP
WMFClearKeyCDMAccess::GetConfiguration(IPropertyStore
** aConfig
) {
41 STDMETHODIMP
WMFClearKeyCDMAccess::GetKeySystem(LPWSTR
* aKeySystem
) {
43 *aKeySystem
= (LPWSTR
)CoTaskMemAlloc((wcslen(kCLEARKEY_SYSTEM_NAME
) + 1) *
45 if (*aKeySystem
== NULL
) {
48 wcscpy_s(*aKeySystem
, wcslen(kCLEARKEY_SYSTEM_NAME
) + 1,
49 kCLEARKEY_SYSTEM_NAME
);
53 } // namespace mozilla