winmm/tests: Don't use same buffer for both input and output.
[wine] / dlls / qcap / capturegraph.c
1 /* Capture Graph Builder, Minimal edition
2  *
3  * Copyright 2005 Maarten Lankhorst
4  * Copyright 2005 Rolf Kalbermatter
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19  */
20 #include "config.h"
21
22 #include <stdio.h>
23 #include <stdarg.h>
24
25 #define COBJMACROS
26 #define NONAMELESSSTRUCT
27 #define NONAMELESSUNION
28
29 #include "windef.h"
30 #include "winbase.h"
31 #include "wingdi.h"
32 #include "winerror.h"
33 #include "objbase.h"
34
35 #include "evcode.h"
36 #include "strmif.h"
37 #include "control.h"
38 #include "vfwmsgs.h"
39 /*
40  *#include "amvideo.h"
41  *#include "mmreg.h"
42  *#include "dshow.h"
43  *#include "ddraw.h"
44  */
45 #include "qcap_main.h"
46
47 #include "wine/unicode.h"
48 #include "wine/debug.h"
49
50 WINE_DEFAULT_DEBUG_CHANNEL(qcap);
51
52 /***********************************************************************
53 *   ICaptureGraphBuilder & ICaptureGraphBuilder2 implementation
54 */
55 typedef struct CaptureGraphImpl
56 {
57     const ICaptureGraphBuilder2Vtbl * lpVtbl2;
58     const ICaptureGraphBuilderVtbl * lpVtbl;
59     LONG ref;
60     IGraphBuilder *mygraph;
61
62     CRITICAL_SECTION csFilter;
63 } CaptureGraphImpl;
64
65 static const ICaptureGraphBuilderVtbl builder_Vtbl;
66 static const ICaptureGraphBuilder2Vtbl builder2_Vtbl;
67
68 static inline CaptureGraphImpl *impl_from_ICaptureGraphBuilder( ICaptureGraphBuilder *iface )
69 {
70     return (CaptureGraphImpl *)((char*)iface - FIELD_OFFSET(CaptureGraphImpl, lpVtbl));
71 }
72
73 static inline CaptureGraphImpl *impl_from_ICaptureGraphBuilder2( ICaptureGraphBuilder2 *iface )
74 {
75     return (CaptureGraphImpl *)((char*)iface - FIELD_OFFSET(CaptureGraphImpl, lpVtbl2));
76 }
77
78 /*
79   converts This to an interface pointer
80 */
81 #define _IUnknown_(This)              (&(This)->lpVtbl2)
82 #define _ICaptureGraphBuilder_(This)  (&(This)->lpVtbl)
83 #define _ICaptureGraphBuilder2_(This) ((ICaptureGraphBuilder2*)&(This)->lpVtbl2)
84
85
86 IUnknown * CALLBACK QCAP_createCaptureGraphBuilder2(IUnknown *pUnkOuter,
87                                                     HRESULT *phr)
88 {
89     CaptureGraphImpl * pCapture = NULL;
90
91     TRACE("(%p, %p)\n", pUnkOuter, phr);
92
93     *phr = CLASS_E_NOAGGREGATION;
94     if (pUnkOuter)
95     {
96         return NULL;
97     }
98     *phr = E_OUTOFMEMORY;
99
100     pCapture = CoTaskMemAlloc(sizeof(CaptureGraphImpl));
101     if (pCapture)
102     {
103         pCapture->lpVtbl2 = &builder2_Vtbl;
104         pCapture->lpVtbl = &builder_Vtbl;
105         pCapture->ref = 1;
106         pCapture->mygraph = NULL;
107         InitializeCriticalSection(&pCapture->csFilter);
108         pCapture->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": CaptureGraphImpl.csFilter");
109         *phr = S_OK;
110         ObjectRefCount(TRUE);
111     }
112     return (IUnknown *)pCapture;
113 }
114
115 static HRESULT WINAPI
116 fnCaptureGraphBuilder2_QueryInterface(ICaptureGraphBuilder2 * iface,
117                                       REFIID riid,
118                                       LPVOID * ppv)
119 {
120     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
121
122     TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppv);
123
124     *ppv = NULL;
125     if (IsEqualIID(riid, &IID_IUnknown))
126         *ppv = _IUnknown_(This);
127     else if (IsEqualIID(riid, &IID_ICaptureGraphBuilder))
128         *ppv = _ICaptureGraphBuilder_(This);
129     else if (IsEqualIID(riid, &IID_ICaptureGraphBuilder2))
130         *ppv = _ICaptureGraphBuilder2_(This);
131
132     if (*ppv)
133     {
134         IUnknown_AddRef((IUnknown *)(*ppv));
135         TRACE ("-- Interface = %p\n", *ppv);
136         return S_OK;
137     }
138
139     TRACE ("-- Interface: E_NOINTERFACE\n");
140     return E_NOINTERFACE;
141 }
142
143 static ULONG WINAPI
144 fnCaptureGraphBuilder2_AddRef(ICaptureGraphBuilder2 * iface)
145 {
146     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
147     DWORD ref = InterlockedIncrement(&This->ref);
148
149     TRACE("(%p/%p)->() AddRef from %d\n", This, iface, ref - 1);
150     return ref;
151 }
152
153 static ULONG WINAPI
154 fnCaptureGraphBuilder2_Release(ICaptureGraphBuilder2 * iface)
155 {
156     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
157     DWORD ref = InterlockedDecrement(&This->ref);
158
159     TRACE("(%p/%p)->() Release from %d\n", This, iface, ref + 1);
160
161     if (!ref)
162     {
163         FIXME("Release IGraphFilter or w/e\n");
164         This->csFilter.DebugInfo->Spare[0] = 0;
165         DeleteCriticalSection(&This->csFilter);
166         This->lpVtbl = NULL;
167         This->lpVtbl2 = NULL;
168         if (This->mygraph != NULL)
169             IGraphBuilder_Release(This->mygraph);
170         CoTaskMemFree(This);
171         ObjectRefCount(FALSE);
172     }
173     return ref;
174 }
175
176 static HRESULT WINAPI
177 fnCaptureGraphBuilder2_SetFilterGraph(ICaptureGraphBuilder2 * iface,
178                                       IGraphBuilder *pfg)
179 {
180 /* The graph builder will automatically create a filter graph if you don't call
181    this method. If you call this method after the graph builder has created its
182    own filter graph, the call will fail. */
183     IMediaEvent *pmev;
184     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
185
186     TRACE("(%p/%p)->(%p)\n", This, iface, pfg);
187
188     if (This->mygraph)
189         return E_UNEXPECTED;
190
191     if (!pfg)
192         return E_POINTER;
193
194     This->mygraph = pfg;
195     IGraphBuilder_AddRef(This->mygraph);
196     if (SUCCEEDED(IUnknown_QueryInterface(This->mygraph,
197                                           &IID_IMediaEvent, (LPVOID *)&pmev)))
198     {
199         IMediaEvent_CancelDefaultHandling(pmev, EC_REPAINT);
200         IMediaEvent_Release(pmev);
201     }
202     return S_OK;
203 }
204
205 static HRESULT WINAPI
206 fnCaptureGraphBuilder2_GetFilterGraph(ICaptureGraphBuilder2 * iface,
207                                       IGraphBuilder **pfg)
208 {
209     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
210
211     TRACE("(%p/%p)->(%p)\n", This, iface, pfg);
212
213     if (!pfg)
214         return E_POINTER;
215
216     *pfg = This->mygraph;
217     if (!This->mygraph)
218     {
219         TRACE("(%p) Getting NULL filtergraph\n", iface);
220         return E_UNEXPECTED;
221     }
222
223     IGraphBuilder_AddRef(This->mygraph);
224    
225     TRACE("(%p) return filtergraph %p\n", iface, *pfg);
226     return S_OK;
227 }
228
229 static HRESULT WINAPI
230 fnCaptureGraphBuilder2_SetOutputFileName(ICaptureGraphBuilder2 * iface,
231                                          const GUID *pType,
232                                          LPCOLESTR lpstrFile,
233                                          IBaseFilter **ppf,
234                                          IFileSinkFilter **ppSink)
235 {
236     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
237
238     FIXME("(%p/%p)->(%s, %s, %p, %p) Stub!\n", This, iface,
239           debugstr_guid(pType), debugstr_w(lpstrFile), ppf, ppSink);
240
241     return E_NOTIMPL;
242 }
243
244 static HRESULT WINAPI
245 fnCaptureGraphBuilder2_FindInterface(ICaptureGraphBuilder2 * iface,
246                                      const GUID *pCategory,
247                                      const GUID *pType,
248                                      IBaseFilter *pf,
249                                      REFIID riid,
250                                      void **ppint)
251 {
252     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
253
254     FIXME("(%p/%p)->(%s, %s, %p, %s, %p) - workaround stub!\n", This, iface,
255           debugstr_guid(pCategory), debugstr_guid(pType),
256           pf, debugstr_guid(riid), ppint);
257
258     return IBaseFilter_QueryInterface(pf, riid, ppint);
259     /* Looks for the specified interface on the filter, upstream and
260      * downstream from the filter, and, optionally, only on the output
261      * pin of the given category.
262      */
263 }
264
265 static HRESULT WINAPI
266 fnCaptureGraphBuilder2_RenderStream(ICaptureGraphBuilder2 * iface,
267                                     const GUID *pCategory,
268                                     const GUID *pType,
269                                     IUnknown *pSource,
270                                     IBaseFilter *pfCompressor,
271                                     IBaseFilter *pfRenderer)
272 {
273     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
274     IPin *pin_in = NULL;
275     IPin *pin_out = NULL;
276     HRESULT hr;
277
278     FIXME("(%p/%p)->(%s, %s, %p, %p, %p) Stub!\n", This, iface,
279           debugstr_guid(pCategory), debugstr_guid(pType),
280           pSource, pfCompressor, pfRenderer);
281
282     if (pfCompressor)
283         FIXME("Intermediate streams not supported yet\n");
284
285     if (!This->mygraph)
286     {
287         FIXME("Need a capture graph\n");
288         return E_UNEXPECTED;
289     }
290
291     ICaptureGraphBuilder2_FindPin(iface, pSource, PINDIR_OUTPUT, pCategory, pType, TRUE, 0, &pin_in);
292     if (!pin_in)
293         return E_FAIL;
294     ICaptureGraphBuilder2_FindPin(iface, (IUnknown*)pfRenderer, PINDIR_INPUT, pCategory, pType, TRUE, 0, &pin_out);
295     if (!pin_out)
296     {
297         IPin_Release(pin_in);
298         return E_FAIL;
299     }
300
301     /* Uses 'Intelligent Connect', so Connect, not ConnectDirect here */
302     hr = IFilterGraph2_Connect(This->mygraph, pin_in, pin_out);
303     IPin_Release(pin_in);
304     IPin_Release(pin_out);
305     return hr;
306 }
307
308 static HRESULT WINAPI
309 fnCaptureGraphBuilder2_ControlStream(ICaptureGraphBuilder2 * iface,
310                                      const GUID *pCategory,
311                                      const GUID *pType,
312                                      IBaseFilter *pFilter,
313                                      REFERENCE_TIME *pstart,
314                                      REFERENCE_TIME *pstop,
315                                      WORD wStartCookie,
316                                      WORD wStopCookie)
317 {
318     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
319
320     FIXME("(%p/%p)->(%s, %s, %p, %p, %p, %i, %i) Stub!\n", This, iface,
321           debugstr_guid(pCategory), debugstr_guid(pType),
322           pFilter, pstart, pstop, wStartCookie, wStopCookie);
323
324     return E_NOTIMPL;
325 }
326
327 static HRESULT WINAPI
328 fnCaptureGraphBuilder2_AllocCapFile(ICaptureGraphBuilder2 * iface,
329                                     LPCOLESTR lpwstr,
330                                     DWORDLONG dwlSize)
331 {
332     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
333
334     FIXME("(%p/%p)->(%s, 0x%s) Stub!\n", This, iface,
335           debugstr_w(lpwstr), wine_dbgstr_longlong(dwlSize));
336
337     return E_NOTIMPL;
338 }
339
340 static HRESULT WINAPI
341 fnCaptureGraphBuilder2_CopyCaptureFile(ICaptureGraphBuilder2 * iface,
342                                        LPOLESTR lpwstrOld,
343                                        LPOLESTR lpwstrNew,
344                                        int fAllowEscAbort,
345                                        IAMCopyCaptureFileProgress *pCallback)
346 {
347     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
348
349     FIXME("(%p/%p)->(%s, %s, %i, %p) Stub!\n", This, iface,
350           debugstr_w(lpwstrOld), debugstr_w(lpwstrNew),
351           fAllowEscAbort, pCallback);
352
353     return E_NOTIMPL;
354 }
355
356 static BOOL pin_matches(IPin *pin, PIN_DIRECTION direction, const GUID *cat, const GUID *type, BOOL unconnected)
357 {
358     IPin *partner;
359     PIN_DIRECTION pindir;
360
361     IPin_QueryDirection(pin, &pindir);
362     if (pindir != direction)
363     {
364         TRACE("No match, wrong direction\n");
365         return FALSE;
366     }
367
368     if (unconnected && IPin_ConnectedTo(pin, &partner) == S_OK)
369     {
370         IPin_Release(partner);
371         TRACE("No match, %p already connected to %p\n", pin, partner);
372         return FALSE;
373     }
374
375     if (cat || type)
376         FIXME("Ignoring category/type\n");
377
378     TRACE("Match made in heaven\n");
379
380     return TRUE;
381 }
382
383 static HRESULT WINAPI
384 fnCaptureGraphBuilder2_FindPin(ICaptureGraphBuilder2 * iface,
385                                IUnknown *pSource,
386                                PIN_DIRECTION pindir,
387                                const GUID *pCategory,
388                                const GUID *pType,
389                                BOOL fUnconnected,
390                                INT num,
391                                IPin **ppPin)
392 {
393     HRESULT hr;
394     IEnumPins *enumpins = NULL;
395     IPin *pin;
396     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder2(iface);
397
398     TRACE("(%p/%p)->(%p, %x, %s, %s, %d, %i, %p)\n", This, iface,
399           pSource, pindir, debugstr_guid(pCategory), debugstr_guid(pType),
400           fUnconnected, num, ppPin);
401
402     pin = NULL;
403
404     hr = IUnknown_QueryInterface(pSource, &IID_IPin, (void**)&pin);
405     if (hr == E_NOINTERFACE)
406     {
407         IBaseFilter *filter = NULL;
408         int numcurrent = 0;
409
410         hr = IUnknown_QueryInterface(pSource, &IID_IBaseFilter, (void**)&filter);
411         if (hr == E_NOINTERFACE)
412         {
413             WARN("Input not filter or pin?!\n");
414             return E_FAIL;
415         }
416
417         hr = IBaseFilter_EnumPins(filter, &enumpins);
418         if (FAILED(hr))
419         {
420             WARN("Could not enumerate\n");
421             return hr;
422         }
423
424         IEnumPins_Reset(enumpins);
425
426         while (1)
427         {
428             hr = IEnumPins_Next(enumpins, 1, &pin, NULL);
429             if (hr == VFW_E_ENUM_OUT_OF_SYNC)
430             {
431                 numcurrent = 0;
432                 IEnumPins_Reset(enumpins);
433                 pin = NULL;
434                 continue;
435             }
436
437             if (hr != S_OK)
438                 break;
439             TRACE("Testing match\n");
440             if (pin_matches(pin, pindir, pCategory, pType, fUnconnected) && numcurrent++ == num)
441                 break;
442             IPin_Release(pin);
443             pin = NULL;
444         }
445         IEnumPins_Release(enumpins);
446
447         if (hr != S_OK)
448         {
449             WARN("Could not find %s pin # %d\n", (pindir == PINDIR_OUTPUT ? "output" : "input"), numcurrent);
450             return E_FAIL;
451         }
452     }
453     else if (!pin_matches(pin, pindir, pCategory, pType, fUnconnected))
454     {
455         IPin_Release(pin);
456         return E_FAIL;
457     }
458
459     *ppPin = pin;
460     return S_OK;
461 }
462
463 static const ICaptureGraphBuilder2Vtbl builder2_Vtbl =
464 {   
465     fnCaptureGraphBuilder2_QueryInterface,
466     fnCaptureGraphBuilder2_AddRef,
467     fnCaptureGraphBuilder2_Release,
468     fnCaptureGraphBuilder2_SetFilterGraph,
469     fnCaptureGraphBuilder2_GetFilterGraph,
470     fnCaptureGraphBuilder2_SetOutputFileName,
471     fnCaptureGraphBuilder2_FindInterface,
472     fnCaptureGraphBuilder2_RenderStream,
473     fnCaptureGraphBuilder2_ControlStream,
474     fnCaptureGraphBuilder2_AllocCapFile,
475     fnCaptureGraphBuilder2_CopyCaptureFile,
476     fnCaptureGraphBuilder2_FindPin
477 };
478
479
480 static HRESULT WINAPI
481 fnCaptureGraphBuilder_QueryInterface(ICaptureGraphBuilder * iface,
482                                      REFIID riid, LPVOID * ppv)
483 {
484     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
485     TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
486     return IUnknown_QueryInterface(_ICaptureGraphBuilder2_(This), riid, ppv);
487 }
488
489 static ULONG WINAPI
490 fnCaptureGraphBuilder_AddRef(ICaptureGraphBuilder * iface)
491 {
492     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
493     TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
494     return IUnknown_AddRef(_ICaptureGraphBuilder2_(This));
495 }
496
497 static ULONG WINAPI
498 fnCaptureGraphBuilder_Release(ICaptureGraphBuilder * iface)
499 {
500     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
501     TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
502     return IUnknown_Release(_ICaptureGraphBuilder2_(This));
503 }
504
505 static HRESULT WINAPI
506 fnCaptureGraphBuilder_SetFiltergraph(ICaptureGraphBuilder * iface,
507                                      IGraphBuilder *pfg)
508 {
509     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
510     TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
511     return ICaptureGraphBuilder2_SetFiltergraph(_ICaptureGraphBuilder2_(This), pfg);
512 }
513
514 static HRESULT WINAPI
515 fnCaptureGraphBuilder_GetFiltergraph(ICaptureGraphBuilder * iface,
516                                      IGraphBuilder **pfg)
517 {
518     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
519     TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
520     return ICaptureGraphBuilder2_GetFiltergraph(_ICaptureGraphBuilder2_(This), pfg);
521 }
522
523 static HRESULT WINAPI
524 fnCaptureGraphBuilder_SetOutputFileName(ICaptureGraphBuilder * iface,
525                                         const GUID *pType, LPCOLESTR lpstrFile,
526                                         IBaseFilter **ppf, IFileSinkFilter **ppSink)
527 {
528     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
529     TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
530     return ICaptureGraphBuilder2_SetOutputFileName(_ICaptureGraphBuilder2_(This),
531                                                    pType, lpstrFile, ppf, ppSink);
532 }
533
534 static HRESULT WINAPI
535 fnCaptureGraphBuilder_FindInterface(ICaptureGraphBuilder * iface,
536                                     const GUID *pCategory, IBaseFilter *pf,
537                                     REFIID riid, void **ppint)
538 {
539     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
540     TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
541     return ICaptureGraphBuilder2_FindInterface(_ICaptureGraphBuilder2_(This),
542                                                pCategory, NULL, pf, riid, ppint);
543 }
544
545 static HRESULT WINAPI
546 fnCaptureGraphBuilder_RenderStream(ICaptureGraphBuilder * iface,
547                                    const GUID *pCategory, IUnknown *pSource,
548                                    IBaseFilter *pfCompressor, IBaseFilter *pfRenderer)
549 {
550     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
551     TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
552     return ICaptureGraphBuilder2_RenderStream(_ICaptureGraphBuilder2_(This),
553                                               pCategory, NULL, pSource,
554                                               pfCompressor, pfRenderer);
555 }
556
557 static HRESULT WINAPI
558 fnCaptureGraphBuilder_ControlStream(ICaptureGraphBuilder * iface,
559                                     const GUID *pCategory, IBaseFilter *pFilter,
560                                     REFERENCE_TIME *pstart, REFERENCE_TIME *pstop,
561                                     WORD wStartCookie, WORD wStopCookie)
562 {
563     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
564     TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
565     return ICaptureGraphBuilder2_ControlStream(_ICaptureGraphBuilder2_(This),
566                                                pCategory, NULL, pFilter, pstart, 
567                                                pstop, wStartCookie, wStopCookie);
568 }
569
570 static HRESULT WINAPI
571 fnCaptureGraphBuilder_AllocCapFile(ICaptureGraphBuilder * iface,
572                                    LPCOLESTR lpstr, DWORDLONG dwlSize)
573 {
574     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
575     TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
576     return ICaptureGraphBuilder2_AllocCapFile(_ICaptureGraphBuilder2_(This),
577                                               lpstr, dwlSize);
578 }
579
580 static HRESULT WINAPI
581 fnCaptureGraphBuilder_CopyCaptureFile(ICaptureGraphBuilder * iface,
582                                       LPOLESTR lpwstrOld, LPOLESTR lpwstrNew,
583                                       int fAllowEscAbort,
584                                       IAMCopyCaptureFileProgress *pCallback)
585 {
586     CaptureGraphImpl *This = impl_from_ICaptureGraphBuilder(iface);
587     TRACE("%p --> Forwarding to v2 (%p)\n", iface, This);
588     return ICaptureGraphBuilder2_CopyCaptureFile(_ICaptureGraphBuilder2_(This),
589                                                  lpwstrOld, lpwstrNew,
590                                                  fAllowEscAbort, pCallback);
591 }
592
593 static const ICaptureGraphBuilderVtbl builder_Vtbl =
594 {   
595    fnCaptureGraphBuilder_QueryInterface,
596    fnCaptureGraphBuilder_AddRef,
597    fnCaptureGraphBuilder_Release,
598    fnCaptureGraphBuilder_SetFiltergraph,
599    fnCaptureGraphBuilder_GetFiltergraph,
600    fnCaptureGraphBuilder_SetOutputFileName,
601    fnCaptureGraphBuilder_FindInterface,
602    fnCaptureGraphBuilder_RenderStream,
603    fnCaptureGraphBuilder_ControlStream,
604    fnCaptureGraphBuilder_AllocCapFile,
605    fnCaptureGraphBuilder_CopyCaptureFile
606 };