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)
11 const GUID IID_IDistributorNotify
= {0x56a868af, 0x0ad4, 0x11ce, {0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70}};
12 const GUID KSCATEGORY_CLOCK
= {0x53172480, 0x4791, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}};
14 class CKsClockForwarder
: public IDistributorNotify
,
18 STDMETHODIMP
QueryInterface( REFIID InterfaceId
, PVOID
* Interface
);
20 STDMETHODIMP_(ULONG
) AddRef()
22 InterlockedIncrement(&m_Ref
);
25 STDMETHODIMP_(ULONG
) Release()
27 InterlockedDecrement(&m_Ref
);
37 // IDistributorNotify interface
38 HRESULT STDMETHODCALLTYPE
Stop();
39 HRESULT STDMETHODCALLTYPE
Pause();
40 HRESULT STDMETHODCALLTYPE
Run(REFERENCE_TIME tStart
);
41 HRESULT STDMETHODCALLTYPE
SetSyncSource(IReferenceClock
*pClock
);
42 HRESULT STDMETHODCALLTYPE
NotifyGraphChange();
44 // IKsObject interface
45 HANDLE STDMETHODCALLTYPE
KsGetObjectHandle();
47 CKsClockForwarder(HANDLE handle
) : m_Ref(0), m_Handle(handle
){}
48 virtual ~CKsClockForwarder(){ if (m_Handle
) CloseHandle(m_Handle
);}
57 CKsClockForwarder::QueryInterface(
61 if (IsEqualGUID(refiid
, IID_IUnknown
))
63 *Output
= PVOID(this);
64 reinterpret_cast<IUnknown
*>(*Output
)->AddRef();
67 if (IsEqualGUID(refiid
, IID_IKsObject
))
69 *Output
= (IKsObject
*)(this);
70 reinterpret_cast<IKsObject
*>(*Output
)->AddRef();
74 if (IsEqualGUID(refiid
, IID_IDistributorNotify
))
76 *Output
= (IDistributorNotify
*)(this);
77 reinterpret_cast<IDistributorNotify
*>(*Output
)->AddRef();
82 if (IsEqualGUID(refiid
, IID_IKsClockForwarder
))
84 *Output
= PVOID(this);
85 reinterpret_cast<IKsObject
*>(*Output
)->AddRef();
93 //-------------------------------------------------------------------
94 // IDistributorNotify interface
100 CKsClockForwarder::Stop()
102 OutputDebugString("UNIMPLEMENTED\n");
108 CKsClockForwarder::Pause()
110 OutputDebugString("UNIMPLEMENTED\n");
116 CKsClockForwarder::Run(
117 REFERENCE_TIME tStart
)
119 OutputDebugString("UNIMPLEMENTED\n");
125 CKsClockForwarder::SetSyncSource(
126 IReferenceClock
*pClock
)
128 OutputDebugString("UNIMPLEMENTED\n");
134 CKsClockForwarder::NotifyGraphChange()
136 OutputDebugString("UNIMPLEMENTED\n");
140 //-------------------------------------------------------------------
141 // IKsObject interface
146 CKsClockForwarder::KsGetObjectHandle()
153 CKsClockForwarder_Constructor(
154 IUnknown
* pUnkOuter
,
161 // open default clock
162 hr
= KsOpenDefaultDevice(KSCATEGORY_CLOCK
, GENERIC_READ
| GENERIC_WRITE
, &handle
);
166 OutputDebugString("CKsClockForwarder_Constructor failed to open device\n");
170 CKsClockForwarder
* clock
= new CKsClockForwarder(handle
);
176 return E_OUTOFMEMORY
;
179 if (FAILED(clock
->QueryInterface(riid
, ppv
)))
183 return E_NOINTERFACE
;