Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
mfactivate.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#include "mfactivate_p.h"
5
6#include <mfapi.h>
7
9 : m_attributes(0)
10 , m_cRef(1)
11{
12 MFCreateAttributes(&m_attributes, 0);
13}
14
16{
17 if (m_attributes)
18 m_attributes->Release();
19}
20
21
23{
24 if (!ppvObject)
25 return E_POINTER;
26 if (riid == IID_IMFActivate) {
27 *ppvObject = static_cast<IMFActivate*>(this);
28 } else if (riid == IID_IMFAttributes) {
29 *ppvObject = static_cast<IMFAttributes*>(this);
30 } else if (riid == IID_IUnknown) {
31 *ppvObject = static_cast<IUnknown*>(static_cast<IMFActivate*>(this));
32 } else {
33 *ppvObject = NULL;
34 return E_NOINTERFACE;
35 }
36 AddRef();
37 return S_OK;
38}
39
40ULONG MFAbstractActivate::AddRef(void)
41{
42 return InterlockedIncrement(&m_cRef);
43}
44
45ULONG MFAbstractActivate::Release(void)
46{
47 ULONG cRef = InterlockedDecrement(&m_cRef);
48 if (cRef == 0)
49 delete this;
50 return cRef;
51}
STDMETHODIMP QueryInterface(REFIID riid, LPVOID *ppvObject) override
virtual ~MFAbstractActivate()
IUIViewSettingsInterop __RPC__in REFIID riid
long HRESULT