1 /* DirectShow FilterGraph object (QUARTZ.DLL)
3 * Copyright 2002 Lionel Ulmer
4 * Copyright 2004 Christian Costa
6 * This file contains the (internal) driver registration functions,
7 * driver enumeration APIs and DirectDraw creation functions.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33 #include "wine/debug.h"
34 #include "quartz_private.h"
35 #define COM_NO_WINDOWS_H
41 #include "wine/unicode.h"
44 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
47 HWND hWnd; /* Target window */
48 long msg; /* User window message */
49 long instance; /* User data */
50 int disabled; /* Disabled messages posting */
54 long lEventCode; /* Event code */
55 LONG_PTR lParam1; /* Param1 */
56 LONG_PTR lParam2; /* Param2 */
59 /* messages ring implementation for queuing events (taken from winmm) */
60 #define EVENTS_RING_BUFFER_INCREMENT 64
66 CRITICAL_SECTION msg_crst;
67 HANDLE msg_event; /* Signaled for no empty queue */
70 static int EventsQueue_Init(EventsQueue* omr)
74 omr->msg_event = CreateEventW(NULL, TRUE, FALSE, NULL);
75 omr->ring_buffer_size = EVENTS_RING_BUFFER_INCREMENT;
76 omr->messages = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,omr->ring_buffer_size * sizeof(Event));
78 InitializeCriticalSection(&omr->msg_crst);
82 static int EventsQueue_Destroy(EventsQueue* omr)
84 CloseHandle(omr->msg_event);
85 HeapFree(GetProcessHeap(),0,omr->messages);
86 DeleteCriticalSection(&omr->msg_crst);
90 static int EventsQueue_PutEvent(EventsQueue* omr, Event* evt)
92 EnterCriticalSection(&omr->msg_crst);
93 if ((omr->msg_toget == ((omr->msg_tosave + 1) % omr->ring_buffer_size)))
95 int old_ring_buffer_size = omr->ring_buffer_size;
96 omr->ring_buffer_size += EVENTS_RING_BUFFER_INCREMENT;
97 TRACE("omr->ring_buffer_size=%d\n",omr->ring_buffer_size);
98 omr->messages = HeapReAlloc(GetProcessHeap(),0,omr->messages, omr->ring_buffer_size * sizeof(Event));
99 /* Now we need to rearrange the ring buffer so that the new
100 buffers just allocated are in between omr->msg_tosave and
103 if (omr->msg_tosave < omr->msg_toget)
105 memmove(&(omr->messages[omr->msg_toget + EVENTS_RING_BUFFER_INCREMENT]),
106 &(omr->messages[omr->msg_toget]),
107 sizeof(Event)*(old_ring_buffer_size - omr->msg_toget)
109 omr->msg_toget += EVENTS_RING_BUFFER_INCREMENT;
112 omr->messages[omr->msg_tosave] = *evt;
113 SetEvent(omr->msg_event);
114 omr->msg_tosave = (omr->msg_tosave + 1) % omr->ring_buffer_size;
115 LeaveCriticalSection(&omr->msg_crst);
119 static int EventsQueue_GetEvent(EventsQueue* omr, Event* evt, long msTimeOut)
121 if (WaitForSingleObject(omr->msg_event, msTimeOut) != WAIT_OBJECT_0)
124 EnterCriticalSection(&omr->msg_crst);
126 if (omr->msg_toget == omr->msg_tosave) /* buffer empty ? */
128 LeaveCriticalSection(&omr->msg_crst);
132 *evt = omr->messages[omr->msg_toget];
133 omr->msg_toget = (omr->msg_toget + 1) % omr->ring_buffer_size;
135 /* Mark the buffer as empty if needed */
136 if (omr->msg_toget == omr->msg_tosave) /* buffer empty ? */
137 ResetEvent(omr->msg_event);
139 LeaveCriticalSection(&omr->msg_crst);
143 typedef struct _IFilterGraphImpl {
144 IGraphBuilderVtbl *IGraphBuilder_vtbl;
145 IMediaControlVtbl *IMediaControl_vtbl;
146 IMediaSeekingVtbl *IMediaSeeking_vtbl;
147 IBasicAudioVtbl *IBasicAudio_vtbl;
148 IBasicVideoVtbl *IBasicVideo_vtbl;
149 IVideoWindowVtbl *IVideoWindow_vtbl;
150 IMediaEventExVtbl *IMediaEventEx_vtbl;
151 IMediaFilterVtbl *IMediaFilter_vtbl;
152 IMediaEventSinkVtbl *IMediaEventSink_vtbl;
153 /* IAMGraphStreams */
163 /* IRegisterServiceProvider */
164 /* IResourceMananger */
165 /* IServiceProvider */
166 /* IVideoFrameStep */
169 IFilterMapper2 * pFilterMapper2;
170 IBaseFilter ** ppFiltersInGraph;
171 LPWSTR * pFilterNames;
176 HANDLE hEventCompletion;
177 int CompletionStatus;
181 int HandleEcComplete;
188 static HRESULT Filtergraph_QueryInterface(IFilterGraphImpl *This,
191 TRACE("(%p)->(%s (%p), %p)\n", This, debugstr_guid(riid), riid, ppvObj);
193 if (IsEqualGUID(&IID_IUnknown, riid) ||
194 IsEqualGUID(&IID_IFilterGraph, riid) ||
195 IsEqualGUID(&IID_IGraphBuilder, riid)) {
196 *ppvObj = &(This->IGraphBuilder_vtbl);
197 TRACE(" returning IGraphBuilder interface (%p)\n", *ppvObj);
198 } else if (IsEqualGUID(&IID_IMediaControl, riid)) {
199 *ppvObj = &(This->IMediaControl_vtbl);
200 TRACE(" returning IMediaControl interface (%p)\n", *ppvObj);
201 } else if (IsEqualGUID(&IID_IMediaSeeking, riid)) {
202 *ppvObj = &(This->IMediaSeeking_vtbl);
203 TRACE(" returning IMediaSeeking interface (%p)\n", *ppvObj);
204 } else if (IsEqualGUID(&IID_IBasicAudio, riid)) {
205 *ppvObj = &(This->IBasicAudio_vtbl);
206 TRACE(" returning IBasicAudio interface (%p)\n", *ppvObj);
207 } else if (IsEqualGUID(&IID_IBasicVideo, riid)) {
208 *ppvObj = &(This->IBasicVideo_vtbl);
209 TRACE(" returning IBasicVideo interface (%p)\n", *ppvObj);
210 } else if (IsEqualGUID(&IID_IVideoWindow, riid)) {
211 *ppvObj = &(This->IVideoWindow_vtbl);
212 TRACE(" returning IVideoWindow interface (%p)\n", *ppvObj);
213 } else if (IsEqualGUID(&IID_IMediaEvent, riid) ||
214 IsEqualGUID(&IID_IMediaEventEx, riid)) {
215 *ppvObj = &(This->IMediaEventEx_vtbl);
216 TRACE(" returning IMediaEvent(Ex) interface (%p)\n", *ppvObj);
217 } else if (IsEqualGUID(&IID_IMediaFilter, riid) ||
218 IsEqualGUID(&IID_IPersist, riid)) {
219 *ppvObj = &(This->IMediaFilter_vtbl);
220 TRACE(" returning IMediaFilter interface (%p)\n", *ppvObj);
221 } else if (IsEqualGUID(&IID_IMediaEventSink, riid)) {
222 *ppvObj = &(This->IMediaEventSink_vtbl);
223 TRACE(" returning IMediaEventSink interface (%p)\n", *ppvObj);
226 FIXME("unknown interface %s\n", debugstr_guid(riid));
227 return E_NOINTERFACE;
230 InterlockedIncrement(&This->ref);
234 static ULONG Filtergraph_AddRef(IFilterGraphImpl *This) {
235 ULONG ref = InterlockedIncrement(&This->ref);
237 TRACE("(%p)->(): new ref = %ld\n", This, ref);
242 static ULONG Filtergraph_Release(IFilterGraphImpl *This) {
243 ULONG ref = InterlockedDecrement(&This->ref);
245 TRACE("(%p)->(): new ref = %ld\n", This, ref);
249 for (i = 0; i < This->nFilters; i++)
250 IBaseFilter_Release(This->ppFiltersInGraph[i]);
251 IFilterMapper2_Release(This->pFilterMapper2);
252 CloseHandle(This->hEventCompletion);
253 EventsQueue_Destroy(&This->evqueue);
254 DeleteCriticalSection(&This->cs);
255 HeapFree(GetProcessHeap(), 0, This->ppFiltersInGraph);
256 HeapFree(GetProcessHeap(), 0, This->pFilterNames);
257 HeapFree(GetProcessHeap(), 0, This);
263 /*** IUnknown methods ***/
264 static HRESULT WINAPI Graphbuilder_QueryInterface(IGraphBuilder *iface,
267 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
269 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
270 return Filtergraph_QueryInterface(This, riid, ppvObj);
273 static ULONG WINAPI Graphbuilder_AddRef(IGraphBuilder *iface) {
274 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
276 TRACE("(%p/%p)->() calling FilterGraph AddRef\n", This, iface);
278 return Filtergraph_AddRef(This);
281 static ULONG WINAPI Graphbuilder_Release(IGraphBuilder *iface) {
282 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
284 TRACE("(%p/%p)->() calling FilterGraph Release\n", This, iface);
286 return Filtergraph_Release(This);
289 /*** IFilterGraph methods ***/
290 static HRESULT WINAPI Graphbuilder_AddFilter(IGraphBuilder *iface,
291 IBaseFilter *pFilter,
293 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
296 WCHAR* wszFilterName = NULL;
297 int duplicate_name = FALSE;
299 TRACE("(%p/%p)->(%p, %s (%p))\n", This, iface, pFilter, debugstr_w(pName), pName);
301 wszFilterName = (WCHAR*) CoTaskMemAlloc( (pName ? strlenW(pName) + 6 : 5) * sizeof(WCHAR) );
305 /* Check if name already exists */
306 for(i = 0; i < This->nFilters; i++)
307 if (!strcmpW(This->pFilterNames[i], pName))
309 duplicate_name = TRUE;
314 /* If no name given or name already existing, generate one */
315 if (!pName || duplicate_name)
317 static const WCHAR wszFmt1[] = {'%','s',' ','%','0','4','d',0};
318 static const WCHAR wszFmt2[] = {'%','0','4','d',0};
320 for (j = 0; j < 10000 ; j++)
324 sprintfW(wszFilterName, wszFmt1, pName, This->nameIndex);
326 sprintfW(wszFilterName, wszFmt2, This->nameIndex);
327 TRACE("Generated name %s\n", debugstr_w(wszFilterName));
329 /* Check if the generated name already exists */
330 for(i = 0; i < This->nFilters; i++)
331 if (!strcmpW(This->pFilterNames[i], wszFilterName))
334 /* Compute next index and exit if generated name is suitable */
335 if (This->nameIndex++ == 10000)
337 if (i == This->nFilters)
340 /* Unable to find a suitable name */
343 CoTaskMemFree(wszFilterName);
344 return VFW_E_DUPLICATE_NAME;
348 memcpy(wszFilterName, pName, (strlenW(pName) + 1) * sizeof(WCHAR));
350 if (This->nFilters + 1 > This->filterCapacity)
352 int newCapacity = 2*This->filterCapacity;
353 IBaseFilter ** ppNewFilters = CoTaskMemAlloc(newCapacity * sizeof(IBaseFilter*));
354 LPWSTR * pNewNames = CoTaskMemAlloc(newCapacity * sizeof(LPWSTR));
355 memcpy(ppNewFilters, This->ppFiltersInGraph, This->nFilters * sizeof(IBaseFilter*));
356 memcpy(pNewNames, This->pFilterNames, This->nFilters * sizeof(LPWSTR));
357 CoTaskMemFree(This->ppFiltersInGraph);
358 CoTaskMemFree(This->pFilterNames);
359 This->ppFiltersInGraph = ppNewFilters;
360 This->pFilterNames = pNewNames;
361 This->filterCapacity = newCapacity;
364 hr = IBaseFilter_JoinFilterGraph(pFilter, (IFilterGraph *)This, wszFilterName);
368 IBaseFilter_AddRef(pFilter);
369 This->ppFiltersInGraph[This->nFilters] = pFilter;
370 This->pFilterNames[This->nFilters] = wszFilterName;
374 CoTaskMemFree(wszFilterName);
376 if (SUCCEEDED(hr) && duplicate_name)
377 return VFW_S_DUPLICATE_NAME;
382 static HRESULT WINAPI Graphbuilder_RemoveFilter(IGraphBuilder *iface,
383 IBaseFilter *pFilter) {
384 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
388 TRACE("(%p/%p)->(%p)\n", This, iface, pFilter);
390 /* FIXME: check graph is stopped */
392 for (i = 0; i < This->nFilters; i++)
394 if (This->ppFiltersInGraph[i] == pFilter)
396 /* FIXME: disconnect pins */
397 hr = IBaseFilter_JoinFilterGraph(pFilter, NULL, This->pFilterNames[i]);
400 IPin_Release(pFilter);
401 CoTaskMemFree(This->pFilterNames[i]);
402 memmove(This->ppFiltersInGraph+i, This->ppFiltersInGraph+i+1, sizeof(IBaseFilter*)*(This->nFilters - 1 - i));
403 memmove(This->pFilterNames+i, This->pFilterNames+i+1, sizeof(LPWSTR)*(This->nFilters - 1 - i));
411 return hr; /* FIXME: check this error code */
414 static HRESULT WINAPI Graphbuilder_EnumFilters(IGraphBuilder *iface,
415 IEnumFilters **ppEnum) {
416 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
418 TRACE("(%p/%p)->(%p)\n", This, iface, ppEnum);
420 return IEnumFiltersImpl_Construct(This->ppFiltersInGraph, This->nFilters, ppEnum);
423 static HRESULT WINAPI Graphbuilder_FindFilterByName(IGraphBuilder *iface,
425 IBaseFilter **ppFilter) {
426 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
429 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_w(pName), pName, ppFilter);
433 for (i = 0; i < This->nFilters; i++)
435 if (!strcmpW(pName, This->pFilterNames[i]))
437 *ppFilter = This->ppFiltersInGraph[i];
438 IBaseFilter_AddRef(*ppFilter);
443 return E_FAIL; /* FIXME: check this error code */
446 /* NOTE: despite the implication, it doesn't matter which
447 * way round you put in the input and output pins */
448 static HRESULT WINAPI Graphbuilder_ConnectDirect(IGraphBuilder *iface,
451 const AM_MEDIA_TYPE *pmt) {
455 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
457 TRACE("(%p/%p)->(%p, %p, %p)\n", This, iface, ppinIn, ppinOut, pmt);
459 /* FIXME: check pins are in graph */
461 hr = IPin_QueryDirection(ppinIn, &dir);
464 if (dir == PINDIR_INPUT)
465 hr = IPin_Connect(ppinOut, ppinIn, pmt);
467 hr = IPin_Connect(ppinIn, ppinOut, pmt);
473 static HRESULT WINAPI Graphbuilder_Reconnect(IGraphBuilder *iface,
475 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
476 IPin *pConnectedTo = NULL;
478 PIN_DIRECTION pindir;
480 IPin_QueryDirection(ppin, &pindir);
481 hr = IPin_ConnectedTo(ppin, &pConnectedTo);
483 TRACE("Querying connected to failed: %lx\n", hr);
486 IPin_Disconnect(ppin);
487 IPin_Disconnect(pConnectedTo);
488 if (pindir == PINDIR_INPUT)
489 hr = IPin_Connect(pConnectedTo, ppin, NULL);
491 hr = IPin_Connect(ppin, pConnectedTo, NULL);
492 IPin_Release(pConnectedTo);
494 ERR("Reconnecting pins failed, pins are not connected now..\n");
495 TRACE("(%p->%p) -- %p %p -> %lx\n", iface, This, ppin, pConnectedTo, hr);
499 static HRESULT WINAPI Graphbuilder_Disconnect(IGraphBuilder *iface,
501 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
503 TRACE("(%p/%p)->(%p)\n", This, iface, ppin);
505 return IPin_Disconnect(ppin);
508 static HRESULT WINAPI Graphbuilder_SetDefaultSyncSource(IGraphBuilder *iface) {
509 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
511 TRACE("(%p/%p)->(): stub !!!\n", iface, This);
516 static HRESULT GetFilterInfo(IMoniker* pMoniker, GUID* pclsid, VARIANT* pvar)
518 static const WCHAR wszClsidName[] = {'C','L','S','I','D',0};
519 static const WCHAR wszFriendlyName[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
520 IPropertyBag * pPropBagCat = NULL;
524 V_VT(pvar) = VT_BSTR;
526 hr = IMoniker_BindToStorage(pMoniker, NULL, NULL, &IID_IPropertyBag, (LPVOID*)&pPropBagCat);
529 hr = IPropertyBag_Read(pPropBagCat, wszClsidName, pvar, NULL);
532 hr = CLSIDFromString(V_UNION(pvar, bstrVal), pclsid);
535 hr = IPropertyBag_Read(pPropBagCat, wszFriendlyName, pvar, NULL);
538 TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid), debugstr_w(V_UNION(pvar, bstrVal)));
541 IPropertyBag_Release(pPropBagCat);
546 static HRESULT GetInternalConnections(IBaseFilter* pfilter, IPin* pinputpin, IPin*** pppins, ULONG* pnb)
551 TRACE("(%p, %p, %p, %p)\n", pfilter, pinputpin, pppins, pnb);
552 hr = IPin_QueryInternalConnections(pinputpin, NULL, &nb);
555 } else if (hr == S_FALSE) {
556 *pppins = CoTaskMemAlloc(sizeof(IPin*)*nb);
557 hr = IPin_QueryInternalConnections(pinputpin, *pppins, &nb);
559 ERR("Error (%lx)\n", hr);
561 } else if (hr == E_NOTIMPL) {
562 /* Input connected to all outputs */
563 IEnumPins* penumpins;
566 TRACE("E_NOTIMPL\n");
567 hr = IBaseFilter_EnumPins(pfilter, &penumpins);
569 ERR("filter Enumpins failed (%lx)\n", hr);
573 /* Count output pins */
574 while(IEnumPins_Next(penumpins, 1, &ppin, &nb) == S_OK) {
575 PIN_DIRECTION pindir;
576 IPin_QueryDirection(ppin, &pindir);
577 if (pindir == PINDIR_OUTPUT)
581 *pppins = CoTaskMemAlloc(sizeof(IPin*)*i);
582 /* Retrieve output pins */
583 IEnumPins_Reset(penumpins);
585 while(IEnumPins_Next(penumpins, 1, &ppin, &nb) == S_OK) {
586 PIN_DIRECTION pindir;
587 IPin_QueryDirection(ppin, &pindir);
588 if (pindir == PINDIR_OUTPUT)
589 (*pppins)[i++] = ppin;
595 ERR("Next failed (%lx)\n", hr);
598 IEnumPins_Release(penumpins);
599 } else if (FAILED(hr)) {
600 ERR("Cannot get internal connection (%lx)\n", hr);
608 /*** IGraphBuilder methods ***/
609 static HRESULT WINAPI Graphbuilder_Connect(IGraphBuilder *iface,
612 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
615 IEnumMediaTypes* penummt;
617 IEnumPins* penumpins;
618 IEnumMoniker* pEnumMoniker;
624 TRACE("(%p/%p)->(%p, %p)\n", This, iface, ppinOut, ppinIn);
626 /* Try direct connection first */
627 hr = IPin_Connect(ppinOut, ppinIn, NULL);
631 TRACE("Direct connection failed, trying to insert other filters\n");
633 /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream
634 * filter to the minor mediatype of input pin of the renderer */
635 hr = IPin_EnumMediaTypes(ppinOut, &penummt);
637 ERR("EnumMediaTypes (%lx)\n", hr);
641 hr = IEnumMediaTypes_Next(penummt, 1, &mt, &nbmt);
643 ERR("IEnumMediaTypes_Next (%lx)\n", hr);
648 ERR("No media type found!\n");
651 TRACE("MajorType %s\n", debugstr_guid(&mt->majortype));
652 TRACE("SubType %s\n", debugstr_guid(&mt->subtype));
654 /* Try to find a suitable filter that can connect to the pin to render */
655 tab[0] = mt->majortype;
656 tab[1] = mt->subtype;
657 hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, FALSE, FALSE, 0, NULL, NULL, NULL);
659 ERR("Unable to enum filters (%lx)\n", hr);
663 while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
668 IPin* ppinfilter = NULL;
669 IBaseFilter* pfilter = NULL;
671 hr = GetFilterInfo(pMoniker, &clsid, &var);
672 IMoniker_Release(pMoniker);
674 ERR("Unable to retrieve filter info (%lx)\n", hr);
678 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&pfilter);
680 ERR("Unable to create filter (%lx), trying next one\n", hr);
684 hr = IGraphBuilder_AddFilter(iface, pfilter, NULL);
686 ERR("Unable to add filter (%lx)\n", hr);
687 IBaseFilter_Release(pfilter);
692 hr = IBaseFilter_EnumPins(pfilter, &penumpins);
694 ERR("Enumpins (%lx)\n", hr);
698 hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin);
700 ERR("Next (%lx)\n", hr);
707 IEnumPins_Release(penumpins);
709 hr = IPin_Connect(ppinOut, ppinfilter, NULL);
711 TRACE("Cannot connect to filter (%lx), trying next one\n", hr);
714 TRACE("Successfully connected to filter, follow chain...\n");
716 /* Render all output pins of the filter by calling IGraphBuilder_Render on each of them */
717 hr = GetInternalConnections(pfilter, ppinfilter, &ppins, &nb);
721 TRACE("pins to consider: %ld\n", nb);
722 for(i = 0; i < nb; i++) {
723 TRACE("Processing pin %d\n", i);
724 hr = IGraphBuilder_Connect(iface, ppins[i], ppinIn);
726 TRACE("Cannot render pin %p (%lx)\n", ppinfilter, hr);
728 IPin_Release(ppins[i]);
729 if (SUCCEEDED(hr)) break;
731 while (++i < nb) IPin_Release(ppins[i]);
732 CoTaskMemFree(ppins);
733 IBaseFilter_Release(pfilter);
734 IPin_Release(ppinfilter);
739 if (ppinfilter) IPin_Release(ppinfilter);
741 IGraphBuilder_RemoveFilter(iface, pfilter);
742 IBaseFilter_Release(pfilter);
746 IEnumMediaTypes_Release(penummt);
752 static HRESULT WINAPI Graphbuilder_Render(IGraphBuilder *iface,
754 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
755 IEnumMediaTypes* penummt;
760 IEnumMoniker* pEnumMoniker;
765 TRACE("(%p/%p)->(%p)\n", This, iface, ppinOut);
767 hr = IPin_EnumMediaTypes(ppinOut, &penummt);
769 ERR("EnumMediaTypes (%lx)\n", hr);
775 hr = IEnumMediaTypes_Next(penummt, 1, &mt, &nbmt);
777 ERR("IEnumMediaTypes_Next (%lx)\n", hr);
782 TRACE("MajorType %s\n", debugstr_guid(&mt->majortype));
783 TRACE("SubType %s\n", debugstr_guid(&mt->subtype));
785 /* Try to find a suitable renderer with the same media type */
786 tab[0] = mt->majortype;
788 hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, TRUE, FALSE, 0, NULL, NULL, NULL);
790 ERR("Unable to enum filters (%lx)\n", hr);
794 while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
799 IBaseFilter* pfilter = NULL;
800 IEnumPins* penumpins;
803 hr = GetFilterInfo(pMoniker, &clsid, &var);
804 IMoniker_Release(pMoniker);
806 ERR("Unable to retrieve filter info (%lx)\n", hr);
810 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&pfilter);
812 ERR("Unable to create filter (%lx), trying next one\n", hr);
816 hr = IGraphBuilder_AddFilter(iface, pfilter, NULL);
818 ERR("Unable to add filter (%lx)\n", hr);
819 IBaseFilter_Release(pfilter);
824 hr = IBaseFilter_EnumPins(pfilter, &penumpins);
826 ERR("Splitter Enumpins (%lx)\n", hr);
829 hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin);
831 ERR("Next (%lx)\n", hr);
838 IEnumPins_Release(penumpins);
840 /* Connect the pin to render to the renderer */
841 hr = IGraphBuilder_Connect(iface, ppinOut, ppinfilter);
843 TRACE("Unable to connect to renderer (%lx)\n", hr);
850 IGraphBuilder_RemoveFilter(iface, pfilter);
851 IBaseFilter_Release(pfilter);
859 IEnumMediaTypes_Release(penummt);
864 static HRESULT WINAPI Graphbuilder_RenderFile(IGraphBuilder *iface,
866 LPCWSTR lpcwstrPlayList) {
867 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
868 static const WCHAR string[] = {'R','e','a','d','e','r',0};
869 IBaseFilter* preader = NULL;
870 IBaseFilter* psplitter;
873 IEnumPins* penumpins;
876 IEnumMoniker* pEnumMoniker;
881 IFileSourceFilter* pfile = NULL;
885 TRACE("(%p/%p)->(%s, %s)\n", This, iface, debugstr_w(lpcwstrFile), debugstr_w(lpcwstrPlayList));
887 hr = IGraphBuilder_AddSourceFilter(iface, lpcwstrFile, string, &preader);
889 /* Retrieve file media type */
891 hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter, (LPVOID*)&pfile);
893 hr = IFileSourceFilter_GetCurFile(pfile, &filename, &mt);
894 IFileSourceFilter_Release(pfile);
898 tab[0] = mt.majortype;
900 hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, FALSE, FALSE, 0, NULL, NULL, NULL);
906 IGraphBuilder_RemoveFilter(iface, preader);
907 IBaseFilter_Release(preader);
913 while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
918 hr = GetFilterInfo(pMoniker, &clsid, &var);
919 IMoniker_Release(pMoniker);
921 ERR("Unable to retrieve filter info (%lx)\n", hr);
925 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&psplitter);
927 ERR("Unable to create filter (%lx), trying next one\n", hr);
931 hr = IGraphBuilder_AddFilter(iface, psplitter, NULL);
933 ERR("Unable add filter (%lx)\n", hr);
937 /* Connect file source and splitter filters together */
938 /* Make the splitter analyze incoming data */
939 hr = IBaseFilter_EnumPins(preader, &penumpins);
941 ERR("Enumpins (%lx)\n", hr);
944 hr = IEnumPins_Next(penumpins, 1, &ppinreader, &pin);
946 ERR("Next (%lx)\n", hr);
953 IEnumPins_Release(penumpins);
955 hr = IBaseFilter_EnumPins(psplitter, &penumpins);
957 ERR("Splitter Enumpins (%lx)\n", hr);
960 hr = IEnumPins_Next(penumpins, 1, &ppinsplitter, &pin);
962 ERR("Next (%lx)\n", hr);
969 IEnumPins_Release(penumpins);
971 hr = IPin_Connect(ppinreader, ppinsplitter, NULL);
973 IBaseFilter_Release(ppinsplitter);
975 TRACE("Cannot connect to filter (%lx), trying next one\n", hr);
978 TRACE("Successfully connected to filter\n");
982 /* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
984 hr = GetInternalConnections(psplitter, ppinsplitter, &ppins, &nb);
988 TRACE("pins to consider: %ld\n", nb);
989 for(i = 0; i < nb; i++) {
990 TRACE("Processing pin %d\n", i);
991 hr = IGraphBuilder_Render(iface, ppins[i]);
993 ERR("Cannot render pin %p (%lx)\n", ppins[i], hr);
994 /* FIXME: We should clean created things properly */
998 CoTaskMemFree(ppins);
1004 static HRESULT WINAPI Graphbuilder_AddSourceFilter(IGraphBuilder *iface,
1005 LPCWSTR lpcwstrFileName,
1006 LPCWSTR lpcwstrFilterName,
1007 IBaseFilter **ppFilter) {
1008 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1010 IBaseFilter* preader;
1011 IFileSourceFilter* pfile = NULL;
1015 TRACE("(%p/%p)->(%s, %s, %p)\n", This, iface, debugstr_w(lpcwstrFileName), debugstr_w(lpcwstrFilterName), ppFilter);
1017 /* Instantiate a file source filter */
1018 hr = CoCreateInstance(&CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&preader);
1020 ERR("Unable to create file source filter (%lx)\n", hr);
1024 hr = IGraphBuilder_AddFilter(iface, preader, lpcwstrFilterName);
1026 ERR("Unable add filter (%lx)\n", hr);
1027 IBaseFilter_Release(preader);
1031 hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter, (LPVOID*)&pfile);
1033 ERR("Unable to get IFileSourceInterface (%lx)\n", hr);
1037 /* Load the file in the file source filter */
1038 hr = IFileSourceFilter_Load(pfile, lpcwstrFileName, NULL);
1040 ERR("Load (%lx)\n", hr);
1044 IFileSourceFilter_GetCurFile(pfile, &filename, &mt);
1046 ERR("GetCurFile (%lx)\n", hr);
1049 TRACE("File %s\n", debugstr_w(filename));
1050 TRACE("MajorType %s\n", debugstr_guid(&mt.majortype));
1051 TRACE("SubType %s\n", debugstr_guid(&mt.subtype));
1054 *ppFilter = preader;
1060 IFileSourceFilter_Release(pfile);
1061 IGraphBuilder_RemoveFilter(iface, preader);
1062 IBaseFilter_Release(preader);
1067 static HRESULT WINAPI Graphbuilder_SetLogFile(IGraphBuilder *iface,
1069 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1071 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) hFile);
1076 static HRESULT WINAPI Graphbuilder_Abort(IGraphBuilder *iface) {
1077 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1079 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1084 static HRESULT WINAPI Graphbuilder_ShouldOperationContinue(IGraphBuilder *iface) {
1085 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1087 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1093 static IGraphBuilderVtbl IGraphBuilder_VTable =
1095 Graphbuilder_QueryInterface,
1096 Graphbuilder_AddRef,
1097 Graphbuilder_Release,
1098 Graphbuilder_AddFilter,
1099 Graphbuilder_RemoveFilter,
1100 Graphbuilder_EnumFilters,
1101 Graphbuilder_FindFilterByName,
1102 Graphbuilder_ConnectDirect,
1103 Graphbuilder_Reconnect,
1104 Graphbuilder_Disconnect,
1105 Graphbuilder_SetDefaultSyncSource,
1106 Graphbuilder_Connect,
1107 Graphbuilder_Render,
1108 Graphbuilder_RenderFile,
1109 Graphbuilder_AddSourceFilter,
1110 Graphbuilder_SetLogFile,
1112 Graphbuilder_ShouldOperationContinue
1115 /*** IUnknown methods ***/
1116 static HRESULT WINAPI Mediacontrol_QueryInterface(IMediaControl *iface,
1119 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1121 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1123 return Filtergraph_QueryInterface(This, riid, ppvObj);
1126 static ULONG WINAPI Mediacontrol_AddRef(IMediaControl *iface) {
1127 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1129 TRACE("(%p/%p)->()\n", This, iface);
1131 return Filtergraph_AddRef(This);
1134 static ULONG WINAPI Mediacontrol_Release(IMediaControl *iface) {
1135 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1137 TRACE("(%p/%p)->()\n", This, iface);
1139 return Filtergraph_Release(This);
1143 /*** IDispatch methods ***/
1144 static HRESULT WINAPI Mediacontrol_GetTypeInfoCount(IMediaControl *iface,
1146 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1148 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1153 static HRESULT WINAPI Mediacontrol_GetTypeInfo(IMediaControl *iface,
1156 ITypeInfo**ppTInfo) {
1157 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1159 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1164 static HRESULT WINAPI Mediacontrol_GetIDsOfNames(IMediaControl *iface,
1170 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1172 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1177 static HRESULT WINAPI Mediacontrol_Invoke(IMediaControl *iface,
1178 DISPID dispIdMember,
1182 DISPPARAMS*pDispParams,
1184 EXCEPINFO*pExepInfo,
1186 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1188 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);
1193 typedef HRESULT(WINAPI *fnFoundFilter)(IBaseFilter *);
1195 static HRESULT ExploreGraph(IFilterGraphImpl* pGraph, IPin* pOutputPin, fnFoundFilter FoundFilter)
1204 TRACE("%p %p\n", pGraph, pOutputPin);
1205 PinInfo.pFilter = NULL;
1207 hr = IPin_ConnectedTo(pOutputPin, &pInputPin);
1210 hr = IPin_QueryPinInfo(pInputPin, &PinInfo);
1213 hr = GetInternalConnections(PinInfo.pFilter, pInputPin, &ppPins, &nb);
1219 TRACE("Reached a renderer\n");
1220 /* Count renderers for end of stream notification */
1221 pGraph->nRenderers++;
1225 for(i = 0; i < nb; i++)
1227 /* Explore the graph downstream from this pin
1228 * FIXME: We should prevent exploring from a pin more than once. This can happens when
1229 * several input pins are connected to the same output (a MUX for instance). */
1230 ExploreGraph(pGraph, ppPins[i], FoundFilter);
1231 IPin_Release(ppPins[i]);
1234 CoTaskMemFree(ppPins);
1236 TRACE("Doing stuff with filter %p\n", PinInfo.pFilter);
1237 FoundFilter(PinInfo.pFilter);
1240 if (PinInfo.pFilter) IBaseFilter_Release(PinInfo.pFilter);
1244 static HRESULT WINAPI SendRun(IBaseFilter *pFilter) {
1245 return IBaseFilter_Run(pFilter, 0);
1248 static HRESULT WINAPI SendPause(IBaseFilter *pFilter) {
1249 return IBaseFilter_Pause(pFilter);
1252 static HRESULT WINAPI SendStop(IBaseFilter *pFilter) {
1253 return IBaseFilter_Stop(pFilter);
1256 static HRESULT SendFilterMessage(IMediaControl *iface, fnFoundFilter FoundFilter) {
1257 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1259 IBaseFilter* pfilter;
1265 TRACE("(%p/%p)->()\n", This, iface);
1267 /* Explorer the graph from source filters to renderers, determine renderers
1268 * number and run filters from renderers to source filters */
1269 This->nRenderers = 0;
1270 ResetEvent(This->hEventCompletion);
1272 for(i = 0; i < This->nFilters; i++)
1275 pfilter = This->ppFiltersInGraph[i];
1276 hr = IBaseFilter_EnumPins(pfilter, &pEnum);
1279 ERR("Enum pins failed %lx\n", hr);
1282 /* Check if it is a source filter */
1283 while(IEnumPins_Next(pEnum, 1, &pPin, &dummy) == S_OK)
1285 IPin_QueryDirection(pPin, &dir);
1287 if (dir == PINDIR_INPUT)
1295 TRACE("Found a source filter\n");
1296 IEnumPins_Reset(pEnum);
1297 while(IEnumPins_Next(pEnum, 1, &pPin, &dummy) == S_OK)
1299 /* Explore the graph downstream from this pin */
1300 ExploreGraph(This, pPin, FoundFilter);
1303 FoundFilter(pfilter);
1305 IEnumPins_Release(pEnum);
1311 /*** IMediaControl methods ***/
1312 static HRESULT WINAPI Mediacontrol_Run(IMediaControl *iface) {
1313 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1314 TRACE("(%p/%p)->()\n", This, iface);
1316 if (This->state == State_Running) return S_OK;
1318 EnterCriticalSection(&This->cs);
1319 SendFilterMessage(iface, SendRun);
1320 This->state = State_Running;
1321 LeaveCriticalSection(&This->cs);
1325 static HRESULT WINAPI Mediacontrol_Pause(IMediaControl *iface) {
1326 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1327 TRACE("(%p/%p)->()\n", This, iface);
1329 if (This->state == State_Paused) return S_OK;
1331 EnterCriticalSection(&This->cs);
1332 SendFilterMessage(iface, SendPause);
1333 This->state = State_Paused;
1334 LeaveCriticalSection(&This->cs);
1338 static HRESULT WINAPI Mediacontrol_Stop(IMediaControl *iface) {
1339 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1340 TRACE("(%p/%p)->()\n", This, iface);
1342 if (This->state == State_Stopped) return S_OK;
1344 EnterCriticalSection(&This->cs);
1345 if (This->state == State_Running) SendFilterMessage(iface, SendPause);
1346 SendFilterMessage(iface, SendStop);
1347 This->state = State_Stopped;
1348 LeaveCriticalSection(&This->cs);
1352 static HRESULT WINAPI Mediacontrol_GetState(IMediaControl *iface,
1354 OAFilterState *pfs) {
1355 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1357 TRACE("(%p/%p)->(%ld, %p): semi-stub !!!\n", This, iface, msTimeout, pfs);
1359 EnterCriticalSection(&This->cs);
1363 LeaveCriticalSection(&This->cs);
1368 static HRESULT WINAPI Mediacontrol_RenderFile(IMediaControl *iface,
1370 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1372 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This, iface, debugstr_w(strFilename), strFilename);
1377 static HRESULT WINAPI Mediacontrol_AddSourceFilter(IMediaControl *iface,
1379 IDispatch **ppUnk) {
1380 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1382 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This, iface, debugstr_w(strFilename), strFilename, ppUnk);
1387 static HRESULT WINAPI Mediacontrol_get_FilterCollection(IMediaControl *iface,
1388 IDispatch **ppUnk) {
1389 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1391 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppUnk);
1396 static HRESULT WINAPI Mediacontrol_get_RegFilterCollection(IMediaControl *iface,
1397 IDispatch **ppUnk) {
1398 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1400 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppUnk);
1405 static HRESULT WINAPI Mediacontrol_StopWhenReady(IMediaControl *iface) {
1406 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1408 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1414 static IMediaControlVtbl IMediaControl_VTable =
1416 Mediacontrol_QueryInterface,
1417 Mediacontrol_AddRef,
1418 Mediacontrol_Release,
1419 Mediacontrol_GetTypeInfoCount,
1420 Mediacontrol_GetTypeInfo,
1421 Mediacontrol_GetIDsOfNames,
1422 Mediacontrol_Invoke,
1426 Mediacontrol_GetState,
1427 Mediacontrol_RenderFile,
1428 Mediacontrol_AddSourceFilter,
1429 Mediacontrol_get_FilterCollection,
1430 Mediacontrol_get_RegFilterCollection,
1431 Mediacontrol_StopWhenReady
1435 /*** IUnknown methods ***/
1436 static HRESULT WINAPI Mediaseeking_QueryInterface(IMediaSeeking *iface,
1439 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1441 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1443 return Filtergraph_QueryInterface(This, riid, ppvObj);
1446 static ULONG WINAPI Mediaseeking_AddRef(IMediaSeeking *iface) {
1447 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1449 TRACE("(%p/%p)->()\n", This, iface);
1451 return Filtergraph_AddRef(This);
1454 static ULONG WINAPI Mediaseeking_Release(IMediaSeeking *iface) {
1455 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1457 TRACE("(%p/%p)->()\n", This, iface);
1459 return Filtergraph_Release(This);
1462 /*** IMediaSeeking methods ***/
1463 static HRESULT WINAPI Mediaseeking_GetCapabilities(IMediaSeeking *iface,
1464 DWORD *pCapabilities) {
1465 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1467 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCapabilities);
1472 static HRESULT WINAPI Mediaseeking_CheckCapabilities(IMediaSeeking *iface,
1473 DWORD *pCapabilities) {
1474 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1476 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCapabilities);
1481 static HRESULT WINAPI Mediaseeking_IsFormatSupported(IMediaSeeking *iface,
1482 const GUID *pFormat) {
1483 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1485 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1490 static HRESULT WINAPI Mediaseeking_QueryPreferredFormat(IMediaSeeking *iface,
1492 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1494 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1499 static HRESULT WINAPI Mediaseeking_GetTimeFormat(IMediaSeeking *iface,
1501 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1503 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1508 static HRESULT WINAPI Mediaseeking_IsUsingTimeFormat(IMediaSeeking *iface,
1509 const GUID *pFormat) {
1510 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1512 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1517 static HRESULT WINAPI Mediaseeking_SetTimeFormat(IMediaSeeking *iface,
1518 const GUID *pFormat) {
1519 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1521 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1526 static HRESULT WINAPI Mediaseeking_GetDuration(IMediaSeeking *iface,
1527 LONGLONG *pDuration) {
1528 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1530 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDuration);
1535 static HRESULT WINAPI Mediaseeking_GetStopPosition(IMediaSeeking *iface,
1537 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1539 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pStop);
1544 static HRESULT WINAPI Mediaseeking_GetCurrentPosition(IMediaSeeking *iface,
1545 LONGLONG *pCurrent) {
1546 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1548 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCurrent);
1553 static HRESULT WINAPI Mediaseeking_ConvertTimeFormat(IMediaSeeking *iface,
1555 const GUID *pTargetFormat,
1557 const GUID *pSourceFormat) {
1558 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1560 TRACE("(%p/%p)->(%p, %p, %lld, %p): stub !!!\n", This, iface, pTarget, pTargetFormat, Source, pSourceFormat);
1565 static HRESULT WINAPI Mediaseeking_SetPositions(IMediaSeeking *iface,
1567 DWORD dwCurrentFlags,
1569 DWORD dwStopFlags) {
1570 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1572 TRACE("(%p/%p)->(%p, %08lx, %p, %08lx): stub !!!\n", This, iface, pCurrent, dwCurrentFlags, pStop, dwStopFlags);
1577 static HRESULT WINAPI Mediaseeking_GetPositions(IMediaSeeking *iface,
1580 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1582 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pCurrent, pStop);
1587 static HRESULT WINAPI Mediaseeking_GetAvailable(IMediaSeeking *iface,
1588 LONGLONG *pEarliest,
1589 LONGLONG *pLatest) {
1590 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1592 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pEarliest, pLatest);
1597 static HRESULT WINAPI Mediaseeking_SetRate(IMediaSeeking *iface,
1599 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1601 TRACE("(%p/%p)->(%f): stub !!!\n", This, iface, dRate);
1606 static HRESULT WINAPI Mediaseeking_GetRate(IMediaSeeking *iface,
1608 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1610 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pdRate);
1615 static HRESULT WINAPI Mediaseeking_GetPreroll(IMediaSeeking *iface,
1616 LONGLONG *pllPreroll) {
1617 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1619 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pllPreroll);
1625 static IMediaSeekingVtbl IMediaSeeking_VTable =
1627 Mediaseeking_QueryInterface,
1628 Mediaseeking_AddRef,
1629 Mediaseeking_Release,
1630 Mediaseeking_GetCapabilities,
1631 Mediaseeking_CheckCapabilities,
1632 Mediaseeking_IsFormatSupported,
1633 Mediaseeking_QueryPreferredFormat,
1634 Mediaseeking_GetTimeFormat,
1635 Mediaseeking_IsUsingTimeFormat,
1636 Mediaseeking_SetTimeFormat,
1637 Mediaseeking_GetDuration,
1638 Mediaseeking_GetStopPosition,
1639 Mediaseeking_GetCurrentPosition,
1640 Mediaseeking_ConvertTimeFormat,
1641 Mediaseeking_SetPositions,
1642 Mediaseeking_GetPositions,
1643 Mediaseeking_GetAvailable,
1644 Mediaseeking_SetRate,
1645 Mediaseeking_GetRate,
1646 Mediaseeking_GetPreroll
1649 /*** IUnknown methods ***/
1650 static HRESULT WINAPI Basicaudio_QueryInterface(IBasicAudio *iface,
1653 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1655 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1657 return Filtergraph_QueryInterface(This, riid, ppvObj);
1660 static ULONG WINAPI Basicaudio_AddRef(IBasicAudio *iface) {
1661 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1663 TRACE("(%p/%p)->()\n", This, iface);
1665 return Filtergraph_AddRef(This);
1668 static ULONG WINAPI Basicaudio_Release(IBasicAudio *iface) {
1669 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1671 TRACE("(%p/%p)->()\n", This, iface);
1673 return Filtergraph_Release(This);
1676 /*** IDispatch methods ***/
1677 static HRESULT WINAPI Basicaudio_GetTypeInfoCount(IBasicAudio *iface,
1679 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1681 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1686 static HRESULT WINAPI Basicaudio_GetTypeInfo(IBasicAudio *iface,
1689 ITypeInfo**ppTInfo) {
1690 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1692 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1697 static HRESULT WINAPI Basicaudio_GetIDsOfNames(IBasicAudio *iface,
1703 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1705 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1710 static HRESULT WINAPI Basicaudio_Invoke(IBasicAudio *iface,
1711 DISPID dispIdMember,
1715 DISPPARAMS*pDispParams,
1717 EXCEPINFO*pExepInfo,
1719 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1721 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);
1726 /*** IBasicAudio methods ***/
1727 static HRESULT WINAPI Basicaudio_put_Volume(IBasicAudio *iface,
1729 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1731 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lVolume);
1736 static HRESULT WINAPI Basicaudio_get_Volume(IBasicAudio *iface,
1738 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1740 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plVolume);
1745 static HRESULT WINAPI Basicaudio_put_Balance(IBasicAudio *iface,
1747 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1749 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lBalance);
1754 static HRESULT WINAPI Basicaudio_get_Balance(IBasicAudio *iface,
1756 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1758 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plBalance);
1763 static IBasicAudioVtbl IBasicAudio_VTable =
1765 Basicaudio_QueryInterface,
1768 Basicaudio_GetTypeInfoCount,
1769 Basicaudio_GetTypeInfo,
1770 Basicaudio_GetIDsOfNames,
1772 Basicaudio_put_Volume,
1773 Basicaudio_get_Volume,
1774 Basicaudio_put_Balance,
1775 Basicaudio_get_Balance
1778 /*** IUnknown methods ***/
1779 static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface,
1782 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1784 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1786 return Filtergraph_QueryInterface(This, riid, ppvObj);
1789 static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface) {
1790 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1792 TRACE("(%p/%p)->()\n", This, iface);
1794 return Filtergraph_AddRef(This);
1797 static ULONG WINAPI Basicvideo_Release(IBasicVideo *iface) {
1798 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1800 TRACE("(%p/%p)->()\n", This, iface);
1802 return Filtergraph_Release(This);
1805 /*** IDispatch methods ***/
1806 static HRESULT WINAPI Basicvideo_GetTypeInfoCount(IBasicVideo *iface,
1808 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1810 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1815 static HRESULT WINAPI Basicvideo_GetTypeInfo(IBasicVideo *iface,
1818 ITypeInfo**ppTInfo) {
1819 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1821 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1826 static HRESULT WINAPI Basicvideo_GetIDsOfNames(IBasicVideo *iface,
1832 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1834 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1839 static HRESULT WINAPI Basicvideo_Invoke(IBasicVideo *iface,
1840 DISPID dispIdMember,
1844 DISPPARAMS*pDispParams,
1846 EXCEPINFO*pExepInfo,
1848 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1850 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);
1855 /*** IBasicVideo methods ***/
1856 static HRESULT WINAPI Basicvideo_get_AvgTimePerFrame(IBasicVideo *iface,
1857 REFTIME *pAvgTimePerFrame) {
1858 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1860 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pAvgTimePerFrame);
1865 static HRESULT WINAPI Basicvideo_get_BitRate(IBasicVideo *iface,
1867 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1869 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBitRate);
1874 static HRESULT WINAPI Basicvideo_get_BitErrorRate(IBasicVideo *iface,
1875 long *pBitErrorRate) {
1876 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1878 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBitErrorRate);
1883 static HRESULT WINAPI Basicvideo_get_VideoWidth(IBasicVideo *iface,
1884 long *pVideoWidth) {
1885 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1887 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVideoWidth);
1892 static HRESULT WINAPI Basicvideo_get_VideoHeight(IBasicVideo *iface,
1893 long *pVideoHeight) {
1894 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1896 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVideoHeight);
1901 static HRESULT WINAPI Basicvideo_put_SourceLeft(IBasicVideo *iface,
1903 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1905 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceLeft);
1910 static HRESULT WINAPI Basicvideo_get_SourceLeft(IBasicVideo *iface,
1911 long *pSourceLeft) {
1912 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1914 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceLeft);
1919 static HRESULT WINAPI Basicvideo_put_SourceWidth(IBasicVideo *iface,
1921 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1923 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceWidth);
1928 static HRESULT WINAPI Basicvideo_get_SourceWidth(IBasicVideo *iface,
1929 long *pSourceWidth) {
1930 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1932 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceWidth);
1937 static HRESULT WINAPI Basicvideo_put_SourceTop(IBasicVideo *iface,
1939 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1941 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceTop);
1946 static HRESULT WINAPI Basicvideo_get_SourceTop(IBasicVideo *iface,
1948 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1950 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceTop);
1955 static HRESULT WINAPI Basicvideo_put_SourceHeight(IBasicVideo *iface,
1956 long SourceHeight) {
1957 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1959 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceHeight);
1964 static HRESULT WINAPI Basicvideo_get_SourceHeight(IBasicVideo *iface,
1965 long *pSourceHeight) {
1966 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1968 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceHeight);
1973 static HRESULT WINAPI Basicvideo_put_DestinationLeft(IBasicVideo *iface,
1974 long DestinationLeft) {
1975 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1977 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationLeft);
1982 static HRESULT WINAPI Basicvideo_get_DestinationLeft(IBasicVideo *iface,
1983 long *pDestinationLeft) {
1984 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1986 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationLeft);
1991 static HRESULT WINAPI Basicvideo_put_DestinationWidth(IBasicVideo *iface,
1992 long DestinationWidth) {
1993 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1995 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationWidth);
2000 static HRESULT WINAPI Basicvideo_get_DestinationWidth(IBasicVideo *iface,
2001 long *pDestinationWidth) {
2002 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2004 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationWidth);
2009 static HRESULT WINAPI Basicvideo_put_DestinationTop(IBasicVideo *iface,
2010 long DestinationTop) {
2011 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2013 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationTop);
2018 static HRESULT WINAPI Basicvideo_get_DestinationTop(IBasicVideo *iface,
2019 long *pDestinationTop) {
2020 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2022 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationTop);
2027 static HRESULT WINAPI Basicvideo_put_DestinationHeight(IBasicVideo *iface,
2028 long DestinationHeight) {
2029 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2031 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationHeight);
2036 static HRESULT WINAPI Basicvideo_get_DestinationHeight(IBasicVideo *iface,
2037 long *pDestinationHeight) {
2038 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2040 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationHeight);
2045 static HRESULT WINAPI Basicvideo_SetSourcePosition(IBasicVideo *iface,
2050 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2052 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2057 static HRESULT WINAPI Basicvideo_GetSourcePosition(IBasicVideo *iface,
2062 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2064 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2069 static HRESULT WINAPI Basicvideo_SetDefaultSourcePosition(IBasicVideo *iface) {
2070 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2072 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2077 static HRESULT WINAPI Basicvideo_SetDestinationPosition(IBasicVideo *iface,
2082 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2084 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2089 static HRESULT WINAPI Basicvideo_GetDestinationPosition(IBasicVideo *iface,
2094 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2096 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2101 static HRESULT WINAPI Basicvideo_SetDefaultDestinationPosition(IBasicVideo *iface) {
2102 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2104 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2109 static HRESULT WINAPI Basicvideo_GetVideoSize(IBasicVideo *iface,
2112 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2114 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2119 static HRESULT WINAPI Basicvideo_GetVideoPaletteEntries(IBasicVideo *iface,
2124 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2126 TRACE("(%p/%p)->(%ld, %ld, %p, %p): stub !!!\n", This, iface, StartIndex, Entries, pRetrieved, pPalette);
2131 static HRESULT WINAPI Basicvideo_GetCurrentImage(IBasicVideo *iface,
2134 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2136 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pBufferSize, pDIBImage);
2141 static HRESULT WINAPI Basicvideo_IsUsingDefaultSource(IBasicVideo *iface) {
2142 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2144 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2149 static HRESULT WINAPI Basicvideo_IsUsingDefaultDestination(IBasicVideo *iface) {
2150 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2152 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2158 static IBasicVideoVtbl IBasicVideo_VTable =
2160 Basicvideo_QueryInterface,
2163 Basicvideo_GetTypeInfoCount,
2164 Basicvideo_GetTypeInfo,
2165 Basicvideo_GetIDsOfNames,
2167 Basicvideo_get_AvgTimePerFrame,
2168 Basicvideo_get_BitRate,
2169 Basicvideo_get_BitErrorRate,
2170 Basicvideo_get_VideoWidth,
2171 Basicvideo_get_VideoHeight,
2172 Basicvideo_put_SourceLeft,
2173 Basicvideo_get_SourceLeft,
2174 Basicvideo_put_SourceWidth,
2175 Basicvideo_get_SourceWidth,
2176 Basicvideo_put_SourceTop,
2177 Basicvideo_get_SourceTop,
2178 Basicvideo_put_SourceHeight,
2179 Basicvideo_get_SourceHeight,
2180 Basicvideo_put_DestinationLeft,
2181 Basicvideo_get_DestinationLeft,
2182 Basicvideo_put_DestinationWidth,
2183 Basicvideo_get_DestinationWidth,
2184 Basicvideo_put_DestinationTop,
2185 Basicvideo_get_DestinationTop,
2186 Basicvideo_put_DestinationHeight,
2187 Basicvideo_get_DestinationHeight,
2188 Basicvideo_SetSourcePosition,
2189 Basicvideo_GetSourcePosition,
2190 Basicvideo_SetDefaultSourcePosition,
2191 Basicvideo_SetDestinationPosition,
2192 Basicvideo_GetDestinationPosition,
2193 Basicvideo_SetDefaultDestinationPosition,
2194 Basicvideo_GetVideoSize,
2195 Basicvideo_GetVideoPaletteEntries,
2196 Basicvideo_GetCurrentImage,
2197 Basicvideo_IsUsingDefaultSource,
2198 Basicvideo_IsUsingDefaultDestination
2202 /*** IUnknown methods ***/
2203 static HRESULT WINAPI Videowindow_QueryInterface(IVideoWindow *iface,
2206 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2208 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
2210 return Filtergraph_QueryInterface(This, riid, ppvObj);
2213 static ULONG WINAPI Videowindow_AddRef(IVideoWindow *iface) {
2214 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2216 TRACE("(%p/%p)->()\n", This, iface);
2218 return Filtergraph_AddRef(This);
2221 static ULONG WINAPI Videowindow_Release(IVideoWindow *iface) {
2222 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2224 TRACE("(%p/%p)->()\n", This, iface);
2226 return Filtergraph_Release(This);
2229 /*** IDispatch methods ***/
2230 static HRESULT WINAPI Videowindow_GetTypeInfoCount(IVideoWindow *iface,
2232 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2234 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
2239 static HRESULT WINAPI Videowindow_GetTypeInfo(IVideoWindow *iface,
2242 ITypeInfo**ppTInfo) {
2243 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2245 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
2250 static HRESULT WINAPI Videowindow_GetIDsOfNames(IVideoWindow *iface,
2256 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2258 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
2263 static HRESULT WINAPI Videowindow_Invoke(IVideoWindow *iface,
2264 DISPID dispIdMember,
2268 DISPPARAMS*pDispParams,
2270 EXCEPINFO*pExepInfo,
2272 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2274 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);
2279 /*** IVideoWindow methods ***/
2280 static HRESULT WINAPI Videowindow_put_Caption(IVideoWindow *iface,
2282 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2284 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This, iface, debugstr_w(strCaption), strCaption);
2289 static HRESULT WINAPI Videowindow_get_Caption(IVideoWindow *iface,
2291 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2293 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, strCaption);
2298 static HRESULT WINAPI Videowindow_put_WindowStyle(IVideoWindow *iface,
2300 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2302 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowStyle);
2307 static HRESULT WINAPI Videowindow_get_WindowStyle(IVideoWindow *iface,
2308 long *WindowStyle) {
2309 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2311 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowStyle);
2316 static HRESULT WINAPI Videowindow_put_WindowStyleEx(IVideoWindow *iface,
2317 long WindowStyleEx) {
2318 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2320 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowStyleEx);
2325 static HRESULT WINAPI Videowindow_get_WindowStyleEx(IVideoWindow *iface,
2326 long *WindowStyleEx) {
2327 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2329 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowStyleEx);
2334 static HRESULT WINAPI Videowindow_put_AutoShow(IVideoWindow *iface,
2336 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2338 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, AutoShow);
2343 static HRESULT WINAPI Videowindow_get_AutoShow(IVideoWindow *iface,
2345 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2347 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, AutoShow);
2352 static HRESULT WINAPI Videowindow_put_WindowState(IVideoWindow *iface,
2354 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2356 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowState);
2361 static HRESULT WINAPI Videowindow_get_WindowState(IVideoWindow *iface,
2362 long *WindowState) {
2363 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2365 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowState);
2370 static HRESULT WINAPI Videowindow_put_BackgroundPalette(IVideoWindow *iface,
2371 long BackgroundPalette) {
2372 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2374 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, BackgroundPalette);
2379 static HRESULT WINAPI Videowindow_get_BackgroundPalette(IVideoWindow *iface,
2380 long *pBackgroundPalette) {
2381 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2383 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBackgroundPalette);
2388 static HRESULT WINAPI Videowindow_put_Visible(IVideoWindow *iface,
2390 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2392 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Visible);
2397 static HRESULT WINAPI Videowindow_get_Visible(IVideoWindow *iface,
2399 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2401 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVisible);
2406 static HRESULT WINAPI Videowindow_put_Left(IVideoWindow *iface,
2408 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2410 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Left);
2415 static HRESULT WINAPI Videowindow_get_Left(IVideoWindow *iface,
2417 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2419 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pLeft);
2424 static HRESULT WINAPI Videowindow_put_Width(IVideoWindow *iface,
2426 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2428 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Width);
2433 static HRESULT WINAPI Videowindow_get_Width(IVideoWindow *iface,
2435 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2437 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pWidth);
2442 static HRESULT WINAPI Videowindow_put_Top(IVideoWindow *iface,
2444 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2446 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Top);
2451 static HRESULT WINAPI Videowindow_get_Top(IVideoWindow *iface,
2453 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2455 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pTop);
2460 static HRESULT WINAPI Videowindow_put_Height(IVideoWindow *iface,
2462 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2464 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Height);
2469 static HRESULT WINAPI Videowindow_get_Height(IVideoWindow *iface,
2471 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2473 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pHeight);
2478 static HRESULT WINAPI Videowindow_put_Owner(IVideoWindow *iface,
2480 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2482 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Owner);
2487 static HRESULT WINAPI Videowindow_get_Owner(IVideoWindow *iface,
2489 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2491 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Owner);
2496 static HRESULT WINAPI Videowindow_put_MessageDrain(IVideoWindow *iface,
2498 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2500 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Drain);
2505 static HRESULT WINAPI Videowindow_get_MessageDrain(IVideoWindow *iface,
2507 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2509 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, Drain);
2514 static HRESULT WINAPI Videowindow_get_BorderColor(IVideoWindow *iface,
2516 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2518 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, Color);
2523 static HRESULT WINAPI Videowindow_put_BorderColor(IVideoWindow *iface,
2525 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2527 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Color);
2532 static HRESULT WINAPI Videowindow_get_FullScreenMode(IVideoWindow *iface,
2533 long *FullScreenMode) {
2534 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2536 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, FullScreenMode);
2541 static HRESULT WINAPI Videowindow_put_FullScreenMode(IVideoWindow *iface,
2542 long FullScreenMode) {
2543 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2545 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, FullScreenMode);
2550 static HRESULT WINAPI Videowindow_SetWindowForeground(IVideoWindow *iface,
2552 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2554 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Focus);
2559 static HRESULT WINAPI Videowindow_NotifyOwnerMessage(IVideoWindow *iface,
2564 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2566 TRACE("(%p/%p)->(%08lx, %ld, %08lx, %08lx): stub !!!\n", This, iface, (DWORD) hwnd, uMsg, wParam, lParam);
2571 static HRESULT WINAPI Videowindow_SetWindowPosition(IVideoWindow *iface,
2576 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2578 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2583 static HRESULT WINAPI Videowindow_GetWindowPosition(IVideoWindow *iface,
2588 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2590 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2595 static HRESULT WINAPI Videowindow_GetMinIdealImageSize(IVideoWindow *iface,
2598 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2600 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2605 static HRESULT WINAPI Videowindow_GetMaxIdealImageSize(IVideoWindow *iface,
2608 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2610 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2615 static HRESULT WINAPI Videowindow_GetRestorePosition(IVideoWindow *iface,
2620 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2622 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2627 static HRESULT WINAPI Videowindow_HideCursor(IVideoWindow *iface,
2629 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2631 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, HideCursor);
2636 static HRESULT WINAPI Videowindow_IsCursorHidden(IVideoWindow *iface,
2637 long *CursorHidden) {
2638 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2640 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, CursorHidden);
2646 static IVideoWindowVtbl IVideoWindow_VTable =
2648 Videowindow_QueryInterface,
2650 Videowindow_Release,
2651 Videowindow_GetTypeInfoCount,
2652 Videowindow_GetTypeInfo,
2653 Videowindow_GetIDsOfNames,
2655 Videowindow_put_Caption,
2656 Videowindow_get_Caption,
2657 Videowindow_put_WindowStyle,
2658 Videowindow_get_WindowStyle,
2659 Videowindow_put_WindowStyleEx,
2660 Videowindow_get_WindowStyleEx,
2661 Videowindow_put_AutoShow,
2662 Videowindow_get_AutoShow,
2663 Videowindow_put_WindowState,
2664 Videowindow_get_WindowState,
2665 Videowindow_put_BackgroundPalette,
2666 Videowindow_get_BackgroundPalette,
2667 Videowindow_put_Visible,
2668 Videowindow_get_Visible,
2669 Videowindow_put_Left,
2670 Videowindow_get_Left,
2671 Videowindow_put_Width,
2672 Videowindow_get_Width,
2673 Videowindow_put_Top,
2674 Videowindow_get_Top,
2675 Videowindow_put_Height,
2676 Videowindow_get_Height,
2677 Videowindow_put_Owner,
2678 Videowindow_get_Owner,
2679 Videowindow_put_MessageDrain,
2680 Videowindow_get_MessageDrain,
2681 Videowindow_get_BorderColor,
2682 Videowindow_put_BorderColor,
2683 Videowindow_get_FullScreenMode,
2684 Videowindow_put_FullScreenMode,
2685 Videowindow_SetWindowForeground,
2686 Videowindow_NotifyOwnerMessage,
2687 Videowindow_SetWindowPosition,
2688 Videowindow_GetWindowPosition,
2689 Videowindow_GetMinIdealImageSize,
2690 Videowindow_GetMaxIdealImageSize,
2691 Videowindow_GetRestorePosition,
2692 Videowindow_HideCursor,
2693 Videowindow_IsCursorHidden
2697 /*** IUnknown methods ***/
2698 static HRESULT WINAPI Mediaevent_QueryInterface(IMediaEventEx *iface,
2701 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2703 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
2705 return Filtergraph_QueryInterface(This, riid, ppvObj);
2708 static ULONG WINAPI Mediaevent_AddRef(IMediaEventEx *iface) {
2709 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2711 TRACE("(%p/%p)->()\n", This, iface);
2713 return Filtergraph_AddRef(This);
2716 static ULONG WINAPI Mediaevent_Release(IMediaEventEx *iface) {
2717 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2719 TRACE("(%p/%p)->()\n", This, iface);
2721 return Filtergraph_Release(This);
2724 /*** IDispatch methods ***/
2725 static HRESULT WINAPI Mediaevent_GetTypeInfoCount(IMediaEventEx *iface,
2727 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2729 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
2734 static HRESULT WINAPI Mediaevent_GetTypeInfo(IMediaEventEx *iface,
2737 ITypeInfo**ppTInfo) {
2738 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2740 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
2745 static HRESULT WINAPI Mediaevent_GetIDsOfNames(IMediaEventEx *iface,
2751 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2753 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
2758 static HRESULT WINAPI Mediaevent_Invoke(IMediaEventEx *iface,
2759 DISPID dispIdMember,
2763 DISPPARAMS*pDispParams,
2765 EXCEPINFO*pExepInfo,
2767 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2769 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);
2774 /*** IMediaEvent methods ***/
2775 static HRESULT WINAPI Mediaevent_GetEventHandle(IMediaEventEx *iface,
2777 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2779 TRACE("(%p/%p)->(%p)\n", This, iface, hEvent);
2781 *hEvent = (OAEVENT)This->evqueue.msg_event;
2786 static HRESULT WINAPI Mediaevent_GetEvent(IMediaEventEx *iface,
2791 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2794 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This, iface, lEventCode, lParam1, lParam2, msTimeout);
2796 if (EventsQueue_GetEvent(&This->evqueue, &evt, msTimeout))
2798 *lEventCode = evt.lEventCode;
2799 *lParam1 = evt.lParam1;
2800 *lParam2 = evt.lParam2;
2808 static HRESULT WINAPI Mediaevent_WaitForCompletion(IMediaEventEx *iface,
2811 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2813 TRACE("(%p/%p)->(%ld, %p)\n", This, iface, msTimeout, pEvCode);
2815 if (WaitForSingleObject(This->hEventCompletion, msTimeout) == WAIT_OBJECT_0)
2817 *pEvCode = This->CompletionStatus;
2825 static HRESULT WINAPI Mediaevent_CancelDefaultHandling(IMediaEventEx *iface,
2827 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2829 TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode);
2831 if (lEvCode == EC_COMPLETE)
2832 This->HandleEcComplete = FALSE;
2833 else if (lEvCode == EC_REPAINT)
2834 This->HandleEcRepaint = FALSE;
2841 static HRESULT WINAPI Mediaevent_RestoreDefaultHandling(IMediaEventEx *iface,
2843 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2845 TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode);
2847 if (lEvCode == EC_COMPLETE)
2848 This->HandleEcComplete = TRUE;
2849 else if (lEvCode == EC_REPAINT)
2850 This->HandleEcRepaint = TRUE;
2857 static HRESULT WINAPI Mediaevent_FreeEventParams(IMediaEventEx *iface,
2861 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2863 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This, iface, lEvCode, lParam1, lParam2);
2868 /*** IMediaEventEx methods ***/
2869 static HRESULT WINAPI Mediaevent_SetNotifyWindow(IMediaEventEx *iface,
2872 LONG_PTR lInstanceData) {
2873 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2875 TRACE("(%p/%p)->(%08lx, %ld, %08lx)\n", This, iface, (DWORD) hwnd, lMsg, lInstanceData);
2877 This->notif.hWnd = (HWND)hwnd;
2878 This->notif.msg = lMsg;
2879 This->notif.instance = (long) lInstanceData;
2884 static HRESULT WINAPI Mediaevent_SetNotifyFlags(IMediaEventEx *iface,
2885 long lNoNotifyFlags) {
2886 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2888 TRACE("(%p/%p)->(%ld)\n", This, iface, lNoNotifyFlags);
2890 if ((lNoNotifyFlags != 0) || (lNoNotifyFlags != 1))
2891 return E_INVALIDARG;
2893 This->notif.disabled = lNoNotifyFlags;
2898 static HRESULT WINAPI Mediaevent_GetNotifyFlags(IMediaEventEx *iface,
2899 long *lplNoNotifyFlags) {
2900 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2902 TRACE("(%p/%p)->(%p)\n", This, iface, lplNoNotifyFlags);
2904 if (!lplNoNotifyFlags)
2907 *lplNoNotifyFlags = This->notif.disabled;
2913 static IMediaEventExVtbl IMediaEventEx_VTable =
2915 Mediaevent_QueryInterface,
2918 Mediaevent_GetTypeInfoCount,
2919 Mediaevent_GetTypeInfo,
2920 Mediaevent_GetIDsOfNames,
2922 Mediaevent_GetEventHandle,
2923 Mediaevent_GetEvent,
2924 Mediaevent_WaitForCompletion,
2925 Mediaevent_CancelDefaultHandling,
2926 Mediaevent_RestoreDefaultHandling,
2927 Mediaevent_FreeEventParams,
2928 Mediaevent_SetNotifyWindow,
2929 Mediaevent_SetNotifyFlags,
2930 Mediaevent_GetNotifyFlags
2934 static HRESULT WINAPI MediaFilter_QueryInterface(IMediaFilter *iface, REFIID riid, LPVOID *ppv)
2936 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2938 return Filtergraph_QueryInterface(This, riid, ppv);
2941 static ULONG WINAPI MediaFilter_AddRef(IMediaFilter *iface)
2943 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2945 return Filtergraph_AddRef(This);
2948 static ULONG WINAPI MediaFilter_Release(IMediaFilter *iface)
2950 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2952 return Filtergraph_Release(This);
2955 static HRESULT WINAPI MediaFilter_GetClassID(IMediaFilter *iface, CLSID * pClassID)
2957 FIXME("(%p): stub\n", pClassID);
2962 static HRESULT WINAPI MediaFilter_Stop(IMediaFilter *iface)
2964 FIXME("(): stub\n");
2969 static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface)
2971 FIXME("(): stub\n");
2976 static HRESULT WINAPI MediaFilter_Run(IMediaFilter *iface, REFERENCE_TIME tStart)
2978 FIXME("(%lld): stub\n", tStart);
2983 static HRESULT WINAPI MediaFilter_GetState(IMediaFilter *iface, DWORD dwMsTimeout, FILTER_STATE * pState)
2985 FIXME("(%ld, %p): stub\n", dwMsTimeout, pState);
2990 static HRESULT WINAPI MediaFilter_SetSyncSource(IMediaFilter *iface, IReferenceClock *pClock)
2992 FIXME("(%p): stub\n", pClock);
2997 static HRESULT WINAPI MediaFilter_GetSyncSource(IMediaFilter *iface, IReferenceClock **ppClock)
2999 FIXME("(%p): stub\n", ppClock);
3004 static IMediaFilterVtbl IMediaFilter_VTable =
3006 MediaFilter_QueryInterface,
3008 MediaFilter_Release,
3009 MediaFilter_GetClassID,
3013 MediaFilter_GetState,
3014 MediaFilter_SetSyncSource,
3015 MediaFilter_GetSyncSource
3018 static HRESULT WINAPI MediaEventSink_QueryInterface(IMediaEventSink *iface, REFIID riid, LPVOID *ppv)
3020 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
3022 return Filtergraph_QueryInterface(This, riid, ppv);
3025 static ULONG WINAPI MediaEventSink_AddRef(IMediaEventSink *iface)
3027 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
3029 return Filtergraph_AddRef(This);
3032 static ULONG WINAPI MediaEventSink_Release(IMediaEventSink *iface)
3034 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
3036 return Filtergraph_Release(This);
3039 static HRESULT WINAPI MediaEventSink_Notify(IMediaEventSink *iface, long EventCode, LONG_PTR EventParam1, LONG_PTR EventParam2)
3041 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
3044 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This, iface, EventCode, EventParam1, EventParam2);
3046 /* We need thread safety here, let's use the events queue's one */
3047 EnterCriticalSection(&This->evqueue.msg_crst);
3049 if ((EventCode == EC_COMPLETE) && This->HandleEcComplete)
3051 TRACE("Process EC_COMPLETE notification\n");
3052 if (++This->EcCompleteCount == This->nRenderers)
3054 evt.lEventCode = EC_COMPLETE;
3057 TRACE("Send EC_COMPLETE to app\n");
3058 EventsQueue_PutEvent(&This->evqueue, &evt);
3059 if (!This->notif.disabled && This->notif.hWnd)
3061 TRACE("Send Window message\n");
3062 PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
3064 This->CompletionStatus = EC_COMPLETE;
3065 SetEvent(This->hEventCompletion);
3068 else if ((EventCode == EC_REPAINT) && This->HandleEcRepaint)
3070 /* FIXME: Not handled yet */
3074 evt.lEventCode = EventCode;
3075 evt.lParam1 = EventParam1;
3076 evt.lParam2 = EventParam2;
3077 EventsQueue_PutEvent(&This->evqueue, &evt);
3078 if (!This->notif.disabled && This->notif.hWnd)
3079 PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
3082 LeaveCriticalSection(&This->evqueue.msg_crst);
3086 static IMediaEventSinkVtbl IMediaEventSink_VTable =
3088 MediaEventSink_QueryInterface,
3089 MediaEventSink_AddRef,
3090 MediaEventSink_Release,
3091 MediaEventSink_Notify
3094 /* This is the only function that actually creates a FilterGraph class... */
3095 HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj)
3097 IFilterGraphImpl *fimpl;
3100 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
3103 return CLASS_E_NOAGGREGATION;
3105 fimpl = HeapAlloc(GetProcessHeap(), 0, sizeof(*fimpl));
3106 fimpl->IGraphBuilder_vtbl = &IGraphBuilder_VTable;
3107 fimpl->IMediaControl_vtbl = &IMediaControl_VTable;
3108 fimpl->IMediaSeeking_vtbl = &IMediaSeeking_VTable;
3109 fimpl->IBasicAudio_vtbl = &IBasicAudio_VTable;
3110 fimpl->IBasicVideo_vtbl = &IBasicVideo_VTable;
3111 fimpl->IVideoWindow_vtbl = &IVideoWindow_VTable;
3112 fimpl->IMediaEventEx_vtbl = &IMediaEventEx_VTable;
3113 fimpl->IMediaFilter_vtbl = &IMediaFilter_VTable;
3114 fimpl->IMediaEventSink_vtbl = &IMediaEventSink_VTable;
3116 fimpl->ppFiltersInGraph = NULL;
3117 fimpl->pFilterNames = NULL;
3118 fimpl->nFilters = 0;
3119 fimpl->filterCapacity = 0;
3120 fimpl->nameIndex = 1;
3121 fimpl->hEventCompletion = CreateEventW(0, TRUE, FALSE, 0);
3122 fimpl->HandleEcComplete = TRUE;
3123 fimpl->HandleEcRepaint = TRUE;
3124 fimpl->notif.hWnd = 0;
3125 fimpl->notif.disabled = FALSE;
3126 fimpl->nRenderers = 0;
3127 fimpl->EcCompleteCount = 0;
3128 fimpl->state = State_Stopped;
3129 EventsQueue_Init(&fimpl->evqueue);
3130 InitializeCriticalSection(&fimpl->cs);
3132 hr = CoCreateInstance(&CLSID_FilterMapper, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (LPVOID*)&fimpl->pFilterMapper2);
3134 ERR("Unable to create filter mapper (%lx)\n", hr);
3142 HRESULT FilterGraphNoThread_create(IUnknown *pUnkOuter, LPVOID *ppObj)
3144 FIXME("CLSID_FilterGraphNoThread partially implemented - Forwarding to CLSID_FilterGraph\n");
3145 return FilterGraph_create(pUnkOuter, ppObj);