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
;
186 static HRESULT
Filtergraph_QueryInterface(IFilterGraphImpl
*This
,
189 TRACE("(%p)->(%s (%p), %p)\n", This
, debugstr_guid(riid
), riid
, ppvObj
);
191 if (IsEqualGUID(&IID_IUnknown
, riid
) ||
192 IsEqualGUID(&IID_IFilterGraph
, riid
) ||
193 IsEqualGUID(&IID_IGraphBuilder
, riid
)) {
194 *ppvObj
= &(This
->IGraphBuilder_vtbl
);
195 TRACE(" returning IGraphBuilder interface (%p)\n", *ppvObj
);
196 } else if (IsEqualGUID(&IID_IMediaControl
, riid
)) {
197 *ppvObj
= &(This
->IMediaControl_vtbl
);
198 TRACE(" returning IMediaControl interface (%p)\n", *ppvObj
);
199 } else if (IsEqualGUID(&IID_IMediaSeeking
, riid
)) {
200 *ppvObj
= &(This
->IMediaSeeking_vtbl
);
201 TRACE(" returning IMediaSeeking interface (%p)\n", *ppvObj
);
202 } else if (IsEqualGUID(&IID_IBasicAudio
, riid
)) {
203 *ppvObj
= &(This
->IBasicAudio_vtbl
);
204 TRACE(" returning IBasicAudio interface (%p)\n", *ppvObj
);
205 } else if (IsEqualGUID(&IID_IBasicVideo
, riid
)) {
206 *ppvObj
= &(This
->IBasicVideo_vtbl
);
207 TRACE(" returning IBasicVideo interface (%p)\n", *ppvObj
);
208 } else if (IsEqualGUID(&IID_IVideoWindow
, riid
)) {
209 *ppvObj
= &(This
->IVideoWindow_vtbl
);
210 TRACE(" returning IVideoWindow interface (%p)\n", *ppvObj
);
211 } else if (IsEqualGUID(&IID_IMediaEvent
, riid
) ||
212 IsEqualGUID(&IID_IMediaEventEx
, riid
)) {
213 *ppvObj
= &(This
->IMediaEventEx_vtbl
);
214 TRACE(" returning IMediaEvent(Ex) interface (%p)\n", *ppvObj
);
215 } else if (IsEqualGUID(&IID_IMediaFilter
, riid
) ||
216 IsEqualGUID(&IID_IPersist
, riid
)) {
217 *ppvObj
= &(This
->IMediaFilter_vtbl
);
218 TRACE(" returning IMediaFilter interface (%p)\n", *ppvObj
);
219 } else if (IsEqualGUID(&IID_IMediaEventSink
, riid
)) {
220 *ppvObj
= &(This
->IMediaEventSink_vtbl
);
221 TRACE(" returning IMediaEventSink interface (%p)\n", *ppvObj
);
224 FIXME("unknown interface %s\n", debugstr_guid(riid
));
225 return E_NOINTERFACE
;
232 static ULONG
Filtergraph_AddRef(IFilterGraphImpl
*This
) {
233 TRACE("(%p)->(): new ref = %ld\n", This
, This
->ref
+ 1);
238 static ULONG
Filtergraph_Release(IFilterGraphImpl
*This
) {
241 TRACE("(%p)->(): new ref = %ld\n", This
, This
->ref
- 1);
245 IFilterMapper2_Release(This
->pFilterMapper2
);
246 CloseHandle(This
->hEventCompletion
);
247 EventsQueue_Destroy(&This
->evqueue
);
248 HeapFree(GetProcessHeap(), 0, This
->ppFiltersInGraph
);
249 HeapFree(GetProcessHeap(), 0, This
->pFilterNames
);
250 HeapFree(GetProcessHeap(), 0, This
);
256 /*** IUnknown methods ***/
257 static HRESULT WINAPI
Graphbuilder_QueryInterface(IGraphBuilder
*iface
,
260 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
262 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
263 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
266 static ULONG WINAPI
Graphbuilder_AddRef(IGraphBuilder
*iface
) {
267 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
269 TRACE("(%p/%p)->() calling FilterGraph AddRef\n", This
, iface
);
271 return Filtergraph_AddRef(This
);
274 static ULONG WINAPI
Graphbuilder_Release(IGraphBuilder
*iface
) {
275 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
277 TRACE("(%p/%p)->() calling FilterGraph Release\n", This
, iface
);
279 return Filtergraph_Release(This
);
282 /*** IFilterGraph methods ***/
283 static HRESULT WINAPI
Graphbuilder_AddFilter(IGraphBuilder
*iface
,
284 IBaseFilter
*pFilter
,
286 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
289 WCHAR
* wszFilterName
= NULL
;
290 int duplicate_name
= FALSE
;
292 TRACE("(%p/%p)->(%p, %s (%p))\n", This
, iface
, pFilter
, debugstr_w(pName
), pName
);
294 wszFilterName
= (WCHAR
*) CoTaskMemAlloc( (pName
? strlenW(pName
) + 6 : 5) * sizeof(WCHAR
) );
298 /* Check if name already exists */
299 for(i
= 0; i
< This
->nFilters
; i
++)
300 if (!strcmpW(This
->pFilterNames
[i
], pName
))
302 duplicate_name
= TRUE
;
307 /* If no name given or name already existing, generate one */
308 if (!pName
|| duplicate_name
)
310 static const WCHAR wszFmt1
[] = {'%','s',' ','%','0','4','d',0};
311 static const WCHAR wszFmt2
[] = {'%','0','4','d',0};
313 for (j
= 0; j
< 10000 ; j
++)
317 sprintfW(wszFilterName
, wszFmt1
, pName
, This
->nameIndex
);
319 sprintfW(wszFilterName
, wszFmt2
, This
->nameIndex
);
320 TRACE("Generated name %s\n", debugstr_w(wszFilterName
));
322 /* Check if the generated name already exists */
323 for(i
= 0; i
< This
->nFilters
; i
++)
324 if (!strcmpW(This
->pFilterNames
[i
], wszFilterName
))
327 /* Compute next index and exit if generated name is suitable */
328 if (This
->nameIndex
++ == 10000)
330 if (i
== This
->nFilters
)
333 /* Unable to find a suitable name */
336 CoTaskMemFree(wszFilterName
);
337 return VFW_E_DUPLICATE_NAME
;
341 memcpy(wszFilterName
, pName
, (strlenW(pName
) + 1) * sizeof(WCHAR
));
343 if (This
->nFilters
+ 1 > This
->filterCapacity
)
345 int newCapacity
= 2*This
->filterCapacity
;
346 IBaseFilter
** ppNewFilters
= CoTaskMemAlloc(newCapacity
* sizeof(IBaseFilter
*));
347 LPWSTR
* pNewNames
= CoTaskMemAlloc(newCapacity
* sizeof(LPWSTR
));
348 memcpy(ppNewFilters
, This
->ppFiltersInGraph
, This
->nFilters
* sizeof(IBaseFilter
*));
349 memcpy(pNewNames
, This
->pFilterNames
, This
->nFilters
* sizeof(LPWSTR
));
350 CoTaskMemFree(This
->ppFiltersInGraph
);
351 CoTaskMemFree(This
->pFilterNames
);
352 This
->ppFiltersInGraph
= ppNewFilters
;
353 This
->pFilterNames
= pNewNames
;
354 This
->filterCapacity
= newCapacity
;
357 hr
= IBaseFilter_JoinFilterGraph(pFilter
, (IFilterGraph
*)This
, wszFilterName
);
361 IBaseFilter_AddRef(pFilter
);
362 This
->ppFiltersInGraph
[This
->nFilters
] = pFilter
;
363 This
->pFilterNames
[This
->nFilters
] = wszFilterName
;
367 CoTaskMemFree(wszFilterName
);
369 if (SUCCEEDED(hr
) && duplicate_name
)
370 return VFW_S_DUPLICATE_NAME
;
375 static HRESULT WINAPI
Graphbuilder_RemoveFilter(IGraphBuilder
*iface
,
376 IBaseFilter
*pFilter
) {
377 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
381 TRACE("(%p/%p)->(%p)\n", This
, iface
, pFilter
);
383 /* FIXME: check graph is stopped */
385 for (i
= 0; i
< This
->nFilters
; i
++)
387 if (This
->ppFiltersInGraph
[i
] == pFilter
)
389 /* FIXME: disconnect pins */
390 hr
= IBaseFilter_JoinFilterGraph(pFilter
, NULL
, This
->pFilterNames
[i
]);
393 IPin_Release(pFilter
);
394 CoTaskMemFree(This
->pFilterNames
[i
]);
395 memmove(This
->ppFiltersInGraph
+i
, This
->ppFiltersInGraph
+i
+1, sizeof(IBaseFilter
*)*(This
->nFilters
- 1 - i
));
396 memmove(This
->pFilterNames
+i
, This
->pFilterNames
+i
+1, sizeof(LPWSTR
)*(This
->nFilters
- 1 - i
));
404 return hr
; /* FIXME: check this error code */
407 static HRESULT WINAPI
Graphbuilder_EnumFilters(IGraphBuilder
*iface
,
408 IEnumFilters
**ppEnum
) {
409 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
411 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppEnum
);
413 return IEnumFiltersImpl_Construct(This
->ppFiltersInGraph
, This
->nFilters
, ppEnum
);
416 static HRESULT WINAPI
Graphbuilder_FindFilterByName(IGraphBuilder
*iface
,
418 IBaseFilter
**ppFilter
) {
419 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
422 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_w(pName
), pName
, ppFilter
);
426 for (i
= 0; i
< This
->nFilters
; i
++)
428 if (!strcmpW(pName
, This
->pFilterNames
[i
]))
430 *ppFilter
= This
->ppFiltersInGraph
[i
];
431 IBaseFilter_AddRef(*ppFilter
);
436 return E_FAIL
; /* FIXME: check this error code */
439 /* NOTE: despite the implication, it doesn't matter which
440 * way round you put in the input and output pins */
441 static HRESULT WINAPI
Graphbuilder_ConnectDirect(IGraphBuilder
*iface
,
444 const AM_MEDIA_TYPE
*pmt
) {
448 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
450 TRACE("(%p/%p)->(%p, %p, %p)\n", This
, iface
, ppinIn
, ppinOut
, pmt
);
452 /* FIXME: check pins are in graph */
454 hr
= IPin_QueryDirection(ppinIn
, &dir
);
457 if (dir
== PINDIR_INPUT
)
458 hr
= IPin_Connect(ppinOut
, ppinIn
, pmt
);
460 hr
= IPin_Connect(ppinIn
, ppinOut
, pmt
);
466 static HRESULT WINAPI
Graphbuilder_Reconnect(IGraphBuilder
*iface
,
468 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
470 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppin
);
475 static HRESULT WINAPI
Graphbuilder_Disconnect(IGraphBuilder
*iface
,
477 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
479 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppin
);
481 return IPin_Disconnect(ppin
);
484 static HRESULT WINAPI
Graphbuilder_SetDefaultSyncSource(IGraphBuilder
*iface
) {
485 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
487 TRACE("(%p/%p)->(): stub !!!\n", iface
, This
);
492 static HRESULT
GetFilterInfo(IMoniker
* pMoniker
, GUID
* pclsid
, VARIANT
* pvar
)
494 static const WCHAR wszClsidName
[] = {'C','L','S','I','D',0};
495 static const WCHAR wszFriendlyName
[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
496 IPropertyBag
* pPropBagCat
= NULL
;
500 V_VT(pvar
) = VT_BSTR
;
502 hr
= IMoniker_BindToStorage(pMoniker
, NULL
, NULL
, &IID_IPropertyBag
, (LPVOID
*)&pPropBagCat
);
505 hr
= IPropertyBag_Read(pPropBagCat
, wszClsidName
, pvar
, NULL
);
508 hr
= CLSIDFromString(V_UNION(pvar
, bstrVal
), pclsid
);
511 hr
= IPropertyBag_Read(pPropBagCat
, wszFriendlyName
, pvar
, NULL
);
514 TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid
), debugstr_w(V_UNION(pvar
, bstrVal
)));
517 IPropertyBag_Release(pPropBagCat
);
522 static HRESULT
GetInternalConnections(IBaseFilter
* pfilter
, IPin
* poutputpin
, IPin
*** pppins
, ULONG
* pnb
)
528 hr
= IPin_QueryInternalConnections(poutputpin
, NULL
, &nb
);
531 } else if (hr
== S_FALSE
) {
532 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*nb
);
533 hr
= IPin_QueryInternalConnections(poutputpin
, *pppins
, &nb
);
535 ERR("Error (%lx)\n", hr
);
537 } else if (hr
== E_NOTIMPL
) {
538 /* Input connected to all outputs */
539 IEnumPins
* penumpins
;
542 TRACE("E_NOTIMPL\n");
543 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
545 ERR("filter Enumpins failed (%lx)\n", hr
);
549 /* Count output pins */
550 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
551 PIN_DIRECTION pindir
;
552 IPin_QueryDirection(ppin
, &pindir
);
553 if (pindir
== PINDIR_OUTPUT
)
558 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*i
);
559 /* Retreive output pins */
560 IEnumPins_Reset(penumpins
);
562 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
563 PIN_DIRECTION pindir
;
564 IPin_QueryDirection(ppin
, &pindir
);
565 if (pindir
== PINDIR_OUTPUT
)
566 (*pppins
)[i
++] = ppin
;
572 ERR("Next failed (%lx)\n", hr
);
575 IEnumPins_Release(penumpins
);
576 } else if (FAILED(hr
)) {
577 ERR("Cannot get internal connection (%lx)\n", hr
);
585 /*** IGraphBuilder methods ***/
586 static HRESULT WINAPI
Graphbuilder_Connect(IGraphBuilder
*iface
,
589 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
592 IEnumMediaTypes
* penummt
;
594 IEnumPins
* penumpins
;
595 IEnumMoniker
* pEnumMoniker
;
601 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, ppinOut
, ppinIn
);
603 /* Try direct connection first */
604 TRACE("Try direct connection first\n");
605 hr
= IPin_Connect(ppinOut
, ppinIn
, NULL
);
607 TRACE("Direct connection successfull\n");
610 TRACE("Direct connection failed, trying to insert other filters\n");
612 /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream
613 * filter to the minor mediatype of input pin of the renderer */
614 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
616 ERR("EnumMediaTypes (%lx)\n", hr
);
620 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
622 ERR("IEnumMediaTypes_Next (%lx)\n", hr
);
627 ERR("No media type found!\n");
630 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
631 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
633 /* Try to find a suitable filter that can connect to the pin to render */
634 tab
[0] = mt
->majortype
;
635 tab
[1] = mt
->subtype
;
636 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
638 ERR("Unable to enum filters (%lx)\n", hr
);
642 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
648 IBaseFilter
* pfilter
= NULL
;
650 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
651 IMoniker_Release(pMoniker
);
653 ERR("Unable to retreive filter info (%lx)\n", hr
);
657 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
659 ERR("Unable to create filter (%lx), trying next one\n", hr
);
663 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, NULL
);
665 ERR("Unable to add filter (%lx)\n", hr
);
666 IBaseFilter_Release(pfilter
);
671 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
673 ERR("Enumpins (%lx)\n", hr
);
676 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
678 ERR("Next (%lx)\n", hr
);
685 IEnumPins_Release(penumpins
);
687 hr
= IPin_Connect(ppinOut
, ppinfilter
, NULL
);
689 TRACE("Cannot connect to filter (%lx), trying next one\n", hr
);
692 TRACE("Successfully connected to filter, follow chain...\n");
694 /* Render all output pins of the filter by calling IGraphBuilder_Render on each of them */
695 hr
= GetInternalConnections(pfilter
, ppinfilter
, &ppins
, &nb
);
699 TRACE("pins to consider: %ld\n", nb
);
700 for(i
= 0; i
< nb
; i
++) {
701 TRACE("Processing pin %d\n", i
);
702 hr
= IGraphBuilder_Connect(iface
, ppins
[0], ppinIn
);
704 TRACE("Cannot render pin %p (%lx)\n", ppinfilter
, hr
);
708 CoTaskMemFree(ppins
);
714 IGraphBuilder_RemoveFilter(iface
, pfilter
);
715 IBaseFilter_Release(pfilter
);
719 IEnumMediaTypes_Release(penummt
);
725 static HRESULT WINAPI
Graphbuilder_Render(IGraphBuilder
*iface
,
727 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
728 IEnumMediaTypes
* penummt
;
733 IEnumMoniker
* pEnumMoniker
;
738 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppinOut
);
740 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
742 ERR("EnumMediaTypes (%lx)\n", hr
);
748 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
750 ERR("IEnumMediaTypes_Next (%lx)\n", hr
);
755 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
756 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
758 /* Try to find a suitable renderer with the same media type */
759 tab
[0] = mt
->majortype
;
761 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, TRUE
, FALSE
, 0, NULL
, NULL
, NULL
);
763 ERR("Unable to enum filters (%lx)\n", hr
);
767 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
772 IBaseFilter
* pfilter
= NULL
;
773 IEnumPins
* penumpins
;
776 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
777 IMoniker_Release(pMoniker
);
779 ERR("Unable to retreive filter info (%lx)\n", hr
);
783 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
785 ERR("Unable to create filter (%lx), trying next one\n", hr
);
789 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, NULL
);
791 ERR("Unable to add filter (%lx)\n", hr
);
792 IBaseFilter_Release(pfilter
);
797 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
799 ERR("Splitter Enumpins (%lx)\n", hr
);
802 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
804 ERR("Next (%lx)\n", hr
);
811 IEnumPins_Release(penumpins
);
813 /* Connect the pin to render to the renderer */
814 hr
= IGraphBuilder_Connect(iface
, ppinOut
, ppinfilter
);
816 TRACE("Unable to connect to renderer (%lx)\n", hr
);
823 IGraphBuilder_RemoveFilter(iface
, pfilter
);
824 IBaseFilter_Release(pfilter
);
832 IEnumMediaTypes_Release(penummt
);
837 static HRESULT WINAPI
Graphbuilder_RenderFile(IGraphBuilder
*iface
,
839 LPCWSTR lpcwstrPlayList
) {
840 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
841 static const WCHAR string
[] = {'R','e','a','d','e','r',0};
842 IBaseFilter
* preader
= NULL
;
843 IBaseFilter
* psplitter
;
846 IEnumPins
* penumpins
;
849 IEnumMoniker
* pEnumMoniker
;
854 IFileSourceFilter
* pfile
= NULL
;
858 TRACE("(%p/%p)->(%s, %s)\n", This
, iface
, debugstr_w(lpcwstrFile
), debugstr_w(lpcwstrPlayList
));
860 hr
= IGraphBuilder_AddSourceFilter(iface
, lpcwstrFile
, string
, &preader
);
862 /* Retreive file media type */
864 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
866 hr
= IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
867 IFileSourceFilter_Release(pfile
);
871 tab
[0] = mt
.majortype
;
873 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
876 IGraphBuilder_RemoveFilter(iface
, preader
);
877 IBaseFilter_Release(preader
);
882 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
887 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
888 IMoniker_Release(pMoniker
);
890 ERR("Unable to retreive filter info (%lx)\n", hr
);
894 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&psplitter
);
896 ERR("Unable to create filter (%lx), trying next one\n", hr
);
900 hr
= IGraphBuilder_AddFilter(iface
, psplitter
, NULL
);
902 ERR("Unable add filter (%lx)\n", hr
);
906 /* Connect file source and splitter filters together */
907 /* Make the splitter analyze incoming data */
908 hr
= IBaseFilter_EnumPins(preader
, &penumpins
);
910 ERR("Enumpins (%lx)\n", hr
);
913 hr
= IEnumPins_Next(penumpins
, 1, &ppinreader
, &pin
);
915 ERR("Next (%lx)\n", hr
);
922 IEnumPins_Release(penumpins
);
924 hr
= IBaseFilter_EnumPins(psplitter
, &penumpins
);
926 ERR("Splitter Enumpins (%lx)\n", hr
);
929 hr
= IEnumPins_Next(penumpins
, 1, &ppinsplitter
, &pin
);
931 ERR("Next (%lx)\n", hr
);
938 IEnumPins_Release(penumpins
);
940 hr
= IPin_Connect(ppinreader
, ppinsplitter
, NULL
);
942 IBaseFilter_Release(ppinsplitter
);
944 TRACE("Cannot connect to filter (%lx), trying next one\n", hr
);
947 TRACE("Successfully connected to filter\n");
951 /* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
953 hr
= GetInternalConnections(psplitter
, ppinsplitter
, &ppins
, &nb
);
957 TRACE("pins to consider: %ld\n", nb
);
958 for(i
= 0; i
< nb
; i
++) {
959 TRACE("Processing pin %d\n", i
);
960 hr
= IGraphBuilder_Render(iface
, ppins
[i
]);
962 ERR("Cannot render pin %p (%lx)\n", ppins
[i
], hr
);
963 /* FIXME: We should clean created things properly */
967 CoTaskMemFree(ppins
);
973 static HRESULT WINAPI
Graphbuilder_AddSourceFilter(IGraphBuilder
*iface
,
974 LPCWSTR lpcwstrFileName
,
975 LPCWSTR lpcwstrFilterName
,
976 IBaseFilter
**ppFilter
) {
977 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
979 IBaseFilter
* preader
;
980 IFileSourceFilter
* pfile
= NULL
;
984 TRACE("(%p/%p)->(%s, %s, %p)\n", This
, iface
, debugstr_w(lpcwstrFileName
), debugstr_w(lpcwstrFilterName
), ppFilter
);
986 /* Instantiate a file source filter */
987 hr
= CoCreateInstance(&CLSID_AsyncReader
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&preader
);
989 ERR("Unable to create file source filter (%lx)\n", hr
);
993 hr
= IGraphBuilder_AddFilter(iface
, preader
, lpcwstrFilterName
);
995 ERR("Unable add filter (%lx)\n", hr
);
996 IBaseFilter_Release(preader
);
1000 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1002 ERR("Unable to get IFileSourceInterface (%lx)\n", hr
);
1006 /* Load the file in the file source filter */
1007 hr
= IFileSourceFilter_Load(pfile
, lpcwstrFileName
, NULL
);
1009 ERR("Load (%lx)\n", hr
);
1013 IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1015 ERR("GetCurFile (%lx)\n", hr
);
1018 TRACE("File %s\n", debugstr_w(filename
));
1019 TRACE("MajorType %s\n", debugstr_guid(&mt
.majortype
));
1020 TRACE("SubType %s\n", debugstr_guid(&mt
.subtype
));
1023 *ppFilter
= preader
;
1029 IFileSourceFilter_Release(pfile
);
1030 IGraphBuilder_RemoveFilter(iface
, preader
);
1031 IBaseFilter_Release(preader
);
1036 static HRESULT WINAPI
Graphbuilder_SetLogFile(IGraphBuilder
*iface
,
1038 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1040 TRACE("(%p/%p)->(%08lx): stub !!!\n", This
, iface
, (DWORD
) hFile
);
1045 static HRESULT WINAPI
Graphbuilder_Abort(IGraphBuilder
*iface
) {
1046 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1048 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1053 static HRESULT WINAPI
Graphbuilder_ShouldOperationContinue(IGraphBuilder
*iface
) {
1054 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1056 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1062 static IGraphBuilderVtbl IGraphBuilder_VTable
=
1064 Graphbuilder_QueryInterface
,
1065 Graphbuilder_AddRef
,
1066 Graphbuilder_Release
,
1067 Graphbuilder_AddFilter
,
1068 Graphbuilder_RemoveFilter
,
1069 Graphbuilder_EnumFilters
,
1070 Graphbuilder_FindFilterByName
,
1071 Graphbuilder_ConnectDirect
,
1072 Graphbuilder_Reconnect
,
1073 Graphbuilder_Disconnect
,
1074 Graphbuilder_SetDefaultSyncSource
,
1075 Graphbuilder_Connect
,
1076 Graphbuilder_Render
,
1077 Graphbuilder_RenderFile
,
1078 Graphbuilder_AddSourceFilter
,
1079 Graphbuilder_SetLogFile
,
1081 Graphbuilder_ShouldOperationContinue
1084 /*** IUnknown methods ***/
1085 static HRESULT WINAPI
Mediacontrol_QueryInterface(IMediaControl
*iface
,
1088 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1090 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1092 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1095 static ULONG WINAPI
Mediacontrol_AddRef(IMediaControl
*iface
) {
1096 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1098 TRACE("(%p/%p)->()\n", This
, iface
);
1100 return Filtergraph_AddRef(This
);
1103 static ULONG WINAPI
Mediacontrol_Release(IMediaControl
*iface
) {
1104 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1106 TRACE("(%p/%p)->()\n", This
, iface
);
1108 return Filtergraph_Release(This
);
1112 /*** IDispatch methods ***/
1113 static HRESULT WINAPI
Mediacontrol_GetTypeInfoCount(IMediaControl
*iface
,
1115 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1117 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1122 static HRESULT WINAPI
Mediacontrol_GetTypeInfo(IMediaControl
*iface
,
1125 ITypeInfo
**ppTInfo
) {
1126 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1128 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1133 static HRESULT WINAPI
Mediacontrol_GetIDsOfNames(IMediaControl
*iface
,
1139 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1141 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1146 static HRESULT WINAPI
Mediacontrol_Invoke(IMediaControl
*iface
,
1147 DISPID dispIdMember
,
1151 DISPPARAMS
*pDispParams
,
1153 EXCEPINFO
*pExepInfo
,
1155 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1157 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
);
1162 /*** IMediaControl methods ***/
1163 static HRESULT WINAPI
Mediacontrol_Run(IMediaControl
*iface
) {
1164 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1166 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1168 ResetEvent(This
->hEventCompletion
);
1173 static HRESULT WINAPI
Mediacontrol_Pause(IMediaControl
*iface
) {
1174 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1176 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1181 static HRESULT WINAPI
Mediacontrol_Stop(IMediaControl
*iface
) {
1182 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1184 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1189 static HRESULT WINAPI
Mediacontrol_GetState(IMediaControl
*iface
,
1191 OAFilterState
*pfs
) {
1192 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1194 TRACE("(%p/%p)->(%ld, %p): stub !!!\n", This
, iface
, msTimeout
, pfs
);
1199 static HRESULT WINAPI
Mediacontrol_RenderFile(IMediaControl
*iface
,
1201 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1203 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
);
1208 static HRESULT WINAPI
Mediacontrol_AddSourceFilter(IMediaControl
*iface
,
1210 IDispatch
**ppUnk
) {
1211 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1213 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
, ppUnk
);
1218 static HRESULT WINAPI
Mediacontrol_get_FilterCollection(IMediaControl
*iface
,
1219 IDispatch
**ppUnk
) {
1220 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1222 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1227 static HRESULT WINAPI
Mediacontrol_get_RegFilterCollection(IMediaControl
*iface
,
1228 IDispatch
**ppUnk
) {
1229 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1231 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1236 static HRESULT WINAPI
Mediacontrol_StopWhenReady(IMediaControl
*iface
) {
1237 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1239 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1245 static IMediaControlVtbl IMediaControl_VTable
=
1247 Mediacontrol_QueryInterface
,
1248 Mediacontrol_AddRef
,
1249 Mediacontrol_Release
,
1250 Mediacontrol_GetTypeInfoCount
,
1251 Mediacontrol_GetTypeInfo
,
1252 Mediacontrol_GetIDsOfNames
,
1253 Mediacontrol_Invoke
,
1257 Mediacontrol_GetState
,
1258 Mediacontrol_RenderFile
,
1259 Mediacontrol_AddSourceFilter
,
1260 Mediacontrol_get_FilterCollection
,
1261 Mediacontrol_get_RegFilterCollection
,
1262 Mediacontrol_StopWhenReady
1266 /*** IUnknown methods ***/
1267 static HRESULT WINAPI
Mediaseeking_QueryInterface(IMediaSeeking
*iface
,
1270 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1272 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1274 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1277 static ULONG WINAPI
Mediaseeking_AddRef(IMediaSeeking
*iface
) {
1278 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1280 TRACE("(%p/%p)->()\n", This
, iface
);
1282 return Filtergraph_AddRef(This
);
1285 static ULONG WINAPI
Mediaseeking_Release(IMediaSeeking
*iface
) {
1286 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1288 TRACE("(%p/%p)->()\n", This
, iface
);
1290 return Filtergraph_Release(This
);
1293 /*** IMediaSeeking methods ***/
1294 static HRESULT WINAPI
Mediaseeking_GetCapabilities(IMediaSeeking
*iface
,
1295 DWORD
*pCapabilities
) {
1296 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1298 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1303 static HRESULT WINAPI
Mediaseeking_CheckCapabilities(IMediaSeeking
*iface
,
1304 DWORD
*pCapabilities
) {
1305 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1307 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1312 static HRESULT WINAPI
Mediaseeking_IsFormatSupported(IMediaSeeking
*iface
,
1313 const GUID
*pFormat
) {
1314 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1316 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1321 static HRESULT WINAPI
Mediaseeking_QueryPreferredFormat(IMediaSeeking
*iface
,
1323 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1325 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1330 static HRESULT WINAPI
Mediaseeking_GetTimeFormat(IMediaSeeking
*iface
,
1332 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1334 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1339 static HRESULT WINAPI
Mediaseeking_IsUsingTimeFormat(IMediaSeeking
*iface
,
1340 const GUID
*pFormat
) {
1341 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1343 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1348 static HRESULT WINAPI
Mediaseeking_SetTimeFormat(IMediaSeeking
*iface
,
1349 const GUID
*pFormat
) {
1350 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1352 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1357 static HRESULT WINAPI
Mediaseeking_GetDuration(IMediaSeeking
*iface
,
1358 LONGLONG
*pDuration
) {
1359 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1361 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDuration
);
1366 static HRESULT WINAPI
Mediaseeking_GetStopPosition(IMediaSeeking
*iface
,
1368 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1370 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pStop
);
1375 static HRESULT WINAPI
Mediaseeking_GetCurrentPosition(IMediaSeeking
*iface
,
1376 LONGLONG
*pCurrent
) {
1377 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1379 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCurrent
);
1384 static HRESULT WINAPI
Mediaseeking_ConvertTimeFormat(IMediaSeeking
*iface
,
1386 const GUID
*pTargetFormat
,
1388 const GUID
*pSourceFormat
) {
1389 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1391 TRACE("(%p/%p)->(%p, %p, %lld, %p): stub !!!\n", This
, iface
, pTarget
, pTargetFormat
, Source
, pSourceFormat
);
1396 static HRESULT WINAPI
Mediaseeking_SetPositions(IMediaSeeking
*iface
,
1398 DWORD dwCurrentFlags
,
1400 DWORD dwStopFlags
) {
1401 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1403 TRACE("(%p/%p)->(%p, %08lx, %p, %08lx): stub !!!\n", This
, iface
, pCurrent
, dwCurrentFlags
, pStop
, dwStopFlags
);
1408 static HRESULT WINAPI
Mediaseeking_GetPositions(IMediaSeeking
*iface
,
1411 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1413 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pCurrent
, pStop
);
1418 static HRESULT WINAPI
Mediaseeking_GetAvailable(IMediaSeeking
*iface
,
1419 LONGLONG
*pEarliest
,
1420 LONGLONG
*pLatest
) {
1421 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1423 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pEarliest
, pLatest
);
1428 static HRESULT WINAPI
Mediaseeking_SetRate(IMediaSeeking
*iface
,
1430 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1432 TRACE("(%p/%p)->(%f): stub !!!\n", This
, iface
, dRate
);
1437 static HRESULT WINAPI
Mediaseeking_GetRate(IMediaSeeking
*iface
,
1439 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1441 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pdRate
);
1446 static HRESULT WINAPI
Mediaseeking_GetPreroll(IMediaSeeking
*iface
,
1447 LONGLONG
*pllPreroll
) {
1448 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1450 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pllPreroll
);
1456 static IMediaSeekingVtbl IMediaSeeking_VTable
=
1458 Mediaseeking_QueryInterface
,
1459 Mediaseeking_AddRef
,
1460 Mediaseeking_Release
,
1461 Mediaseeking_GetCapabilities
,
1462 Mediaseeking_CheckCapabilities
,
1463 Mediaseeking_IsFormatSupported
,
1464 Mediaseeking_QueryPreferredFormat
,
1465 Mediaseeking_GetTimeFormat
,
1466 Mediaseeking_IsUsingTimeFormat
,
1467 Mediaseeking_SetTimeFormat
,
1468 Mediaseeking_GetDuration
,
1469 Mediaseeking_GetStopPosition
,
1470 Mediaseeking_GetCurrentPosition
,
1471 Mediaseeking_ConvertTimeFormat
,
1472 Mediaseeking_SetPositions
,
1473 Mediaseeking_GetPositions
,
1474 Mediaseeking_GetAvailable
,
1475 Mediaseeking_SetRate
,
1476 Mediaseeking_GetRate
,
1477 Mediaseeking_GetPreroll
1480 /*** IUnknown methods ***/
1481 static HRESULT WINAPI
Basicaudio_QueryInterface(IBasicAudio
*iface
,
1484 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1486 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1488 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1491 static ULONG WINAPI
Basicaudio_AddRef(IBasicAudio
*iface
) {
1492 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1494 TRACE("(%p/%p)->()\n", This
, iface
);
1496 return Filtergraph_AddRef(This
);
1499 static ULONG WINAPI
Basicaudio_Release(IBasicAudio
*iface
) {
1500 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1502 TRACE("(%p/%p)->()\n", This
, iface
);
1504 return Filtergraph_Release(This
);
1507 /*** IDispatch methods ***/
1508 static HRESULT WINAPI
Basicaudio_GetTypeInfoCount(IBasicAudio
*iface
,
1510 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1512 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1517 static HRESULT WINAPI
Basicaudio_GetTypeInfo(IBasicAudio
*iface
,
1520 ITypeInfo
**ppTInfo
) {
1521 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1523 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1528 static HRESULT WINAPI
Basicaudio_GetIDsOfNames(IBasicAudio
*iface
,
1534 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1536 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1541 static HRESULT WINAPI
Basicaudio_Invoke(IBasicAudio
*iface
,
1542 DISPID dispIdMember
,
1546 DISPPARAMS
*pDispParams
,
1548 EXCEPINFO
*pExepInfo
,
1550 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1552 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
);
1557 /*** IBasicAudio methods ***/
1558 static HRESULT WINAPI
Basicaudio_put_Volume(IBasicAudio
*iface
,
1560 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1562 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, lVolume
);
1567 static HRESULT WINAPI
Basicaudio_get_Volume(IBasicAudio
*iface
,
1569 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1571 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, plVolume
);
1576 static HRESULT WINAPI
Basicaudio_put_Balance(IBasicAudio
*iface
,
1578 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1580 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, lBalance
);
1585 static HRESULT WINAPI
Basicaudio_get_Balance(IBasicAudio
*iface
,
1587 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1589 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, plBalance
);
1594 static IBasicAudioVtbl IBasicAudio_VTable
=
1596 Basicaudio_QueryInterface
,
1599 Basicaudio_GetTypeInfoCount
,
1600 Basicaudio_GetTypeInfo
,
1601 Basicaudio_GetIDsOfNames
,
1603 Basicaudio_put_Volume
,
1604 Basicaudio_get_Volume
,
1605 Basicaudio_put_Balance
,
1606 Basicaudio_get_Balance
1609 /*** IUnknown methods ***/
1610 static HRESULT WINAPI
Basicvideo_QueryInterface(IBasicVideo
*iface
,
1613 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1615 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1617 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1620 static ULONG WINAPI
Basicvideo_AddRef(IBasicVideo
*iface
) {
1621 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1623 TRACE("(%p/%p)->()\n", This
, iface
);
1625 return Filtergraph_AddRef(This
);
1628 static ULONG WINAPI
Basicvideo_Release(IBasicVideo
*iface
) {
1629 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1631 TRACE("(%p/%p)->()\n", This
, iface
);
1633 return Filtergraph_Release(This
);
1636 /*** IDispatch methods ***/
1637 static HRESULT WINAPI
Basicvideo_GetTypeInfoCount(IBasicVideo
*iface
,
1639 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1641 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1646 static HRESULT WINAPI
Basicvideo_GetTypeInfo(IBasicVideo
*iface
,
1649 ITypeInfo
**ppTInfo
) {
1650 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1652 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1657 static HRESULT WINAPI
Basicvideo_GetIDsOfNames(IBasicVideo
*iface
,
1663 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1665 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1670 static HRESULT WINAPI
Basicvideo_Invoke(IBasicVideo
*iface
,
1671 DISPID dispIdMember
,
1675 DISPPARAMS
*pDispParams
,
1677 EXCEPINFO
*pExepInfo
,
1679 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1681 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
);
1686 /*** IBasicVideo methods ***/
1687 static HRESULT WINAPI
Basicvideo_get_AvgTimePerFrame(IBasicVideo
*iface
,
1688 REFTIME
*pAvgTimePerFrame
) {
1689 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1691 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pAvgTimePerFrame
);
1696 static HRESULT WINAPI
Basicvideo_get_BitRate(IBasicVideo
*iface
,
1698 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1700 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pBitRate
);
1705 static HRESULT WINAPI
Basicvideo_get_BitErrorRate(IBasicVideo
*iface
,
1706 long *pBitErrorRate
) {
1707 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1709 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pBitErrorRate
);
1714 static HRESULT WINAPI
Basicvideo_get_VideoWidth(IBasicVideo
*iface
,
1715 long *pVideoWidth
) {
1716 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1718 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pVideoWidth
);
1723 static HRESULT WINAPI
Basicvideo_get_VideoHeight(IBasicVideo
*iface
,
1724 long *pVideoHeight
) {
1725 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1727 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pVideoHeight
);
1732 static HRESULT WINAPI
Basicvideo_put_SourceLeft(IBasicVideo
*iface
,
1734 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1736 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, SourceLeft
);
1741 static HRESULT WINAPI
Basicvideo_get_SourceLeft(IBasicVideo
*iface
,
1742 long *pSourceLeft
) {
1743 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1745 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pSourceLeft
);
1750 static HRESULT WINAPI
Basicvideo_put_SourceWidth(IBasicVideo
*iface
,
1752 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1754 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, SourceWidth
);
1759 static HRESULT WINAPI
Basicvideo_get_SourceWidth(IBasicVideo
*iface
,
1760 long *pSourceWidth
) {
1761 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1763 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pSourceWidth
);
1768 static HRESULT WINAPI
Basicvideo_put_SourceTop(IBasicVideo
*iface
,
1770 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1772 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, SourceTop
);
1777 static HRESULT WINAPI
Basicvideo_get_SourceTop(IBasicVideo
*iface
,
1779 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1781 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pSourceTop
);
1786 static HRESULT WINAPI
Basicvideo_put_SourceHeight(IBasicVideo
*iface
,
1787 long SourceHeight
) {
1788 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1790 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, SourceHeight
);
1795 static HRESULT WINAPI
Basicvideo_get_SourceHeight(IBasicVideo
*iface
,
1796 long *pSourceHeight
) {
1797 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1799 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pSourceHeight
);
1804 static HRESULT WINAPI
Basicvideo_put_DestinationLeft(IBasicVideo
*iface
,
1805 long DestinationLeft
) {
1806 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1808 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, DestinationLeft
);
1813 static HRESULT WINAPI
Basicvideo_get_DestinationLeft(IBasicVideo
*iface
,
1814 long *pDestinationLeft
) {
1815 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1817 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDestinationLeft
);
1822 static HRESULT WINAPI
Basicvideo_put_DestinationWidth(IBasicVideo
*iface
,
1823 long DestinationWidth
) {
1824 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1826 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, DestinationWidth
);
1831 static HRESULT WINAPI
Basicvideo_get_DestinationWidth(IBasicVideo
*iface
,
1832 long *pDestinationWidth
) {
1833 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1835 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDestinationWidth
);
1840 static HRESULT WINAPI
Basicvideo_put_DestinationTop(IBasicVideo
*iface
,
1841 long DestinationTop
) {
1842 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1844 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, DestinationTop
);
1849 static HRESULT WINAPI
Basicvideo_get_DestinationTop(IBasicVideo
*iface
,
1850 long *pDestinationTop
) {
1851 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1853 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDestinationTop
);
1858 static HRESULT WINAPI
Basicvideo_put_DestinationHeight(IBasicVideo
*iface
,
1859 long DestinationHeight
) {
1860 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1862 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, DestinationHeight
);
1867 static HRESULT WINAPI
Basicvideo_get_DestinationHeight(IBasicVideo
*iface
,
1868 long *pDestinationHeight
) {
1869 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1871 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDestinationHeight
);
1876 static HRESULT WINAPI
Basicvideo_SetSourcePosition(IBasicVideo
*iface
,
1881 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1883 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This
, iface
, Left
, Top
, Width
, Height
);
1888 static HRESULT WINAPI
Basicvideo_GetSourcePosition(IBasicVideo
*iface
,
1893 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1895 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
1900 static HRESULT WINAPI
Basicvideo_SetDefaultSourcePosition(IBasicVideo
*iface
) {
1901 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1903 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1908 static HRESULT WINAPI
Basicvideo_SetDestinationPosition(IBasicVideo
*iface
,
1913 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1915 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This
, iface
, Left
, Top
, Width
, Height
);
1920 static HRESULT WINAPI
Basicvideo_GetDestinationPosition(IBasicVideo
*iface
,
1925 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1927 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
1932 static HRESULT WINAPI
Basicvideo_SetDefaultDestinationPosition(IBasicVideo
*iface
) {
1933 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1935 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1940 static HRESULT WINAPI
Basicvideo_GetVideoSize(IBasicVideo
*iface
,
1943 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1945 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pWidth
, pHeight
);
1950 static HRESULT WINAPI
Basicvideo_GetVideoPaletteEntries(IBasicVideo
*iface
,
1955 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1957 TRACE("(%p/%p)->(%ld, %ld, %p, %p): stub !!!\n", This
, iface
, StartIndex
, Entries
, pRetrieved
, pPalette
);
1962 static HRESULT WINAPI
Basicvideo_GetCurrentImage(IBasicVideo
*iface
,
1965 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1967 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pBufferSize
, pDIBImage
);
1972 static HRESULT WINAPI
Basicvideo_IsUsingDefaultSource(IBasicVideo
*iface
) {
1973 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1975 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1980 static HRESULT WINAPI
Basicvideo_IsUsingDefaultDestination(IBasicVideo
*iface
) {
1981 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1983 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1989 static IBasicVideoVtbl IBasicVideo_VTable
=
1991 Basicvideo_QueryInterface
,
1994 Basicvideo_GetTypeInfoCount
,
1995 Basicvideo_GetTypeInfo
,
1996 Basicvideo_GetIDsOfNames
,
1998 Basicvideo_get_AvgTimePerFrame
,
1999 Basicvideo_get_BitRate
,
2000 Basicvideo_get_BitErrorRate
,
2001 Basicvideo_get_VideoWidth
,
2002 Basicvideo_get_VideoHeight
,
2003 Basicvideo_put_SourceLeft
,
2004 Basicvideo_get_SourceLeft
,
2005 Basicvideo_put_SourceWidth
,
2006 Basicvideo_get_SourceWidth
,
2007 Basicvideo_put_SourceTop
,
2008 Basicvideo_get_SourceTop
,
2009 Basicvideo_put_SourceHeight
,
2010 Basicvideo_get_SourceHeight
,
2011 Basicvideo_put_DestinationLeft
,
2012 Basicvideo_get_DestinationLeft
,
2013 Basicvideo_put_DestinationWidth
,
2014 Basicvideo_get_DestinationWidth
,
2015 Basicvideo_put_DestinationTop
,
2016 Basicvideo_get_DestinationTop
,
2017 Basicvideo_put_DestinationHeight
,
2018 Basicvideo_get_DestinationHeight
,
2019 Basicvideo_SetSourcePosition
,
2020 Basicvideo_GetSourcePosition
,
2021 Basicvideo_SetDefaultSourcePosition
,
2022 Basicvideo_SetDestinationPosition
,
2023 Basicvideo_GetDestinationPosition
,
2024 Basicvideo_SetDefaultDestinationPosition
,
2025 Basicvideo_GetVideoSize
,
2026 Basicvideo_GetVideoPaletteEntries
,
2027 Basicvideo_GetCurrentImage
,
2028 Basicvideo_IsUsingDefaultSource
,
2029 Basicvideo_IsUsingDefaultDestination
2033 /*** IUnknown methods ***/
2034 static HRESULT WINAPI
Videowindow_QueryInterface(IVideoWindow
*iface
,
2037 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2039 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2041 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2044 static ULONG WINAPI
Videowindow_AddRef(IVideoWindow
*iface
) {
2045 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2047 TRACE("(%p/%p)->()\n", This
, iface
);
2049 return Filtergraph_AddRef(This
);
2052 static ULONG WINAPI
Videowindow_Release(IVideoWindow
*iface
) {
2053 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2055 TRACE("(%p/%p)->()\n", This
, iface
);
2057 return Filtergraph_Release(This
);
2060 /*** IDispatch methods ***/
2061 static HRESULT WINAPI
Videowindow_GetTypeInfoCount(IVideoWindow
*iface
,
2063 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2065 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
2070 static HRESULT WINAPI
Videowindow_GetTypeInfo(IVideoWindow
*iface
,
2073 ITypeInfo
**ppTInfo
) {
2074 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2076 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2081 static HRESULT WINAPI
Videowindow_GetIDsOfNames(IVideoWindow
*iface
,
2087 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2089 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2094 static HRESULT WINAPI
Videowindow_Invoke(IVideoWindow
*iface
,
2095 DISPID dispIdMember
,
2099 DISPPARAMS
*pDispParams
,
2101 EXCEPINFO
*pExepInfo
,
2103 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2105 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
);
2110 /*** IVideoWindow methods ***/
2111 static HRESULT WINAPI
Videowindow_put_Caption(IVideoWindow
*iface
,
2113 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2115 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This
, iface
, debugstr_w(strCaption
), strCaption
);
2120 static HRESULT WINAPI
Videowindow_get_Caption(IVideoWindow
*iface
,
2122 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2124 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, strCaption
);
2129 static HRESULT WINAPI
Videowindow_put_WindowStyle(IVideoWindow
*iface
,
2131 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2133 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, WindowStyle
);
2138 static HRESULT WINAPI
Videowindow_get_WindowStyle(IVideoWindow
*iface
,
2139 long *WindowStyle
) {
2140 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2142 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, WindowStyle
);
2147 static HRESULT WINAPI
Videowindow_put_WindowStyleEx(IVideoWindow
*iface
,
2148 long WindowStyleEx
) {
2149 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2151 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, WindowStyleEx
);
2156 static HRESULT WINAPI
Videowindow_get_WindowStyleEx(IVideoWindow
*iface
,
2157 long *WindowStyleEx
) {
2158 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2160 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, WindowStyleEx
);
2165 static HRESULT WINAPI
Videowindow_put_AutoShow(IVideoWindow
*iface
,
2167 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2169 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, AutoShow
);
2174 static HRESULT WINAPI
Videowindow_get_AutoShow(IVideoWindow
*iface
,
2176 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2178 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, AutoShow
);
2183 static HRESULT WINAPI
Videowindow_put_WindowState(IVideoWindow
*iface
,
2185 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2187 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, WindowState
);
2192 static HRESULT WINAPI
Videowindow_get_WindowState(IVideoWindow
*iface
,
2193 long *WindowState
) {
2194 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2196 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, WindowState
);
2201 static HRESULT WINAPI
Videowindow_put_BackgroundPalette(IVideoWindow
*iface
,
2202 long BackgroundPalette
) {
2203 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2205 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, BackgroundPalette
);
2210 static HRESULT WINAPI
Videowindow_get_BackgroundPalette(IVideoWindow
*iface
,
2211 long *pBackgroundPalette
) {
2212 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2214 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pBackgroundPalette
);
2219 static HRESULT WINAPI
Videowindow_put_Visible(IVideoWindow
*iface
,
2221 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2223 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Visible
);
2228 static HRESULT WINAPI
Videowindow_get_Visible(IVideoWindow
*iface
,
2230 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2232 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pVisible
);
2237 static HRESULT WINAPI
Videowindow_put_Left(IVideoWindow
*iface
,
2239 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2241 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Left
);
2246 static HRESULT WINAPI
Videowindow_get_Left(IVideoWindow
*iface
,
2248 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2250 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pLeft
);
2255 static HRESULT WINAPI
Videowindow_put_Width(IVideoWindow
*iface
,
2257 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2259 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Width
);
2264 static HRESULT WINAPI
Videowindow_get_Width(IVideoWindow
*iface
,
2266 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2268 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pWidth
);
2273 static HRESULT WINAPI
Videowindow_put_Top(IVideoWindow
*iface
,
2275 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2277 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Top
);
2282 static HRESULT WINAPI
Videowindow_get_Top(IVideoWindow
*iface
,
2284 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2286 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pTop
);
2291 static HRESULT WINAPI
Videowindow_put_Height(IVideoWindow
*iface
,
2293 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2295 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Height
);
2300 static HRESULT WINAPI
Videowindow_get_Height(IVideoWindow
*iface
,
2302 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2304 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pHeight
);
2309 static HRESULT WINAPI
Videowindow_put_Owner(IVideoWindow
*iface
,
2311 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2313 TRACE("(%p/%p)->(%08lx): stub !!!\n", This
, iface
, (DWORD
) Owner
);
2318 static HRESULT WINAPI
Videowindow_get_Owner(IVideoWindow
*iface
,
2320 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2322 TRACE("(%p/%p)->(%08lx): stub !!!\n", This
, iface
, (DWORD
) Owner
);
2327 static HRESULT WINAPI
Videowindow_put_MessageDrain(IVideoWindow
*iface
,
2329 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2331 TRACE("(%p/%p)->(%08lx): stub !!!\n", This
, iface
, (DWORD
) Drain
);
2336 static HRESULT WINAPI
Videowindow_get_MessageDrain(IVideoWindow
*iface
,
2338 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2340 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, Drain
);
2345 static HRESULT WINAPI
Videowindow_get_BorderColor(IVideoWindow
*iface
,
2347 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2349 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, Color
);
2354 static HRESULT WINAPI
Videowindow_put_BorderColor(IVideoWindow
*iface
,
2356 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2358 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Color
);
2363 static HRESULT WINAPI
Videowindow_get_FullScreenMode(IVideoWindow
*iface
,
2364 long *FullScreenMode
) {
2365 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2367 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, FullScreenMode
);
2372 static HRESULT WINAPI
Videowindow_put_FullScreenMode(IVideoWindow
*iface
,
2373 long FullScreenMode
) {
2374 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2376 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, FullScreenMode
);
2381 static HRESULT WINAPI
Videowindow_SetWindowForeground(IVideoWindow
*iface
,
2383 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2385 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Focus
);
2390 static HRESULT WINAPI
Videowindow_NotifyOwnerMessage(IVideoWindow
*iface
,
2395 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2397 TRACE("(%p/%p)->(%08lx, %ld, %08lx, %08lx): stub !!!\n", This
, iface
, (DWORD
) hwnd
, uMsg
, wParam
, lParam
);
2402 static HRESULT WINAPI
Videowindow_SetWindowPosition(IVideoWindow
*iface
,
2407 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2409 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This
, iface
, Left
, Top
, Width
, Height
);
2414 static HRESULT WINAPI
Videowindow_GetWindowPosition(IVideoWindow
*iface
,
2419 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2421 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2426 static HRESULT WINAPI
Videowindow_GetMinIdealImageSize(IVideoWindow
*iface
,
2429 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2431 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pWidth
, pHeight
);
2436 static HRESULT WINAPI
Videowindow_GetMaxIdealImageSize(IVideoWindow
*iface
,
2439 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2441 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pWidth
, pHeight
);
2446 static HRESULT WINAPI
Videowindow_GetRestorePosition(IVideoWindow
*iface
,
2451 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2453 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2458 static HRESULT WINAPI
Videowindow_HideCursor(IVideoWindow
*iface
,
2460 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2462 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, HideCursor
);
2467 static HRESULT WINAPI
Videowindow_IsCursorHidden(IVideoWindow
*iface
,
2468 long *CursorHidden
) {
2469 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2471 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, CursorHidden
);
2477 static IVideoWindowVtbl IVideoWindow_VTable
=
2479 Videowindow_QueryInterface
,
2481 Videowindow_Release
,
2482 Videowindow_GetTypeInfoCount
,
2483 Videowindow_GetTypeInfo
,
2484 Videowindow_GetIDsOfNames
,
2486 Videowindow_put_Caption
,
2487 Videowindow_get_Caption
,
2488 Videowindow_put_WindowStyle
,
2489 Videowindow_get_WindowStyle
,
2490 Videowindow_put_WindowStyleEx
,
2491 Videowindow_get_WindowStyleEx
,
2492 Videowindow_put_AutoShow
,
2493 Videowindow_get_AutoShow
,
2494 Videowindow_put_WindowState
,
2495 Videowindow_get_WindowState
,
2496 Videowindow_put_BackgroundPalette
,
2497 Videowindow_get_BackgroundPalette
,
2498 Videowindow_put_Visible
,
2499 Videowindow_get_Visible
,
2500 Videowindow_put_Left
,
2501 Videowindow_get_Left
,
2502 Videowindow_put_Width
,
2503 Videowindow_get_Width
,
2504 Videowindow_put_Top
,
2505 Videowindow_get_Top
,
2506 Videowindow_put_Height
,
2507 Videowindow_get_Height
,
2508 Videowindow_put_Owner
,
2509 Videowindow_get_Owner
,
2510 Videowindow_put_MessageDrain
,
2511 Videowindow_get_MessageDrain
,
2512 Videowindow_get_BorderColor
,
2513 Videowindow_put_BorderColor
,
2514 Videowindow_get_FullScreenMode
,
2515 Videowindow_put_FullScreenMode
,
2516 Videowindow_SetWindowForeground
,
2517 Videowindow_NotifyOwnerMessage
,
2518 Videowindow_SetWindowPosition
,
2519 Videowindow_GetWindowPosition
,
2520 Videowindow_GetMinIdealImageSize
,
2521 Videowindow_GetMaxIdealImageSize
,
2522 Videowindow_GetRestorePosition
,
2523 Videowindow_HideCursor
,
2524 Videowindow_IsCursorHidden
2528 /*** IUnknown methods ***/
2529 static HRESULT WINAPI
Mediaevent_QueryInterface(IMediaEventEx
*iface
,
2532 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2534 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2536 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2539 static ULONG WINAPI
Mediaevent_AddRef(IMediaEventEx
*iface
) {
2540 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2542 TRACE("(%p/%p)->()\n", This
, iface
);
2544 return Filtergraph_AddRef(This
);
2547 static ULONG WINAPI
Mediaevent_Release(IMediaEventEx
*iface
) {
2548 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2550 TRACE("(%p/%p)->()\n", This
, iface
);
2552 return Filtergraph_Release(This
);
2555 /*** IDispatch methods ***/
2556 static HRESULT WINAPI
Mediaevent_GetTypeInfoCount(IMediaEventEx
*iface
,
2558 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2560 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
2565 static HRESULT WINAPI
Mediaevent_GetTypeInfo(IMediaEventEx
*iface
,
2568 ITypeInfo
**ppTInfo
) {
2569 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2571 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2576 static HRESULT WINAPI
Mediaevent_GetIDsOfNames(IMediaEventEx
*iface
,
2582 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2584 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2589 static HRESULT WINAPI
Mediaevent_Invoke(IMediaEventEx
*iface
,
2590 DISPID dispIdMember
,
2594 DISPPARAMS
*pDispParams
,
2596 EXCEPINFO
*pExepInfo
,
2598 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2600 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
);
2605 /*** IMediaEvent methods ***/
2606 static HRESULT WINAPI
Mediaevent_GetEventHandle(IMediaEventEx
*iface
,
2608 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2610 TRACE("(%p/%p)->(%p)\n", This
, iface
, hEvent
);
2612 *hEvent
= (OAEVENT
)This
->evqueue
.msg_event
;
2617 static HRESULT WINAPI
Mediaevent_GetEvent(IMediaEventEx
*iface
,
2622 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2625 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This
, iface
, lEventCode
, lParam1
, lParam2
, msTimeout
);
2627 if (EventsQueue_GetEvent(&This
->evqueue
, &evt
, msTimeout
))
2629 *lEventCode
= evt
.lEventCode
;
2630 *lParam1
= evt
.lParam1
;
2631 *lParam2
= evt
.lParam2
;
2639 static HRESULT WINAPI
Mediaevent_WaitForCompletion(IMediaEventEx
*iface
,
2642 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2644 TRACE("(%p/%p)->(%ld, %p)\n", This
, iface
, msTimeout
, pEvCode
);
2646 if (WaitForSingleObject(This
->hEventCompletion
, msTimeout
) == WAIT_OBJECT_0
)
2648 *pEvCode
= This
->CompletionStatus
;
2656 static HRESULT WINAPI
Mediaevent_CancelDefaultHandling(IMediaEventEx
*iface
,
2658 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2660 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
2662 if (lEvCode
== EC_COMPLETE
)
2663 This
->HandleEcComplete
= FALSE
;
2664 else if (lEvCode
== EC_REPAINT
)
2665 This
->HandleEcRepaint
= FALSE
;
2672 static HRESULT WINAPI
Mediaevent_RestoreDefaultHandling(IMediaEventEx
*iface
,
2674 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2676 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
2678 if (lEvCode
== EC_COMPLETE
)
2679 This
->HandleEcComplete
= TRUE
;
2680 else if (lEvCode
== EC_REPAINT
)
2681 This
->HandleEcRepaint
= TRUE
;
2688 static HRESULT WINAPI
Mediaevent_FreeEventParams(IMediaEventEx
*iface
,
2692 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2694 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This
, iface
, lEvCode
, lParam1
, lParam2
);
2699 /*** IMediaEventEx methods ***/
2700 static HRESULT WINAPI
Mediaevent_SetNotifyWindow(IMediaEventEx
*iface
,
2703 LONG_PTR lInstanceData
) {
2704 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2706 TRACE("(%p/%p)->(%08lx, %ld, %08lx)\n", This
, iface
, (DWORD
) hwnd
, lMsg
, lInstanceData
);
2708 This
->notif
.hWnd
= (HWND
)hwnd
;
2709 This
->notif
.msg
= lMsg
;
2710 This
->notif
.instance
= (long) lInstanceData
;
2715 static HRESULT WINAPI
Mediaevent_SetNotifyFlags(IMediaEventEx
*iface
,
2716 long lNoNotifyFlags
) {
2717 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2719 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lNoNotifyFlags
);
2721 if ((lNoNotifyFlags
!= 0) || (lNoNotifyFlags
!= 1))
2722 return E_INVALIDARG
;
2724 This
->notif
.disabled
= lNoNotifyFlags
;
2729 static HRESULT WINAPI
Mediaevent_GetNotifyFlags(IMediaEventEx
*iface
,
2730 long *lplNoNotifyFlags
) {
2731 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2733 TRACE("(%p/%p)->(%p)\n", This
, iface
, lplNoNotifyFlags
);
2735 if (!lplNoNotifyFlags
)
2738 *lplNoNotifyFlags
= This
->notif
.disabled
;
2744 static IMediaEventExVtbl IMediaEventEx_VTable
=
2746 Mediaevent_QueryInterface
,
2749 Mediaevent_GetTypeInfoCount
,
2750 Mediaevent_GetTypeInfo
,
2751 Mediaevent_GetIDsOfNames
,
2753 Mediaevent_GetEventHandle
,
2754 Mediaevent_GetEvent
,
2755 Mediaevent_WaitForCompletion
,
2756 Mediaevent_CancelDefaultHandling
,
2757 Mediaevent_RestoreDefaultHandling
,
2758 Mediaevent_FreeEventParams
,
2759 Mediaevent_SetNotifyWindow
,
2760 Mediaevent_SetNotifyFlags
,
2761 Mediaevent_GetNotifyFlags
2765 static HRESULT WINAPI
MediaFilter_QueryInterface(IMediaFilter
*iface
, REFIID riid
, LPVOID
*ppv
)
2767 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2769 return Filtergraph_QueryInterface(This
, riid
, ppv
);
2772 static ULONG WINAPI
MediaFilter_AddRef(IMediaFilter
*iface
)
2774 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2776 return Filtergraph_AddRef(This
);
2779 static ULONG WINAPI
MediaFilter_Release(IMediaFilter
*iface
)
2781 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2783 return Filtergraph_Release(This
);
2786 static HRESULT WINAPI
MediaFilter_GetClassID(IMediaFilter
*iface
, CLSID
* pClassID
)
2788 FIXME("(%p): stub\n", pClassID
);
2793 static HRESULT WINAPI
MediaFilter_Stop(IMediaFilter
*iface
)
2795 FIXME("(): stub\n");
2800 static HRESULT WINAPI
MediaFilter_Pause(IMediaFilter
*iface
)
2802 FIXME("(): stub\n");
2807 static HRESULT WINAPI
MediaFilter_Run(IMediaFilter
*iface
, REFERENCE_TIME tStart
)
2809 FIXME("(%lld): stub\n", tStart
);
2814 static HRESULT WINAPI
MediaFilter_GetState(IMediaFilter
*iface
, DWORD dwMsTimeout
, FILTER_STATE
* pState
)
2816 FIXME("(%ld, %p): stub\n", dwMsTimeout
, pState
);
2821 static HRESULT WINAPI
MediaFilter_SetSyncSource(IMediaFilter
*iface
, IReferenceClock
*pClock
)
2823 FIXME("(%p): stub\n", pClock
);
2828 static HRESULT WINAPI
MediaFilter_GetSyncSource(IMediaFilter
*iface
, IReferenceClock
**ppClock
)
2830 FIXME("(%p): stub\n", ppClock
);
2835 static IMediaFilterVtbl IMediaFilter_VTable
=
2837 MediaFilter_QueryInterface
,
2839 MediaFilter_Release
,
2840 MediaFilter_GetClassID
,
2844 MediaFilter_GetState
,
2845 MediaFilter_SetSyncSource
,
2846 MediaFilter_GetSyncSource
2849 static HRESULT WINAPI
MediaEventSink_QueryInterface(IMediaEventSink
*iface
, REFIID riid
, LPVOID
*ppv
)
2851 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
2853 return Filtergraph_QueryInterface(This
, riid
, ppv
);
2856 static ULONG WINAPI
MediaEventSink_AddRef(IMediaEventSink
*iface
)
2858 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
2860 return Filtergraph_AddRef(This
);
2863 static ULONG WINAPI
MediaEventSink_Release(IMediaEventSink
*iface
)
2865 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
2867 return Filtergraph_Release(This
);
2870 static HRESULT WINAPI
MediaEventSink_Notify(IMediaEventSink
*iface
, long EventCode
, LONG_PTR EventParam1
, LONG_PTR EventParam2
)
2872 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
2875 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This
, iface
, EventCode
, EventParam1
, EventParam2
);
2877 /* We need thread safety here, let's use the events queue's one */
2878 EnterCriticalSection(&This
->evqueue
.msg_crst
);
2880 if ((EventCode
== EC_COMPLETE
) && This
->HandleEcComplete
)
2882 if (++This
->EcCompleteCount
== This
->nRenderers
)
2884 evt
.lEventCode
= EC_COMPLETE
;
2887 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
2888 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
2889 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
2890 This
->CompletionStatus
= EC_COMPLETE
;
2891 SetEvent(This
->hEventCompletion
);
2894 else if ((EventCode
== EC_REPAINT
) && This
->HandleEcRepaint
)
2896 /* FIXME: Not handled yet */
2900 evt
.lEventCode
= EventCode
;
2901 evt
.lParam1
= EventParam1
;
2902 evt
.lParam2
= EventParam2
;
2903 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
2904 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
2905 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
2908 LeaveCriticalSection(&This
->evqueue
.msg_crst
);
2912 static IMediaEventSinkVtbl IMediaEventSink_VTable
=
2914 MediaEventSink_QueryInterface
,
2915 MediaEventSink_AddRef
,
2916 MediaEventSink_Release
,
2917 MediaEventSink_Notify
2920 /* This is the only function that actually creates a FilterGraph class... */
2921 HRESULT
FILTERGRAPH_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
) {
2922 IFilterGraphImpl
*fimpl
;
2925 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
2928 return CLASS_E_NOAGGREGATION
;
2930 fimpl
= (IFilterGraphImpl
*) HeapAlloc(GetProcessHeap(), 0, sizeof(*fimpl
));
2931 fimpl
->IGraphBuilder_vtbl
= &IGraphBuilder_VTable
;
2932 fimpl
->IMediaControl_vtbl
= &IMediaControl_VTable
;
2933 fimpl
->IMediaSeeking_vtbl
= &IMediaSeeking_VTable
;
2934 fimpl
->IBasicAudio_vtbl
= &IBasicAudio_VTable
;
2935 fimpl
->IBasicVideo_vtbl
= &IBasicVideo_VTable
;
2936 fimpl
->IVideoWindow_vtbl
= &IVideoWindow_VTable
;
2937 fimpl
->IMediaEventEx_vtbl
= &IMediaEventEx_VTable
;
2938 fimpl
->IMediaFilter_vtbl
= &IMediaFilter_VTable
;
2939 fimpl
->IMediaEventSink_vtbl
= &IMediaEventSink_VTable
;
2941 fimpl
->ppFiltersInGraph
= NULL
;
2942 fimpl
->pFilterNames
= NULL
;
2943 fimpl
->nFilters
= 0;
2944 fimpl
->filterCapacity
= 0;
2945 fimpl
->nameIndex
= 1;
2946 fimpl
->hEventCompletion
= CreateEventW(0, TRUE
, FALSE
,0);
2947 fimpl
->HandleEcComplete
= TRUE
;
2948 fimpl
->HandleEcRepaint
= TRUE
;
2949 fimpl
->notif
.hWnd
= 0;
2950 fimpl
->notif
.disabled
= TRUE
;
2951 fimpl
->nRenderers
= 0;
2952 fimpl
->EcCompleteCount
= 0;
2953 EventsQueue_Init(&fimpl
->evqueue
);
2955 hr
= CoCreateInstance(&CLSID_FilterMapper
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IFilterMapper2
, (LPVOID
*)&fimpl
->pFilterMapper2
);
2957 ERR("Unable to create filter mapper (%lx)\n", hr
);