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);
880 IGraphBuilder_RemoveFilter(iface, preader);
881 IBaseFilter_Release(preader);
886 while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
891 hr = GetFilterInfo(pMoniker, &clsid, &var);
892 IMoniker_Release(pMoniker);
894 ERR("Unable to retrieve filter info (%lx)\n", hr);
898 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&psplitter);
900 ERR("Unable to create filter (%lx), trying next one\n", hr);
904 hr = IGraphBuilder_AddFilter(iface, psplitter, NULL);
906 ERR("Unable add filter (%lx)\n", hr);
910 /* Connect file source and splitter filters together */
911 /* Make the splitter analyze incoming data */
912 hr = IBaseFilter_EnumPins(preader, &penumpins);
914 ERR("Enumpins (%lx)\n", hr);
917 hr = IEnumPins_Next(penumpins, 1, &ppinreader, &pin);
919 ERR("Next (%lx)\n", hr);
926 IEnumPins_Release(penumpins);
928 hr = IBaseFilter_EnumPins(psplitter, &penumpins);
930 ERR("Splitter Enumpins (%lx)\n", hr);
933 hr = IEnumPins_Next(penumpins, 1, &ppinsplitter, &pin);
935 ERR("Next (%lx)\n", hr);
942 IEnumPins_Release(penumpins);
944 hr = IPin_Connect(ppinreader, ppinsplitter, NULL);
946 IBaseFilter_Release(ppinsplitter);
948 TRACE("Cannot connect to filter (%lx), trying next one\n", hr);
951 TRACE("Successfully connected to filter\n");
955 /* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
957 hr = GetInternalConnections(psplitter, ppinsplitter, &ppins, &nb);
961 TRACE("pins to consider: %ld\n", nb);
962 for(i = 0; i < nb; i++) {
963 TRACE("Processing pin %d\n", i);
964 hr = IGraphBuilder_Render(iface, ppins[i]);
966 ERR("Cannot render pin %p (%lx)\n", ppins[i], hr);
967 /* FIXME: We should clean created things properly */
971 CoTaskMemFree(ppins);
977 static HRESULT WINAPI Graphbuilder_AddSourceFilter(IGraphBuilder *iface,
978 LPCWSTR lpcwstrFileName,
979 LPCWSTR lpcwstrFilterName,
980 IBaseFilter **ppFilter) {
981 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
983 IBaseFilter* preader;
984 IFileSourceFilter* pfile = NULL;
988 TRACE("(%p/%p)->(%s, %s, %p)\n", This, iface, debugstr_w(lpcwstrFileName), debugstr_w(lpcwstrFilterName), ppFilter);
990 /* Instantiate a file source filter */
991 hr = CoCreateInstance(&CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&preader);
993 ERR("Unable to create file source filter (%lx)\n", hr);
997 hr = IGraphBuilder_AddFilter(iface, preader, lpcwstrFilterName);
999 ERR("Unable add filter (%lx)\n", hr);
1000 IBaseFilter_Release(preader);
1004 hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter, (LPVOID*)&pfile);
1006 ERR("Unable to get IFileSourceInterface (%lx)\n", hr);
1010 /* Load the file in the file source filter */
1011 hr = IFileSourceFilter_Load(pfile, lpcwstrFileName, NULL);
1013 ERR("Load (%lx)\n", hr);
1017 IFileSourceFilter_GetCurFile(pfile, &filename, &mt);
1019 ERR("GetCurFile (%lx)\n", hr);
1022 TRACE("File %s\n", debugstr_w(filename));
1023 TRACE("MajorType %s\n", debugstr_guid(&mt.majortype));
1024 TRACE("SubType %s\n", debugstr_guid(&mt.subtype));
1027 *ppFilter = preader;
1033 IFileSourceFilter_Release(pfile);
1034 IGraphBuilder_RemoveFilter(iface, preader);
1035 IBaseFilter_Release(preader);
1040 static HRESULT WINAPI Graphbuilder_SetLogFile(IGraphBuilder *iface,
1042 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1044 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) hFile);
1049 static HRESULT WINAPI Graphbuilder_Abort(IGraphBuilder *iface) {
1050 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1052 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1057 static HRESULT WINAPI Graphbuilder_ShouldOperationContinue(IGraphBuilder *iface) {
1058 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1060 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1066 static IGraphBuilderVtbl IGraphBuilder_VTable =
1068 Graphbuilder_QueryInterface,
1069 Graphbuilder_AddRef,
1070 Graphbuilder_Release,
1071 Graphbuilder_AddFilter,
1072 Graphbuilder_RemoveFilter,
1073 Graphbuilder_EnumFilters,
1074 Graphbuilder_FindFilterByName,
1075 Graphbuilder_ConnectDirect,
1076 Graphbuilder_Reconnect,
1077 Graphbuilder_Disconnect,
1078 Graphbuilder_SetDefaultSyncSource,
1079 Graphbuilder_Connect,
1080 Graphbuilder_Render,
1081 Graphbuilder_RenderFile,
1082 Graphbuilder_AddSourceFilter,
1083 Graphbuilder_SetLogFile,
1085 Graphbuilder_ShouldOperationContinue
1088 /*** IUnknown methods ***/
1089 static HRESULT WINAPI Mediacontrol_QueryInterface(IMediaControl *iface,
1092 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1094 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1096 return Filtergraph_QueryInterface(This, riid, ppvObj);
1099 static ULONG WINAPI Mediacontrol_AddRef(IMediaControl *iface) {
1100 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1102 TRACE("(%p/%p)->()\n", This, iface);
1104 return Filtergraph_AddRef(This);
1107 static ULONG WINAPI Mediacontrol_Release(IMediaControl *iface) {
1108 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1110 TRACE("(%p/%p)->()\n", This, iface);
1112 return Filtergraph_Release(This);
1116 /*** IDispatch methods ***/
1117 static HRESULT WINAPI Mediacontrol_GetTypeInfoCount(IMediaControl *iface,
1119 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1121 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1126 static HRESULT WINAPI Mediacontrol_GetTypeInfo(IMediaControl *iface,
1129 ITypeInfo**ppTInfo) {
1130 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1132 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1137 static HRESULT WINAPI Mediacontrol_GetIDsOfNames(IMediaControl *iface,
1143 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1145 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1150 static HRESULT WINAPI Mediacontrol_Invoke(IMediaControl *iface,
1151 DISPID dispIdMember,
1155 DISPPARAMS*pDispParams,
1157 EXCEPINFO*pExepInfo,
1159 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1161 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);
1166 static HRESULT ExploreGraph(IFilterGraphImpl* pGraph, IPin* pOutputPin, REFERENCE_TIME tStart)
1175 TRACE("%p %p %lld\n", pGraph, pOutputPin, tStart);
1177 hr = IPin_ConnectedTo(pOutputPin, &pInputPin);
1180 hr = IPin_QueryPinInfo(pInputPin, &PinInfo);
1183 hr = GetInternalConnections(PinInfo.pFilter, pInputPin, &ppPins, &nb);
1189 TRACE("Reached a renderer\n");
1190 /* Count renderers for end of stream notification */
1191 pGraph->nRenderers++;
1195 for(i = 0; i < nb; i++)
1197 /* Explore the graph downstream from this pin
1198 * FIXME: We should prevent exploring from a pin more than once. This can happens when
1199 * several input pins are connected to the same output (a MUX for instance). */
1200 ExploreGraph(pGraph, ppPins[i], tStart);
1203 CoTaskMemFree(ppPins);
1205 TRACE("Run filter %p\n", PinInfo.pFilter);
1206 IBaseFilter_Run(PinInfo.pFilter, tStart);
1212 /*** IMediaControl methods ***/
1213 static HRESULT WINAPI Mediacontrol_Run(IMediaControl *iface) {
1214 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1216 IBaseFilter* pfilter;
1223 TRACE("(%p/%p)->()\n", This, iface);
1225 EnterCriticalSection(&This->cs);
1227 if (This->state == State_Running)
1229 LeaveCriticalSection(&This->cs);
1233 /* Explorer the graph from source filters to renderers, determine renderers number and
1234 * run filters from renderers to source filters */
1235 This->nRenderers = 0;
1236 ResetEvent(This->hEventCompletion);
1238 for(i = 0; i < This->nFilters; i++)
1241 pfilter = This->ppFiltersInGraph[i];
1242 hr = IBaseFilter_EnumPins(pfilter, &pEnum);
1245 ERR("Enum pins failed %lx\n", hr);
1248 /* Check if it is a source filter */
1249 while(IEnumPins_Next(pEnum, 1, &pPin, &dummy) == S_OK)
1251 IPin_QueryDirection(pPin, &dir);
1252 if (dir == PINDIR_INPUT)
1260 TRACE("Found a source filter\n");
1261 IEnumPins_Reset(pEnum);
1262 while(IEnumPins_Next(pEnum, 1, &pPin, &dummy) == S_OK)
1264 /* Explore the graph downstream from this pin */
1265 ExploreGraph(This, pPin, 0);
1267 IBaseFilter_Run(pfilter, 0);
1269 IEnumPins_Release(pEnum);
1272 This->state = State_Running;
1274 LeaveCriticalSection(&This->cs);
1279 static HRESULT WINAPI Mediacontrol_Pause(IMediaControl *iface) {
1280 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1282 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1287 static HRESULT WINAPI Mediacontrol_Stop(IMediaControl *iface) {
1288 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1290 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1295 static HRESULT WINAPI Mediacontrol_GetState(IMediaControl *iface,
1297 OAFilterState *pfs) {
1298 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1300 TRACE("(%p/%p)->(%ld, %p): semi-stub !!!\n", This, iface, msTimeout, pfs);
1302 EnterCriticalSection(&This->cs);
1306 LeaveCriticalSection(&This->cs);
1311 static HRESULT WINAPI Mediacontrol_RenderFile(IMediaControl *iface,
1313 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1315 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This, iface, debugstr_w(strFilename), strFilename);
1320 static HRESULT WINAPI Mediacontrol_AddSourceFilter(IMediaControl *iface,
1322 IDispatch **ppUnk) {
1323 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1325 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This, iface, debugstr_w(strFilename), strFilename, ppUnk);
1330 static HRESULT WINAPI Mediacontrol_get_FilterCollection(IMediaControl *iface,
1331 IDispatch **ppUnk) {
1332 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1334 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppUnk);
1339 static HRESULT WINAPI Mediacontrol_get_RegFilterCollection(IMediaControl *iface,
1340 IDispatch **ppUnk) {
1341 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1343 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppUnk);
1348 static HRESULT WINAPI Mediacontrol_StopWhenReady(IMediaControl *iface) {
1349 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1351 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1357 static IMediaControlVtbl IMediaControl_VTable =
1359 Mediacontrol_QueryInterface,
1360 Mediacontrol_AddRef,
1361 Mediacontrol_Release,
1362 Mediacontrol_GetTypeInfoCount,
1363 Mediacontrol_GetTypeInfo,
1364 Mediacontrol_GetIDsOfNames,
1365 Mediacontrol_Invoke,
1369 Mediacontrol_GetState,
1370 Mediacontrol_RenderFile,
1371 Mediacontrol_AddSourceFilter,
1372 Mediacontrol_get_FilterCollection,
1373 Mediacontrol_get_RegFilterCollection,
1374 Mediacontrol_StopWhenReady
1378 /*** IUnknown methods ***/
1379 static HRESULT WINAPI Mediaseeking_QueryInterface(IMediaSeeking *iface,
1382 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1384 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1386 return Filtergraph_QueryInterface(This, riid, ppvObj);
1389 static ULONG WINAPI Mediaseeking_AddRef(IMediaSeeking *iface) {
1390 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1392 TRACE("(%p/%p)->()\n", This, iface);
1394 return Filtergraph_AddRef(This);
1397 static ULONG WINAPI Mediaseeking_Release(IMediaSeeking *iface) {
1398 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1400 TRACE("(%p/%p)->()\n", This, iface);
1402 return Filtergraph_Release(This);
1405 /*** IMediaSeeking methods ***/
1406 static HRESULT WINAPI Mediaseeking_GetCapabilities(IMediaSeeking *iface,
1407 DWORD *pCapabilities) {
1408 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1410 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCapabilities);
1415 static HRESULT WINAPI Mediaseeking_CheckCapabilities(IMediaSeeking *iface,
1416 DWORD *pCapabilities) {
1417 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1419 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCapabilities);
1424 static HRESULT WINAPI Mediaseeking_IsFormatSupported(IMediaSeeking *iface,
1425 const GUID *pFormat) {
1426 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1428 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1433 static HRESULT WINAPI Mediaseeking_QueryPreferredFormat(IMediaSeeking *iface,
1435 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1437 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1442 static HRESULT WINAPI Mediaseeking_GetTimeFormat(IMediaSeeking *iface,
1444 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1446 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1451 static HRESULT WINAPI Mediaseeking_IsUsingTimeFormat(IMediaSeeking *iface,
1452 const GUID *pFormat) {
1453 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1455 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1460 static HRESULT WINAPI Mediaseeking_SetTimeFormat(IMediaSeeking *iface,
1461 const GUID *pFormat) {
1462 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1464 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1469 static HRESULT WINAPI Mediaseeking_GetDuration(IMediaSeeking *iface,
1470 LONGLONG *pDuration) {
1471 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1473 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDuration);
1478 static HRESULT WINAPI Mediaseeking_GetStopPosition(IMediaSeeking *iface,
1480 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1482 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pStop);
1487 static HRESULT WINAPI Mediaseeking_GetCurrentPosition(IMediaSeeking *iface,
1488 LONGLONG *pCurrent) {
1489 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1491 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCurrent);
1496 static HRESULT WINAPI Mediaseeking_ConvertTimeFormat(IMediaSeeking *iface,
1498 const GUID *pTargetFormat,
1500 const GUID *pSourceFormat) {
1501 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1503 TRACE("(%p/%p)->(%p, %p, %lld, %p): stub !!!\n", This, iface, pTarget, pTargetFormat, Source, pSourceFormat);
1508 static HRESULT WINAPI Mediaseeking_SetPositions(IMediaSeeking *iface,
1510 DWORD dwCurrentFlags,
1512 DWORD dwStopFlags) {
1513 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1515 TRACE("(%p/%p)->(%p, %08lx, %p, %08lx): stub !!!\n", This, iface, pCurrent, dwCurrentFlags, pStop, dwStopFlags);
1520 static HRESULT WINAPI Mediaseeking_GetPositions(IMediaSeeking *iface,
1523 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1525 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pCurrent, pStop);
1530 static HRESULT WINAPI Mediaseeking_GetAvailable(IMediaSeeking *iface,
1531 LONGLONG *pEarliest,
1532 LONGLONG *pLatest) {
1533 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1535 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pEarliest, pLatest);
1540 static HRESULT WINAPI Mediaseeking_SetRate(IMediaSeeking *iface,
1542 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1544 TRACE("(%p/%p)->(%f): stub !!!\n", This, iface, dRate);
1549 static HRESULT WINAPI Mediaseeking_GetRate(IMediaSeeking *iface,
1551 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1553 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pdRate);
1558 static HRESULT WINAPI Mediaseeking_GetPreroll(IMediaSeeking *iface,
1559 LONGLONG *pllPreroll) {
1560 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1562 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pllPreroll);
1568 static IMediaSeekingVtbl IMediaSeeking_VTable =
1570 Mediaseeking_QueryInterface,
1571 Mediaseeking_AddRef,
1572 Mediaseeking_Release,
1573 Mediaseeking_GetCapabilities,
1574 Mediaseeking_CheckCapabilities,
1575 Mediaseeking_IsFormatSupported,
1576 Mediaseeking_QueryPreferredFormat,
1577 Mediaseeking_GetTimeFormat,
1578 Mediaseeking_IsUsingTimeFormat,
1579 Mediaseeking_SetTimeFormat,
1580 Mediaseeking_GetDuration,
1581 Mediaseeking_GetStopPosition,
1582 Mediaseeking_GetCurrentPosition,
1583 Mediaseeking_ConvertTimeFormat,
1584 Mediaseeking_SetPositions,
1585 Mediaseeking_GetPositions,
1586 Mediaseeking_GetAvailable,
1587 Mediaseeking_SetRate,
1588 Mediaseeking_GetRate,
1589 Mediaseeking_GetPreroll
1592 /*** IUnknown methods ***/
1593 static HRESULT WINAPI Basicaudio_QueryInterface(IBasicAudio *iface,
1596 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1598 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1600 return Filtergraph_QueryInterface(This, riid, ppvObj);
1603 static ULONG WINAPI Basicaudio_AddRef(IBasicAudio *iface) {
1604 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1606 TRACE("(%p/%p)->()\n", This, iface);
1608 return Filtergraph_AddRef(This);
1611 static ULONG WINAPI Basicaudio_Release(IBasicAudio *iface) {
1612 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1614 TRACE("(%p/%p)->()\n", This, iface);
1616 return Filtergraph_Release(This);
1619 /*** IDispatch methods ***/
1620 static HRESULT WINAPI Basicaudio_GetTypeInfoCount(IBasicAudio *iface,
1622 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1624 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1629 static HRESULT WINAPI Basicaudio_GetTypeInfo(IBasicAudio *iface,
1632 ITypeInfo**ppTInfo) {
1633 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1635 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1640 static HRESULT WINAPI Basicaudio_GetIDsOfNames(IBasicAudio *iface,
1646 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1648 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1653 static HRESULT WINAPI Basicaudio_Invoke(IBasicAudio *iface,
1654 DISPID dispIdMember,
1658 DISPPARAMS*pDispParams,
1660 EXCEPINFO*pExepInfo,
1662 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1664 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);
1669 /*** IBasicAudio methods ***/
1670 static HRESULT WINAPI Basicaudio_put_Volume(IBasicAudio *iface,
1672 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1674 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lVolume);
1679 static HRESULT WINAPI Basicaudio_get_Volume(IBasicAudio *iface,
1681 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1683 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plVolume);
1688 static HRESULT WINAPI Basicaudio_put_Balance(IBasicAudio *iface,
1690 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1692 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lBalance);
1697 static HRESULT WINAPI Basicaudio_get_Balance(IBasicAudio *iface,
1699 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1701 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plBalance);
1706 static IBasicAudioVtbl IBasicAudio_VTable =
1708 Basicaudio_QueryInterface,
1711 Basicaudio_GetTypeInfoCount,
1712 Basicaudio_GetTypeInfo,
1713 Basicaudio_GetIDsOfNames,
1715 Basicaudio_put_Volume,
1716 Basicaudio_get_Volume,
1717 Basicaudio_put_Balance,
1718 Basicaudio_get_Balance
1721 /*** IUnknown methods ***/
1722 static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface,
1725 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1727 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1729 return Filtergraph_QueryInterface(This, riid, ppvObj);
1732 static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface) {
1733 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1735 TRACE("(%p/%p)->()\n", This, iface);
1737 return Filtergraph_AddRef(This);
1740 static ULONG WINAPI Basicvideo_Release(IBasicVideo *iface) {
1741 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1743 TRACE("(%p/%p)->()\n", This, iface);
1745 return Filtergraph_Release(This);
1748 /*** IDispatch methods ***/
1749 static HRESULT WINAPI Basicvideo_GetTypeInfoCount(IBasicVideo *iface,
1751 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1753 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1758 static HRESULT WINAPI Basicvideo_GetTypeInfo(IBasicVideo *iface,
1761 ITypeInfo**ppTInfo) {
1762 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1764 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1769 static HRESULT WINAPI Basicvideo_GetIDsOfNames(IBasicVideo *iface,
1775 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1777 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1782 static HRESULT WINAPI Basicvideo_Invoke(IBasicVideo *iface,
1783 DISPID dispIdMember,
1787 DISPPARAMS*pDispParams,
1789 EXCEPINFO*pExepInfo,
1791 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1793 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);
1798 /*** IBasicVideo methods ***/
1799 static HRESULT WINAPI Basicvideo_get_AvgTimePerFrame(IBasicVideo *iface,
1800 REFTIME *pAvgTimePerFrame) {
1801 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1803 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pAvgTimePerFrame);
1808 static HRESULT WINAPI Basicvideo_get_BitRate(IBasicVideo *iface,
1810 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1812 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBitRate);
1817 static HRESULT WINAPI Basicvideo_get_BitErrorRate(IBasicVideo *iface,
1818 long *pBitErrorRate) {
1819 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1821 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBitErrorRate);
1826 static HRESULT WINAPI Basicvideo_get_VideoWidth(IBasicVideo *iface,
1827 long *pVideoWidth) {
1828 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1830 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVideoWidth);
1835 static HRESULT WINAPI Basicvideo_get_VideoHeight(IBasicVideo *iface,
1836 long *pVideoHeight) {
1837 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1839 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVideoHeight);
1844 static HRESULT WINAPI Basicvideo_put_SourceLeft(IBasicVideo *iface,
1846 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1848 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceLeft);
1853 static HRESULT WINAPI Basicvideo_get_SourceLeft(IBasicVideo *iface,
1854 long *pSourceLeft) {
1855 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1857 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceLeft);
1862 static HRESULT WINAPI Basicvideo_put_SourceWidth(IBasicVideo *iface,
1864 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1866 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceWidth);
1871 static HRESULT WINAPI Basicvideo_get_SourceWidth(IBasicVideo *iface,
1872 long *pSourceWidth) {
1873 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1875 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceWidth);
1880 static HRESULT WINAPI Basicvideo_put_SourceTop(IBasicVideo *iface,
1882 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1884 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceTop);
1889 static HRESULT WINAPI Basicvideo_get_SourceTop(IBasicVideo *iface,
1891 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1893 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceTop);
1898 static HRESULT WINAPI Basicvideo_put_SourceHeight(IBasicVideo *iface,
1899 long SourceHeight) {
1900 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1902 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceHeight);
1907 static HRESULT WINAPI Basicvideo_get_SourceHeight(IBasicVideo *iface,
1908 long *pSourceHeight) {
1909 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1911 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceHeight);
1916 static HRESULT WINAPI Basicvideo_put_DestinationLeft(IBasicVideo *iface,
1917 long DestinationLeft) {
1918 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1920 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationLeft);
1925 static HRESULT WINAPI Basicvideo_get_DestinationLeft(IBasicVideo *iface,
1926 long *pDestinationLeft) {
1927 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1929 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationLeft);
1934 static HRESULT WINAPI Basicvideo_put_DestinationWidth(IBasicVideo *iface,
1935 long DestinationWidth) {
1936 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1938 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationWidth);
1943 static HRESULT WINAPI Basicvideo_get_DestinationWidth(IBasicVideo *iface,
1944 long *pDestinationWidth) {
1945 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1947 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationWidth);
1952 static HRESULT WINAPI Basicvideo_put_DestinationTop(IBasicVideo *iface,
1953 long DestinationTop) {
1954 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1956 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationTop);
1961 static HRESULT WINAPI Basicvideo_get_DestinationTop(IBasicVideo *iface,
1962 long *pDestinationTop) {
1963 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1965 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationTop);
1970 static HRESULT WINAPI Basicvideo_put_DestinationHeight(IBasicVideo *iface,
1971 long DestinationHeight) {
1972 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1974 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationHeight);
1979 static HRESULT WINAPI Basicvideo_get_DestinationHeight(IBasicVideo *iface,
1980 long *pDestinationHeight) {
1981 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1983 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationHeight);
1988 static HRESULT WINAPI Basicvideo_SetSourcePosition(IBasicVideo *iface,
1993 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1995 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2000 static HRESULT WINAPI Basicvideo_GetSourcePosition(IBasicVideo *iface,
2005 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2007 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2012 static HRESULT WINAPI Basicvideo_SetDefaultSourcePosition(IBasicVideo *iface) {
2013 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2015 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2020 static HRESULT WINAPI Basicvideo_SetDestinationPosition(IBasicVideo *iface,
2025 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2027 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2032 static HRESULT WINAPI Basicvideo_GetDestinationPosition(IBasicVideo *iface,
2037 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2039 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2044 static HRESULT WINAPI Basicvideo_SetDefaultDestinationPosition(IBasicVideo *iface) {
2045 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2047 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2052 static HRESULT WINAPI Basicvideo_GetVideoSize(IBasicVideo *iface,
2055 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2057 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2062 static HRESULT WINAPI Basicvideo_GetVideoPaletteEntries(IBasicVideo *iface,
2067 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2069 TRACE("(%p/%p)->(%ld, %ld, %p, %p): stub !!!\n", This, iface, StartIndex, Entries, pRetrieved, pPalette);
2074 static HRESULT WINAPI Basicvideo_GetCurrentImage(IBasicVideo *iface,
2077 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2079 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pBufferSize, pDIBImage);
2084 static HRESULT WINAPI Basicvideo_IsUsingDefaultSource(IBasicVideo *iface) {
2085 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2087 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2092 static HRESULT WINAPI Basicvideo_IsUsingDefaultDestination(IBasicVideo *iface) {
2093 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2095 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2101 static IBasicVideoVtbl IBasicVideo_VTable =
2103 Basicvideo_QueryInterface,
2106 Basicvideo_GetTypeInfoCount,
2107 Basicvideo_GetTypeInfo,
2108 Basicvideo_GetIDsOfNames,
2110 Basicvideo_get_AvgTimePerFrame,
2111 Basicvideo_get_BitRate,
2112 Basicvideo_get_BitErrorRate,
2113 Basicvideo_get_VideoWidth,
2114 Basicvideo_get_VideoHeight,
2115 Basicvideo_put_SourceLeft,
2116 Basicvideo_get_SourceLeft,
2117 Basicvideo_put_SourceWidth,
2118 Basicvideo_get_SourceWidth,
2119 Basicvideo_put_SourceTop,
2120 Basicvideo_get_SourceTop,
2121 Basicvideo_put_SourceHeight,
2122 Basicvideo_get_SourceHeight,
2123 Basicvideo_put_DestinationLeft,
2124 Basicvideo_get_DestinationLeft,
2125 Basicvideo_put_DestinationWidth,
2126 Basicvideo_get_DestinationWidth,
2127 Basicvideo_put_DestinationTop,
2128 Basicvideo_get_DestinationTop,
2129 Basicvideo_put_DestinationHeight,
2130 Basicvideo_get_DestinationHeight,
2131 Basicvideo_SetSourcePosition,
2132 Basicvideo_GetSourcePosition,
2133 Basicvideo_SetDefaultSourcePosition,
2134 Basicvideo_SetDestinationPosition,
2135 Basicvideo_GetDestinationPosition,
2136 Basicvideo_SetDefaultDestinationPosition,
2137 Basicvideo_GetVideoSize,
2138 Basicvideo_GetVideoPaletteEntries,
2139 Basicvideo_GetCurrentImage,
2140 Basicvideo_IsUsingDefaultSource,
2141 Basicvideo_IsUsingDefaultDestination
2145 /*** IUnknown methods ***/
2146 static HRESULT WINAPI Videowindow_QueryInterface(IVideoWindow *iface,
2149 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2151 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
2153 return Filtergraph_QueryInterface(This, riid, ppvObj);
2156 static ULONG WINAPI Videowindow_AddRef(IVideoWindow *iface) {
2157 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2159 TRACE("(%p/%p)->()\n", This, iface);
2161 return Filtergraph_AddRef(This);
2164 static ULONG WINAPI Videowindow_Release(IVideoWindow *iface) {
2165 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2167 TRACE("(%p/%p)->()\n", This, iface);
2169 return Filtergraph_Release(This);
2172 /*** IDispatch methods ***/
2173 static HRESULT WINAPI Videowindow_GetTypeInfoCount(IVideoWindow *iface,
2175 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2177 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
2182 static HRESULT WINAPI Videowindow_GetTypeInfo(IVideoWindow *iface,
2185 ITypeInfo**ppTInfo) {
2186 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2188 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
2193 static HRESULT WINAPI Videowindow_GetIDsOfNames(IVideoWindow *iface,
2199 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2201 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
2206 static HRESULT WINAPI Videowindow_Invoke(IVideoWindow *iface,
2207 DISPID dispIdMember,
2211 DISPPARAMS*pDispParams,
2213 EXCEPINFO*pExepInfo,
2215 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2217 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);
2222 /*** IVideoWindow methods ***/
2223 static HRESULT WINAPI Videowindow_put_Caption(IVideoWindow *iface,
2225 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2227 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This, iface, debugstr_w(strCaption), strCaption);
2232 static HRESULT WINAPI Videowindow_get_Caption(IVideoWindow *iface,
2234 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2236 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, strCaption);
2241 static HRESULT WINAPI Videowindow_put_WindowStyle(IVideoWindow *iface,
2243 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2245 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowStyle);
2250 static HRESULT WINAPI Videowindow_get_WindowStyle(IVideoWindow *iface,
2251 long *WindowStyle) {
2252 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2254 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowStyle);
2259 static HRESULT WINAPI Videowindow_put_WindowStyleEx(IVideoWindow *iface,
2260 long WindowStyleEx) {
2261 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2263 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowStyleEx);
2268 static HRESULT WINAPI Videowindow_get_WindowStyleEx(IVideoWindow *iface,
2269 long *WindowStyleEx) {
2270 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2272 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowStyleEx);
2277 static HRESULT WINAPI Videowindow_put_AutoShow(IVideoWindow *iface,
2279 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2281 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, AutoShow);
2286 static HRESULT WINAPI Videowindow_get_AutoShow(IVideoWindow *iface,
2288 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2290 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, AutoShow);
2295 static HRESULT WINAPI Videowindow_put_WindowState(IVideoWindow *iface,
2297 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2299 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowState);
2304 static HRESULT WINAPI Videowindow_get_WindowState(IVideoWindow *iface,
2305 long *WindowState) {
2306 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2308 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowState);
2313 static HRESULT WINAPI Videowindow_put_BackgroundPalette(IVideoWindow *iface,
2314 long BackgroundPalette) {
2315 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2317 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, BackgroundPalette);
2322 static HRESULT WINAPI Videowindow_get_BackgroundPalette(IVideoWindow *iface,
2323 long *pBackgroundPalette) {
2324 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2326 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBackgroundPalette);
2331 static HRESULT WINAPI Videowindow_put_Visible(IVideoWindow *iface,
2333 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2335 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Visible);
2340 static HRESULT WINAPI Videowindow_get_Visible(IVideoWindow *iface,
2342 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2344 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVisible);
2349 static HRESULT WINAPI Videowindow_put_Left(IVideoWindow *iface,
2351 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2353 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Left);
2358 static HRESULT WINAPI Videowindow_get_Left(IVideoWindow *iface,
2360 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2362 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pLeft);
2367 static HRESULT WINAPI Videowindow_put_Width(IVideoWindow *iface,
2369 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2371 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Width);
2376 static HRESULT WINAPI Videowindow_get_Width(IVideoWindow *iface,
2378 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2380 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pWidth);
2385 static HRESULT WINAPI Videowindow_put_Top(IVideoWindow *iface,
2387 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2389 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Top);
2394 static HRESULT WINAPI Videowindow_get_Top(IVideoWindow *iface,
2396 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2398 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pTop);
2403 static HRESULT WINAPI Videowindow_put_Height(IVideoWindow *iface,
2405 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2407 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Height);
2412 static HRESULT WINAPI Videowindow_get_Height(IVideoWindow *iface,
2414 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2416 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pHeight);
2421 static HRESULT WINAPI Videowindow_put_Owner(IVideoWindow *iface,
2423 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2425 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Owner);
2430 static HRESULT WINAPI Videowindow_get_Owner(IVideoWindow *iface,
2432 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2434 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Owner);
2439 static HRESULT WINAPI Videowindow_put_MessageDrain(IVideoWindow *iface,
2441 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2443 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Drain);
2448 static HRESULT WINAPI Videowindow_get_MessageDrain(IVideoWindow *iface,
2450 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2452 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, Drain);
2457 static HRESULT WINAPI Videowindow_get_BorderColor(IVideoWindow *iface,
2459 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2461 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, Color);
2466 static HRESULT WINAPI Videowindow_put_BorderColor(IVideoWindow *iface,
2468 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2470 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Color);
2475 static HRESULT WINAPI Videowindow_get_FullScreenMode(IVideoWindow *iface,
2476 long *FullScreenMode) {
2477 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2479 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, FullScreenMode);
2484 static HRESULT WINAPI Videowindow_put_FullScreenMode(IVideoWindow *iface,
2485 long FullScreenMode) {
2486 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2488 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, FullScreenMode);
2493 static HRESULT WINAPI Videowindow_SetWindowForeground(IVideoWindow *iface,
2495 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2497 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Focus);
2502 static HRESULT WINAPI Videowindow_NotifyOwnerMessage(IVideoWindow *iface,
2507 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2509 TRACE("(%p/%p)->(%08lx, %ld, %08lx, %08lx): stub !!!\n", This, iface, (DWORD) hwnd, uMsg, wParam, lParam);
2514 static HRESULT WINAPI Videowindow_SetWindowPosition(IVideoWindow *iface,
2519 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2521 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2526 static HRESULT WINAPI Videowindow_GetWindowPosition(IVideoWindow *iface,
2531 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2533 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2538 static HRESULT WINAPI Videowindow_GetMinIdealImageSize(IVideoWindow *iface,
2541 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2543 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2548 static HRESULT WINAPI Videowindow_GetMaxIdealImageSize(IVideoWindow *iface,
2551 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2553 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2558 static HRESULT WINAPI Videowindow_GetRestorePosition(IVideoWindow *iface,
2563 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2565 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2570 static HRESULT WINAPI Videowindow_HideCursor(IVideoWindow *iface,
2572 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2574 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, HideCursor);
2579 static HRESULT WINAPI Videowindow_IsCursorHidden(IVideoWindow *iface,
2580 long *CursorHidden) {
2581 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2583 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, CursorHidden);
2589 static IVideoWindowVtbl IVideoWindow_VTable =
2591 Videowindow_QueryInterface,
2593 Videowindow_Release,
2594 Videowindow_GetTypeInfoCount,
2595 Videowindow_GetTypeInfo,
2596 Videowindow_GetIDsOfNames,
2598 Videowindow_put_Caption,
2599 Videowindow_get_Caption,
2600 Videowindow_put_WindowStyle,
2601 Videowindow_get_WindowStyle,
2602 Videowindow_put_WindowStyleEx,
2603 Videowindow_get_WindowStyleEx,
2604 Videowindow_put_AutoShow,
2605 Videowindow_get_AutoShow,
2606 Videowindow_put_WindowState,
2607 Videowindow_get_WindowState,
2608 Videowindow_put_BackgroundPalette,
2609 Videowindow_get_BackgroundPalette,
2610 Videowindow_put_Visible,
2611 Videowindow_get_Visible,
2612 Videowindow_put_Left,
2613 Videowindow_get_Left,
2614 Videowindow_put_Width,
2615 Videowindow_get_Width,
2616 Videowindow_put_Top,
2617 Videowindow_get_Top,
2618 Videowindow_put_Height,
2619 Videowindow_get_Height,
2620 Videowindow_put_Owner,
2621 Videowindow_get_Owner,
2622 Videowindow_put_MessageDrain,
2623 Videowindow_get_MessageDrain,
2624 Videowindow_get_BorderColor,
2625 Videowindow_put_BorderColor,
2626 Videowindow_get_FullScreenMode,
2627 Videowindow_put_FullScreenMode,
2628 Videowindow_SetWindowForeground,
2629 Videowindow_NotifyOwnerMessage,
2630 Videowindow_SetWindowPosition,
2631 Videowindow_GetWindowPosition,
2632 Videowindow_GetMinIdealImageSize,
2633 Videowindow_GetMaxIdealImageSize,
2634 Videowindow_GetRestorePosition,
2635 Videowindow_HideCursor,
2636 Videowindow_IsCursorHidden
2640 /*** IUnknown methods ***/
2641 static HRESULT WINAPI Mediaevent_QueryInterface(IMediaEventEx *iface,
2644 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2646 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
2648 return Filtergraph_QueryInterface(This, riid, ppvObj);
2651 static ULONG WINAPI Mediaevent_AddRef(IMediaEventEx *iface) {
2652 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2654 TRACE("(%p/%p)->()\n", This, iface);
2656 return Filtergraph_AddRef(This);
2659 static ULONG WINAPI Mediaevent_Release(IMediaEventEx *iface) {
2660 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2662 TRACE("(%p/%p)->()\n", This, iface);
2664 return Filtergraph_Release(This);
2667 /*** IDispatch methods ***/
2668 static HRESULT WINAPI Mediaevent_GetTypeInfoCount(IMediaEventEx *iface,
2670 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2672 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
2677 static HRESULT WINAPI Mediaevent_GetTypeInfo(IMediaEventEx *iface,
2680 ITypeInfo**ppTInfo) {
2681 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2683 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
2688 static HRESULT WINAPI Mediaevent_GetIDsOfNames(IMediaEventEx *iface,
2694 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2696 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
2701 static HRESULT WINAPI Mediaevent_Invoke(IMediaEventEx *iface,
2702 DISPID dispIdMember,
2706 DISPPARAMS*pDispParams,
2708 EXCEPINFO*pExepInfo,
2710 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2712 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);
2717 /*** IMediaEvent methods ***/
2718 static HRESULT WINAPI Mediaevent_GetEventHandle(IMediaEventEx *iface,
2720 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2722 TRACE("(%p/%p)->(%p)\n", This, iface, hEvent);
2724 *hEvent = (OAEVENT)This->evqueue.msg_event;
2729 static HRESULT WINAPI Mediaevent_GetEvent(IMediaEventEx *iface,
2734 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2737 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This, iface, lEventCode, lParam1, lParam2, msTimeout);
2739 if (EventsQueue_GetEvent(&This->evqueue, &evt, msTimeout))
2741 *lEventCode = evt.lEventCode;
2742 *lParam1 = evt.lParam1;
2743 *lParam2 = evt.lParam2;
2751 static HRESULT WINAPI Mediaevent_WaitForCompletion(IMediaEventEx *iface,
2754 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2756 TRACE("(%p/%p)->(%ld, %p)\n", This, iface, msTimeout, pEvCode);
2758 if (WaitForSingleObject(This->hEventCompletion, msTimeout) == WAIT_OBJECT_0)
2760 *pEvCode = This->CompletionStatus;
2768 static HRESULT WINAPI Mediaevent_CancelDefaultHandling(IMediaEventEx *iface,
2770 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2772 TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode);
2774 if (lEvCode == EC_COMPLETE)
2775 This->HandleEcComplete = FALSE;
2776 else if (lEvCode == EC_REPAINT)
2777 This->HandleEcRepaint = FALSE;
2784 static HRESULT WINAPI Mediaevent_RestoreDefaultHandling(IMediaEventEx *iface,
2786 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2788 TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode);
2790 if (lEvCode == EC_COMPLETE)
2791 This->HandleEcComplete = TRUE;
2792 else if (lEvCode == EC_REPAINT)
2793 This->HandleEcRepaint = TRUE;
2800 static HRESULT WINAPI Mediaevent_FreeEventParams(IMediaEventEx *iface,
2804 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2806 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This, iface, lEvCode, lParam1, lParam2);
2811 /*** IMediaEventEx methods ***/
2812 static HRESULT WINAPI Mediaevent_SetNotifyWindow(IMediaEventEx *iface,
2815 LONG_PTR lInstanceData) {
2816 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2818 TRACE("(%p/%p)->(%08lx, %ld, %08lx)\n", This, iface, (DWORD) hwnd, lMsg, lInstanceData);
2820 This->notif.hWnd = (HWND)hwnd;
2821 This->notif.msg = lMsg;
2822 This->notif.instance = (long) lInstanceData;
2827 static HRESULT WINAPI Mediaevent_SetNotifyFlags(IMediaEventEx *iface,
2828 long lNoNotifyFlags) {
2829 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2831 TRACE("(%p/%p)->(%ld)\n", This, iface, lNoNotifyFlags);
2833 if ((lNoNotifyFlags != 0) || (lNoNotifyFlags != 1))
2834 return E_INVALIDARG;
2836 This->notif.disabled = lNoNotifyFlags;
2841 static HRESULT WINAPI Mediaevent_GetNotifyFlags(IMediaEventEx *iface,
2842 long *lplNoNotifyFlags) {
2843 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2845 TRACE("(%p/%p)->(%p)\n", This, iface, lplNoNotifyFlags);
2847 if (!lplNoNotifyFlags)
2850 *lplNoNotifyFlags = This->notif.disabled;
2856 static IMediaEventExVtbl IMediaEventEx_VTable =
2858 Mediaevent_QueryInterface,
2861 Mediaevent_GetTypeInfoCount,
2862 Mediaevent_GetTypeInfo,
2863 Mediaevent_GetIDsOfNames,
2865 Mediaevent_GetEventHandle,
2866 Mediaevent_GetEvent,
2867 Mediaevent_WaitForCompletion,
2868 Mediaevent_CancelDefaultHandling,
2869 Mediaevent_RestoreDefaultHandling,
2870 Mediaevent_FreeEventParams,
2871 Mediaevent_SetNotifyWindow,
2872 Mediaevent_SetNotifyFlags,
2873 Mediaevent_GetNotifyFlags
2877 static HRESULT WINAPI MediaFilter_QueryInterface(IMediaFilter *iface, REFIID riid, LPVOID *ppv)
2879 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2881 return Filtergraph_QueryInterface(This, riid, ppv);
2884 static ULONG WINAPI MediaFilter_AddRef(IMediaFilter *iface)
2886 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2888 return Filtergraph_AddRef(This);
2891 static ULONG WINAPI MediaFilter_Release(IMediaFilter *iface)
2893 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2895 return Filtergraph_Release(This);
2898 static HRESULT WINAPI MediaFilter_GetClassID(IMediaFilter *iface, CLSID * pClassID)
2900 FIXME("(%p): stub\n", pClassID);
2905 static HRESULT WINAPI MediaFilter_Stop(IMediaFilter *iface)
2907 FIXME("(): stub\n");
2912 static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface)
2914 FIXME("(): stub\n");
2919 static HRESULT WINAPI MediaFilter_Run(IMediaFilter *iface, REFERENCE_TIME tStart)
2921 FIXME("(%lld): stub\n", tStart);
2926 static HRESULT WINAPI MediaFilter_GetState(IMediaFilter *iface, DWORD dwMsTimeout, FILTER_STATE * pState)
2928 FIXME("(%ld, %p): stub\n", dwMsTimeout, pState);
2933 static HRESULT WINAPI MediaFilter_SetSyncSource(IMediaFilter *iface, IReferenceClock *pClock)
2935 FIXME("(%p): stub\n", pClock);
2940 static HRESULT WINAPI MediaFilter_GetSyncSource(IMediaFilter *iface, IReferenceClock **ppClock)
2942 FIXME("(%p): stub\n", ppClock);
2947 static IMediaFilterVtbl IMediaFilter_VTable =
2949 MediaFilter_QueryInterface,
2951 MediaFilter_Release,
2952 MediaFilter_GetClassID,
2956 MediaFilter_GetState,
2957 MediaFilter_SetSyncSource,
2958 MediaFilter_GetSyncSource
2961 static HRESULT WINAPI MediaEventSink_QueryInterface(IMediaEventSink *iface, REFIID riid, LPVOID *ppv)
2963 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
2965 return Filtergraph_QueryInterface(This, riid, ppv);
2968 static ULONG WINAPI MediaEventSink_AddRef(IMediaEventSink *iface)
2970 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
2972 return Filtergraph_AddRef(This);
2975 static ULONG WINAPI MediaEventSink_Release(IMediaEventSink *iface)
2977 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
2979 return Filtergraph_Release(This);
2982 static HRESULT WINAPI MediaEventSink_Notify(IMediaEventSink *iface, long EventCode, LONG_PTR EventParam1, LONG_PTR EventParam2)
2984 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
2987 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This, iface, EventCode, EventParam1, EventParam2);
2989 /* We need thread safety here, let's use the events queue's one */
2990 EnterCriticalSection(&This->evqueue.msg_crst);
2992 if ((EventCode == EC_COMPLETE) && This->HandleEcComplete)
2994 if (++This->EcCompleteCount == This->nRenderers)
2996 evt.lEventCode = EC_COMPLETE;
2999 EventsQueue_PutEvent(&This->evqueue, &evt);
3000 if (!This->notif.disabled && This->notif.hWnd)
3001 PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
3002 This->CompletionStatus = EC_COMPLETE;
3003 SetEvent(This->hEventCompletion);
3006 else if ((EventCode == EC_REPAINT) && This->HandleEcRepaint)
3008 /* FIXME: Not handled yet */
3012 evt.lEventCode = EventCode;
3013 evt.lParam1 = EventParam1;
3014 evt.lParam2 = EventParam2;
3015 EventsQueue_PutEvent(&This->evqueue, &evt);
3016 if (!This->notif.disabled && This->notif.hWnd)
3017 PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
3020 LeaveCriticalSection(&This->evqueue.msg_crst);
3024 static IMediaEventSinkVtbl IMediaEventSink_VTable =
3026 MediaEventSink_QueryInterface,
3027 MediaEventSink_AddRef,
3028 MediaEventSink_Release,
3029 MediaEventSink_Notify
3032 /* This is the only function that actually creates a FilterGraph class... */
3033 HRESULT FILTERGRAPH_create(IUnknown *pUnkOuter, LPVOID *ppObj) {
3034 IFilterGraphImpl *fimpl;
3037 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
3040 return CLASS_E_NOAGGREGATION;
3042 fimpl = (IFilterGraphImpl *) HeapAlloc(GetProcessHeap(), 0, sizeof(*fimpl));
3043 fimpl->IGraphBuilder_vtbl = &IGraphBuilder_VTable;
3044 fimpl->IMediaControl_vtbl = &IMediaControl_VTable;
3045 fimpl->IMediaSeeking_vtbl = &IMediaSeeking_VTable;
3046 fimpl->IBasicAudio_vtbl = &IBasicAudio_VTable;
3047 fimpl->IBasicVideo_vtbl = &IBasicVideo_VTable;
3048 fimpl->IVideoWindow_vtbl = &IVideoWindow_VTable;
3049 fimpl->IMediaEventEx_vtbl = &IMediaEventEx_VTable;
3050 fimpl->IMediaFilter_vtbl = &IMediaFilter_VTable;
3051 fimpl->IMediaEventSink_vtbl = &IMediaEventSink_VTable;
3053 fimpl->ppFiltersInGraph = NULL;
3054 fimpl->pFilterNames = NULL;
3055 fimpl->nFilters = 0;
3056 fimpl->filterCapacity = 0;
3057 fimpl->nameIndex = 1;
3058 fimpl->hEventCompletion = CreateEventW(0, TRUE, FALSE,0);
3059 fimpl->HandleEcComplete = TRUE;
3060 fimpl->HandleEcRepaint = TRUE;
3061 fimpl->notif.hWnd = 0;
3062 fimpl->notif.disabled = TRUE;
3063 fimpl->nRenderers = 0;
3064 fimpl->EcCompleteCount = 0;
3065 fimpl->state = State_Stopped;
3066 EventsQueue_Init(&fimpl->evqueue);
3067 InitializeCriticalSection(&fimpl->cs);
3069 hr = CoCreateInstance(&CLSID_FilterMapper, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (LPVOID*)&fimpl->pFilterMapper2);
3071 ERR("Unable to create filter mapper (%lx)\n", hr);