2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS WDM Streaming ActiveMovie Proxy
4 * FILE: dll/directx/ksproxy/clockforward.cpp
5 * PURPOSE: IKsClockForwarder interface
7 * PROGRAMMERS: Johannes Anderwald (janderwald@reactos.org)
12 const GUID KSCATEGORY_CLOCK
= {0x53172480, 0x4791, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
15 class CKsClockForwarder
: public IDistributorNotify
,
19 STDMETHODIMP
QueryInterface( REFIID InterfaceId
, PVOID
* Interface
);
21 STDMETHODIMP_(ULONG
) AddRef()
23 InterlockedIncrement(&m_Ref
);
26 STDMETHODIMP_(ULONG
) Release()
28 InterlockedDecrement(&m_Ref
);
38 // IDistributorNotify interface
39 HRESULT STDMETHODCALLTYPE
Stop();
40 HRESULT STDMETHODCALLTYPE
Pause();
41 HRESULT STDMETHODCALLTYPE
Run(REFERENCE_TIME tStart
);
42 HRESULT STDMETHODCALLTYPE
SetSyncSource(IReferenceClock
*pClock
);
43 HRESULT STDMETHODCALLTYPE
NotifyGraphChange();
45 // IKsObject interface
46 HANDLE STDMETHODCALLTYPE
KsGetObjectHandle();
48 CKsClockForwarder(HANDLE handle
) : m_Ref(0), m_Handle(handle
){}
49 virtual ~CKsClockForwarder(){ if (m_Handle
) CloseHandle(m_Handle
);}
58 CKsClockForwarder::QueryInterface(
62 if (IsEqualGUID(refiid
, IID_IUnknown
))
64 *Output
= PVOID(this);
65 reinterpret_cast<IUnknown
*>(*Output
)->AddRef();
68 if (IsEqualGUID(refiid
, IID_IKsObject
))
70 *Output
= (IKsObject
*)(this);
71 reinterpret_cast<IKsObject
*>(*Output
)->AddRef();
75 if (IsEqualGUID(refiid
, IID_IDistributorNotify
))
77 *Output
= (IDistributorNotify
*)(this);
78 reinterpret_cast<IDistributorNotify
*>(*Output
)->AddRef();
83 if (IsEqualGUID(refiid
, IID_IKsClockForwarder
))
85 *Output
= PVOID(this);
86 reinterpret_cast<IKsObject
*>(*Output
)->AddRef();
94 //-------------------------------------------------------------------
95 // IDistributorNotify interface
101 CKsClockForwarder::Stop()
103 OutputDebugString("UNIMPLEMENTED\n");
109 CKsClockForwarder::Pause()
111 OutputDebugString("UNIMPLEMENTED\n");
117 CKsClockForwarder::Run(
118 REFERENCE_TIME tStart
)
120 OutputDebugString("UNIMPLEMENTED\n");
126 CKsClockForwarder::SetSyncSource(
127 IReferenceClock
*pClock
)
129 OutputDebugString("UNIMPLEMENTED\n");
135 CKsClockForwarder::NotifyGraphChange()
137 OutputDebugString("UNIMPLEMENTED\n");
141 //-------------------------------------------------------------------
142 // IKsObject interface
147 CKsClockForwarder::KsGetObjectHandle()
154 CKsClockForwarder_Constructor(
155 IUnknown
* pUnkOuter
,
162 OutputDebugStringW(L
"CKsClockForwarder_Constructor\n");
164 // open default clock
165 hr
= KsOpenDefaultDevice(KSCATEGORY_CLOCK
, GENERIC_READ
| GENERIC_WRITE
, &handle
);
169 OutputDebugString("CKsClockForwarder_Constructor failed to open device\n");
173 CKsClockForwarder
* clock
= new CKsClockForwarder(handle
);
179 return E_OUTOFMEMORY
;
182 if (FAILED(clock
->QueryInterface(riid
, ppv
)))
186 return E_NOINTERFACE
;