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);
248 IFilterMapper2_Release(This->pFilterMapper2);
249 CloseHandle(This->hEventCompletion);
250 EventsQueue_Destroy(&This->evqueue);
251 DeleteCriticalSection(&This->cs);
252 HeapFree(GetProcessHeap(), 0, This->ppFiltersInGraph);
253 HeapFree(GetProcessHeap(), 0, This->pFilterNames);
254 HeapFree(GetProcessHeap(), 0, This);
260 /*** IUnknown methods ***/
261 static HRESULT WINAPI Graphbuilder_QueryInterface(IGraphBuilder *iface,
264 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
266 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
267 return Filtergraph_QueryInterface(This, riid, ppvObj);
270 static ULONG WINAPI Graphbuilder_AddRef(IGraphBuilder *iface) {
271 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
273 TRACE("(%p/%p)->() calling FilterGraph AddRef\n", This, iface);
275 return Filtergraph_AddRef(This);
278 static ULONG WINAPI Graphbuilder_Release(IGraphBuilder *iface) {
279 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
281 TRACE("(%p/%p)->() calling FilterGraph Release\n", This, iface);
283 return Filtergraph_Release(This);
286 /*** IFilterGraph methods ***/
287 static HRESULT WINAPI Graphbuilder_AddFilter(IGraphBuilder *iface,
288 IBaseFilter *pFilter,
290 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
293 WCHAR* wszFilterName = NULL;
294 int duplicate_name = FALSE;
296 TRACE("(%p/%p)->(%p, %s (%p))\n", This, iface, pFilter, debugstr_w(pName), pName);
298 wszFilterName = (WCHAR*) CoTaskMemAlloc( (pName ? strlenW(pName) + 6 : 5) * sizeof(WCHAR) );
302 /* Check if name already exists */
303 for(i = 0; i < This->nFilters; i++)
304 if (!strcmpW(This->pFilterNames[i], pName))
306 duplicate_name = TRUE;
311 /* If no name given or name already existing, generate one */
312 if (!pName || duplicate_name)
314 static const WCHAR wszFmt1[] = {'%','s',' ','%','0','4','d',0};
315 static const WCHAR wszFmt2[] = {'%','0','4','d',0};
317 for (j = 0; j < 10000 ; j++)
321 sprintfW(wszFilterName, wszFmt1, pName, This->nameIndex);
323 sprintfW(wszFilterName, wszFmt2, This->nameIndex);
324 TRACE("Generated name %s\n", debugstr_w(wszFilterName));
326 /* Check if the generated name already exists */
327 for(i = 0; i < This->nFilters; i++)
328 if (!strcmpW(This->pFilterNames[i], wszFilterName))
331 /* Compute next index and exit if generated name is suitable */
332 if (This->nameIndex++ == 10000)
334 if (i == This->nFilters)
337 /* Unable to find a suitable name */
340 CoTaskMemFree(wszFilterName);
341 return VFW_E_DUPLICATE_NAME;
345 memcpy(wszFilterName, pName, (strlenW(pName) + 1) * sizeof(WCHAR));
347 if (This->nFilters + 1 > This->filterCapacity)
349 int newCapacity = 2*This->filterCapacity;
350 IBaseFilter ** ppNewFilters = CoTaskMemAlloc(newCapacity * sizeof(IBaseFilter*));
351 LPWSTR * pNewNames = CoTaskMemAlloc(newCapacity * sizeof(LPWSTR));
352 memcpy(ppNewFilters, This->ppFiltersInGraph, This->nFilters * sizeof(IBaseFilter*));
353 memcpy(pNewNames, This->pFilterNames, This->nFilters * sizeof(LPWSTR));
354 CoTaskMemFree(This->ppFiltersInGraph);
355 CoTaskMemFree(This->pFilterNames);
356 This->ppFiltersInGraph = ppNewFilters;
357 This->pFilterNames = pNewNames;
358 This->filterCapacity = newCapacity;
361 hr = IBaseFilter_JoinFilterGraph(pFilter, (IFilterGraph *)This, wszFilterName);
365 IBaseFilter_AddRef(pFilter);
366 This->ppFiltersInGraph[This->nFilters] = pFilter;
367 This->pFilterNames[This->nFilters] = wszFilterName;
371 CoTaskMemFree(wszFilterName);
373 if (SUCCEEDED(hr) && duplicate_name)
374 return VFW_S_DUPLICATE_NAME;
379 static HRESULT WINAPI Graphbuilder_RemoveFilter(IGraphBuilder *iface,
380 IBaseFilter *pFilter) {
381 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
385 TRACE("(%p/%p)->(%p)\n", This, iface, pFilter);
387 /* FIXME: check graph is stopped */
389 for (i = 0; i < This->nFilters; i++)
391 if (This->ppFiltersInGraph[i] == pFilter)
393 /* FIXME: disconnect pins */
394 hr = IBaseFilter_JoinFilterGraph(pFilter, NULL, This->pFilterNames[i]);
397 IPin_Release(pFilter);
398 CoTaskMemFree(This->pFilterNames[i]);
399 memmove(This->ppFiltersInGraph+i, This->ppFiltersInGraph+i+1, sizeof(IBaseFilter*)*(This->nFilters - 1 - i));
400 memmove(This->pFilterNames+i, This->pFilterNames+i+1, sizeof(LPWSTR)*(This->nFilters - 1 - i));
408 return hr; /* FIXME: check this error code */
411 static HRESULT WINAPI Graphbuilder_EnumFilters(IGraphBuilder *iface,
412 IEnumFilters **ppEnum) {
413 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
415 TRACE("(%p/%p)->(%p)\n", This, iface, ppEnum);
417 return IEnumFiltersImpl_Construct(This->ppFiltersInGraph, This->nFilters, ppEnum);
420 static HRESULT WINAPI Graphbuilder_FindFilterByName(IGraphBuilder *iface,
422 IBaseFilter **ppFilter) {
423 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
426 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_w(pName), pName, ppFilter);
430 for (i = 0; i < This->nFilters; i++)
432 if (!strcmpW(pName, This->pFilterNames[i]))
434 *ppFilter = This->ppFiltersInGraph[i];
435 IBaseFilter_AddRef(*ppFilter);
440 return E_FAIL; /* FIXME: check this error code */
443 /* NOTE: despite the implication, it doesn't matter which
444 * way round you put in the input and output pins */
445 static HRESULT WINAPI Graphbuilder_ConnectDirect(IGraphBuilder *iface,
448 const AM_MEDIA_TYPE *pmt) {
452 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
454 TRACE("(%p/%p)->(%p, %p, %p)\n", This, iface, ppinIn, ppinOut, pmt);
456 /* FIXME: check pins are in graph */
458 hr = IPin_QueryDirection(ppinIn, &dir);
461 if (dir == PINDIR_INPUT)
462 hr = IPin_Connect(ppinOut, ppinIn, pmt);
464 hr = IPin_Connect(ppinIn, ppinOut, pmt);
470 static HRESULT WINAPI Graphbuilder_Reconnect(IGraphBuilder *iface,
472 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
474 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppin);
479 static HRESULT WINAPI Graphbuilder_Disconnect(IGraphBuilder *iface,
481 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
483 TRACE("(%p/%p)->(%p)\n", This, iface, ppin);
485 return IPin_Disconnect(ppin);
488 static HRESULT WINAPI Graphbuilder_SetDefaultSyncSource(IGraphBuilder *iface) {
489 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
491 TRACE("(%p/%p)->(): stub !!!\n", iface, This);
496 static HRESULT GetFilterInfo(IMoniker* pMoniker, GUID* pclsid, VARIANT* pvar)
498 static const WCHAR wszClsidName[] = {'C','L','S','I','D',0};
499 static const WCHAR wszFriendlyName[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
500 IPropertyBag * pPropBagCat = NULL;
504 V_VT(pvar) = VT_BSTR;
506 hr = IMoniker_BindToStorage(pMoniker, NULL, NULL, &IID_IPropertyBag, (LPVOID*)&pPropBagCat);
509 hr = IPropertyBag_Read(pPropBagCat, wszClsidName, pvar, NULL);
512 hr = CLSIDFromString(V_UNION(pvar, bstrVal), pclsid);
515 hr = IPropertyBag_Read(pPropBagCat, wszFriendlyName, pvar, NULL);
518 TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid), debugstr_w(V_UNION(pvar, bstrVal)));
521 IPropertyBag_Release(pPropBagCat);
526 static HRESULT GetInternalConnections(IBaseFilter* pfilter, IPin* pinputpin, IPin*** pppins, ULONG* pnb)
531 TRACE("(%p, %p, %p, %p)\n", pfilter, pinputpin, pppins, pnb);
532 hr = IPin_QueryInternalConnections(pinputpin, NULL, &nb);
535 } else if (hr == S_FALSE) {
536 *pppins = CoTaskMemAlloc(sizeof(IPin*)*nb);
537 hr = IPin_QueryInternalConnections(pinputpin, *pppins, &nb);
539 ERR("Error (%lx)\n", hr);
541 } else if (hr == E_NOTIMPL) {
542 /* Input connected to all outputs */
543 IEnumPins* penumpins;
546 TRACE("E_NOTIMPL\n");
547 hr = IBaseFilter_EnumPins(pfilter, &penumpins);
549 ERR("filter Enumpins failed (%lx)\n", hr);
553 /* Count output pins */
554 while(IEnumPins_Next(penumpins, 1, &ppin, &nb) == S_OK) {
555 PIN_DIRECTION pindir;
556 IPin_QueryDirection(ppin, &pindir);
557 if (pindir == PINDIR_OUTPUT)
562 *pppins = CoTaskMemAlloc(sizeof(IPin*)*i);
563 /* Retrieve output pins */
564 IEnumPins_Reset(penumpins);
566 while(IEnumPins_Next(penumpins, 1, &ppin, &nb) == S_OK) {
567 PIN_DIRECTION pindir;
568 IPin_QueryDirection(ppin, &pindir);
569 if (pindir == PINDIR_OUTPUT)
570 (*pppins)[i++] = ppin;
576 ERR("Next failed (%lx)\n", hr);
579 IEnumPins_Release(penumpins);
580 } else if (FAILED(hr)) {
581 ERR("Cannot get internal connection (%lx)\n", hr);
589 /*** IGraphBuilder methods ***/
590 static HRESULT WINAPI Graphbuilder_Connect(IGraphBuilder *iface,
593 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
596 IEnumMediaTypes* penummt;
598 IEnumPins* penumpins;
599 IEnumMoniker* pEnumMoniker;
605 TRACE("(%p/%p)->(%p, %p)\n", This, iface, ppinOut, ppinIn);
607 /* Try direct connection first */
608 TRACE("Try direct connection first\n");
609 hr = IPin_Connect(ppinOut, ppinIn, NULL);
611 TRACE("Direct connection successful\n");
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)
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);
680 hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin);
682 ERR("Next (%lx)\n", hr);
689 IEnumPins_Release(penumpins);
691 hr = IPin_Connect(ppinOut, ppinfilter, NULL);
693 TRACE("Cannot connect to filter (%lx), trying next one\n", hr);
696 TRACE("Successfully connected to filter, follow chain...\n");
698 /* Render all output pins of the filter by calling IGraphBuilder_Render on each of them */
699 hr = GetInternalConnections(pfilter, ppinfilter, &ppins, &nb);
703 TRACE("pins to consider: %ld\n", nb);
704 for(i = 0; i < nb; i++) {
705 TRACE("Processing pin %d\n", i);
706 hr = IGraphBuilder_Connect(iface, ppins[0], ppinIn);
708 TRACE("Cannot render pin %p (%lx)\n", ppinfilter, hr);
712 CoTaskMemFree(ppins);
718 IGraphBuilder_RemoveFilter(iface, pfilter);
719 IBaseFilter_Release(pfilter);
723 IEnumMediaTypes_Release(penummt);
729 static HRESULT WINAPI Graphbuilder_Render(IGraphBuilder *iface,
731 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
732 IEnumMediaTypes* penummt;
737 IEnumMoniker* pEnumMoniker;
742 TRACE("(%p/%p)->(%p)\n", This, iface, ppinOut);
744 hr = IPin_EnumMediaTypes(ppinOut, &penummt);
746 ERR("EnumMediaTypes (%lx)\n", hr);
752 hr = IEnumMediaTypes_Next(penummt, 1, &mt, &nbmt);
754 ERR("IEnumMediaTypes_Next (%lx)\n", hr);
759 TRACE("MajorType %s\n", debugstr_guid(&mt->majortype));
760 TRACE("SubType %s\n", debugstr_guid(&mt->subtype));
762 /* Try to find a suitable renderer with the same media type */
763 tab[0] = mt->majortype;
765 hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, TRUE, FALSE, 0, NULL, NULL, NULL);
767 ERR("Unable to enum filters (%lx)\n", hr);
771 while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
776 IBaseFilter* pfilter = NULL;
777 IEnumPins* penumpins;
780 hr = GetFilterInfo(pMoniker, &clsid, &var);
781 IMoniker_Release(pMoniker);
783 ERR("Unable to retrieve filter info (%lx)\n", hr);
787 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&pfilter);
789 ERR("Unable to create filter (%lx), trying next one\n", hr);
793 hr = IGraphBuilder_AddFilter(iface, pfilter, NULL);
795 ERR("Unable to add filter (%lx)\n", hr);
796 IBaseFilter_Release(pfilter);
801 hr = IBaseFilter_EnumPins(pfilter, &penumpins);
803 ERR("Splitter Enumpins (%lx)\n", hr);
806 hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin);
808 ERR("Next (%lx)\n", hr);
815 IEnumPins_Release(penumpins);
817 /* Connect the pin to render to the renderer */
818 hr = IGraphBuilder_Connect(iface, ppinOut, ppinfilter);
820 TRACE("Unable to connect to renderer (%lx)\n", hr);
827 IGraphBuilder_RemoveFilter(iface, pfilter);
828 IBaseFilter_Release(pfilter);
836 IEnumMediaTypes_Release(penummt);
841 static HRESULT WINAPI Graphbuilder_RenderFile(IGraphBuilder *iface,
843 LPCWSTR lpcwstrPlayList) {
844 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
845 static const WCHAR string[] = {'R','e','a','d','e','r',0};
846 IBaseFilter* preader = NULL;
847 IBaseFilter* psplitter;
850 IEnumPins* penumpins;
853 IEnumMoniker* pEnumMoniker;
858 IFileSourceFilter* pfile = NULL;
862 TRACE("(%p/%p)->(%s, %s)\n", This, iface, debugstr_w(lpcwstrFile), debugstr_w(lpcwstrPlayList));
864 hr = IGraphBuilder_AddSourceFilter(iface, lpcwstrFile, string, &preader);
866 /* Retrieve file media type */
868 hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter, (LPVOID*)&pfile);
870 hr = IFileSourceFilter_GetCurFile(pfile, &filename, &mt);
871 IFileSourceFilter_Release(pfile);
875 tab[0] = mt.majortype;
877 hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, FALSE, FALSE, 0, NULL, NULL, NULL);
883 IGraphBuilder_RemoveFilter(iface, preader);
884 IBaseFilter_Release(preader);
890 while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
895 hr = GetFilterInfo(pMoniker, &clsid, &var);
896 IMoniker_Release(pMoniker);
898 ERR("Unable to retrieve filter info (%lx)\n", hr);
902 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&psplitter);
904 ERR("Unable to create filter (%lx), trying next one\n", hr);
908 hr = IGraphBuilder_AddFilter(iface, psplitter, NULL);
910 ERR("Unable add filter (%lx)\n", hr);
914 /* Connect file source and splitter filters together */
915 /* Make the splitter analyze incoming data */
916 hr = IBaseFilter_EnumPins(preader, &penumpins);
918 ERR("Enumpins (%lx)\n", hr);
921 hr = IEnumPins_Next(penumpins, 1, &ppinreader, &pin);
923 ERR("Next (%lx)\n", hr);
930 IEnumPins_Release(penumpins);
932 hr = IBaseFilter_EnumPins(psplitter, &penumpins);
934 ERR("Splitter Enumpins (%lx)\n", hr);
937 hr = IEnumPins_Next(penumpins, 1, &ppinsplitter, &pin);
939 ERR("Next (%lx)\n", hr);
946 IEnumPins_Release(penumpins);
948 hr = IPin_Connect(ppinreader, ppinsplitter, NULL);
950 IBaseFilter_Release(ppinsplitter);
952 TRACE("Cannot connect to filter (%lx), trying next one\n", hr);
955 TRACE("Successfully connected to filter\n");
959 /* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
961 hr = GetInternalConnections(psplitter, ppinsplitter, &ppins, &nb);
965 TRACE("pins to consider: %ld\n", nb);
966 for(i = 0; i < nb; i++) {
967 TRACE("Processing pin %d\n", i);
968 hr = IGraphBuilder_Render(iface, ppins[i]);
970 ERR("Cannot render pin %p (%lx)\n", ppins[i], hr);
971 /* FIXME: We should clean created things properly */
975 CoTaskMemFree(ppins);
981 static HRESULT WINAPI Graphbuilder_AddSourceFilter(IGraphBuilder *iface,
982 LPCWSTR lpcwstrFileName,
983 LPCWSTR lpcwstrFilterName,
984 IBaseFilter **ppFilter) {
985 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
987 IBaseFilter* preader;
988 IFileSourceFilter* pfile = NULL;
992 TRACE("(%p/%p)->(%s, %s, %p)\n", This, iface, debugstr_w(lpcwstrFileName), debugstr_w(lpcwstrFilterName), ppFilter);
994 /* Instantiate a file source filter */
995 hr = CoCreateInstance(&CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&preader);
997 ERR("Unable to create file source filter (%lx)\n", hr);
1001 hr = IGraphBuilder_AddFilter(iface, preader, lpcwstrFilterName);
1003 ERR("Unable add filter (%lx)\n", hr);
1004 IBaseFilter_Release(preader);
1008 hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter, (LPVOID*)&pfile);
1010 ERR("Unable to get IFileSourceInterface (%lx)\n", hr);
1014 /* Load the file in the file source filter */
1015 hr = IFileSourceFilter_Load(pfile, lpcwstrFileName, NULL);
1017 ERR("Load (%lx)\n", hr);
1021 IFileSourceFilter_GetCurFile(pfile, &filename, &mt);
1023 ERR("GetCurFile (%lx)\n", hr);
1026 TRACE("File %s\n", debugstr_w(filename));
1027 TRACE("MajorType %s\n", debugstr_guid(&mt.majortype));
1028 TRACE("SubType %s\n", debugstr_guid(&mt.subtype));
1031 *ppFilter = preader;
1037 IFileSourceFilter_Release(pfile);
1038 IGraphBuilder_RemoveFilter(iface, preader);
1039 IBaseFilter_Release(preader);
1044 static HRESULT WINAPI Graphbuilder_SetLogFile(IGraphBuilder *iface,
1046 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1048 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) hFile);
1053 static HRESULT WINAPI Graphbuilder_Abort(IGraphBuilder *iface) {
1054 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1056 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1061 static HRESULT WINAPI Graphbuilder_ShouldOperationContinue(IGraphBuilder *iface) {
1062 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1064 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1070 static IGraphBuilderVtbl IGraphBuilder_VTable =
1072 Graphbuilder_QueryInterface,
1073 Graphbuilder_AddRef,
1074 Graphbuilder_Release,
1075 Graphbuilder_AddFilter,
1076 Graphbuilder_RemoveFilter,
1077 Graphbuilder_EnumFilters,
1078 Graphbuilder_FindFilterByName,
1079 Graphbuilder_ConnectDirect,
1080 Graphbuilder_Reconnect,
1081 Graphbuilder_Disconnect,
1082 Graphbuilder_SetDefaultSyncSource,
1083 Graphbuilder_Connect,
1084 Graphbuilder_Render,
1085 Graphbuilder_RenderFile,
1086 Graphbuilder_AddSourceFilter,
1087 Graphbuilder_SetLogFile,
1089 Graphbuilder_ShouldOperationContinue
1092 /*** IUnknown methods ***/
1093 static HRESULT WINAPI Mediacontrol_QueryInterface(IMediaControl *iface,
1096 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1098 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1100 return Filtergraph_QueryInterface(This, riid, ppvObj);
1103 static ULONG WINAPI Mediacontrol_AddRef(IMediaControl *iface) {
1104 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1106 TRACE("(%p/%p)->()\n", This, iface);
1108 return Filtergraph_AddRef(This);
1111 static ULONG WINAPI Mediacontrol_Release(IMediaControl *iface) {
1112 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1114 TRACE("(%p/%p)->()\n", This, iface);
1116 return Filtergraph_Release(This);
1120 /*** IDispatch methods ***/
1121 static HRESULT WINAPI Mediacontrol_GetTypeInfoCount(IMediaControl *iface,
1123 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1125 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1130 static HRESULT WINAPI Mediacontrol_GetTypeInfo(IMediaControl *iface,
1133 ITypeInfo**ppTInfo) {
1134 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1136 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1141 static HRESULT WINAPI Mediacontrol_GetIDsOfNames(IMediaControl *iface,
1147 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1149 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1154 static HRESULT WINAPI Mediacontrol_Invoke(IMediaControl *iface,
1155 DISPID dispIdMember,
1159 DISPPARAMS*pDispParams,
1161 EXCEPINFO*pExepInfo,
1163 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1165 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);
1170 static HRESULT ExploreGraph(IFilterGraphImpl* pGraph, IPin* pOutputPin, REFERENCE_TIME tStart)
1179 TRACE("%p %p %lld\n", pGraph, pOutputPin, tStart);
1181 hr = IPin_ConnectedTo(pOutputPin, &pInputPin);
1184 hr = IPin_QueryPinInfo(pInputPin, &PinInfo);
1187 hr = GetInternalConnections(PinInfo.pFilter, pInputPin, &ppPins, &nb);
1193 TRACE("Reached a renderer\n");
1194 /* Count renderers for end of stream notification */
1195 pGraph->nRenderers++;
1199 for(i = 0; i < nb; i++)
1201 /* Explore the graph downstream from this pin
1202 * FIXME: We should prevent exploring from a pin more than once. This can happens when
1203 * several input pins are connected to the same output (a MUX for instance). */
1204 ExploreGraph(pGraph, ppPins[i], tStart);
1207 CoTaskMemFree(ppPins);
1209 TRACE("Run filter %p\n", PinInfo.pFilter);
1210 IBaseFilter_Run(PinInfo.pFilter, tStart);
1216 /*** IMediaControl methods ***/
1217 static HRESULT WINAPI Mediacontrol_Run(IMediaControl *iface) {
1218 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1220 IBaseFilter* pfilter;
1227 TRACE("(%p/%p)->()\n", This, iface);
1229 EnterCriticalSection(&This->cs);
1231 if (This->state == State_Running)
1233 LeaveCriticalSection(&This->cs);
1237 /* Explorer the graph from source filters to renderers, determine renderers number and
1238 * run filters from renderers to source filters */
1239 This->nRenderers = 0;
1240 ResetEvent(This->hEventCompletion);
1242 for(i = 0; i < This->nFilters; i++)
1245 pfilter = This->ppFiltersInGraph[i];
1246 hr = IBaseFilter_EnumPins(pfilter, &pEnum);
1249 ERR("Enum pins failed %lx\n", hr);
1252 /* Check if it is a source filter */
1253 while(IEnumPins_Next(pEnum, 1, &pPin, &dummy) == S_OK)
1255 IPin_QueryDirection(pPin, &dir);
1256 if (dir == PINDIR_INPUT)
1264 TRACE("Found a source filter\n");
1265 IEnumPins_Reset(pEnum);
1266 while(IEnumPins_Next(pEnum, 1, &pPin, &dummy) == S_OK)
1268 /* Explore the graph downstream from this pin */
1269 ExploreGraph(This, pPin, 0);
1271 IBaseFilter_Run(pfilter, 0);
1273 IEnumPins_Release(pEnum);
1276 This->state = State_Running;
1278 LeaveCriticalSection(&This->cs);
1283 static HRESULT WINAPI Mediacontrol_Pause(IMediaControl *iface) {
1284 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1286 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1291 static HRESULT WINAPI Mediacontrol_Stop(IMediaControl *iface) {
1292 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1294 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1299 static HRESULT WINAPI Mediacontrol_GetState(IMediaControl *iface,
1301 OAFilterState *pfs) {
1302 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1304 TRACE("(%p/%p)->(%ld, %p): semi-stub !!!\n", This, iface, msTimeout, pfs);
1306 EnterCriticalSection(&This->cs);
1310 LeaveCriticalSection(&This->cs);
1315 static HRESULT WINAPI Mediacontrol_RenderFile(IMediaControl *iface,
1317 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1319 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This, iface, debugstr_w(strFilename), strFilename);
1324 static HRESULT WINAPI Mediacontrol_AddSourceFilter(IMediaControl *iface,
1326 IDispatch **ppUnk) {
1327 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1329 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This, iface, debugstr_w(strFilename), strFilename, ppUnk);
1334 static HRESULT WINAPI Mediacontrol_get_FilterCollection(IMediaControl *iface,
1335 IDispatch **ppUnk) {
1336 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1338 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppUnk);
1343 static HRESULT WINAPI Mediacontrol_get_RegFilterCollection(IMediaControl *iface,
1344 IDispatch **ppUnk) {
1345 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1347 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppUnk);
1352 static HRESULT WINAPI Mediacontrol_StopWhenReady(IMediaControl *iface) {
1353 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1355 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1361 static IMediaControlVtbl IMediaControl_VTable =
1363 Mediacontrol_QueryInterface,
1364 Mediacontrol_AddRef,
1365 Mediacontrol_Release,
1366 Mediacontrol_GetTypeInfoCount,
1367 Mediacontrol_GetTypeInfo,
1368 Mediacontrol_GetIDsOfNames,
1369 Mediacontrol_Invoke,
1373 Mediacontrol_GetState,
1374 Mediacontrol_RenderFile,
1375 Mediacontrol_AddSourceFilter,
1376 Mediacontrol_get_FilterCollection,
1377 Mediacontrol_get_RegFilterCollection,
1378 Mediacontrol_StopWhenReady
1382 /*** IUnknown methods ***/
1383 static HRESULT WINAPI Mediaseeking_QueryInterface(IMediaSeeking *iface,
1386 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1388 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1390 return Filtergraph_QueryInterface(This, riid, ppvObj);
1393 static ULONG WINAPI Mediaseeking_AddRef(IMediaSeeking *iface) {
1394 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1396 TRACE("(%p/%p)->()\n", This, iface);
1398 return Filtergraph_AddRef(This);
1401 static ULONG WINAPI Mediaseeking_Release(IMediaSeeking *iface) {
1402 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1404 TRACE("(%p/%p)->()\n", This, iface);
1406 return Filtergraph_Release(This);
1409 /*** IMediaSeeking methods ***/
1410 static HRESULT WINAPI Mediaseeking_GetCapabilities(IMediaSeeking *iface,
1411 DWORD *pCapabilities) {
1412 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1414 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCapabilities);
1419 static HRESULT WINAPI Mediaseeking_CheckCapabilities(IMediaSeeking *iface,
1420 DWORD *pCapabilities) {
1421 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1423 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCapabilities);
1428 static HRESULT WINAPI Mediaseeking_IsFormatSupported(IMediaSeeking *iface,
1429 const GUID *pFormat) {
1430 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1432 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1437 static HRESULT WINAPI Mediaseeking_QueryPreferredFormat(IMediaSeeking *iface,
1439 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1441 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1446 static HRESULT WINAPI Mediaseeking_GetTimeFormat(IMediaSeeking *iface,
1448 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1450 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1455 static HRESULT WINAPI Mediaseeking_IsUsingTimeFormat(IMediaSeeking *iface,
1456 const GUID *pFormat) {
1457 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1459 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1464 static HRESULT WINAPI Mediaseeking_SetTimeFormat(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_GetDuration(IMediaSeeking *iface,
1474 LONGLONG *pDuration) {
1475 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1477 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDuration);
1482 static HRESULT WINAPI Mediaseeking_GetStopPosition(IMediaSeeking *iface,
1484 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1486 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pStop);
1491 static HRESULT WINAPI Mediaseeking_GetCurrentPosition(IMediaSeeking *iface,
1492 LONGLONG *pCurrent) {
1493 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1495 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCurrent);
1500 static HRESULT WINAPI Mediaseeking_ConvertTimeFormat(IMediaSeeking *iface,
1502 const GUID *pTargetFormat,
1504 const GUID *pSourceFormat) {
1505 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1507 TRACE("(%p/%p)->(%p, %p, %lld, %p): stub !!!\n", This, iface, pTarget, pTargetFormat, Source, pSourceFormat);
1512 static HRESULT WINAPI Mediaseeking_SetPositions(IMediaSeeking *iface,
1514 DWORD dwCurrentFlags,
1516 DWORD dwStopFlags) {
1517 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1519 TRACE("(%p/%p)->(%p, %08lx, %p, %08lx): stub !!!\n", This, iface, pCurrent, dwCurrentFlags, pStop, dwStopFlags);
1524 static HRESULT WINAPI Mediaseeking_GetPositions(IMediaSeeking *iface,
1527 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1529 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pCurrent, pStop);
1534 static HRESULT WINAPI Mediaseeking_GetAvailable(IMediaSeeking *iface,
1535 LONGLONG *pEarliest,
1536 LONGLONG *pLatest) {
1537 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1539 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pEarliest, pLatest);
1544 static HRESULT WINAPI Mediaseeking_SetRate(IMediaSeeking *iface,
1546 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1548 TRACE("(%p/%p)->(%f): stub !!!\n", This, iface, dRate);
1553 static HRESULT WINAPI Mediaseeking_GetRate(IMediaSeeking *iface,
1555 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1557 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pdRate);
1562 static HRESULT WINAPI Mediaseeking_GetPreroll(IMediaSeeking *iface,
1563 LONGLONG *pllPreroll) {
1564 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1566 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pllPreroll);
1572 static IMediaSeekingVtbl IMediaSeeking_VTable =
1574 Mediaseeking_QueryInterface,
1575 Mediaseeking_AddRef,
1576 Mediaseeking_Release,
1577 Mediaseeking_GetCapabilities,
1578 Mediaseeking_CheckCapabilities,
1579 Mediaseeking_IsFormatSupported,
1580 Mediaseeking_QueryPreferredFormat,
1581 Mediaseeking_GetTimeFormat,
1582 Mediaseeking_IsUsingTimeFormat,
1583 Mediaseeking_SetTimeFormat,
1584 Mediaseeking_GetDuration,
1585 Mediaseeking_GetStopPosition,
1586 Mediaseeking_GetCurrentPosition,
1587 Mediaseeking_ConvertTimeFormat,
1588 Mediaseeking_SetPositions,
1589 Mediaseeking_GetPositions,
1590 Mediaseeking_GetAvailable,
1591 Mediaseeking_SetRate,
1592 Mediaseeking_GetRate,
1593 Mediaseeking_GetPreroll
1596 /*** IUnknown methods ***/
1597 static HRESULT WINAPI Basicaudio_QueryInterface(IBasicAudio *iface,
1600 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1602 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1604 return Filtergraph_QueryInterface(This, riid, ppvObj);
1607 static ULONG WINAPI Basicaudio_AddRef(IBasicAudio *iface) {
1608 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1610 TRACE("(%p/%p)->()\n", This, iface);
1612 return Filtergraph_AddRef(This);
1615 static ULONG WINAPI Basicaudio_Release(IBasicAudio *iface) {
1616 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1618 TRACE("(%p/%p)->()\n", This, iface);
1620 return Filtergraph_Release(This);
1623 /*** IDispatch methods ***/
1624 static HRESULT WINAPI Basicaudio_GetTypeInfoCount(IBasicAudio *iface,
1626 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1628 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1633 static HRESULT WINAPI Basicaudio_GetTypeInfo(IBasicAudio *iface,
1636 ITypeInfo**ppTInfo) {
1637 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1639 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1644 static HRESULT WINAPI Basicaudio_GetIDsOfNames(IBasicAudio *iface,
1650 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1652 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1657 static HRESULT WINAPI Basicaudio_Invoke(IBasicAudio *iface,
1658 DISPID dispIdMember,
1662 DISPPARAMS*pDispParams,
1664 EXCEPINFO*pExepInfo,
1666 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1668 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);
1673 /*** IBasicAudio methods ***/
1674 static HRESULT WINAPI Basicaudio_put_Volume(IBasicAudio *iface,
1676 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1678 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lVolume);
1683 static HRESULT WINAPI Basicaudio_get_Volume(IBasicAudio *iface,
1685 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1687 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plVolume);
1692 static HRESULT WINAPI Basicaudio_put_Balance(IBasicAudio *iface,
1694 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1696 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lBalance);
1701 static HRESULT WINAPI Basicaudio_get_Balance(IBasicAudio *iface,
1703 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1705 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plBalance);
1710 static IBasicAudioVtbl IBasicAudio_VTable =
1712 Basicaudio_QueryInterface,
1715 Basicaudio_GetTypeInfoCount,
1716 Basicaudio_GetTypeInfo,
1717 Basicaudio_GetIDsOfNames,
1719 Basicaudio_put_Volume,
1720 Basicaudio_get_Volume,
1721 Basicaudio_put_Balance,
1722 Basicaudio_get_Balance
1725 /*** IUnknown methods ***/
1726 static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface,
1729 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1731 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1733 return Filtergraph_QueryInterface(This, riid, ppvObj);
1736 static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface) {
1737 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1739 TRACE("(%p/%p)->()\n", This, iface);
1741 return Filtergraph_AddRef(This);
1744 static ULONG WINAPI Basicvideo_Release(IBasicVideo *iface) {
1745 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1747 TRACE("(%p/%p)->()\n", This, iface);
1749 return Filtergraph_Release(This);
1752 /*** IDispatch methods ***/
1753 static HRESULT WINAPI Basicvideo_GetTypeInfoCount(IBasicVideo *iface,
1755 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1757 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1762 static HRESULT WINAPI Basicvideo_GetTypeInfo(IBasicVideo *iface,
1765 ITypeInfo**ppTInfo) {
1766 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1768 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1773 static HRESULT WINAPI Basicvideo_GetIDsOfNames(IBasicVideo *iface,
1779 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1781 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1786 static HRESULT WINAPI Basicvideo_Invoke(IBasicVideo *iface,
1787 DISPID dispIdMember,
1791 DISPPARAMS*pDispParams,
1793 EXCEPINFO*pExepInfo,
1795 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1797 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);
1802 /*** IBasicVideo methods ***/
1803 static HRESULT WINAPI Basicvideo_get_AvgTimePerFrame(IBasicVideo *iface,
1804 REFTIME *pAvgTimePerFrame) {
1805 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1807 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pAvgTimePerFrame);
1812 static HRESULT WINAPI Basicvideo_get_BitRate(IBasicVideo *iface,
1814 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1816 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBitRate);
1821 static HRESULT WINAPI Basicvideo_get_BitErrorRate(IBasicVideo *iface,
1822 long *pBitErrorRate) {
1823 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1825 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBitErrorRate);
1830 static HRESULT WINAPI Basicvideo_get_VideoWidth(IBasicVideo *iface,
1831 long *pVideoWidth) {
1832 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1834 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVideoWidth);
1839 static HRESULT WINAPI Basicvideo_get_VideoHeight(IBasicVideo *iface,
1840 long *pVideoHeight) {
1841 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1843 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVideoHeight);
1848 static HRESULT WINAPI Basicvideo_put_SourceLeft(IBasicVideo *iface,
1850 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1852 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceLeft);
1857 static HRESULT WINAPI Basicvideo_get_SourceLeft(IBasicVideo *iface,
1858 long *pSourceLeft) {
1859 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1861 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceLeft);
1866 static HRESULT WINAPI Basicvideo_put_SourceWidth(IBasicVideo *iface,
1868 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1870 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceWidth);
1875 static HRESULT WINAPI Basicvideo_get_SourceWidth(IBasicVideo *iface,
1876 long *pSourceWidth) {
1877 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1879 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceWidth);
1884 static HRESULT WINAPI Basicvideo_put_SourceTop(IBasicVideo *iface,
1886 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1888 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceTop);
1893 static HRESULT WINAPI Basicvideo_get_SourceTop(IBasicVideo *iface,
1895 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1897 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceTop);
1902 static HRESULT WINAPI Basicvideo_put_SourceHeight(IBasicVideo *iface,
1903 long SourceHeight) {
1904 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1906 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceHeight);
1911 static HRESULT WINAPI Basicvideo_get_SourceHeight(IBasicVideo *iface,
1912 long *pSourceHeight) {
1913 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1915 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceHeight);
1920 static HRESULT WINAPI Basicvideo_put_DestinationLeft(IBasicVideo *iface,
1921 long DestinationLeft) {
1922 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1924 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationLeft);
1929 static HRESULT WINAPI Basicvideo_get_DestinationLeft(IBasicVideo *iface,
1930 long *pDestinationLeft) {
1931 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1933 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationLeft);
1938 static HRESULT WINAPI Basicvideo_put_DestinationWidth(IBasicVideo *iface,
1939 long DestinationWidth) {
1940 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1942 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationWidth);
1947 static HRESULT WINAPI Basicvideo_get_DestinationWidth(IBasicVideo *iface,
1948 long *pDestinationWidth) {
1949 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1951 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationWidth);
1956 static HRESULT WINAPI Basicvideo_put_DestinationTop(IBasicVideo *iface,
1957 long DestinationTop) {
1958 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1960 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationTop);
1965 static HRESULT WINAPI Basicvideo_get_DestinationTop(IBasicVideo *iface,
1966 long *pDestinationTop) {
1967 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1969 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationTop);
1974 static HRESULT WINAPI Basicvideo_put_DestinationHeight(IBasicVideo *iface,
1975 long DestinationHeight) {
1976 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1978 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationHeight);
1983 static HRESULT WINAPI Basicvideo_get_DestinationHeight(IBasicVideo *iface,
1984 long *pDestinationHeight) {
1985 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1987 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationHeight);
1992 static HRESULT WINAPI Basicvideo_SetSourcePosition(IBasicVideo *iface,
1997 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1999 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2004 static HRESULT WINAPI Basicvideo_GetSourcePosition(IBasicVideo *iface,
2009 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2011 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2016 static HRESULT WINAPI Basicvideo_SetDefaultSourcePosition(IBasicVideo *iface) {
2017 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2019 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2024 static HRESULT WINAPI Basicvideo_SetDestinationPosition(IBasicVideo *iface,
2029 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2031 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2036 static HRESULT WINAPI Basicvideo_GetDestinationPosition(IBasicVideo *iface,
2041 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2043 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2048 static HRESULT WINAPI Basicvideo_SetDefaultDestinationPosition(IBasicVideo *iface) {
2049 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2051 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2056 static HRESULT WINAPI Basicvideo_GetVideoSize(IBasicVideo *iface,
2059 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2061 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2066 static HRESULT WINAPI Basicvideo_GetVideoPaletteEntries(IBasicVideo *iface,
2071 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2073 TRACE("(%p/%p)->(%ld, %ld, %p, %p): stub !!!\n", This, iface, StartIndex, Entries, pRetrieved, pPalette);
2078 static HRESULT WINAPI Basicvideo_GetCurrentImage(IBasicVideo *iface,
2081 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2083 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pBufferSize, pDIBImage);
2088 static HRESULT WINAPI Basicvideo_IsUsingDefaultSource(IBasicVideo *iface) {
2089 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2091 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2096 static HRESULT WINAPI Basicvideo_IsUsingDefaultDestination(IBasicVideo *iface) {
2097 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2099 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2105 static IBasicVideoVtbl IBasicVideo_VTable =
2107 Basicvideo_QueryInterface,
2110 Basicvideo_GetTypeInfoCount,
2111 Basicvideo_GetTypeInfo,
2112 Basicvideo_GetIDsOfNames,
2114 Basicvideo_get_AvgTimePerFrame,
2115 Basicvideo_get_BitRate,
2116 Basicvideo_get_BitErrorRate,
2117 Basicvideo_get_VideoWidth,
2118 Basicvideo_get_VideoHeight,
2119 Basicvideo_put_SourceLeft,
2120 Basicvideo_get_SourceLeft,
2121 Basicvideo_put_SourceWidth,
2122 Basicvideo_get_SourceWidth,
2123 Basicvideo_put_SourceTop,
2124 Basicvideo_get_SourceTop,
2125 Basicvideo_put_SourceHeight,
2126 Basicvideo_get_SourceHeight,
2127 Basicvideo_put_DestinationLeft,
2128 Basicvideo_get_DestinationLeft,
2129 Basicvideo_put_DestinationWidth,
2130 Basicvideo_get_DestinationWidth,
2131 Basicvideo_put_DestinationTop,
2132 Basicvideo_get_DestinationTop,
2133 Basicvideo_put_DestinationHeight,
2134 Basicvideo_get_DestinationHeight,
2135 Basicvideo_SetSourcePosition,
2136 Basicvideo_GetSourcePosition,
2137 Basicvideo_SetDefaultSourcePosition,
2138 Basicvideo_SetDestinationPosition,
2139 Basicvideo_GetDestinationPosition,
2140 Basicvideo_SetDefaultDestinationPosition,
2141 Basicvideo_GetVideoSize,
2142 Basicvideo_GetVideoPaletteEntries,
2143 Basicvideo_GetCurrentImage,
2144 Basicvideo_IsUsingDefaultSource,
2145 Basicvideo_IsUsingDefaultDestination
2149 /*** IUnknown methods ***/
2150 static HRESULT WINAPI Videowindow_QueryInterface(IVideoWindow *iface,
2153 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2155 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
2157 return Filtergraph_QueryInterface(This, riid, ppvObj);
2160 static ULONG WINAPI Videowindow_AddRef(IVideoWindow *iface) {
2161 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2163 TRACE("(%p/%p)->()\n", This, iface);
2165 return Filtergraph_AddRef(This);
2168 static ULONG WINAPI Videowindow_Release(IVideoWindow *iface) {
2169 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2171 TRACE("(%p/%p)->()\n", This, iface);
2173 return Filtergraph_Release(This);
2176 /*** IDispatch methods ***/
2177 static HRESULT WINAPI Videowindow_GetTypeInfoCount(IVideoWindow *iface,
2179 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2181 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
2186 static HRESULT WINAPI Videowindow_GetTypeInfo(IVideoWindow *iface,
2189 ITypeInfo**ppTInfo) {
2190 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2192 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
2197 static HRESULT WINAPI Videowindow_GetIDsOfNames(IVideoWindow *iface,
2203 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2205 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
2210 static HRESULT WINAPI Videowindow_Invoke(IVideoWindow *iface,
2211 DISPID dispIdMember,
2215 DISPPARAMS*pDispParams,
2217 EXCEPINFO*pExepInfo,
2219 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2221 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);
2226 /*** IVideoWindow methods ***/
2227 static HRESULT WINAPI Videowindow_put_Caption(IVideoWindow *iface,
2229 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2231 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This, iface, debugstr_w(strCaption), strCaption);
2236 static HRESULT WINAPI Videowindow_get_Caption(IVideoWindow *iface,
2238 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2240 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, strCaption);
2245 static HRESULT WINAPI Videowindow_put_WindowStyle(IVideoWindow *iface,
2247 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2249 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowStyle);
2254 static HRESULT WINAPI Videowindow_get_WindowStyle(IVideoWindow *iface,
2255 long *WindowStyle) {
2256 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2258 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowStyle);
2263 static HRESULT WINAPI Videowindow_put_WindowStyleEx(IVideoWindow *iface,
2264 long WindowStyleEx) {
2265 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2267 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowStyleEx);
2272 static HRESULT WINAPI Videowindow_get_WindowStyleEx(IVideoWindow *iface,
2273 long *WindowStyleEx) {
2274 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2276 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowStyleEx);
2281 static HRESULT WINAPI Videowindow_put_AutoShow(IVideoWindow *iface,
2283 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2285 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, AutoShow);
2290 static HRESULT WINAPI Videowindow_get_AutoShow(IVideoWindow *iface,
2292 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2294 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, AutoShow);
2299 static HRESULT WINAPI Videowindow_put_WindowState(IVideoWindow *iface,
2301 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2303 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowState);
2308 static HRESULT WINAPI Videowindow_get_WindowState(IVideoWindow *iface,
2309 long *WindowState) {
2310 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2312 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowState);
2317 static HRESULT WINAPI Videowindow_put_BackgroundPalette(IVideoWindow *iface,
2318 long BackgroundPalette) {
2319 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2321 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, BackgroundPalette);
2326 static HRESULT WINAPI Videowindow_get_BackgroundPalette(IVideoWindow *iface,
2327 long *pBackgroundPalette) {
2328 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2330 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBackgroundPalette);
2335 static HRESULT WINAPI Videowindow_put_Visible(IVideoWindow *iface,
2337 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2339 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Visible);
2344 static HRESULT WINAPI Videowindow_get_Visible(IVideoWindow *iface,
2346 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2348 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVisible);
2353 static HRESULT WINAPI Videowindow_put_Left(IVideoWindow *iface,
2355 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2357 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Left);
2362 static HRESULT WINAPI Videowindow_get_Left(IVideoWindow *iface,
2364 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2366 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pLeft);
2371 static HRESULT WINAPI Videowindow_put_Width(IVideoWindow *iface,
2373 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2375 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Width);
2380 static HRESULT WINAPI Videowindow_get_Width(IVideoWindow *iface,
2382 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2384 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pWidth);
2389 static HRESULT WINAPI Videowindow_put_Top(IVideoWindow *iface,
2391 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2393 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Top);
2398 static HRESULT WINAPI Videowindow_get_Top(IVideoWindow *iface,
2400 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2402 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pTop);
2407 static HRESULT WINAPI Videowindow_put_Height(IVideoWindow *iface,
2409 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2411 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Height);
2416 static HRESULT WINAPI Videowindow_get_Height(IVideoWindow *iface,
2418 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2420 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pHeight);
2425 static HRESULT WINAPI Videowindow_put_Owner(IVideoWindow *iface,
2427 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2429 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Owner);
2434 static HRESULT WINAPI Videowindow_get_Owner(IVideoWindow *iface,
2436 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2438 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Owner);
2443 static HRESULT WINAPI Videowindow_put_MessageDrain(IVideoWindow *iface,
2445 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2447 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Drain);
2452 static HRESULT WINAPI Videowindow_get_MessageDrain(IVideoWindow *iface,
2454 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2456 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, Drain);
2461 static HRESULT WINAPI Videowindow_get_BorderColor(IVideoWindow *iface,
2463 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2465 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, Color);
2470 static HRESULT WINAPI Videowindow_put_BorderColor(IVideoWindow *iface,
2472 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2474 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Color);
2479 static HRESULT WINAPI Videowindow_get_FullScreenMode(IVideoWindow *iface,
2480 long *FullScreenMode) {
2481 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2483 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, FullScreenMode);
2488 static HRESULT WINAPI Videowindow_put_FullScreenMode(IVideoWindow *iface,
2489 long FullScreenMode) {
2490 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2492 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, FullScreenMode);
2497 static HRESULT WINAPI Videowindow_SetWindowForeground(IVideoWindow *iface,
2499 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2501 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Focus);
2506 static HRESULT WINAPI Videowindow_NotifyOwnerMessage(IVideoWindow *iface,
2511 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2513 TRACE("(%p/%p)->(%08lx, %ld, %08lx, %08lx): stub !!!\n", This, iface, (DWORD) hwnd, uMsg, wParam, lParam);
2518 static HRESULT WINAPI Videowindow_SetWindowPosition(IVideoWindow *iface,
2523 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2525 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2530 static HRESULT WINAPI Videowindow_GetWindowPosition(IVideoWindow *iface,
2535 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2537 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2542 static HRESULT WINAPI Videowindow_GetMinIdealImageSize(IVideoWindow *iface,
2545 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2547 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2552 static HRESULT WINAPI Videowindow_GetMaxIdealImageSize(IVideoWindow *iface,
2555 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2557 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2562 static HRESULT WINAPI Videowindow_GetRestorePosition(IVideoWindow *iface,
2567 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2569 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2574 static HRESULT WINAPI Videowindow_HideCursor(IVideoWindow *iface,
2576 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2578 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, HideCursor);
2583 static HRESULT WINAPI Videowindow_IsCursorHidden(IVideoWindow *iface,
2584 long *CursorHidden) {
2585 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2587 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, CursorHidden);
2593 static IVideoWindowVtbl IVideoWindow_VTable =
2595 Videowindow_QueryInterface,
2597 Videowindow_Release,
2598 Videowindow_GetTypeInfoCount,
2599 Videowindow_GetTypeInfo,
2600 Videowindow_GetIDsOfNames,
2602 Videowindow_put_Caption,
2603 Videowindow_get_Caption,
2604 Videowindow_put_WindowStyle,
2605 Videowindow_get_WindowStyle,
2606 Videowindow_put_WindowStyleEx,
2607 Videowindow_get_WindowStyleEx,
2608 Videowindow_put_AutoShow,
2609 Videowindow_get_AutoShow,
2610 Videowindow_put_WindowState,
2611 Videowindow_get_WindowState,
2612 Videowindow_put_BackgroundPalette,
2613 Videowindow_get_BackgroundPalette,
2614 Videowindow_put_Visible,
2615 Videowindow_get_Visible,
2616 Videowindow_put_Left,
2617 Videowindow_get_Left,
2618 Videowindow_put_Width,
2619 Videowindow_get_Width,
2620 Videowindow_put_Top,
2621 Videowindow_get_Top,
2622 Videowindow_put_Height,
2623 Videowindow_get_Height,
2624 Videowindow_put_Owner,
2625 Videowindow_get_Owner,
2626 Videowindow_put_MessageDrain,
2627 Videowindow_get_MessageDrain,
2628 Videowindow_get_BorderColor,
2629 Videowindow_put_BorderColor,
2630 Videowindow_get_FullScreenMode,
2631 Videowindow_put_FullScreenMode,
2632 Videowindow_SetWindowForeground,
2633 Videowindow_NotifyOwnerMessage,
2634 Videowindow_SetWindowPosition,
2635 Videowindow_GetWindowPosition,
2636 Videowindow_GetMinIdealImageSize,
2637 Videowindow_GetMaxIdealImageSize,
2638 Videowindow_GetRestorePosition,
2639 Videowindow_HideCursor,
2640 Videowindow_IsCursorHidden
2644 /*** IUnknown methods ***/
2645 static HRESULT WINAPI Mediaevent_QueryInterface(IMediaEventEx *iface,
2648 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2650 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
2652 return Filtergraph_QueryInterface(This, riid, ppvObj);
2655 static ULONG WINAPI Mediaevent_AddRef(IMediaEventEx *iface) {
2656 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2658 TRACE("(%p/%p)->()\n", This, iface);
2660 return Filtergraph_AddRef(This);
2663 static ULONG WINAPI Mediaevent_Release(IMediaEventEx *iface) {
2664 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2666 TRACE("(%p/%p)->()\n", This, iface);
2668 return Filtergraph_Release(This);
2671 /*** IDispatch methods ***/
2672 static HRESULT WINAPI Mediaevent_GetTypeInfoCount(IMediaEventEx *iface,
2674 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2676 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
2681 static HRESULT WINAPI Mediaevent_GetTypeInfo(IMediaEventEx *iface,
2684 ITypeInfo**ppTInfo) {
2685 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2687 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
2692 static HRESULT WINAPI Mediaevent_GetIDsOfNames(IMediaEventEx *iface,
2698 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2700 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
2705 static HRESULT WINAPI Mediaevent_Invoke(IMediaEventEx *iface,
2706 DISPID dispIdMember,
2710 DISPPARAMS*pDispParams,
2712 EXCEPINFO*pExepInfo,
2714 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2716 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);
2721 /*** IMediaEvent methods ***/
2722 static HRESULT WINAPI Mediaevent_GetEventHandle(IMediaEventEx *iface,
2724 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2726 TRACE("(%p/%p)->(%p)\n", This, iface, hEvent);
2728 *hEvent = (OAEVENT)This->evqueue.msg_event;
2733 static HRESULT WINAPI Mediaevent_GetEvent(IMediaEventEx *iface,
2738 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2741 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This, iface, lEventCode, lParam1, lParam2, msTimeout);
2743 if (EventsQueue_GetEvent(&This->evqueue, &evt, msTimeout))
2745 *lEventCode = evt.lEventCode;
2746 *lParam1 = evt.lParam1;
2747 *lParam2 = evt.lParam2;
2755 static HRESULT WINAPI Mediaevent_WaitForCompletion(IMediaEventEx *iface,
2758 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2760 TRACE("(%p/%p)->(%ld, %p)\n", This, iface, msTimeout, pEvCode);
2762 if (WaitForSingleObject(This->hEventCompletion, msTimeout) == WAIT_OBJECT_0)
2764 *pEvCode = This->CompletionStatus;
2772 static HRESULT WINAPI Mediaevent_CancelDefaultHandling(IMediaEventEx *iface,
2774 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2776 TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode);
2778 if (lEvCode == EC_COMPLETE)
2779 This->HandleEcComplete = FALSE;
2780 else if (lEvCode == EC_REPAINT)
2781 This->HandleEcRepaint = FALSE;
2788 static HRESULT WINAPI Mediaevent_RestoreDefaultHandling(IMediaEventEx *iface,
2790 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2792 TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode);
2794 if (lEvCode == EC_COMPLETE)
2795 This->HandleEcComplete = TRUE;
2796 else if (lEvCode == EC_REPAINT)
2797 This->HandleEcRepaint = TRUE;
2804 static HRESULT WINAPI Mediaevent_FreeEventParams(IMediaEventEx *iface,
2808 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2810 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This, iface, lEvCode, lParam1, lParam2);
2815 /*** IMediaEventEx methods ***/
2816 static HRESULT WINAPI Mediaevent_SetNotifyWindow(IMediaEventEx *iface,
2819 LONG_PTR lInstanceData) {
2820 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2822 TRACE("(%p/%p)->(%08lx, %ld, %08lx)\n", This, iface, (DWORD) hwnd, lMsg, lInstanceData);
2824 This->notif.hWnd = (HWND)hwnd;
2825 This->notif.msg = lMsg;
2826 This->notif.instance = (long) lInstanceData;
2831 static HRESULT WINAPI Mediaevent_SetNotifyFlags(IMediaEventEx *iface,
2832 long lNoNotifyFlags) {
2833 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2835 TRACE("(%p/%p)->(%ld)\n", This, iface, lNoNotifyFlags);
2837 if ((lNoNotifyFlags != 0) || (lNoNotifyFlags != 1))
2838 return E_INVALIDARG;
2840 This->notif.disabled = lNoNotifyFlags;
2845 static HRESULT WINAPI Mediaevent_GetNotifyFlags(IMediaEventEx *iface,
2846 long *lplNoNotifyFlags) {
2847 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2849 TRACE("(%p/%p)->(%p)\n", This, iface, lplNoNotifyFlags);
2851 if (!lplNoNotifyFlags)
2854 *lplNoNotifyFlags = This->notif.disabled;
2860 static IMediaEventExVtbl IMediaEventEx_VTable =
2862 Mediaevent_QueryInterface,
2865 Mediaevent_GetTypeInfoCount,
2866 Mediaevent_GetTypeInfo,
2867 Mediaevent_GetIDsOfNames,
2869 Mediaevent_GetEventHandle,
2870 Mediaevent_GetEvent,
2871 Mediaevent_WaitForCompletion,
2872 Mediaevent_CancelDefaultHandling,
2873 Mediaevent_RestoreDefaultHandling,
2874 Mediaevent_FreeEventParams,
2875 Mediaevent_SetNotifyWindow,
2876 Mediaevent_SetNotifyFlags,
2877 Mediaevent_GetNotifyFlags
2881 static HRESULT WINAPI MediaFilter_QueryInterface(IMediaFilter *iface, REFIID riid, LPVOID *ppv)
2883 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2885 return Filtergraph_QueryInterface(This, riid, ppv);
2888 static ULONG WINAPI MediaFilter_AddRef(IMediaFilter *iface)
2890 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2892 return Filtergraph_AddRef(This);
2895 static ULONG WINAPI MediaFilter_Release(IMediaFilter *iface)
2897 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2899 return Filtergraph_Release(This);
2902 static HRESULT WINAPI MediaFilter_GetClassID(IMediaFilter *iface, CLSID * pClassID)
2904 FIXME("(%p): stub\n", pClassID);
2909 static HRESULT WINAPI MediaFilter_Stop(IMediaFilter *iface)
2911 FIXME("(): stub\n");
2916 static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface)
2918 FIXME("(): stub\n");
2923 static HRESULT WINAPI MediaFilter_Run(IMediaFilter *iface, REFERENCE_TIME tStart)
2925 FIXME("(%lld): stub\n", tStart);
2930 static HRESULT WINAPI MediaFilter_GetState(IMediaFilter *iface, DWORD dwMsTimeout, FILTER_STATE * pState)
2932 FIXME("(%ld, %p): stub\n", dwMsTimeout, pState);
2937 static HRESULT WINAPI MediaFilter_SetSyncSource(IMediaFilter *iface, IReferenceClock *pClock)
2939 FIXME("(%p): stub\n", pClock);
2944 static HRESULT WINAPI MediaFilter_GetSyncSource(IMediaFilter *iface, IReferenceClock **ppClock)
2946 FIXME("(%p): stub\n", ppClock);
2951 static IMediaFilterVtbl IMediaFilter_VTable =
2953 MediaFilter_QueryInterface,
2955 MediaFilter_Release,
2956 MediaFilter_GetClassID,
2960 MediaFilter_GetState,
2961 MediaFilter_SetSyncSource,
2962 MediaFilter_GetSyncSource
2965 static HRESULT WINAPI MediaEventSink_QueryInterface(IMediaEventSink *iface, REFIID riid, LPVOID *ppv)
2967 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
2969 return Filtergraph_QueryInterface(This, riid, ppv);
2972 static ULONG WINAPI MediaEventSink_AddRef(IMediaEventSink *iface)
2974 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
2976 return Filtergraph_AddRef(This);
2979 static ULONG WINAPI MediaEventSink_Release(IMediaEventSink *iface)
2981 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
2983 return Filtergraph_Release(This);
2986 static HRESULT WINAPI MediaEventSink_Notify(IMediaEventSink *iface, long EventCode, LONG_PTR EventParam1, LONG_PTR EventParam2)
2988 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
2991 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This, iface, EventCode, EventParam1, EventParam2);
2993 /* We need thread safety here, let's use the events queue's one */
2994 EnterCriticalSection(&This->evqueue.msg_crst);
2996 if ((EventCode == EC_COMPLETE) && This->HandleEcComplete)
2998 if (++This->EcCompleteCount == This->nRenderers)
3000 evt.lEventCode = EC_COMPLETE;
3003 EventsQueue_PutEvent(&This->evqueue, &evt);
3004 if (!This->notif.disabled && This->notif.hWnd)
3005 PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
3006 This->CompletionStatus = EC_COMPLETE;
3007 SetEvent(This->hEventCompletion);
3010 else if ((EventCode == EC_REPAINT) && This->HandleEcRepaint)
3012 /* FIXME: Not handled yet */
3016 evt.lEventCode = EventCode;
3017 evt.lParam1 = EventParam1;
3018 evt.lParam2 = EventParam2;
3019 EventsQueue_PutEvent(&This->evqueue, &evt);
3020 if (!This->notif.disabled && This->notif.hWnd)
3021 PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
3024 LeaveCriticalSection(&This->evqueue.msg_crst);
3028 static IMediaEventSinkVtbl IMediaEventSink_VTable =
3030 MediaEventSink_QueryInterface,
3031 MediaEventSink_AddRef,
3032 MediaEventSink_Release,
3033 MediaEventSink_Notify
3036 /* This is the only function that actually creates a FilterGraph class... */
3037 HRESULT FILTERGRAPH_create(IUnknown *pUnkOuter, LPVOID *ppObj) {
3038 IFilterGraphImpl *fimpl;
3041 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
3044 return CLASS_E_NOAGGREGATION;
3046 fimpl = (IFilterGraphImpl *) HeapAlloc(GetProcessHeap(), 0, sizeof(*fimpl));
3047 fimpl->IGraphBuilder_vtbl = &IGraphBuilder_VTable;
3048 fimpl->IMediaControl_vtbl = &IMediaControl_VTable;
3049 fimpl->IMediaSeeking_vtbl = &IMediaSeeking_VTable;
3050 fimpl->IBasicAudio_vtbl = &IBasicAudio_VTable;
3051 fimpl->IBasicVideo_vtbl = &IBasicVideo_VTable;
3052 fimpl->IVideoWindow_vtbl = &IVideoWindow_VTable;
3053 fimpl->IMediaEventEx_vtbl = &IMediaEventEx_VTable;
3054 fimpl->IMediaFilter_vtbl = &IMediaFilter_VTable;
3055 fimpl->IMediaEventSink_vtbl = &IMediaEventSink_VTable;
3057 fimpl->ppFiltersInGraph = NULL;
3058 fimpl->pFilterNames = NULL;
3059 fimpl->nFilters = 0;
3060 fimpl->filterCapacity = 0;
3061 fimpl->nameIndex = 1;
3062 fimpl->hEventCompletion = CreateEventW(0, TRUE, FALSE,0);
3063 fimpl->HandleEcComplete = TRUE;
3064 fimpl->HandleEcRepaint = TRUE;
3065 fimpl->notif.hWnd = 0;
3066 fimpl->notif.disabled = TRUE;
3067 fimpl->nRenderers = 0;
3068 fimpl->EcCompleteCount = 0;
3069 fimpl->state = State_Stopped;
3070 EventsQueue_Init(&fimpl->evqueue);
3071 InitializeCriticalSection(&fimpl->cs);
3073 hr = CoCreateInstance(&CLSID_FilterMapper, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (LPVOID*)&fimpl->pFilterMapper2);
3075 ERR("Unable to create filter mapper (%lx)\n", hr);