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
33 #include "wine/debug.h"
34 #include "quartz_private.h"
35 #define COM_NO_WINDOWS_H
41 #include "wine/unicode.h"
44 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
47 HWND hWnd; /* Target window */
48 long msg; /* User window message */
49 long instance; /* User data */
50 int disabled; /* Disabled messages posting */
54 long lEventCode; /* Event code */
55 LONG_PTR lParam1; /* Param1 */
56 LONG_PTR lParam2; /* Param2 */
59 /* messages ring implementation for queuing events (taken from winmm) */
60 #define EVENTS_RING_BUFFER_INCREMENT 64
66 CRITICAL_SECTION msg_crst;
67 HANDLE msg_event; /* Signaled for no empty queue */
70 static int EventsQueue_Init(EventsQueue* omr)
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);
82 static int EventsQueue_Destroy(EventsQueue* omr)
84 CloseHandle(omr->msg_event);
85 HeapFree(GetProcessHeap(),0,omr->messages);
86 DeleteCriticalSection(&omr->msg_crst);
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
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);
119 static int EventsQueue_GetEvent(EventsQueue* omr, Event* evt, long msTimeOut)
121 if (WaitForSingleObject(omr->msg_event, msTimeOut) != WAIT_OBJECT_0)
124 EnterCriticalSection(&omr->msg_crst);
126 if (omr->msg_toget == omr->msg_tosave) /* buffer empty ? */
128 LeaveCriticalSection(&omr->msg_crst);
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);
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 */
163 /* IRegisterServiceProvider */
164 /* IResourceMananger */
165 /* IServiceProvider */
166 /* IVideoFrameStep */
169 IFilterMapper2 * pFilterMapper2;
170 IBaseFilter ** ppFiltersInGraph;
171 LPWSTR * pFilterNames;
176 HANDLE hEventCompletion;
177 int CompletionStatus;
181 int HandleEcComplete;
188 static HRESULT Filtergraph_QueryInterface(IFilterGraphImpl *This,
191 TRACE("(%p)->(%s (%p), %p)\n", This, debugstr_guid(riid), riid, ppvObj);
193 if (IsEqualGUID(&IID_IUnknown, riid) ||
194 IsEqualGUID(&IID_IFilterGraph, riid) ||
195 IsEqualGUID(&IID_IGraphBuilder, riid)) {
196 *ppvObj = &(This->IGraphBuilder_vtbl);
197 TRACE(" returning IGraphBuilder interface (%p)\n", *ppvObj);
198 } else if (IsEqualGUID(&IID_IMediaControl, riid)) {
199 *ppvObj = &(This->IMediaControl_vtbl);
200 TRACE(" returning IMediaControl interface (%p)\n", *ppvObj);
201 } else if (IsEqualGUID(&IID_IMediaSeeking, riid)) {
202 *ppvObj = &(This->IMediaSeeking_vtbl);
203 TRACE(" returning IMediaSeeking interface (%p)\n", *ppvObj);
204 } else if (IsEqualGUID(&IID_IBasicAudio, riid)) {
205 *ppvObj = &(This->IBasicAudio_vtbl);
206 TRACE(" returning IBasicAudio interface (%p)\n", *ppvObj);
207 } else if (IsEqualGUID(&IID_IBasicVideo, riid)) {
208 *ppvObj = &(This->IBasicVideo_vtbl);
209 TRACE(" returning IBasicVideo interface (%p)\n", *ppvObj);
210 } else if (IsEqualGUID(&IID_IVideoWindow, riid)) {
211 *ppvObj = &(This->IVideoWindow_vtbl);
212 TRACE(" returning IVideoWindow interface (%p)\n", *ppvObj);
213 } else if (IsEqualGUID(&IID_IMediaEvent, riid) ||
214 IsEqualGUID(&IID_IMediaEventEx, riid)) {
215 *ppvObj = &(This->IMediaEventEx_vtbl);
216 TRACE(" returning IMediaEvent(Ex) interface (%p)\n", *ppvObj);
217 } else if (IsEqualGUID(&IID_IMediaFilter, riid) ||
218 IsEqualGUID(&IID_IPersist, riid)) {
219 *ppvObj = &(This->IMediaFilter_vtbl);
220 TRACE(" returning IMediaFilter interface (%p)\n", *ppvObj);
221 } else if (IsEqualGUID(&IID_IMediaEventSink, riid)) {
222 *ppvObj = &(This->IMediaEventSink_vtbl);
223 TRACE(" returning IMediaEventSink interface (%p)\n", *ppvObj);
226 FIXME("unknown interface %s\n", debugstr_guid(riid));
227 return E_NOINTERFACE;
230 InterlockedIncrement(&This->ref);
234 static ULONG Filtergraph_AddRef(IFilterGraphImpl *This) {
235 ULONG ref = InterlockedIncrement(&This->ref);
237 TRACE("(%p)->(): new ref = %ld\n", This, ref);
242 static ULONG Filtergraph_Release(IFilterGraphImpl *This) {
243 ULONG ref = InterlockedDecrement(&This->ref);
245 TRACE("(%p)->(): new ref = %ld\n", This, ref);
249 for (i = 0; i < This->nFilters; i++)
250 IBaseFilter_Release(This->ppFiltersInGraph[i]);
251 IFilterMapper2_Release(This->pFilterMapper2);
252 CloseHandle(This->hEventCompletion);
253 EventsQueue_Destroy(&This->evqueue);
254 DeleteCriticalSection(&This->cs);
255 HeapFree(GetProcessHeap(), 0, This->ppFiltersInGraph);
256 HeapFree(GetProcessHeap(), 0, This->pFilterNames);
257 HeapFree(GetProcessHeap(), 0, This);
263 /*** IUnknown methods ***/
264 static HRESULT WINAPI Graphbuilder_QueryInterface(IGraphBuilder *iface,
267 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
269 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
270 return Filtergraph_QueryInterface(This, riid, ppvObj);
273 static ULONG WINAPI Graphbuilder_AddRef(IGraphBuilder *iface) {
274 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
276 TRACE("(%p/%p)->() calling FilterGraph AddRef\n", This, iface);
278 return Filtergraph_AddRef(This);
281 static ULONG WINAPI Graphbuilder_Release(IGraphBuilder *iface) {
282 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
284 TRACE("(%p/%p)->() calling FilterGraph Release\n", This, iface);
286 return Filtergraph_Release(This);
289 /*** IFilterGraph methods ***/
290 static HRESULT WINAPI Graphbuilder_AddFilter(IGraphBuilder *iface,
291 IBaseFilter *pFilter,
293 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
296 WCHAR* wszFilterName = NULL;
297 int duplicate_name = FALSE;
299 TRACE("(%p/%p)->(%p, %s (%p))\n", This, iface, pFilter, debugstr_w(pName), pName);
301 wszFilterName = (WCHAR*) CoTaskMemAlloc( (pName ? strlenW(pName) + 6 : 5) * sizeof(WCHAR) );
305 /* Check if name already exists */
306 for(i = 0; i < This->nFilters; i++)
307 if (!strcmpW(This->pFilterNames[i], pName))
309 duplicate_name = TRUE;
314 /* If no name given or name already existing, generate one */
315 if (!pName || duplicate_name)
317 static const WCHAR wszFmt1[] = {'%','s',' ','%','0','4','d',0};
318 static const WCHAR wszFmt2[] = {'%','0','4','d',0};
320 for (j = 0; j < 10000 ; j++)
324 sprintfW(wszFilterName, wszFmt1, pName, This->nameIndex);
326 sprintfW(wszFilterName, wszFmt2, This->nameIndex);
327 TRACE("Generated name %s\n", debugstr_w(wszFilterName));
329 /* Check if the generated name already exists */
330 for(i = 0; i < This->nFilters; i++)
331 if (!strcmpW(This->pFilterNames[i], wszFilterName))
334 /* Compute next index and exit if generated name is suitable */
335 if (This->nameIndex++ == 10000)
337 if (i == This->nFilters)
340 /* Unable to find a suitable name */
343 CoTaskMemFree(wszFilterName);
344 return VFW_E_DUPLICATE_NAME;
348 memcpy(wszFilterName, pName, (strlenW(pName) + 1) * sizeof(WCHAR));
350 if (This->nFilters + 1 > This->filterCapacity)
352 int newCapacity = 2*This->filterCapacity;
353 IBaseFilter ** ppNewFilters = CoTaskMemAlloc(newCapacity * sizeof(IBaseFilter*));
354 LPWSTR * pNewNames = CoTaskMemAlloc(newCapacity * sizeof(LPWSTR));
355 memcpy(ppNewFilters, This->ppFiltersInGraph, This->nFilters * sizeof(IBaseFilter*));
356 memcpy(pNewNames, This->pFilterNames, This->nFilters * sizeof(LPWSTR));
357 CoTaskMemFree(This->ppFiltersInGraph);
358 CoTaskMemFree(This->pFilterNames);
359 This->ppFiltersInGraph = ppNewFilters;
360 This->pFilterNames = pNewNames;
361 This->filterCapacity = newCapacity;
364 hr = IBaseFilter_JoinFilterGraph(pFilter, (IFilterGraph *)This, wszFilterName);
368 IBaseFilter_AddRef(pFilter);
369 This->ppFiltersInGraph[This->nFilters] = pFilter;
370 This->pFilterNames[This->nFilters] = wszFilterName;
374 CoTaskMemFree(wszFilterName);
376 if (SUCCEEDED(hr) && duplicate_name)
377 return VFW_S_DUPLICATE_NAME;
382 static HRESULT WINAPI Graphbuilder_RemoveFilter(IGraphBuilder *iface,
383 IBaseFilter *pFilter) {
384 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
388 TRACE("(%p/%p)->(%p)\n", This, iface, pFilter);
390 /* FIXME: check graph is stopped */
392 for (i = 0; i < This->nFilters; i++)
394 if (This->ppFiltersInGraph[i] == pFilter)
396 /* FIXME: disconnect pins */
397 hr = IBaseFilter_JoinFilterGraph(pFilter, NULL, This->pFilterNames[i]);
400 IPin_Release(pFilter);
401 CoTaskMemFree(This->pFilterNames[i]);
402 memmove(This->ppFiltersInGraph+i, This->ppFiltersInGraph+i+1, sizeof(IBaseFilter*)*(This->nFilters - 1 - i));
403 memmove(This->pFilterNames+i, This->pFilterNames+i+1, sizeof(LPWSTR)*(This->nFilters - 1 - i));
411 return hr; /* FIXME: check this error code */
414 static HRESULT WINAPI Graphbuilder_EnumFilters(IGraphBuilder *iface,
415 IEnumFilters **ppEnum) {
416 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
418 TRACE("(%p/%p)->(%p)\n", This, iface, ppEnum);
420 return IEnumFiltersImpl_Construct(This->ppFiltersInGraph, This->nFilters, ppEnum);
423 static HRESULT WINAPI Graphbuilder_FindFilterByName(IGraphBuilder *iface,
425 IBaseFilter **ppFilter) {
426 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
429 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_w(pName), pName, ppFilter);
433 for (i = 0; i < This->nFilters; i++)
435 if (!strcmpW(pName, This->pFilterNames[i]))
437 *ppFilter = This->ppFiltersInGraph[i];
438 IBaseFilter_AddRef(*ppFilter);
443 return E_FAIL; /* FIXME: check this error code */
446 /* NOTE: despite the implication, it doesn't matter which
447 * way round you put in the input and output pins */
448 static HRESULT WINAPI Graphbuilder_ConnectDirect(IGraphBuilder *iface,
451 const AM_MEDIA_TYPE *pmt) {
455 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
457 TRACE("(%p/%p)->(%p, %p, %p)\n", This, iface, ppinIn, ppinOut, pmt);
459 /* FIXME: check pins are in graph */
461 hr = IPin_QueryDirection(ppinIn, &dir);
464 if (dir == PINDIR_INPUT)
465 hr = IPin_Connect(ppinOut, ppinIn, pmt);
467 hr = IPin_Connect(ppinIn, ppinOut, pmt);
473 static HRESULT WINAPI Graphbuilder_Reconnect(IGraphBuilder *iface,
475 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
477 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppin);
482 static HRESULT WINAPI Graphbuilder_Disconnect(IGraphBuilder *iface,
484 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
486 TRACE("(%p/%p)->(%p)\n", This, iface, ppin);
488 return IPin_Disconnect(ppin);
491 static HRESULT WINAPI Graphbuilder_SetDefaultSyncSource(IGraphBuilder *iface) {
492 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
494 TRACE("(%p/%p)->(): stub !!!\n", iface, This);
499 static HRESULT GetFilterInfo(IMoniker* pMoniker, GUID* pclsid, VARIANT* pvar)
501 static const WCHAR wszClsidName[] = {'C','L','S','I','D',0};
502 static const WCHAR wszFriendlyName[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
503 IPropertyBag * pPropBagCat = NULL;
507 V_VT(pvar) = VT_BSTR;
509 hr = IMoniker_BindToStorage(pMoniker, NULL, NULL, &IID_IPropertyBag, (LPVOID*)&pPropBagCat);
512 hr = IPropertyBag_Read(pPropBagCat, wszClsidName, pvar, NULL);
515 hr = CLSIDFromString(V_UNION(pvar, bstrVal), pclsid);
518 hr = IPropertyBag_Read(pPropBagCat, wszFriendlyName, pvar, NULL);
521 TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid), debugstr_w(V_UNION(pvar, bstrVal)));
524 IPropertyBag_Release(pPropBagCat);
529 static HRESULT GetInternalConnections(IBaseFilter* pfilter, IPin* pinputpin, IPin*** pppins, ULONG* pnb)
534 TRACE("(%p, %p, %p, %p)\n", pfilter, pinputpin, pppins, pnb);
535 hr = IPin_QueryInternalConnections(pinputpin, NULL, &nb);
538 } else if (hr == S_FALSE) {
539 *pppins = CoTaskMemAlloc(sizeof(IPin*)*nb);
540 hr = IPin_QueryInternalConnections(pinputpin, *pppins, &nb);
542 ERR("Error (%lx)\n", hr);
544 } else if (hr == E_NOTIMPL) {
545 /* Input connected to all outputs */
546 IEnumPins* penumpins;
549 TRACE("E_NOTIMPL\n");
550 hr = IBaseFilter_EnumPins(pfilter, &penumpins);
552 ERR("filter Enumpins failed (%lx)\n", hr);
556 /* Count output pins */
557 while(IEnumPins_Next(penumpins, 1, &ppin, &nb) == S_OK) {
558 PIN_DIRECTION pindir;
559 IPin_QueryDirection(ppin, &pindir);
560 if (pindir == PINDIR_OUTPUT)
564 *pppins = CoTaskMemAlloc(sizeof(IPin*)*i);
565 /* Retrieve output pins */
566 IEnumPins_Reset(penumpins);
568 while(IEnumPins_Next(penumpins, 1, &ppin, &nb) == S_OK) {
569 PIN_DIRECTION pindir;
570 IPin_QueryDirection(ppin, &pindir);
571 if (pindir == PINDIR_OUTPUT)
572 (*pppins)[i++] = ppin;
578 ERR("Next failed (%lx)\n", hr);
581 IEnumPins_Release(penumpins);
582 } else if (FAILED(hr)) {
583 ERR("Cannot get internal connection (%lx)\n", hr);
591 /*** IGraphBuilder methods ***/
592 static HRESULT WINAPI Graphbuilder_Connect(IGraphBuilder *iface,
595 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
598 IEnumMediaTypes* penummt;
600 IEnumPins* penumpins;
601 IEnumMoniker* pEnumMoniker;
607 TRACE("(%p/%p)->(%p, %p)\n", This, iface, ppinOut, ppinIn);
609 /* Try direct connection first */
610 hr = IPin_Connect(ppinOut, ppinIn, NULL);
614 TRACE("Direct connection failed, trying to insert other filters\n");
616 /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream
617 * filter to the minor mediatype of input pin of the renderer */
618 hr = IPin_EnumMediaTypes(ppinOut, &penummt);
620 ERR("EnumMediaTypes (%lx)\n", hr);
624 hr = IEnumMediaTypes_Next(penummt, 1, &mt, &nbmt);
626 ERR("IEnumMediaTypes_Next (%lx)\n", hr);
631 ERR("No media type found!\n");
634 TRACE("MajorType %s\n", debugstr_guid(&mt->majortype));
635 TRACE("SubType %s\n", debugstr_guid(&mt->subtype));
637 /* Try to find a suitable filter that can connect to the pin to render */
638 tab[0] = mt->majortype;
639 tab[1] = mt->subtype;
640 hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, FALSE, FALSE, 0, NULL, NULL, NULL);
642 ERR("Unable to enum filters (%lx)\n", hr);
646 while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
651 IPin* ppinfilter = NULL;
652 IBaseFilter* pfilter = NULL;
654 hr = GetFilterInfo(pMoniker, &clsid, &var);
655 IMoniker_Release(pMoniker);
657 ERR("Unable to retrieve filter info (%lx)\n", hr);
661 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&pfilter);
663 ERR("Unable to create filter (%lx), trying next one\n", hr);
667 hr = IGraphBuilder_AddFilter(iface, pfilter, NULL);
669 ERR("Unable to add filter (%lx)\n", hr);
670 IBaseFilter_Release(pfilter);
675 hr = IBaseFilter_EnumPins(pfilter, &penumpins);
677 ERR("Enumpins (%lx)\n", hr);
681 hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin);
683 ERR("Next (%lx)\n", hr);
690 IEnumPins_Release(penumpins);
692 hr = IPin_Connect(ppinOut, ppinfilter, NULL);
694 TRACE("Cannot connect to filter (%lx), trying next one\n", hr);
697 TRACE("Successfully connected to filter, follow chain...\n");
699 /* Render all output pins of the filter by calling IGraphBuilder_Render on each of them */
700 hr = GetInternalConnections(pfilter, ppinfilter, &ppins, &nb);
704 TRACE("pins to consider: %ld\n", nb);
705 for(i = 0; i < nb; i++) {
706 TRACE("Processing pin %d\n", i);
707 hr = IGraphBuilder_Connect(iface, ppins[i], ppinIn);
709 TRACE("Cannot render pin %p (%lx)\n", ppinfilter, hr);
711 IPin_Release(ppins[i]);
712 if (SUCCEEDED(hr)) break;
714 while (++i < nb) IPin_Release(ppins[i]);
715 CoTaskMemFree(ppins);
716 IBaseFilter_Release(pfilter);
717 IPin_Release(ppinfilter);
722 if (ppinfilter) IPin_Release(ppinfilter);
724 IGraphBuilder_RemoveFilter(iface, pfilter);
725 IBaseFilter_Release(pfilter);
729 IEnumMediaTypes_Release(penummt);
735 static HRESULT WINAPI Graphbuilder_Render(IGraphBuilder *iface,
737 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
738 IEnumMediaTypes* penummt;
743 IEnumMoniker* pEnumMoniker;
748 TRACE("(%p/%p)->(%p)\n", This, iface, ppinOut);
750 hr = IPin_EnumMediaTypes(ppinOut, &penummt);
752 ERR("EnumMediaTypes (%lx)\n", hr);
758 hr = IEnumMediaTypes_Next(penummt, 1, &mt, &nbmt);
760 ERR("IEnumMediaTypes_Next (%lx)\n", hr);
765 TRACE("MajorType %s\n", debugstr_guid(&mt->majortype));
766 TRACE("SubType %s\n", debugstr_guid(&mt->subtype));
768 /* Try to find a suitable renderer with the same media type */
769 tab[0] = mt->majortype;
771 hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, TRUE, FALSE, 0, NULL, NULL, NULL);
773 ERR("Unable to enum filters (%lx)\n", hr);
777 while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
782 IBaseFilter* pfilter = NULL;
783 IEnumPins* penumpins;
786 hr = GetFilterInfo(pMoniker, &clsid, &var);
787 IMoniker_Release(pMoniker);
789 ERR("Unable to retrieve filter info (%lx)\n", hr);
793 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&pfilter);
795 ERR("Unable to create filter (%lx), trying next one\n", hr);
799 hr = IGraphBuilder_AddFilter(iface, pfilter, NULL);
801 ERR("Unable to add filter (%lx)\n", hr);
802 IBaseFilter_Release(pfilter);
807 hr = IBaseFilter_EnumPins(pfilter, &penumpins);
809 ERR("Splitter Enumpins (%lx)\n", hr);
812 hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin);
814 ERR("Next (%lx)\n", hr);
821 IEnumPins_Release(penumpins);
823 /* Connect the pin to render to the renderer */
824 hr = IGraphBuilder_Connect(iface, ppinOut, ppinfilter);
826 TRACE("Unable to connect to renderer (%lx)\n", hr);
833 IGraphBuilder_RemoveFilter(iface, pfilter);
834 IBaseFilter_Release(pfilter);
842 IEnumMediaTypes_Release(penummt);
847 static HRESULT WINAPI Graphbuilder_RenderFile(IGraphBuilder *iface,
849 LPCWSTR lpcwstrPlayList) {
850 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
851 static const WCHAR string[] = {'R','e','a','d','e','r',0};
852 IBaseFilter* preader = NULL;
853 IBaseFilter* psplitter;
856 IEnumPins* penumpins;
859 IEnumMoniker* pEnumMoniker;
864 IFileSourceFilter* pfile = NULL;
868 TRACE("(%p/%p)->(%s, %s)\n", This, iface, debugstr_w(lpcwstrFile), debugstr_w(lpcwstrPlayList));
870 hr = IGraphBuilder_AddSourceFilter(iface, lpcwstrFile, string, &preader);
872 /* Retrieve file media type */
874 hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter, (LPVOID*)&pfile);
876 hr = IFileSourceFilter_GetCurFile(pfile, &filename, &mt);
877 IFileSourceFilter_Release(pfile);
881 tab[0] = mt.majortype;
883 hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, FALSE, FALSE, 0, NULL, NULL, NULL);
889 IGraphBuilder_RemoveFilter(iface, preader);
890 IBaseFilter_Release(preader);
896 while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
901 hr = GetFilterInfo(pMoniker, &clsid, &var);
902 IMoniker_Release(pMoniker);
904 ERR("Unable to retrieve filter info (%lx)\n", hr);
908 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&psplitter);
910 ERR("Unable to create filter (%lx), trying next one\n", hr);
914 hr = IGraphBuilder_AddFilter(iface, psplitter, NULL);
916 ERR("Unable add filter (%lx)\n", hr);
920 /* Connect file source and splitter filters together */
921 /* Make the splitter analyze incoming data */
922 hr = IBaseFilter_EnumPins(preader, &penumpins);
924 ERR("Enumpins (%lx)\n", hr);
927 hr = IEnumPins_Next(penumpins, 1, &ppinreader, &pin);
929 ERR("Next (%lx)\n", hr);
936 IEnumPins_Release(penumpins);
938 hr = IBaseFilter_EnumPins(psplitter, &penumpins);
940 ERR("Splitter Enumpins (%lx)\n", hr);
943 hr = IEnumPins_Next(penumpins, 1, &ppinsplitter, &pin);
945 ERR("Next (%lx)\n", hr);
952 IEnumPins_Release(penumpins);
954 hr = IPin_Connect(ppinreader, ppinsplitter, NULL);
956 IBaseFilter_Release(ppinsplitter);
958 TRACE("Cannot connect to filter (%lx), trying next one\n", hr);
961 TRACE("Successfully connected to filter\n");
965 /* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
967 hr = GetInternalConnections(psplitter, ppinsplitter, &ppins, &nb);
971 TRACE("pins to consider: %ld\n", nb);
972 for(i = 0; i < nb; i++) {
973 TRACE("Processing pin %d\n", i);
974 hr = IGraphBuilder_Render(iface, ppins[i]);
976 ERR("Cannot render pin %p (%lx)\n", ppins[i], hr);
977 /* FIXME: We should clean created things properly */
981 CoTaskMemFree(ppins);
987 static HRESULT WINAPI Graphbuilder_AddSourceFilter(IGraphBuilder *iface,
988 LPCWSTR lpcwstrFileName,
989 LPCWSTR lpcwstrFilterName,
990 IBaseFilter **ppFilter) {
991 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
993 IBaseFilter* preader;
994 IFileSourceFilter* pfile = NULL;
998 TRACE("(%p/%p)->(%s, %s, %p)\n", This, iface, debugstr_w(lpcwstrFileName), debugstr_w(lpcwstrFilterName), ppFilter);
1000 /* Instantiate a file source filter */
1001 hr = CoCreateInstance(&CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&preader);
1003 ERR("Unable to create file source filter (%lx)\n", hr);
1007 hr = IGraphBuilder_AddFilter(iface, preader, lpcwstrFilterName);
1009 ERR("Unable add filter (%lx)\n", hr);
1010 IBaseFilter_Release(preader);
1014 hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter, (LPVOID*)&pfile);
1016 ERR("Unable to get IFileSourceInterface (%lx)\n", hr);
1020 /* Load the file in the file source filter */
1021 hr = IFileSourceFilter_Load(pfile, lpcwstrFileName, NULL);
1023 ERR("Load (%lx)\n", hr);
1027 IFileSourceFilter_GetCurFile(pfile, &filename, &mt);
1029 ERR("GetCurFile (%lx)\n", hr);
1032 TRACE("File %s\n", debugstr_w(filename));
1033 TRACE("MajorType %s\n", debugstr_guid(&mt.majortype));
1034 TRACE("SubType %s\n", debugstr_guid(&mt.subtype));
1037 *ppFilter = preader;
1043 IFileSourceFilter_Release(pfile);
1044 IGraphBuilder_RemoveFilter(iface, preader);
1045 IBaseFilter_Release(preader);
1050 static HRESULT WINAPI Graphbuilder_SetLogFile(IGraphBuilder *iface,
1052 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1054 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) hFile);
1059 static HRESULT WINAPI Graphbuilder_Abort(IGraphBuilder *iface) {
1060 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1062 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1067 static HRESULT WINAPI Graphbuilder_ShouldOperationContinue(IGraphBuilder *iface) {
1068 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1070 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1076 static IGraphBuilderVtbl IGraphBuilder_VTable =
1078 Graphbuilder_QueryInterface,
1079 Graphbuilder_AddRef,
1080 Graphbuilder_Release,
1081 Graphbuilder_AddFilter,
1082 Graphbuilder_RemoveFilter,
1083 Graphbuilder_EnumFilters,
1084 Graphbuilder_FindFilterByName,
1085 Graphbuilder_ConnectDirect,
1086 Graphbuilder_Reconnect,
1087 Graphbuilder_Disconnect,
1088 Graphbuilder_SetDefaultSyncSource,
1089 Graphbuilder_Connect,
1090 Graphbuilder_Render,
1091 Graphbuilder_RenderFile,
1092 Graphbuilder_AddSourceFilter,
1093 Graphbuilder_SetLogFile,
1095 Graphbuilder_ShouldOperationContinue
1098 /*** IUnknown methods ***/
1099 static HRESULT WINAPI Mediacontrol_QueryInterface(IMediaControl *iface,
1102 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1104 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1106 return Filtergraph_QueryInterface(This, riid, ppvObj);
1109 static ULONG WINAPI Mediacontrol_AddRef(IMediaControl *iface) {
1110 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1112 TRACE("(%p/%p)->()\n", This, iface);
1114 return Filtergraph_AddRef(This);
1117 static ULONG WINAPI Mediacontrol_Release(IMediaControl *iface) {
1118 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1120 TRACE("(%p/%p)->()\n", This, iface);
1122 return Filtergraph_Release(This);
1126 /*** IDispatch methods ***/
1127 static HRESULT WINAPI Mediacontrol_GetTypeInfoCount(IMediaControl *iface,
1129 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1131 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1136 static HRESULT WINAPI Mediacontrol_GetTypeInfo(IMediaControl *iface,
1139 ITypeInfo**ppTInfo) {
1140 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1142 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1147 static HRESULT WINAPI Mediacontrol_GetIDsOfNames(IMediaControl *iface,
1153 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1155 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1160 static HRESULT WINAPI Mediacontrol_Invoke(IMediaControl *iface,
1161 DISPID dispIdMember,
1165 DISPPARAMS*pDispParams,
1167 EXCEPINFO*pExepInfo,
1169 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1171 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);
1176 typedef HRESULT(WINAPI *fnFoundFilter)(IBaseFilter *);
1178 static HRESULT ExploreGraph(IFilterGraphImpl* pGraph, IPin* pOutputPin, fnFoundFilter FoundFilter)
1187 TRACE("%p %p\n", pGraph, pOutputPin);
1188 PinInfo.pFilter = NULL;
1190 hr = IPin_ConnectedTo(pOutputPin, &pInputPin);
1193 hr = IPin_QueryPinInfo(pInputPin, &PinInfo);
1196 hr = GetInternalConnections(PinInfo.pFilter, pInputPin, &ppPins, &nb);
1202 TRACE("Reached a renderer\n");
1203 /* Count renderers for end of stream notification */
1204 pGraph->nRenderers++;
1208 for(i = 0; i < nb; i++)
1210 /* Explore the graph downstream from this pin
1211 * FIXME: We should prevent exploring from a pin more than once. This can happens when
1212 * several input pins are connected to the same output (a MUX for instance). */
1213 ExploreGraph(pGraph, ppPins[i], FoundFilter);
1214 IPin_Release(ppPins[i]);
1217 CoTaskMemFree(ppPins);
1219 TRACE("Doing stuff with filter %p\n", PinInfo.pFilter);
1220 FoundFilter(PinInfo.pFilter);
1223 if (PinInfo.pFilter) IBaseFilter_Release(PinInfo.pFilter);
1227 static HRESULT WINAPI SendRun(IBaseFilter *pFilter) {
1228 return IBaseFilter_Run(pFilter, 0);
1231 static HRESULT WINAPI SendPause(IBaseFilter *pFilter) {
1232 return IBaseFilter_Pause(pFilter);
1235 static HRESULT WINAPI SendStop(IBaseFilter *pFilter) {
1236 return IBaseFilter_Stop(pFilter);
1239 static HRESULT SendFilterMessage(IMediaControl *iface, fnFoundFilter FoundFilter) {
1240 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1242 IBaseFilter* pfilter;
1248 TRACE("(%p/%p)->()\n", This, iface);
1250 /* Explorer the graph from source filters to renderers, determine renderers
1251 * number and run filters from renderers to source filters */
1252 This->nRenderers = 0;
1253 ResetEvent(This->hEventCompletion);
1255 for(i = 0; i < This->nFilters; i++)
1258 pfilter = This->ppFiltersInGraph[i];
1259 hr = IBaseFilter_EnumPins(pfilter, &pEnum);
1262 ERR("Enum pins failed %lx\n", hr);
1265 /* Check if it is a source filter */
1266 while(IEnumPins_Next(pEnum, 1, &pPin, &dummy) == S_OK)
1268 IPin_QueryDirection(pPin, &dir);
1270 if (dir == PINDIR_INPUT)
1278 TRACE("Found a source filter\n");
1279 IEnumPins_Reset(pEnum);
1280 while(IEnumPins_Next(pEnum, 1, &pPin, &dummy) == S_OK)
1282 /* Explore the graph downstream from this pin */
1283 ExploreGraph(This, pPin, FoundFilter);
1286 FoundFilter(pfilter);
1288 IEnumPins_Release(pEnum);
1294 /*** IMediaControl methods ***/
1295 static HRESULT WINAPI Mediacontrol_Run(IMediaControl *iface) {
1296 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1297 TRACE("(%p/%p)->()\n", This, iface);
1299 if (This->state == State_Running) return S_OK;
1301 EnterCriticalSection(&This->cs);
1302 SendFilterMessage(iface, SendRun);
1303 This->state = State_Running;
1304 LeaveCriticalSection(&This->cs);
1308 static HRESULT WINAPI Mediacontrol_Pause(IMediaControl *iface) {
1309 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1310 TRACE("(%p/%p)->()\n", This, iface);
1312 if (This->state == State_Paused) return S_OK;
1314 EnterCriticalSection(&This->cs);
1315 SendFilterMessage(iface, SendPause);
1316 This->state = State_Paused;
1317 LeaveCriticalSection(&This->cs);
1321 static HRESULT WINAPI Mediacontrol_Stop(IMediaControl *iface) {
1322 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1323 TRACE("(%p/%p)->()\n", This, iface);
1325 if (This->state == State_Stopped) return S_OK;
1327 EnterCriticalSection(&This->cs);
1328 if (This->state == State_Running) SendFilterMessage(iface, SendPause);
1329 SendFilterMessage(iface, SendStop);
1330 This->state = State_Stopped;
1331 LeaveCriticalSection(&This->cs);
1335 static HRESULT WINAPI Mediacontrol_GetState(IMediaControl *iface,
1337 OAFilterState *pfs) {
1338 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1340 TRACE("(%p/%p)->(%ld, %p): semi-stub !!!\n", This, iface, msTimeout, pfs);
1342 EnterCriticalSection(&This->cs);
1346 LeaveCriticalSection(&This->cs);
1351 static HRESULT WINAPI Mediacontrol_RenderFile(IMediaControl *iface,
1353 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1355 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This, iface, debugstr_w(strFilename), strFilename);
1360 static HRESULT WINAPI Mediacontrol_AddSourceFilter(IMediaControl *iface,
1362 IDispatch **ppUnk) {
1363 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1365 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This, iface, debugstr_w(strFilename), strFilename, ppUnk);
1370 static HRESULT WINAPI Mediacontrol_get_FilterCollection(IMediaControl *iface,
1371 IDispatch **ppUnk) {
1372 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1374 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppUnk);
1379 static HRESULT WINAPI Mediacontrol_get_RegFilterCollection(IMediaControl *iface,
1380 IDispatch **ppUnk) {
1381 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1383 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppUnk);
1388 static HRESULT WINAPI Mediacontrol_StopWhenReady(IMediaControl *iface) {
1389 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1391 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1397 static IMediaControlVtbl IMediaControl_VTable =
1399 Mediacontrol_QueryInterface,
1400 Mediacontrol_AddRef,
1401 Mediacontrol_Release,
1402 Mediacontrol_GetTypeInfoCount,
1403 Mediacontrol_GetTypeInfo,
1404 Mediacontrol_GetIDsOfNames,
1405 Mediacontrol_Invoke,
1409 Mediacontrol_GetState,
1410 Mediacontrol_RenderFile,
1411 Mediacontrol_AddSourceFilter,
1412 Mediacontrol_get_FilterCollection,
1413 Mediacontrol_get_RegFilterCollection,
1414 Mediacontrol_StopWhenReady
1418 /*** IUnknown methods ***/
1419 static HRESULT WINAPI Mediaseeking_QueryInterface(IMediaSeeking *iface,
1422 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1424 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1426 return Filtergraph_QueryInterface(This, riid, ppvObj);
1429 static ULONG WINAPI Mediaseeking_AddRef(IMediaSeeking *iface) {
1430 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1432 TRACE("(%p/%p)->()\n", This, iface);
1434 return Filtergraph_AddRef(This);
1437 static ULONG WINAPI Mediaseeking_Release(IMediaSeeking *iface) {
1438 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1440 TRACE("(%p/%p)->()\n", This, iface);
1442 return Filtergraph_Release(This);
1445 /*** IMediaSeeking methods ***/
1446 static HRESULT WINAPI Mediaseeking_GetCapabilities(IMediaSeeking *iface,
1447 DWORD *pCapabilities) {
1448 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1450 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCapabilities);
1455 static HRESULT WINAPI Mediaseeking_CheckCapabilities(IMediaSeeking *iface,
1456 DWORD *pCapabilities) {
1457 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1459 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCapabilities);
1464 static HRESULT WINAPI Mediaseeking_IsFormatSupported(IMediaSeeking *iface,
1465 const GUID *pFormat) {
1466 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1468 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1473 static HRESULT WINAPI Mediaseeking_QueryPreferredFormat(IMediaSeeking *iface,
1475 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1477 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1482 static HRESULT WINAPI Mediaseeking_GetTimeFormat(IMediaSeeking *iface,
1484 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1486 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1491 static HRESULT WINAPI Mediaseeking_IsUsingTimeFormat(IMediaSeeking *iface,
1492 const GUID *pFormat) {
1493 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1495 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1500 static HRESULT WINAPI Mediaseeking_SetTimeFormat(IMediaSeeking *iface,
1501 const GUID *pFormat) {
1502 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1504 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1509 static HRESULT WINAPI Mediaseeking_GetDuration(IMediaSeeking *iface,
1510 LONGLONG *pDuration) {
1511 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1513 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDuration);
1518 static HRESULT WINAPI Mediaseeking_GetStopPosition(IMediaSeeking *iface,
1520 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1522 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pStop);
1527 static HRESULT WINAPI Mediaseeking_GetCurrentPosition(IMediaSeeking *iface,
1528 LONGLONG *pCurrent) {
1529 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1531 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCurrent);
1536 static HRESULT WINAPI Mediaseeking_ConvertTimeFormat(IMediaSeeking *iface,
1538 const GUID *pTargetFormat,
1540 const GUID *pSourceFormat) {
1541 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1543 TRACE("(%p/%p)->(%p, %p, %lld, %p): stub !!!\n", This, iface, pTarget, pTargetFormat, Source, pSourceFormat);
1548 static HRESULT WINAPI Mediaseeking_SetPositions(IMediaSeeking *iface,
1550 DWORD dwCurrentFlags,
1552 DWORD dwStopFlags) {
1553 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1555 TRACE("(%p/%p)->(%p, %08lx, %p, %08lx): stub !!!\n", This, iface, pCurrent, dwCurrentFlags, pStop, dwStopFlags);
1560 static HRESULT WINAPI Mediaseeking_GetPositions(IMediaSeeking *iface,
1563 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1565 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pCurrent, pStop);
1570 static HRESULT WINAPI Mediaseeking_GetAvailable(IMediaSeeking *iface,
1571 LONGLONG *pEarliest,
1572 LONGLONG *pLatest) {
1573 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1575 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pEarliest, pLatest);
1580 static HRESULT WINAPI Mediaseeking_SetRate(IMediaSeeking *iface,
1582 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1584 TRACE("(%p/%p)->(%f): stub !!!\n", This, iface, dRate);
1589 static HRESULT WINAPI Mediaseeking_GetRate(IMediaSeeking *iface,
1591 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1593 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pdRate);
1598 static HRESULT WINAPI Mediaseeking_GetPreroll(IMediaSeeking *iface,
1599 LONGLONG *pllPreroll) {
1600 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1602 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pllPreroll);
1608 static IMediaSeekingVtbl IMediaSeeking_VTable =
1610 Mediaseeking_QueryInterface,
1611 Mediaseeking_AddRef,
1612 Mediaseeking_Release,
1613 Mediaseeking_GetCapabilities,
1614 Mediaseeking_CheckCapabilities,
1615 Mediaseeking_IsFormatSupported,
1616 Mediaseeking_QueryPreferredFormat,
1617 Mediaseeking_GetTimeFormat,
1618 Mediaseeking_IsUsingTimeFormat,
1619 Mediaseeking_SetTimeFormat,
1620 Mediaseeking_GetDuration,
1621 Mediaseeking_GetStopPosition,
1622 Mediaseeking_GetCurrentPosition,
1623 Mediaseeking_ConvertTimeFormat,
1624 Mediaseeking_SetPositions,
1625 Mediaseeking_GetPositions,
1626 Mediaseeking_GetAvailable,
1627 Mediaseeking_SetRate,
1628 Mediaseeking_GetRate,
1629 Mediaseeking_GetPreroll
1632 /*** IUnknown methods ***/
1633 static HRESULT WINAPI Basicaudio_QueryInterface(IBasicAudio *iface,
1636 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1638 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1640 return Filtergraph_QueryInterface(This, riid, ppvObj);
1643 static ULONG WINAPI Basicaudio_AddRef(IBasicAudio *iface) {
1644 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1646 TRACE("(%p/%p)->()\n", This, iface);
1648 return Filtergraph_AddRef(This);
1651 static ULONG WINAPI Basicaudio_Release(IBasicAudio *iface) {
1652 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1654 TRACE("(%p/%p)->()\n", This, iface);
1656 return Filtergraph_Release(This);
1659 /*** IDispatch methods ***/
1660 static HRESULT WINAPI Basicaudio_GetTypeInfoCount(IBasicAudio *iface,
1662 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1664 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1669 static HRESULT WINAPI Basicaudio_GetTypeInfo(IBasicAudio *iface,
1672 ITypeInfo**ppTInfo) {
1673 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1675 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1680 static HRESULT WINAPI Basicaudio_GetIDsOfNames(IBasicAudio *iface,
1686 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1688 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1693 static HRESULT WINAPI Basicaudio_Invoke(IBasicAudio *iface,
1694 DISPID dispIdMember,
1698 DISPPARAMS*pDispParams,
1700 EXCEPINFO*pExepInfo,
1702 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1704 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);
1709 /*** IBasicAudio methods ***/
1710 static HRESULT WINAPI Basicaudio_put_Volume(IBasicAudio *iface,
1712 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1714 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lVolume);
1719 static HRESULT WINAPI Basicaudio_get_Volume(IBasicAudio *iface,
1721 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1723 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plVolume);
1728 static HRESULT WINAPI Basicaudio_put_Balance(IBasicAudio *iface,
1730 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1732 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lBalance);
1737 static HRESULT WINAPI Basicaudio_get_Balance(IBasicAudio *iface,
1739 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1741 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plBalance);
1746 static IBasicAudioVtbl IBasicAudio_VTable =
1748 Basicaudio_QueryInterface,
1751 Basicaudio_GetTypeInfoCount,
1752 Basicaudio_GetTypeInfo,
1753 Basicaudio_GetIDsOfNames,
1755 Basicaudio_put_Volume,
1756 Basicaudio_get_Volume,
1757 Basicaudio_put_Balance,
1758 Basicaudio_get_Balance
1761 /*** IUnknown methods ***/
1762 static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface,
1765 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1767 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1769 return Filtergraph_QueryInterface(This, riid, ppvObj);
1772 static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface) {
1773 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1775 TRACE("(%p/%p)->()\n", This, iface);
1777 return Filtergraph_AddRef(This);
1780 static ULONG WINAPI Basicvideo_Release(IBasicVideo *iface) {
1781 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1783 TRACE("(%p/%p)->()\n", This, iface);
1785 return Filtergraph_Release(This);
1788 /*** IDispatch methods ***/
1789 static HRESULT WINAPI Basicvideo_GetTypeInfoCount(IBasicVideo *iface,
1791 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1793 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1798 static HRESULT WINAPI Basicvideo_GetTypeInfo(IBasicVideo *iface,
1801 ITypeInfo**ppTInfo) {
1802 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1804 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1809 static HRESULT WINAPI Basicvideo_GetIDsOfNames(IBasicVideo *iface,
1815 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1817 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1822 static HRESULT WINAPI Basicvideo_Invoke(IBasicVideo *iface,
1823 DISPID dispIdMember,
1827 DISPPARAMS*pDispParams,
1829 EXCEPINFO*pExepInfo,
1831 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1833 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);
1838 /*** IBasicVideo methods ***/
1839 static HRESULT WINAPI Basicvideo_get_AvgTimePerFrame(IBasicVideo *iface,
1840 REFTIME *pAvgTimePerFrame) {
1841 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1843 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pAvgTimePerFrame);
1848 static HRESULT WINAPI Basicvideo_get_BitRate(IBasicVideo *iface,
1850 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1852 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBitRate);
1857 static HRESULT WINAPI Basicvideo_get_BitErrorRate(IBasicVideo *iface,
1858 long *pBitErrorRate) {
1859 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1861 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBitErrorRate);
1866 static HRESULT WINAPI Basicvideo_get_VideoWidth(IBasicVideo *iface,
1867 long *pVideoWidth) {
1868 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1870 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVideoWidth);
1875 static HRESULT WINAPI Basicvideo_get_VideoHeight(IBasicVideo *iface,
1876 long *pVideoHeight) {
1877 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1879 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVideoHeight);
1884 static HRESULT WINAPI Basicvideo_put_SourceLeft(IBasicVideo *iface,
1886 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1888 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceLeft);
1893 static HRESULT WINAPI Basicvideo_get_SourceLeft(IBasicVideo *iface,
1894 long *pSourceLeft) {
1895 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1897 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceLeft);
1902 static HRESULT WINAPI Basicvideo_put_SourceWidth(IBasicVideo *iface,
1904 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1906 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceWidth);
1911 static HRESULT WINAPI Basicvideo_get_SourceWidth(IBasicVideo *iface,
1912 long *pSourceWidth) {
1913 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1915 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceWidth);
1920 static HRESULT WINAPI Basicvideo_put_SourceTop(IBasicVideo *iface,
1922 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1924 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceTop);
1929 static HRESULT WINAPI Basicvideo_get_SourceTop(IBasicVideo *iface,
1931 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1933 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceTop);
1938 static HRESULT WINAPI Basicvideo_put_SourceHeight(IBasicVideo *iface,
1939 long SourceHeight) {
1940 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1942 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceHeight);
1947 static HRESULT WINAPI Basicvideo_get_SourceHeight(IBasicVideo *iface,
1948 long *pSourceHeight) {
1949 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1951 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceHeight);
1956 static HRESULT WINAPI Basicvideo_put_DestinationLeft(IBasicVideo *iface,
1957 long DestinationLeft) {
1958 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1960 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationLeft);
1965 static HRESULT WINAPI Basicvideo_get_DestinationLeft(IBasicVideo *iface,
1966 long *pDestinationLeft) {
1967 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1969 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationLeft);
1974 static HRESULT WINAPI Basicvideo_put_DestinationWidth(IBasicVideo *iface,
1975 long DestinationWidth) {
1976 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1978 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationWidth);
1983 static HRESULT WINAPI Basicvideo_get_DestinationWidth(IBasicVideo *iface,
1984 long *pDestinationWidth) {
1985 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1987 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationWidth);
1992 static HRESULT WINAPI Basicvideo_put_DestinationTop(IBasicVideo *iface,
1993 long DestinationTop) {
1994 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1996 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationTop);
2001 static HRESULT WINAPI Basicvideo_get_DestinationTop(IBasicVideo *iface,
2002 long *pDestinationTop) {
2003 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2005 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationTop);
2010 static HRESULT WINAPI Basicvideo_put_DestinationHeight(IBasicVideo *iface,
2011 long DestinationHeight) {
2012 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2014 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationHeight);
2019 static HRESULT WINAPI Basicvideo_get_DestinationHeight(IBasicVideo *iface,
2020 long *pDestinationHeight) {
2021 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2023 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationHeight);
2028 static HRESULT WINAPI Basicvideo_SetSourcePosition(IBasicVideo *iface,
2033 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2035 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2040 static HRESULT WINAPI Basicvideo_GetSourcePosition(IBasicVideo *iface,
2045 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2047 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2052 static HRESULT WINAPI Basicvideo_SetDefaultSourcePosition(IBasicVideo *iface) {
2053 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2055 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2060 static HRESULT WINAPI Basicvideo_SetDestinationPosition(IBasicVideo *iface,
2065 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2067 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2072 static HRESULT WINAPI Basicvideo_GetDestinationPosition(IBasicVideo *iface,
2077 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2079 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2084 static HRESULT WINAPI Basicvideo_SetDefaultDestinationPosition(IBasicVideo *iface) {
2085 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2087 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2092 static HRESULT WINAPI Basicvideo_GetVideoSize(IBasicVideo *iface,
2095 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2097 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2102 static HRESULT WINAPI Basicvideo_GetVideoPaletteEntries(IBasicVideo *iface,
2107 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2109 TRACE("(%p/%p)->(%ld, %ld, %p, %p): stub !!!\n", This, iface, StartIndex, Entries, pRetrieved, pPalette);
2114 static HRESULT WINAPI Basicvideo_GetCurrentImage(IBasicVideo *iface,
2117 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2119 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pBufferSize, pDIBImage);
2124 static HRESULT WINAPI Basicvideo_IsUsingDefaultSource(IBasicVideo *iface) {
2125 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2127 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2132 static HRESULT WINAPI Basicvideo_IsUsingDefaultDestination(IBasicVideo *iface) {
2133 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2135 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2141 static IBasicVideoVtbl IBasicVideo_VTable =
2143 Basicvideo_QueryInterface,
2146 Basicvideo_GetTypeInfoCount,
2147 Basicvideo_GetTypeInfo,
2148 Basicvideo_GetIDsOfNames,
2150 Basicvideo_get_AvgTimePerFrame,
2151 Basicvideo_get_BitRate,
2152 Basicvideo_get_BitErrorRate,
2153 Basicvideo_get_VideoWidth,
2154 Basicvideo_get_VideoHeight,
2155 Basicvideo_put_SourceLeft,
2156 Basicvideo_get_SourceLeft,
2157 Basicvideo_put_SourceWidth,
2158 Basicvideo_get_SourceWidth,
2159 Basicvideo_put_SourceTop,
2160 Basicvideo_get_SourceTop,
2161 Basicvideo_put_SourceHeight,
2162 Basicvideo_get_SourceHeight,
2163 Basicvideo_put_DestinationLeft,
2164 Basicvideo_get_DestinationLeft,
2165 Basicvideo_put_DestinationWidth,
2166 Basicvideo_get_DestinationWidth,
2167 Basicvideo_put_DestinationTop,
2168 Basicvideo_get_DestinationTop,
2169 Basicvideo_put_DestinationHeight,
2170 Basicvideo_get_DestinationHeight,
2171 Basicvideo_SetSourcePosition,
2172 Basicvideo_GetSourcePosition,
2173 Basicvideo_SetDefaultSourcePosition,
2174 Basicvideo_SetDestinationPosition,
2175 Basicvideo_GetDestinationPosition,
2176 Basicvideo_SetDefaultDestinationPosition,
2177 Basicvideo_GetVideoSize,
2178 Basicvideo_GetVideoPaletteEntries,
2179 Basicvideo_GetCurrentImage,
2180 Basicvideo_IsUsingDefaultSource,
2181 Basicvideo_IsUsingDefaultDestination
2185 /*** IUnknown methods ***/
2186 static HRESULT WINAPI Videowindow_QueryInterface(IVideoWindow *iface,
2189 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2191 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
2193 return Filtergraph_QueryInterface(This, riid, ppvObj);
2196 static ULONG WINAPI Videowindow_AddRef(IVideoWindow *iface) {
2197 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2199 TRACE("(%p/%p)->()\n", This, iface);
2201 return Filtergraph_AddRef(This);
2204 static ULONG WINAPI Videowindow_Release(IVideoWindow *iface) {
2205 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2207 TRACE("(%p/%p)->()\n", This, iface);
2209 return Filtergraph_Release(This);
2212 /*** IDispatch methods ***/
2213 static HRESULT WINAPI Videowindow_GetTypeInfoCount(IVideoWindow *iface,
2215 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2217 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
2222 static HRESULT WINAPI Videowindow_GetTypeInfo(IVideoWindow *iface,
2225 ITypeInfo**ppTInfo) {
2226 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2228 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
2233 static HRESULT WINAPI Videowindow_GetIDsOfNames(IVideoWindow *iface,
2239 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2241 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
2246 static HRESULT WINAPI Videowindow_Invoke(IVideoWindow *iface,
2247 DISPID dispIdMember,
2251 DISPPARAMS*pDispParams,
2253 EXCEPINFO*pExepInfo,
2255 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2257 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);
2262 /*** IVideoWindow methods ***/
2263 static HRESULT WINAPI Videowindow_put_Caption(IVideoWindow *iface,
2265 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2267 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This, iface, debugstr_w(strCaption), strCaption);
2272 static HRESULT WINAPI Videowindow_get_Caption(IVideoWindow *iface,
2274 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2276 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, strCaption);
2281 static HRESULT WINAPI Videowindow_put_WindowStyle(IVideoWindow *iface,
2283 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2285 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowStyle);
2290 static HRESULT WINAPI Videowindow_get_WindowStyle(IVideoWindow *iface,
2291 long *WindowStyle) {
2292 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2294 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowStyle);
2299 static HRESULT WINAPI Videowindow_put_WindowStyleEx(IVideoWindow *iface,
2300 long WindowStyleEx) {
2301 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2303 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowStyleEx);
2308 static HRESULT WINAPI Videowindow_get_WindowStyleEx(IVideoWindow *iface,
2309 long *WindowStyleEx) {
2310 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2312 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowStyleEx);
2317 static HRESULT WINAPI Videowindow_put_AutoShow(IVideoWindow *iface,
2319 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2321 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, AutoShow);
2326 static HRESULT WINAPI Videowindow_get_AutoShow(IVideoWindow *iface,
2328 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2330 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, AutoShow);
2335 static HRESULT WINAPI Videowindow_put_WindowState(IVideoWindow *iface,
2337 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2339 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowState);
2344 static HRESULT WINAPI Videowindow_get_WindowState(IVideoWindow *iface,
2345 long *WindowState) {
2346 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2348 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowState);
2353 static HRESULT WINAPI Videowindow_put_BackgroundPalette(IVideoWindow *iface,
2354 long BackgroundPalette) {
2355 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2357 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, BackgroundPalette);
2362 static HRESULT WINAPI Videowindow_get_BackgroundPalette(IVideoWindow *iface,
2363 long *pBackgroundPalette) {
2364 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2366 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBackgroundPalette);
2371 static HRESULT WINAPI Videowindow_put_Visible(IVideoWindow *iface,
2373 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2375 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Visible);
2380 static HRESULT WINAPI Videowindow_get_Visible(IVideoWindow *iface,
2382 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2384 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVisible);
2389 static HRESULT WINAPI Videowindow_put_Left(IVideoWindow *iface,
2391 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2393 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Left);
2398 static HRESULT WINAPI Videowindow_get_Left(IVideoWindow *iface,
2400 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2402 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pLeft);
2407 static HRESULT WINAPI Videowindow_put_Width(IVideoWindow *iface,
2409 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2411 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Width);
2416 static HRESULT WINAPI Videowindow_get_Width(IVideoWindow *iface,
2418 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2420 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pWidth);
2425 static HRESULT WINAPI Videowindow_put_Top(IVideoWindow *iface,
2427 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2429 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Top);
2434 static HRESULT WINAPI Videowindow_get_Top(IVideoWindow *iface,
2436 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2438 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pTop);
2443 static HRESULT WINAPI Videowindow_put_Height(IVideoWindow *iface,
2445 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2447 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Height);
2452 static HRESULT WINAPI Videowindow_get_Height(IVideoWindow *iface,
2454 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2456 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pHeight);
2461 static HRESULT WINAPI Videowindow_put_Owner(IVideoWindow *iface,
2463 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2465 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Owner);
2470 static HRESULT WINAPI Videowindow_get_Owner(IVideoWindow *iface,
2472 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2474 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Owner);
2479 static HRESULT WINAPI Videowindow_put_MessageDrain(IVideoWindow *iface,
2481 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2483 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Drain);
2488 static HRESULT WINAPI Videowindow_get_MessageDrain(IVideoWindow *iface,
2490 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2492 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, Drain);
2497 static HRESULT WINAPI Videowindow_get_BorderColor(IVideoWindow *iface,
2499 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2501 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, Color);
2506 static HRESULT WINAPI Videowindow_put_BorderColor(IVideoWindow *iface,
2508 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2510 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Color);
2515 static HRESULT WINAPI Videowindow_get_FullScreenMode(IVideoWindow *iface,
2516 long *FullScreenMode) {
2517 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2519 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, FullScreenMode);
2524 static HRESULT WINAPI Videowindow_put_FullScreenMode(IVideoWindow *iface,
2525 long FullScreenMode) {
2526 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2528 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, FullScreenMode);
2533 static HRESULT WINAPI Videowindow_SetWindowForeground(IVideoWindow *iface,
2535 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2537 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Focus);
2542 static HRESULT WINAPI Videowindow_NotifyOwnerMessage(IVideoWindow *iface,
2547 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2549 TRACE("(%p/%p)->(%08lx, %ld, %08lx, %08lx): stub !!!\n", This, iface, (DWORD) hwnd, uMsg, wParam, lParam);
2554 static HRESULT WINAPI Videowindow_SetWindowPosition(IVideoWindow *iface,
2559 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2561 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2566 static HRESULT WINAPI Videowindow_GetWindowPosition(IVideoWindow *iface,
2571 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2573 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2578 static HRESULT WINAPI Videowindow_GetMinIdealImageSize(IVideoWindow *iface,
2581 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2583 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2588 static HRESULT WINAPI Videowindow_GetMaxIdealImageSize(IVideoWindow *iface,
2591 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2593 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2598 static HRESULT WINAPI Videowindow_GetRestorePosition(IVideoWindow *iface,
2603 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2605 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2610 static HRESULT WINAPI Videowindow_HideCursor(IVideoWindow *iface,
2612 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2614 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, HideCursor);
2619 static HRESULT WINAPI Videowindow_IsCursorHidden(IVideoWindow *iface,
2620 long *CursorHidden) {
2621 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2623 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, CursorHidden);
2629 static IVideoWindowVtbl IVideoWindow_VTable =
2631 Videowindow_QueryInterface,
2633 Videowindow_Release,
2634 Videowindow_GetTypeInfoCount,
2635 Videowindow_GetTypeInfo,
2636 Videowindow_GetIDsOfNames,
2638 Videowindow_put_Caption,
2639 Videowindow_get_Caption,
2640 Videowindow_put_WindowStyle,
2641 Videowindow_get_WindowStyle,
2642 Videowindow_put_WindowStyleEx,
2643 Videowindow_get_WindowStyleEx,
2644 Videowindow_put_AutoShow,
2645 Videowindow_get_AutoShow,
2646 Videowindow_put_WindowState,
2647 Videowindow_get_WindowState,
2648 Videowindow_put_BackgroundPalette,
2649 Videowindow_get_BackgroundPalette,
2650 Videowindow_put_Visible,
2651 Videowindow_get_Visible,
2652 Videowindow_put_Left,
2653 Videowindow_get_Left,
2654 Videowindow_put_Width,
2655 Videowindow_get_Width,
2656 Videowindow_put_Top,
2657 Videowindow_get_Top,
2658 Videowindow_put_Height,
2659 Videowindow_get_Height,
2660 Videowindow_put_Owner,
2661 Videowindow_get_Owner,
2662 Videowindow_put_MessageDrain,
2663 Videowindow_get_MessageDrain,
2664 Videowindow_get_BorderColor,
2665 Videowindow_put_BorderColor,
2666 Videowindow_get_FullScreenMode,
2667 Videowindow_put_FullScreenMode,
2668 Videowindow_SetWindowForeground,
2669 Videowindow_NotifyOwnerMessage,
2670 Videowindow_SetWindowPosition,
2671 Videowindow_GetWindowPosition,
2672 Videowindow_GetMinIdealImageSize,
2673 Videowindow_GetMaxIdealImageSize,
2674 Videowindow_GetRestorePosition,
2675 Videowindow_HideCursor,
2676 Videowindow_IsCursorHidden
2680 /*** IUnknown methods ***/
2681 static HRESULT WINAPI Mediaevent_QueryInterface(IMediaEventEx *iface,
2684 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2686 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
2688 return Filtergraph_QueryInterface(This, riid, ppvObj);
2691 static ULONG WINAPI Mediaevent_AddRef(IMediaEventEx *iface) {
2692 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2694 TRACE("(%p/%p)->()\n", This, iface);
2696 return Filtergraph_AddRef(This);
2699 static ULONG WINAPI Mediaevent_Release(IMediaEventEx *iface) {
2700 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2702 TRACE("(%p/%p)->()\n", This, iface);
2704 return Filtergraph_Release(This);
2707 /*** IDispatch methods ***/
2708 static HRESULT WINAPI Mediaevent_GetTypeInfoCount(IMediaEventEx *iface,
2710 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2712 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
2717 static HRESULT WINAPI Mediaevent_GetTypeInfo(IMediaEventEx *iface,
2720 ITypeInfo**ppTInfo) {
2721 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2723 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
2728 static HRESULT WINAPI Mediaevent_GetIDsOfNames(IMediaEventEx *iface,
2734 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2736 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
2741 static HRESULT WINAPI Mediaevent_Invoke(IMediaEventEx *iface,
2742 DISPID dispIdMember,
2746 DISPPARAMS*pDispParams,
2748 EXCEPINFO*pExepInfo,
2750 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2752 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);
2757 /*** IMediaEvent methods ***/
2758 static HRESULT WINAPI Mediaevent_GetEventHandle(IMediaEventEx *iface,
2760 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2762 TRACE("(%p/%p)->(%p)\n", This, iface, hEvent);
2764 *hEvent = (OAEVENT)This->evqueue.msg_event;
2769 static HRESULT WINAPI Mediaevent_GetEvent(IMediaEventEx *iface,
2774 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2777 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This, iface, lEventCode, lParam1, lParam2, msTimeout);
2779 if (EventsQueue_GetEvent(&This->evqueue, &evt, msTimeout))
2781 *lEventCode = evt.lEventCode;
2782 *lParam1 = evt.lParam1;
2783 *lParam2 = evt.lParam2;
2791 static HRESULT WINAPI Mediaevent_WaitForCompletion(IMediaEventEx *iface,
2794 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2796 TRACE("(%p/%p)->(%ld, %p)\n", This, iface, msTimeout, pEvCode);
2798 if (WaitForSingleObject(This->hEventCompletion, msTimeout) == WAIT_OBJECT_0)
2800 *pEvCode = This->CompletionStatus;
2808 static HRESULT WINAPI Mediaevent_CancelDefaultHandling(IMediaEventEx *iface,
2810 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2812 TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode);
2814 if (lEvCode == EC_COMPLETE)
2815 This->HandleEcComplete = FALSE;
2816 else if (lEvCode == EC_REPAINT)
2817 This->HandleEcRepaint = FALSE;
2824 static HRESULT WINAPI Mediaevent_RestoreDefaultHandling(IMediaEventEx *iface,
2826 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2828 TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode);
2830 if (lEvCode == EC_COMPLETE)
2831 This->HandleEcComplete = TRUE;
2832 else if (lEvCode == EC_REPAINT)
2833 This->HandleEcRepaint = TRUE;
2840 static HRESULT WINAPI Mediaevent_FreeEventParams(IMediaEventEx *iface,
2844 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2846 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This, iface, lEvCode, lParam1, lParam2);
2851 /*** IMediaEventEx methods ***/
2852 static HRESULT WINAPI Mediaevent_SetNotifyWindow(IMediaEventEx *iface,
2855 LONG_PTR lInstanceData) {
2856 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2858 TRACE("(%p/%p)->(%08lx, %ld, %08lx)\n", This, iface, (DWORD) hwnd, lMsg, lInstanceData);
2860 This->notif.hWnd = (HWND)hwnd;
2861 This->notif.msg = lMsg;
2862 This->notif.instance = (long) lInstanceData;
2867 static HRESULT WINAPI Mediaevent_SetNotifyFlags(IMediaEventEx *iface,
2868 long lNoNotifyFlags) {
2869 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2871 TRACE("(%p/%p)->(%ld)\n", This, iface, lNoNotifyFlags);
2873 if ((lNoNotifyFlags != 0) || (lNoNotifyFlags != 1))
2874 return E_INVALIDARG;
2876 This->notif.disabled = lNoNotifyFlags;
2881 static HRESULT WINAPI Mediaevent_GetNotifyFlags(IMediaEventEx *iface,
2882 long *lplNoNotifyFlags) {
2883 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2885 TRACE("(%p/%p)->(%p)\n", This, iface, lplNoNotifyFlags);
2887 if (!lplNoNotifyFlags)
2890 *lplNoNotifyFlags = This->notif.disabled;
2896 static IMediaEventExVtbl IMediaEventEx_VTable =
2898 Mediaevent_QueryInterface,
2901 Mediaevent_GetTypeInfoCount,
2902 Mediaevent_GetTypeInfo,
2903 Mediaevent_GetIDsOfNames,
2905 Mediaevent_GetEventHandle,
2906 Mediaevent_GetEvent,
2907 Mediaevent_WaitForCompletion,
2908 Mediaevent_CancelDefaultHandling,
2909 Mediaevent_RestoreDefaultHandling,
2910 Mediaevent_FreeEventParams,
2911 Mediaevent_SetNotifyWindow,
2912 Mediaevent_SetNotifyFlags,
2913 Mediaevent_GetNotifyFlags
2917 static HRESULT WINAPI MediaFilter_QueryInterface(IMediaFilter *iface, REFIID riid, LPVOID *ppv)
2919 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2921 return Filtergraph_QueryInterface(This, riid, ppv);
2924 static ULONG WINAPI MediaFilter_AddRef(IMediaFilter *iface)
2926 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2928 return Filtergraph_AddRef(This);
2931 static ULONG WINAPI MediaFilter_Release(IMediaFilter *iface)
2933 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2935 return Filtergraph_Release(This);
2938 static HRESULT WINAPI MediaFilter_GetClassID(IMediaFilter *iface, CLSID * pClassID)
2940 FIXME("(%p): stub\n", pClassID);
2945 static HRESULT WINAPI MediaFilter_Stop(IMediaFilter *iface)
2947 FIXME("(): stub\n");
2952 static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface)
2954 FIXME("(): stub\n");
2959 static HRESULT WINAPI MediaFilter_Run(IMediaFilter *iface, REFERENCE_TIME tStart)
2961 FIXME("(%lld): stub\n", tStart);
2966 static HRESULT WINAPI MediaFilter_GetState(IMediaFilter *iface, DWORD dwMsTimeout, FILTER_STATE * pState)
2968 FIXME("(%ld, %p): stub\n", dwMsTimeout, pState);
2973 static HRESULT WINAPI MediaFilter_SetSyncSource(IMediaFilter *iface, IReferenceClock *pClock)
2975 FIXME("(%p): stub\n", pClock);
2980 static HRESULT WINAPI MediaFilter_GetSyncSource(IMediaFilter *iface, IReferenceClock **ppClock)
2982 FIXME("(%p): stub\n", ppClock);
2987 static IMediaFilterVtbl IMediaFilter_VTable =
2989 MediaFilter_QueryInterface,
2991 MediaFilter_Release,
2992 MediaFilter_GetClassID,
2996 MediaFilter_GetState,
2997 MediaFilter_SetSyncSource,
2998 MediaFilter_GetSyncSource
3001 static HRESULT WINAPI MediaEventSink_QueryInterface(IMediaEventSink *iface, REFIID riid, LPVOID *ppv)
3003 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
3005 return Filtergraph_QueryInterface(This, riid, ppv);
3008 static ULONG WINAPI MediaEventSink_AddRef(IMediaEventSink *iface)
3010 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
3012 return Filtergraph_AddRef(This);
3015 static ULONG WINAPI MediaEventSink_Release(IMediaEventSink *iface)
3017 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
3019 return Filtergraph_Release(This);
3022 static HRESULT WINAPI MediaEventSink_Notify(IMediaEventSink *iface, long EventCode, LONG_PTR EventParam1, LONG_PTR EventParam2)
3024 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
3027 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This, iface, EventCode, EventParam1, EventParam2);
3029 /* We need thread safety here, let's use the events queue's one */
3030 EnterCriticalSection(&This->evqueue.msg_crst);
3032 if ((EventCode == EC_COMPLETE) && This->HandleEcComplete)
3034 TRACE("Process EC_COMPLETE notification\n");
3035 if (++This->EcCompleteCount == This->nRenderers)
3037 evt.lEventCode = EC_COMPLETE;
3040 TRACE("Send EC_COMPLETE to app\n");
3041 EventsQueue_PutEvent(&This->evqueue, &evt);
3042 if (!This->notif.disabled && This->notif.hWnd)
3044 TRACE("Send Window message\n");
3045 PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
3047 This->CompletionStatus = EC_COMPLETE;
3048 SetEvent(This->hEventCompletion);
3051 else if ((EventCode == EC_REPAINT) && This->HandleEcRepaint)
3053 /* FIXME: Not handled yet */
3057 evt.lEventCode = EventCode;
3058 evt.lParam1 = EventParam1;
3059 evt.lParam2 = EventParam2;
3060 EventsQueue_PutEvent(&This->evqueue, &evt);
3061 if (!This->notif.disabled && This->notif.hWnd)
3062 PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
3065 LeaveCriticalSection(&This->evqueue.msg_crst);
3069 static IMediaEventSinkVtbl IMediaEventSink_VTable =
3071 MediaEventSink_QueryInterface,
3072 MediaEventSink_AddRef,
3073 MediaEventSink_Release,
3074 MediaEventSink_Notify
3077 /* This is the only function that actually creates a FilterGraph class... */
3078 HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj)
3080 IFilterGraphImpl *fimpl;
3083 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
3086 return CLASS_E_NOAGGREGATION;
3088 fimpl = HeapAlloc(GetProcessHeap(), 0, sizeof(*fimpl));
3089 fimpl->IGraphBuilder_vtbl = &IGraphBuilder_VTable;
3090 fimpl->IMediaControl_vtbl = &IMediaControl_VTable;
3091 fimpl->IMediaSeeking_vtbl = &IMediaSeeking_VTable;
3092 fimpl->IBasicAudio_vtbl = &IBasicAudio_VTable;
3093 fimpl->IBasicVideo_vtbl = &IBasicVideo_VTable;
3094 fimpl->IVideoWindow_vtbl = &IVideoWindow_VTable;
3095 fimpl->IMediaEventEx_vtbl = &IMediaEventEx_VTable;
3096 fimpl->IMediaFilter_vtbl = &IMediaFilter_VTable;
3097 fimpl->IMediaEventSink_vtbl = &IMediaEventSink_VTable;
3099 fimpl->ppFiltersInGraph = NULL;
3100 fimpl->pFilterNames = NULL;
3101 fimpl->nFilters = 0;
3102 fimpl->filterCapacity = 0;
3103 fimpl->nameIndex = 1;
3104 fimpl->hEventCompletion = CreateEventW(0, TRUE, FALSE, 0);
3105 fimpl->HandleEcComplete = TRUE;
3106 fimpl->HandleEcRepaint = TRUE;
3107 fimpl->notif.hWnd = 0;
3108 fimpl->notif.disabled = FALSE;
3109 fimpl->nRenderers = 0;
3110 fimpl->EcCompleteCount = 0;
3111 fimpl->state = State_Stopped;
3112 EventsQueue_Init(&fimpl->evqueue);
3113 InitializeCriticalSection(&fimpl->cs);
3115 hr = CoCreateInstance(&CLSID_FilterMapper, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (LPVOID*)&fimpl->pFilterMapper2);
3117 ERR("Unable to create filter mapper (%lx)\n", hr);
3125 HRESULT FilterGraphNoThread_create(IUnknown *pUnkOuter, LPVOID *ppObj)
3127 FIXME("CLSID_FilterGraphNoThread partially implemented - Forwarding to CLSID_FilterGraph\n");
3128 return FilterGraph_create(pUnkOuter, ppObj);