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 const IGraphBuilderVtbl *IGraphBuilder_vtbl;
145 const IMediaControlVtbl *IMediaControl_vtbl;
146 const IMediaSeekingVtbl *IMediaSeeking_vtbl;
147 const IBasicAudioVtbl *IBasicAudio_vtbl;
148 const IBasicVideoVtbl *IBasicVideo_vtbl;
149 const IVideoWindowVtbl *IVideoWindow_vtbl;
150 const IMediaEventExVtbl *IMediaEventEx_vtbl;
151 const IMediaFilterVtbl *IMediaFilter_vtbl;
152 const IMediaEventSinkVtbl *IMediaEventSink_vtbl;
153 const IGraphConfigVtbl *IGraphConfig_vtbl;
154 /* 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);
224 } else if (IsEqualGUID(&IID_IGraphConfig, riid)) {
225 *ppvObj = &(This->IGraphConfig_vtbl);
226 TRACE(" returning IGraphConfig interface (%p)\n", *ppvObj);
229 FIXME("unknown interface %s\n", debugstr_guid(riid));
230 return E_NOINTERFACE;
233 InterlockedIncrement(&This->ref);
237 static ULONG Filtergraph_AddRef(IFilterGraphImpl *This) {
238 ULONG ref = InterlockedIncrement(&This->ref);
240 TRACE("(%p)->(): new ref = %ld\n", This, ref);
245 static ULONG Filtergraph_Release(IFilterGraphImpl *This) {
246 ULONG ref = InterlockedDecrement(&This->ref);
248 TRACE("(%p)->(): new ref = %ld\n", This, ref);
252 for (i = 0; i < This->nFilters; i++)
253 IBaseFilter_Release(This->ppFiltersInGraph[i]);
254 IFilterMapper2_Release(This->pFilterMapper2);
255 CloseHandle(This->hEventCompletion);
256 EventsQueue_Destroy(&This->evqueue);
257 DeleteCriticalSection(&This->cs);
258 HeapFree(GetProcessHeap(), 0, This->ppFiltersInGraph);
259 HeapFree(GetProcessHeap(), 0, This->pFilterNames);
260 HeapFree(GetProcessHeap(), 0, This);
266 /*** IUnknown methods ***/
267 static HRESULT WINAPI Graphbuilder_QueryInterface(IGraphBuilder *iface,
270 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
272 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
273 return Filtergraph_QueryInterface(This, riid, ppvObj);
276 static ULONG WINAPI Graphbuilder_AddRef(IGraphBuilder *iface) {
277 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
279 TRACE("(%p/%p)->() calling FilterGraph AddRef\n", This, iface);
281 return Filtergraph_AddRef(This);
284 static ULONG WINAPI Graphbuilder_Release(IGraphBuilder *iface) {
285 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
287 TRACE("(%p/%p)->() calling FilterGraph Release\n", This, iface);
289 return Filtergraph_Release(This);
292 /*** IFilterGraph methods ***/
293 static HRESULT WINAPI Graphbuilder_AddFilter(IGraphBuilder *iface,
294 IBaseFilter *pFilter,
296 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
299 WCHAR* wszFilterName = NULL;
300 int duplicate_name = FALSE;
302 TRACE("(%p/%p)->(%p, %s (%p))\n", This, iface, pFilter, debugstr_w(pName), pName);
304 wszFilterName = (WCHAR*) CoTaskMemAlloc( (pName ? strlenW(pName) + 6 : 5) * sizeof(WCHAR) );
308 /* Check if name already exists */
309 for(i = 0; i < This->nFilters; i++)
310 if (!strcmpW(This->pFilterNames[i], pName))
312 duplicate_name = TRUE;
317 /* If no name given or name already existing, generate one */
318 if (!pName || duplicate_name)
320 static const WCHAR wszFmt1[] = {'%','s',' ','%','0','4','d',0};
321 static const WCHAR wszFmt2[] = {'%','0','4','d',0};
323 for (j = 0; j < 10000 ; j++)
327 sprintfW(wszFilterName, wszFmt1, pName, This->nameIndex);
329 sprintfW(wszFilterName, wszFmt2, This->nameIndex);
330 TRACE("Generated name %s\n", debugstr_w(wszFilterName));
332 /* Check if the generated name already exists */
333 for(i = 0; i < This->nFilters; i++)
334 if (!strcmpW(This->pFilterNames[i], wszFilterName))
337 /* Compute next index and exit if generated name is suitable */
338 if (This->nameIndex++ == 10000)
340 if (i == This->nFilters)
343 /* Unable to find a suitable name */
346 CoTaskMemFree(wszFilterName);
347 return VFW_E_DUPLICATE_NAME;
351 memcpy(wszFilterName, pName, (strlenW(pName) + 1) * sizeof(WCHAR));
353 if (This->nFilters + 1 > This->filterCapacity)
355 int newCapacity = This->filterCapacity ? 2 * This->filterCapacity : 1;
356 IBaseFilter ** ppNewFilters = CoTaskMemAlloc(newCapacity * sizeof(IBaseFilter*));
357 LPWSTR * pNewNames = CoTaskMemAlloc(newCapacity * sizeof(LPWSTR));
358 memcpy(ppNewFilters, This->ppFiltersInGraph, This->nFilters * sizeof(IBaseFilter*));
359 memcpy(pNewNames, This->pFilterNames, This->nFilters * sizeof(LPWSTR));
360 if (!This->filterCapacity)
362 CoTaskMemFree(This->ppFiltersInGraph);
363 CoTaskMemFree(This->pFilterNames);
365 This->ppFiltersInGraph = ppNewFilters;
366 This->pFilterNames = pNewNames;
367 This->filterCapacity = newCapacity;
370 hr = IBaseFilter_JoinFilterGraph(pFilter, (IFilterGraph *)This, wszFilterName);
374 IBaseFilter_AddRef(pFilter);
375 This->ppFiltersInGraph[This->nFilters] = pFilter;
376 This->pFilterNames[This->nFilters] = wszFilterName;
380 CoTaskMemFree(wszFilterName);
382 if (SUCCEEDED(hr) && duplicate_name)
383 return VFW_S_DUPLICATE_NAME;
388 static HRESULT WINAPI Graphbuilder_RemoveFilter(IGraphBuilder *iface,
389 IBaseFilter *pFilter) {
390 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
394 TRACE("(%p/%p)->(%p)\n", This, iface, pFilter);
396 /* FIXME: check graph is stopped */
398 for (i = 0; i < This->nFilters; i++)
400 if (This->ppFiltersInGraph[i] == pFilter)
402 /* FIXME: disconnect pins */
403 hr = IBaseFilter_JoinFilterGraph(pFilter, NULL, This->pFilterNames[i]);
406 IPin_Release(pFilter);
407 CoTaskMemFree(This->pFilterNames[i]);
408 memmove(This->ppFiltersInGraph+i, This->ppFiltersInGraph+i+1, sizeof(IBaseFilter*)*(This->nFilters - 1 - i));
409 memmove(This->pFilterNames+i, This->pFilterNames+i+1, sizeof(LPWSTR)*(This->nFilters - 1 - i));
417 return hr; /* FIXME: check this error code */
420 static HRESULT WINAPI Graphbuilder_EnumFilters(IGraphBuilder *iface,
421 IEnumFilters **ppEnum) {
422 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
424 TRACE("(%p/%p)->(%p)\n", This, iface, ppEnum);
426 return IEnumFiltersImpl_Construct(This->ppFiltersInGraph, This->nFilters, ppEnum);
429 static HRESULT WINAPI Graphbuilder_FindFilterByName(IGraphBuilder *iface,
431 IBaseFilter **ppFilter) {
432 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
435 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_w(pName), pName, ppFilter);
439 for (i = 0; i < This->nFilters; i++)
441 if (!strcmpW(pName, This->pFilterNames[i]))
443 *ppFilter = This->ppFiltersInGraph[i];
444 IBaseFilter_AddRef(*ppFilter);
449 return E_FAIL; /* FIXME: check this error code */
452 /* NOTE: despite the implication, it doesn't matter which
453 * way round you put in the input and output pins */
454 static HRESULT WINAPI Graphbuilder_ConnectDirect(IGraphBuilder *iface,
457 const AM_MEDIA_TYPE *pmt) {
461 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
463 TRACE("(%p/%p)->(%p, %p, %p)\n", This, iface, ppinIn, ppinOut, pmt);
465 /* FIXME: check pins are in graph */
467 if (TRACE_ON(quartz))
471 hr = IPin_QueryPinInfo(ppinIn, &PinInfo);
475 TRACE("Filter owning first pin => %p\n", PinInfo.pFilter);
476 IBaseFilter_Release(PinInfo.pFilter);
478 hr = IPin_QueryPinInfo(ppinOut, &PinInfo);
482 TRACE("Filter owning second pin => %p\n", PinInfo.pFilter);
483 IBaseFilter_Release(PinInfo.pFilter);
486 hr = IPin_QueryDirection(ppinIn, &dir);
489 if (dir == PINDIR_INPUT)
490 hr = IPin_Connect(ppinOut, ppinIn, pmt);
492 hr = IPin_Connect(ppinIn, ppinOut, pmt);
498 static HRESULT WINAPI Graphbuilder_Reconnect(IGraphBuilder *iface,
500 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
501 IPin *pConnectedTo = NULL;
503 PIN_DIRECTION pindir;
505 IPin_QueryDirection(ppin, &pindir);
506 hr = IPin_ConnectedTo(ppin, &pConnectedTo);
508 TRACE("Querying connected to failed: %lx\n", hr);
511 IPin_Disconnect(ppin);
512 IPin_Disconnect(pConnectedTo);
513 if (pindir == PINDIR_INPUT)
514 hr = IPin_Connect(pConnectedTo, ppin, NULL);
516 hr = IPin_Connect(ppin, pConnectedTo, NULL);
517 IPin_Release(pConnectedTo);
519 ERR("Reconnecting pins failed, pins are not connected now..\n");
520 TRACE("(%p->%p) -- %p %p -> %lx\n", iface, This, ppin, pConnectedTo, hr);
524 static HRESULT WINAPI Graphbuilder_Disconnect(IGraphBuilder *iface,
526 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
528 TRACE("(%p/%p)->(%p)\n", This, iface, ppin);
530 return IPin_Disconnect(ppin);
533 static HRESULT WINAPI Graphbuilder_SetDefaultSyncSource(IGraphBuilder *iface) {
534 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
536 TRACE("(%p/%p)->(): stub !!!\n", iface, This);
541 static HRESULT GetFilterInfo(IMoniker* pMoniker, GUID* pclsid, VARIANT* pvar)
543 static const WCHAR wszClsidName[] = {'C','L','S','I','D',0};
544 static const WCHAR wszFriendlyName[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
545 IPropertyBag * pPropBagCat = NULL;
549 V_VT(pvar) = VT_BSTR;
551 hr = IMoniker_BindToStorage(pMoniker, NULL, NULL, &IID_IPropertyBag, (LPVOID*)&pPropBagCat);
554 hr = IPropertyBag_Read(pPropBagCat, wszClsidName, pvar, NULL);
557 hr = CLSIDFromString(V_UNION(pvar, bstrVal), pclsid);
560 hr = IPropertyBag_Read(pPropBagCat, wszFriendlyName, pvar, NULL);
563 TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid), debugstr_w(V_UNION(pvar, bstrVal)));
566 IPropertyBag_Release(pPropBagCat);
571 static HRESULT GetInternalConnections(IBaseFilter* pfilter, IPin* pinputpin, IPin*** pppins, ULONG* pnb)
576 TRACE("(%p, %p, %p, %p)\n", pfilter, pinputpin, pppins, pnb);
577 hr = IPin_QueryInternalConnections(pinputpin, NULL, &nb);
580 } else if (hr == S_FALSE) {
581 *pppins = CoTaskMemAlloc(sizeof(IPin*)*nb);
582 hr = IPin_QueryInternalConnections(pinputpin, *pppins, &nb);
584 ERR("Error (%lx)\n", hr);
586 } else if (hr == E_NOTIMPL) {
587 /* Input connected to all outputs */
588 IEnumPins* penumpins;
591 TRACE("E_NOTIMPL\n");
592 hr = IBaseFilter_EnumPins(pfilter, &penumpins);
594 ERR("filter Enumpins failed (%lx)\n", hr);
598 /* Count output pins */
599 while(IEnumPins_Next(penumpins, 1, &ppin, &nb) == S_OK) {
600 PIN_DIRECTION pindir;
601 IPin_QueryDirection(ppin, &pindir);
602 if (pindir == PINDIR_OUTPUT)
606 *pppins = CoTaskMemAlloc(sizeof(IPin*)*i);
607 /* Retrieve output pins */
608 IEnumPins_Reset(penumpins);
610 while(IEnumPins_Next(penumpins, 1, &ppin, &nb) == S_OK) {
611 PIN_DIRECTION pindir;
612 IPin_QueryDirection(ppin, &pindir);
613 if (pindir == PINDIR_OUTPUT)
614 (*pppins)[i++] = ppin;
620 ERR("Next failed (%lx)\n", hr);
623 IEnumPins_Release(penumpins);
624 } else if (FAILED(hr)) {
625 ERR("Cannot get internal connection (%lx)\n", hr);
633 /*** IGraphBuilder methods ***/
634 static HRESULT WINAPI Graphbuilder_Connect(IGraphBuilder *iface,
637 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
640 IEnumMediaTypes* penummt;
642 IEnumPins* penumpins;
643 IEnumMoniker* pEnumMoniker;
651 TRACE("(%p/%p)->(%p, %p)\n", This, iface, ppinOut, ppinIn);
653 if (TRACE_ON(quartz))
655 hr = IPin_QueryPinInfo(ppinIn, &PinInfo);
659 TRACE("Filter owning first pin => %p\n", PinInfo.pFilter);
660 IBaseFilter_Release(PinInfo.pFilter);
662 hr = IPin_QueryPinInfo(ppinOut, &PinInfo);
666 TRACE("Filter owning second pin => %p\n", PinInfo.pFilter);
667 IBaseFilter_Release(PinInfo.pFilter);
670 /* Try direct connection first */
671 hr = IPin_Connect(ppinOut, ppinIn, NULL);
675 TRACE("Direct connection failed, trying to insert other filters\n");
677 hr = IPin_QueryPinInfo(ppinIn, &PinInfo);
681 hr = IBaseFilter_GetClassID(PinInfo.pFilter, &FilterCLSID);
685 IBaseFilter_Release(PinInfo.pFilter);
687 /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream
688 * filter to the minor mediatype of input pin of the renderer */
689 hr = IPin_EnumMediaTypes(ppinOut, &penummt);
691 ERR("EnumMediaTypes (%lx)\n", hr);
695 hr = IEnumMediaTypes_Next(penummt, 1, &mt, &nbmt);
697 ERR("IEnumMediaTypes_Next (%lx)\n", hr);
702 ERR("No media type found!\n");
705 TRACE("MajorType %s\n", debugstr_guid(&mt->majortype));
706 TRACE("SubType %s\n", debugstr_guid(&mt->subtype));
708 /* Try to find a suitable filter that can connect to the pin to render */
709 tab[0] = mt->majortype;
710 tab[1] = mt->subtype;
711 hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, FALSE, FALSE, 0, NULL, NULL, NULL);
713 ERR("Unable to enum filters (%lx)\n", hr);
717 while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
722 IPin* ppinfilter = NULL;
723 IBaseFilter* pfilter = NULL;
725 hr = GetFilterInfo(pMoniker, &clsid, &var);
726 IMoniker_Release(pMoniker);
728 ERR("Unable to retrieve filter info (%lx)\n", hr);
732 if (IsEqualGUID(&clsid, &FilterCLSID)) {
733 /* Skip filter (same as the one the output pin belongs to) */
737 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&pfilter);
739 ERR("Unable to create filter (%lx), trying next one\n", hr);
743 hr = IGraphBuilder_AddFilter(iface, pfilter, NULL);
745 ERR("Unable to add filter (%lx)\n", hr);
746 IBaseFilter_Release(pfilter);
751 hr = IBaseFilter_EnumPins(pfilter, &penumpins);
753 ERR("Enumpins (%lx)\n", hr);
757 hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin);
759 ERR("Next (%lx)\n", hr);
766 IEnumPins_Release(penumpins);
768 hr = IPin_Connect(ppinOut, ppinfilter, NULL);
770 TRACE("Cannot connect to filter (%lx), trying next one\n", hr);
773 TRACE("Successfully connected to filter, follow chain...\n");
775 /* Render all output pins of the filter by calling IGraphBuilder_Render on each of them */
776 hr = GetInternalConnections(pfilter, ppinfilter, &ppins, &nb);
780 TRACE("pins to consider: %ld\n", nb);
781 for(i = 0; i < nb; i++) {
782 TRACE("Processing pin %d\n", i);
783 hr = IGraphBuilder_Connect(iface, ppins[i], ppinIn);
785 TRACE("Cannot render pin %p (%lx)\n", ppinfilter, hr);
787 IPin_Release(ppins[i]);
788 if (SUCCEEDED(hr)) break;
790 while (++i < nb) IPin_Release(ppins[i]);
791 CoTaskMemFree(ppins);
792 IBaseFilter_Release(pfilter);
793 IPin_Release(ppinfilter);
798 if (ppinfilter) IPin_Release(ppinfilter);
800 IGraphBuilder_RemoveFilter(iface, pfilter);
801 IBaseFilter_Release(pfilter);
805 IEnumMediaTypes_Release(penummt);
811 static HRESULT WINAPI Graphbuilder_Render(IGraphBuilder *iface,
813 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
814 IEnumMediaTypes* penummt;
819 IEnumMoniker* pEnumMoniker;
824 TRACE("(%p/%p)->(%p)\n", This, iface, ppinOut);
826 if (TRACE_ON(quartz))
830 hr = IPin_QueryPinInfo(ppinOut, &PinInfo);
834 TRACE("Filter owning pin => %p\n", PinInfo.pFilter);
835 IBaseFilter_Release(PinInfo.pFilter);
838 hr = IPin_EnumMediaTypes(ppinOut, &penummt);
840 ERR("EnumMediaTypes (%lx)\n", hr);
846 hr = IEnumMediaTypes_Next(penummt, 1, &mt, &nbmt);
848 ERR("IEnumMediaTypes_Next (%lx)\n", hr);
853 TRACE("MajorType %s\n", debugstr_guid(&mt->majortype));
854 TRACE("SubType %s\n", debugstr_guid(&mt->subtype));
856 /* Try to find a suitable renderer with the same media type */
857 tab[0] = mt->majortype;
859 hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, TRUE, FALSE, 0, NULL, NULL, NULL);
861 ERR("Unable to enum filters (%lx)\n", hr);
865 while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
870 IBaseFilter* pfilter = NULL;
871 IEnumPins* penumpins;
874 hr = GetFilterInfo(pMoniker, &clsid, &var);
875 IMoniker_Release(pMoniker);
877 ERR("Unable to retrieve filter info (%lx)\n", hr);
881 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&pfilter);
883 ERR("Unable to create filter (%lx), trying next one\n", hr);
887 hr = IGraphBuilder_AddFilter(iface, pfilter, NULL);
889 ERR("Unable to add filter (%lx)\n", hr);
894 hr = IBaseFilter_EnumPins(pfilter, &penumpins);
896 ERR("Splitter Enumpins (%lx)\n", hr);
899 hr = IEnumPins_Next(penumpins, 1, &ppinfilter, &pin);
901 ERR("Next (%lx)\n", hr);
908 IEnumPins_Release(penumpins);
910 /* Connect the pin to render to the renderer */
911 hr = IGraphBuilder_Connect(iface, ppinOut, ppinfilter);
913 TRACE("Unable to connect to renderer (%lx)\n", hr);
920 IGraphBuilder_RemoveFilter(iface, pfilter);
921 IBaseFilter_Release(pfilter);
929 IEnumMediaTypes_Release(penummt);
934 static HRESULT WINAPI Graphbuilder_RenderFile(IGraphBuilder *iface,
936 LPCWSTR lpcwstrPlayList) {
937 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
938 static const WCHAR string[] = {'R','e','a','d','e','r',0};
939 IBaseFilter* preader = NULL;
940 IBaseFilter* psplitter;
943 IEnumPins* penumpins;
946 IEnumMoniker* pEnumMoniker;
951 IFileSourceFilter* pfile = NULL;
955 TRACE("(%p/%p)->(%s, %s)\n", This, iface, debugstr_w(lpcwstrFile), debugstr_w(lpcwstrPlayList));
957 hr = IGraphBuilder_AddSourceFilter(iface, lpcwstrFile, string, &preader);
959 /* Retrieve file media type */
961 hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter, (LPVOID*)&pfile);
963 hr = IFileSourceFilter_GetCurFile(pfile, &filename, &mt);
964 IFileSourceFilter_Release(pfile);
968 tab[0] = mt.majortype;
970 hr = IFilterMapper2_EnumMatchingFilters(This->pFilterMapper2, &pEnumMoniker, 0, FALSE, 0, TRUE, 1, tab, NULL, NULL, FALSE, FALSE, 0, NULL, NULL, NULL);
976 IGraphBuilder_RemoveFilter(iface, preader);
977 IBaseFilter_Release(preader);
983 while(IEnumMoniker_Next(pEnumMoniker, 1, &pMoniker, &nb) == S_OK)
988 hr = GetFilterInfo(pMoniker, &clsid, &var);
989 IMoniker_Release(pMoniker);
991 ERR("Unable to retrieve filter info (%lx)\n", hr);
995 hr = CoCreateInstance(&clsid, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&psplitter);
997 ERR("Unable to create filter (%lx), trying next one\n", hr);
1001 hr = IGraphBuilder_AddFilter(iface, psplitter, NULL);
1003 ERR("Unable add filter (%lx)\n", hr);
1007 /* Connect file source and splitter filters together */
1008 /* Make the splitter analyze incoming data */
1009 hr = IBaseFilter_EnumPins(preader, &penumpins);
1011 ERR("Enumpins (%lx)\n", hr);
1014 hr = IEnumPins_Next(penumpins, 1, &ppinreader, &pin);
1016 ERR("Next (%lx)\n", hr);
1023 IEnumPins_Release(penumpins);
1025 hr = IBaseFilter_EnumPins(psplitter, &penumpins);
1027 ERR("Splitter Enumpins (%lx)\n", hr);
1030 hr = IEnumPins_Next(penumpins, 1, &ppinsplitter, &pin);
1032 ERR("Next (%lx)\n", hr);
1039 IEnumPins_Release(penumpins);
1041 hr = IPin_Connect(ppinreader, ppinsplitter, NULL);
1043 IBaseFilter_Release(ppinsplitter);
1044 ppinsplitter = NULL;
1045 TRACE("Cannot connect to filter (%lx), trying next one\n", hr);
1048 TRACE("Successfully connected to filter\n");
1052 /* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
1054 hr = GetInternalConnections(psplitter, ppinsplitter, &ppins, &nb);
1056 if (SUCCEEDED(hr)) {
1058 TRACE("pins to consider: %ld\n", nb);
1059 for(i = 0; i < nb; i++) {
1060 TRACE("Processing pin %d\n", i);
1061 hr = IGraphBuilder_Render(iface, ppins[i]);
1063 ERR("Cannot render pin %p (%lx)\n", ppins[i], hr);
1064 /* FIXME: We should clean created things properly */
1068 CoTaskMemFree(ppins);
1074 static HRESULT WINAPI Graphbuilder_AddSourceFilter(IGraphBuilder *iface,
1075 LPCWSTR lpcwstrFileName,
1076 LPCWSTR lpcwstrFilterName,
1077 IBaseFilter **ppFilter) {
1078 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1080 IBaseFilter* preader;
1081 IFileSourceFilter* pfile = NULL;
1085 TRACE("(%p/%p)->(%s, %s, %p)\n", This, iface, debugstr_w(lpcwstrFileName), debugstr_w(lpcwstrFilterName), ppFilter);
1087 /* Instantiate a file source filter */
1088 hr = CoCreateInstance(&CLSID_AsyncReader, NULL, CLSCTX_INPROC_SERVER, &IID_IBaseFilter, (LPVOID*)&preader);
1090 ERR("Unable to create file source filter (%lx)\n", hr);
1094 hr = IGraphBuilder_AddFilter(iface, preader, lpcwstrFilterName);
1096 ERR("Unable add filter (%lx)\n", hr);
1097 IBaseFilter_Release(preader);
1101 hr = IBaseFilter_QueryInterface(preader, &IID_IFileSourceFilter, (LPVOID*)&pfile);
1103 ERR("Unable to get IFileSourceInterface (%lx)\n", hr);
1107 /* Load the file in the file source filter */
1108 hr = IFileSourceFilter_Load(pfile, lpcwstrFileName, NULL);
1110 ERR("Load (%lx)\n", hr);
1114 IFileSourceFilter_GetCurFile(pfile, &filename, &mt);
1116 ERR("GetCurFile (%lx)\n", hr);
1119 TRACE("File %s\n", debugstr_w(filename));
1120 TRACE("MajorType %s\n", debugstr_guid(&mt.majortype));
1121 TRACE("SubType %s\n", debugstr_guid(&mt.subtype));
1124 *ppFilter = preader;
1130 IFileSourceFilter_Release(pfile);
1131 IGraphBuilder_RemoveFilter(iface, preader);
1132 IBaseFilter_Release(preader);
1137 static HRESULT WINAPI Graphbuilder_SetLogFile(IGraphBuilder *iface,
1139 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1141 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) hFile);
1146 static HRESULT WINAPI Graphbuilder_Abort(IGraphBuilder *iface) {
1147 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1149 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1154 static HRESULT WINAPI Graphbuilder_ShouldOperationContinue(IGraphBuilder *iface) {
1155 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphBuilder_vtbl, iface);
1157 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1163 static const IGraphBuilderVtbl IGraphBuilder_VTable =
1165 Graphbuilder_QueryInterface,
1166 Graphbuilder_AddRef,
1167 Graphbuilder_Release,
1168 Graphbuilder_AddFilter,
1169 Graphbuilder_RemoveFilter,
1170 Graphbuilder_EnumFilters,
1171 Graphbuilder_FindFilterByName,
1172 Graphbuilder_ConnectDirect,
1173 Graphbuilder_Reconnect,
1174 Graphbuilder_Disconnect,
1175 Graphbuilder_SetDefaultSyncSource,
1176 Graphbuilder_Connect,
1177 Graphbuilder_Render,
1178 Graphbuilder_RenderFile,
1179 Graphbuilder_AddSourceFilter,
1180 Graphbuilder_SetLogFile,
1182 Graphbuilder_ShouldOperationContinue
1185 /*** IUnknown methods ***/
1186 static HRESULT WINAPI Mediacontrol_QueryInterface(IMediaControl *iface,
1189 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1191 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1193 return Filtergraph_QueryInterface(This, riid, ppvObj);
1196 static ULONG WINAPI Mediacontrol_AddRef(IMediaControl *iface) {
1197 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1199 TRACE("(%p/%p)->()\n", This, iface);
1201 return Filtergraph_AddRef(This);
1204 static ULONG WINAPI Mediacontrol_Release(IMediaControl *iface) {
1205 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1207 TRACE("(%p/%p)->()\n", This, iface);
1209 return Filtergraph_Release(This);
1213 /*** IDispatch methods ***/
1214 static HRESULT WINAPI Mediacontrol_GetTypeInfoCount(IMediaControl *iface,
1216 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1218 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1223 static HRESULT WINAPI Mediacontrol_GetTypeInfo(IMediaControl *iface,
1226 ITypeInfo**ppTInfo) {
1227 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1229 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1234 static HRESULT WINAPI Mediacontrol_GetIDsOfNames(IMediaControl *iface,
1240 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1242 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1247 static HRESULT WINAPI Mediacontrol_Invoke(IMediaControl *iface,
1248 DISPID dispIdMember,
1252 DISPPARAMS*pDispParams,
1254 EXCEPINFO*pExepInfo,
1256 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1258 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);
1263 typedef HRESULT(WINAPI *fnFoundFilter)(IBaseFilter *);
1265 static HRESULT ExploreGraph(IFilterGraphImpl* pGraph, IPin* pOutputPin, fnFoundFilter FoundFilter)
1274 TRACE("%p %p\n", pGraph, pOutputPin);
1275 PinInfo.pFilter = NULL;
1277 hr = IPin_ConnectedTo(pOutputPin, &pInputPin);
1280 hr = IPin_QueryPinInfo(pInputPin, &PinInfo);
1283 hr = GetInternalConnections(PinInfo.pFilter, pInputPin, &ppPins, &nb);
1289 TRACE("Reached a renderer\n");
1290 /* Count renderers for end of stream notification */
1291 pGraph->nRenderers++;
1295 for(i = 0; i < nb; i++)
1297 /* Explore the graph downstream from this pin
1298 * FIXME: We should prevent exploring from a pin more than once. This can happens when
1299 * several input pins are connected to the same output (a MUX for instance). */
1300 ExploreGraph(pGraph, ppPins[i], FoundFilter);
1301 IPin_Release(ppPins[i]);
1304 CoTaskMemFree(ppPins);
1306 TRACE("Doing stuff with filter %p\n", PinInfo.pFilter);
1307 FoundFilter(PinInfo.pFilter);
1310 if (PinInfo.pFilter) IBaseFilter_Release(PinInfo.pFilter);
1314 static HRESULT WINAPI SendRun(IBaseFilter *pFilter) {
1315 return IBaseFilter_Run(pFilter, 0);
1318 static HRESULT WINAPI SendPause(IBaseFilter *pFilter) {
1319 return IBaseFilter_Pause(pFilter);
1322 static HRESULT WINAPI SendStop(IBaseFilter *pFilter) {
1323 return IBaseFilter_Stop(pFilter);
1326 static HRESULT SendFilterMessage(IMediaControl *iface, fnFoundFilter FoundFilter) {
1327 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1329 IBaseFilter* pfilter;
1335 TRACE("(%p/%p)->()\n", This, iface);
1337 /* Explorer the graph from source filters to renderers, determine renderers
1338 * number and run filters from renderers to source filters */
1339 This->nRenderers = 0;
1340 ResetEvent(This->hEventCompletion);
1342 for(i = 0; i < This->nFilters; i++)
1345 pfilter = This->ppFiltersInGraph[i];
1346 hr = IBaseFilter_EnumPins(pfilter, &pEnum);
1349 ERR("Enum pins failed %lx\n", hr);
1352 /* Check if it is a source filter */
1353 while(IEnumPins_Next(pEnum, 1, &pPin, &dummy) == S_OK)
1355 IPin_QueryDirection(pPin, &dir);
1357 if (dir == PINDIR_INPUT)
1365 TRACE("Found a source filter %p\n", pfilter);
1366 IEnumPins_Reset(pEnum);
1367 while(IEnumPins_Next(pEnum, 1, &pPin, &dummy) == S_OK)
1369 /* Explore the graph downstream from this pin */
1370 ExploreGraph(This, pPin, FoundFilter);
1373 FoundFilter(pfilter);
1375 IEnumPins_Release(pEnum);
1381 /*** IMediaControl methods ***/
1382 static HRESULT WINAPI Mediacontrol_Run(IMediaControl *iface) {
1383 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1384 TRACE("(%p/%p)->()\n", This, iface);
1386 if (This->state == State_Running) return S_OK;
1388 EnterCriticalSection(&This->cs);
1389 SendFilterMessage(iface, SendRun);
1390 This->state = State_Running;
1391 LeaveCriticalSection(&This->cs);
1395 static HRESULT WINAPI Mediacontrol_Pause(IMediaControl *iface) {
1396 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1397 TRACE("(%p/%p)->()\n", This, iface);
1399 if (This->state == State_Paused) return S_OK;
1401 EnterCriticalSection(&This->cs);
1402 SendFilterMessage(iface, SendPause);
1403 This->state = State_Paused;
1404 LeaveCriticalSection(&This->cs);
1408 static HRESULT WINAPI Mediacontrol_Stop(IMediaControl *iface) {
1409 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1410 TRACE("(%p/%p)->()\n", This, iface);
1412 if (This->state == State_Stopped) return S_OK;
1414 EnterCriticalSection(&This->cs);
1415 if (This->state == State_Running) SendFilterMessage(iface, SendPause);
1416 SendFilterMessage(iface, SendStop);
1417 This->state = State_Stopped;
1418 LeaveCriticalSection(&This->cs);
1422 static HRESULT WINAPI Mediacontrol_GetState(IMediaControl *iface,
1424 OAFilterState *pfs) {
1425 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1427 TRACE("(%p/%p)->(%ld, %p): semi-stub !!!\n", This, iface, msTimeout, pfs);
1429 EnterCriticalSection(&This->cs);
1433 LeaveCriticalSection(&This->cs);
1438 static HRESULT WINAPI Mediacontrol_RenderFile(IMediaControl *iface,
1440 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1442 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This, iface, debugstr_w(strFilename), strFilename);
1447 static HRESULT WINAPI Mediacontrol_AddSourceFilter(IMediaControl *iface,
1449 IDispatch **ppUnk) {
1450 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1452 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This, iface, debugstr_w(strFilename), strFilename, ppUnk);
1457 static HRESULT WINAPI Mediacontrol_get_FilterCollection(IMediaControl *iface,
1458 IDispatch **ppUnk) {
1459 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1461 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppUnk);
1466 static HRESULT WINAPI Mediacontrol_get_RegFilterCollection(IMediaControl *iface,
1467 IDispatch **ppUnk) {
1468 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1470 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, ppUnk);
1475 static HRESULT WINAPI Mediacontrol_StopWhenReady(IMediaControl *iface) {
1476 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaControl_vtbl, iface);
1478 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1484 static const IMediaControlVtbl IMediaControl_VTable =
1486 Mediacontrol_QueryInterface,
1487 Mediacontrol_AddRef,
1488 Mediacontrol_Release,
1489 Mediacontrol_GetTypeInfoCount,
1490 Mediacontrol_GetTypeInfo,
1491 Mediacontrol_GetIDsOfNames,
1492 Mediacontrol_Invoke,
1496 Mediacontrol_GetState,
1497 Mediacontrol_RenderFile,
1498 Mediacontrol_AddSourceFilter,
1499 Mediacontrol_get_FilterCollection,
1500 Mediacontrol_get_RegFilterCollection,
1501 Mediacontrol_StopWhenReady
1505 /*** IUnknown methods ***/
1506 static HRESULT WINAPI Mediaseeking_QueryInterface(IMediaSeeking *iface,
1509 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1511 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1513 return Filtergraph_QueryInterface(This, riid, ppvObj);
1516 static ULONG WINAPI Mediaseeking_AddRef(IMediaSeeking *iface) {
1517 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1519 TRACE("(%p/%p)->()\n", This, iface);
1521 return Filtergraph_AddRef(This);
1524 static ULONG WINAPI Mediaseeking_Release(IMediaSeeking *iface) {
1525 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1527 TRACE("(%p/%p)->()\n", This, iface);
1529 return Filtergraph_Release(This);
1532 /*** IMediaSeeking methods ***/
1533 static HRESULT WINAPI Mediaseeking_GetCapabilities(IMediaSeeking *iface,
1534 DWORD *pCapabilities) {
1535 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1537 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCapabilities);
1542 static HRESULT WINAPI Mediaseeking_CheckCapabilities(IMediaSeeking *iface,
1543 DWORD *pCapabilities) {
1544 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1546 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCapabilities);
1551 static HRESULT WINAPI Mediaseeking_IsFormatSupported(IMediaSeeking *iface,
1552 const GUID *pFormat) {
1553 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1555 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1560 static HRESULT WINAPI Mediaseeking_QueryPreferredFormat(IMediaSeeking *iface,
1562 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1564 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1569 static HRESULT WINAPI Mediaseeking_GetTimeFormat(IMediaSeeking *iface,
1571 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1573 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1578 static HRESULT WINAPI Mediaseeking_IsUsingTimeFormat(IMediaSeeking *iface,
1579 const GUID *pFormat) {
1580 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1582 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1587 static HRESULT WINAPI Mediaseeking_SetTimeFormat(IMediaSeeking *iface,
1588 const GUID *pFormat) {
1589 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1591 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pFormat);
1596 static HRESULT WINAPI Mediaseeking_GetDuration(IMediaSeeking *iface,
1597 LONGLONG *pDuration) {
1598 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1600 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDuration);
1605 static HRESULT WINAPI Mediaseeking_GetStopPosition(IMediaSeeking *iface,
1607 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1609 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pStop);
1614 static HRESULT WINAPI Mediaseeking_GetCurrentPosition(IMediaSeeking *iface,
1615 LONGLONG *pCurrent) {
1616 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1618 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pCurrent);
1623 static HRESULT WINAPI Mediaseeking_ConvertTimeFormat(IMediaSeeking *iface,
1625 const GUID *pTargetFormat,
1627 const GUID *pSourceFormat) {
1628 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1630 TRACE("(%p/%p)->(%p, %p, %lld, %p): stub !!!\n", This, iface, pTarget, pTargetFormat, Source, pSourceFormat);
1635 static HRESULT WINAPI Mediaseeking_SetPositions(IMediaSeeking *iface,
1637 DWORD dwCurrentFlags,
1639 DWORD dwStopFlags) {
1640 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1642 TRACE("(%p/%p)->(%p, %08lx, %p, %08lx): stub !!!\n", This, iface, pCurrent, dwCurrentFlags, pStop, dwStopFlags);
1647 static HRESULT WINAPI Mediaseeking_GetPositions(IMediaSeeking *iface,
1650 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1652 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pCurrent, pStop);
1657 static HRESULT WINAPI Mediaseeking_GetAvailable(IMediaSeeking *iface,
1658 LONGLONG *pEarliest,
1659 LONGLONG *pLatest) {
1660 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1662 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pEarliest, pLatest);
1667 static HRESULT WINAPI Mediaseeking_SetRate(IMediaSeeking *iface,
1669 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1671 TRACE("(%p/%p)->(%f): stub !!!\n", This, iface, dRate);
1676 static HRESULT WINAPI Mediaseeking_GetRate(IMediaSeeking *iface,
1678 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1680 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pdRate);
1685 static HRESULT WINAPI Mediaseeking_GetPreroll(IMediaSeeking *iface,
1686 LONGLONG *pllPreroll) {
1687 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaSeeking_vtbl, iface);
1689 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pllPreroll);
1695 static const IMediaSeekingVtbl IMediaSeeking_VTable =
1697 Mediaseeking_QueryInterface,
1698 Mediaseeking_AddRef,
1699 Mediaseeking_Release,
1700 Mediaseeking_GetCapabilities,
1701 Mediaseeking_CheckCapabilities,
1702 Mediaseeking_IsFormatSupported,
1703 Mediaseeking_QueryPreferredFormat,
1704 Mediaseeking_GetTimeFormat,
1705 Mediaseeking_IsUsingTimeFormat,
1706 Mediaseeking_SetTimeFormat,
1707 Mediaseeking_GetDuration,
1708 Mediaseeking_GetStopPosition,
1709 Mediaseeking_GetCurrentPosition,
1710 Mediaseeking_ConvertTimeFormat,
1711 Mediaseeking_SetPositions,
1712 Mediaseeking_GetPositions,
1713 Mediaseeking_GetAvailable,
1714 Mediaseeking_SetRate,
1715 Mediaseeking_GetRate,
1716 Mediaseeking_GetPreroll
1719 /*** IUnknown methods ***/
1720 static HRESULT WINAPI Basicaudio_QueryInterface(IBasicAudio *iface,
1723 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1725 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1727 return Filtergraph_QueryInterface(This, riid, ppvObj);
1730 static ULONG WINAPI Basicaudio_AddRef(IBasicAudio *iface) {
1731 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1733 TRACE("(%p/%p)->()\n", This, iface);
1735 return Filtergraph_AddRef(This);
1738 static ULONG WINAPI Basicaudio_Release(IBasicAudio *iface) {
1739 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1741 TRACE("(%p/%p)->()\n", This, iface);
1743 return Filtergraph_Release(This);
1746 /*** IDispatch methods ***/
1747 static HRESULT WINAPI Basicaudio_GetTypeInfoCount(IBasicAudio *iface,
1749 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1751 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1756 static HRESULT WINAPI Basicaudio_GetTypeInfo(IBasicAudio *iface,
1759 ITypeInfo**ppTInfo) {
1760 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1762 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1767 static HRESULT WINAPI Basicaudio_GetIDsOfNames(IBasicAudio *iface,
1773 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1775 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1780 static HRESULT WINAPI Basicaudio_Invoke(IBasicAudio *iface,
1781 DISPID dispIdMember,
1785 DISPPARAMS*pDispParams,
1787 EXCEPINFO*pExepInfo,
1789 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1791 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);
1796 /*** IBasicAudio methods ***/
1797 static HRESULT WINAPI Basicaudio_put_Volume(IBasicAudio *iface,
1799 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1801 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lVolume);
1806 static HRESULT WINAPI Basicaudio_get_Volume(IBasicAudio *iface,
1808 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1810 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plVolume);
1815 static HRESULT WINAPI Basicaudio_put_Balance(IBasicAudio *iface,
1817 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1819 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lBalance);
1824 static HRESULT WINAPI Basicaudio_get_Balance(IBasicAudio *iface,
1826 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicAudio_vtbl, iface);
1828 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plBalance);
1833 static const IBasicAudioVtbl IBasicAudio_VTable =
1835 Basicaudio_QueryInterface,
1838 Basicaudio_GetTypeInfoCount,
1839 Basicaudio_GetTypeInfo,
1840 Basicaudio_GetIDsOfNames,
1842 Basicaudio_put_Volume,
1843 Basicaudio_get_Volume,
1844 Basicaudio_put_Balance,
1845 Basicaudio_get_Balance
1848 /*** IUnknown methods ***/
1849 static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface,
1852 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1854 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1856 return Filtergraph_QueryInterface(This, riid, ppvObj);
1859 static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface) {
1860 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1862 TRACE("(%p/%p)->()\n", This, iface);
1864 return Filtergraph_AddRef(This);
1867 static ULONG WINAPI Basicvideo_Release(IBasicVideo *iface) {
1868 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1870 TRACE("(%p/%p)->()\n", This, iface);
1872 return Filtergraph_Release(This);
1875 /*** IDispatch methods ***/
1876 static HRESULT WINAPI Basicvideo_GetTypeInfoCount(IBasicVideo *iface,
1878 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1880 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1885 static HRESULT WINAPI Basicvideo_GetTypeInfo(IBasicVideo *iface,
1888 ITypeInfo**ppTInfo) {
1889 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1891 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1896 static HRESULT WINAPI Basicvideo_GetIDsOfNames(IBasicVideo *iface,
1902 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1904 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1909 static HRESULT WINAPI Basicvideo_Invoke(IBasicVideo *iface,
1910 DISPID dispIdMember,
1914 DISPPARAMS*pDispParams,
1916 EXCEPINFO*pExepInfo,
1918 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1920 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);
1925 /*** IBasicVideo methods ***/
1926 static HRESULT WINAPI Basicvideo_get_AvgTimePerFrame(IBasicVideo *iface,
1927 REFTIME *pAvgTimePerFrame) {
1928 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1930 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pAvgTimePerFrame);
1935 static HRESULT WINAPI Basicvideo_get_BitRate(IBasicVideo *iface,
1937 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1939 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBitRate);
1944 static HRESULT WINAPI Basicvideo_get_BitErrorRate(IBasicVideo *iface,
1945 long *pBitErrorRate) {
1946 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1948 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBitErrorRate);
1953 static HRESULT WINAPI Basicvideo_get_VideoWidth(IBasicVideo *iface,
1954 long *pVideoWidth) {
1955 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1957 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVideoWidth);
1962 static HRESULT WINAPI Basicvideo_get_VideoHeight(IBasicVideo *iface,
1963 long *pVideoHeight) {
1964 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1966 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVideoHeight);
1971 static HRESULT WINAPI Basicvideo_put_SourceLeft(IBasicVideo *iface,
1973 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1975 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceLeft);
1980 static HRESULT WINAPI Basicvideo_get_SourceLeft(IBasicVideo *iface,
1981 long *pSourceLeft) {
1982 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1984 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceLeft);
1989 static HRESULT WINAPI Basicvideo_put_SourceWidth(IBasicVideo *iface,
1991 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
1993 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceWidth);
1998 static HRESULT WINAPI Basicvideo_get_SourceWidth(IBasicVideo *iface,
1999 long *pSourceWidth) {
2000 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2002 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceWidth);
2007 static HRESULT WINAPI Basicvideo_put_SourceTop(IBasicVideo *iface,
2009 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2011 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceTop);
2016 static HRESULT WINAPI Basicvideo_get_SourceTop(IBasicVideo *iface,
2018 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2020 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceTop);
2025 static HRESULT WINAPI Basicvideo_put_SourceHeight(IBasicVideo *iface,
2026 long SourceHeight) {
2027 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2029 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceHeight);
2034 static HRESULT WINAPI Basicvideo_get_SourceHeight(IBasicVideo *iface,
2035 long *pSourceHeight) {
2036 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2038 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceHeight);
2043 static HRESULT WINAPI Basicvideo_put_DestinationLeft(IBasicVideo *iface,
2044 long DestinationLeft) {
2045 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2047 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationLeft);
2052 static HRESULT WINAPI Basicvideo_get_DestinationLeft(IBasicVideo *iface,
2053 long *pDestinationLeft) {
2054 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2056 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationLeft);
2061 static HRESULT WINAPI Basicvideo_put_DestinationWidth(IBasicVideo *iface,
2062 long DestinationWidth) {
2063 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2065 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationWidth);
2070 static HRESULT WINAPI Basicvideo_get_DestinationWidth(IBasicVideo *iface,
2071 long *pDestinationWidth) {
2072 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2074 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationWidth);
2079 static HRESULT WINAPI Basicvideo_put_DestinationTop(IBasicVideo *iface,
2080 long DestinationTop) {
2081 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2083 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationTop);
2088 static HRESULT WINAPI Basicvideo_get_DestinationTop(IBasicVideo *iface,
2089 long *pDestinationTop) {
2090 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2092 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationTop);
2097 static HRESULT WINAPI Basicvideo_put_DestinationHeight(IBasicVideo *iface,
2098 long DestinationHeight) {
2099 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2101 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationHeight);
2106 static HRESULT WINAPI Basicvideo_get_DestinationHeight(IBasicVideo *iface,
2107 long *pDestinationHeight) {
2108 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2110 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationHeight);
2115 static HRESULT WINAPI Basicvideo_SetSourcePosition(IBasicVideo *iface,
2120 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2122 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2127 static HRESULT WINAPI Basicvideo_GetSourcePosition(IBasicVideo *iface,
2132 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2134 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2139 static HRESULT WINAPI Basicvideo_SetDefaultSourcePosition(IBasicVideo *iface) {
2140 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2142 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2147 static HRESULT WINAPI Basicvideo_SetDestinationPosition(IBasicVideo *iface,
2152 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2154 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2159 static HRESULT WINAPI Basicvideo_GetDestinationPosition(IBasicVideo *iface,
2164 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2166 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2171 static HRESULT WINAPI Basicvideo_SetDefaultDestinationPosition(IBasicVideo *iface) {
2172 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2174 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2179 static HRESULT WINAPI Basicvideo_GetVideoSize(IBasicVideo *iface,
2182 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2184 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2189 static HRESULT WINAPI Basicvideo_GetVideoPaletteEntries(IBasicVideo *iface,
2194 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2196 TRACE("(%p/%p)->(%ld, %ld, %p, %p): stub !!!\n", This, iface, StartIndex, Entries, pRetrieved, pPalette);
2201 static HRESULT WINAPI Basicvideo_GetCurrentImage(IBasicVideo *iface,
2204 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2206 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pBufferSize, pDIBImage);
2211 static HRESULT WINAPI Basicvideo_IsUsingDefaultSource(IBasicVideo *iface) {
2212 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2214 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2219 static HRESULT WINAPI Basicvideo_IsUsingDefaultDestination(IBasicVideo *iface) {
2220 ICOM_THIS_MULTI(IFilterGraphImpl, IBasicVideo_vtbl, iface);
2222 TRACE("(%p/%p)->(): stub !!!\n", This, iface);
2228 static const IBasicVideoVtbl IBasicVideo_VTable =
2230 Basicvideo_QueryInterface,
2233 Basicvideo_GetTypeInfoCount,
2234 Basicvideo_GetTypeInfo,
2235 Basicvideo_GetIDsOfNames,
2237 Basicvideo_get_AvgTimePerFrame,
2238 Basicvideo_get_BitRate,
2239 Basicvideo_get_BitErrorRate,
2240 Basicvideo_get_VideoWidth,
2241 Basicvideo_get_VideoHeight,
2242 Basicvideo_put_SourceLeft,
2243 Basicvideo_get_SourceLeft,
2244 Basicvideo_put_SourceWidth,
2245 Basicvideo_get_SourceWidth,
2246 Basicvideo_put_SourceTop,
2247 Basicvideo_get_SourceTop,
2248 Basicvideo_put_SourceHeight,
2249 Basicvideo_get_SourceHeight,
2250 Basicvideo_put_DestinationLeft,
2251 Basicvideo_get_DestinationLeft,
2252 Basicvideo_put_DestinationWidth,
2253 Basicvideo_get_DestinationWidth,
2254 Basicvideo_put_DestinationTop,
2255 Basicvideo_get_DestinationTop,
2256 Basicvideo_put_DestinationHeight,
2257 Basicvideo_get_DestinationHeight,
2258 Basicvideo_SetSourcePosition,
2259 Basicvideo_GetSourcePosition,
2260 Basicvideo_SetDefaultSourcePosition,
2261 Basicvideo_SetDestinationPosition,
2262 Basicvideo_GetDestinationPosition,
2263 Basicvideo_SetDefaultDestinationPosition,
2264 Basicvideo_GetVideoSize,
2265 Basicvideo_GetVideoPaletteEntries,
2266 Basicvideo_GetCurrentImage,
2267 Basicvideo_IsUsingDefaultSource,
2268 Basicvideo_IsUsingDefaultDestination
2272 /*** IUnknown methods ***/
2273 static HRESULT WINAPI Videowindow_QueryInterface(IVideoWindow *iface,
2276 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2278 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
2280 return Filtergraph_QueryInterface(This, riid, ppvObj);
2283 static ULONG WINAPI Videowindow_AddRef(IVideoWindow *iface) {
2284 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2286 TRACE("(%p/%p)->()\n", This, iface);
2288 return Filtergraph_AddRef(This);
2291 static ULONG WINAPI Videowindow_Release(IVideoWindow *iface) {
2292 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2294 TRACE("(%p/%p)->()\n", This, iface);
2296 return Filtergraph_Release(This);
2299 /*** IDispatch methods ***/
2300 static HRESULT WINAPI Videowindow_GetTypeInfoCount(IVideoWindow *iface,
2302 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2304 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
2309 static HRESULT WINAPI Videowindow_GetTypeInfo(IVideoWindow *iface,
2312 ITypeInfo**ppTInfo) {
2313 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2315 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
2320 static HRESULT WINAPI Videowindow_GetIDsOfNames(IVideoWindow *iface,
2326 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2328 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
2333 static HRESULT WINAPI Videowindow_Invoke(IVideoWindow *iface,
2334 DISPID dispIdMember,
2338 DISPPARAMS*pDispParams,
2340 EXCEPINFO*pExepInfo,
2342 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2344 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);
2349 /*** IVideoWindow methods ***/
2350 static HRESULT WINAPI Videowindow_put_Caption(IVideoWindow *iface,
2352 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2354 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This, iface, debugstr_w(strCaption), strCaption);
2359 static HRESULT WINAPI Videowindow_get_Caption(IVideoWindow *iface,
2361 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2363 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, strCaption);
2368 static HRESULT WINAPI Videowindow_put_WindowStyle(IVideoWindow *iface,
2370 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2372 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowStyle);
2377 static HRESULT WINAPI Videowindow_get_WindowStyle(IVideoWindow *iface,
2378 long *WindowStyle) {
2379 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2381 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowStyle);
2386 static HRESULT WINAPI Videowindow_put_WindowStyleEx(IVideoWindow *iface,
2387 long WindowStyleEx) {
2388 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2390 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowStyleEx);
2395 static HRESULT WINAPI Videowindow_get_WindowStyleEx(IVideoWindow *iface,
2396 long *WindowStyleEx) {
2397 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2399 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowStyleEx);
2404 static HRESULT WINAPI Videowindow_put_AutoShow(IVideoWindow *iface,
2406 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2408 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, AutoShow);
2413 static HRESULT WINAPI Videowindow_get_AutoShow(IVideoWindow *iface,
2415 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2417 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, AutoShow);
2422 static HRESULT WINAPI Videowindow_put_WindowState(IVideoWindow *iface,
2424 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2426 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowState);
2431 static HRESULT WINAPI Videowindow_get_WindowState(IVideoWindow *iface,
2432 long *WindowState) {
2433 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2435 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowState);
2440 static HRESULT WINAPI Videowindow_put_BackgroundPalette(IVideoWindow *iface,
2441 long BackgroundPalette) {
2442 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2444 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, BackgroundPalette);
2449 static HRESULT WINAPI Videowindow_get_BackgroundPalette(IVideoWindow *iface,
2450 long *pBackgroundPalette) {
2451 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2453 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBackgroundPalette);
2458 static HRESULT WINAPI Videowindow_put_Visible(IVideoWindow *iface,
2460 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2462 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Visible);
2467 static HRESULT WINAPI Videowindow_get_Visible(IVideoWindow *iface,
2469 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2471 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVisible);
2476 static HRESULT WINAPI Videowindow_put_Left(IVideoWindow *iface,
2478 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2480 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Left);
2485 static HRESULT WINAPI Videowindow_get_Left(IVideoWindow *iface,
2487 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2489 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pLeft);
2494 static HRESULT WINAPI Videowindow_put_Width(IVideoWindow *iface,
2496 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2498 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Width);
2503 static HRESULT WINAPI Videowindow_get_Width(IVideoWindow *iface,
2505 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2507 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pWidth);
2512 static HRESULT WINAPI Videowindow_put_Top(IVideoWindow *iface,
2514 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2516 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Top);
2521 static HRESULT WINAPI Videowindow_get_Top(IVideoWindow *iface,
2523 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2525 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pTop);
2530 static HRESULT WINAPI Videowindow_put_Height(IVideoWindow *iface,
2532 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2534 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Height);
2539 static HRESULT WINAPI Videowindow_get_Height(IVideoWindow *iface,
2541 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2543 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pHeight);
2548 static HRESULT WINAPI Videowindow_put_Owner(IVideoWindow *iface,
2550 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2552 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Owner);
2557 static HRESULT WINAPI Videowindow_get_Owner(IVideoWindow *iface,
2559 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2561 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Owner);
2566 static HRESULT WINAPI Videowindow_put_MessageDrain(IVideoWindow *iface,
2568 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2570 TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Drain);
2575 static HRESULT WINAPI Videowindow_get_MessageDrain(IVideoWindow *iface,
2577 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2579 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, Drain);
2584 static HRESULT WINAPI Videowindow_get_BorderColor(IVideoWindow *iface,
2586 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2588 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, Color);
2593 static HRESULT WINAPI Videowindow_put_BorderColor(IVideoWindow *iface,
2595 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2597 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Color);
2602 static HRESULT WINAPI Videowindow_get_FullScreenMode(IVideoWindow *iface,
2603 long *FullScreenMode) {
2604 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2606 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, FullScreenMode);
2611 static HRESULT WINAPI Videowindow_put_FullScreenMode(IVideoWindow *iface,
2612 long FullScreenMode) {
2613 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2615 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, FullScreenMode);
2620 static HRESULT WINAPI Videowindow_SetWindowForeground(IVideoWindow *iface,
2622 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2624 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Focus);
2629 static HRESULT WINAPI Videowindow_NotifyOwnerMessage(IVideoWindow *iface,
2634 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2636 TRACE("(%p/%p)->(%08lx, %ld, %08lx, %08lx): stub !!!\n", This, iface, (DWORD) hwnd, uMsg, wParam, lParam);
2641 static HRESULT WINAPI Videowindow_SetWindowPosition(IVideoWindow *iface,
2646 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2648 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
2653 static HRESULT WINAPI Videowindow_GetWindowPosition(IVideoWindow *iface,
2658 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2660 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2665 static HRESULT WINAPI Videowindow_GetMinIdealImageSize(IVideoWindow *iface,
2668 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2670 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2675 static HRESULT WINAPI Videowindow_GetMaxIdealImageSize(IVideoWindow *iface,
2678 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2680 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
2685 static HRESULT WINAPI Videowindow_GetRestorePosition(IVideoWindow *iface,
2690 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2692 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2697 static HRESULT WINAPI Videowindow_HideCursor(IVideoWindow *iface,
2699 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2701 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, HideCursor);
2706 static HRESULT WINAPI Videowindow_IsCursorHidden(IVideoWindow *iface,
2707 long *CursorHidden) {
2708 ICOM_THIS_MULTI(IFilterGraphImpl, IVideoWindow_vtbl, iface);
2710 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, CursorHidden);
2716 static const IVideoWindowVtbl IVideoWindow_VTable =
2718 Videowindow_QueryInterface,
2720 Videowindow_Release,
2721 Videowindow_GetTypeInfoCount,
2722 Videowindow_GetTypeInfo,
2723 Videowindow_GetIDsOfNames,
2725 Videowindow_put_Caption,
2726 Videowindow_get_Caption,
2727 Videowindow_put_WindowStyle,
2728 Videowindow_get_WindowStyle,
2729 Videowindow_put_WindowStyleEx,
2730 Videowindow_get_WindowStyleEx,
2731 Videowindow_put_AutoShow,
2732 Videowindow_get_AutoShow,
2733 Videowindow_put_WindowState,
2734 Videowindow_get_WindowState,
2735 Videowindow_put_BackgroundPalette,
2736 Videowindow_get_BackgroundPalette,
2737 Videowindow_put_Visible,
2738 Videowindow_get_Visible,
2739 Videowindow_put_Left,
2740 Videowindow_get_Left,
2741 Videowindow_put_Width,
2742 Videowindow_get_Width,
2743 Videowindow_put_Top,
2744 Videowindow_get_Top,
2745 Videowindow_put_Height,
2746 Videowindow_get_Height,
2747 Videowindow_put_Owner,
2748 Videowindow_get_Owner,
2749 Videowindow_put_MessageDrain,
2750 Videowindow_get_MessageDrain,
2751 Videowindow_get_BorderColor,
2752 Videowindow_put_BorderColor,
2753 Videowindow_get_FullScreenMode,
2754 Videowindow_put_FullScreenMode,
2755 Videowindow_SetWindowForeground,
2756 Videowindow_NotifyOwnerMessage,
2757 Videowindow_SetWindowPosition,
2758 Videowindow_GetWindowPosition,
2759 Videowindow_GetMinIdealImageSize,
2760 Videowindow_GetMaxIdealImageSize,
2761 Videowindow_GetRestorePosition,
2762 Videowindow_HideCursor,
2763 Videowindow_IsCursorHidden
2767 /*** IUnknown methods ***/
2768 static HRESULT WINAPI Mediaevent_QueryInterface(IMediaEventEx *iface,
2771 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2773 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
2775 return Filtergraph_QueryInterface(This, riid, ppvObj);
2778 static ULONG WINAPI Mediaevent_AddRef(IMediaEventEx *iface) {
2779 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2781 TRACE("(%p/%p)->()\n", This, iface);
2783 return Filtergraph_AddRef(This);
2786 static ULONG WINAPI Mediaevent_Release(IMediaEventEx *iface) {
2787 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2789 TRACE("(%p/%p)->()\n", This, iface);
2791 return Filtergraph_Release(This);
2794 /*** IDispatch methods ***/
2795 static HRESULT WINAPI Mediaevent_GetTypeInfoCount(IMediaEventEx *iface,
2797 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2799 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
2804 static HRESULT WINAPI Mediaevent_GetTypeInfo(IMediaEventEx *iface,
2807 ITypeInfo**ppTInfo) {
2808 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2810 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
2815 static HRESULT WINAPI Mediaevent_GetIDsOfNames(IMediaEventEx *iface,
2821 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2823 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
2828 static HRESULT WINAPI Mediaevent_Invoke(IMediaEventEx *iface,
2829 DISPID dispIdMember,
2833 DISPPARAMS*pDispParams,
2835 EXCEPINFO*pExepInfo,
2837 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2839 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);
2844 /*** IMediaEvent methods ***/
2845 static HRESULT WINAPI Mediaevent_GetEventHandle(IMediaEventEx *iface,
2847 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2849 TRACE("(%p/%p)->(%p)\n", This, iface, hEvent);
2851 *hEvent = (OAEVENT)This->evqueue.msg_event;
2856 static HRESULT WINAPI Mediaevent_GetEvent(IMediaEventEx *iface,
2861 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2864 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This, iface, lEventCode, lParam1, lParam2, msTimeout);
2866 if (EventsQueue_GetEvent(&This->evqueue, &evt, msTimeout))
2868 *lEventCode = evt.lEventCode;
2869 *lParam1 = evt.lParam1;
2870 *lParam2 = evt.lParam2;
2878 static HRESULT WINAPI Mediaevent_WaitForCompletion(IMediaEventEx *iface,
2881 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2883 TRACE("(%p/%p)->(%ld, %p)\n", This, iface, msTimeout, pEvCode);
2885 if (WaitForSingleObject(This->hEventCompletion, msTimeout) == WAIT_OBJECT_0)
2887 *pEvCode = This->CompletionStatus;
2895 static HRESULT WINAPI Mediaevent_CancelDefaultHandling(IMediaEventEx *iface,
2897 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2899 TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode);
2901 if (lEvCode == EC_COMPLETE)
2902 This->HandleEcComplete = FALSE;
2903 else if (lEvCode == EC_REPAINT)
2904 This->HandleEcRepaint = FALSE;
2911 static HRESULT WINAPI Mediaevent_RestoreDefaultHandling(IMediaEventEx *iface,
2913 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2915 TRACE("(%p/%p)->(%ld)\n", This, iface, lEvCode);
2917 if (lEvCode == EC_COMPLETE)
2918 This->HandleEcComplete = TRUE;
2919 else if (lEvCode == EC_REPAINT)
2920 This->HandleEcRepaint = TRUE;
2927 static HRESULT WINAPI Mediaevent_FreeEventParams(IMediaEventEx *iface,
2931 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2933 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This, iface, lEvCode, lParam1, lParam2);
2938 /*** IMediaEventEx methods ***/
2939 static HRESULT WINAPI Mediaevent_SetNotifyWindow(IMediaEventEx *iface,
2942 LONG_PTR lInstanceData) {
2943 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2945 TRACE("(%p/%p)->(%08lx, %ld, %08lx)\n", This, iface, (DWORD) hwnd, lMsg, lInstanceData);
2947 This->notif.hWnd = (HWND)hwnd;
2948 This->notif.msg = lMsg;
2949 This->notif.instance = (long) lInstanceData;
2954 static HRESULT WINAPI Mediaevent_SetNotifyFlags(IMediaEventEx *iface,
2955 long lNoNotifyFlags) {
2956 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2958 TRACE("(%p/%p)->(%ld)\n", This, iface, lNoNotifyFlags);
2960 if ((lNoNotifyFlags != 0) || (lNoNotifyFlags != 1))
2961 return E_INVALIDARG;
2963 This->notif.disabled = lNoNotifyFlags;
2968 static HRESULT WINAPI Mediaevent_GetNotifyFlags(IMediaEventEx *iface,
2969 long *lplNoNotifyFlags) {
2970 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
2972 TRACE("(%p/%p)->(%p)\n", This, iface, lplNoNotifyFlags);
2974 if (!lplNoNotifyFlags)
2977 *lplNoNotifyFlags = This->notif.disabled;
2983 static const IMediaEventExVtbl IMediaEventEx_VTable =
2985 Mediaevent_QueryInterface,
2988 Mediaevent_GetTypeInfoCount,
2989 Mediaevent_GetTypeInfo,
2990 Mediaevent_GetIDsOfNames,
2992 Mediaevent_GetEventHandle,
2993 Mediaevent_GetEvent,
2994 Mediaevent_WaitForCompletion,
2995 Mediaevent_CancelDefaultHandling,
2996 Mediaevent_RestoreDefaultHandling,
2997 Mediaevent_FreeEventParams,
2998 Mediaevent_SetNotifyWindow,
2999 Mediaevent_SetNotifyFlags,
3000 Mediaevent_GetNotifyFlags
3004 static HRESULT WINAPI MediaFilter_QueryInterface(IMediaFilter *iface, REFIID riid, LPVOID *ppv)
3006 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
3008 return Filtergraph_QueryInterface(This, riid, ppv);
3011 static ULONG WINAPI MediaFilter_AddRef(IMediaFilter *iface)
3013 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
3015 return Filtergraph_AddRef(This);
3018 static ULONG WINAPI MediaFilter_Release(IMediaFilter *iface)
3020 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventEx_vtbl, iface);
3022 return Filtergraph_Release(This);
3025 static HRESULT WINAPI MediaFilter_GetClassID(IMediaFilter *iface, CLSID * pClassID)
3027 FIXME("(%p): stub\n", pClassID);
3032 static HRESULT WINAPI MediaFilter_Stop(IMediaFilter *iface)
3034 FIXME("(): stub\n");
3039 static HRESULT WINAPI MediaFilter_Pause(IMediaFilter *iface)
3041 FIXME("(): stub\n");
3046 static HRESULT WINAPI MediaFilter_Run(IMediaFilter *iface, REFERENCE_TIME tStart)
3048 FIXME("(%lld): stub\n", tStart);
3053 static HRESULT WINAPI MediaFilter_GetState(IMediaFilter *iface, DWORD dwMsTimeout, FILTER_STATE * pState)
3055 FIXME("(%ld, %p): stub\n", dwMsTimeout, pState);
3060 static HRESULT WINAPI MediaFilter_SetSyncSource(IMediaFilter *iface, IReferenceClock *pClock)
3062 FIXME("(%p): stub\n", pClock);
3067 static HRESULT WINAPI MediaFilter_GetSyncSource(IMediaFilter *iface, IReferenceClock **ppClock)
3069 FIXME("(%p): stub\n", ppClock);
3074 static const IMediaFilterVtbl IMediaFilter_VTable =
3076 MediaFilter_QueryInterface,
3078 MediaFilter_Release,
3079 MediaFilter_GetClassID,
3083 MediaFilter_GetState,
3084 MediaFilter_SetSyncSource,
3085 MediaFilter_GetSyncSource
3088 static HRESULT WINAPI MediaEventSink_QueryInterface(IMediaEventSink *iface, REFIID riid, LPVOID *ppv)
3090 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
3092 return Filtergraph_QueryInterface(This, riid, ppv);
3095 static ULONG WINAPI MediaEventSink_AddRef(IMediaEventSink *iface)
3097 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
3099 return Filtergraph_AddRef(This);
3102 static ULONG WINAPI MediaEventSink_Release(IMediaEventSink *iface)
3104 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
3106 return Filtergraph_Release(This);
3109 static HRESULT WINAPI MediaEventSink_Notify(IMediaEventSink *iface, long EventCode, LONG_PTR EventParam1, LONG_PTR EventParam2)
3111 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
3114 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This, iface, EventCode, EventParam1, EventParam2);
3116 /* We need thread safety here, let's use the events queue's one */
3117 EnterCriticalSection(&This->evqueue.msg_crst);
3119 if ((EventCode == EC_COMPLETE) && This->HandleEcComplete)
3121 TRACE("Process EC_COMPLETE notification\n");
3122 if (++This->EcCompleteCount == This->nRenderers)
3124 evt.lEventCode = EC_COMPLETE;
3127 TRACE("Send EC_COMPLETE to app\n");
3128 EventsQueue_PutEvent(&This->evqueue, &evt);
3129 if (!This->notif.disabled && This->notif.hWnd)
3131 TRACE("Send Window message\n");
3132 PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
3134 This->CompletionStatus = EC_COMPLETE;
3135 SetEvent(This->hEventCompletion);
3138 else if ((EventCode == EC_REPAINT) && This->HandleEcRepaint)
3140 /* FIXME: Not handled yet */
3144 evt.lEventCode = EventCode;
3145 evt.lParam1 = EventParam1;
3146 evt.lParam2 = EventParam2;
3147 EventsQueue_PutEvent(&This->evqueue, &evt);
3148 if (!This->notif.disabled && This->notif.hWnd)
3149 PostMessageW(This->notif.hWnd, This->notif.msg, 0, This->notif.instance);
3152 LeaveCriticalSection(&This->evqueue.msg_crst);
3156 static const IMediaEventSinkVtbl IMediaEventSink_VTable =
3158 MediaEventSink_QueryInterface,
3159 MediaEventSink_AddRef,
3160 MediaEventSink_Release,
3161 MediaEventSink_Notify
3164 static HRESULT WINAPI GraphConfig_QueryInterface(IGraphConfig *iface, REFIID riid, LPVOID *ppv)
3166 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
3168 return Filtergraph_QueryInterface(This, riid, ppv);
3171 static ULONG WINAPI GraphConfig_AddRef(IGraphConfig *iface)
3173 ICOM_THIS_MULTI(IFilterGraphImpl, IMediaEventSink_vtbl, iface);
3175 return Filtergraph_AddRef(This);
3178 static ULONG WINAPI GraphConfig_Release(IGraphConfig *iface)
3180 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
3182 return Filtergraph_Release(This);
3185 static HRESULT WINAPI GraphConfig_Reconnect(IGraphConfig *iface,
3188 const AM_MEDIA_TYPE* pmtFirstConnection,
3189 IBaseFilter* pUsingFilter,
3193 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
3195 FIXME("(%p)->(%p, %p, %p, %p, %p, %lx): stub!\n", This, pOutputPin, pInputPin, pmtFirstConnection, pUsingFilter, hAbortEvent, dwFlags);
3200 static HRESULT WINAPI GraphConfig_Reconfigure(IGraphConfig *iface,
3201 IGraphConfigCallback* pCallback,
3206 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
3208 FIXME("(%p)->(%p, %p, %lx, %p): stub!\n", This, pCallback, pvContext, dwFlags, hAbortEvent);
3213 static HRESULT WINAPI GraphConfig_AddFilterToCache(IGraphConfig *iface,
3214 IBaseFilter* pFilter)
3216 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
3218 FIXME("(%p)->(%p): stub!\n", This, pFilter);
3223 static HRESULT WINAPI GraphConfig_EnumCacheFilter(IGraphConfig *iface,
3224 IEnumFilters** pEnum)
3226 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
3228 FIXME("(%p)->(%p): stub!\n", This, pEnum);
3233 static HRESULT WINAPI GraphConfig_RemoveFilterFromCache(IGraphConfig *iface,
3234 IBaseFilter* pFilter)
3236 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
3238 FIXME("(%p)->(%p): stub!\n", This, pFilter);
3243 static HRESULT WINAPI GraphConfig_GetStartTime(IGraphConfig *iface,
3244 REFERENCE_TIME* prtStart)
3246 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
3248 FIXME("(%p)->(%p): stub!\n", This, prtStart);
3253 static HRESULT WINAPI GraphConfig_PushThroughData(IGraphConfig *iface,
3255 IPinConnection* pConnection,
3258 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
3260 FIXME("(%p)->(%p, %p, %p): stub!\n", This, pOutputPin, pConnection, hEventAbort);
3265 static HRESULT WINAPI GraphConfig_SetFilterFlags(IGraphConfig *iface,
3266 IBaseFilter* pFilter,
3269 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
3271 FIXME("(%p)->(%p, %lx): stub!\n", This, pFilter, dwFlags);
3276 static HRESULT WINAPI GraphConfig_GetFilterFlags(IGraphConfig *iface,
3277 IBaseFilter* pFilter,
3280 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
3282 FIXME("(%p)->(%p, %p): stub!\n", This, pFilter, dwFlags);
3287 static HRESULT WINAPI GraphConfig_RemoveFilterEx(IGraphConfig *iface,
3288 IBaseFilter* pFilter,
3291 ICOM_THIS_MULTI(IFilterGraphImpl, IGraphConfig_vtbl, iface);
3293 FIXME("(%p)->(%p, %lx): stub!\n", This, pFilter, dwFlags);
3298 static const IGraphConfigVtbl IGraphConfig_VTable =
3300 GraphConfig_QueryInterface,
3302 GraphConfig_Release,
3303 GraphConfig_Reconnect,
3304 GraphConfig_Reconfigure,
3305 GraphConfig_AddFilterToCache,
3306 GraphConfig_EnumCacheFilter,
3307 GraphConfig_RemoveFilterFromCache,
3308 GraphConfig_GetStartTime,
3309 GraphConfig_PushThroughData,
3310 GraphConfig_SetFilterFlags,
3311 GraphConfig_GetFilterFlags,
3312 GraphConfig_RemoveFilterEx
3315 /* This is the only function that actually creates a FilterGraph class... */
3316 HRESULT FilterGraph_create(IUnknown *pUnkOuter, LPVOID *ppObj)
3318 IFilterGraphImpl *fimpl;
3321 TRACE("(%p,%p)\n", pUnkOuter, ppObj);
3324 return CLASS_E_NOAGGREGATION;
3326 fimpl = HeapAlloc(GetProcessHeap(), 0, sizeof(*fimpl));
3327 fimpl->IGraphBuilder_vtbl = &IGraphBuilder_VTable;
3328 fimpl->IMediaControl_vtbl = &IMediaControl_VTable;
3329 fimpl->IMediaSeeking_vtbl = &IMediaSeeking_VTable;
3330 fimpl->IBasicAudio_vtbl = &IBasicAudio_VTable;
3331 fimpl->IBasicVideo_vtbl = &IBasicVideo_VTable;
3332 fimpl->IVideoWindow_vtbl = &IVideoWindow_VTable;
3333 fimpl->IMediaEventEx_vtbl = &IMediaEventEx_VTable;
3334 fimpl->IMediaFilter_vtbl = &IMediaFilter_VTable;
3335 fimpl->IMediaEventSink_vtbl = &IMediaEventSink_VTable;
3336 fimpl->IGraphConfig_vtbl = &IGraphConfig_VTable;
3338 fimpl->ppFiltersInGraph = NULL;
3339 fimpl->pFilterNames = NULL;
3340 fimpl->nFilters = 0;
3341 fimpl->filterCapacity = 0;
3342 fimpl->nameIndex = 1;
3343 fimpl->hEventCompletion = CreateEventW(0, TRUE, FALSE, 0);
3344 fimpl->HandleEcComplete = TRUE;
3345 fimpl->HandleEcRepaint = TRUE;
3346 fimpl->notif.hWnd = 0;
3347 fimpl->notif.disabled = FALSE;
3348 fimpl->nRenderers = 0;
3349 fimpl->EcCompleteCount = 0;
3350 fimpl->state = State_Stopped;
3351 EventsQueue_Init(&fimpl->evqueue);
3352 InitializeCriticalSection(&fimpl->cs);
3354 hr = CoCreateInstance(&CLSID_FilterMapper, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterMapper2, (LPVOID*)&fimpl->pFilterMapper2);
3356 ERR("Unable to create filter mapper (%lx)\n", hr);
3364 HRESULT FilterGraphNoThread_create(IUnknown *pUnkOuter, LPVOID *ppObj)
3366 FIXME("CLSID_FilterGraphNoThread partially implemented - Forwarding to CLSID_FilterGraph\n");
3367 return FilterGraph_create(pUnkOuter, ppObj);