ReactOS 0.4.15-dev-7089-gea8a49d
qualityforward.cpp
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS WDM Streaming ActiveMovie Proxy
4 * FILE: dll/directx/ksproxy/qualityforward.cpp
5 * PURPOSE: IKsClockForwarder interface
6 *
7 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org)
8 */
9#include "precomp.h"
10
11#define IID_IKsQualityForwarder KSCATEGORY_QUALITY
12
13class CKsQualityForwarder : public IKsQualityForwarder
14{
15public:
17
19 {
21 return m_Ref;
22 }
24 {
26
27 if (!m_Ref)
28 {
29 delete this;
30 return 0;
31 }
32 return m_Ref;
33 }
34
35 // IKsObject interface
37
38 // IKsQualityForwarder
40
43
44protected:
47
48
49};
50
54 IN REFIID refiid,
56{
57 if (IsEqualGUID(refiid, IID_IUnknown) ||
59 {
60 *Output = PVOID(this);
61 reinterpret_cast<IUnknown*>(*Output)->AddRef();
62 return NOERROR;
63 }
64
65 return E_NOINTERFACE;
66}
67
68//-------------------------------------------------------------------
69// IKsObject interface
70//
71
75{
76 return m_Handle;
77}
78
79//-------------------------------------------------------------------
80// IKsQualityForwarder interface
81//
82VOID
85 IN IKsPin *Pin)
86{
87#ifdef KSPROXY_TRACE
88 OutputDebugString("UNIMPLEMENTED\n");
89#endif
90}
91
95 IUnknown * pUnkOuter,
97 LPVOID * ppv)
98{
99 HRESULT hr;
101
102#ifdef KSPROXY_TRACE
103 OutputDebugStringW(L"CKsQualityForwarder_Constructor\n");
104#endif
105
106 // open default clock
108
109 if (hr != NOERROR)
110 {
111#ifdef KSPROXY_TRACE
112 OutputDebugString("CKsClockForwarder_Constructor failed to open device\n");
113#endif
114 return hr;
115 }
116
118
119 if (!quality)
120 {
121 // free clock handle
123 return E_OUTOFMEMORY;
124 }
125
126 if (FAILED(quality->QueryInterface(riid, ppv)))
127 {
128 /* not supported */
129 delete quality;
130 return E_NOINTERFACE;
131 }
132
133 return NOERROR;
134}
#define InterlockedIncrement
Definition: armddk.h:53
#define InterlockedDecrement
Definition: armddk.h:52
#define STDMETHODIMP
Definition: basetyps.h:43
const GUID IID_IUnknown
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
_In_ BOOLEAN Release
Definition: cdrom.h:920
HANDLE STDMETHODCALLTYPE KsGetObjectHandle()
STDMETHODIMP_(ULONG) Release()
STDMETHODIMP_(ULONG) AddRef()
virtual ~CKsQualityForwarder()
VOID STDMETHODCALLTYPE KsFlushClient(IN IKsPin *Pin)
CKsQualityForwarder(HANDLE handle)
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define CloseHandle
Definition: compat.h:739
#define GENERIC_READ
Definition: compat.h:135
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:427
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
ULONG AddRef()
#define FAILED(hr)
Definition: intsafe.h:51
int quality
Definition: jpeglib.h:992
#define KSCATEGORY_QUALITY
Definition: ks.h:225
KSDDKAPI HRESULT WINAPI KsOpenDefaultDevice(REFGUID Category, ACCESS_MASK Access, PHANDLE DeviceHandle)
Definition: ksproxy.cpp:101
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
#define GENERIC_WRITE
Definition: nt_native.h:90
#define L(x)
Definition: ntvdm.h:50
long LONG
Definition: pedump.c:60
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define REFIID
Definition: guiddef.h:118
HRESULT WINAPI CKsQualityForwarder_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
#define IID_IKsQualityForwarder
@ Output
Definition: arc.h:85
HRESULT hr
Definition: shlfolder.c:183
void * PVOID
Definition: typedefs.h:50
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
#define OutputDebugString
Definition: winbase.h:3825
#define WINAPI
Definition: msvc.h:6
#define E_NOINTERFACE
Definition: winerror.h:2364
#define NOERROR
Definition: winerror.h:2354