ReactOS  0.4.14-dev-390-g34947ad
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 
13 class CKsQualityForwarder : public IKsQualityForwarder
14 {
15 public:
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 
44 protected:
47 
48 
49 };
50 
51 HRESULT
54  IN REFIID refiid,
55  OUT PVOID* Output)
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 
72 HANDLE
75 {
76  return m_Handle;
77 }
78 
79 //-------------------------------------------------------------------
80 // IKsQualityForwarder interface
81 //
82 VOID
85  IN IKsPin *Pin)
86 {
87 #ifdef KSPROXY_TRACE
88  OutputDebugString("UNIMPLEMENTED\n");
89 #endif
90 }
91 
92 HRESULT
93 WINAPI
95  IUnknown * pUnkOuter,
96  REFIID riid,
97  LPVOID * ppv)
98 {
99  HRESULT hr;
100  HANDLE handle;
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 }
virtual ~CKsQualityForwarder()
#define IN
Definition: typedefs.h:38
namespace GUID const ADDRINFOEXW ADDRINFOEXW struct timeval OVERLAPPED LPLOOKUPSERVICE_COMPLETION_ROUTINE HANDLE * handle
Definition: sock.c:82
#define REFIID
Definition: guiddef.h:118
#define CloseHandle
Definition: compat.h:406
#define E_NOINTERFACE
Definition: winerror.h:2364
HRESULT hr
Definition: shlfolder.c:183
_In_ BOOLEAN Release
Definition: classpnp.h:929
#define NOERROR
Definition: winerror.h:2354
REFIID riid
Definition: precomp.h:44
HANDLE STDMETHODCALLTYPE KsGetObjectHandle()
REFIID LPVOID * ppv
Definition: atlbase.h:39
VOID STDMETHODCALLTYPE KsFlushClient(IN IKsPin *Pin)
#define OutputDebugString
Definition: winbase.h:3714
STDMETHODIMP QueryInterface(REFIID InterfaceId, PVOID *Interface)
void WINAPI SHIM_OBJ_NAME() OutputDebugStringW(LPCWSTR lpOutputString)
Definition: ignoredbgout.c:23
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
long LONG
Definition: pedump.c:60
#define GENERIC_WRITE
Definition: nt_native.h:90
STDMETHODIMP_(ULONG) Release()
#define STDMETHODIMP
Definition: basetyps.h:43
void * PVOID
Definition: retypes.h:9
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:359
IN PDCB IN VBO IN ULONG IN BOOLEAN Pin
Definition: fatprocs.h:415
LONG HRESULT
Definition: typedefs.h:77
const GUID IID_IUnknown
#define WINAPI
Definition: msvc.h:8
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
int quality
Definition: jpeglib.h:991
static const WCHAR L[]
Definition: oid.c:1250
#define InterlockedDecrement
Definition: armddk.h:52
Definition: arc.h:85
#define GENERIC_READ
Definition: compat.h:124
STDMETHODIMP_(ULONG) AddRef()
#define IID_IKsQualityForwarder
#define InterlockedIncrement
Definition: armddk.h:53
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
static ULONG WINAPI AddRef(IStream *iface)
Definition: clist.c:90
#define OUT
Definition: typedefs.h:39
HRESULT WINAPI CKsQualityForwarder_Constructor(IUnknown *pUnkOuter, REFIID riid, LPVOID *ppv)
CKsQualityForwarder(HANDLE handle)
unsigned int ULONG
Definition: retypes.h:1
#define KSCATEGORY_QUALITY
Definition: ks.h:225
KSDDKAPI HRESULT WINAPI KsOpenDefaultDevice(REFGUID Category, ACCESS_MASK Access, PHANDLE DeviceHandle)
Definition: ksproxy.cpp:101