1 #pragma once
2
3 #define WIN32_NO_STATUS
4 #define WIN32_LEAN_AND_MEAN
5
6 #define _FORCENAMELESSUNION
7 #define BUILDING_KS
8 #define _KSDDK_
9 #define KSPROXY_TRACE
10 #include <dshow.h>
11 //#include <streams.h>
12 #include <ks.h>
13 #define __STREAMS__
14 #include <ksproxy.h>
15 #include <devioctl.h>
16 #include <stdio.h>
17 //#include <wchar.h>
18 //#include <tchar.h>
19 //#include <uuids.h>
20 #include <dvp.h>
21 #include <vptype.h>
22 #include <vpconfig.h>
23 #include <setupapi.h>
24 #include <vector>
25 #include <stack>
26 #include <list>
27 #include <assert.h>
28 #include <ksmedia.h>
29 //#include <debug.h>
30
31 interface DECLSPEC_UUID("877E4351-6FEA-11D0-B863-00AA00A216A1") IKsClock;
32
33 #undef INTERFACE
34 #define INTERFACE IKsClock
35
DECLARE_INTERFACE_(IKsClock,IUnknown)36 DECLARE_INTERFACE_(IKsClock, IUnknown)
37 {
38 STDMETHOD_(HANDLE, KsGetClockHandle)(
39 THIS
40 ) PURE;
41 };
42
43
44 typedef HRESULT (CALLBACK *LPFNCREATEINSTANCE)(IUnknown* pUnkOuter, REFIID riid, LPVOID* ppvObject);
45
46 typedef struct {
47 const GUID* riid;
48 LPFNCREATEINSTANCE lpfnCI;
49 } INTERFACE_TABLE;
50
51 /* classfactory.cpp */
52
53 IClassFactory *
54 CClassFactory_fnConstructor(
55 LPFNCREATEINSTANCE lpfnCI,
56 PLONG pcRefDll,
57 IID * riidInst);
58
59 /* datatype.cpp */
60 HRESULT
61 WINAPI
62 CKsDataTypeHandler_Constructor(
63 IUnknown * pUnkOuter,
64 REFIID riid,
65 LPVOID * ppv);
66
67 /* interface.cpp */
68 HRESULT
69 WINAPI
70 CKsInterfaceHandler_Constructor(
71 IUnknown * pUnkOuter,
72 REFIID riid,
73 LPVOID * ppv);
74
75 /* clockforward.cpp */
76 HRESULT
77 WINAPI
78 CKsClockForwarder_Constructor(
79 IUnknown * pUnkOuter,
80 REFIID riid,
81 LPVOID * ppv);
82
83 /* qualityforward.cpp */
84 HRESULT
85 WINAPI
86 CKsQualityForwarder_Constructor(
87 IUnknown * pUnkOuter,
88 REFIID riid,
89 LPVOID * ppv);
90
91 /* cvpconfig.cpp */
92 HRESULT
93 WINAPI
94 CVPConfig_Constructor(
95 IUnknown * pUnkOuter,
96 REFIID riid,
97 LPVOID * ppv);
98
99 /* cvpvbiconfig.cpp */
100 HRESULT
101 WINAPI
102 CVPVBIConfig_Constructor(
103 IUnknown * pUnkOuter,
104 REFIID riid,
105 LPVOID * ppv);
106
107 /* basicaudio.cpp */
108 HRESULT
109 WINAPI
110 CKsBasicAudio_Constructor(
111 IUnknown * pUnkOuter,
112 REFIID riid,
113 LPVOID * ppv);
114
115 /* proxy.cpp */
116 HRESULT
117 WINAPI
118 CKsProxy_Constructor(
119 IUnknown * pUnkOuter,
120 REFIID riid,
121 LPVOID * ppv);
122
123 /* input_pin.cpp */
124 HRESULT
125 WINAPI
126 CInputPin_Constructor(
127 IBaseFilter * ParentFilter,
128 LPCWSTR PinName,
129 HANDLE hFilter,
130 ULONG PinId,
131 KSPIN_COMMUNICATION Communication,
132 REFIID riid,
133 LPVOID * ppv);
134
135 /* output_pin.cpp */
136 HRESULT
137 WINAPI
138 COutputPin_Constructor(
139 IBaseFilter * ParentFilter,
140 LPCWSTR PinName,
141 ULONG PinId,
142 KSPIN_COMMUNICATION Communication,
143 REFIID riid,
144 LPVOID * ppv);
145
146 HRESULT
147 STDMETHODCALLTYPE
148 COutputPin_SetState(
149 IPin * Pin,
150 KSSTATE State);
151
152 /* enumpins.cpp */
153 HRESULT
154 WINAPI
155 CEnumPins_fnConstructor(
156 std::vector<IPin*> Pins,
157 REFIID riid,
158 LPVOID * ppv);
159
160 /* enum_mediatypes.cpp */
161 HRESULT
162 WINAPI
163 CEnumMediaTypes_fnConstructor(
164 ULONG MediaTypeCount,
165 AM_MEDIA_TYPE * MediaTypes,
166 REFIID riid,
167 LPVOID * ppv);
168
169 /* node.cpp */
170 HRESULT
171 WINAPI
172 CKsNode_Constructor(
173 IUnknown * pUnkOuter,
174 HANDLE ParentHandle,
175 ULONG NodeId,
176 ACCESS_MASK DesiredAccess,
177 REFIID riid,
178 LPVOID * ppv);
179
180 /* allocator.cpp */
181 HRESULT
182 WINAPI
183 CKsAllocator_Constructor(
184 IUnknown * pUnkOuter,
185 REFIID riid,
186 LPVOID * ppv);
187
188 /* mediasample.cpp */
189 HRESULT
190 WINAPI
191 CMediaSample_Constructor(
192 IMemAllocator* Allocator,
193 BYTE* pBuffer,
194 ULONG BufferSize,
195 REFIID riid,
196 LPVOID * ppv);
197
198
199 extern const GUID IID_IKsObject;
200 extern const GUID IID_IKsPinEx;
201 extern const GUID IID_IKsAggregateControl;
202 extern const GUID IID_IKsPinPipe;
203 extern const GUID IID_IKsPinFactory;
204 extern const GUID IID_IKsAllocatorEx;
205 extern KSPIN_INTERFACE StandardPinInterface;
206 extern KSPIN_MEDIUM StandardPinMedium;
207