DrawStatusText() must not process prefix characters.
[wine/multimedia.git] / dlls / quartz / filtergraph.c
blob1f5664686c418268dc37de118606ab750ae72604
1 /* DirectShow FilterGraph object (QUARTZ.DLL)
3 * Copyright 2002 Lionel Ulmer
4 * Copyright 2004 Christian Costa
6 * This file contains the (internal) driver registration functions,
7 * driver enumeration APIs and DirectDraw creation functions.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #include "config.h"
25 #include <stdarg.h>
27 #define COBJMACROS
29 #include "windef.h"
30 #include "winbase.h"
31 #include "winuser.h"
32 #include "dshow.h"
33 #include "wine/debug.h"
34 #include "quartz_private.h"
35 #define COM_NO_WINDOWS_H
36 #include "ole2.h"
37 #include "olectl.h"
38 #include "strmif.h"
39 #include "vfwmsgs.h"
40 #include "evcode.h"
41 #include "wine/unicode.h"
44 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
46 typedef struct {
47 HWND hWnd; /* Target window */
48 long msg; /* User window message */
49 long instance; /* User data */
50 int disabled; /* Disabled messages posting */
51 } WndNotify;
53 typedef struct {
54 long lEventCode; /* Event code */
55 LONG_PTR lParam1; /* Param1 */
56 LONG_PTR lParam2; /* Param2 */
57 } Event;
59 /* messages ring implementation for queuing events (taken from winmm) */
60 #define EVENTS_RING_BUFFER_INCREMENT 64
61 typedef struct {
62 Event* messages;
63 int ring_buffer_size;
64 int msg_tosave;
65 int msg_toget;
66 CRITICAL_SECTION msg_crst;
67 HANDLE msg_event; /* Signaled for no empty queue */
68 } EventsQueue;
70 static int EventsQueue_Init(EventsQueue* omr)
72 omr->msg_toget = 0;
73 omr->msg_tosave = 0;
74 omr->msg_event = CreateEventW(NULL, TRUE, FALSE, NULL);
75 omr->ring_buffer_size = EVENTS_RING_BUFFER_INCREMENT;
76 omr->messages = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,omr->ring_buffer_size * sizeof(Event));
78 InitializeCriticalSection(&omr->msg_crst);
79 return TRUE;
82 static int EventsQueue_Destroy(EventsQueue* omr)
84 CloseHandle(omr->msg_event);
85 HeapFree(GetProcessHeap(),0,omr->messages);
86 DeleteCriticalSection(&omr->msg_crst);
87 return TRUE;
90 static int EventsQueue_PutEvent(EventsQueue* omr, Event* evt)
92 EnterCriticalSection(&omr->msg_crst);
93 if ((omr->msg_toget == ((omr->msg_tosave + 1) % omr->ring_buffer_size)))
95 int old_ring_buffer_size = omr->ring_buffer_size;
96 omr->ring_buffer_size += EVENTS_RING_BUFFER_INCREMENT;
97 TRACE("omr->ring_buffer_size=%d\n",omr->ring_buffer_size);
98 omr->messages = HeapReAlloc(GetProcessHeap(),0,omr->messages, omr->ring_buffer_size * sizeof(Event));
99 /* Now we need to rearrange the ring buffer so that the new
100 buffers just allocated are in between omr->msg_tosave and
101 omr->msg_toget.
103 if (omr->msg_tosave < omr->msg_toget)
105 memmove(&(omr->messages[omr->msg_toget + EVENTS_RING_BUFFER_INCREMENT]),
106 &(omr->messages[omr->msg_toget]),
107 sizeof(Event)*(old_ring_buffer_size - omr->msg_toget)
109 omr->msg_toget += EVENTS_RING_BUFFER_INCREMENT;
112 omr->messages[omr->msg_tosave] = *evt;
113 SetEvent(omr->msg_event);
114 omr->msg_tosave = (omr->msg_tosave + 1) % omr->ring_buffer_size;
115 LeaveCriticalSection(&omr->msg_crst);
116 return TRUE;
119 static int EventsQueue_GetEvent(EventsQueue* omr, Event* evt, long msTimeOut)
121 if (WaitForSingleObject(omr->msg_event, msTimeOut) != WAIT_OBJECT_0)
122 return FALSE;
124 EnterCriticalSection(&omr->msg_crst);
126 if (omr->msg_toget == omr->msg_tosave) /* buffer empty ? */
128 LeaveCriticalSection(&omr->msg_crst);
129 return FALSE;
132 *evt = omr->messages[omr->msg_toget];
133 omr->msg_toget = (omr->msg_toget + 1) % omr->ring_buffer_size;
135 /* Mark the buffer as empty if needed */
136 if (omr->msg_toget == omr->msg_tosave) /* buffer empty ? */
137 ResetEvent(omr->msg_event);
139 LeaveCriticalSection(&omr->msg_crst);
140 return TRUE;
143 typedef struct _IFilterGraphImpl {
144 IGraphBuilderVtbl *IGraphBuilder_vtbl;
145 IMediaControlVtbl *IMediaControl_vtbl;
146 IMediaSeekingVtbl *IMediaSeeking_vtbl;
147 IBasicAudioVtbl *IBasicAudio_vtbl;
148 IBasicVideoVtbl *IBasicVideo_vtbl;
149 IVideoWindowVtbl *IVideoWindow_vtbl;
150 IMediaEventExVtbl *IMediaEventEx_vtbl;
151 IMediaFilterVtbl *IMediaFilter_vtbl;
152 IMediaEventSinkVtbl *IMediaEventSink_vtbl;
153 /* IAMGraphStreams */
154 /* IAMStats */
155 /* IBasicVideo2 */
156 /* IFilterChain */
157 /* IFilterGraph2 */
158 /* IFilterMapper2 */
159 /* IGraphConfig */
160 /* IGraphVersion */
161 /* IMediaPosition */
162 /* IQueueCommand */
163 /* IRegisterServiceProvider */
164 /* IResourceMananger */
165 /* IServiceProvider */
166 /* IVideoFrameStep */
168 ULONG ref;
169 IFilterMapper2 * pFilterMapper2;
170 IBaseFilter ** ppFiltersInGraph;
171 LPWSTR * pFilterNames;
172 int nFilters;
173 int filterCapacity;
174 long nameIndex;
175 EventsQueue evqueue;
176 HANDLE hEventCompletion;
177 int CompletionStatus;
178 WndNotify notif;
179 int nRenderers;
180 int EcCompleteCount;
181 int HandleEcComplete;
182 int HandleEcRepaint;
183 } IFilterGraphImpl;
186 static HRESULT Filtergraph_QueryInterface(IFilterGraphImpl *This,
187 REFIID riid,
188 LPVOID *ppvObj) {
189 TRACE("(%p)->(%s (%p), %p)\n", This, debugstr_guid(riid), riid, ppvObj);
191 if (IsEqualGUID(&IID_IUnknown, riid) ||
192 IsEqualGUID(&IID_IFilterGraph, riid) ||
193 IsEqualGUID(&IID_IGraphBuilder, riid)) {
194 *ppvObj = &(This->IGraphBuilder_vtbl);
195 TRACE(" returning IGraphBuilder interface (%p)\n", *ppvObj);
196 } else if (IsEqualGUID(&IID_IMediaControl, riid)) {
197 *ppvObj = &(This->IMediaControl_vtbl);
198 TRACE(" returning IMediaControl interface (%p)\n", *ppvObj);
199 } else if (IsEqualGUID(&IID_IMediaSeeking, riid)) {
200 *ppvObj = &(This->IMediaSeeking_vtbl);
201 TRACE(" returning IMediaSeeking interface (%p)\n", *ppvObj);
202 } else if (IsEqualGUID(&IID_IBasicAudio, riid)) {
203 *ppvObj = &(This->IBasicAudio_vtbl);
204 TRACE(" returning IBasicAudio interface (%p)\n", *ppvObj);
205 } else if (IsEqualGUID(&IID_IBasicVideo, riid)) {
206 *ppvObj = &(This->IBasicVideo_vtbl);
207 TRACE(" returning IBasicVideo interface (%p)\n", *ppvObj);
208 } else if (IsEqualGUID(&IID_IVideoWindow, riid)) {
209 *ppvObj = &(This->IVideoWindow_vtbl);
210 TRACE(" returning IVideoWindow interface (%p)\n", *ppvObj);
211 } else if (IsEqualGUID(&IID_IMediaEvent, riid) ||
212 IsEqualGUID(&IID_IMediaEventEx, riid)) {
213 *ppvObj = &(This->IMediaEventEx_vtbl);
214 TRACE(" returning IMediaEvent(Ex) interface (%p)\n", *ppvObj);
215 } else if (IsEqualGUID(&IID_IMediaFilter, riid) ||
216 IsEqualGUID(&IID_IPersist, riid)) {
217 *ppvObj = &(This->IMediaFilter_vtbl);
218 TRACE(" returning IMediaFilter interface (%p)\n", *ppvObj);
219 } else if (IsEqualGUID(&IID_IMediaEventSink, riid)) {
220 *ppvObj = &(This->IMediaEventSink_vtbl);
221 TRACE(" returning IMediaEventSink interface (%p)\n", *ppvObj);
222 } else {
223 *ppvObj = NULL;
224 FIXME("unknown interface %s\n", debugstr_guid(riid));
225 return E_NOINTERFACE;
228 This->ref++;
229 return S_OK;
232 static ULONG Filtergraph_AddRef(IFilterGraphImpl *This) {
233 TRACE("(%p)->(): new ref = %ld\n", This, This->ref + 1);
235 return ++This->ref;
238 static ULONG Filtergraph_Release(IFilterGraphImpl *This) {
239 static ULONG ref;
241 TRACE("(%p)->(): new ref = %ld\n", This, This->ref - 1);
243 ref = --This->ref;
244 if (ref == 0) {
245 IFilterMapper2_Release(This->pFilterMapper2);
246 CloseHandle(This->hEventCompletion);
247 EventsQueue_Destroy(&This->evqueue);
248 HeapFree(GetProcessHeap(), 0, This->ppFiltersInGraph);
249 HeapFree(GetProcessHeap(), 0, This->pFilterNames);
250 HeapFree(GetProcessHeap(), 0, This);
252 return ref;
256 /*** IUnknown methods ***/
257 static HRESULT WINAPI Graphbuilder_QueryInterface(IGraphBuilder *iface,
258 REFIID riid,
259 LPVOID*ppvObj) {
260 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
262 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
263 return Filtergraph_QueryInterface(This, riid, ppvObj);
266 static ULONG WINAPI Graphbuilder_AddRef(IGraphBuilder *iface) {
267 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
269 TRACE("(%p/%p)->() calling FilterGraph AddRef\n", This, iface);
271 return Filtergraph_AddRef(This);
274 static ULONG WINAPI Graphbuilder_Release(IGraphBuilder *iface) {
275 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
277 TRACE("(%p/%p)->() calling FilterGraph Release\n", This, iface);
279 return Filtergraph_Release(This);
282 /*** IFilterGraph methods ***/
283 static HRESULT WINAPI Graphbuilder_AddFilter(IGraphBuilder *iface,
284 IBaseFilter *pFilter,
285 LPCWSTR pName) {
286 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
287 HRESULT hr;
288 int i,j;
289 WCHAR* wszFilterName = NULL;
290 int duplicate_name = FALSE;
292 TRACE("(%p/%p)->(%p, %s (%p))\n", This, iface, pFilter, debugstr_w(pName), pName);
294 wszFilterName = (WCHAR*) CoTaskMemAlloc( (pName ? strlenW(pName) + 6 : 5) * sizeof(WCHAR) );
296 if (pName)
298 /* Check if name already exists */
299 for(i = 0; i < This->nFilters; i++)
300 if (!strcmpW(This->pFilterNames[i], pName))
302 duplicate_name = TRUE;
303 break;
307 /* If no name given or name already existing, generate one */
308 if (!pName || duplicate_name)
310 static const WCHAR wszFmt1[] = {'%','s',' ','%','0','4','d',0};
311 static const WCHAR wszFmt2[] = {'%','0','4','d',0};
313 for (j = 0; j < 10000 ; j++)
315 /* Create name */
316 if (pName)
317 sprintfW(wszFilterName, wszFmt1, pName, This->nameIndex);
318 else
319 sprintfW(wszFilterName, wszFmt2, This->nameIndex);
320 TRACE("Generated name %s\n", debugstr_w(wszFilterName));
322 /* Check if the generated name already exists */
323 for(i = 0; i < This->nFilters; i++)
324 if (!strcmpW(This->pFilterNames[i], wszFilterName))
325 break;
327 /* Compute next index and exit if generated name is suitable */
328 if (This->nameIndex++ == 10000)
329 This->nameIndex = 1;
330 if (i == This->nFilters)
331 break;
333 /* Unable to find a suitable name */
334 if (j == 10000)
336 CoTaskMemFree(wszFilterName);
337 return VFW_E_DUPLICATE_NAME;
340 else
341 memcpy(wszFilterName, pName, (strlenW(pName) + 1) * sizeof(WCHAR));
343 if (This->nFilters + 1 > This->filterCapacity)
345 int newCapacity = 2*This->filterCapacity;
346 IBaseFilter ** ppNewFilters = CoTaskMemAlloc(newCapacity * sizeof(IBaseFilter*));
347 LPWSTR * pNewNames = CoTaskMemAlloc(newCapacity * sizeof(LPWSTR));
348 memcpy(ppNewFilters, This->ppFiltersInGraph, This->nFilters * sizeof(IBaseFilter*));
349 memcpy(pNewNames, This->pFilterNames, This->nFilters * sizeof(LPWSTR));
350 CoTaskMemFree(This->ppFiltersInGraph);
351 CoTaskMemFree(This->pFilterNames);
352 This->ppFiltersInGraph = ppNewFilters;
353 This->pFilterNames = pNewNames;
354 This->filterCapacity = newCapacity;
357 hr = IBaseFilter_JoinFilterGraph(pFilter, (IFilterGraph *)This, wszFilterName);
359 if (SUCCEEDED(hr))
361 IBaseFilter_AddRef(pFilter);
362 This->ppFiltersInGraph[This->nFilters] = pFilter;
363 This->pFilterNames[This->nFilters] = wszFilterName;
364 This->nFilters++;
366 else
367 CoTaskMemFree(wszFilterName);
369 if (SUCCEEDED(hr) && duplicate_name)
370 return VFW_S_DUPLICATE_NAME;
372 return hr;
375 static HRESULT WINAPI Graphbuilder_RemoveFilter(IGraphBuilder *iface,
376 IBaseFilter *pFilter) {
377 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
378 int i;
379 HRESULT hr = E_FAIL;
381 TRACE("(%p/%p)->(%p)\n", This, iface, pFilter);
383 /* FIXME: check graph is stopped */
385 for (i = 0; i < This->nFilters; i++)
387 if (This->ppFiltersInGraph[i] == pFilter)
389 /* FIXME: disconnect pins */
390 hr = IBaseFilter_JoinFilterGraph(pFilter, NULL, This->pFilterNames[i]);
391 if (SUCCEEDED(hr))
393 IPin_Release(pFilter);
394 CoTaskMemFree(This->pFilterNames[i]);
395 memmove(This->ppFiltersInGraph+i, This->ppFiltersInGraph+i+1, sizeof(IBaseFilter*)*(This->nFilters - 1 - i));
396 memmove(This->pFilterNames+i, This->pFilterNames+i+1, sizeof(LPWSTR)*(This->nFilters - 1 - i));
397 This->nFilters--;
398 return S_OK;
400 break;
404 return hr; /* FIXME: check this error code */
407 static HRESULT WINAPI Graphbuilder_EnumFilters(IGraphBuilder *iface,
408 IEnumFilters **ppEnum) {
409 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
411 TRACE("(%p/%p)->(%p)\n", This, iface, ppEnum);
413 return IEnumFiltersImpl_Construct(This->ppFiltersInGraph, This->nFilters, ppEnum);
416 static HRESULT WINAPI Graphbuilder_FindFilterByName(IGraphBuilder *iface,
417 LPCWSTR pName,
418 IBaseFilter **ppFilter) {
419 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
420 int i;
422 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_w(pName), pName, ppFilter);
424 *ppFilter = NULL;
426 for (i = 0; i < This->nFilters; i++)
428 if (!strcmpW(pName, This->pFilterNames[i]))
430 *ppFilter = This->ppFiltersInGraph[i];
431 IBaseFilter_AddRef(*ppFilter);
432 return S_OK;
436 return E_FAIL; /* FIXME: check this error code */
439 /* NOTE: despite the implication, it doesn't matter which
440 * way round you put in the input and output pins */
441 static HRESULT WINAPI Graphbuilder_ConnectDirect(IGraphBuilder *iface,
442 IPin *ppinIn,
443 IPin *ppinOut,
444 const AM_MEDIA_TYPE *pmt) {
445 PIN_DIRECTION dir;
446 HRESULT hr;
448 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
450 TRACE("(%p/%p)->(%p, %p, %p)\n", This, iface, ppinIn, ppinOut, pmt);
452 /* FIXME: check pins are in graph */
454 hr = IPin_QueryDirection(ppinIn, &dir);
455 if (SUCCEEDED(hr))
457 if (dir == PINDIR_INPUT)
458 hr = IPin_Connect(ppinOut, ppinIn, pmt);
459 else
460 hr = IPin_Connect(ppinIn, ppinOut, pmt);
463 return hr;
466 static HRESULT WINAPI Graphbuilder_Reconnect(IGraphBuilder *iface,
467 IPin *ppin) {
468 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
470 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppin);
472 return S_OK;
475 static HRESULT WINAPI Graphbuilder_Disconnect(IGraphBuilder *iface,
476 IPin *ppin) {
477 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
479 TRACE("(%p/%p)->(%p)\n", This, iface, ppin);
481 return IPin_Disconnect(ppin);
484 static HRESULT WINAPI Graphbuilder_SetDefaultSyncSource(IGraphBuilder *iface) {
485 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
487 TRACE("(%p/%p)->(): stub !!!\n", iface, This);
489 return S_OK;
492 static HRESULT GetFilterInfo(IMoniker* pMoniker, GUID* pclsid, VARIANT* pvar)
494 static const WCHAR wszClsidName[] = {'C','L','S','I','D',0};
495 static const WCHAR wszFriendlyName[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
496 IPropertyBag * pPropBagCat = NULL;
497 HRESULT hr;
499 VariantInit(pvar);
500 V_VT(pvar) = VT_BSTR;
502 hr = IMoniker_BindToStorage(pMoniker, NULL, NULL, &IID_IPropertyBag, (LPVOID*)&pPropBagCat);
504 if (SUCCEEDED(hr))
505 hr = IPropertyBag_Read(pPropBagCat, wszClsidName, pvar, NULL);
507 if (SUCCEEDED(hr))
508 hr = CLSIDFromString(V_UNION(pvar, bstrVal), pclsid);
510 if (SUCCEEDED(hr))
511 hr = IPropertyBag_Read(pPropBagCat, wszFriendlyName, pvar, NULL);
513 if (SUCCEEDED(hr))
514 TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid), debugstr_w(V_UNION(pvar, bstrVal)));
516 if (pPropBagCat)
517 IPropertyBag_Release(pPropBagCat);
519 return hr;
522 static HRESULT GetInternalConnections(IBaseFilter* pfilter, IPin* poutputpin, IPin*** pppins, ULONG* pnb)
524 HRESULT hr;
525 ULONG nb = 0;
527 TRACE("\n");
528 hr = IPin_QueryInternalConnections(poutputpin, NULL, &nb);
529 if (hr == S_OK) {
530 /* Rendered input */
531 } else if (hr == S_FALSE) {
532 *pppins = CoTaskMemAlloc(sizeof(IPin*)*nb);
533 hr = IPin_QueryInternalConnections(poutputpin, *pppins, &nb);
534 if (hr != S_OK) {
535 ERR("Error (%lx)\n", hr);
537 } else if (hr == E_NOTIMPL) {
538 /* Input connected to all outputs */
539 IEnumPins* penumpins;
540 IPin* ppin;
541 int i = 0;
542 TRACE("E_NOTIMPL\n");
543 hr = IBaseFilter_EnumPins(pfilter, &penumpins);
544 if (FAILED(hr)) {
545 ERR("filter Enumpins failed (%lx)\n", hr);
546 return hr;
548 i = 0;
549 /* Count output pins */
550 while(IEnumPins_Next(penumpins, 1, &ppin, &nb) == S_OK) {
551 PIN_DIRECTION pindir;
552 IPin_QueryDirection(ppin, &pindir);
553 if (pindir == PINDIR_OUTPUT)
554 i++;
555 else
556 IPin_Release(ppin);
558 *pppins = CoTaskMemAlloc(sizeof(IPin*)*i);
559 /* Retreive output pins */
560 IEnumPins_Reset(penumpins);
561 i = 0;
562 while(IEnumPins_Next(penumpins, 1, &ppin, &nb) == S_OK) {
563 PIN_DIRECTION pindir;
564 IPin_QueryDirection(ppin, &pindir);
565 if (pindir == PINDIR_OUTPUT)
566 (*pppins)[i++] = ppin;
567 else
568 IPin_Release(ppin);
570 nb = i;
571 if (FAILED(hr)) {
572 ERR("Next failed (%lx)\n", hr);
573 return hr;
575 IEnumPins_Release(penumpins);
576 } else if (FAILED(hr)) {
577 ERR("Cannot get internal connection (%lx)\n", hr);
578 return hr;
581 *pnb = nb;
582 return S_OK;
585 /*** IGraphBuilder methods ***/
586 static HRESULT WINAPI Graphbuilder_Connect(IGraphBuilder *iface,
587 IPin *ppinOut,
588 IPin *ppinIn) {
589 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
590 HRESULT hr;
591 AM_MEDIA_TYPE* mt;
592 IEnumMediaTypes* penummt;
593 ULONG nbmt;
594 IEnumPins* penumpins;
595 IEnumMoniker* pEnumMoniker;
596 GUID tab[2];
597 ULONG nb;
598 IMoniker* pMoniker;
599 ULONG pin;
601 TRACE("(%p/%p)->(%p, %p)\n", This, iface, ppinOut, ppinIn);
603 /* Try direct connection first */
604 TRACE("Try direct connection first\n");
605 hr = IPin_Connect(ppinOut, ppinIn, NULL);
606 if (SUCCEEDED(hr)) {
607 TRACE("Direct connection successfull\n");
608 return S_OK;
610 TRACE("Direct connection failed, trying to insert other filters\n");
612 /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream
613 * filter to the minor mediatype of input pin of the renderer */
614 hr = IPin_EnumMediaTypes(ppinOut, &penummt);
615 if (FAILED(hr)) {
616 ERR("EnumMediaTypes (%lx)\n", hr);
617 return hr;
620 hr = IEnumMediaTypes_Next(penummt, 1, &mt, &nbmt);
621 if (FAILED(hr)) {
622 ERR("IEnumMediaTypes_Next (%lx)\n", hr);
623 return hr;
626 if (!nbmt) {
627 ERR("No media type found!\n");
628 return S_OK;
630 TRACE("MajorType %s\n", debugstr_guid(&mt->majortype));
631 TRACE("SubType %s\n", debugstr_guid(&mt->subtype));
633 /* Try to find a suitable filter that can connect to the pin to render */
634 tab[0] = mt->majortype;
635 tab[1] = mt->subtype;
636 hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, FALSE, FALSE, 0, NULL, NULL, NULL);
637 if (FAILED(hr)) {
638 ERR("Unable to enum filters (%lx)\n", hr);
639 return hr;
642 while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
644 VARIANT var;
645 GUID clsid;
646 IPin** ppins;
647 IPin* ppinfilter;
648 IBaseFilter* pfilter = NULL;
650 hr = GetFilterInfo(pMoniker, &clsid, &var);
651 IMoniker_Release(pMoniker);
652 if (FAILED(hr)) {
653 ERR("Unable to retreive filter info (%lx)\n", hr);
654 goto error;
657 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&pfilter);
658 if (FAILED(hr)) {
659 ERR("Unable to create filter (%lx), trying next one\n", hr);
660 goto error;
663 hr = IGraphBuilder_AddFilter(iface, pfilter, NULL);
664 if (FAILED(hr)) {
665 ERR("Unable to add filter (%lx)\n", hr);
666 IBaseFilter_Release(pfilter);
667 pfilter = NULL;
668 goto error;
671 hr = IBaseFilter_EnumPins(pfilter, &penumpins);
672 if (FAILED(hr)) {
673 ERR("Enumpins (%lx)\n", hr);
674 goto error;
676 hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin);
677 if (FAILED(hr)) {
678 ERR("Next (%lx)\n", hr);
679 goto error;
681 if (pin == 0) {
682 ERR("No Pin\n");
683 goto error;
685 IEnumPins_Release(penumpins);
687 hr = IPin_Connect(ppinOut, ppinfilter, NULL);
688 if (FAILED(hr)) {
689 TRACE("Cannot connect to filter (%lx), trying next one\n", hr);
690 goto error;
692 TRACE("Successfully connected to filter, follow chain...\n");
694 /* Render all output pins of the filter by calling IGraphBuilder_Render on each of them */
695 hr = GetInternalConnections(pfilter, ppinfilter, &ppins, &nb);
697 if (SUCCEEDED(hr)) {
698 int i;
699 TRACE("pins to consider: %ld\n", nb);
700 for(i = 0; i < nb; i++) {
701 TRACE("Processing pin %d\n", i);
702 hr = IGraphBuilder_Connect(iface, ppins[0], ppinIn);
703 if (FAILED(hr)) {
704 TRACE("Cannot render pin %p (%lx)\n", ppinfilter, hr);
705 return hr;
708 CoTaskMemFree(ppins);
710 break;
712 error:
713 if (pfilter) {
714 IGraphBuilder_RemoveFilter(iface, pfilter);
715 IBaseFilter_Release(pfilter);
719 IEnumMediaTypes_Release(penummt);
720 DeleteMediaType(mt);
722 return S_OK;
725 static HRESULT WINAPI Graphbuilder_Render(IGraphBuilder *iface,
726 IPin *ppinOut) {
727 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
728 IEnumMediaTypes* penummt;
729 AM_MEDIA_TYPE* mt;
730 ULONG nbmt;
731 HRESULT hr;
733 IEnumMoniker* pEnumMoniker;
734 GUID tab[2];
735 ULONG nb;
736 IMoniker* pMoniker;
738 TRACE("(%p/%p)->(%p)\n", This, iface, ppinOut);
740 hr = IPin_EnumMediaTypes(ppinOut, &penummt);
741 if (FAILED(hr)) {
742 ERR("EnumMediaTypes (%lx)\n", hr);
743 return hr;
746 while(1)
748 hr = IEnumMediaTypes_Next(penummt, 1, &mt, &nbmt);
749 if (FAILED(hr)) {
750 ERR("IEnumMediaTypes_Next (%lx)\n", hr);
751 return hr;
753 if (!nbmt)
754 break;
755 TRACE("MajorType %s\n", debugstr_guid(&mt->majortype));
756 TRACE("SubType %s\n", debugstr_guid(&mt->subtype));
758 /* Try to find a suitable renderer with the same media type */
759 tab[0] = mt->majortype;
760 tab[1] = GUID_NULL;
761 hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, TRUE, FALSE, 0, NULL, NULL, NULL);
762 if (FAILED(hr)) {
763 ERR("Unable to enum filters (%lx)\n", hr);
764 return hr;
767 while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
769 VARIANT var;
770 GUID clsid;
771 IPin* ppinfilter;
772 IBaseFilter* pfilter = NULL;
773 IEnumPins* penumpins;
774 ULONG pin;
776 hr = GetFilterInfo(pMoniker, &clsid, &var);
777 IMoniker_Release(pMoniker);
778 if (FAILED(hr)) {
779 ERR("Unable to retreive filter info (%lx)\n", hr);
780 goto error;
783 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&pfilter);
784 if (FAILED(hr)) {
785 ERR("Unable to create filter (%lx), trying next one\n", hr);
786 goto error;
789 hr = IGraphBuilder_AddFilter(iface, pfilter, NULL);
790 if (FAILED(hr)) {
791 ERR("Unable to add filter (%lx)\n", hr);
792 IBaseFilter_Release(pfilter);
793 pfilter = NULL;
794 goto error;
797 hr = IBaseFilter_EnumPins(pfilter, &penumpins);
798 if (FAILED(hr)) {
799 ERR("Splitter Enumpins (%lx)\n", hr);
800 goto error;
802 hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin);
803 if (FAILED(hr)) {
804 ERR("Next (%lx)\n", hr);
805 goto error;
807 if (pin == 0) {
808 ERR("No Pin\n");
809 goto error;
811 IEnumPins_Release(penumpins);
813 /* Connect the pin to render to the renderer */
814 hr = IGraphBuilder_Connect(iface, ppinOut, ppinfilter);
815 if (FAILED(hr)) {
816 TRACE("Unable to connect to renderer (%lx)\n", hr);
817 goto error;
819 break;
821 error:
822 if (pfilter) {
823 IGraphBuilder_RemoveFilter(iface, pfilter);
824 IBaseFilter_Release(pfilter);
828 DeleteMediaType(mt);
829 break;
832 IEnumMediaTypes_Release(penummt);
834 return S_OK;
837 static HRESULT WINAPI Graphbuilder_RenderFile(IGraphBuilder *iface,
838 LPCWSTR lpcwstrFile,
839 LPCWSTR lpcwstrPlayList) {
840 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
841 static const WCHAR string[] = {'R','e','a','d','e','r',0};
842 IBaseFilter* preader = NULL;
843 IBaseFilter* psplitter;
844 IPin* ppinreader;
845 IPin* ppinsplitter;
846 IEnumPins* penumpins;
847 ULONG pin;
848 HRESULT hr;
849 IEnumMoniker* pEnumMoniker;
850 GUID tab[2];
851 IPin** ppins;
852 ULONG nb;
853 IMoniker* pMoniker;
854 IFileSourceFilter* pfile = NULL;
855 AM_MEDIA_TYPE mt;
856 WCHAR* filename;
858 TRACE("(%p/%p)->(%s, %s)\n", This, iface, debugstr_w(lpcwstrFile), debugstr_w(lpcwstrPlayList));
860 hr = IGraphBuilder_AddSourceFilter(iface, lpcwstrFile, string, &preader);
862 /* Retreive file media type */
863 if (SUCCEEDED(hr))
864 hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter, (LPVOID*)&pfile);
865 if (SUCCEEDED(hr)) {
866 hr = IFileSourceFilter_GetCurFile(pfile, &filename, &mt);
867 IFileSourceFilter_Release(pfile);
870 if (SUCCEEDED(hr)) {
871 tab[0] = mt.majortype;
872 tab[1] = mt.subtype;
873 hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, FALSE, FALSE, 0, NULL, NULL, NULL);
874 } else {
875 if (preader) {
876 IGraphBuilder_RemoveFilter(iface, preader);
877 IBaseFilter_Release(preader);
879 return hr;
882 while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
884 VARIANT var;
885 GUID clsid;
887 hr = GetFilterInfo(pMoniker, &clsid, &var);
888 IMoniker_Release(pMoniker);
889 if (FAILED(hr)) {
890 ERR("Unable to retreive filter info (%lx)\n", hr);
891 continue;
894 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&psplitter);
895 if (FAILED(hr)) {
896 ERR("Unable to create filter (%lx), trying next one\n", hr);
897 continue;
900 hr = IGraphBuilder_AddFilter(iface, psplitter, NULL);
901 if (FAILED(hr)) {
902 ERR("Unable add filter (%lx)\n", hr);
903 return hr;
906 /* Connect file source and splitter filters together */
907 /* Make the splitter analyze incoming data */
908 hr = IBaseFilter_EnumPins(preader, &penumpins);
909 if (FAILED(hr)) {
910 ERR("Enumpins (%lx)\n", hr);
911 return hr;
913 hr = IEnumPins_Next(penumpins, 1, &ppinreader, &pin);
914 if (FAILED(hr)) {
915 ERR("Next (%lx)\n", hr);
916 return hr;
918 if (pin == 0) {
919 ERR("No Pin\n");
920 return E_FAIL;
922 IEnumPins_Release(penumpins);
924 hr = IBaseFilter_EnumPins(psplitter, &penumpins);
925 if (FAILED(hr)) {
926 ERR("Splitter Enumpins (%lx)\n", hr);
927 return hr;
929 hr = IEnumPins_Next(penumpins, 1, &ppinsplitter, &pin);
930 if (FAILED(hr)) {
931 ERR("Next (%lx)\n", hr);
932 return hr;
934 if (pin == 0) {
935 ERR("No Pin\n");
936 return E_FAIL;
938 IEnumPins_Release(penumpins);
940 hr = IPin_Connect(ppinreader, ppinsplitter, NULL);
941 if (FAILED(hr)) {
942 IBaseFilter_Release(ppinsplitter);
943 ppinsplitter = NULL;
944 TRACE("Cannot connect to filter (%lx), trying next one\n", hr);
945 break;
947 TRACE("Successfully connected to filter\n");
948 break;
951 /* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
952 if (SUCCEEDED(hr))
953 hr = GetInternalConnections(psplitter, ppinsplitter, &ppins, &nb);
955 if (SUCCEEDED(hr)) {
956 int i;
957 TRACE("pins to consider: %ld\n", nb);
958 for(i = 0; i < nb; i++) {
959 TRACE("Processing pin %d\n", i);
960 hr = IGraphBuilder_Render(iface, ppins[i]);
961 if (FAILED(hr)) {
962 ERR("Cannot render pin %p (%lx)\n", ppins[i], hr);
963 /* FIXME: We should clean created things properly */
964 break;
967 CoTaskMemFree(ppins);
970 return hr;
973 static HRESULT WINAPI Graphbuilder_AddSourceFilter(IGraphBuilder *iface,
974 LPCWSTR lpcwstrFileName,
975 LPCWSTR lpcwstrFilterName,
976 IBaseFilter **ppFilter) {
977 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
978 HRESULT hr;
979 IBaseFilter* preader;
980 IFileSourceFilter* pfile = NULL;
981 AM_MEDIA_TYPE mt;
982 WCHAR* filename;
984 TRACE("(%p/%p)->(%s, %s, %p)\n", This, iface, debugstr_w(lpcwstrFileName), debugstr_w(lpcwstrFilterName), ppFilter);
986 /* Instantiate a file source filter */
987 hr = CoCreateInstance(&CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&preader);
988 if (FAILED(hr)) {
989 ERR("Unable to create file source filter (%lx)\n", hr);
990 return hr;
993 hr = IGraphBuilder_AddFilter(iface, preader, lpcwstrFilterName);
994 if (FAILED(hr)) {
995 ERR("Unable add filter (%lx)\n", hr);
996 IBaseFilter_Release(preader);
997 return hr;
1000 hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter, (LPVOID*)&pfile);
1001 if (FAILED(hr)) {
1002 ERR("Unable to get IFileSourceInterface (%lx)\n", hr);
1003 goto error;
1006 /* Load the file in the file source filter */
1007 hr = IFileSourceFilter_Load(pfile, lpcwstrFileName, NULL);
1008 if (FAILED(hr)) {
1009 ERR("Load (%lx)\n", hr);
1010 goto error;
1013 IFileSourceFilter_GetCurFile(pfile, &filename, &mt);
1014 if (FAILED(hr)) {
1015 ERR("GetCurFile (%lx)\n", hr);
1016 goto error;
1018 TRACE("File %s\n", debugstr_w(filename));
1019 TRACE("MajorType %s\n", debugstr_guid(&mt.majortype));
1020 TRACE("SubType %s\n", debugstr_guid(&mt.subtype));
1022 if (ppFilter)
1023 *ppFilter = preader;
1025 return S_OK;
1027 error:
1028 if (pfile)
1029 IFileSourceFilter_Release(pfile);
1030 IGraphBuilder_RemoveFilter(iface, preader);
1031 IBaseFilter_Release(preader);
1033 return S_OK;
1036 static HRESULT WINAPI Graphbuilder_SetLogFile(IGraphBuilder *iface,
1037 DWORD_PTR hFile) {
1038 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1040 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) hFile);
1042 return S_OK;
1045 static HRESULT WINAPI Graphbuilder_Abort(IGraphBuilder *iface) {
1046 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1048 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1050 return S_OK;
1053 static HRESULT WINAPI Graphbuilder_ShouldOperationContinue(IGraphBuilder *iface) {
1054 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1056 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1058 return S_OK;
1062 static IGraphBuilderVtbl IGraphBuilder_VTable =
1064 Graphbuilder_QueryInterface,
1065 Graphbuilder_AddRef,
1066 Graphbuilder_Release,
1067 Graphbuilder_AddFilter,
1068 Graphbuilder_RemoveFilter,
1069 Graphbuilder_EnumFilters,
1070 Graphbuilder_FindFilterByName,
1071 Graphbuilder_ConnectDirect,
1072 Graphbuilder_Reconnect,
1073 Graphbuilder_Disconnect,
1074 Graphbuilder_SetDefaultSyncSource,
1075 Graphbuilder_Connect,
1076 Graphbuilder_Render,
1077 Graphbuilder_RenderFile,
1078 Graphbuilder_AddSourceFilter,
1079 Graphbuilder_SetLogFile,
1080 Graphbuilder_Abort,
1081 Graphbuilder_ShouldOperationContinue
1084 /*** IUnknown methods ***/
1085 static HRESULT WINAPI Mediacontrol_QueryInterface(IMediaControl *iface,
1086 REFIID riid,
1087 LPVOID*ppvObj) {
1088 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1090 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1092 return Filtergraph_QueryInterface(This, riid, ppvObj);
1095 static ULONG WINAPI Mediacontrol_AddRef(IMediaControl *iface) {
1096 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1098 TRACE("(%p/%p)->()\n", This, iface);
1100 return Filtergraph_AddRef(This);
1103 static ULONG WINAPI Mediacontrol_Release(IMediaControl *iface) {
1104 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1106 TRACE("(%p/%p)->()\n", This, iface);
1108 return Filtergraph_Release(This);
1112 /*** IDispatch methods ***/
1113 static HRESULT WINAPI Mediacontrol_GetTypeInfoCount(IMediaControl *iface,
1114 UINT*pctinfo) {
1115 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1117 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1119 return S_OK;
1122 static HRESULT WINAPI Mediacontrol_GetTypeInfo(IMediaControl *iface,
1123 UINT iTInfo,
1124 LCID lcid,
1125 ITypeInfo**ppTInfo) {
1126 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1128 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1130 return S_OK;
1133 static HRESULT WINAPI Mediacontrol_GetIDsOfNames(IMediaControl *iface,
1134 REFIID riid,
1135 LPOLESTR*rgszNames,
1136 UINT cNames,
1137 LCID lcid,
1138 DISPID*rgDispId) {
1139 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1141 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1143 return S_OK;
1146 static HRESULT WINAPI Mediacontrol_Invoke(IMediaControl *iface,
1147 DISPID dispIdMember,
1148 REFIID riid,
1149 LCID lcid,
1150 WORD wFlags,
1151 DISPPARAMS*pDispParams,
1152 VARIANT*pVarResult,
1153 EXCEPINFO*pExepInfo,
1154 UINT*puArgErr) {
1155 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1157 TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
1159 return S_OK;
1162 /*** IMediaControl methods ***/
1163 static HRESULT WINAPI Mediacontrol_Run(IMediaControl *iface) {
1164 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1166 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1168 ResetEvent(This->hEventCompletion);
1170 return S_OK;
1173 static HRESULT WINAPI Mediacontrol_Pause(IMediaControl *iface) {
1174 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1176 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1178 return S_OK;
1181 static HRESULT WINAPI Mediacontrol_Stop(IMediaControl *iface) {
1182 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1184 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1186 return S_OK;
1189 static HRESULT WINAPI Mediacontrol_GetState(IMediaControl *iface,
1190 LONG msTimeout,
1191 OAFilterState *pfs) {
1192 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1194 TRACE("(%p/%p)->(%ld, %p): stub !!!\n", This, iface, msTimeout, pfs);
1196 return S_OK;
1199 static HRESULT WINAPI Mediacontrol_RenderFile(IMediaControl *iface,
1200 BSTR strFilename) {
1201 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1203 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This, iface, debugstr_w(strFilename), strFilename);
1205 return S_OK;
1208 static HRESULT WINAPI Mediacontrol_AddSourceFilter(IMediaControl *iface,
1209 BSTR strFilename,
1210 IDispatch **ppUnk) {
1211 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1213 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This, iface, debugstr_w(strFilename), strFilename, ppUnk);
1215 return S_OK;
1218 static HRESULT WINAPI Mediacontrol_get_FilterCollection(IMediaControl *iface,
1219 IDispatch **ppUnk) {
1220 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1222 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppUnk);
1224 return S_OK;
1227 static HRESULT WINAPI Mediacontrol_get_RegFilterCollection(IMediaControl *iface,
1228 IDispatch **ppUnk) {
1229 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1231 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppUnk);
1233 return S_OK;
1236 static HRESULT WINAPI Mediacontrol_StopWhenReady(IMediaControl *iface) {
1237 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1239 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1241 return S_OK;
1245 static IMediaControlVtbl IMediaControl_VTable =
1247 Mediacontrol_QueryInterface,
1248 Mediacontrol_AddRef,
1249 Mediacontrol_Release,
1250 Mediacontrol_GetTypeInfoCount,
1251 Mediacontrol_GetTypeInfo,
1252 Mediacontrol_GetIDsOfNames,
1253 Mediacontrol_Invoke,
1254 Mediacontrol_Run,
1255 Mediacontrol_Pause,
1256 Mediacontrol_Stop,
1257 Mediacontrol_GetState,
1258 Mediacontrol_RenderFile,
1259 Mediacontrol_AddSourceFilter,
1260 Mediacontrol_get_FilterCollection,
1261 Mediacontrol_get_RegFilterCollection,
1262 Mediacontrol_StopWhenReady
1266 /*** IUnknown methods ***/
1267 static HRESULT WINAPI Mediaseeking_QueryInterface(IMediaSeeking *iface,
1268 REFIID riid,
1269 LPVOID*ppvObj) {
1270 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1272 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1274 return Filtergraph_QueryInterface(This, riid, ppvObj);
1277 static ULONG WINAPI Mediaseeking_AddRef(IMediaSeeking *iface) {
1278 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1280 TRACE("(%p/%p)->()\n", This, iface);
1282 return Filtergraph_AddRef(This);
1285 static ULONG WINAPI Mediaseeking_Release(IMediaSeeking *iface) {
1286 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1288 TRACE("(%p/%p)->()\n", This, iface);
1290 return Filtergraph_Release(This);
1293 /*** IMediaSeeking methods ***/
1294 static HRESULT WINAPI Mediaseeking_GetCapabilities(IMediaSeeking *iface,
1295 DWORD *pCapabilities) {
1296 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1298 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCapabilities);
1300 return S_OK;
1303 static HRESULT WINAPI Mediaseeking_CheckCapabilities(IMediaSeeking *iface,
1304 DWORD *pCapabilities) {
1305 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1307 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCapabilities);
1309 return S_OK;
1312 static HRESULT WINAPI Mediaseeking_IsFormatSupported(IMediaSeeking *iface,
1313 const GUID *pFormat) {
1314 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1316 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1318 return S_OK;
1321 static HRESULT WINAPI Mediaseeking_QueryPreferredFormat(IMediaSeeking *iface,
1322 GUID *pFormat) {
1323 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1325 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1327 return S_OK;
1330 static HRESULT WINAPI Mediaseeking_GetTimeFormat(IMediaSeeking *iface,
1331 GUID *pFormat) {
1332 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1334 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1336 return S_OK;
1339 static HRESULT WINAPI Mediaseeking_IsUsingTimeFormat(IMediaSeeking *iface,
1340 const GUID *pFormat) {
1341 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1343 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1345 return S_OK;
1348 static HRESULT WINAPI Mediaseeking_SetTimeFormat(IMediaSeeking *iface,
1349 const GUID *pFormat) {
1350 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1352 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1354 return S_OK;
1357 static HRESULT WINAPI Mediaseeking_GetDuration(IMediaSeeking *iface,
1358 LONGLONG *pDuration) {
1359 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1361 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDuration);
1363 return S_OK;
1366 static HRESULT WINAPI Mediaseeking_GetStopPosition(IMediaSeeking *iface,
1367 LONGLONG *pStop) {
1368 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1370 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pStop);
1372 return S_OK;
1375 static HRESULT WINAPI Mediaseeking_GetCurrentPosition(IMediaSeeking *iface,
1376 LONGLONG *pCurrent) {
1377 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1379 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCurrent);
1381 return S_OK;
1384 static HRESULT WINAPI Mediaseeking_ConvertTimeFormat(IMediaSeeking *iface,
1385 LONGLONG *pTarget,
1386 const GUID *pTargetFormat,
1387 LONGLONG Source,
1388 const GUID *pSourceFormat) {
1389 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1391 TRACE("(%p/%p)->(%p, %p, %lld, %p): stub !!!\n", This, iface, pTarget, pTargetFormat, Source, pSourceFormat);
1393 return S_OK;
1396 static HRESULT WINAPI Mediaseeking_SetPositions(IMediaSeeking *iface,
1397 LONGLONG *pCurrent,
1398 DWORD dwCurrentFlags,
1399 LONGLONG *pStop,
1400 DWORD dwStopFlags) {
1401 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1403 TRACE("(%p/%p)->(%p, %08lx, %p, %08lx): stub !!!\n", This, iface, pCurrent, dwCurrentFlags, pStop, dwStopFlags);
1405 return S_OK;
1408 static HRESULT WINAPI Mediaseeking_GetPositions(IMediaSeeking *iface,
1409 LONGLONG *pCurrent,
1410 LONGLONG *pStop) {
1411 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1413 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pCurrent, pStop);
1415 return S_OK;
1418 static HRESULT WINAPI Mediaseeking_GetAvailable(IMediaSeeking *iface,
1419 LONGLONG *pEarliest,
1420 LONGLONG *pLatest) {
1421 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1423 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pEarliest, pLatest);
1425 return S_OK;
1428 static HRESULT WINAPI Mediaseeking_SetRate(IMediaSeeking *iface,
1429 double dRate) {
1430 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1432 TRACE("(%p/%p)->(%f): stub !!!\n", This, iface, dRate);
1434 return S_OK;
1437 static HRESULT WINAPI Mediaseeking_GetRate(IMediaSeeking *iface,
1438 double *pdRate) {
1439 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1441 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pdRate);
1443 return S_OK;
1446 static HRESULT WINAPI Mediaseeking_GetPreroll(IMediaSeeking *iface,
1447 LONGLONG *pllPreroll) {
1448 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1450 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pllPreroll);
1452 return S_OK;
1456 static IMediaSeekingVtbl IMediaSeeking_VTable =
1458 Mediaseeking_QueryInterface,
1459 Mediaseeking_AddRef,
1460 Mediaseeking_Release,
1461 Mediaseeking_GetCapabilities,
1462 Mediaseeking_CheckCapabilities,
1463 Mediaseeking_IsFormatSupported,
1464 Mediaseeking_QueryPreferredFormat,
1465 Mediaseeking_GetTimeFormat,
1466 Mediaseeking_IsUsingTimeFormat,
1467 Mediaseeking_SetTimeFormat,
1468 Mediaseeking_GetDuration,
1469 Mediaseeking_GetStopPosition,
1470 Mediaseeking_GetCurrentPosition,
1471 Mediaseeking_ConvertTimeFormat,
1472 Mediaseeking_SetPositions,
1473 Mediaseeking_GetPositions,
1474 Mediaseeking_GetAvailable,
1475 Mediaseeking_SetRate,
1476 Mediaseeking_GetRate,
1477 Mediaseeking_GetPreroll
1480 /*** IUnknown methods ***/
1481 static HRESULT WINAPI Basicaudio_QueryInterface(IBasicAudio *iface,
1482 REFIID riid,
1483 LPVOID*ppvObj) {
1484 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1486 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1488 return Filtergraph_QueryInterface(This, riid, ppvObj);
1491 static ULONG WINAPI Basicaudio_AddRef(IBasicAudio *iface) {
1492 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1494 TRACE("(%p/%p)->()\n", This, iface);
1496 return Filtergraph_AddRef(This);
1499 static ULONG WINAPI Basicaudio_Release(IBasicAudio *iface) {
1500 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1502 TRACE("(%p/%p)->()\n", This, iface);
1504 return Filtergraph_Release(This);
1507 /*** IDispatch methods ***/
1508 static HRESULT WINAPI Basicaudio_GetTypeInfoCount(IBasicAudio *iface,
1509 UINT*pctinfo) {
1510 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1512 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1514 return S_OK;
1517 static HRESULT WINAPI Basicaudio_GetTypeInfo(IBasicAudio *iface,
1518 UINT iTInfo,
1519 LCID lcid,
1520 ITypeInfo**ppTInfo) {
1521 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1523 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1525 return S_OK;
1528 static HRESULT WINAPI Basicaudio_GetIDsOfNames(IBasicAudio *iface,
1529 REFIID riid,
1530 LPOLESTR*rgszNames,
1531 UINT cNames,
1532 LCID lcid,
1533 DISPID*rgDispId) {
1534 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1536 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1538 return S_OK;
1541 static HRESULT WINAPI Basicaudio_Invoke(IBasicAudio *iface,
1542 DISPID dispIdMember,
1543 REFIID riid,
1544 LCID lcid,
1545 WORD wFlags,
1546 DISPPARAMS*pDispParams,
1547 VARIANT*pVarResult,
1548 EXCEPINFO*pExepInfo,
1549 UINT*puArgErr) {
1550 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1552 TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
1554 return S_OK;
1557 /*** IBasicAudio methods ***/
1558 static HRESULT WINAPI Basicaudio_put_Volume(IBasicAudio *iface,
1559 long lVolume) {
1560 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1562 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lVolume);
1564 return S_OK;
1567 static HRESULT WINAPI Basicaudio_get_Volume(IBasicAudio *iface,
1568 long *plVolume) {
1569 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1571 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plVolume);
1573 return S_OK;
1576 static HRESULT WINAPI Basicaudio_put_Balance(IBasicAudio *iface,
1577 long lBalance) {
1578 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1580 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lBalance);
1582 return S_OK;
1585 static HRESULT WINAPI Basicaudio_get_Balance(IBasicAudio *iface,
1586 long *plBalance) {
1587 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1589 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plBalance);
1591 return S_OK;
1594 static IBasicAudioVtbl IBasicAudio_VTable =
1596 Basicaudio_QueryInterface,
1597 Basicaudio_AddRef,
1598 Basicaudio_Release,
1599 Basicaudio_GetTypeInfoCount,
1600 Basicaudio_GetTypeInfo,
1601 Basicaudio_GetIDsOfNames,
1602 Basicaudio_Invoke,
1603 Basicaudio_put_Volume,
1604 Basicaudio_get_Volume,
1605 Basicaudio_put_Balance,
1606 Basicaudio_get_Balance
1609 /*** IUnknown methods ***/
1610 static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface,
1611 REFIID riid,
1612 LPVOID*ppvObj) {
1613 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1615 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1617 return Filtergraph_QueryInterface(This, riid, ppvObj);
1620 static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface) {
1621 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1623 TRACE("(%p/%p)->()\n", This, iface);
1625 return Filtergraph_AddRef(This);
1628 static ULONG WINAPI Basicvideo_Release(IBasicVideo *iface) {
1629 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1631 TRACE("(%p/%p)->()\n", This, iface);
1633 return Filtergraph_Release(This);
1636 /*** IDispatch methods ***/
1637 static HRESULT WINAPI Basicvideo_GetTypeInfoCount(IBasicVideo *iface,
1638 UINT*pctinfo) {
1639 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1641 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1643 return S_OK;
1646 static HRESULT WINAPI Basicvideo_GetTypeInfo(IBasicVideo *iface,
1647 UINT iTInfo,
1648 LCID lcid,
1649 ITypeInfo**ppTInfo) {
1650 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1652 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1654 return S_OK;
1657 static HRESULT WINAPI Basicvideo_GetIDsOfNames(IBasicVideo *iface,
1658 REFIID riid,
1659 LPOLESTR*rgszNames,
1660 UINT cNames,
1661 LCID lcid,
1662 DISPID*rgDispId) {
1663 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1665 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1667 return S_OK;
1670 static HRESULT WINAPI Basicvideo_Invoke(IBasicVideo *iface,
1671 DISPID dispIdMember,
1672 REFIID riid,
1673 LCID lcid,
1674 WORD wFlags,
1675 DISPPARAMS*pDispParams,
1676 VARIANT*pVarResult,
1677 EXCEPINFO*pExepInfo,
1678 UINT*puArgErr) {
1679 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1681 TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
1683 return S_OK;
1686 /*** IBasicVideo methods ***/
1687 static HRESULT WINAPI Basicvideo_get_AvgTimePerFrame(IBasicVideo *iface,
1688 REFTIME *pAvgTimePerFrame) {
1689 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1691 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pAvgTimePerFrame);
1693 return S_OK;
1696 static HRESULT WINAPI Basicvideo_get_BitRate(IBasicVideo *iface,
1697 long *pBitRate) {
1698 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1700 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBitRate);
1702 return S_OK;
1705 static HRESULT WINAPI Basicvideo_get_BitErrorRate(IBasicVideo *iface,
1706 long *pBitErrorRate) {
1707 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1709 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBitErrorRate);
1711 return S_OK;
1714 static HRESULT WINAPI Basicvideo_get_VideoWidth(IBasicVideo *iface,
1715 long *pVideoWidth) {
1716 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1718 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVideoWidth);
1720 return S_OK;
1723 static HRESULT WINAPI Basicvideo_get_VideoHeight(IBasicVideo *iface,
1724 long *pVideoHeight) {
1725 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1727 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVideoHeight);
1729 return S_OK;
1732 static HRESULT WINAPI Basicvideo_put_SourceLeft(IBasicVideo *iface,
1733 long SourceLeft) {
1734 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1736 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceLeft);
1738 return S_OK;
1741 static HRESULT WINAPI Basicvideo_get_SourceLeft(IBasicVideo *iface,
1742 long *pSourceLeft) {
1743 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1745 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceLeft);
1747 return S_OK;
1750 static HRESULT WINAPI Basicvideo_put_SourceWidth(IBasicVideo *iface,
1751 long SourceWidth) {
1752 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1754 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceWidth);
1756 return S_OK;
1759 static HRESULT WINAPI Basicvideo_get_SourceWidth(IBasicVideo *iface,
1760 long *pSourceWidth) {
1761 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1763 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceWidth);
1765 return S_OK;
1768 static HRESULT WINAPI Basicvideo_put_SourceTop(IBasicVideo *iface,
1769 long SourceTop) {
1770 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1772 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceTop);
1774 return S_OK;
1777 static HRESULT WINAPI Basicvideo_get_SourceTop(IBasicVideo *iface,
1778 long *pSourceTop) {
1779 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1781 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceTop);
1783 return S_OK;
1786 static HRESULT WINAPI Basicvideo_put_SourceHeight(IBasicVideo *iface,
1787 long SourceHeight) {
1788 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1790 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceHeight);
1792 return S_OK;
1795 static HRESULT WINAPI Basicvideo_get_SourceHeight(IBasicVideo *iface,
1796 long *pSourceHeight) {
1797 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1799 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceHeight);
1801 return S_OK;
1804 static HRESULT WINAPI Basicvideo_put_DestinationLeft(IBasicVideo *iface,
1805 long DestinationLeft) {
1806 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1808 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationLeft);
1810 return S_OK;
1813 static HRESULT WINAPI Basicvideo_get_DestinationLeft(IBasicVideo *iface,
1814 long *pDestinationLeft) {
1815 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1817 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationLeft);
1819 return S_OK;
1822 static HRESULT WINAPI Basicvideo_put_DestinationWidth(IBasicVideo *iface,
1823 long DestinationWidth) {
1824 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1826 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationWidth);
1828 return S_OK;
1831 static HRESULT WINAPI Basicvideo_get_DestinationWidth(IBasicVideo *iface,
1832 long *pDestinationWidth) {
1833 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1835 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationWidth);
1837 return S_OK;
1840 static HRESULT WINAPI Basicvideo_put_DestinationTop(IBasicVideo *iface,
1841 long DestinationTop) {
1842 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1844 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationTop);
1846 return S_OK;
1849 static HRESULT WINAPI Basicvideo_get_DestinationTop(IBasicVideo *iface,
1850 long *pDestinationTop) {
1851 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1853 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationTop);
1855 return S_OK;
1858 static HRESULT WINAPI Basicvideo_put_DestinationHeight(IBasicVideo *iface,
1859 long DestinationHeight) {
1860 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1862 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationHeight);
1864 return S_OK;
1867 static HRESULT WINAPI Basicvideo_get_DestinationHeight(IBasicVideo *iface,
1868 long *pDestinationHeight) {
1869 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1871 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationHeight);
1873 return S_OK;
1876 static HRESULT WINAPI Basicvideo_SetSourcePosition(IBasicVideo *iface,
1877 long Left,
1878 long Top,
1879 long Width,
1880 long Height) {
1881 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1883 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
1885 return S_OK;
1888 static HRESULT WINAPI Basicvideo_GetSourcePosition(IBasicVideo *iface,
1889 long *pLeft,
1890 long *pTop,
1891 long *pWidth,
1892 long *pHeight) {
1893 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1895 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
1897 return S_OK;
1900 static HRESULT WINAPI Basicvideo_SetDefaultSourcePosition(IBasicVideo *iface) {
1901 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1903 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1905 return S_OK;
1908 static HRESULT WINAPI Basicvideo_SetDestinationPosition(IBasicVideo *iface,
1909 long Left,
1910 long Top,
1911 long Width,
1912 long Height) {
1913 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1915 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
1917 return S_OK;
1920 static HRESULT WINAPI Basicvideo_GetDestinationPosition(IBasicVideo *iface,
1921 long *pLeft,
1922 long *pTop,
1923 long *pWidth,
1924 long *pHeight) {
1925 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1927 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
1929 return S_OK;
1932 static HRESULT WINAPI Basicvideo_SetDefaultDestinationPosition(IBasicVideo *iface) {
1933 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1935 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1937 return S_OK;
1940 static HRESULT WINAPI Basicvideo_GetVideoSize(IBasicVideo *iface,
1941 long *pWidth,
1942 long *pHeight) {
1943 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1945 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
1947 return S_OK;
1950 static HRESULT WINAPI Basicvideo_GetVideoPaletteEntries(IBasicVideo *iface,
1951 long StartIndex,
1952 long Entries,
1953 long *pRetrieved,
1954 long *pPalette) {
1955 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1957 TRACE("(%p/%p)->(%ld, %ld, %p, %p): stub !!!\n", This, iface, StartIndex, Entries, pRetrieved, pPalette);
1959 return S_OK;
1962 static HRESULT WINAPI Basicvideo_GetCurrentImage(IBasicVideo *iface,
1963 long *pBufferSize,
1964 long *pDIBImage) {
1965 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1967 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pBufferSize, pDIBImage);
1969 return S_OK;
1972 static HRESULT WINAPI Basicvideo_IsUsingDefaultSource(IBasicVideo *iface) {
1973 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1975 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1977 return S_OK;
1980 static HRESULT WINAPI Basicvideo_IsUsingDefaultDestination(IBasicVideo *iface) {
1981 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1983 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1985 return S_OK;
1989 static IBasicVideoVtbl IBasicVideo_VTable =
1991 Basicvideo_QueryInterface,
1992 Basicvideo_AddRef,
1993 Basicvideo_Release,
1994 Basicvideo_GetTypeInfoCount,
1995 Basicvideo_GetTypeInfo,
1996 Basicvideo_GetIDsOfNames,
1997 Basicvideo_Invoke,
1998 Basicvideo_get_AvgTimePerFrame,
1999 Basicvideo_get_BitRate,
2000 Basicvideo_get_BitErrorRate,
2001 Basicvideo_get_VideoWidth,
2002 Basicvideo_get_VideoHeight,
2003 Basicvideo_put_SourceLeft,
2004 Basicvideo_get_SourceLeft,
2005 Basicvideo_put_SourceWidth,
2006 Basicvideo_get_SourceWidth,
2007 Basicvideo_put_SourceTop,
2008 Basicvideo_get_SourceTop,
2009 Basicvideo_put_SourceHeight,
2010 Basicvideo_get_SourceHeight,
2011 Basicvideo_put_DestinationLeft,
2012 Basicvideo_get_DestinationLeft,
2013 Basicvideo_put_DestinationWidth,
2014 Basicvideo_get_DestinationWidth,
2015 Basicvideo_put_DestinationTop,
2016 Basicvideo_get_DestinationTop,
2017 Basicvideo_put_DestinationHeight,
2018 Basicvideo_get_DestinationHeight,
2019 Basicvideo_SetSourcePosition,
2020 Basicvideo_GetSourcePosition,
2021 Basicvideo_SetDefaultSourcePosition,
2022 Basicvideo_SetDestinationPosition,
2023 Basicvideo_GetDestinationPosition,
2024 Basicvideo_SetDefaultDestinationPosition,
2025 Basicvideo_GetVideoSize,
2026 Basicvideo_GetVideoPaletteEntries,
2027 Basicvideo_GetCurrentImage,
2028 Basicvideo_IsUsingDefaultSource,
2029 Basicvideo_IsUsingDefaultDestination
2033 /*** IUnknown methods ***/
2034 static HRESULT WINAPI Videowindow_QueryInterface(IVideoWindow *iface,
2035 REFIID riid,
2036 LPVOID*ppvObj) {
2037 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2039 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
2041 return Filtergraph_QueryInterface(This, riid, ppvObj);
2044 static ULONG WINAPI Videowindow_AddRef(IVideoWindow *iface) {
2045 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2047 TRACE("(%p/%p)->()\n", This, iface);
2049 return Filtergraph_AddRef(This);
2052 static ULONG WINAPI Videowindow_Release(IVideoWindow *iface) {
2053 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2055 TRACE("(%p/%p)->()\n", This, iface);
2057 return Filtergraph_Release(This);
2060 /*** IDispatch methods ***/
2061 static HRESULT WINAPI Videowindow_GetTypeInfoCount(IVideoWindow *iface,
2062 UINT*pctinfo) {
2063 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2065 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
2067 return S_OK;
2070 static HRESULT WINAPI Videowindow_GetTypeInfo(IVideoWindow *iface,
2071 UINT iTInfo,
2072 LCID lcid,
2073 ITypeInfo**ppTInfo) {
2074 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2076 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
2078 return S_OK;
2081 static HRESULT WINAPI Videowindow_GetIDsOfNames(IVideoWindow *iface,
2082 REFIID riid,
2083 LPOLESTR*rgszNames,
2084 UINT cNames,
2085 LCID lcid,
2086 DISPID*rgDispId) {
2087 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2089 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
2091 return S_OK;
2094 static HRESULT WINAPI Videowindow_Invoke(IVideoWindow *iface,
2095 DISPID dispIdMember,
2096 REFIID riid,
2097 LCID lcid,
2098 WORD wFlags,
2099 DISPPARAMS*pDispParams,
2100 VARIANT*pVarResult,
2101 EXCEPINFO*pExepInfo,
2102 UINT*puArgErr) {
2103 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2105 TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
2107 return S_OK;
2110 /*** IVideoWindow methods ***/
2111 static HRESULT WINAPI Videowindow_put_Caption(IVideoWindow *iface,
2112 BSTR strCaption) {
2113 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2115 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This, iface, debugstr_w(strCaption), strCaption);
2117 return S_OK;
2120 static HRESULT WINAPI Videowindow_get_Caption(IVideoWindow *iface,
2121 BSTR *strCaption) {
2122 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2124 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, strCaption);
2126 return S_OK;
2129 static HRESULT WINAPI Videowindow_put_WindowStyle(IVideoWindow *iface,
2130 long WindowStyle) {
2131 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2133 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowStyle);
2135 return S_OK;
2138 static HRESULT WINAPI Videowindow_get_WindowStyle(IVideoWindow *iface,
2139 long *WindowStyle) {
2140 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2142 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowStyle);
2144 return S_OK;
2147 static HRESULT WINAPI Videowindow_put_WindowStyleEx(IVideoWindow *iface,
2148 long WindowStyleEx) {
2149 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2151 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowStyleEx);
2153 return S_OK;
2156 static HRESULT WINAPI Videowindow_get_WindowStyleEx(IVideoWindow *iface,
2157 long *WindowStyleEx) {
2158 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2160 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowStyleEx);
2162 return S_OK;
2165 static HRESULT WINAPI Videowindow_put_AutoShow(IVideoWindow *iface,
2166 long AutoShow) {
2167 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2169 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, AutoShow);
2171 return S_OK;
2174 static HRESULT WINAPI Videowindow_get_AutoShow(IVideoWindow *iface,
2175 long *AutoShow) {
2176 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2178 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, AutoShow);
2180 return S_OK;
2183 static HRESULT WINAPI Videowindow_put_WindowState(IVideoWindow *iface,
2184 long WindowState) {
2185 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2187 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowState);
2189 return S_OK;
2192 static HRESULT WINAPI Videowindow_get_WindowState(IVideoWindow *iface,
2193 long *WindowState) {
2194 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2196 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowState);
2198 return S_OK;
2201 static HRESULT WINAPI Videowindow_put_BackgroundPalette(IVideoWindow *iface,
2202 long BackgroundPalette) {
2203 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2205 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, BackgroundPalette);
2207 return S_OK;
2210 static HRESULT WINAPI Videowindow_get_BackgroundPalette(IVideoWindow *iface,
2211 long *pBackgroundPalette) {
2212 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2214 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBackgroundPalette);
2216 return S_OK;
2219 static HRESULT WINAPI Videowindow_put_Visible(IVideoWindow *iface,
2220 long Visible) {
2221 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2223 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Visible);
2225 return S_OK;
2228 static HRESULT WINAPI Videowindow_get_Visible(IVideoWindow *iface,
2229 long *pVisible) {
2230 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2232 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVisible);
2234 return S_OK;
2237 static HRESULT WINAPI Videowindow_put_Left(IVideoWindow *iface,
2238 long Left) {
2239 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2241 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Left);
2243 return S_OK;
2246 static HRESULT WINAPI Videowindow_get_Left(IVideoWindow *iface,
2247 long *pLeft) {
2248 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2250 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pLeft);
2252 return S_OK;
2255 static HRESULT WINAPI Videowindow_put_Width(IVideoWindow *iface,
2256 long Width) {
2257 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2259 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Width);
2261 return S_OK;
2264 static HRESULT WINAPI Videowindow_get_Width(IVideoWindow *iface,
2265 long *pWidth) {
2266 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2268 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pWidth);
2270 return S_OK;
2273 static HRESULT WINAPI Videowindow_put_Top(IVideoWindow *iface,
2274 long Top) {
2275 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2277 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Top);
2279 return S_OK;
2282 static HRESULT WINAPI Videowindow_get_Top(IVideoWindow *iface,
2283 long *pTop) {
2284 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2286 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pTop);
2288 return S_OK;
2291 static HRESULT WINAPI Videowindow_put_Height(IVideoWindow *iface,
2292 long Height) {
2293 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2295 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Height);
2297 return S_OK;
2300 static HRESULT WINAPI Videowindow_get_Height(IVideoWindow *iface,
2301 long *pHeight) {
2302 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2304 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pHeight);
2306 return S_OK;
2309 static HRESULT WINAPI Videowindow_put_Owner(IVideoWindow *iface,
2310 OAHWND Owner) {
2311 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2313 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Owner);
2315 return S_OK;
2318 static HRESULT WINAPI Videowindow_get_Owner(IVideoWindow *iface,
2319 OAHWND *Owner) {
2320 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2322 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Owner);
2324 return S_OK;
2327 static HRESULT WINAPI Videowindow_put_MessageDrain(IVideoWindow *iface,
2328 OAHWND Drain) {
2329 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2331 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Drain);
2333 return S_OK;
2336 static HRESULT WINAPI Videowindow_get_MessageDrain(IVideoWindow *iface,
2337 OAHWND *Drain) {
2338 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2340 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, Drain);
2342 return S_OK;
2345 static HRESULT WINAPI Videowindow_get_BorderColor(IVideoWindow *iface,
2346 long *Color) {
2347 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2349 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, Color);
2351 return S_OK;
2354 static HRESULT WINAPI Videowindow_put_BorderColor(IVideoWindow *iface,
2355 long Color) {
2356 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2358 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Color);
2360 return S_OK;
2363 static HRESULT WINAPI Videowindow_get_FullScreenMode(IVideoWindow *iface,
2364 long *FullScreenMode) {
2365 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2367 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, FullScreenMode);
2369 return S_OK;
2372 static HRESULT WINAPI Videowindow_put_FullScreenMode(IVideoWindow *iface,
2373 long FullScreenMode) {
2374 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2376 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, FullScreenMode);
2378 return S_OK;
2381 static HRESULT WINAPI Videowindow_SetWindowForeground(IVideoWindow *iface,
2382 long Focus) {
2383 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2385 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Focus);
2387 return S_OK;
2390 static HRESULT WINAPI Videowindow_NotifyOwnerMessage(IVideoWindow *iface,
2391 OAHWND hwnd,
2392 long uMsg,
2393 LONG_PTR wParam,
2394 LONG_PTR lParam) {
2395 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2397 TRACE("(%p/%p)->(%08lx, %ld, %08lx, %08lx): stub !!!\n", This, iface, (DWORD) hwnd, uMsg, wParam, lParam);
2399 return S_OK;
2402 static HRESULT WINAPI Videowindow_SetWindowPosition(IVideoWindow *iface,
2403 long Left,
2404 long Top,
2405 long Width,
2406 long Height) {
2407 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2409 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2411 return S_OK;
2414 static HRESULT WINAPI Videowindow_GetWindowPosition(IVideoWindow *iface,
2415 long *pLeft,
2416 long *pTop,
2417 long *pWidth,
2418 long *pHeight) {
2419 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2421 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2423 return S_OK;
2426 static HRESULT WINAPI Videowindow_GetMinIdealImageSize(IVideoWindow *iface,
2427 long *pWidth,
2428 long *pHeight) {
2429 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2431 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2433 return S_OK;
2436 static HRESULT WINAPI Videowindow_GetMaxIdealImageSize(IVideoWindow *iface,
2437 long *pWidth,
2438 long *pHeight) {
2439 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2441 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2443 return S_OK;
2446 static HRESULT WINAPI Videowindow_GetRestorePosition(IVideoWindow *iface,
2447 long *pLeft,
2448 long *pTop,
2449 long *pWidth,
2450 long *pHeight) {
2451 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2453 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2455 return S_OK;
2458 static HRESULT WINAPI Videowindow_HideCursor(IVideoWindow *iface,
2459 long HideCursor) {
2460 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2462 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, HideCursor);
2464 return S_OK;
2467 static HRESULT WINAPI Videowindow_IsCursorHidden(IVideoWindow *iface,
2468 long *CursorHidden) {
2469 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2471 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, CursorHidden);
2473 return S_OK;
2477 static IVideoWindowVtbl IVideoWindow_VTable =
2479 Videowindow_QueryInterface,
2480 Videowindow_AddRef,
2481 Videowindow_Release,
2482 Videowindow_GetTypeInfoCount,
2483 Videowindow_GetTypeInfo,
2484 Videowindow_GetIDsOfNames,
2485 Videowindow_Invoke,
2486 Videowindow_put_Caption,
2487 Videowindow_get_Caption,
2488 Videowindow_put_WindowStyle,
2489 Videowindow_get_WindowStyle,
2490 Videowindow_put_WindowStyleEx,
2491 Videowindow_get_WindowStyleEx,
2492 Videowindow_put_AutoShow,
2493 Videowindow_get_AutoShow,
2494 Videowindow_put_WindowState,
2495 Videowindow_get_WindowState,
2496 Videowindow_put_BackgroundPalette,
2497 Videowindow_get_BackgroundPalette,
2498 Videowindow_put_Visible,
2499 Videowindow_get_Visible,
2500 Videowindow_put_Left,
2501 Videowindow_get_Left,
2502 Videowindow_put_Width,
2503 Videowindow_get_Width,
2504 Videowindow_put_Top,
2505 Videowindow_get_Top,
2506 Videowindow_put_Height,
2507 Videowindow_get_Height,
2508 Videowindow_put_Owner,
2509 Videowindow_get_Owner,
2510 Videowindow_put_MessageDrain,
2511 Videowindow_get_MessageDrain,
2512 Videowindow_get_BorderColor,
2513 Videowindow_put_BorderColor,
2514 Videowindow_get_FullScreenMode,
2515 Videowindow_put_FullScreenMode,
2516 Videowindow_SetWindowForeground,
2517 Videowindow_NotifyOwnerMessage,
2518 Videowindow_SetWindowPosition,
2519 Videowindow_GetWindowPosition,
2520 Videowindow_GetMinIdealImageSize,
2521 Videowindow_GetMaxIdealImageSize,
2522 Videowindow_GetRestorePosition,
2523 Videowindow_HideCursor,
2524 Videowindow_IsCursorHidden
2528 /*** IUnknown methods ***/
2529 static HRESULT WINAPI Mediaevent_QueryInterface(IMediaEventEx *iface,
2530 REFIID riid,
2531 LPVOID*ppvObj) {
2532 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2534 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
2536 return Filtergraph_QueryInterface(This, riid, ppvObj);
2539 static ULONG WINAPI Mediaevent_AddRef(IMediaEventEx *iface) {
2540 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2542 TRACE("(%p/%p)->()\n", This, iface);
2544 return Filtergraph_AddRef(This);
2547 static ULONG WINAPI Mediaevent_Release(IMediaEventEx *iface) {
2548 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2550 TRACE("(%p/%p)->()\n", This, iface);
2552 return Filtergraph_Release(This);
2555 /*** IDispatch methods ***/
2556 static HRESULT WINAPI Mediaevent_GetTypeInfoCount(IMediaEventEx *iface,
2557 UINT*pctinfo) {
2558 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2560 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
2562 return S_OK;
2565 static HRESULT WINAPI Mediaevent_GetTypeInfo(IMediaEventEx *iface,
2566 UINT iTInfo,
2567 LCID lcid,
2568 ITypeInfo**ppTInfo) {
2569 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2571 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
2573 return S_OK;
2576 static HRESULT WINAPI Mediaevent_GetIDsOfNames(IMediaEventEx *iface,
2577 REFIID riid,
2578 LPOLESTR*rgszNames,
2579 UINT cNames,
2580 LCID lcid,
2581 DISPID*rgDispId) {
2582 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2584 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
2586 return S_OK;
2589 static HRESULT WINAPI Mediaevent_Invoke(IMediaEventEx *iface,
2590 DISPID dispIdMember,
2591 REFIID riid,
2592 LCID lcid,
2593 WORD wFlags,
2594 DISPPARAMS*pDispParams,
2595 VARIANT*pVarResult,
2596 EXCEPINFO*pExepInfo,
2597 UINT*puArgErr) {
2598 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2600 TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
2602 return S_OK;
2605 /*** IMediaEvent methods ***/
2606 static HRESULT WINAPI Mediaevent_GetEventHandle(IMediaEventEx *iface,
2607 OAEVENT *hEvent) {
2608 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2610 TRACE("(%p/%p)->(%p)\n", This, iface, hEvent);
2612 *hEvent = (OAEVENT)This->evqueue.msg_event;
2614 return S_OK;
2617 static HRESULT WINAPI Mediaevent_GetEvent(IMediaEventEx *iface,
2618 long *lEventCode,
2619 LONG_PTR *lParam1,
2620 LONG_PTR *lParam2,
2621 long msTimeout) {
2622 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2623 Event evt;
2625 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This, iface, lEventCode, lParam1, lParam2, msTimeout);
2627 if (EventsQueue_GetEvent(&This->evqueue, &evt, msTimeout))
2629 *lEventCode = evt.lEventCode;
2630 *lParam1 = evt.lParam1;
2631 *lParam2 = evt.lParam2;
2632 return S_OK;
2635 *lEventCode = 0;
2636 return E_ABORT;
2639 static HRESULT WINAPI Mediaevent_WaitForCompletion(IMediaEventEx *iface,
2640 long msTimeout,
2641 long *pEvCode) {
2642 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2644 TRACE("(%p/%p)->(%ld, %p)\n", This, iface, msTimeout, pEvCode);
2646 if (WaitForSingleObject(This->hEventCompletion, msTimeout) == WAIT_OBJECT_0)
2648 *pEvCode = This->CompletionStatus;
2649 return S_OK;
2652 *pEvCode = 0;
2653 return E_ABORT;
2656 static HRESULT WINAPI Mediaevent_CancelDefaultHandling(IMediaEventEx *iface,
2657 long lEvCode) {
2658 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2660 TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode);
2662 if (lEvCode == EC_COMPLETE)
2663 This->HandleEcComplete = FALSE;
2664 else if (lEvCode == EC_REPAINT)
2665 This->HandleEcRepaint = FALSE;
2666 else
2667 return S_FALSE;
2669 return S_OK;
2672 static HRESULT WINAPI Mediaevent_RestoreDefaultHandling(IMediaEventEx *iface,
2673 long lEvCode) {
2674 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2676 TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode);
2678 if (lEvCode == EC_COMPLETE)
2679 This->HandleEcComplete = TRUE;
2680 else if (lEvCode == EC_REPAINT)
2681 This->HandleEcRepaint = TRUE;
2682 else
2683 return S_FALSE;
2685 return S_OK;
2688 static HRESULT WINAPI Mediaevent_FreeEventParams(IMediaEventEx *iface,
2689 long lEvCode,
2690 LONG_PTR lParam1,
2691 LONG_PTR lParam2) {
2692 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2694 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This, iface, lEvCode, lParam1, lParam2);
2696 return S_OK;
2699 /*** IMediaEventEx methods ***/
2700 static HRESULT WINAPI Mediaevent_SetNotifyWindow(IMediaEventEx *iface,
2701 OAHWND hwnd,
2702 long lMsg,
2703 LONG_PTR lInstanceData) {
2704 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2706 TRACE("(%p/%p)->(%08lx, %ld, %08lx)\n", This, iface, (DWORD) hwnd, lMsg, lInstanceData);
2708 This->notif.hWnd = (HWND)hwnd;
2709 This->notif.msg = lMsg;
2710 This->notif.instance = (long) lInstanceData;
2712 return S_OK;
2715 static HRESULT WINAPI Mediaevent_SetNotifyFlags(IMediaEventEx *iface,
2716 long lNoNotifyFlags) {
2717 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2719 TRACE("(%p/%p)->(%ld)\n", This, iface, lNoNotifyFlags);
2721 if ((lNoNotifyFlags != 0) || (lNoNotifyFlags != 1))
2722 return E_INVALIDARG;
2724 This->notif.disabled = lNoNotifyFlags;
2726 return S_OK;
2729 static HRESULT WINAPI Mediaevent_GetNotifyFlags(IMediaEventEx *iface,
2730 long *lplNoNotifyFlags) {
2731 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2733 TRACE("(%p/%p)->(%p)\n", This, iface, lplNoNotifyFlags);
2735 if (!lplNoNotifyFlags)
2736 return E_POINTER;
2738 *lplNoNotifyFlags = This->notif.disabled;
2740 return S_OK;
2744 static IMediaEventExVtbl IMediaEventEx_VTable =
2746 Mediaevent_QueryInterface,
2747 Mediaevent_AddRef,
2748 Mediaevent_Release,
2749 Mediaevent_GetTypeInfoCount,
2750 Mediaevent_GetTypeInfo,
2751 Mediaevent_GetIDsOfNames,
2752 Mediaevent_Invoke,
2753 Mediaevent_GetEventHandle,
2754 Mediaevent_GetEvent,
2755 Mediaevent_WaitForCompletion,
2756 Mediaevent_CancelDefaultHandling,
2757 Mediaevent_RestoreDefaultHandling,
2758 Mediaevent_FreeEventParams,
2759 Mediaevent_SetNotifyWindow,
2760 Mediaevent_SetNotifyFlags,
2761 Mediaevent_GetNotifyFlags
2765 static HRESULT WINAPI MediaFilter_QueryInterface(IMediaFilter *iface, REFIID riid, LPVOID *ppv)
2767 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2769 return Filtergraph_QueryInterface(This, riid, ppv);
2772 static ULONG WINAPI MediaFilter_AddRef(IMediaFilter *iface)
2774 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2776 return Filtergraph_AddRef(This);
2779 static ULONG WINAPI MediaFilter_Release(IMediaFilter *iface)
2781 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2783 return Filtergraph_Release(This);
2786 static HRESULT WINAPI MediaFilter_GetClassID(IMediaFilter *iface, CLSID * pClassID)
2788 FIXME("(%p): stub\n", pClassID);
2790 return E_NOTIMPL;
2793 static HRESULT WINAPI MediaFilter_Stop(IMediaFilter *iface)
2795 FIXME("(): stub\n");
2797 return E_NOTIMPL;
2800 static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface)
2802 FIXME("(): stub\n");
2804 return E_NOTIMPL;
2807 static HRESULT WINAPI MediaFilter_Run(IMediaFilter *iface, REFERENCE_TIME tStart)
2809 FIXME("(%lld): stub\n", tStart);
2811 return E_NOTIMPL;
2814 static HRESULT WINAPI MediaFilter_GetState(IMediaFilter *iface, DWORD dwMsTimeout, FILTER_STATE * pState)
2816 FIXME("(%ld, %p): stub\n", dwMsTimeout, pState);
2818 return E_NOTIMPL;
2821 static HRESULT WINAPI MediaFilter_SetSyncSource(IMediaFilter *iface, IReferenceClock *pClock)
2823 FIXME("(%p): stub\n", pClock);
2825 return E_NOTIMPL;
2828 static HRESULT WINAPI MediaFilter_GetSyncSource(IMediaFilter *iface, IReferenceClock **ppClock)
2830 FIXME("(%p): stub\n", ppClock);
2832 return E_NOTIMPL;
2835 static IMediaFilterVtbl IMediaFilter_VTable =
2837 MediaFilter_QueryInterface,
2838 MediaFilter_AddRef,
2839 MediaFilter_Release,
2840 MediaFilter_GetClassID,
2841 MediaFilter_Stop,
2842 MediaFilter_Pause,
2843 MediaFilter_Run,
2844 MediaFilter_GetState,
2845 MediaFilter_SetSyncSource,
2846 MediaFilter_GetSyncSource
2849 static HRESULT WINAPI MediaEventSink_QueryInterface(IMediaEventSink *iface, REFIID riid, LPVOID *ppv)
2851 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
2853 return Filtergraph_QueryInterface(This, riid, ppv);
2856 static ULONG WINAPI MediaEventSink_AddRef(IMediaEventSink *iface)
2858 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
2860 return Filtergraph_AddRef(This);
2863 static ULONG WINAPI MediaEventSink_Release(IMediaEventSink *iface)
2865 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
2867 return Filtergraph_Release(This);
2870 static HRESULT WINAPI MediaEventSink_Notify(IMediaEventSink *iface, long EventCode, LONG_PTR EventParam1, LONG_PTR EventParam2)
2872 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
2873 Event evt;
2875 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This, iface, EventCode, EventParam1, EventParam2);
2877 /* We need thread safety here, let's use the events queue's one */
2878 EnterCriticalSection(&This->evqueue.msg_crst);
2880 if ((EventCode == EC_COMPLETE) && This->HandleEcComplete)
2882 if (++This->EcCompleteCount == This->nRenderers)
2884 evt.lEventCode = EC_COMPLETE;
2885 evt.lParam1 = S_OK;
2886 evt.lParam2 = 0;
2887 EventsQueue_PutEvent(&This->evqueue, &evt);
2888 if (!This->notif.disabled && This->notif.hWnd)
2889 PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
2890 This->CompletionStatus = EC_COMPLETE;
2891 SetEvent(This->hEventCompletion);
2894 else if ((EventCode == EC_REPAINT) && This->HandleEcRepaint)
2896 /* FIXME: Not handled yet */
2898 else
2900 evt.lEventCode = EventCode;
2901 evt.lParam1 = EventParam1;
2902 evt.lParam2 = EventParam2;
2903 EventsQueue_PutEvent(&This->evqueue, &evt);
2904 if (!This->notif.disabled && This->notif.hWnd)
2905 PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
2908 LeaveCriticalSection(&This->evqueue.msg_crst);
2909 return S_OK;
2912 static IMediaEventSinkVtbl IMediaEventSink_VTable =
2914 MediaEventSink_QueryInterface,
2915 MediaEventSink_AddRef,
2916 MediaEventSink_Release,
2917 MediaEventSink_Notify
2920 /* This is the only function that actually creates a FilterGraph class... */
2921 HRESULT FILTERGRAPH_create(IUnknown *pUnkOuter, LPVOID *ppObj) {
2922 IFilterGraphImpl *fimpl;
2923 HRESULT hr;
2925 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
2927 if( pUnkOuter )
2928 return CLASS_E_NOAGGREGATION;
2930 fimpl = (IFilterGraphImpl *) HeapAlloc(GetProcessHeap(), 0, sizeof(*fimpl));
2931 fimpl->IGraphBuilder_vtbl = &IGraphBuilder_VTable;
2932 fimpl->IMediaControl_vtbl = &IMediaControl_VTable;
2933 fimpl->IMediaSeeking_vtbl = &IMediaSeeking_VTable;
2934 fimpl->IBasicAudio_vtbl = &IBasicAudio_VTable;
2935 fimpl->IBasicVideo_vtbl = &IBasicVideo_VTable;
2936 fimpl->IVideoWindow_vtbl = &IVideoWindow_VTable;
2937 fimpl->IMediaEventEx_vtbl = &IMediaEventEx_VTable;
2938 fimpl->IMediaFilter_vtbl = &IMediaFilter_VTable;
2939 fimpl->IMediaEventSink_vtbl = &IMediaEventSink_VTable;
2940 fimpl->ref = 1;
2941 fimpl->ppFiltersInGraph = NULL;
2942 fimpl->pFilterNames = NULL;
2943 fimpl->nFilters = 0;
2944 fimpl->filterCapacity = 0;
2945 fimpl->nameIndex = 1;
2946 fimpl->hEventCompletion = CreateEventW(0, TRUE, FALSE,0);
2947 fimpl->HandleEcComplete = TRUE;
2948 fimpl->HandleEcRepaint = TRUE;
2949 fimpl->notif.hWnd = 0;
2950 fimpl->notif.disabled = TRUE;
2951 fimpl->nRenderers = 0;
2952 fimpl->EcCompleteCount = 0;
2953 EventsQueue_Init(&fimpl->evqueue);
2955 hr = CoCreateInstance(&CLSID_FilterMapper, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (LPVOID*)&fimpl->pFilterMapper2);
2956 if (FAILED(hr)) {
2957 ERR("Unable to create filter mapper (%lx)\n", hr);
2958 return hr;
2961 *ppObj = fimpl;
2962 return S_OK;