xref: /reactos/sdk/include/psdk/ksmedia.h (revision 53221834)
1 /*
2     KS Media
3     (c) Andrew Greenwood, 2007.
4 
5     Please see COPYING in the top level directory for license information.
6 */
7 
8 #ifndef _KS_
9 #error ks.h needs to be included before ksmedia.h
10 #endif /* _KS_ */
11 
12 #ifndef KSMEDIA_H
13 #define KSMEDIA_H
14 
15 /*
16     KS CATEGORIES
17 */
18 
19 typedef LONGLONG REFERENCE_TIME;
20 
21 
22 #if (NTDDI_VERSION >= NTDDI_WINXP)
23 
24 #if !defined(INIT_USBAUDIO_MID)
25 #define INIT_USBAUDIO_MID(guid, id)\
26 {\
27     (guid)->Data1 = 0x4e1cecd2 + (USHORT)(id);\
28     (guid)->Data2 = 0x1679;\
29     (guid)->Data3 = 0x463b;\
30     (guid)->Data4[0] = 0xa7;\
31     (guid)->Data4[1] = 0x2f;\
32     (guid)->Data4[2] = 0xa5;\
33     (guid)->Data4[3] = 0xbf;\
34     (guid)->Data4[4] = 0x64;\
35     (guid)->Data4[5] = 0xc8;\
36     (guid)->Data4[6] = 0x6e;\
37     (guid)->Data4[7] = 0xba;\
38 }
39 #define EXTRACT_USBAUDIO_MID(guid)\
40     (USHORT)((guid)->Data1 - 0x4e1cecd2)
41 #define DEFINE_USBAUDIO_MID_GUID(id)\
42     0x4e1cecd2+(USHORT)(id), 0x1679, 0x463b, 0xa7, 0x2f, 0xa5, 0xbf, 0x64, 0xc8, 0x6e, 0xba
43 
44 #define INIT_EXBUS_MANUFACTURER_ID INIT_USBAUDIO_MID
45 
46 #define IS_COMPATIBLE_USBAUDIO_MID(guid)\
47     (((guid)->Data1 >= 0x4e1cecd2) &&\
48     ((guid)->Data1 < 0x4e1cecd2 + 0xffff) &&\
49     ((guid)->Data2 == 0x1679) &&\
50     ((guid)->Data3 == 0x463b) &&\
51     ((guid)->Data4[0] == 0xa7) &&\
52     ((guid)->Data4[1] == 0x2f) &&\
53     ((guid)->Data4[2] == 0xa5) &&\
54     ((guid)->Data4[3] == 0xbf) &&\
55     ((guid)->Data4[4] == 0x64) &&\
56     ((guid)->Data4[5] == 0xc8) &&\
57     ((guid)->Data4[6] == 0x6e) &&\
58     ((guid)->Data4[7] == 0xba))
59 #endif // !defined(INIT_USBAUDIO_MID)
60 
61 #if !defined(INIT_USBAUDIO_PID)
62 #define INIT_USBAUDIO_PID(guid, id)\
63 {\
64     (guid)->Data1 = 0xabcc5a5e + (USHORT)(id);\
65     (guid)->Data2 = 0xc263;\
66     (guid)->Data3 = 0x463b;\
67     (guid)->Data4[0] = 0xa7;\
68     (guid)->Data4[1] = 0x2f;\
69     (guid)->Data4[2] = 0xa5;\
70     (guid)->Data4[3] = 0xbf;\
71     (guid)->Data4[4] = 0x64;\
72     (guid)->Data4[5] = 0xc8;\
73     (guid)->Data4[6] = 0x6e;\
74     (guid)->Data4[7] = 0xba;\
75 }
76 #define EXTRACT_USBAUDIO_PID(guid)\
77     (USHORT)((guid)->Data1 - 0xabcc5a5e)
78 #define DEFINE_USBAUDIO_PID_GUID(id)\
79     0xabcc5a5e+(USHORT)(id), 0xc263, 0x463b, 0xa7, 0x2f, 0xa5, 0xbf, 0x64, 0xc8, 0x6e, 0xba
80 
81 #define INIT_EXBUS_PRODUCT_ID INIT_USBAUDIO_PID
82 
83 #define IS_COMPATIBLE_USBAUDIO_PID(guid)\
84     (((guid)->Data1 >= 0xabcc5a5e) &&\
85     ((guid)->Data1 < 0xabcc5a5e + 0xffff) &&\
86     ((guid)->Data2 == 0xc263) &&\
87     ((guid)->Data3 == 0x463b) &&\
88     ((guid)->Data4[0] == 0xa7) &&\
89     ((guid)->Data4[1] == 0x2f) &&\
90     ((guid)->Data4[2] == 0xa5) &&\
91     ((guid)->Data4[3] == 0xbf) &&\
92     ((guid)->Data4[4] == 0x64) &&\
93     ((guid)->Data4[5] == 0xc8) &&\
94     ((guid)->Data4[6] == 0x6e) &&\
95     ((guid)->Data4[7] == 0xba))
96 #endif // !defined(INIT_USBAUDIO_PID)
97 
98 #if !defined(INIT_USBAUDIO_PRODUCT_NAME)
99 #define INIT_USBAUDIO_PRODUCT_NAME(guid, vid, pid, strIndex)\
100 {\
101     (guid)->Data1 = 0XFC575048 + (USHORT)(vid);\
102     (guid)->Data2 = 0x2E08     + (USHORT)(pid);\
103     (guid)->Data3 = 0x463B     + (USHORT)(strIndex);\
104     (guid)->Data4[0] = 0xA7;\
105     (guid)->Data4[1] = 0x2F;\
106     (guid)->Data4[2] = 0xA5;\
107     (guid)->Data4[3] = 0xBF;\
108     (guid)->Data4[4] = 0x64;\
109     (guid)->Data4[5] = 0xC8;\
110     (guid)->Data4[6] = 0x6E;\
111     (guid)->Data4[7] = 0xBA;\
112 }
113 #define DEFINE_USBAUDIO_PRODUCT_NAME(vid, pid, strIndex)\
114     0xFC575048+(USHORT)(vid), 0x2E08+(USHORT)(pid), 0x463B+(USHORT)(strIndex), 0xA7, 0x2F, 0xA5, 0xBF, 0x64, 0xC8, 0x6E, 0xBA
115 #endif
116 
117 #define INIT_EXBUS_PRODUCT_NAME INIT_USBAUDIO_PRODUCT_NAME
118 
119 // USB Component ID
120 #define STATIC_KSCOMPONENTID_USBAUDIO \
121     0x8F1275F0, 0x26E9, 0x4264, {0xBA, 0x4D, 0x39, 0xFF, 0xF0, 0x1D, 0x94, 0xAA}
122 DEFINE_GUIDSTRUCT("8F1275F0-26E9-4264-BA4D-39FFF01D94AA", KSCOMPONENTID_USBAUDIO);
123 #define KSCOMPONENTID_USBAUDIO DEFINE_GUIDNAMED(KSCOMPONENTID_USBAUDIO)
124 
125 #endif // (NTDDI_VERSION >= NTDDI_WINXP)
126 
127 #define EXTRACT_WAVEFORMATEX_ID(Guid)\
128     (USHORT)((Guid)->Data1)
129 
130 #define DEFINE_USB_TERMINAL_GUID(id)\
131 	0xDFF219E0+(USHORT)(id), 0xF70F, 0x11D0, {0xB9, 0x17, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
132 
133 
134 /* Audio device (as presented by sysaudio) */
135 
136 #define STATIC_KSCATEGORY_AUDIO_DEVICE \
137     0xFBF6F530L, 0x07B9, 0x11D2, {0xA7, 0x1E, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88}
138 DEFINE_GUIDSTRUCT("FBF6F530-07B9-11D2-A71E-0000F8004788", KSCATEGORY_AUDIO_DEVICE);
139 #define KSCATEGORY_AUDIO_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_AUDIO_DEVICE)
140 
141 /* video */
142 #define STATIC_PINNAME_VIDEO_CAPTURE \
143     0xfb6c4281, 0x353, 0x11d1, {0x90, 0x5f, 0x0, 0x0, 0xc0, 0xcc, 0x16, 0xba}
144 #define STATIC_PINNAME_CAPTURE STATIC_PINNAME_VIDEO_CAPTURE
145 DEFINE_GUIDSTRUCT("FB6C4281-0353-11d1-905F-0000C0CC16BA", PINNAME_VIDEO_CAPTURE);
146 #define PINNAME_VIDEO_CAPTURE DEFINE_GUIDNAMED(PINNAME_VIDEO_CAPTURE)
147 #define PINNAME_CAPTURE PINNAME_VIDEO_CAPTURE
148 
149 /* Preferred devices */
150 
151 #define STATIC_KSCATEGORY_PREFERRED_WAVEOUT_DEVICE \
152     0xD6C5066EL, 0x72C1, 0x11D2, {0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88}
153 DEFINE_GUIDSTRUCT("D6C5066E-72C1-11D2-9755-0000F8004788", KSCATEGORY_PREFERRED_WAVEOUT_DEVICE);
154 #define KSCATEGORY_PREFERRED_WAVEOUT_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_PREFERRED_WAVEOUT_DEVICE)
155 
156 #define STATIC_KSCATEGORY_PREFERRED_WAVEIN_DEVICE \
157     0xD6C50671L, 0x72C1, 0x11D2, {0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88}
158 DEFINE_GUIDSTRUCT("D6C50671-72C1-11D2-9755-0000F8004788", KSCATEGORY_PREFERRED_WAVEIN_DEVICE);
159 #define KSCATEGORY_PREFERRED_WAVEIN_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_PREFERRED_WAVEIN_DEVICE)
160 
161 #define STATIC_KSCATEGORY_PREFERRED_MIDIOUT_DEVICE \
162     0xD6C50674L, 0x72C1, 0x11D2, {0x97, 0x55, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88}
163 DEFINE_GUIDSTRUCT("D6C50674-72C1-11D2-9755-0000F8004788", KSCATEGORY_PREFERRED_MIDIOUT_DEVICE);
164 #define KSCATEGORY_PREFERRED_MIDIOUT_DEVICE DEFINE_GUIDNAMED(KSCATEGORY_PREFERRED_MIDIOUT_DEVICE)
165 
166 
167 /* Media type categories */
168 
169 #define STATIC_KSCATEGORY_AUDIO \
170     0x6994AD04L, 0x93EF, 0x11D0, {0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
171 DEFINE_GUIDSTRUCT("6994AD04-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_AUDIO);
172 #define KSCATEGORY_AUDIO DEFINE_GUIDNAMED(KSCATEGORY_AUDIO)
173 
174 #define STATIC_KSCATEGORY_VIDEO \
175     0x6994AD05L, 0x93EF, 0x11D0, {0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
176 DEFINE_GUIDSTRUCT("6994AD05-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_VIDEO);
177 #define KSCATEGORY_VIDEO DEFINE_GUIDNAMED(KSCATEGORY_VIDEO)
178 
179 #define STATIC_KSCATEGORY_TEXT \
180     0x6994AD06L, 0x93EF, 0x11D0, {0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
181 DEFINE_GUIDSTRUCT("6994AD06-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_TEXT);
182 #define KSCATEGORY_TEXT DEFINE_GUIDNAMED(KSCATEGORY_TEXT)
183 
184 #define STATIC_KSCATEGORY_NETWORK \
185     0x67C9CC3CL, 0x69C4, 0x11D2, {0x87, 0x59, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
186 DEFINE_GUIDSTRUCT("67C9CC3C-69C4-11D2-8759-00A0C9223196", KSCATEGORY_NETWORK);
187 #define KSCATEGORY_NETWORK DEFINE_GUIDNAMED(KSCATEGORY_NETWORK)
188 
189 #define STATIC_KSINTERFACESETID_Media \
190     0x3A13EB40L, 0x30A7, 0x11D0, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
191 DEFINE_GUIDSTRUCT("3A13EB40-30A7-11D0-A5D6-28DB04C10000", KSINTERFACESETID_Media);
192 #define KSINTERFACESETID_Media DEFINE_GUIDNAMED(KSINTERFACESETID_Media)
193 
194 /* ... */
195 
196 #define STATIC_KSCATEGORY_TOPOLOGY \
197     0xDDA54A40L, 0x1E4C, 0x11D1, {0xA0, 0x50, 0x40, 0x57, 0x05, 0xC1, 0x00, 0x00}
198 DEFINE_GUIDSTRUCT("DDA54A40-1E4C-11D1-A050-405705C10000", KSCATEGORY_TOPOLOGY);
199 #define KSCATEGORY_TOPOLOGY DEFINE_GUIDNAMED(KSCATEGORY_TOPOLOGY)
200 
201 #define STATIC_KSCATEGORY_VIRTUAL \
202     0x3503EAC4L, 0x1F26, 0x11D1, {0x8A, 0xB0, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
203 DEFINE_GUIDSTRUCT("3503EAC4-1F26-11D1-8AB0-00A0C9223196", KSCATEGORY_VIRTUAL);
204 #define KSCATEGORY_VIRTUAL DEFINE_GUIDNAMED(KSCATEGORY_VIRTUAL)
205 
206 #define STATIC_KSCATEGORY_ACOUSTIC_ECHO_CANCEL \
207     0xBF963D80L, 0xC559, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
208 DEFINE_GUIDSTRUCT("BF963D80-C559-11D0-8A2B-00A0C9255AC1", KSCATEGORY_ACOUSTIC_ECHO_CANCEL);
209 #define KSCATEGORY_ACOUSTIC_ECHO_CANCEL DEFINE_GUIDNAMED(KSCATEGORY_ACOUSTIC_ECHO_CANCEL)
210 
211 
212 /* Component-specific */
213 
214 #define STATIC_KSCATEGORY_SYSAUDIO \
215     0xA7C7A5B1L, 0x5AF3, 0x11D1, {0x9C, 0xED, 0x00, 0xA0, 0x24, 0xBF, 0x04, 0x07}
216 DEFINE_GUIDSTRUCT("A7C7A5B1-5AF3-11D1-9CED-00A024BF0407", KSCATEGORY_SYSAUDIO);
217 #define KSCATEGORY_SYSAUDIO DEFINE_GUIDNAMED(KSCATEGORY_SYSAUDIO)
218 
219 #define STATIC_KSCATEGORY_WDMAUD \
220     0x3E227E76L, 0x690D, 0x11D2, {0x81, 0x61, 0x00, 0x00, 0xF8, 0x77, 0x5B, 0xF1}
221 DEFINE_GUIDSTRUCT("3E227E76-690D-11D2-8161-0000F8775BF1", KSCATEGORY_WDMAUD);
222 #define KSCATEGORY_WDMAUD DEFINE_GUIDNAMED(KSCATEGORY_WDMAUD)
223 
224 #define STATIC_KSCATEGORY_AUDIO_GFX \
225     0x9BAF9572L, 0x340C, 0x11D3, {0xAB, 0xDC, 0x00, 0xA0, 0xC9, 0x0A, 0xB1, 0x6F}
226 DEFINE_GUIDSTRUCT("9BAF9572-340C-11D3-ABDC-00A0C90AB16F", KSCATEGORY_AUDIO_GFX);
227 #define KSCATEGORY_AUDIO_GFX DEFINE_GUIDNAMED(KSCATEGORY_AUDIO_GFX)
228 
229 #define STATIC_KSCATEGORY_AUDIO_SPLITTER \
230     0x9EA331FAL, 0xB91B, 0x45F8, {0x92, 0x85, 0xBD, 0x2B, 0xC7, 0x7A, 0xFC, 0xDE}
231 DEFINE_GUIDSTRUCT("9EA331FA-B91B-45F8-9285-BD2BC77AFCDE", KSCATEGORY_AUDIO_SPLITTER);
232 #define KSCATEGORY_AUDIO_SPLITTER DEFINE_GUIDNAMED(KSCATEGORY_AUDIO_SPLITTER)
233 
234 #define STATIC_KSCATEGORY_SYNTHESIZER STATIC_KSNODETYPE_SYNTHESIZER
235 #define KSCATEGORY_SYNTHESIZER KSNODETYPE_SYNTHESIZER
236 
237 #define STATIC_KSCATEGORY_DRM_DESCRAMBLE STATIC_KSNODETYPE_DRM_DESCRAMBLE
238 #define KSCATEGORY_DRM_DESCRAMBLE KSNODETYPE_DRM_DESCRAMBLE
239 
240 #define STATIC_KSDATAFORMAT_SPECIFIER_ANALOGVIDEO \
241     0x0482DDE0L, 0x7817, 0x11CF, {0x8A, 0x03, 0x00, 0xAA, 0x00, 0x6E, 0xCB, 0x65}
242 DEFINE_GUIDSTRUCT("0482DDE0-7817-11CF-8A03-00AA006ECB65", KSDATAFORMAT_SPECIFIER_ANALOGVIDEO);
243 #define KSDATAFORMAT_SPECIFIER_ANALOGVIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_ANALOGVIDEO)
244 
245 #define STATIC_KSDATAFORMAT_TYPE_ANALOGVIDEO \
246     0x0482DDE1L, 0x7817, 0x11CF, {0x8A, 0x03, 0x00, 0xAA, 0x00, 0x6E, 0xCB, 0x65}
247 DEFINE_GUIDSTRUCT("0482DDE1-7817-11CF-8A03-00AA006ECB65", KSDATAFORMAT_TYPE_ANALOGVIDEO);
248 #define KSDATAFORMAT_TYPE_ANALOGVIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_ANALOGVIDEO)
249 
250 #define STATIC_PINNAME_VIDEO_ANALOGVIDEOIN \
251     0xFB6C4283L, 0x0353, 0x11D1, {0x90, 0x5F, 0x00, 0x00, 0xC0, 0xCC, 0x16, 0xBA}
252 DEFINE_GUIDSTRUCT("FB6C4283-0353-11D1-905F-0000C0CC16BA", PINNAME_VIDEO_ANALOGVIDEOIN);
253 #define PINNAME_VIDEO_ANALOGVIDEOIN DEFINE_GUIDNAMED(PINNAME_VIDEO_ANALOGVIDEOIN)
254 
255 /*
256     Nodes
257 */
258 
259 #define STATIC_KSNODETYPE_ADC\
260     0x4D837FE0L, 0xC555, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
261 DEFINE_GUIDSTRUCT("4D837FE0-C555-11D0-8A2B-00A0C9255AC1", KSNODETYPE_ADC);
262 #define KSNODETYPE_ADC DEFINE_GUIDNAMED(KSNODETYPE_ADC)
263 
264 #define STATIC_KSNODETYPE_AGC\
265     0xE88C9BA0L, 0xC557, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
266 DEFINE_GUIDSTRUCT("E88C9BA0-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_AGC);
267 #define KSNODETYPE_AGC DEFINE_GUIDNAMED(KSNODETYPE_AGC)
268 
269 #define STATIC_KSNODETYPE_3D_EFFECTS\
270     0x55515860L, 0xC559, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
271 DEFINE_GUIDSTRUCT("55515860-C559-11D0-8A2B-00A0C9255AC1", KSNODETYPE_3D_EFFECTS);
272 #define KSNODETYPE_3D_EFFECTS DEFINE_GUIDNAMED(KSNODETYPE_3D_EFFECTS)
273 
274 #define STATIC_KSNODETYPE_SUPERMIX\
275     0xE573ADC0L, 0xC555, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
276 DEFINE_GUIDSTRUCT("E573ADC0-C555-11D0-8A2B-00A0C9255AC1", KSNODETYPE_SUPERMIX);
277 #define KSNODETYPE_SUPERMIX DEFINE_GUIDNAMED(KSNODETYPE_SUPERMIX)
278 
279 #define STATIC_KSNODETYPE_SRC\
280     0x9DB7B9E0L, 0xC555, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
281 DEFINE_GUIDSTRUCT("9DB7B9E0-C555-11D0-8A2B-00A0C9255AC1", KSNODETYPE_SRC);
282 #define KSNODETYPE_SRC DEFINE_GUIDNAMED(KSNODETYPE_SRC)
283 
284 #define STATIC_KSNODETYPE_DAC\
285     0x507AE360L, 0xC554, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
286 DEFINE_GUIDSTRUCT("507AE360-C554-11D0-8A2B-00A0C9255AC1", KSNODETYPE_DAC);
287 #define KSNODETYPE_DAC DEFINE_GUIDNAMED(KSNODETYPE_DAC)
288 
289 #define STATIC_KSNODETYPE_SPDIF_INTERFACE\
290     DEFINE_USB_TERMINAL_GUID(0x0605)
291 DEFINE_GUIDSTRUCT("DFF21FE5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SPDIF_INTERFACE);
292 #define KSNODETYPE_SPDIF_INTERFACE DEFINE_GUIDNAMED(KSNODETYPE_SPDIF_INTERFACE)
293 
294 #define STATIC_KSNODETYPE_MICROPHONE\
295     DEFINE_USB_TERMINAL_GUID(0x0201)
296 DEFINE_GUIDSTRUCT("DFF21BE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_MICROPHONE);
297 #define KSNODETYPE_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_MICROPHONE)
298 
299 #define STATIC_KSNODETYPE_CD_PLAYER\
300     DEFINE_USB_TERMINAL_GUID(0x0703)
301 DEFINE_GUIDSTRUCT("DFF220E3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_CD_PLAYER);
302 #define KSNODETYPE_CD_PLAYER DEFINE_GUIDNAMED(KSNODETYPE_CD_PLAYER)
303 
304 #define STATIC_KSNODETYPE_CHORUS\
305     0x20173F20L, 0xC559, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
306 DEFINE_GUIDSTRUCT("20173F20-C559-11D0-8A2B-00A0C9255AC1", KSNODETYPE_CHORUS);
307 #define KSNODETYPE_CHORUS DEFINE_GUIDNAMED(KSNODETYPE_CHORUS)
308 
309 #define STATIC_KSNODETYPE_REVERB\
310     0xEF0328E0L, 0xC558, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
311 DEFINE_GUIDSTRUCT("EF0328E0-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_REVERB);
312 #define KSNODETYPE_REVERB DEFINE_GUIDNAMED(KSNODETYPE_REVERB)
313 
314 
315 #define STATIC_KSNODETYPE_LINE_CONNECTOR\
316     DEFINE_USB_TERMINAL_GUID(0x0603)
317 DEFINE_GUIDSTRUCT("DFF21FE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_LINE_CONNECTOR);
318 #define KSNODETYPE_LINE_CONNECTOR DEFINE_GUIDNAMED(KSNODETYPE_LINE_CONNECTOR)
319 
320 #define STATIC_KSNODETYPE_ANALOG_CONNECTOR\
321     DEFINE_USB_TERMINAL_GUID(0x601)
322 DEFINE_GUIDSTRUCT("DFF21FE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ANALOG_CONNECTOR);
323 #define KSNODETYPE_ANALOG_CONNECTOR DEFINE_GUIDNAMED(KSNODETYPE_ANALOG_CONNECTOR)
324 
325 #define STATIC_KSNODETYPE_SPEAKER\
326     DEFINE_USB_TERMINAL_GUID(0x0301)
327 DEFINE_GUIDSTRUCT("DFF21CE1-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SPEAKER);
328 #define KSNODETYPE_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_SPEAKER)
329 
330 #define STATIC_KSAUDFNAME_RECORDING_CONTROL\
331     0x185FEDFAL, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
332 DEFINE_GUIDSTRUCT("185FEDFA-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_RECORDING_CONTROL);
333 #define KSAUDFNAME_RECORDING_CONTROL DEFINE_GUIDNAMED(KSAUDFNAME_RECORDING_CONTROL)
334 
335 #define STATIC_KSNODETYPE_VOLUME\
336     0x3A5ACC00L, 0xC557, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
337 DEFINE_GUIDSTRUCT("3A5ACC00-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_VOLUME);
338 #define KSNODETYPE_VOLUME DEFINE_GUIDNAMED(KSNODETYPE_VOLUME)
339 
340 #define STATIC_KSAUDFNAME_WAVE_VOLUME\
341     0x185FEDE5L, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
342 DEFINE_GUIDSTRUCT("185FEDE5-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_WAVE_VOLUME);
343 #define KSAUDFNAME_WAVE_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_WAVE_VOLUME)
344 
345 #define STATIC_KSNODETYPE_MUTE\
346     0x02B223C0L, 0xC557, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
347 DEFINE_GUIDSTRUCT("02B223C0-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_MUTE);
348 #define KSNODETYPE_MUTE DEFINE_GUIDNAMED(KSNODETYPE_MUTE)
349 
350 #define STATIC_KSAUDFNAME_WAVE_MUTE\
351     0x185FEDE6L, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
352 DEFINE_GUIDSTRUCT("185FEDE6-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_WAVE_MUTE);
353 #define KSAUDFNAME_WAVE_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_WAVE_MUTE)
354 
355 #define STATIC_KSAUDFNAME_MIC_VOLUME\
356     0x185FEDEDL, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
357 DEFINE_GUIDSTRUCT("185FEDED-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIC_VOLUME);
358 #define KSAUDFNAME_MIC_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MIC_VOLUME)
359 
360 #define STATIC_KSNODETYPE_SUM\
361     0xDA441A60L, 0xC556, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
362 DEFINE_GUIDSTRUCT("DA441A60-C556-11D0-8A2B-00A0C9255AC1", KSNODETYPE_SUM);
363 #define KSNODETYPE_SUM DEFINE_GUIDNAMED(KSNODETYPE_SUM)
364 
365 #define STATIC_KSAUDFNAME_MASTER_VOLUME\
366     0x185FEDE3L, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
367 DEFINE_GUIDSTRUCT("185FEDE3-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MASTER_VOLUME);
368 #define KSAUDFNAME_MASTER_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MASTER_VOLUME)
369 
370 #define STATIC_KSAUDFNAME_CD_VOLUME\
371     0x185FEDE9L, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
372 DEFINE_GUIDSTRUCT("185FEDE9-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_CD_VOLUME);
373 #define KSAUDFNAME_CD_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_CD_VOLUME)
374 
375 #define STATIC_KSAUDFNAME_RECORDING_SOURCE\
376     0x185FEDEFL, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
377 DEFINE_GUIDSTRUCT("185FEDEF-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_RECORDING_SOURCE);
378 #define KSAUDFNAME_RECORDING_SOURCE DEFINE_GUIDNAMED(KSAUDFNAME_RECORDING_SOURCE)
379 
380 #define STATIC_KSAUDFNAME_LINE_IN_VOLUME\
381     0x185FEDF4L, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
382 DEFINE_GUIDSTRUCT("185FEDF4-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_LINE_IN_VOLUME);
383 #define KSAUDFNAME_LINE_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_LINE_IN_VOLUME)
384 
385 #define STATIC_KSAUDFNAME_AUX_VOLUME\
386     0x185FEDFCL, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
387 DEFINE_GUIDSTRUCT("185FEDFC-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_AUX_VOLUME);
388 #define KSAUDFNAME_AUX_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_AUX_VOLUME)
389 
390 #define STATIC_KSAUDFNAME_MIC_IN_VOLUME\
391     0x185FEDF5L, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
392 DEFINE_GUIDSTRUCT("185FEDF5-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIC_IN_VOLUME);
393 #define KSAUDFNAME_MIC_IN_VOLUME DEFINE_GUIDNAMED(KSAUDFNAME_MIC_IN_VOLUME)
394 
395 #define STATIC_KSNODETYPE_LOUDNESS\
396     0x41887440L, 0xC558, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
397 DEFINE_GUIDSTRUCT("41887440-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_LOUDNESS);
398 #define KSNODETYPE_LOUDNESS DEFINE_GUIDNAMED(KSNODETYPE_LOUDNESS)
399 
400 #define STATIC_KSAUDFNAME_MICROPHONE_BOOST\
401     0x2bc31d6aL, 0x96e3, 0x11d2, {0xac, 0x4c, 0x0, 0xc0, 0x4f, 0x8e, 0xfb, 0x68}
402 DEFINE_GUIDSTRUCT("2BC31D6A-96E3-11d2-AC4C-00C04F8EFB68", KSAUDFNAME_MICROPHONE_BOOST);
403 #define KSAUDFNAME_MICROPHONE_BOOST DEFINE_GUIDNAMED(KSAUDFNAME_MICROPHONE_BOOST)
404 
405 #define STATIC_KSAUDFNAME_CD_MUTE\
406     0x185FEDEAL, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
407 DEFINE_GUIDSTRUCT("185FEDEA-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_CD_MUTE);
408 #define KSAUDFNAME_CD_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_CD_MUTE)
409 
410 #define STATIC_KSAUDFNAME_LINE_MUTE\
411     0x185FEDECL, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
412 DEFINE_GUIDSTRUCT("185FEDEC-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_LINE_MUTE);
413 #define KSAUDFNAME_LINE_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_LINE_MUTE)
414 
415 #define STATIC_KSAUDFNAME_MIC_MUTE\
416     0x185FEDEEL, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
417 DEFINE_GUIDSTRUCT("185FEDEE-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIC_MUTE);
418 #define KSAUDFNAME_MIC_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MIC_MUTE)
419 
420 #define STATIC_KSAUDFNAME_AUX_MUTE\
421     0x185FEDFDL, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
422 DEFINE_GUIDSTRUCT("185FEDFD-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_AUX_MUTE);
423 #define KSAUDFNAME_AUX_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_AUX_MUTE)
424 
425 #define STATIC_KSAUDFNAME_VOLUME_CONTROL\
426     0x185FEDF7L, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
427 DEFINE_GUIDSTRUCT("185FEDF7-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_VOLUME_CONTROL);
428 #define KSAUDFNAME_VOLUME_CONTROL DEFINE_GUIDNAMED(KSAUDFNAME_VOLUME_CONTROL)
429 
430 #define STATIC_KSNODETYPE_MUX\
431     0x2CEAF780L, 0xC556, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
432 DEFINE_GUIDSTRUCT("2CEAF780-C556-11D0-8A2B-00A0C9255AC1", KSNODETYPE_MUX);
433 #define KSNODETYPE_MUX DEFINE_GUIDNAMED(KSNODETYPE_MUX)
434 
435 #define STATIC_KSAUDFNAME_MASTER_MUTE\
436     0x185FEDE4L, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
437 DEFINE_GUIDSTRUCT("185FEDE4-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MASTER_MUTE);
438 #define KSAUDFNAME_MASTER_MUTE DEFINE_GUIDNAMED(KSAUDFNAME_MASTER_MUTE)
439 
440 #define STATIC_KSNODETYPE_PEAKMETER\
441     0xa085651eL, 0x5f0d, 0x4b36, {0xa8, 0x69, 0xd1, 0x95, 0xd6, 0xab, 0x4b, 0x9e}
442 DEFINE_GUIDSTRUCT("A085651E-5F0D-4b36-A869-D195D6AB4B9E", KSNODETYPE_PEAKMETER);
443 #define KSNODETYPE_PEAKMETER DEFINE_GUIDNAMED(KSNODETYPE_PEAKMETER)
444 
445 #define STATIC_KSNODETYPE_STEREO_WIDE\
446     0xA9E69800L, 0xC558, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
447 DEFINE_GUIDSTRUCT("A9E69800-C558-11D0-8A2B-00A0C9255AC1", KSNODETYPE_STEREO_WIDE);
448 #define KSNODETYPE_STEREO_WIDE DEFINE_GUIDNAMED(KSNODETYPE_STEREO_WIDE)
449 
450 #define STATIC_KSNODETYPE_TONE\
451     0x7607E580L, 0xC557, 0x11D0, {0x8A, 0x2B, 0x00, 0xA0, 0xC9, 0x25, 0x5A, 0xC1}
452 DEFINE_GUIDSTRUCT("7607E580-C557-11D0-8A2B-00A0C9255AC1", KSNODETYPE_TONE);
453 #define KSNODETYPE_TONE DEFINE_GUIDNAMED(KSNODETYPE_TONE)
454 
455 
456 #define STATIC_KSNODETYPE_DESKTOP_MICROPHONE\
457     DEFINE_USB_TERMINAL_GUID(0x0202)
458 DEFINE_GUIDSTRUCT("DFF21BE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DESKTOP_MICROPHONE);
459 #define KSNODETYPE_DESKTOP_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_DESKTOP_MICROPHONE)
460 
461 #define STATIC_KSNODETYPE_PERSONAL_MICROPHONE\
462     DEFINE_USB_TERMINAL_GUID(0x0203)
463 DEFINE_GUIDSTRUCT("DFF21BE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_PERSONAL_MICROPHONE);
464 #define KSNODETYPE_PERSONAL_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_PERSONAL_MICROPHONE)
465 
466 #define STATIC_KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE\
467     DEFINE_USB_TERMINAL_GUID(0x0204)
468 DEFINE_GUIDSTRUCT("DFF21BE4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE);
469 #define KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE DEFINE_GUIDNAMED(KSNODETYPE_OMNI_DIRECTIONAL_MICROPHONE)
470 
471 #define STATIC_KSNODETYPE_MICROPHONE_ARRAY\
472     DEFINE_USB_TERMINAL_GUID(0x0205)
473 DEFINE_GUIDSTRUCT("DFF21BE5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_MICROPHONE_ARRAY);
474 #define KSNODETYPE_MICROPHONE_ARRAY DEFINE_GUIDNAMED(KSNODETYPE_MICROPHONE_ARRAY)
475 
476 #define STATIC_KSNODETYPE_PROCESSING_MICROPHONE_ARRAY\
477     DEFINE_USB_TERMINAL_GUID(0x0206)
478 DEFINE_GUIDSTRUCT("DFF21BE6-F70F-11D0-B917-00A0C9223196", KSNODETYPE_PROCESSING_MICROPHONE_ARRAY);
479 #define KSNODETYPE_PROCESSING_MICROPHONE_ARRAY DEFINE_GUIDNAMED(KSNODETYPE_PROCESSING_MICROPHONE_ARRAY)
480 
481 #define STATIC_KSNODETYPE_HEADPHONES\
482     DEFINE_USB_TERMINAL_GUID(0x0302)
483 DEFINE_GUIDSTRUCT("DFF21CE2-F70F-11D0-B917-00A0C9223196", KSNODETYPE_HEADPHONES);
484 #define KSNODETYPE_HEADPHONES DEFINE_GUIDNAMED(KSNODETYPE_HEADPHONES)
485 
486 #define STATIC_KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO\
487     DEFINE_USB_TERMINAL_GUID(0x0303)
488 DEFINE_GUIDSTRUCT("DFF21CE3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO);
489 #define KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO DEFINE_GUIDNAMED(KSNODETYPE_HEAD_MOUNTED_DISPLAY_AUDIO)
490 
491 #define STATIC_KSNODETYPE_DESKTOP_SPEAKER\
492     DEFINE_USB_TERMINAL_GUID(0x0304)
493 DEFINE_GUIDSTRUCT("DFF21CE4-F70F-11D0-B917-00A0C9223196", KSNODETYPE_DESKTOP_SPEAKER);
494 #define KSNODETYPE_DESKTOP_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_DESKTOP_SPEAKER)
495 
496 #define STATIC_KSNODETYPE_ROOM_SPEAKER\
497     DEFINE_USB_TERMINAL_GUID(0x0305)
498 DEFINE_GUIDSTRUCT("DFF21CE5-F70F-11D0-B917-00A0C9223196", KSNODETYPE_ROOM_SPEAKER);
499 #define KSNODETYPE_ROOM_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_ROOM_SPEAKER)
500 
501 #define STATIC_KSNODETYPE_COMMUNICATION_SPEAKER\
502     DEFINE_USB_TERMINAL_GUID(0x0306)
503 DEFINE_GUIDSTRUCT("DFF21CE6-F70F-11D0-B917-00A0C9223196", KSNODETYPE_COMMUNICATION_SPEAKER);
504 #define KSNODETYPE_COMMUNICATION_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_COMMUNICATION_SPEAKER)
505 
506 #define STATIC_KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER\
507     DEFINE_USB_TERMINAL_GUID(0x0307)
508 DEFINE_GUIDSTRUCT("DFF21CE7-F70F-11D0-B917-00A0C9223196", KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER);
509 #define KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER DEFINE_GUIDNAMED(KSNODETYPE_LOW_FREQUENCY_EFFECTS_SPEAKER)
510 
511 
512 /*
513     Pins
514 */
515 
516 #define STATIC_KSCATEGORY_WDMAUD_USE_PIN_NAME \
517     0x47A4FA20L, 0xA251, 0x11D1, {0xA0, 0x50, 0x00, 0x00, 0xF8, 0x00, 0x47, 0x88}
518 DEFINE_GUIDSTRUCT("47A4FA20-A251-11D1-A050-0000F8004788", KSCATEGORY_WDMAUD_USE_PIN_NAME);
519 #define KSCATEGORY_WDMAUD_USE_PIN_NAME DEFINE_GUIDNAMED(KSCATEGORY_WDMAUD_USE_PIN_NAME)
520 
521 
522 /*
523     Formats
524 */
525 
526 //#if defined(_INC_MMREG)
527 #if !defined( PACK_PRAGMAS_NOT_SUPPORTED )
528 #include <pshpack1.h>
529 #endif
530 typedef struct {
531     KSDATAFORMAT    DataFormat;
532     WAVEFORMATEX    WaveFormatEx;
533 } KSDATAFORMAT_WAVEFORMATEX, *PKSDATAFORMAT_WAVEFORMATEX;
534 
535 #ifndef _WAVEFORMATEXTENSIBLE_
536 #define _WAVEFORMATEXTENSIBLE_
537 typedef struct {
538     WAVEFORMATEX    Format;
539     union
540     {
541         WORD wValidBitsPerSample;
542         WORD wSamplesPerBlock;
543         WORD wReserved;
544     }Samples;
545     DWORD dwChannelMask;
546     GUID SubFormat;
547 } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
548 #endif
549 
550 #if !defined(WAVE_FORMAT_EXTENSIBLE)
551 #define  WAVE_FORMAT_EXTENSIBLE                 0xFFFE
552 #endif
553 
554 typedef struct {
555     ULONG               Flags;
556     ULONG               Control;
557     WAVEFORMATEX        WaveFormatEx;
558 } KSDSOUND_BUFFERDESC, *PKSDSOUND_BUFFERDESC;
559 
560 typedef struct {
561     KSDATAFORMAT        DataFormat;
562     KSDSOUND_BUFFERDESC BufferDesc;
563 } KSDATAFORMAT_DSOUND, *PKSDATAFORMAT_DSOUND;
564 
565 #if !defined( PACK_PRAGMAS_NOT_SUPPORTED )
566 #include <poppack.h>
567 #endif
568 
569 //#endif
570 
571 typedef enum {
572     KSPROPERTY_ALLOCATOR_CONTROL_HONOR_COUNT,
573     KSPROPERTY_ALLOCATOR_CONTROL_SURFACE_SIZE,
574     KSPROPERTY_ALLOCATOR_CONTROL_CAPTURE_CAPS,
575     KSPROPERTY_ALLOCATOR_CONTROL_CAPTURE_INTERLEAVE
576 } KSPROPERTY_ALLOCATOR_CONTROL;
577 
578 typedef struct {
579    KSDATARANGE              DataRange;
580    ULONG                    MaximumChannels;
581    ULONG                    MinimumBitsPerSample;
582    ULONG                    MaximumBitsPerSample;
583    ULONG                    MinimumSampleFrequency;
584    ULONG                    MaximumSampleFrequency;
585 } KSDATARANGE_AUDIO, *PKSDATARANGE_AUDIO;
586 
587 typedef struct tagKS_AnalogVideoInfo {
588     RECT rcSource;
589     RECT rcTarget;
590     DWORD dwActiveWidth;
591     DWORD dwActiveHeight;
592     REFERENCE_TIME AvgTimePerFrame;
593 } KS_ANALOGVIDEOINFO, *PKS_ANALOGVIDEOINFO;
594 
595 typedef struct tagKS_DATARANGE_ANALOGVIDEO {
596     KSDATARANGE DataRange;
597     KS_ANALOGVIDEOINFO AnalogVideoInfo;
598 } KS_DATARANGE_ANALOGVIDEO, *PKS_DATARANGE_ANALOGVIDEO;
599 
600 typedef enum {
601     KS_TUNER_TUNING_EXACT = 1,
602     KS_TUNER_TUNING_FINE,
603     KS_TUNER_TUNING_COARSE,
604 } KS_TUNER_TUNING_FLAGS;
605 
606 typedef enum {
607     KS_TUNER_STRATEGY_PLL = 0x01,
608     KS_TUNER_STRATEGY_SIGNAL_STRENGTH = 0x02,
609     KS_TUNER_STRATEGY_DRIVER_TUNES = 0x04,
610 } KS_TUNER_STRATEGY;
611 
612 typedef struct {
613     KSPROPERTY Property;
614     ULONG ModesSupported;
615     KSPIN_MEDIUM VideoMedium;
616     KSPIN_MEDIUM TVAudioMedium;
617     KSPIN_MEDIUM RadioAudioMedium;
618 } KSPROPERTY_TUNER_CAPS_S, *PKSPROPERTY_TUNER_CAPS_S;
619 
620 typedef struct {
621     KSPROPERTY Property;
622     KSPIN_MEDIUM IFMedium;
623 } KSPROPERTY_TUNER_IF_MEDIUM_S, *PKSPROPERTY_TUNER_IF_MEDIUM_S;
624 
625 typedef struct {
626     KSPROPERTY Property;
627     ULONG Mode;
628 } KSPROPERTY_TUNER_MODE_S, *PKSPROPERTY_TUNER_MODE_S;
629 
630 typedef struct {
631     KSPROPERTY Property;
632     ULONG Frequency;
633     ULONG LastFrequency;
634     ULONG TuningFlags;
635     ULONG VideoSubChannel;
636     ULONG AudioSubChannel;
637     ULONG Channel;
638     ULONG Country;
639 } KSPROPERTY_TUNER_FREQUENCY_S, *PKSPROPERTY_TUNER_FREQUENCY_S;
640 
641 typedef struct {
642     KSPROPERTY Property;
643     ULONG Standard;
644 } KSPROPERTY_TUNER_STANDARD_S, *PKSPROPERTY_TUNER_STANDARD_S;
645 
646 typedef struct {
647     KSPROPERTY Property;
648     ULONG InputIndex;
649 } KSPROPERTY_TUNER_INPUT_S, *PKSPROPERTY_TUNER_INPUT_S;
650 
651 typedef struct {
652     KSPROPERTY Property;
653     ULONG CurrentFrequency;
654     ULONG PLLOffset;
655     ULONG SignalStrength;
656     ULONG Busy;
657 } KSPROPERTY_TUNER_STATUS_S, *PKSPROPERTY_TUNER_STATUS_S;
658 
659 typedef enum {
660     KSEVENT_TUNER_CHANGED,
661     KSEVENT_TUNER_INITIATE_SCAN
662 } KSEVENT_TUNER;
663 
664 typedef enum {
665     KS_AnalogVideo_None        = 0x00000000,
666     KS_AnalogVideo_NTSC_M      = 0x00000001,
667     KS_AnalogVideo_NTSC_M_J    = 0x00000002,
668     KS_AnalogVideo_NTSC_433    = 0x00000004,
669     KS_AnalogVideo_PAL_B       = 0x00000010,
670     KS_AnalogVideo_PAL_D       = 0x00000020,
671     KS_AnalogVideo_PAL_G       = 0x00000040,
672     KS_AnalogVideo_PAL_H       = 0x00000080,
673     KS_AnalogVideo_PAL_I       = 0x00000100,
674     KS_AnalogVideo_PAL_M       = 0x00000200,
675     KS_AnalogVideo_PAL_N       = 0x00000400,
676     KS_AnalogVideo_PAL_60      = 0x00000800,
677     KS_AnalogVideo_SECAM_B     = 0x00001000,
678     KS_AnalogVideo_SECAM_D     = 0x00002000,
679     KS_AnalogVideo_SECAM_G     = 0x00004000,
680     KS_AnalogVideo_SECAM_H     = 0x00008000,
681     KS_AnalogVideo_SECAM_K     = 0x00010000,
682     KS_AnalogVideo_SECAM_K1    = 0x00020000,
683     KS_AnalogVideo_SECAM_L     = 0x00040000,
684     KS_AnalogVideo_SECAM_L1    = 0x00080000,
685     KS_AnalogVideo_PAL_N_COMBO = 0x00100000
686 } KS_AnalogVideoStandard;
687 
688 typedef struct {
689     KSPROPERTY Property;
690     ULONG Mode;
691     ULONG StandardsSupported;
692     ULONG MinFrequency;
693     ULONG MaxFrequency;
694     ULONG TuningGranularity;
695     ULONG NumberOfInputs;
696     ULONG SettlingTime;
697     ULONG Strategy;
698 } KSPROPERTY_TUNER_MODE_CAPS_S, *PKSPROPERTY_TUNER_MODE_CAPS_S;
699 
700 typedef struct tagKS_BITMAPINFOHEADER {
701     DWORD biSize;
702     LONG biWidth;
703     LONG biHeight;
704     WORD biPlanes;
705     WORD biBitCount;
706     DWORD biCompression;
707     DWORD biSizeImage;
708     LONG biXPelsPerMeter;
709     LONG biYPelsPerMeter;
710     DWORD biClrUsed;
711     DWORD biClrImportant;
712 } KS_BITMAPINFOHEADER, *PKS_BITMAPINFOHEADER;
713 
714 typedef struct _KS_VIDEO_STREAM_CONFIG_CAPS {
715     GUID guid;
716     ULONG VideoStandard;
717     SIZE InputSize;
718     SIZE MinCroppingSize;
719     SIZE MaxCroppingSize;
720     int CropGranularityX;
721     int CropGranularityY;
722     int CropAlignX;
723     int CropAlignY;
724     SIZE MinOutputSize;
725     SIZE MaxOutputSize;
726     int OutputGranularityX;
727     int OutputGranularityY;
728     int StretchTapsX;
729     int StretchTapsY;
730     int ShrinkTapsX;
731     int ShrinkTapsY;
732     LONGLONG MinFrameInterval;
733     LONGLONG MaxFrameInterval;
734     LONG MinBitsPerSecond;
735     LONG MaxBitsPerSecond;
736 } KS_VIDEO_STREAM_CONFIG_CAPS, *PKS_VIDEO_STREAM_CONFIG_CAPS;
737 
738 typedef struct tagKS_FRAME_INFO {
739     ULONG ExtendedHeaderSize;
740     DWORD dwFrameFlags;
741     LONGLONG PictureNumber;
742     LONGLONG DropCount;
743     HANDLE hDirectDraw;
744     HANDLE hSurfaceHandle;
745     RECT DirectDrawRect;
746     union {
747         LONG lSurfacePitch;
748         DWORD Reserved1;
749     };
750     DWORD Reserved2;
751     union {
752         struct {
753             DWORD Reserved3;
754             DWORD Reserved4;
755         };
756         ULONGLONG FrameCompletionNumber;
757     };
758 } KS_FRAME_INFO, *PKS_FRAME_INFO;
759 
760 typedef struct tagKS_VIDEOINFOHEADER {
761     RECT rcSource;
762     RECT rcTarget;
763     DWORD dwBitRate;
764     DWORD dwBitErrorRate;
765     REFERENCE_TIME AvgTimePerFrame;
766     KS_BITMAPINFOHEADER bmiHeader;
767 } KS_VIDEOINFOHEADER, *PKS_VIDEOINFOHEADER;
768 
769 typedef struct tagKS_VIDEOINFOHEADER2 {
770     RECT rcSource;
771     RECT rcTarget;
772     DWORD dwBitRate;
773     DWORD dwBitErrorRate;
774     REFERENCE_TIME AvgTimePerFrame;
775     DWORD dwInterlaceFlags;
776     DWORD dwCopyProtectFlags;
777     DWORD dwPictAspectRatioX;
778     DWORD dwPictAspectRatioY;
779     union {
780         DWORD dwControlFlags;
781         DWORD dwReserved1;
782     };
783     DWORD dwReserved2;
784     KS_BITMAPINFOHEADER bmiHeader;
785 } KS_VIDEOINFOHEADER2, *PKS_VIDEOINFOHEADER2;
786 
787 typedef struct tagKS_DATARANGE_VIDEO {
788     KSDATARANGE DataRange;
789     BOOL bFixedSizeSamples;
790     BOOL bTemporalCompression;
791     DWORD StreamDescriptionFlags;
792     DWORD MemoryAllocationFlags;
793     KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps;
794     KS_VIDEOINFOHEADER VideoInfoHeader;
795 } KS_DATARANGE_VIDEO, *PKS_DATARANGE_VIDEO;
796 
797 typedef struct tagKS_DATARANGE_VIDEO2 {
798     KSDATARANGE DataRange;
799     BOOL bFixedSizeSamples;
800     BOOL bTemporalCompression;
801     DWORD StreamDescriptionFlags;
802     DWORD MemoryAllocationFlags;
803     KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps;
804     KS_VIDEOINFOHEADER2 VideoInfoHeader;
805 } KS_DATARANGE_VIDEO2, *PKS_DATARANGE_VIDEO2;
806 
807 typedef struct tagKS_VBIINFOHEADER {
808     ULONG StartLine;
809     ULONG EndLine;
810     ULONG SamplingFrequency;
811     ULONG MinLineStartTime;
812     ULONG MaxLineStartTime;
813     ULONG ActualLineStartTime;
814     ULONG ActualLineEndTime;
815     ULONG VideoStandard;
816     ULONG SamplesPerLine;
817     ULONG StrideInBytes;
818     ULONG BufferSize;
819 } KS_VBIINFOHEADER, *PKS_VBIINFOHEADER;
820 
821 typedef struct tagKS_DATARANGE_VIDEO_VBI {
822     KSDATARANGE DataRange;
823     BOOL bFixedSizeSamples;
824     BOOL bTemporalCompression;
825     DWORD StreamDescriptionFlags;
826     DWORD MemoryAllocationFlags;
827     KS_VIDEO_STREAM_CONFIG_CAPS ConfigCaps;
828     KS_VBIINFOHEADER VBIInfoHeader;
829 } KS_DATARANGE_VIDEO_VBI, *PKS_DATARANGE_VIDEO_VBI;
830 
831 typedef struct tagKS_TVTUNER_CHANGE_INFO {
832     DWORD dwFlags;
833     DWORD dwCountryCode;
834     DWORD dwAnalogVideoStandard;
835     DWORD dwChannel;
836 } KS_TVTUNER_CHANGE_INFO, *PKS_TVTUNER_CHANGE_INFO;
837 
838 typedef struct {
839     KSPROPERTY Property;
840     ULONG IndexInputPin;
841     ULONG IndexOutputPin;
842     ULONG CanRoute;
843 } KSPROPERTY_CROSSBAR_ROUTE_S, *PKSPROPERTY_CROSSBAR_ROUTE_S;
844 
845 typedef struct tagKS_VBI_FRAME_INFO {
846     ULONG ExtendedHeaderSize;
847     DWORD dwFrameFlags;
848     LONGLONG PictureNumber;
849     LONGLONG DropCount;
850     DWORD dwSamplingFrequency;
851     KS_TVTUNER_CHANGE_INFO TvTunerChangeInfo;
852     KS_VBIINFOHEADER VBIInfoHeader;
853 } KS_VBI_FRAME_INFO, *PKS_VBI_FRAME_INFO;
854 
855 #define KS_SIZE_PREHEADER (FIELD_OFFSET(KS_VIDEOINFOHEADER,bmiHeader))
856 
857 #if !defined( DEFINE_WAVEFORMATEX_GUID )
858 #define DEFINE_WAVEFORMATEX_GUID(x) (USHORT)(x), 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
859 #endif
860 
861 #define STATIC_KSDATAFORMAT_SUBTYPE_WAVEFORMATEX\
862     0x00000000L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
863 DEFINE_GUIDSTRUCT("00000000-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_WAVEFORMATEX);
864 #define KSDATAFORMAT_SUBTYPE_WAVEFORMATEX DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_WAVEFORMATEX)
865 
866 
867 #define INIT_WAVEFORMATEX_GUID(Guid, x)            \
868 {                                                  \
869     *(Guid) = KSDATAFORMAT_SUBTYPE_WAVEFORMATEX;   \
870     (Guid)->Data1 = (USHORT)(x);                   \
871 }
872 
873 // 'vids'
874 #define STATIC_KSDATAFORMAT_TYPE_VIDEO \
875     0x73646976L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
876 DEFINE_GUIDSTRUCT("73646976-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_VIDEO);
877 #define KSDATAFORMAT_TYPE_VIDEO DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_VIDEO)
878 
879 // 'auds'
880 #define STATIC_KSDATAFORMAT_TYPE_AUDIO \
881     0x73647561L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
882 DEFINE_GUIDSTRUCT("73647561-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_AUDIO);
883 #define KSDATAFORMAT_TYPE_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_AUDIO)
884 
885 #define STATIC_KSDATAFORMAT_SPECIFIER_DSOUND\
886     0x518590a2L, 0xa184, 0x11d0, {0x85, 0x22, 0x00, 0xc0, 0x4f, 0xd9, 0xba, 0xf3}
887 DEFINE_GUIDSTRUCT("518590a2-a184-11d0-8522-00c04fd9baf3", KSDATAFORMAT_SPECIFIER_DSOUND);
888 #define KSDATAFORMAT_SPECIFIER_DSOUND DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_DSOUND)
889 
890 #define STATIC_KSDATAFORMAT_SUBTYPE_ANALOG\
891     0x6dba3190L, 0x67bd, 0x11cf, {0xa0, 0xf7, 0x00, 0x20, 0xaf, 0xd1, 0x56, 0xe4}
892 DEFINE_GUIDSTRUCT("6dba3190-67bd-11cf-a0f7-0020afd156e4", KSDATAFORMAT_SUBTYPE_ANALOG);
893 #define KSDATAFORMAT_SUBTYPE_ANALOG DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_ANALOG)
894 
895 
896 // 'txts'
897 #define STATIC_KSDATAFORMAT_TYPE_TEXT \
898     0x73747874L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
899 DEFINE_GUIDSTRUCT("73747874-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_TEXT);
900 #define KSDATAFORMAT_TYPE_TEXT DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_TEXT)
901 
902 #define STATIC_KSDATAFORMAT_TYPE_MUSIC \
903     0xE725D360L, 0x62CC, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
904 DEFINE_GUIDSTRUCT("E725D360-62CC-11CF-A5D6-28DB04C10000", KSDATAFORMAT_TYPE_MUSIC);
905 #define KSDATAFORMAT_TYPE_MUSIC DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MUSIC)
906 
907 // 'mids'
908 #define STATIC_KSDATAFORMAT_TYPE_MIDI \
909     0x7364696DL, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
910 DEFINE_GUIDSTRUCT("7364696D-0000-0010-8000-00aa00389b71", KSDATAFORMAT_TYPE_MIDI);
911 #define KSDATAFORMAT_TYPE_MIDI DEFINE_GUIDNAMED(KSDATAFORMAT_TYPE_MIDI)
912 
913 #define STATIC_KSDATAFORMAT_SUBTYPE_MIDI \
914     0x1D262760L, 0xE957, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
915 DEFINE_GUIDSTRUCT("1D262760-E957-11CF-A5D6-28DB04C10000", KSDATAFORMAT_SUBTYPE_MIDI);
916 #define KSDATAFORMAT_SUBTYPE_MIDI DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MIDI)
917 
918 #define STATIC_KSDATAFORMAT_SUBTYPE_PCM\
919     0x00000001L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
920 DEFINE_GUIDSTRUCT("00000001-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_PCM);
921 #define KSDATAFORMAT_SUBTYPE_PCM DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_PCM)
922 
923 #define STATIC_KSDATAFORMAT_SUBTYPE_IEEE_FLOAT\
924     0x00000003L, 0x0000, 0x0010, {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
925 DEFINE_GUIDSTRUCT("00000003-0000-0010-8000-00aa00389b71", KSDATAFORMAT_SUBTYPE_IEEE_FLOAT);
926 #define KSDATAFORMAT_SUBTYPE_IEEE_FLOAT DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_IEEE_FLOAT)
927 
928 #define STATIC_KSDATAFORMAT_SPECIFIER_WAVEFORMATEX\
929     0x05589f81L, 0xc356, 0x11ce, {0xbf, 0x01, 0x00, 0xaa, 0x00, 0x55, 0x59, 0x5a}
930 DEFINE_GUIDSTRUCT("05589f81-c356-11ce-bf01-00aa0055595a", KSDATAFORMAT_SPECIFIER_WAVEFORMATEX);
931 #define KSDATAFORMAT_SPECIFIER_WAVEFORMATEX DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_WAVEFORMATEX)
932 
933 #define STATIC_KSDATAFORMAT_SUBTYPE_AC3_AUDIO\
934     0xe06d802cL, 0xdb46, 0x11cf, {0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea}
935 DEFINE_GUIDSTRUCT("e06d802c-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SUBTYPE_AC3_AUDIO);
936 #define KSDATAFORMAT_SUBTYPE_AC3_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_AC3_AUDIO)
937 
938 #define STATIC_KSDATAFORMAT_SPECIFIER_AC3_AUDIO\
939     0xe06d80e4L, 0xdb46, 0x11cf, {0xb4, 0xd1, 0x00, 0x80, 0x5f, 0x6c, 0xbb, 0xea}
940 DEFINE_GUIDSTRUCT("e06d80e4-db46-11cf-b4d1-00805f6cbbea", KSDATAFORMAT_SPECIFIER_AC3_AUDIO);
941 #define KSDATAFORMAT_SPECIFIER_AC3_AUDIO DEFINE_GUIDNAMED(KSDATAFORMAT_SPECIFIER_AC3_AUDIO)
942 
943 #define STATIC_KSPROPSETID_AC3\
944     0xBFABE720L, 0x6E1F, 0x11D0, {0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}
945 DEFINE_GUIDSTRUCT("BFABE720-6E1F-11D0-BCF2-444553540000", KSPROPSETID_AC3);
946 #define KSPROPSETID_AC3 DEFINE_GUIDNAMED(KSPROPSETID_AC3)
947 
948 #define STATIC_KSPROPSETID_Audio\
949     0x45FFAAA0L, 0x6E1B, 0x11D0, {0xBC, 0xF2, 0x44, 0x45, 0x53, 0x54, 0x00, 0x00}
950 DEFINE_GUIDSTRUCT("45FFAAA0-6E1B-11D0-BCF2-444553540000", KSPROPSETID_Audio);
951 #define KSPROPSETID_Audio DEFINE_GUIDNAMED(KSPROPSETID_Audio)
952 
953 typedef enum {
954     KSPROPERTY_AUDIO_LATENCY = 1,
955     KSPROPERTY_AUDIO_COPY_PROTECTION,
956     KSPROPERTY_AUDIO_CHANNEL_CONFIG,
957     KSPROPERTY_AUDIO_VOLUMELEVEL,
958     KSPROPERTY_AUDIO_POSITION,
959     KSPROPERTY_AUDIO_DYNAMIC_RANGE,
960     KSPROPERTY_AUDIO_QUALITY,
961     KSPROPERTY_AUDIO_SAMPLING_RATE,
962     KSPROPERTY_AUDIO_DYNAMIC_SAMPLING_RATE,
963     KSPROPERTY_AUDIO_MIX_LEVEL_TABLE,
964     KSPROPERTY_AUDIO_MIX_LEVEL_CAPS,
965     KSPROPERTY_AUDIO_MUX_SOURCE,
966     KSPROPERTY_AUDIO_MUTE,
967     KSPROPERTY_AUDIO_BASS,
968     KSPROPERTY_AUDIO_MID,
969     KSPROPERTY_AUDIO_TREBLE,
970     KSPROPERTY_AUDIO_BASS_BOOST,
971     KSPROPERTY_AUDIO_EQ_LEVEL,
972     KSPROPERTY_AUDIO_NUM_EQ_BANDS,
973     KSPROPERTY_AUDIO_EQ_BANDS,
974     KSPROPERTY_AUDIO_AGC,
975     KSPROPERTY_AUDIO_DELAY,
976     KSPROPERTY_AUDIO_LOUDNESS,
977     KSPROPERTY_AUDIO_WIDE_MODE,
978     KSPROPERTY_AUDIO_WIDENESS,
979     KSPROPERTY_AUDIO_REVERB_LEVEL,
980     KSPROPERTY_AUDIO_CHORUS_LEVEL,
981     KSPROPERTY_AUDIO_DEV_SPECIFIC,
982     KSPROPERTY_AUDIO_DEMUX_DEST,
983     KSPROPERTY_AUDIO_STEREO_ENHANCE,
984     KSPROPERTY_AUDIO_MANUFACTURE_GUID,
985     KSPROPERTY_AUDIO_PRODUCT_GUID,
986     KSPROPERTY_AUDIO_CPU_RESOURCES,
987     KSPROPERTY_AUDIO_STEREO_SPEAKER_GEOMETRY,
988     KSPROPERTY_AUDIO_SURROUND_ENCODE,
989     KSPROPERTY_AUDIO_3D_INTERFACE
990 
991 #if (NTDDI_VERSION >= NTDDI_WINXP)
992     , KSPROPERTY_AUDIO_PEAKMETER
993     , KSPROPERTY_AUDIO_ALGORITHM_INSTANCE
994     , KSPROPERTY_AUDIO_FILTER_STATE
995     , KSPROPERTY_AUDIO_PREFERRED_STATUS
996 
997 #endif
998 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
999     , KSPROPERTY_AUDIO_PEQ_MAX_BANDS
1000     , KSPROPERTY_AUDIO_PEQ_NUM_BANDS
1001     , KSPROPERTY_AUDIO_PEQ_BAND_CENTER_FREQ
1002     , KSPROPERTY_AUDIO_PEQ_BAND_Q_FACTOR
1003     , KSPROPERTY_AUDIO_PEQ_BAND_LEVEL
1004     , KSPROPERTY_AUDIO_CHORUS_MODULATION_RATE
1005     , KSPROPERTY_AUDIO_CHORUS_MODULATION_DEPTH
1006     , KSPROPERTY_AUDIO_REVERB_TIME
1007     , KSPROPERTY_AUDIO_REVERB_DELAY_FEEDBACK
1008     , KSPROPERTY_AUDIO_POSITIONEX
1009     , KSPROPERTY_AUDIO_MIC_ARRAY_GEOMETRY
1010 #endif
1011 
1012 } KSPROPERTY_AUDIO;
1013 
1014 #define STATIC_KSEVENTSETID_AudioControlChange\
1015     0xE85E9698L, 0xFA2F, 0x11D1, {0x95, 0xBD, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
1016 DEFINE_GUIDSTRUCT("E85E9698-FA2F-11D1-95BD-00C04FB925D3", KSEVENTSETID_AudioControlChange);
1017 #define KSEVENTSETID_AudioControlChange DEFINE_GUIDNAMED(KSEVENTSETID_AudioControlChange)
1018 
1019 typedef enum {
1020     KSEVENT_CONTROL_CHANGE,
1021 } KSEVENT_AUDIO_CONTROL_CHANGE;
1022 
1023 
1024 #define STATIC_KSEVENTSETID_LoopedStreaming\
1025     0x4682B940L, 0xC6EF, 0x11D0, {0x96, 0xD8, 0x00, 0xAA, 0x00, 0x51, 0xE5, 0x1D}
1026 DEFINE_GUIDSTRUCT("4682B940-C6EF-11D0-96D8-00AA0051E51D", KSEVENTSETID_LoopedStreaming);
1027 #define KSEVENTSETID_LoopedStreaming DEFINE_GUIDNAMED(KSEVENTSETID_LoopedStreaming)
1028 
1029 typedef enum {
1030     KSEVENT_LOOPEDSTREAMING_POSITION,
1031 } KSEVENT_LOOPEDSTREAMING;
1032 
1033 #define STATIC_KSEVENTSETID_Connection\
1034     0x7f4bcbe0L, 0x9ea5, 0x11cf, {0xa5, 0xd6, 0x28, 0xdb, 0x04, 0xc1, 0x00, 0x00}
1035 DEFINE_GUIDSTRUCT("7f4bcbe0-9ea5-11cf-a5d6-28db04c10000", KSEVENTSETID_Connection);
1036 #define KSEVENTSETID_Connection DEFINE_GUIDNAMED(KSEVENTSETID_Connection)
1037 
1038 
1039 typedef struct {
1040     KSEVENTDATA KsEventData;
1041 #if defined(_NTDDK_)
1042     ULONGLONG   Position;
1043 #else // !_NTDDK_
1044     DWORDLONG   Position;
1045 #endif // !_NTDDK_
1046 } LOOPEDSTREAMING_POSITION_EVENT_DATA, *PLOOPEDSTREAMING_POSITION_EVENT_DATA ;
1047 
1048 #define STATIC_KSPROPSETID_DrmAudioStream\
1049     0x2f2c8ddd, 0x4198, 0x4fac, {0xba, 0x29, 0x61, 0xbb, 0x5, 0xb7, 0xde, 0x6}
1050 DEFINE_GUIDSTRUCT("2F2C8DDD-4198-4fac-BA29-61BB05B7DE06", KSPROPSETID_DrmAudioStream);
1051 #define KSPROPSETID_DrmAudioStream DEFINE_GUIDNAMED(KSPROPSETID_DrmAudioStream)
1052 
1053 typedef enum {
1054     KSPROPERTY_DRMAUDIOSTREAM_CONTENTID
1055 } KSPROPERTY_DRMAUDIOSTREAM;
1056 
1057 
1058 /*
1059     SysAudio Properties
1060 */
1061 
1062 #define STATIC_KSPROPSETID_Sysaudio \
1063     0xCBE3FAA0L, 0xCC75, 0x11D0, {0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6}
1064 DEFINE_GUIDSTRUCT("CBE3FAA0-CC75-11D0-B465-00001A1818E6", KSPROPSETID_Sysaudio);
1065 #define KSPROPSETID_Sysaudio DEFINE_GUIDNAMED(KSPROPSETID_Sysaudio)
1066 
1067 typedef enum {
1068     KSPROPERTY_SYSAUDIO_DEVICE_COUNT            = 1,
1069     KSPROPERTY_SYSAUDIO_DEVICE_FRIENDLY_NAME    = 2,
1070     KSPROPERTY_SYSAUDIO_DEVICE_INSTANCE         = 3,
1071     KSPROPERTY_SYSAUDIO_DEVICE_INTERFACE_NAME   = 4,
1072     KSPROPERTY_SYSAUDIO_SELECT_GRAPH            = 5,
1073     KSPROPERTY_SYSAUDIO_CREATE_VIRTUAL_SOURCE   = 6,
1074     KSPROPERTY_SYSAUDIO_DEVICE_DEFAULT          = 7,
1075     KSPROPERTY_SYSAUDIO_INSTANCE_INFO           = 14,
1076     KSPROPERTY_SYSAUDIO_COMPONENT_ID            = 16
1077 } KSPROPERTY_SYSAUDIO;
1078 
1079 typedef struct {
1080     KSPROPERTY Property;
1081     ULONG Flags;
1082     ULONG DeviceNumber;
1083 } SYSAUDIO_INSTANCE_INFO, *PSYSAUDIO_INSTANCE_INFO;
1084 
1085 #define SYSAUDIO_FLAGS_DONT_COMBINE_PINS        0x00000001
1086 
1087 
1088 #define STATIC_KSPROPSETID_Sysaudio_Pin \
1089     0xA3A53220L, 0xC6E4, 0x11D0, {0xB4, 0x65, 0x00, 0x00, 0x1A, 0x18, 0x18, 0xE6}
1090 DEFINE_GUIDSTRUCT("A3A53220-C6E4-11D0-B465-00001A1818E6", KSPROPSETID_Sysaudio_Pin);
1091 #define KSPROPSETID_Sysaudio_Pin DEFINE_GUIDNAMED(KSPROPSETID_Sysaudio_Pin)
1092 
1093 typedef enum {
1094     KSPROPERTY_SYSAUDIO_ATTACH_VIRTUAL_SOURCE = 1,
1095 } KSPROPERTY_SYSAUDIO_PIN;
1096 
1097 
1098 #define KSAUDIO_CPU_RESOURCES_NOT_HOST_CPU  0x00000000
1099 #define KSAUDIO_CPU_RESOURCES_HOST_CPU      0x7FFFFFFF
1100 
1101 #if (NTDDI_VERSION >= NTDDI_WINXP)
1102 #define KSAUDIO_SPEAKER_DIRECTOUT       0
1103 #endif
1104 #define KSAUDIO_SPEAKER_MONO            (SPEAKER_FRONT_CENTER)
1105 #define KSAUDIO_SPEAKER_STEREO          (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT)
1106 #define KSAUDIO_SPEAKER_QUAD            (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \
1107                                          SPEAKER_BACK_LEFT  | SPEAKER_BACK_RIGHT)
1108 #define KSAUDIO_SPEAKER_SURROUND        (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \
1109                                          SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER)
1110 #define KSAUDIO_SPEAKER_5POINT1         (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \
1111                                          SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \
1112                                          SPEAKER_BACK_LEFT  | SPEAKER_BACK_RIGHT)
1113 #define KSAUDIO_SPEAKER_7POINT1         (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \
1114                                          SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \
1115                                          SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | \
1116                                          SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER)
1117 
1118 #if ( (NTDDI_VERSION >= NTDDI_WINXPSP2) && (NTDDI_VERSION < NTDDI_WS03) ) || (NTDDI_VERSION >= NTDDI_WS03SP1)
1119 
1120 #define KSAUDIO_SPEAKER_5POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \
1121                                          SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \
1122                                          SPEAKER_SIDE_LEFT  | SPEAKER_SIDE_RIGHT)
1123 #define KSAUDIO_SPEAKER_7POINT1_SURROUND (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \
1124                                          SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \
1125                                          SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | \
1126                                          SPEAKER_SIDE_LEFT | SPEAKER_SIDE_RIGHT)
1127 #define KSAUDIO_SPEAKER_5POINT1_BACK     KSAUDIO_SPEAKER_5POINT1
1128 #define KSAUDIO_SPEAKER_7POINT1_WIDE     KSAUDIO_SPEAKER_7POINT1
1129 #endif
1130 
1131 typedef struct
1132 {
1133     KSPROPERTY  Property;
1134     ULONG  NodeId;
1135     ULONG  Reserved;
1136 } KSNODEPROPERTY, *PKSNODEPROPERTY;
1137 
1138 typedef struct
1139 {
1140     KSNODEPROPERTY  NodeProperty;
1141     LONG  Channel;
1142     ULONG  Reserved;
1143 } KSNODEPROPERTY_AUDIO_CHANNEL, *PKSNODEPROPERTY_AUDIO_CHANNEL;
1144 
1145 typedef struct {
1146 #if defined(_NTDDK_)
1147     ULONGLONG        PlayOffset;
1148     ULONGLONG        WriteOffset;
1149 #else
1150     DWORDLONG        PlayOffset;
1151     DWORDLONG        WriteOffset;
1152 #endif
1153 } KSAUDIO_POSITION, *PKSAUDIO_POSITION;
1154 
1155 typedef struct {
1156     ULONG   FifoSize;
1157     ULONG   ChipsetDelay;
1158     ULONG   CodecDelay;
1159 } KSRTAUDIO_HWLATENCY, *PKSRTAUDIO_HWLATENCY;
1160 
1161 typedef struct {
1162     PVOID       Register;
1163     ULONG       Width;
1164     ULONGLONG   Numerator;
1165     ULONGLONG   Denominator;
1166     ULONG       Accuracy;
1167 } KSRTAUDIO_HWREGISTER, *PKSRTAUDIO_HWREGISTER;
1168 
1169 #define KSNODEPIN_STANDARD_IN       1
1170 #define KSNODEPIN_STANDARD_OUT      0
1171 
1172 #define KSNODEPIN_SUM_MUX_IN        1
1173 #define KSNODEPIN_SUM_MUX_OUT       0
1174 
1175 #define KSNODEPIN_DEMUX_IN          0
1176 #define KSNODEPIN_DEMUX_OUT         1
1177 
1178 #if (NTDDI_VERSION < NTDDI_VISTA)
1179 
1180 #define KSNODEPIN_AEC_RENDER_IN     1
1181 #define KSNODEPIN_AEC_RENDER_OUT    0
1182 #define KSNODEPIN_AEC_CAPTURE_IN    2
1183 #define KSNODEPIN_AEC_CAPTURE_OUT   3
1184 
1185 #endif
1186 
1187 
1188 #define STATIC_KSMUSIC_TECHNOLOGY_PORT\
1189     0x86C92E60L, 0x62E8, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
1190 DEFINE_GUIDSTRUCT("86C92E60-62E8-11CF-A5D6-28DB04C10000", KSMUSIC_TECHNOLOGY_PORT);
1191 #define KSMUSIC_TECHNOLOGY_PORT DEFINE_GUIDNAMED(KSMUSIC_TECHNOLOGY_PORT)
1192 
1193 #define STATIC_KSDATAFORMAT_SUBTYPE_MIDI_BUS\
1194     0x2CA15FA0L, 0x6CFE, 0x11CF, {0xA5, 0xD6, 0x28, 0xDB, 0x04, 0xC1, 0x00, 0x00}
1195 DEFINE_GUIDSTRUCT("2CA15FA0-6CFE-11CF-A5D6-28DB04C10000", KSDATAFORMAT_SUBTYPE_MIDI_BUS);
1196 #define KSDATAFORMAT_SUBTYPE_MIDI_BUS DEFINE_GUIDNAMED(KSDATAFORMAT_SUBTYPE_MIDI_BUS)
1197 
1198 #define STATIC_KSAUDFNAME_MIDI\
1199     0x185FEDF8L, 0x9905, 0x11D1, {0x95, 0xA9, 0x00, 0xC0, 0x4F, 0xB9, 0x25, 0xD3}
1200 DEFINE_GUIDSTRUCT("185FEDF8-9905-11D1-95A9-00C04FB925D3", KSAUDFNAME_MIDI);
1201 #define KSAUDFNAME_MIDI DEFINE_GUIDNAMED(KSAUDFNAME_MIDI)
1202 
1203 #define STATIC_KSNODETYPE_SYNTHESIZER\
1204     DEFINE_USB_TERMINAL_GUID(0x0713)
1205 DEFINE_GUIDSTRUCT("DFF220F3-F70F-11D0-B917-00A0C9223196", KSNODETYPE_SYNTHESIZER);
1206 #define KSNODETYPE_SYNTHESIZER DEFINE_GUIDNAMED(KSNODETYPE_SYNTHESIZER)
1207 
1208 typedef struct
1209 {
1210    KSDATARANGE              DataRange;
1211    GUID                     Technology;
1212    ULONG                    Channels;
1213    ULONG                    Notes;
1214    ULONG                    ChannelMask;
1215 } KSDATARANGE_MUSIC, *PKSDATARANGE_MUSIC;
1216 
1217 #if (NTDDI_VERSION >= NTDDI_WINXPSP1)
1218 
1219 #define STATIC_KSPROPSETID_Jack\
1220     0x4509f757, 0x2d46, 0x4637, {0x8e, 0x62, 0xce, 0x7d, 0xb9, 0x44, 0xf5, 0x7b}
1221 DEFINE_GUIDSTRUCT("4509F757-2D46-4637-8E62-CE7DB944F57B", KSPROPSETID_Jack);
1222 #define KSPROPSETID_Jack DEFINE_GUIDNAMED(KSPROPSETID_Jack)
1223 
1224 typedef enum {
1225   KSPROPERTY_JACK_DESCRIPTION = 1,
1226   KSPROPERTY_JACK_DESCRIPTION2,
1227   KSPROPERTY_JACK_SINK_INFO,
1228   KSPROPERTY_JACK_CONTAINERID
1229 } KSPROPERTY_JACK;
1230 
1231 typedef enum {
1232   eConnTypeUnknown,
1233   eConnType3Point5mm,
1234   eConnTypeQuarter,
1235   eConnTypeAtapiInternal,
1236   eConnTypeRCA,
1237   eConnTypeOptical,
1238   eConnTypeOtherDigital,
1239   eConnTypeOtherAnalog,
1240   eConnTypeMultichannelAnalogDIN,
1241   eConnTypeXlrProfessional,
1242   eConnTypeRJ11Modem,
1243   eConnTypeCombination
1244 } EPcxConnectionType;
1245 
1246 #define eGeoLocReserved5 eGeoLocNotApplicable
1247 
1248 typedef enum {
1249   eGeoLocRear = 0x1,
1250   eGeoLocFront,
1251   eGeoLocLeft,
1252   eGeoLocRight,
1253   eGeoLocTop,
1254   eGeoLocBottom,
1255   eGeoLocRearPanel,
1256   eGeoLocRiser,
1257   eGeoLocInsideMobileLid,
1258   eGeoLocDrivebay,
1259   eGeoLocHDMI,
1260   eGeoLocOutsideMobileLid,
1261   eGeoLocATAPI,
1262   eGeoLocNotApplicable,
1263   eGeoLocReserved6,
1264   EPcxGeoLocation_enum_count
1265 } EPcxGeoLocation;
1266 
1267 typedef enum {
1268   eGenLocPrimaryBox = 0,
1269   eGenLocInternal,
1270   eGenLocSeparate,
1271   eGenLocOther,
1272   EPcxGenLocation_enum_count
1273 } EPcxGenLocation;
1274 
1275 typedef enum {
1276   ePortConnJack = 0,
1277   ePortConnIntegratedDevice,
1278   ePortConnBothIntegratedAndJack,
1279   ePortConnUnknown
1280 } EPxcPortConnection;
1281 
1282 typedef struct {
1283   DWORD ChannelMapping;
1284   DWORD Color;
1285   EPcxConnectionType ConnectionType;
1286   EPcxGeoLocation GeoLocation;
1287   EPcxGenLocation GenLocation;
1288   EPxcPortConnection PortConnection;
1289   BOOL IsConnected;
1290 } KSJACK_DESCRIPTION, *PKSJACK_DESCRIPTION;
1291 
1292 typedef enum {
1293   KSJACK_SINK_CONNECTIONTYPE_HDMI = 0,
1294   KSJACK_SINK_CONNECTIONTYPE_DISPLAYPORT
1295 } KSJACK_SINK_CONNECTIONTYPE;
1296 
1297 #define MAX_SINK_DESCRIPTION_NAME_LENGTH 32
1298 
1299 typedef struct _tagKSJACK_SINK_INFORMATION {
1300   KSJACK_SINK_CONNECTIONTYPE ConnType;
1301   WORD ManufacturerId;
1302   WORD ProductId;
1303   WORD AudioLatency;
1304   BOOL HDCPCapable;
1305   BOOL AICapable;
1306   UCHAR SinkDescriptionLength;
1307   WCHAR SinkDescription[MAX_SINK_DESCRIPTION_NAME_LENGTH];
1308   LUID PortId;
1309 } KSJACK_SINK_INFORMATION, *PKSJACK_SINK_INFORMATION;
1310 
1311 #define JACKDESC2_PRESENCE_DETECT_CAPABILITY       0x1
1312 #define JACKDESC2_DYNAMIC_FORMAT_CHANGE_CAPABILITY 0x2
1313 
1314 typedef struct _tagKSJACK_DESCRIPTION2 {
1315   DWORD DeviceStateInfo;
1316   DWORD JackCapabilities;
1317 } KSJACK_DESCRIPTION2, *PKSJACK_DESCRIPTION2;
1318 
1319 #endif /* (NTDDI_VERSION >= NTDDI_WINXPSP1) */
1320 
1321 #ifndef _SPEAKER_POSITIONS_
1322 #define _SPEAKER_POSITIONS_
1323 
1324 
1325 #define SPEAKER_FRONT_LEFT              0x1
1326 #define SPEAKER_FRONT_RIGHT             0x2
1327 #define SPEAKER_FRONT_CENTER            0x4
1328 #define SPEAKER_LOW_FREQUENCY           0x8
1329 #define SPEAKER_BACK_LEFT               0x10
1330 #define SPEAKER_BACK_RIGHT              0x20
1331 #define SPEAKER_FRONT_LEFT_OF_CENTER    0x40
1332 #define SPEAKER_FRONT_RIGHT_OF_CENTER   0x80
1333 #define SPEAKER_BACK_CENTER             0x100
1334 #define SPEAKER_SIDE_LEFT               0x200
1335 #define SPEAKER_SIDE_RIGHT              0x400
1336 #define SPEAKER_TOP_CENTER              0x800
1337 #define SPEAKER_TOP_FRONT_LEFT          0x1000
1338 #define SPEAKER_TOP_FRONT_CENTER        0x2000
1339 #define SPEAKER_TOP_FRONT_RIGHT         0x4000
1340 #define SPEAKER_TOP_BACK_LEFT           0x8000
1341 #define SPEAKER_TOP_BACK_CENTER         0x10000
1342 #define SPEAKER_TOP_BACK_RIGHT          0x20000
1343 
1344 #define SPEAKER_RESERVED                0x7FFC0000
1345 #define SPEAKER_ALL                     0x80000000
1346 
1347 #endif
1348 
1349 #if (NTDDI_VERSION >= NTDDI_WINXP)
1350 #define KSAUDIO_SPEAKER_DIRECTOUT       0
1351 #endif
1352 
1353 #define KSAUDIO_SPEAKER_MONO            (SPEAKER_FRONT_CENTER)
1354 #define KSAUDIO_SPEAKER_STEREO          (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT)
1355 #define KSAUDIO_SPEAKER_QUAD            (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \
1356                                          SPEAKER_BACK_LEFT  | SPEAKER_BACK_RIGHT)
1357 #define KSAUDIO_SPEAKER_SURROUND        (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \
1358                                          SPEAKER_FRONT_CENTER | SPEAKER_BACK_CENTER)
1359 #define KSAUDIO_SPEAKER_5POINT1         (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \
1360                                          SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \
1361                                          SPEAKER_BACK_LEFT  | SPEAKER_BACK_RIGHT)
1362 #define KSAUDIO_SPEAKER_7POINT1         (SPEAKER_FRONT_LEFT | SPEAKER_FRONT_RIGHT | \
1363                                          SPEAKER_FRONT_CENTER | SPEAKER_LOW_FREQUENCY | \
1364                                          SPEAKER_BACK_LEFT | SPEAKER_BACK_RIGHT | \
1365                                          SPEAKER_FRONT_LEFT_OF_CENTER | SPEAKER_FRONT_RIGHT_OF_CENTER)
1366 
1367 #endif
1368