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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
33 #include "wine/debug.h"
34 #include "quartz_private.h"
40 #include "wine/unicode.h"
43 WINE_DEFAULT_DEBUG_CHANNEL(quartz
);
46 HWND hWnd
; /* Target window */
47 long msg
; /* User window message */
48 long instance
; /* User data */
49 int disabled
; /* Disabled messages posting */
53 long lEventCode
; /* Event code */
54 LONG_PTR lParam1
; /* Param1 */
55 LONG_PTR lParam2
; /* Param2 */
58 /* messages ring implementation for queuing events (taken from winmm) */
59 #define EVENTS_RING_BUFFER_INCREMENT 64
65 CRITICAL_SECTION msg_crst
;
66 HANDLE msg_event
; /* Signaled for no empty queue */
69 static int EventsQueue_Init(EventsQueue
* omr
)
73 omr
->msg_event
= CreateEventW(NULL
, TRUE
, FALSE
, NULL
);
74 omr
->ring_buffer_size
= EVENTS_RING_BUFFER_INCREMENT
;
75 omr
->messages
= CoTaskMemAlloc(omr
->ring_buffer_size
* sizeof(Event
));
76 ZeroMemory(omr
->messages
, omr
->ring_buffer_size
* sizeof(Event
));
78 InitializeCriticalSection(&omr
->msg_crst
);
79 omr
->msg_crst
.DebugInfo
->Spare
[0] = (DWORD_PTR
)(__FILE__
": EventsQueue.msg_crst");
83 static int EventsQueue_Destroy(EventsQueue
* omr
)
85 CloseHandle(omr
->msg_event
);
86 CoTaskMemFree(omr
->messages
);
87 omr
->msg_crst
.DebugInfo
->Spare
[0] = 0;
88 DeleteCriticalSection(&omr
->msg_crst
);
92 static int EventsQueue_PutEvent(EventsQueue
* omr
, const Event
* evt
)
94 EnterCriticalSection(&omr
->msg_crst
);
95 if ((omr
->msg_toget
== ((omr
->msg_tosave
+ 1) % omr
->ring_buffer_size
)))
97 int old_ring_buffer_size
= omr
->ring_buffer_size
;
98 omr
->ring_buffer_size
+= EVENTS_RING_BUFFER_INCREMENT
;
99 TRACE("omr->ring_buffer_size=%d\n",omr
->ring_buffer_size
);
100 omr
->messages
= HeapReAlloc(GetProcessHeap(),0,omr
->messages
, omr
->ring_buffer_size
* sizeof(Event
));
101 /* Now we need to rearrange the ring buffer so that the new
102 buffers just allocated are in between omr->msg_tosave and
105 if (omr
->msg_tosave
< omr
->msg_toget
)
107 memmove(&(omr
->messages
[omr
->msg_toget
+ EVENTS_RING_BUFFER_INCREMENT
]),
108 &(omr
->messages
[omr
->msg_toget
]),
109 sizeof(Event
)*(old_ring_buffer_size
- omr
->msg_toget
)
111 omr
->msg_toget
+= EVENTS_RING_BUFFER_INCREMENT
;
114 omr
->messages
[omr
->msg_tosave
] = *evt
;
115 SetEvent(omr
->msg_event
);
116 omr
->msg_tosave
= (omr
->msg_tosave
+ 1) % omr
->ring_buffer_size
;
117 LeaveCriticalSection(&omr
->msg_crst
);
121 static int EventsQueue_GetEvent(EventsQueue
* omr
, Event
* evt
, long msTimeOut
)
123 if (WaitForSingleObject(omr
->msg_event
, msTimeOut
) != WAIT_OBJECT_0
)
126 EnterCriticalSection(&omr
->msg_crst
);
128 if (omr
->msg_toget
== omr
->msg_tosave
) /* buffer empty ? */
130 LeaveCriticalSection(&omr
->msg_crst
);
134 *evt
= omr
->messages
[omr
->msg_toget
];
135 omr
->msg_toget
= (omr
->msg_toget
+ 1) % omr
->ring_buffer_size
;
137 /* Mark the buffer as empty if needed */
138 if (omr
->msg_toget
== omr
->msg_tosave
) /* buffer empty ? */
139 ResetEvent(omr
->msg_event
);
141 LeaveCriticalSection(&omr
->msg_crst
);
145 #define MAX_ITF_CACHE_ENTRIES 3
146 typedef struct _ITF_CACHE_ENTRY
{
152 typedef struct _IFilterGraphImpl
{
153 const IFilterGraph2Vtbl
*IFilterGraph2_vtbl
;
154 const IMediaControlVtbl
*IMediaControl_vtbl
;
155 const IMediaSeekingVtbl
*IMediaSeeking_vtbl
;
156 const IBasicAudioVtbl
*IBasicAudio_vtbl
;
157 const IBasicVideoVtbl
*IBasicVideo_vtbl
;
158 const IVideoWindowVtbl
*IVideoWindow_vtbl
;
159 const IMediaEventExVtbl
*IMediaEventEx_vtbl
;
160 const IMediaFilterVtbl
*IMediaFilter_vtbl
;
161 const IMediaEventSinkVtbl
*IMediaEventSink_vtbl
;
162 const IGraphConfigVtbl
*IGraphConfig_vtbl
;
163 const IMediaPositionVtbl
*IMediaPosition_vtbl
;
164 const IUnknownVtbl
* IInner_vtbl
;
165 /* IAMGraphStreams */
172 /* IRegisterServiceProvider */
173 /* IResourceMananger */
174 /* IServiceProvider */
175 /* IVideoFrameStep */
178 IFilterMapper2
* pFilterMapper2
;
179 IBaseFilter
** ppFiltersInGraph
;
180 LPWSTR
* pFilterNames
;
184 IReferenceClock
*refClock
;
186 HANDLE hEventCompletion
;
187 int CompletionStatus
;
191 int HandleEcComplete
;
193 int HandleEcClockChanged
;
196 ITF_CACHE_ENTRY ItfCacheEntries
[MAX_ITF_CACHE_ENTRIES
];
197 int nItfCacheEntries
;
198 IUnknown
* pUnkOuter
;
203 static HRESULT WINAPI
Filtergraph_QueryInterface(IFilterGraphImpl
*This
,
204 REFIID riid
, LPVOID
* ppv
);
205 static ULONG WINAPI
Filtergraph_AddRef(IFilterGraphImpl
*This
);
206 static ULONG WINAPI
Filtergraph_Release(IFilterGraphImpl
*This
);
208 static HRESULT WINAPI
FilterGraphInner_QueryInterface(IUnknown
* iface
,
211 ICOM_THIS_MULTI(IFilterGraphImpl
, IInner_vtbl
, iface
);
212 TRACE("(%p)->(%s (%p), %p)\n", This
, debugstr_guid(riid
), riid
, ppvObj
);
214 if (This
->bAggregatable
)
215 This
->bUnkOuterValid
= TRUE
;
217 if (IsEqualGUID(&IID_IUnknown
, riid
)) {
218 *ppvObj
= &(This
->IInner_vtbl
);
219 TRACE(" returning IUnknown interface (%p)\n", *ppvObj
);
220 } else if (IsEqualGUID(&IID_IFilterGraph
, riid
) ||
221 IsEqualGUID(&IID_IFilterGraph2
, riid
) ||
222 IsEqualGUID(&IID_IGraphBuilder
, riid
)) {
223 *ppvObj
= &(This
->IFilterGraph2_vtbl
);
224 TRACE(" returning IGraphBuilder interface (%p)\n", *ppvObj
);
225 } else if (IsEqualGUID(&IID_IMediaControl
, riid
)) {
226 *ppvObj
= &(This
->IMediaControl_vtbl
);
227 TRACE(" returning IMediaControl interface (%p)\n", *ppvObj
);
228 } else if (IsEqualGUID(&IID_IMediaSeeking
, riid
)) {
229 *ppvObj
= &(This
->IMediaSeeking_vtbl
);
230 TRACE(" returning IMediaSeeking interface (%p)\n", *ppvObj
);
231 } else if (IsEqualGUID(&IID_IBasicAudio
, riid
)) {
232 *ppvObj
= &(This
->IBasicAudio_vtbl
);
233 TRACE(" returning IBasicAudio interface (%p)\n", *ppvObj
);
234 } else if (IsEqualGUID(&IID_IBasicVideo
, riid
)) {
235 *ppvObj
= &(This
->IBasicVideo_vtbl
);
236 TRACE(" returning IBasicVideo interface (%p)\n", *ppvObj
);
237 } else if (IsEqualGUID(&IID_IVideoWindow
, riid
)) {
238 *ppvObj
= &(This
->IVideoWindow_vtbl
);
239 TRACE(" returning IVideoWindow interface (%p)\n", *ppvObj
);
240 } else if (IsEqualGUID(&IID_IMediaEvent
, riid
) ||
241 IsEqualGUID(&IID_IMediaEventEx
, riid
)) {
242 *ppvObj
= &(This
->IMediaEventEx_vtbl
);
243 TRACE(" returning IMediaEvent(Ex) interface (%p)\n", *ppvObj
);
244 } else if (IsEqualGUID(&IID_IMediaFilter
, riid
) ||
245 IsEqualGUID(&IID_IPersist
, riid
)) {
246 *ppvObj
= &(This
->IMediaFilter_vtbl
);
247 TRACE(" returning IMediaFilter interface (%p)\n", *ppvObj
);
248 } else if (IsEqualGUID(&IID_IMediaEventSink
, riid
)) {
249 *ppvObj
= &(This
->IMediaEventSink_vtbl
);
250 TRACE(" returning IMediaEventSink interface (%p)\n", *ppvObj
);
251 } else if (IsEqualGUID(&IID_IGraphConfig
, riid
)) {
252 *ppvObj
= &(This
->IGraphConfig_vtbl
);
253 TRACE(" returning IGraphConfig interface (%p)\n", *ppvObj
);
254 } else if (IsEqualGUID(&IID_IMediaPosition
, riid
)) {
255 *ppvObj
= &(This
->IMediaPosition_vtbl
);
256 TRACE(" returning IMediaPosition interface (%p)\n", *ppvObj
);
259 FIXME("unknown interface %s\n", debugstr_guid(riid
));
260 return E_NOINTERFACE
;
263 IUnknown_AddRef((IUnknown
*)(*ppvObj
));
267 static ULONG WINAPI
FilterGraphInner_AddRef(IUnknown
* iface
) {
268 ICOM_THIS_MULTI(IFilterGraphImpl
, IInner_vtbl
, iface
);
269 ULONG ref
= InterlockedIncrement(&This
->ref
);
271 TRACE("(%p)->(): new ref = %d\n", This
, ref
);
276 static ULONG WINAPI
FilterGraphInner_Release(IUnknown
* iface
) {
277 ICOM_THIS_MULTI(IFilterGraphImpl
, IInner_vtbl
, iface
);
278 ULONG ref
= InterlockedDecrement(&This
->ref
);
280 TRACE("(%p)->(): new ref = %d\n", This
, ref
);
286 IReferenceClock_Release(This
->refClock
);
288 for (i
= 0; i
< This
->nFilters
; i
++)
290 IBaseFilter_SetSyncSource(This
->ppFiltersInGraph
[i
], NULL
);
291 IBaseFilter_Release(This
->ppFiltersInGraph
[i
]);
292 CoTaskMemFree(This
->pFilterNames
[i
]);
294 for (i
= 0; i
< This
->nItfCacheEntries
; i
++)
296 if (This
->ItfCacheEntries
[i
].iface
)
297 IUnknown_Release(This
->ItfCacheEntries
[i
].iface
);
299 IFilterMapper2_Release(This
->pFilterMapper2
);
300 CloseHandle(This
->hEventCompletion
);
301 EventsQueue_Destroy(&This
->evqueue
);
302 This
->cs
.DebugInfo
->Spare
[0] = 0;
303 DeleteCriticalSection(&This
->cs
);
304 CoTaskMemFree(This
->ppFiltersInGraph
);
305 CoTaskMemFree(This
->pFilterNames
);
312 /*** IUnknown methods ***/
313 static HRESULT WINAPI
FilterGraph2_QueryInterface(IFilterGraph2
*iface
,
316 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
318 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
319 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
322 static ULONG WINAPI
FilterGraph2_AddRef(IFilterGraph2
*iface
) {
323 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
325 TRACE("(%p/%p)->() calling FilterGraph AddRef\n", This
, iface
);
327 return Filtergraph_AddRef(This
);
330 static ULONG WINAPI
FilterGraph2_Release(IFilterGraph2
*iface
) {
331 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
333 TRACE("(%p/%p)->() calling FilterGraph Release\n", This
, iface
);
335 return Filtergraph_Release(This
);
338 /*** IFilterGraph methods ***/
339 static HRESULT WINAPI
FilterGraph2_AddFilter(IFilterGraph2
*iface
,
340 IBaseFilter
*pFilter
,
342 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
345 WCHAR
* wszFilterName
= NULL
;
346 int duplicate_name
= FALSE
;
348 TRACE("(%p/%p)->(%p, %s (%p))\n", This
, iface
, pFilter
, debugstr_w(pName
), pName
);
350 wszFilterName
= CoTaskMemAlloc( (pName
? strlenW(pName
) + 6 : 5) * sizeof(WCHAR
) );
354 /* Check if name already exists */
355 for(i
= 0; i
< This
->nFilters
; i
++)
356 if (!strcmpW(This
->pFilterNames
[i
], pName
))
358 duplicate_name
= TRUE
;
363 /* If no name given or name already existing, generate one */
364 if (!pName
|| duplicate_name
)
366 static const WCHAR wszFmt1
[] = {'%','s',' ','%','0','4','d',0};
367 static const WCHAR wszFmt2
[] = {'%','0','4','d',0};
369 for (j
= 0; j
< 10000 ; j
++)
373 sprintfW(wszFilterName
, wszFmt1
, pName
, This
->nameIndex
);
375 sprintfW(wszFilterName
, wszFmt2
, This
->nameIndex
);
376 TRACE("Generated name %s\n", debugstr_w(wszFilterName
));
378 /* Check if the generated name already exists */
379 for(i
= 0; i
< This
->nFilters
; i
++)
380 if (!strcmpW(This
->pFilterNames
[i
], wszFilterName
))
383 /* Compute next index and exit if generated name is suitable */
384 if (This
->nameIndex
++ == 10000)
386 if (i
== This
->nFilters
)
389 /* Unable to find a suitable name */
392 CoTaskMemFree(wszFilterName
);
393 return VFW_E_DUPLICATE_NAME
;
397 memcpy(wszFilterName
, pName
, (strlenW(pName
) + 1) * sizeof(WCHAR
));
399 if (This
->nFilters
+ 1 > This
->filterCapacity
)
401 int newCapacity
= This
->filterCapacity
? 2 * This
->filterCapacity
: 1;
402 IBaseFilter
** ppNewFilters
= CoTaskMemAlloc(newCapacity
* sizeof(IBaseFilter
*));
403 LPWSTR
* pNewNames
= CoTaskMemAlloc(newCapacity
* sizeof(LPWSTR
));
404 memcpy(ppNewFilters
, This
->ppFiltersInGraph
, This
->nFilters
* sizeof(IBaseFilter
*));
405 memcpy(pNewNames
, This
->pFilterNames
, This
->nFilters
* sizeof(LPWSTR
));
406 if (!This
->filterCapacity
)
408 CoTaskMemFree(This
->ppFiltersInGraph
);
409 CoTaskMemFree(This
->pFilterNames
);
411 This
->ppFiltersInGraph
= ppNewFilters
;
412 This
->pFilterNames
= pNewNames
;
413 This
->filterCapacity
= newCapacity
;
416 hr
= IBaseFilter_JoinFilterGraph(pFilter
, (IFilterGraph
*)This
, wszFilterName
);
420 IBaseFilter_AddRef(pFilter
);
421 This
->ppFiltersInGraph
[This
->nFilters
] = pFilter
;
422 This
->pFilterNames
[This
->nFilters
] = wszFilterName
;
424 IBaseFilter_SetSyncSource(pFilter
, This
->refClock
);
427 CoTaskMemFree(wszFilterName
);
429 if (SUCCEEDED(hr
) && duplicate_name
)
430 return VFW_S_DUPLICATE_NAME
;
435 static HRESULT WINAPI
FilterGraph2_RemoveFilter(IFilterGraph2
*iface
,
436 IBaseFilter
*pFilter
) {
437 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
441 TRACE("(%p/%p)->(%p)\n", This
, iface
, pFilter
);
443 /* FIXME: check graph is stopped */
445 for (i
= 0; i
< This
->nFilters
; i
++)
447 if (This
->ppFiltersInGraph
[i
] == pFilter
)
449 IEnumPins
*penumpins
;
450 hr
= IBaseFilter_EnumPins(pFilter
, &penumpins
);
453 while(IEnumPins_Next(penumpins
, 1, &ppin
, NULL
) == S_OK
) {
454 IPin_Disconnect(ppin
);
457 IEnumPins_Release(penumpins
);
460 hr
= IBaseFilter_JoinFilterGraph(pFilter
, NULL
, This
->pFilterNames
[i
]);
463 IBaseFilter_SetSyncSource(pFilter
, NULL
);
464 IBaseFilter_Release(pFilter
);
465 CoTaskMemFree(This
->pFilterNames
[i
]);
466 memmove(This
->ppFiltersInGraph
+i
, This
->ppFiltersInGraph
+i
+1, sizeof(IBaseFilter
*)*(This
->nFilters
- 1 - i
));
467 memmove(This
->pFilterNames
+i
, This
->pFilterNames
+i
+1, sizeof(LPWSTR
)*(This
->nFilters
- 1 - i
));
469 /* Invalidate interfaces in the cache */
470 for (i
= 0; i
< This
->nItfCacheEntries
; i
++)
471 if (pFilter
== This
->ItfCacheEntries
[i
].filter
)
473 IUnknown_Release(This
->ItfCacheEntries
[i
].iface
);
474 This
->ItfCacheEntries
[i
].iface
= NULL
;
475 This
->ItfCacheEntries
[i
].filter
= NULL
;
483 return hr
; /* FIXME: check this error code */
486 static HRESULT WINAPI
FilterGraph2_EnumFilters(IFilterGraph2
*iface
,
487 IEnumFilters
**ppEnum
) {
488 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
490 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppEnum
);
492 return IEnumFiltersImpl_Construct(This
->ppFiltersInGraph
, This
->nFilters
, ppEnum
);
495 static HRESULT WINAPI
FilterGraph2_FindFilterByName(IFilterGraph2
*iface
,
497 IBaseFilter
**ppFilter
) {
498 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
501 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_w(pName
), pName
, ppFilter
);
506 for (i
= 0; i
< This
->nFilters
; i
++)
508 if (!strcmpW(pName
, This
->pFilterNames
[i
]))
510 *ppFilter
= This
->ppFiltersInGraph
[i
];
511 IBaseFilter_AddRef(*ppFilter
);
517 return VFW_E_NOT_FOUND
;
520 /* NOTE: despite the implication, it doesn't matter which
521 * way round you put in the input and output pins */
522 static HRESULT WINAPI
FilterGraph2_ConnectDirect(IFilterGraph2
*iface
,
525 const AM_MEDIA_TYPE
*pmt
) {
529 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
531 TRACE("(%p/%p)->(%p, %p, %p)\n", This
, iface
, ppinIn
, ppinOut
, pmt
);
533 /* FIXME: check pins are in graph */
535 if (TRACE_ON(quartz
))
539 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
543 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
544 IBaseFilter_Release(PinInfo
.pFilter
);
546 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
550 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
551 IBaseFilter_Release(PinInfo
.pFilter
);
554 hr
= IPin_QueryDirection(ppinIn
, &dir
);
557 if (dir
== PINDIR_INPUT
)
558 hr
= IPin_Connect(ppinOut
, ppinIn
, pmt
);
560 hr
= IPin_Connect(ppinIn
, ppinOut
, pmt
);
566 static HRESULT WINAPI
FilterGraph2_Reconnect(IFilterGraph2
*iface
,
568 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
569 IPin
*pConnectedTo
= NULL
;
571 PIN_DIRECTION pindir
;
573 IPin_QueryDirection(ppin
, &pindir
);
574 hr
= IPin_ConnectedTo(ppin
, &pConnectedTo
);
576 TRACE("Querying connected to failed: %x\n", hr
);
579 IPin_Disconnect(ppin
);
580 IPin_Disconnect(pConnectedTo
);
581 if (pindir
== PINDIR_INPUT
)
582 hr
= IPin_Connect(pConnectedTo
, ppin
, NULL
);
584 hr
= IPin_Connect(ppin
, pConnectedTo
, NULL
);
585 IPin_Release(pConnectedTo
);
587 ERR("Reconnecting pins failed, pins are not connected now..\n");
588 TRACE("(%p->%p) -- %p %p -> %x\n", iface
, This
, ppin
, pConnectedTo
, hr
);
592 static HRESULT WINAPI
FilterGraph2_Disconnect(IFilterGraph2
*iface
,
594 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
596 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppin
);
598 return IPin_Disconnect(ppin
);
601 static HRESULT WINAPI
FilterGraph2_SetDefaultSyncSource(IFilterGraph2
*iface
) {
602 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
604 TRACE("(%p/%p)->(): stub !!!\n", iface
, This
);
609 static HRESULT
GetFilterInfo(IMoniker
* pMoniker
, GUID
* pclsid
, VARIANT
* pvar
)
611 static const WCHAR wszClsidName
[] = {'C','L','S','I','D',0};
612 static const WCHAR wszFriendlyName
[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
613 IPropertyBag
* pPropBagCat
= NULL
;
617 V_VT(pvar
) = VT_BSTR
;
619 hr
= IMoniker_BindToStorage(pMoniker
, NULL
, NULL
, &IID_IPropertyBag
, (LPVOID
*)&pPropBagCat
);
622 hr
= IPropertyBag_Read(pPropBagCat
, wszClsidName
, pvar
, NULL
);
625 hr
= CLSIDFromString(V_UNION(pvar
, bstrVal
), pclsid
);
628 hr
= IPropertyBag_Read(pPropBagCat
, wszFriendlyName
, pvar
, NULL
);
631 TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid
), debugstr_w(V_UNION(pvar
, bstrVal
)));
634 IPropertyBag_Release(pPropBagCat
);
639 static HRESULT
GetInternalConnections(IBaseFilter
* pfilter
, IPin
* pinputpin
, IPin
*** pppins
, ULONG
* pnb
)
644 TRACE("(%p, %p, %p, %p)\n", pfilter
, pinputpin
, pppins
, pnb
);
645 hr
= IPin_QueryInternalConnections(pinputpin
, NULL
, &nb
);
648 } else if (hr
== S_FALSE
) {
649 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*nb
);
650 hr
= IPin_QueryInternalConnections(pinputpin
, *pppins
, &nb
);
652 ERR("Error (%x)\n", hr
);
654 } else if (hr
== E_NOTIMPL
) {
655 /* Input connected to all outputs */
656 IEnumPins
* penumpins
;
659 TRACE("E_NOTIMPL\n");
660 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
662 ERR("filter Enumpins failed (%x)\n", hr
);
666 /* Count output pins */
667 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
668 PIN_DIRECTION pindir
;
669 IPin_QueryDirection(ppin
, &pindir
);
670 if (pindir
== PINDIR_OUTPUT
)
674 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*i
);
675 /* Retrieve output pins */
676 IEnumPins_Reset(penumpins
);
678 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
679 PIN_DIRECTION pindir
;
680 IPin_QueryDirection(ppin
, &pindir
);
681 if (pindir
== PINDIR_OUTPUT
)
682 (*pppins
)[i
++] = ppin
;
686 IEnumPins_Release(penumpins
);
689 ERR("Next failed (%x)\n", hr
);
692 } else if (FAILED(hr
)) {
693 ERR("Cannot get internal connection (%x)\n", hr
);
701 /*** IGraphBuilder methods ***/
702 static HRESULT WINAPI
FilterGraph2_Connect(IFilterGraph2
*iface
,
705 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
708 IEnumMediaTypes
* penummt
;
710 IEnumPins
* penumpins
;
711 IEnumMoniker
* pEnumMoniker
;
719 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, ppinOut
, ppinIn
);
721 if (TRACE_ON(quartz
))
723 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
727 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
728 IBaseFilter_Release(PinInfo
.pFilter
);
730 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
734 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
735 IBaseFilter_Release(PinInfo
.pFilter
);
738 /* Try direct connection first */
739 hr
= IPin_Connect(ppinOut
, ppinIn
, NULL
);
743 TRACE("Direct connection failed, trying to insert other filters\n");
745 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
749 hr
= IBaseFilter_GetClassID(PinInfo
.pFilter
, &FilterCLSID
);
750 IBaseFilter_Release(PinInfo
.pFilter
);
754 /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream
755 * filter to the minor mediatype of input pin of the renderer */
756 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
758 ERR("EnumMediaTypes (%x)\n", hr
);
762 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
764 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
769 ERR("No media type found!\n");
772 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
773 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
775 /* Try to find a suitable filter that can connect to the pin to render */
776 tab
[0] = mt
->majortype
;
777 tab
[1] = mt
->subtype
;
778 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
780 ERR("Unable to enum filters (%x)\n", hr
);
784 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
789 IPin
* ppinfilter
= NULL
;
790 IBaseFilter
* pfilter
= NULL
;
792 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
793 IMoniker_Release(pMoniker
);
795 ERR("Unable to retrieve filter info (%x)\n", hr
);
799 if (IsEqualGUID(&clsid
, &FilterCLSID
)) {
800 /* Skip filter (same as the one the output pin belongs to) */
804 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
806 ERR("Unable to create filter (%x), trying next one\n", hr
);
810 hr
= IFilterGraph2_AddFilter(iface
, pfilter
, V_UNION(&var
, bstrVal
));
812 ERR("Unable to add filter (%x)\n", hr
);
813 IBaseFilter_Release(pfilter
);
818 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
820 ERR("Enumpins (%x)\n", hr
);
824 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
825 IEnumPins_Release(penumpins
);
828 ERR("Next (%x)\n", hr
);
836 hr
= IPin_Connect(ppinOut
, ppinfilter
, NULL
);
838 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
841 TRACE("Successfully connected to filter, follow chain...\n");
843 /* Render all output pins of the filter by calling IFilterGraph2_Render on each of them */
844 hr
= GetInternalConnections(pfilter
, ppinfilter
, &ppins
, &nb
);
849 IPin_Disconnect(ppinOut
);
852 TRACE("pins to consider: %d\n", nb
);
853 for(i
= 0; i
< nb
; i
++) {
854 TRACE("Processing pin %d\n", i
);
855 hr
= IFilterGraph2_Connect(iface
, ppins
[i
], ppinIn
);
857 TRACE("Cannot render pin %p (%x)\n", ppinfilter
, hr
);
859 IPin_Release(ppins
[i
]);
860 if (SUCCEEDED(hr
)) break;
862 while (++i
< nb
) IPin_Release(ppins
[i
]);
863 CoTaskMemFree(ppins
);
864 IPin_Release(ppinfilter
);
865 IBaseFilter_Release(pfilter
);
870 if (ppinfilter
) IPin_Release(ppinfilter
);
872 IFilterGraph2_RemoveFilter(iface
, pfilter
);
873 IBaseFilter_Release(pfilter
);
877 IEnumMediaTypes_Release(penummt
);
883 static HRESULT WINAPI
FilterGraph2_Render(IFilterGraph2
*iface
,
885 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
886 IEnumMediaTypes
* penummt
;
891 IEnumMoniker
* pEnumMoniker
;
896 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppinOut
);
898 if (TRACE_ON(quartz
))
902 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
906 TRACE("Filter owning pin => %p\n", PinInfo
.pFilter
);
907 IBaseFilter_Release(PinInfo
.pFilter
);
910 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
912 ERR("EnumMediaTypes (%x)\n", hr
);
918 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
920 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
925 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
926 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
928 /* Try to find a suitable renderer with the same media type */
929 tab
[0] = mt
->majortype
;
931 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, TRUE
, FALSE
, 0, NULL
, NULL
, NULL
);
933 ERR("Unable to enum filters (%x)\n", hr
);
937 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
942 IBaseFilter
* pfilter
= NULL
;
943 IEnumPins
* penumpins
;
946 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
947 IMoniker_Release(pMoniker
);
949 ERR("Unable to retrieve filter info (%x)\n", hr
);
953 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
955 ERR("Unable to create filter (%x), trying next one\n", hr
);
959 hr
= IFilterGraph2_AddFilter(iface
, pfilter
, V_UNION(&var
, bstrVal
));
961 ERR("Unable to add filter (%x)\n", hr
);
962 IBaseFilter_Release(pfilter
);
967 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
969 ERR("Splitter Enumpins (%x)\n", hr
);
972 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
973 IEnumPins_Release(penumpins
);
975 ERR("Next (%x)\n", hr
);
983 /* Connect the pin to render to the renderer */
984 hr
= IFilterGraph2_Connect(iface
, ppinOut
, ppinfilter
);
986 TRACE("Unable to connect to renderer (%x)\n", hr
);
987 IPin_Release(ppinfilter
);
990 IPin_Release(ppinfilter
);
991 IBaseFilter_Release(pfilter
);
997 IFilterGraph2_RemoveFilter(iface
, pfilter
);
998 IBaseFilter_Release(pfilter
);
1002 DeleteMediaType(mt
);
1006 IEnumMediaTypes_Release(penummt
);
1011 static HRESULT WINAPI
FilterGraph2_RenderFile(IFilterGraph2
*iface
,
1012 LPCWSTR lpcwstrFile
,
1013 LPCWSTR lpcwstrPlayList
) {
1014 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1015 static const WCHAR string
[] = {'R','e','a','d','e','r',0};
1016 IBaseFilter
* preader
= NULL
;
1017 IBaseFilter
* psplitter
= NULL
;
1018 IPin
* ppinreader
= NULL
;
1019 IPin
* ppinsplitter
= NULL
;
1020 IEnumPins
* penumpins
;
1023 IEnumMoniker
* pEnumMoniker
= NULL
;
1025 IPin
** ppins
= NULL
;
1028 IFileSourceFilter
* pfile
= NULL
;
1032 TRACE("(%p/%p)->(%s, %s)\n", This
, iface
, debugstr_w(lpcwstrFile
), debugstr_w(lpcwstrPlayList
));
1034 if (lpcwstrPlayList
!= NULL
)
1035 return E_INVALIDARG
;
1037 hr
= IFilterGraph2_AddSourceFilter(iface
, lpcwstrFile
, string
, &preader
);
1039 /* Retrieve file media type */
1041 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1042 if (SUCCEEDED(hr
)) {
1043 hr
= IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1044 IFileSourceFilter_Release(pfile
);
1048 hr
= IBaseFilter_EnumPins(preader
, &penumpins
);
1049 if (SUCCEEDED(hr
)) {
1050 hr
= IEnumPins_Next(penumpins
, 1, &ppinreader
, &pin
);
1051 IEnumPins_Release(penumpins
);
1054 if (SUCCEEDED(hr
)) {
1055 tab
[0] = mt
.majortype
;
1056 tab
[1] = mt
.subtype
;
1057 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
1063 IPin_Release(ppinreader
);
1065 IEnumMoniker_Release(pEnumMoniker
);
1067 IFilterGraph2_RemoveFilter(iface
, preader
);
1068 IBaseFilter_Release(preader
);
1073 hr
= VFW_E_CANNOT_RENDER
;
1074 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
1079 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
1080 IMoniker_Release(pMoniker
);
1082 ERR("Unable to retrieve filter info (%x)\n", hr
);
1086 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&psplitter
);
1088 ERR("Unable to create filter (%x), trying next one\n", hr
);
1092 hr
= IFilterGraph2_AddFilter(iface
, psplitter
, V_UNION(&var
, bstrVal
));
1094 ERR("Unable add filter (%x)\n", hr
);
1095 IBaseFilter_Release(psplitter
);
1099 /* Connect file source and splitter filters together */
1100 /* Make the splitter analyze incoming data */
1102 hr
= IBaseFilter_EnumPins(psplitter
, &penumpins
);
1103 if (SUCCEEDED(hr
)) {
1104 hr
= IEnumPins_Next(penumpins
, 1, &ppinsplitter
, &pin
);
1105 IEnumPins_Release(penumpins
);
1109 hr
= IPin_Connect(ppinreader
, ppinsplitter
, NULL
);
1111 /* Make sure there's some output pins in the filter */
1113 hr
= GetInternalConnections(psplitter
, ppinsplitter
, &ppins
, &nb
);
1114 if (SUCCEEDED(hr
)) {
1116 IPin_Disconnect(ppinreader
);
1117 TRACE("No output pins found in filter\n");
1118 hr
= VFW_E_CANNOT_RENDER
;
1123 IPin_Release(ppinsplitter
);
1124 ppinsplitter
= NULL
;
1126 if (SUCCEEDED(hr
)) {
1127 TRACE("Successfully connected to filter\n");
1131 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
1134 CoTaskMemFree(ppins
);
1137 IFilterGraph2_RemoveFilter(iface
, psplitter
);
1138 IBaseFilter_Release(psplitter
);
1142 /* Render all output pin of the splitter by calling IFilterGraph2_Render on each of them */
1143 if (SUCCEEDED(hr
)) {
1146 TRACE("pins to consider: %d\n", nb
);
1147 for(i
= 0; i
< nb
; i
++) {
1148 TRACE("Processing pin %d\n", i
);
1149 hr
= IFilterGraph2_Render(iface
, ppins
[i
]);
1151 ERR("Cannot render pin %p (%x)\n", ppins
[i
], hr
);
1154 IPin_Release(ppins
[i
]);
1156 CoTaskMemFree(ppins
);
1158 hr
= (partial
? VFW_S_PARTIAL_RENDER
: S_OK
);
1161 IPin_Release(ppinreader
);
1162 IBaseFilter_Release(preader
);
1164 IBaseFilter_Release(psplitter
);
1169 static HRESULT WINAPI
FilterGraph2_AddSourceFilter(IFilterGraph2
*iface
,
1170 LPCWSTR lpcwstrFileName
,
1171 LPCWSTR lpcwstrFilterName
,
1172 IBaseFilter
**ppFilter
) {
1173 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1175 IBaseFilter
* preader
;
1176 IFileSourceFilter
* pfile
= NULL
;
1180 TRACE("(%p/%p)->(%s, %s, %p)\n", This
, iface
, debugstr_w(lpcwstrFileName
), debugstr_w(lpcwstrFilterName
), ppFilter
);
1182 /* Instantiate a file source filter */
1183 hr
= CoCreateInstance(&CLSID_AsyncReader
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&preader
);
1185 ERR("Unable to create file source filter (%x)\n", hr
);
1189 hr
= IFilterGraph2_AddFilter(iface
, preader
, lpcwstrFilterName
);
1191 ERR("Unable add filter (%x)\n", hr
);
1192 IBaseFilter_Release(preader
);
1196 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1198 ERR("Unable to get IFileSourceInterface (%x)\n", hr
);
1202 /* Load the file in the file source filter */
1203 hr
= IFileSourceFilter_Load(pfile
, lpcwstrFileName
, NULL
);
1205 ERR("Load (%x)\n", hr
);
1209 IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1211 ERR("GetCurFile (%x)\n", hr
);
1214 TRACE("File %s\n", debugstr_w(filename
));
1215 TRACE("MajorType %s\n", debugstr_guid(&mt
.majortype
));
1216 TRACE("SubType %s\n", debugstr_guid(&mt
.subtype
));
1219 *ppFilter
= preader
;
1220 IFileSourceFilter_Release(pfile
);
1226 IFileSourceFilter_Release(pfile
);
1227 IFilterGraph2_RemoveFilter(iface
, preader
);
1228 IBaseFilter_Release(preader
);
1233 static HRESULT WINAPI
FilterGraph2_SetLogFile(IFilterGraph2
*iface
,
1235 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1237 TRACE("(%p/%p)->(%08x): stub !!!\n", This
, iface
, (DWORD
) hFile
);
1242 static HRESULT WINAPI
FilterGraph2_Abort(IFilterGraph2
*iface
) {
1243 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1245 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1250 static HRESULT WINAPI
FilterGraph2_ShouldOperationContinue(IFilterGraph2
*iface
) {
1251 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1253 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1258 /*** IFilterGraph2 methods ***/
1259 static HRESULT WINAPI
FilterGraph2_AddSourceFilterForMoniker(IFilterGraph2
*iface
,
1262 LPCWSTR lpcwstrFilterName
,
1263 IBaseFilter
**ppFilter
) {
1264 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1266 TRACE("(%p/%p)->(%p %p %s %p): stub !!!\n", This
, iface
, pMoniker
, pCtx
, debugstr_w(lpcwstrFilterName
), ppFilter
);
1271 static HRESULT WINAPI
FilterGraph2_ReconnectEx(IFilterGraph2
*iface
,
1273 const AM_MEDIA_TYPE
*pmt
) {
1274 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1276 TRACE("(%p/%p)->(%p %p): stub !!!\n", This
, iface
, ppin
, pmt
);
1281 static HRESULT WINAPI
FilterGraph2_RenderEx(IFilterGraph2
*iface
,
1285 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1287 TRACE("(%p/%p)->(%p %08x %p): stub !!!\n", This
, iface
, pPinOut
, dwFlags
, pvContext
);
1293 static const IFilterGraph2Vtbl IFilterGraph2_VTable
=
1295 FilterGraph2_QueryInterface
,
1296 FilterGraph2_AddRef
,
1297 FilterGraph2_Release
,
1298 FilterGraph2_AddFilter
,
1299 FilterGraph2_RemoveFilter
,
1300 FilterGraph2_EnumFilters
,
1301 FilterGraph2_FindFilterByName
,
1302 FilterGraph2_ConnectDirect
,
1303 FilterGraph2_Reconnect
,
1304 FilterGraph2_Disconnect
,
1305 FilterGraph2_SetDefaultSyncSource
,
1306 FilterGraph2_Connect
,
1307 FilterGraph2_Render
,
1308 FilterGraph2_RenderFile
,
1309 FilterGraph2_AddSourceFilter
,
1310 FilterGraph2_SetLogFile
,
1312 FilterGraph2_ShouldOperationContinue
,
1313 FilterGraph2_AddSourceFilterForMoniker
,
1314 FilterGraph2_ReconnectEx
,
1315 FilterGraph2_RenderEx
1318 /*** IUnknown methods ***/
1319 static HRESULT WINAPI
MediaControl_QueryInterface(IMediaControl
*iface
,
1322 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1324 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1326 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1329 static ULONG WINAPI
MediaControl_AddRef(IMediaControl
*iface
) {
1330 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1332 TRACE("(%p/%p)->()\n", This
, iface
);
1334 return Filtergraph_AddRef(This
);
1337 static ULONG WINAPI
MediaControl_Release(IMediaControl
*iface
) {
1338 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1340 TRACE("(%p/%p)->()\n", This
, iface
);
1342 return Filtergraph_Release(This
);
1346 /*** IDispatch methods ***/
1347 static HRESULT WINAPI
MediaControl_GetTypeInfoCount(IMediaControl
*iface
,
1349 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1351 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1356 static HRESULT WINAPI
MediaControl_GetTypeInfo(IMediaControl
*iface
,
1359 ITypeInfo
**ppTInfo
) {
1360 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1362 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1367 static HRESULT WINAPI
MediaControl_GetIDsOfNames(IMediaControl
*iface
,
1373 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1375 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1380 static HRESULT WINAPI
MediaControl_Invoke(IMediaControl
*iface
,
1381 DISPID dispIdMember
,
1385 DISPPARAMS
*pDispParams
,
1387 EXCEPINFO
*pExepInfo
,
1389 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1391 TRACE("(%p/%p)->(%d, %s (%p), %d, %04x, %p, %p, %p, %p): stub !!!\n", This
, iface
, dispIdMember
, debugstr_guid(riid
), riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
1396 typedef HRESULT(WINAPI
*fnFoundFilter
)(IBaseFilter
*);
1398 static HRESULT
ExploreGraph(IFilterGraphImpl
* pGraph
, IPin
* pOutputPin
, fnFoundFilter FoundFilter
)
1407 TRACE("%p %p\n", pGraph
, pOutputPin
);
1408 PinInfo
.pFilter
= NULL
;
1410 hr
= IPin_ConnectedTo(pOutputPin
, &pInputPin
);
1414 hr
= IPin_QueryPinInfo(pInputPin
, &PinInfo
);
1416 hr
= GetInternalConnections(PinInfo
.pFilter
, pInputPin
, &ppPins
, &nb
);
1417 IPin_Release(pInputPin
);
1424 TRACE("Reached a renderer\n");
1425 /* Count renderers for end of stream notification */
1426 pGraph
->nRenderers
++;
1430 for(i
= 0; i
< nb
; i
++)
1432 /* Explore the graph downstream from this pin
1433 * FIXME: We should prevent exploring from a pin more than once. This can happens when
1434 * several input pins are connected to the same output (a MUX for instance). */
1435 ExploreGraph(pGraph
, ppPins
[i
], FoundFilter
);
1436 IPin_Release(ppPins
[i
]);
1439 CoTaskMemFree(ppPins
);
1441 TRACE("Doing stuff with filter %p\n", PinInfo
.pFilter
);
1442 FoundFilter(PinInfo
.pFilter
);
1445 if (PinInfo
.pFilter
) IBaseFilter_Release(PinInfo
.pFilter
);
1449 static HRESULT WINAPI
SendRun(IBaseFilter
*pFilter
) {
1450 return IBaseFilter_Run(pFilter
, 0);
1453 static HRESULT WINAPI
SendPause(IBaseFilter
*pFilter
) {
1454 return IBaseFilter_Pause(pFilter
);
1457 static HRESULT WINAPI
SendStop(IBaseFilter
*pFilter
) {
1458 return IBaseFilter_Stop(pFilter
);
1461 static HRESULT
SendFilterMessage(IMediaControl
*iface
, fnFoundFilter FoundFilter
) {
1462 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1464 IBaseFilter
* pfilter
;
1470 TRACE("(%p/%p)->()\n", This
, iface
);
1472 /* Explorer the graph from source filters to renderers, determine renderers
1473 * number and run filters from renderers to source filters */
1474 This
->nRenderers
= 0;
1475 ResetEvent(This
->hEventCompletion
);
1477 for(i
= 0; i
< This
->nFilters
; i
++)
1480 pfilter
= This
->ppFiltersInGraph
[i
];
1481 hr
= IBaseFilter_EnumPins(pfilter
, &pEnum
);
1484 ERR("Enum pins failed %x\n", hr
);
1487 /* Check if it is a source filter */
1488 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1490 IPin_QueryDirection(pPin
, &dir
);
1492 if (dir
== PINDIR_INPUT
)
1500 TRACE("Found a source filter %p\n", pfilter
);
1501 IEnumPins_Reset(pEnum
);
1502 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1504 /* Explore the graph downstream from this pin */
1505 ExploreGraph(This
, pPin
, FoundFilter
);
1508 FoundFilter(pfilter
);
1510 IEnumPins_Release(pEnum
);
1516 /*** IMediaControl methods ***/
1517 static HRESULT WINAPI
MediaControl_Run(IMediaControl
*iface
) {
1518 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1519 TRACE("(%p/%p)->()\n", This
, iface
);
1521 if (This
->state
== State_Running
) return S_OK
;
1523 EnterCriticalSection(&This
->cs
);
1524 SendFilterMessage(iface
, SendRun
);
1525 This
->state
= State_Running
;
1526 LeaveCriticalSection(&This
->cs
);
1530 static HRESULT WINAPI
MediaControl_Pause(IMediaControl
*iface
) {
1531 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1532 TRACE("(%p/%p)->()\n", This
, iface
);
1534 if (This
->state
== State_Paused
) return S_OK
;
1536 EnterCriticalSection(&This
->cs
);
1537 SendFilterMessage(iface
, SendPause
);
1538 This
->state
= State_Paused
;
1539 LeaveCriticalSection(&This
->cs
);
1543 static HRESULT WINAPI
MediaControl_Stop(IMediaControl
*iface
) {
1544 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1545 TRACE("(%p/%p)->()\n", This
, iface
);
1547 if (This
->state
== State_Stopped
) return S_OK
;
1549 EnterCriticalSection(&This
->cs
);
1550 if (This
->state
== State_Running
) SendFilterMessage(iface
, SendPause
);
1551 SendFilterMessage(iface
, SendStop
);
1552 This
->state
= State_Stopped
;
1553 LeaveCriticalSection(&This
->cs
);
1557 static HRESULT WINAPI
MediaControl_GetState(IMediaControl
*iface
,
1559 OAFilterState
*pfs
) {
1560 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1562 TRACE("(%p/%p)->(%d, %p): semi-stub !!!\n", This
, iface
, msTimeout
, pfs
);
1564 EnterCriticalSection(&This
->cs
);
1568 LeaveCriticalSection(&This
->cs
);
1573 static HRESULT WINAPI
MediaControl_RenderFile(IMediaControl
*iface
,
1575 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1577 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
);
1582 static HRESULT WINAPI
MediaControl_AddSourceFilter(IMediaControl
*iface
,
1584 IDispatch
**ppUnk
) {
1585 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1587 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
, ppUnk
);
1592 static HRESULT WINAPI
MediaControl_get_FilterCollection(IMediaControl
*iface
,
1593 IDispatch
**ppUnk
) {
1594 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1596 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1601 static HRESULT WINAPI
MediaControl_get_RegFilterCollection(IMediaControl
*iface
,
1602 IDispatch
**ppUnk
) {
1603 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1605 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1610 static HRESULT WINAPI
MediaControl_StopWhenReady(IMediaControl
*iface
) {
1611 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1613 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1619 static const IMediaControlVtbl IMediaControl_VTable
=
1621 MediaControl_QueryInterface
,
1622 MediaControl_AddRef
,
1623 MediaControl_Release
,
1624 MediaControl_GetTypeInfoCount
,
1625 MediaControl_GetTypeInfo
,
1626 MediaControl_GetIDsOfNames
,
1627 MediaControl_Invoke
,
1631 MediaControl_GetState
,
1632 MediaControl_RenderFile
,
1633 MediaControl_AddSourceFilter
,
1634 MediaControl_get_FilterCollection
,
1635 MediaControl_get_RegFilterCollection
,
1636 MediaControl_StopWhenReady
1640 /*** IUnknown methods ***/
1641 static HRESULT WINAPI
MediaSeeking_QueryInterface(IMediaSeeking
*iface
,
1644 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1646 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1648 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1651 static ULONG WINAPI
MediaSeeking_AddRef(IMediaSeeking
*iface
) {
1652 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1654 TRACE("(%p/%p)->()\n", This
, iface
);
1656 return Filtergraph_AddRef(This
);
1659 static ULONG WINAPI
MediaSeeking_Release(IMediaSeeking
*iface
) {
1660 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1662 TRACE("(%p/%p)->()\n", This
, iface
);
1664 return Filtergraph_Release(This
);
1667 /*** IMediaSeeking methods ***/
1668 static HRESULT WINAPI
MediaSeeking_GetCapabilities(IMediaSeeking
*iface
,
1669 DWORD
*pCapabilities
) {
1670 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1672 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1677 static HRESULT WINAPI
MediaSeeking_CheckCapabilities(IMediaSeeking
*iface
,
1678 DWORD
*pCapabilities
) {
1679 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1681 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1686 static HRESULT WINAPI
MediaSeeking_IsFormatSupported(IMediaSeeking
*iface
,
1687 const GUID
*pFormat
) {
1688 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1690 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1695 static HRESULT WINAPI
MediaSeeking_QueryPreferredFormat(IMediaSeeking
*iface
,
1697 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1699 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1704 static HRESULT WINAPI
MediaSeeking_GetTimeFormat(IMediaSeeking
*iface
,
1706 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1708 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1713 static HRESULT WINAPI
MediaSeeking_IsUsingTimeFormat(IMediaSeeking
*iface
,
1714 const GUID
*pFormat
) {
1715 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1717 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1722 static HRESULT WINAPI
MediaSeeking_SetTimeFormat(IMediaSeeking
*iface
,
1723 const GUID
*pFormat
) {
1724 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1726 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1731 static HRESULT WINAPI
MediaSeeking_GetDuration(IMediaSeeking
*iface
,
1732 LONGLONG
*pDuration
) {
1733 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1735 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDuration
);
1740 static HRESULT WINAPI
MediaSeeking_GetStopPosition(IMediaSeeking
*iface
,
1742 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1744 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pStop
);
1749 static HRESULT WINAPI
MediaSeeking_GetCurrentPosition(IMediaSeeking
*iface
,
1750 LONGLONG
*pCurrent
) {
1751 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1753 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCurrent
);
1758 static HRESULT WINAPI
MediaSeeking_ConvertTimeFormat(IMediaSeeking
*iface
,
1760 const GUID
*pTargetFormat
,
1762 const GUID
*pSourceFormat
) {
1763 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1765 TRACE("(%p/%p)->(%p, %p, 0x%s, %p): stub !!!\n", This
, iface
, pTarget
,
1766 pTargetFormat
, wine_dbgstr_longlong(Source
), pSourceFormat
);
1771 static HRESULT WINAPI
MediaSeeking_SetPositions(IMediaSeeking
*iface
,
1773 DWORD dwCurrentFlags
,
1775 DWORD dwStopFlags
) {
1776 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1778 TRACE("(%p/%p)->(%p, %08x, %p, %08x): stub !!!\n", This
, iface
, pCurrent
, dwCurrentFlags
, pStop
, dwStopFlags
);
1783 static HRESULT WINAPI
MediaSeeking_GetPositions(IMediaSeeking
*iface
,
1786 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1788 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pCurrent
, pStop
);
1793 static HRESULT WINAPI
MediaSeeking_GetAvailable(IMediaSeeking
*iface
,
1794 LONGLONG
*pEarliest
,
1795 LONGLONG
*pLatest
) {
1796 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1798 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pEarliest
, pLatest
);
1803 static HRESULT WINAPI
MediaSeeking_SetRate(IMediaSeeking
*iface
,
1805 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1807 TRACE("(%p/%p)->(%f): stub !!!\n", This
, iface
, dRate
);
1812 static HRESULT WINAPI
MediaSeeking_GetRate(IMediaSeeking
*iface
,
1814 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1816 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pdRate
);
1821 static HRESULT WINAPI
MediaSeeking_GetPreroll(IMediaSeeking
*iface
,
1822 LONGLONG
*pllPreroll
) {
1823 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1825 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pllPreroll
);
1831 static const IMediaSeekingVtbl IMediaSeeking_VTable
=
1833 MediaSeeking_QueryInterface
,
1834 MediaSeeking_AddRef
,
1835 MediaSeeking_Release
,
1836 MediaSeeking_GetCapabilities
,
1837 MediaSeeking_CheckCapabilities
,
1838 MediaSeeking_IsFormatSupported
,
1839 MediaSeeking_QueryPreferredFormat
,
1840 MediaSeeking_GetTimeFormat
,
1841 MediaSeeking_IsUsingTimeFormat
,
1842 MediaSeeking_SetTimeFormat
,
1843 MediaSeeking_GetDuration
,
1844 MediaSeeking_GetStopPosition
,
1845 MediaSeeking_GetCurrentPosition
,
1846 MediaSeeking_ConvertTimeFormat
,
1847 MediaSeeking_SetPositions
,
1848 MediaSeeking_GetPositions
,
1849 MediaSeeking_GetAvailable
,
1850 MediaSeeking_SetRate
,
1851 MediaSeeking_GetRate
,
1852 MediaSeeking_GetPreroll
1855 /*** IUnknown methods ***/
1856 static HRESULT WINAPI
MediaPosition_QueryInterface(IMediaPosition
* iface
, REFIID riid
, void** ppvObj
){
1857 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1859 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1861 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1864 static ULONG WINAPI
MediaPosition_AddRef(IMediaPosition
*iface
){
1865 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1867 TRACE("(%p/%p)->()\n", This
, iface
);
1869 return Filtergraph_AddRef(This
);
1872 static ULONG WINAPI
MediaPosition_Release(IMediaPosition
*iface
){
1873 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1875 TRACE("(%p/%p)->()\n", This
, iface
);
1877 return Filtergraph_Release(This
);
1880 /*** IDispatch methods ***/
1881 static HRESULT WINAPI
MediaPosition_GetTypeInfoCount(IMediaPosition
*iface
, UINT
* pctinfo
){
1882 FIXME("(%p) stub!\n", iface
);
1886 static HRESULT WINAPI
MediaPosition_GetTypeInfo(IMediaPosition
*iface
, UINT iTInfo
, LCID lcid
, ITypeInfo
** ppTInfo
){
1887 FIXME("(%p) stub!\n", iface
);
1891 static HRESULT WINAPI
MediaPosition_GetIDsOfNames(IMediaPosition
* iface
, REFIID riid
, LPOLESTR
* rgszNames
, UINT cNames
, LCID lcid
, DISPID
* rgDispId
){
1892 FIXME("(%p) stub!\n", iface
);
1896 static HRESULT WINAPI
MediaPosition_Invoke(IMediaPosition
* iface
, DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
* pDispParams
, VARIANT
* pVarResult
, EXCEPINFO
* pExcepInfo
, UINT
* puArgErr
){
1897 FIXME("(%p) stub!\n", iface
);
1901 /*** IMediaPosition methods ***/
1902 static HRESULT WINAPI
MediaPosition_get_Duration(IMediaPosition
* iface
, REFTIME
*plength
){
1903 FIXME("(%p)->(%p) stub!\n", iface
, plength
);
1907 static HRESULT WINAPI
MediaPosition_put_CurrentPosition(IMediaPosition
* iface
, REFTIME llTime
){
1908 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1912 static HRESULT WINAPI
MediaPosition_get_CurrentPosition(IMediaPosition
* iface
, REFTIME
*pllTime
){
1913 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1917 static HRESULT WINAPI
MediaPosition_get_StopTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1918 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1922 static HRESULT WINAPI
MediaPosition_put_StopTime(IMediaPosition
* iface
, REFTIME llTime
){
1923 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1927 static HRESULT WINAPI
MediaPosition_get_PrerollTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1928 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1932 static HRESULT WINAPI
MediaPosition_put_PrerollTime(IMediaPosition
* iface
, REFTIME llTime
){
1933 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1937 static HRESULT WINAPI
MediaPosition_put_Rate(IMediaPosition
* iface
, double dRate
){
1938 FIXME("(%p)->(%f) stub!\n", iface
, dRate
);
1942 static HRESULT WINAPI
MediaPosition_get_Rate(IMediaPosition
* iface
, double *pdRate
){
1943 FIXME("(%p)->(%p) stub!\n", iface
, pdRate
);
1947 static HRESULT WINAPI
MediaPosition_CanSeekForward(IMediaPosition
* iface
, LONG
*pCanSeekForward
){
1948 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekForward
);
1952 static HRESULT WINAPI
MediaPosition_CanSeekBackward(IMediaPosition
* iface
, LONG
*pCanSeekBackward
){
1953 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekBackward
);
1958 static const IMediaPositionVtbl IMediaPosition_VTable
=
1960 MediaPosition_QueryInterface
,
1961 MediaPosition_AddRef
,
1962 MediaPosition_Release
,
1963 MediaPosition_GetTypeInfoCount
,
1964 MediaPosition_GetTypeInfo
,
1965 MediaPosition_GetIDsOfNames
,
1966 MediaPosition_Invoke
,
1967 MediaPosition_get_Duration
,
1968 MediaPosition_put_CurrentPosition
,
1969 MediaPosition_get_CurrentPosition
,
1970 MediaPosition_get_StopTime
,
1971 MediaPosition_put_StopTime
,
1972 MediaPosition_get_PrerollTime
,
1973 MediaPosition_put_PrerollTime
,
1974 MediaPosition_put_Rate
,
1975 MediaPosition_get_Rate
,
1976 MediaPosition_CanSeekForward
,
1977 MediaPosition_CanSeekBackward
1980 static HRESULT
GetTargetInterface(IFilterGraphImpl
* pGraph
, REFIID riid
, LPVOID
* ppvObj
)
1982 HRESULT hr
= E_NOINTERFACE
;
1986 /* Check if the interface type is already registered */
1987 for (entry
= 0; entry
< pGraph
->nItfCacheEntries
; entry
++)
1988 if (riid
== pGraph
->ItfCacheEntries
[entry
].riid
)
1990 if (pGraph
->ItfCacheEntries
[entry
].iface
)
1992 /* Return the interface if available */
1993 *ppvObj
= pGraph
->ItfCacheEntries
[entry
].iface
;
1999 if (entry
>= MAX_ITF_CACHE_ENTRIES
)
2001 FIXME("Not enough space to store interface in the cache\n");
2002 return E_OUTOFMEMORY
;
2005 /* Find a filter supporting the requested interface */
2006 for (i
= 0; i
< pGraph
->nFilters
; i
++)
2008 hr
= IBaseFilter_QueryInterface(pGraph
->ppFiltersInGraph
[i
], riid
, ppvObj
);
2011 pGraph
->ItfCacheEntries
[entry
].riid
= riid
;
2012 pGraph
->ItfCacheEntries
[entry
].filter
= pGraph
->ppFiltersInGraph
[i
];
2013 pGraph
->ItfCacheEntries
[entry
].iface
= (IUnknown
*)*ppvObj
;
2014 if (entry
>= pGraph
->nItfCacheEntries
)
2015 pGraph
->nItfCacheEntries
++;
2018 if (hr
!= E_NOINTERFACE
)
2025 /*** IUnknown methods ***/
2026 static HRESULT WINAPI
BasicAudio_QueryInterface(IBasicAudio
*iface
,
2029 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2031 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2033 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2036 static ULONG WINAPI
BasicAudio_AddRef(IBasicAudio
*iface
) {
2037 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2039 TRACE("(%p/%p)->()\n", This
, iface
);
2041 return Filtergraph_AddRef(This
);
2044 static ULONG WINAPI
BasicAudio_Release(IBasicAudio
*iface
) {
2045 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2047 TRACE("(%p/%p)->()\n", This
, iface
);
2049 return Filtergraph_Release(This
);
2052 /*** IDispatch methods ***/
2053 static HRESULT WINAPI
BasicAudio_GetTypeInfoCount(IBasicAudio
*iface
,
2055 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2056 IBasicAudio
* pBasicAudio
;
2059 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
2061 EnterCriticalSection(&This
->cs
);
2063 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2066 hr
= IBasicAudio_GetTypeInfoCount(pBasicAudio
, pctinfo
);
2068 LeaveCriticalSection(&This
->cs
);
2073 static HRESULT WINAPI
BasicAudio_GetTypeInfo(IBasicAudio
*iface
,
2076 ITypeInfo
**ppTInfo
) {
2077 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2078 IBasicAudio
* pBasicAudio
;
2081 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2083 EnterCriticalSection(&This
->cs
);
2085 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2088 hr
= IBasicAudio_GetTypeInfo(pBasicAudio
, iTInfo
, lcid
, ppTInfo
);
2090 LeaveCriticalSection(&This
->cs
);
2095 static HRESULT WINAPI
BasicAudio_GetIDsOfNames(IBasicAudio
*iface
,
2101 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2102 IBasicAudio
* pBasicAudio
;
2105 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2107 EnterCriticalSection(&This
->cs
);
2109 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2112 hr
= IBasicAudio_GetIDsOfNames(pBasicAudio
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2114 LeaveCriticalSection(&This
->cs
);
2119 static HRESULT WINAPI
BasicAudio_Invoke(IBasicAudio
*iface
,
2120 DISPID dispIdMember
,
2124 DISPPARAMS
*pDispParams
,
2126 EXCEPINFO
*pExepInfo
,
2128 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2129 IBasicAudio
* pBasicAudio
;
2132 TRACE("(%p/%p)->(%d, %s (%p), %d, %04x, %p, %p, %p, %p)\n", This
, iface
, dispIdMember
, debugstr_guid(riid
), riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2134 EnterCriticalSection(&This
->cs
);
2136 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2139 hr
= IBasicAudio_Invoke(pBasicAudio
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2141 LeaveCriticalSection(&This
->cs
);
2146 /*** IBasicAudio methods ***/
2147 static HRESULT WINAPI
BasicAudio_put_Volume(IBasicAudio
*iface
,
2149 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2150 IBasicAudio
* pBasicAudio
;
2153 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lVolume
);
2155 EnterCriticalSection(&This
->cs
);
2157 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2160 hr
= IBasicAudio_put_Volume(pBasicAudio
, lVolume
);
2162 LeaveCriticalSection(&This
->cs
);
2167 static HRESULT WINAPI
BasicAudio_get_Volume(IBasicAudio
*iface
,
2169 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2170 IBasicAudio
* pBasicAudio
;
2173 TRACE("(%p/%p)->(%p)\n", This
, iface
, plVolume
);
2175 EnterCriticalSection(&This
->cs
);
2177 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2180 hr
= IBasicAudio_get_Volume(pBasicAudio
, plVolume
);
2182 LeaveCriticalSection(&This
->cs
);
2187 static HRESULT WINAPI
BasicAudio_put_Balance(IBasicAudio
*iface
,
2189 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2190 IBasicAudio
* pBasicAudio
;
2193 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lBalance
);
2195 EnterCriticalSection(&This
->cs
);
2197 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2200 hr
= IBasicAudio_put_Balance(pBasicAudio
, lBalance
);
2202 LeaveCriticalSection(&This
->cs
);
2207 static HRESULT WINAPI
BasicAudio_get_Balance(IBasicAudio
*iface
,
2209 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2210 IBasicAudio
* pBasicAudio
;
2213 TRACE("(%p/%p)->(%p)\n", This
, iface
, plBalance
);
2215 EnterCriticalSection(&This
->cs
);
2217 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2220 hr
= IBasicAudio_get_Balance(pBasicAudio
, plBalance
);
2222 LeaveCriticalSection(&This
->cs
);
2227 static const IBasicAudioVtbl IBasicAudio_VTable
=
2229 BasicAudio_QueryInterface
,
2232 BasicAudio_GetTypeInfoCount
,
2233 BasicAudio_GetTypeInfo
,
2234 BasicAudio_GetIDsOfNames
,
2236 BasicAudio_put_Volume
,
2237 BasicAudio_get_Volume
,
2238 BasicAudio_put_Balance
,
2239 BasicAudio_get_Balance
2242 /*** IUnknown methods ***/
2243 static HRESULT WINAPI
BasicVideo_QueryInterface(IBasicVideo
*iface
,
2246 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2248 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2250 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2253 static ULONG WINAPI
BasicVideo_AddRef(IBasicVideo
*iface
) {
2254 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2256 TRACE("(%p/%p)->()\n", This
, iface
);
2258 return Filtergraph_AddRef(This
);
2261 static ULONG WINAPI
BasicVideo_Release(IBasicVideo
*iface
) {
2262 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2264 TRACE("(%p/%p)->()\n", This
, iface
);
2266 return Filtergraph_Release(This
);
2269 /*** IDispatch methods ***/
2270 static HRESULT WINAPI
BasicVideo_GetTypeInfoCount(IBasicVideo
*iface
,
2272 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2273 IBasicVideo
* pBasicVideo
;
2276 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
2278 EnterCriticalSection(&This
->cs
);
2280 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2283 hr
= IBasicVideo_GetTypeInfoCount(pBasicVideo
, pctinfo
);
2285 LeaveCriticalSection(&This
->cs
);
2290 static HRESULT WINAPI
BasicVideo_GetTypeInfo(IBasicVideo
*iface
,
2293 ITypeInfo
**ppTInfo
) {
2294 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2295 IBasicVideo
* pBasicVideo
;
2298 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2300 EnterCriticalSection(&This
->cs
);
2302 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2305 hr
= IBasicVideo_GetTypeInfo(pBasicVideo
, iTInfo
, lcid
, ppTInfo
);
2307 LeaveCriticalSection(&This
->cs
);
2312 static HRESULT WINAPI
BasicVideo_GetIDsOfNames(IBasicVideo
*iface
,
2318 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2319 IBasicVideo
* pBasicVideo
;
2322 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2324 EnterCriticalSection(&This
->cs
);
2326 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2329 hr
= IBasicVideo_GetIDsOfNames(pBasicVideo
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2331 LeaveCriticalSection(&This
->cs
);
2336 static HRESULT WINAPI
BasicVideo_Invoke(IBasicVideo
*iface
,
2337 DISPID dispIdMember
,
2341 DISPPARAMS
*pDispParams
,
2343 EXCEPINFO
*pExepInfo
,
2345 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2346 IBasicVideo
* pBasicVideo
;
2349 TRACE("(%p/%p)->(%d, %s (%p), %d, %04x, %p, %p, %p, %p)\n", This
, iface
, dispIdMember
, debugstr_guid(riid
), riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2351 EnterCriticalSection(&This
->cs
);
2353 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2356 hr
= IBasicVideo_Invoke(pBasicVideo
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2358 LeaveCriticalSection(&This
->cs
);
2363 /*** IBasicVideo methods ***/
2364 static HRESULT WINAPI
BasicVideo_get_AvgTimePerFrame(IBasicVideo
*iface
,
2365 REFTIME
*pAvgTimePerFrame
) {
2366 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2367 IBasicVideo
* pBasicVideo
;
2370 TRACE("(%p/%p)->(%p)\n", This
, iface
, pAvgTimePerFrame
);
2372 EnterCriticalSection(&This
->cs
);
2374 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2377 hr
= IBasicVideo_get_AvgTimePerFrame(pBasicVideo
, pAvgTimePerFrame
);
2379 LeaveCriticalSection(&This
->cs
);
2384 static HRESULT WINAPI
BasicVideo_get_BitRate(IBasicVideo
*iface
,
2386 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2387 IBasicVideo
* pBasicVideo
;
2390 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitRate
);
2392 EnterCriticalSection(&This
->cs
);
2394 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2397 hr
= IBasicVideo_get_BitRate(pBasicVideo
, pBitRate
);
2399 LeaveCriticalSection(&This
->cs
);
2404 static HRESULT WINAPI
BasicVideo_get_BitErrorRate(IBasicVideo
*iface
,
2405 long *pBitErrorRate
) {
2406 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2407 IBasicVideo
* pBasicVideo
;
2410 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitErrorRate
);
2412 EnterCriticalSection(&This
->cs
);
2414 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2417 hr
= IBasicVideo_get_BitErrorRate(pBasicVideo
, pBitErrorRate
);
2419 LeaveCriticalSection(&This
->cs
);
2424 static HRESULT WINAPI
BasicVideo_get_VideoWidth(IBasicVideo
*iface
,
2425 long *pVideoWidth
) {
2426 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2427 IBasicVideo
* pBasicVideo
;
2430 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoWidth
);
2432 EnterCriticalSection(&This
->cs
);
2434 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2437 hr
= IBasicVideo_get_VideoWidth(pBasicVideo
, pVideoWidth
);
2439 LeaveCriticalSection(&This
->cs
);
2444 static HRESULT WINAPI
BasicVideo_get_VideoHeight(IBasicVideo
*iface
,
2445 long *pVideoHeight
) {
2446 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2447 IBasicVideo
* pBasicVideo
;
2450 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoHeight
);
2452 EnterCriticalSection(&This
->cs
);
2454 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2457 hr
= IBasicVideo_get_VideoHeight(pBasicVideo
, pVideoHeight
);
2459 LeaveCriticalSection(&This
->cs
);
2464 static HRESULT WINAPI
BasicVideo_put_SourceLeft(IBasicVideo
*iface
,
2466 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2467 IBasicVideo
* pBasicVideo
;
2470 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceLeft
);
2472 EnterCriticalSection(&This
->cs
);
2474 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2477 hr
= IBasicVideo_put_SourceLeft(pBasicVideo
, SourceLeft
);
2479 LeaveCriticalSection(&This
->cs
);
2484 static HRESULT WINAPI
BasicVideo_get_SourceLeft(IBasicVideo
*iface
,
2485 long *pSourceLeft
) {
2486 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2487 IBasicVideo
* pBasicVideo
;
2490 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceLeft
);
2492 EnterCriticalSection(&This
->cs
);
2494 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2497 hr
= IBasicVideo_get_SourceLeft(pBasicVideo
, pSourceLeft
);
2499 LeaveCriticalSection(&This
->cs
);
2504 static HRESULT WINAPI
BasicVideo_put_SourceWidth(IBasicVideo
*iface
,
2506 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2507 IBasicVideo
* pBasicVideo
;
2510 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceWidth
);
2512 EnterCriticalSection(&This
->cs
);
2514 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2517 hr
= IBasicVideo_put_SourceWidth(pBasicVideo
, SourceWidth
);
2519 LeaveCriticalSection(&This
->cs
);
2524 static HRESULT WINAPI
BasicVideo_get_SourceWidth(IBasicVideo
*iface
,
2525 long *pSourceWidth
) {
2526 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2527 IBasicVideo
* pBasicVideo
;
2530 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceWidth
);
2532 EnterCriticalSection(&This
->cs
);
2534 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2537 hr
= IBasicVideo_get_SourceWidth(pBasicVideo
, pSourceWidth
);
2539 LeaveCriticalSection(&This
->cs
);
2544 static HRESULT WINAPI
BasicVideo_put_SourceTop(IBasicVideo
*iface
,
2546 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2547 IBasicVideo
* pBasicVideo
;
2550 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceTop
);
2552 EnterCriticalSection(&This
->cs
);
2554 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2557 hr
= IBasicVideo_put_SourceTop(pBasicVideo
, SourceTop
);
2559 LeaveCriticalSection(&This
->cs
);
2564 static HRESULT WINAPI
BasicVideo_get_SourceTop(IBasicVideo
*iface
,
2566 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2567 IBasicVideo
* pBasicVideo
;
2570 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceTop
);
2572 EnterCriticalSection(&This
->cs
);
2574 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2577 hr
= IBasicVideo_get_SourceTop(pBasicVideo
, pSourceTop
);
2579 LeaveCriticalSection(&This
->cs
);
2584 static HRESULT WINAPI
BasicVideo_put_SourceHeight(IBasicVideo
*iface
,
2585 long SourceHeight
) {
2586 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2587 IBasicVideo
* pBasicVideo
;
2590 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceHeight
);
2592 EnterCriticalSection(&This
->cs
);
2594 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2597 hr
= IBasicVideo_put_SourceHeight(pBasicVideo
, SourceHeight
);
2599 LeaveCriticalSection(&This
->cs
);
2604 static HRESULT WINAPI
BasicVideo_get_SourceHeight(IBasicVideo
*iface
,
2605 long *pSourceHeight
) {
2606 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2607 IBasicVideo
* pBasicVideo
;
2610 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceHeight
);
2612 EnterCriticalSection(&This
->cs
);
2614 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2617 hr
= IBasicVideo_get_SourceHeight(pBasicVideo
, pSourceHeight
);
2619 LeaveCriticalSection(&This
->cs
);
2624 static HRESULT WINAPI
BasicVideo_put_DestinationLeft(IBasicVideo
*iface
,
2625 long DestinationLeft
) {
2626 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2627 IBasicVideo
* pBasicVideo
;
2630 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationLeft
);
2632 EnterCriticalSection(&This
->cs
);
2634 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2637 hr
= IBasicVideo_put_DestinationLeft(pBasicVideo
, DestinationLeft
);
2639 LeaveCriticalSection(&This
->cs
);
2644 static HRESULT WINAPI
BasicVideo_get_DestinationLeft(IBasicVideo
*iface
,
2645 long *pDestinationLeft
) {
2646 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2647 IBasicVideo
* pBasicVideo
;
2650 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationLeft
);
2652 EnterCriticalSection(&This
->cs
);
2654 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2657 hr
= IBasicVideo_get_DestinationLeft(pBasicVideo
, pDestinationLeft
);
2659 LeaveCriticalSection(&This
->cs
);
2664 static HRESULT WINAPI
BasicVideo_put_DestinationWidth(IBasicVideo
*iface
,
2665 long DestinationWidth
) {
2666 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2667 IBasicVideo
* pBasicVideo
;
2670 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationWidth
);
2672 EnterCriticalSection(&This
->cs
);
2674 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2677 hr
= IBasicVideo_put_DestinationWidth(pBasicVideo
, DestinationWidth
);
2679 LeaveCriticalSection(&This
->cs
);
2684 static HRESULT WINAPI
BasicVideo_get_DestinationWidth(IBasicVideo
*iface
,
2685 long *pDestinationWidth
) {
2686 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2687 IBasicVideo
* pBasicVideo
;
2690 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationWidth
);
2692 EnterCriticalSection(&This
->cs
);
2694 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2697 hr
= IBasicVideo_get_DestinationWidth(pBasicVideo
, pDestinationWidth
);
2699 LeaveCriticalSection(&This
->cs
);
2704 static HRESULT WINAPI
BasicVideo_put_DestinationTop(IBasicVideo
*iface
,
2705 long DestinationTop
) {
2706 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2707 IBasicVideo
* pBasicVideo
;
2710 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationTop
);
2712 EnterCriticalSection(&This
->cs
);
2714 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2717 hr
= IBasicVideo_put_DestinationTop(pBasicVideo
, DestinationTop
);
2719 LeaveCriticalSection(&This
->cs
);
2724 static HRESULT WINAPI
BasicVideo_get_DestinationTop(IBasicVideo
*iface
,
2725 long *pDestinationTop
) {
2726 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2727 IBasicVideo
* pBasicVideo
;
2730 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationTop
);
2732 EnterCriticalSection(&This
->cs
);
2734 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2737 hr
= IBasicVideo_get_DestinationTop(pBasicVideo
, pDestinationTop
);
2739 LeaveCriticalSection(&This
->cs
);
2744 static HRESULT WINAPI
BasicVideo_put_DestinationHeight(IBasicVideo
*iface
,
2745 long DestinationHeight
) {
2746 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2747 IBasicVideo
* pBasicVideo
;
2750 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationHeight
);
2752 EnterCriticalSection(&This
->cs
);
2754 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2757 hr
= IBasicVideo_put_DestinationHeight(pBasicVideo
, DestinationHeight
);
2759 LeaveCriticalSection(&This
->cs
);
2764 static HRESULT WINAPI
BasicVideo_get_DestinationHeight(IBasicVideo
*iface
,
2765 long *pDestinationHeight
) {
2766 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2767 IBasicVideo
* pBasicVideo
;
2770 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationHeight
);
2772 EnterCriticalSection(&This
->cs
);
2774 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2777 hr
= IBasicVideo_get_DestinationHeight(pBasicVideo
, pDestinationHeight
);
2779 LeaveCriticalSection(&This
->cs
);
2784 static HRESULT WINAPI
BasicVideo_SetSourcePosition(IBasicVideo
*iface
,
2789 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2790 IBasicVideo
* pBasicVideo
;
2793 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2795 EnterCriticalSection(&This
->cs
);
2797 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2800 hr
= IBasicVideo_SetSourcePosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2802 LeaveCriticalSection(&This
->cs
);
2807 static HRESULT WINAPI
BasicVideo_GetSourcePosition(IBasicVideo
*iface
,
2812 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2813 IBasicVideo
* pBasicVideo
;
2816 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2818 EnterCriticalSection(&This
->cs
);
2820 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2823 hr
= IBasicVideo_GetSourcePosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2825 LeaveCriticalSection(&This
->cs
);
2830 static HRESULT WINAPI
BasicVideo_SetDefaultSourcePosition(IBasicVideo
*iface
) {
2831 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2832 IBasicVideo
* pBasicVideo
;
2835 TRACE("(%p/%p)->()\n", This
, iface
);
2837 EnterCriticalSection(&This
->cs
);
2839 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2842 hr
= IBasicVideo_SetDefaultSourcePosition(pBasicVideo
);
2844 LeaveCriticalSection(&This
->cs
);
2849 static HRESULT WINAPI
BasicVideo_SetDestinationPosition(IBasicVideo
*iface
,
2854 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2855 IBasicVideo
* pBasicVideo
;
2858 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2860 EnterCriticalSection(&This
->cs
);
2862 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2865 hr
= IBasicVideo_SetDestinationPosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2867 LeaveCriticalSection(&This
->cs
);
2872 static HRESULT WINAPI
BasicVideo_GetDestinationPosition(IBasicVideo
*iface
,
2877 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2878 IBasicVideo
* pBasicVideo
;
2881 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2883 EnterCriticalSection(&This
->cs
);
2885 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2888 hr
= IBasicVideo_GetDestinationPosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2890 LeaveCriticalSection(&This
->cs
);
2895 static HRESULT WINAPI
BasicVideo_SetDefaultDestinationPosition(IBasicVideo
*iface
) {
2896 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2897 IBasicVideo
* pBasicVideo
;
2900 TRACE("(%p/%p)->()\n", This
, iface
);
2902 EnterCriticalSection(&This
->cs
);
2904 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2907 hr
= IBasicVideo_SetDefaultDestinationPosition(pBasicVideo
);
2909 LeaveCriticalSection(&This
->cs
);
2914 static HRESULT WINAPI
BasicVideo_GetVideoSize(IBasicVideo
*iface
,
2917 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2918 IBasicVideo
* pBasicVideo
;
2921 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
2923 EnterCriticalSection(&This
->cs
);
2925 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2928 hr
= IBasicVideo_GetVideoSize(pBasicVideo
, pWidth
, pHeight
);
2930 LeaveCriticalSection(&This
->cs
);
2935 static HRESULT WINAPI
BasicVideo_GetVideoPaletteEntries(IBasicVideo
*iface
,
2940 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2941 IBasicVideo
* pBasicVideo
;
2944 TRACE("(%p/%p)->(%ld, %ld, %p, %p)\n", This
, iface
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2946 EnterCriticalSection(&This
->cs
);
2948 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2951 hr
= IBasicVideo_GetVideoPaletteEntries(pBasicVideo
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2953 LeaveCriticalSection(&This
->cs
);
2958 static HRESULT WINAPI
BasicVideo_GetCurrentImage(IBasicVideo
*iface
,
2961 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2962 IBasicVideo
* pBasicVideo
;
2965 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pBufferSize
, pDIBImage
);
2967 EnterCriticalSection(&This
->cs
);
2969 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2972 hr
= IBasicVideo_GetCurrentImage(pBasicVideo
, pBufferSize
, pDIBImage
);
2974 LeaveCriticalSection(&This
->cs
);
2979 static HRESULT WINAPI
BasicVideo_IsUsingDefaultSource(IBasicVideo
*iface
) {
2980 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2981 IBasicVideo
* pBasicVideo
;
2984 TRACE("(%p/%p)->()\n", This
, iface
);
2986 EnterCriticalSection(&This
->cs
);
2988 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2991 hr
= IBasicVideo_IsUsingDefaultSource(pBasicVideo
);
2993 LeaveCriticalSection(&This
->cs
);
2998 static HRESULT WINAPI
BasicVideo_IsUsingDefaultDestination(IBasicVideo
*iface
) {
2999 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
3000 IBasicVideo
* pBasicVideo
;
3003 TRACE("(%p/%p)->()\n", This
, iface
);
3005 EnterCriticalSection(&This
->cs
);
3007 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
3010 hr
= IBasicVideo_IsUsingDefaultDestination(pBasicVideo
);
3012 LeaveCriticalSection(&This
->cs
);
3018 static const IBasicVideoVtbl IBasicVideo_VTable
=
3020 BasicVideo_QueryInterface
,
3023 BasicVideo_GetTypeInfoCount
,
3024 BasicVideo_GetTypeInfo
,
3025 BasicVideo_GetIDsOfNames
,
3027 BasicVideo_get_AvgTimePerFrame
,
3028 BasicVideo_get_BitRate
,
3029 BasicVideo_get_BitErrorRate
,
3030 BasicVideo_get_VideoWidth
,
3031 BasicVideo_get_VideoHeight
,
3032 BasicVideo_put_SourceLeft
,
3033 BasicVideo_get_SourceLeft
,
3034 BasicVideo_put_SourceWidth
,
3035 BasicVideo_get_SourceWidth
,
3036 BasicVideo_put_SourceTop
,
3037 BasicVideo_get_SourceTop
,
3038 BasicVideo_put_SourceHeight
,
3039 BasicVideo_get_SourceHeight
,
3040 BasicVideo_put_DestinationLeft
,
3041 BasicVideo_get_DestinationLeft
,
3042 BasicVideo_put_DestinationWidth
,
3043 BasicVideo_get_DestinationWidth
,
3044 BasicVideo_put_DestinationTop
,
3045 BasicVideo_get_DestinationTop
,
3046 BasicVideo_put_DestinationHeight
,
3047 BasicVideo_get_DestinationHeight
,
3048 BasicVideo_SetSourcePosition
,
3049 BasicVideo_GetSourcePosition
,
3050 BasicVideo_SetDefaultSourcePosition
,
3051 BasicVideo_SetDestinationPosition
,
3052 BasicVideo_GetDestinationPosition
,
3053 BasicVideo_SetDefaultDestinationPosition
,
3054 BasicVideo_GetVideoSize
,
3055 BasicVideo_GetVideoPaletteEntries
,
3056 BasicVideo_GetCurrentImage
,
3057 BasicVideo_IsUsingDefaultSource
,
3058 BasicVideo_IsUsingDefaultDestination
3062 /*** IUnknown methods ***/
3063 static HRESULT WINAPI
VideoWindow_QueryInterface(IVideoWindow
*iface
,
3066 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3068 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
3070 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
3073 static ULONG WINAPI
VideoWindow_AddRef(IVideoWindow
*iface
) {
3074 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3076 TRACE("(%p/%p)->()\n", This
, iface
);
3078 return Filtergraph_AddRef(This
);
3081 static ULONG WINAPI
VideoWindow_Release(IVideoWindow
*iface
) {
3082 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3084 TRACE("(%p/%p)->()\n", This
, iface
);
3086 return Filtergraph_Release(This
);
3089 /*** IDispatch methods ***/
3090 static HRESULT WINAPI
VideoWindow_GetTypeInfoCount(IVideoWindow
*iface
,
3092 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3093 IVideoWindow
* pVideoWindow
;
3096 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
3098 EnterCriticalSection(&This
->cs
);
3100 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3103 hr
= IVideoWindow_GetTypeInfoCount(pVideoWindow
, pctinfo
);
3105 LeaveCriticalSection(&This
->cs
);
3110 static HRESULT WINAPI
VideoWindow_GetTypeInfo(IVideoWindow
*iface
,
3113 ITypeInfo
**ppTInfo
) {
3114 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3115 IVideoWindow
* pVideoWindow
;
3118 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
3120 EnterCriticalSection(&This
->cs
);
3122 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3125 hr
= IVideoWindow_GetTypeInfo(pVideoWindow
, iTInfo
, lcid
, ppTInfo
);
3127 LeaveCriticalSection(&This
->cs
);
3132 static HRESULT WINAPI
VideoWindow_GetIDsOfNames(IVideoWindow
*iface
,
3138 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3139 IVideoWindow
* pVideoWindow
;
3142 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3144 EnterCriticalSection(&This
->cs
);
3146 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3149 hr
= IVideoWindow_GetIDsOfNames(pVideoWindow
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3151 LeaveCriticalSection(&This
->cs
);
3156 static HRESULT WINAPI
VideoWindow_Invoke(IVideoWindow
*iface
,
3157 DISPID dispIdMember
,
3161 DISPPARAMS
*pDispParams
,
3163 EXCEPINFO
*pExepInfo
,
3165 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3166 IVideoWindow
* pVideoWindow
;
3169 TRACE("(%p/%p)->(%d, %s (%p), %d, %04x, %p, %p, %p, %p)\n", This
, iface
, dispIdMember
, debugstr_guid(riid
), riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
3171 EnterCriticalSection(&This
->cs
);
3173 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3176 hr
= IVideoWindow_Invoke(pVideoWindow
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
3178 LeaveCriticalSection(&This
->cs
);
3184 /*** IVideoWindow methods ***/
3185 static HRESULT WINAPI
VideoWindow_put_Caption(IVideoWindow
*iface
,
3187 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3188 IVideoWindow
* pVideoWindow
;
3191 TRACE("(%p/%p)->(%s (%p))\n", This
, iface
, debugstr_w(strCaption
), strCaption
);
3193 EnterCriticalSection(&This
->cs
);
3195 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3198 hr
= IVideoWindow_put_Caption(pVideoWindow
, strCaption
);
3200 LeaveCriticalSection(&This
->cs
);
3205 static HRESULT WINAPI
VideoWindow_get_Caption(IVideoWindow
*iface
,
3207 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3208 IVideoWindow
* pVideoWindow
;
3211 TRACE("(%p/%p)->(%p)\n", This
, iface
, strCaption
);
3213 EnterCriticalSection(&This
->cs
);
3215 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3218 hr
= IVideoWindow_get_Caption(pVideoWindow
, strCaption
);
3220 LeaveCriticalSection(&This
->cs
);
3225 static HRESULT WINAPI
VideoWindow_put_WindowStyle(IVideoWindow
*iface
,
3227 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3228 IVideoWindow
* pVideoWindow
;
3231 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyle
);
3233 EnterCriticalSection(&This
->cs
);
3235 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3238 hr
= IVideoWindow_put_WindowStyle(pVideoWindow
, WindowStyle
);
3240 LeaveCriticalSection(&This
->cs
);
3245 static HRESULT WINAPI
VideoWindow_get_WindowStyle(IVideoWindow
*iface
,
3246 long *WindowStyle
) {
3247 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3248 IVideoWindow
* pVideoWindow
;
3251 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyle
);
3253 EnterCriticalSection(&This
->cs
);
3255 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3258 hr
= IVideoWindow_get_WindowStyle(pVideoWindow
, WindowStyle
);
3260 LeaveCriticalSection(&This
->cs
);
3265 static HRESULT WINAPI
VideoWindow_put_WindowStyleEx(IVideoWindow
*iface
,
3266 long WindowStyleEx
) {
3267 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3268 IVideoWindow
* pVideoWindow
;
3271 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyleEx
);
3273 EnterCriticalSection(&This
->cs
);
3275 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3278 hr
= IVideoWindow_put_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3280 LeaveCriticalSection(&This
->cs
);
3285 static HRESULT WINAPI
VideoWindow_get_WindowStyleEx(IVideoWindow
*iface
,
3286 long *WindowStyleEx
) {
3287 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3288 IVideoWindow
* pVideoWindow
;
3291 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyleEx
);
3293 EnterCriticalSection(&This
->cs
);
3295 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3298 hr
= IVideoWindow_get_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3300 LeaveCriticalSection(&This
->cs
);
3305 static HRESULT WINAPI
VideoWindow_put_AutoShow(IVideoWindow
*iface
,
3307 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3308 IVideoWindow
* pVideoWindow
;
3311 TRACE("(%p/%p)->(%ld)\n", This
, iface
, AutoShow
);
3313 EnterCriticalSection(&This
->cs
);
3315 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3318 hr
= IVideoWindow_put_AutoShow(pVideoWindow
, AutoShow
);
3320 LeaveCriticalSection(&This
->cs
);
3325 static HRESULT WINAPI
VideoWindow_get_AutoShow(IVideoWindow
*iface
,
3327 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3328 IVideoWindow
* pVideoWindow
;
3331 TRACE("(%p/%p)->(%p)\n", This
, iface
, AutoShow
);
3333 EnterCriticalSection(&This
->cs
);
3335 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3338 hr
= IVideoWindow_get_AutoShow(pVideoWindow
, AutoShow
);
3340 LeaveCriticalSection(&This
->cs
);
3345 static HRESULT WINAPI
VideoWindow_put_WindowState(IVideoWindow
*iface
,
3347 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3348 IVideoWindow
* pVideoWindow
;
3351 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowState
);
3353 EnterCriticalSection(&This
->cs
);
3355 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3358 hr
= IVideoWindow_put_WindowState(pVideoWindow
, WindowState
);
3360 LeaveCriticalSection(&This
->cs
);
3365 static HRESULT WINAPI
VideoWindow_get_WindowState(IVideoWindow
*iface
,
3366 long *WindowState
) {
3367 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3368 IVideoWindow
* pVideoWindow
;
3371 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowState
);
3373 EnterCriticalSection(&This
->cs
);
3375 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3378 hr
= IVideoWindow_get_WindowState(pVideoWindow
, WindowState
);
3380 LeaveCriticalSection(&This
->cs
);
3385 static HRESULT WINAPI
VideoWindow_put_BackgroundPalette(IVideoWindow
*iface
,
3386 long BackgroundPalette
) {
3387 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3388 IVideoWindow
* pVideoWindow
;
3391 TRACE("(%p/%p)->(%ld)\n", This
, iface
, BackgroundPalette
);
3393 EnterCriticalSection(&This
->cs
);
3395 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3398 hr
= IVideoWindow_put_BackgroundPalette(pVideoWindow
, BackgroundPalette
);
3400 LeaveCriticalSection(&This
->cs
);
3405 static HRESULT WINAPI
VideoWindow_get_BackgroundPalette(IVideoWindow
*iface
,
3406 long *pBackgroundPalette
) {
3407 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3408 IVideoWindow
* pVideoWindow
;
3411 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBackgroundPalette
);
3413 EnterCriticalSection(&This
->cs
);
3415 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3418 hr
= IVideoWindow_get_BackgroundPalette(pVideoWindow
, pBackgroundPalette
);
3420 LeaveCriticalSection(&This
->cs
);
3425 static HRESULT WINAPI
VideoWindow_put_Visible(IVideoWindow
*iface
,
3427 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3428 IVideoWindow
* pVideoWindow
;
3431 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Visible
);
3433 EnterCriticalSection(&This
->cs
);
3435 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3438 hr
= IVideoWindow_put_Visible(pVideoWindow
, Visible
);
3440 LeaveCriticalSection(&This
->cs
);
3445 static HRESULT WINAPI
VideoWindow_get_Visible(IVideoWindow
*iface
,
3447 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3448 IVideoWindow
* pVideoWindow
;
3451 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVisible
);
3453 EnterCriticalSection(&This
->cs
);
3455 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3458 hr
= IVideoWindow_get_Visible(pVideoWindow
, pVisible
);
3460 LeaveCriticalSection(&This
->cs
);
3465 static HRESULT WINAPI
VideoWindow_put_Left(IVideoWindow
*iface
,
3467 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3468 IVideoWindow
* pVideoWindow
;
3471 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Left
);
3473 EnterCriticalSection(&This
->cs
);
3475 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3478 hr
= IVideoWindow_put_Left(pVideoWindow
, Left
);
3480 LeaveCriticalSection(&This
->cs
);
3485 static HRESULT WINAPI
VideoWindow_get_Left(IVideoWindow
*iface
,
3487 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3488 IVideoWindow
* pVideoWindow
;
3491 TRACE("(%p/%p)->(%p)\n", This
, iface
, pLeft
);
3493 EnterCriticalSection(&This
->cs
);
3495 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3498 hr
= IVideoWindow_get_Left(pVideoWindow
, pLeft
);
3500 LeaveCriticalSection(&This
->cs
);
3505 static HRESULT WINAPI
VideoWindow_put_Width(IVideoWindow
*iface
,
3507 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3508 IVideoWindow
* pVideoWindow
;
3511 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Width
);
3513 EnterCriticalSection(&This
->cs
);
3515 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3518 hr
= IVideoWindow_put_Width(pVideoWindow
, Width
);
3520 LeaveCriticalSection(&This
->cs
);
3525 static HRESULT WINAPI
VideoWindow_get_Width(IVideoWindow
*iface
,
3527 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3528 IVideoWindow
* pVideoWindow
;
3531 TRACE("(%p/%p)->(%p)\n", This
, iface
, pWidth
);
3533 EnterCriticalSection(&This
->cs
);
3535 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3538 hr
= IVideoWindow_get_Width(pVideoWindow
, pWidth
);
3540 LeaveCriticalSection(&This
->cs
);
3545 static HRESULT WINAPI
VideoWindow_put_Top(IVideoWindow
*iface
,
3547 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3548 IVideoWindow
* pVideoWindow
;
3551 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Top
);
3553 EnterCriticalSection(&This
->cs
);
3555 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3558 hr
= IVideoWindow_put_Top(pVideoWindow
, Top
);
3560 LeaveCriticalSection(&This
->cs
);
3565 static HRESULT WINAPI
VideoWindow_get_Top(IVideoWindow
*iface
,
3567 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3568 IVideoWindow
* pVideoWindow
;
3571 TRACE("(%p/%p)->(%p)\n", This
, iface
, pTop
);
3573 EnterCriticalSection(&This
->cs
);
3575 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3578 hr
= IVideoWindow_get_Top(pVideoWindow
, pTop
);
3580 LeaveCriticalSection(&This
->cs
);
3585 static HRESULT WINAPI
VideoWindow_put_Height(IVideoWindow
*iface
,
3587 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3588 IVideoWindow
* pVideoWindow
;
3591 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Height
);
3593 EnterCriticalSection(&This
->cs
);
3595 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3598 hr
= IVideoWindow_put_Height(pVideoWindow
, Height
);
3600 LeaveCriticalSection(&This
->cs
);
3605 static HRESULT WINAPI
VideoWindow_get_Height(IVideoWindow
*iface
,
3607 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3608 IVideoWindow
* pVideoWindow
;
3611 TRACE("(%p/%p)->(%p)\n", This
, iface
, pHeight
);
3613 EnterCriticalSection(&This
->cs
);
3615 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3618 hr
= IVideoWindow_get_Height(pVideoWindow
, pHeight
);
3620 LeaveCriticalSection(&This
->cs
);
3625 static HRESULT WINAPI
VideoWindow_put_Owner(IVideoWindow
*iface
,
3627 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3628 IVideoWindow
* pVideoWindow
;
3631 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Owner
);
3633 EnterCriticalSection(&This
->cs
);
3635 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3638 hr
= IVideoWindow_put_Owner(pVideoWindow
, Owner
);
3640 LeaveCriticalSection(&This
->cs
);
3645 static HRESULT WINAPI
VideoWindow_get_Owner(IVideoWindow
*iface
,
3647 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3648 IVideoWindow
* pVideoWindow
;
3651 TRACE("(%p/%p)->(%p)\n", This
, iface
, Owner
);
3653 EnterCriticalSection(&This
->cs
);
3655 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3658 hr
= IVideoWindow_get_Owner(pVideoWindow
, Owner
);
3660 LeaveCriticalSection(&This
->cs
);
3665 static HRESULT WINAPI
VideoWindow_put_MessageDrain(IVideoWindow
*iface
,
3667 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3668 IVideoWindow
* pVideoWindow
;
3671 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Drain
);
3673 EnterCriticalSection(&This
->cs
);
3675 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3678 hr
= IVideoWindow_put_MessageDrain(pVideoWindow
, Drain
);
3680 LeaveCriticalSection(&This
->cs
);
3685 static HRESULT WINAPI
VideoWindow_get_MessageDrain(IVideoWindow
*iface
,
3687 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3688 IVideoWindow
* pVideoWindow
;
3691 TRACE("(%p/%p)->(%p)\n", This
, iface
, Drain
);
3693 EnterCriticalSection(&This
->cs
);
3695 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3698 hr
= IVideoWindow_get_MessageDrain(pVideoWindow
, Drain
);
3700 LeaveCriticalSection(&This
->cs
);
3705 static HRESULT WINAPI
VideoWindow_get_BorderColor(IVideoWindow
*iface
,
3707 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3708 IVideoWindow
* pVideoWindow
;
3711 TRACE("(%p/%p)->(%p)\n", This
, iface
, Color
);
3713 EnterCriticalSection(&This
->cs
);
3715 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3718 hr
= IVideoWindow_get_BorderColor(pVideoWindow
, Color
);
3720 LeaveCriticalSection(&This
->cs
);
3725 static HRESULT WINAPI
VideoWindow_put_BorderColor(IVideoWindow
*iface
,
3727 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3728 IVideoWindow
* pVideoWindow
;
3731 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Color
);
3733 EnterCriticalSection(&This
->cs
);
3735 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3738 hr
= IVideoWindow_put_BorderColor(pVideoWindow
, Color
);
3740 LeaveCriticalSection(&This
->cs
);
3745 static HRESULT WINAPI
VideoWindow_get_FullScreenMode(IVideoWindow
*iface
,
3746 long *FullScreenMode
) {
3747 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3748 IVideoWindow
* pVideoWindow
;
3751 TRACE("(%p/%p)->(%p)\n", This
, iface
, FullScreenMode
);
3753 EnterCriticalSection(&This
->cs
);
3755 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3758 hr
= IVideoWindow_get_FullScreenMode(pVideoWindow
, FullScreenMode
);
3760 LeaveCriticalSection(&This
->cs
);
3765 static HRESULT WINAPI
VideoWindow_put_FullScreenMode(IVideoWindow
*iface
,
3766 long FullScreenMode
) {
3767 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3768 IVideoWindow
* pVideoWindow
;
3771 TRACE("(%p/%p)->(%ld)\n", This
, iface
, FullScreenMode
);
3773 EnterCriticalSection(&This
->cs
);
3775 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3778 hr
= IVideoWindow_put_FullScreenMode(pVideoWindow
, FullScreenMode
);
3780 LeaveCriticalSection(&This
->cs
);
3785 static HRESULT WINAPI
VideoWindow_SetWindowForeground(IVideoWindow
*iface
,
3787 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3788 IVideoWindow
* pVideoWindow
;
3791 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Focus
);
3793 EnterCriticalSection(&This
->cs
);
3795 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3798 hr
= IVideoWindow_SetWindowForeground(pVideoWindow
, Focus
);
3800 LeaveCriticalSection(&This
->cs
);
3805 static HRESULT WINAPI
VideoWindow_NotifyOwnerMessage(IVideoWindow
*iface
,
3810 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3811 IVideoWindow
* pVideoWindow
;
3814 TRACE("(%p/%p)->(%08x, %ld, %08lx, %08lx)\n", This
, iface
, (DWORD
) hwnd
, uMsg
, wParam
, lParam
);
3816 EnterCriticalSection(&This
->cs
);
3818 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3821 hr
= IVideoWindow_NotifyOwnerMessage(pVideoWindow
, hwnd
, uMsg
, wParam
, lParam
);
3823 LeaveCriticalSection(&This
->cs
);
3828 static HRESULT WINAPI
VideoWindow_SetWindowPosition(IVideoWindow
*iface
,
3833 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3834 IVideoWindow
* pVideoWindow
;
3837 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
3839 EnterCriticalSection(&This
->cs
);
3841 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3844 hr
= IVideoWindow_SetWindowPosition(pVideoWindow
, Left
, Top
, Width
, Height
);
3846 LeaveCriticalSection(&This
->cs
);
3851 static HRESULT WINAPI
VideoWindow_GetWindowPosition(IVideoWindow
*iface
,
3856 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3857 IVideoWindow
* pVideoWindow
;
3860 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3862 EnterCriticalSection(&This
->cs
);
3864 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3867 hr
= IVideoWindow_GetWindowPosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3869 LeaveCriticalSection(&This
->cs
);
3874 static HRESULT WINAPI
VideoWindow_GetMinIdealImageSize(IVideoWindow
*iface
,
3877 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3878 IVideoWindow
* pVideoWindow
;
3881 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3883 EnterCriticalSection(&This
->cs
);
3885 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3888 hr
= IVideoWindow_GetMinIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3890 LeaveCriticalSection(&This
->cs
);
3895 static HRESULT WINAPI
VideoWindow_GetMaxIdealImageSize(IVideoWindow
*iface
,
3898 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3899 IVideoWindow
* pVideoWindow
;
3902 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3904 EnterCriticalSection(&This
->cs
);
3906 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3909 hr
= IVideoWindow_GetMaxIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3911 LeaveCriticalSection(&This
->cs
);
3916 static HRESULT WINAPI
VideoWindow_GetRestorePosition(IVideoWindow
*iface
,
3921 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3922 IVideoWindow
* pVideoWindow
;
3925 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3927 EnterCriticalSection(&This
->cs
);
3929 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3932 hr
= IVideoWindow_GetRestorePosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3934 LeaveCriticalSection(&This
->cs
);
3939 static HRESULT WINAPI
VideoWindow_HideCursor(IVideoWindow
*iface
,
3941 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3942 IVideoWindow
* pVideoWindow
;
3945 TRACE("(%p/%p)->(%ld)\n", This
, iface
, HideCursor
);
3947 EnterCriticalSection(&This
->cs
);
3949 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3952 hr
= IVideoWindow_HideCursor(pVideoWindow
, HideCursor
);
3954 LeaveCriticalSection(&This
->cs
);
3959 static HRESULT WINAPI
VideoWindow_IsCursorHidden(IVideoWindow
*iface
,
3960 long *CursorHidden
) {
3961 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3962 IVideoWindow
* pVideoWindow
;
3965 TRACE("(%p/%p)->(%p)\n", This
, iface
, CursorHidden
);
3967 EnterCriticalSection(&This
->cs
);
3969 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3972 hr
= IVideoWindow_IsCursorHidden(pVideoWindow
, CursorHidden
);
3974 LeaveCriticalSection(&This
->cs
);
3980 static const IVideoWindowVtbl IVideoWindow_VTable
=
3982 VideoWindow_QueryInterface
,
3984 VideoWindow_Release
,
3985 VideoWindow_GetTypeInfoCount
,
3986 VideoWindow_GetTypeInfo
,
3987 VideoWindow_GetIDsOfNames
,
3989 VideoWindow_put_Caption
,
3990 VideoWindow_get_Caption
,
3991 VideoWindow_put_WindowStyle
,
3992 VideoWindow_get_WindowStyle
,
3993 VideoWindow_put_WindowStyleEx
,
3994 VideoWindow_get_WindowStyleEx
,
3995 VideoWindow_put_AutoShow
,
3996 VideoWindow_get_AutoShow
,
3997 VideoWindow_put_WindowState
,
3998 VideoWindow_get_WindowState
,
3999 VideoWindow_put_BackgroundPalette
,
4000 VideoWindow_get_BackgroundPalette
,
4001 VideoWindow_put_Visible
,
4002 VideoWindow_get_Visible
,
4003 VideoWindow_put_Left
,
4004 VideoWindow_get_Left
,
4005 VideoWindow_put_Width
,
4006 VideoWindow_get_Width
,
4007 VideoWindow_put_Top
,
4008 VideoWindow_get_Top
,
4009 VideoWindow_put_Height
,
4010 VideoWindow_get_Height
,
4011 VideoWindow_put_Owner
,
4012 VideoWindow_get_Owner
,
4013 VideoWindow_put_MessageDrain
,
4014 VideoWindow_get_MessageDrain
,
4015 VideoWindow_get_BorderColor
,
4016 VideoWindow_put_BorderColor
,
4017 VideoWindow_get_FullScreenMode
,
4018 VideoWindow_put_FullScreenMode
,
4019 VideoWindow_SetWindowForeground
,
4020 VideoWindow_NotifyOwnerMessage
,
4021 VideoWindow_SetWindowPosition
,
4022 VideoWindow_GetWindowPosition
,
4023 VideoWindow_GetMinIdealImageSize
,
4024 VideoWindow_GetMaxIdealImageSize
,
4025 VideoWindow_GetRestorePosition
,
4026 VideoWindow_HideCursor
,
4027 VideoWindow_IsCursorHidden
4031 /*** IUnknown methods ***/
4032 static HRESULT WINAPI
MediaEvent_QueryInterface(IMediaEventEx
*iface
,
4035 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4037 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
4039 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
4042 static ULONG WINAPI
MediaEvent_AddRef(IMediaEventEx
*iface
) {
4043 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4045 TRACE("(%p/%p)->()\n", This
, iface
);
4047 return Filtergraph_AddRef(This
);
4050 static ULONG WINAPI
MediaEvent_Release(IMediaEventEx
*iface
) {
4051 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4053 TRACE("(%p/%p)->()\n", This
, iface
);
4055 return Filtergraph_Release(This
);
4058 /*** IDispatch methods ***/
4059 static HRESULT WINAPI
MediaEvent_GetTypeInfoCount(IMediaEventEx
*iface
,
4061 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4063 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
4068 static HRESULT WINAPI
MediaEvent_GetTypeInfo(IMediaEventEx
*iface
,
4071 ITypeInfo
**ppTInfo
) {
4072 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4074 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
4079 static HRESULT WINAPI
MediaEvent_GetIDsOfNames(IMediaEventEx
*iface
,
4085 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4087 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
4092 static HRESULT WINAPI
MediaEvent_Invoke(IMediaEventEx
*iface
,
4093 DISPID dispIdMember
,
4097 DISPPARAMS
*pDispParams
,
4099 EXCEPINFO
*pExepInfo
,
4101 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4103 TRACE("(%p/%p)->(%d, %s (%p), %d, %04x, %p, %p, %p, %p): stub !!!\n", This
, iface
, dispIdMember
, debugstr_guid(riid
), riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
4108 /*** IMediaEvent methods ***/
4109 static HRESULT WINAPI
MediaEvent_GetEventHandle(IMediaEventEx
*iface
,
4111 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4113 TRACE("(%p/%p)->(%p)\n", This
, iface
, hEvent
);
4115 *hEvent
= (OAEVENT
)This
->evqueue
.msg_event
;
4120 static HRESULT WINAPI
MediaEvent_GetEvent(IMediaEventEx
*iface
,
4125 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4128 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This
, iface
, lEventCode
, lParam1
, lParam2
, msTimeout
);
4130 if (EventsQueue_GetEvent(&This
->evqueue
, &evt
, msTimeout
))
4132 *lEventCode
= evt
.lEventCode
;
4133 *lParam1
= evt
.lParam1
;
4134 *lParam2
= evt
.lParam2
;
4142 static HRESULT WINAPI
MediaEvent_WaitForCompletion(IMediaEventEx
*iface
,
4145 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4147 TRACE("(%p/%p)->(%ld, %p)\n", This
, iface
, msTimeout
, pEvCode
);
4149 if (WaitForSingleObject(This
->hEventCompletion
, msTimeout
) == WAIT_OBJECT_0
)
4151 *pEvCode
= This
->CompletionStatus
;
4159 static HRESULT WINAPI
MediaEvent_CancelDefaultHandling(IMediaEventEx
*iface
,
4161 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4163 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4165 if (lEvCode
== EC_COMPLETE
)
4166 This
->HandleEcComplete
= FALSE
;
4167 else if (lEvCode
== EC_REPAINT
)
4168 This
->HandleEcRepaint
= FALSE
;
4169 else if (lEvCode
== EC_CLOCK_CHANGED
)
4170 This
->HandleEcClockChanged
= FALSE
;
4177 static HRESULT WINAPI
MediaEvent_RestoreDefaultHandling(IMediaEventEx
*iface
,
4179 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4181 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4183 if (lEvCode
== EC_COMPLETE
)
4184 This
->HandleEcComplete
= TRUE
;
4185 else if (lEvCode
== EC_REPAINT
)
4186 This
->HandleEcRepaint
= TRUE
;
4187 else if (lEvCode
== EC_CLOCK_CHANGED
)
4188 This
->HandleEcClockChanged
= TRUE
;
4195 static HRESULT WINAPI
MediaEvent_FreeEventParams(IMediaEventEx
*iface
,
4199 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4201 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This
, iface
, lEvCode
, lParam1
, lParam2
);
4206 /*** IMediaEventEx methods ***/
4207 static HRESULT WINAPI
MediaEvent_SetNotifyWindow(IMediaEventEx
*iface
,
4210 LONG_PTR lInstanceData
) {
4211 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4213 TRACE("(%p/%p)->(%08x, %ld, %08lx)\n", This
, iface
, (DWORD
) hwnd
, lMsg
, lInstanceData
);
4215 This
->notif
.hWnd
= (HWND
)hwnd
;
4216 This
->notif
.msg
= lMsg
;
4217 This
->notif
.instance
= (long) lInstanceData
;
4222 static HRESULT WINAPI
MediaEvent_SetNotifyFlags(IMediaEventEx
*iface
,
4223 long lNoNotifyFlags
) {
4224 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4226 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lNoNotifyFlags
);
4228 if ((lNoNotifyFlags
!= 0) && (lNoNotifyFlags
!= 1))
4229 return E_INVALIDARG
;
4231 This
->notif
.disabled
= lNoNotifyFlags
;
4236 static HRESULT WINAPI
MediaEvent_GetNotifyFlags(IMediaEventEx
*iface
,
4237 long *lplNoNotifyFlags
) {
4238 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4240 TRACE("(%p/%p)->(%p)\n", This
, iface
, lplNoNotifyFlags
);
4242 if (!lplNoNotifyFlags
)
4245 *lplNoNotifyFlags
= This
->notif
.disabled
;
4251 static const IMediaEventExVtbl IMediaEventEx_VTable
=
4253 MediaEvent_QueryInterface
,
4256 MediaEvent_GetTypeInfoCount
,
4257 MediaEvent_GetTypeInfo
,
4258 MediaEvent_GetIDsOfNames
,
4260 MediaEvent_GetEventHandle
,
4261 MediaEvent_GetEvent
,
4262 MediaEvent_WaitForCompletion
,
4263 MediaEvent_CancelDefaultHandling
,
4264 MediaEvent_RestoreDefaultHandling
,
4265 MediaEvent_FreeEventParams
,
4266 MediaEvent_SetNotifyWindow
,
4267 MediaEvent_SetNotifyFlags
,
4268 MediaEvent_GetNotifyFlags
4272 static HRESULT WINAPI
MediaFilter_QueryInterface(IMediaFilter
*iface
, REFIID riid
, LPVOID
*ppv
)
4274 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4276 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4279 static ULONG WINAPI
MediaFilter_AddRef(IMediaFilter
*iface
)
4281 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4283 return Filtergraph_AddRef(This
);
4286 static ULONG WINAPI
MediaFilter_Release(IMediaFilter
*iface
)
4288 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4290 return Filtergraph_Release(This
);
4293 static HRESULT WINAPI
MediaFilter_GetClassID(IMediaFilter
*iface
, CLSID
* pClassID
)
4295 FIXME("(%p): stub\n", pClassID
);
4300 static HRESULT WINAPI
MediaFilter_Stop(IMediaFilter
*iface
)
4302 FIXME("(): stub\n");
4307 static HRESULT WINAPI
MediaFilter_Pause(IMediaFilter
*iface
)
4309 FIXME("(): stub\n");
4314 static HRESULT WINAPI
MediaFilter_Run(IMediaFilter
*iface
, REFERENCE_TIME tStart
)
4316 FIXME("(0x%s): stub\n", wine_dbgstr_longlong(tStart
));
4321 static HRESULT WINAPI
MediaFilter_GetState(IMediaFilter
*iface
, DWORD dwMsTimeout
, FILTER_STATE
* pState
)
4323 FIXME("(%d, %p): stub\n", dwMsTimeout
, pState
);
4328 static HRESULT WINAPI
MediaFilter_SetSyncSource(IMediaFilter
*iface
, IReferenceClock
*pClock
)
4330 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4334 TRACE("(%p/%p)->(%p)\n", iface
, This
, pClock
);
4336 EnterCriticalSection(&This
->cs
);
4338 for (i
= 0;i
< This
->nFilters
;i
++)
4340 hr
= IBaseFilter_SetSyncSource(This
->ppFiltersInGraph
[i
], pClock
);
4348 IBaseFilter_SetSyncSource(This
->ppFiltersInGraph
[i
], This
->refClock
);
4353 IReferenceClock_Release(This
->refClock
);
4354 This
->refClock
= pClock
;
4356 IReferenceClock_AddRef(This
->refClock
);
4358 if (This
->HandleEcClockChanged
)
4360 IMediaEventSink
*pEventSink
;
4363 eshr
= IMediaFilter_QueryInterface(iface
, &IID_IMediaEventSink
, (LPVOID
)&pEventSink
);
4364 if (SUCCEEDED(eshr
))
4366 IMediaEventSink_Notify(pEventSink
, EC_CLOCK_CHANGED
, 0, 0);
4367 IMediaEventSink_Release(pEventSink
);
4372 LeaveCriticalSection(&This
->cs
);
4377 static HRESULT WINAPI
MediaFilter_GetSyncSource(IMediaFilter
*iface
, IReferenceClock
**ppClock
)
4379 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4381 TRACE("(%p/%p)->(%p)\n", iface
, This
, ppClock
);
4386 EnterCriticalSection(&This
->cs
);
4388 *ppClock
= This
->refClock
;
4390 IReferenceClock_AddRef(*ppClock
);
4392 LeaveCriticalSection(&This
->cs
);
4397 static const IMediaFilterVtbl IMediaFilter_VTable
=
4399 MediaFilter_QueryInterface
,
4401 MediaFilter_Release
,
4402 MediaFilter_GetClassID
,
4406 MediaFilter_GetState
,
4407 MediaFilter_SetSyncSource
,
4408 MediaFilter_GetSyncSource
4411 static HRESULT WINAPI
MediaEventSink_QueryInterface(IMediaEventSink
*iface
, REFIID riid
, LPVOID
*ppv
)
4413 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4415 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4418 static ULONG WINAPI
MediaEventSink_AddRef(IMediaEventSink
*iface
)
4420 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4422 return Filtergraph_AddRef(This
);
4425 static ULONG WINAPI
MediaEventSink_Release(IMediaEventSink
*iface
)
4427 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4429 return Filtergraph_Release(This
);
4432 static HRESULT WINAPI
MediaEventSink_Notify(IMediaEventSink
*iface
, long EventCode
, LONG_PTR EventParam1
, LONG_PTR EventParam2
)
4434 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4437 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This
, iface
, EventCode
, EventParam1
, EventParam2
);
4439 /* We need thread safety here, let's use the events queue's one */
4440 EnterCriticalSection(&This
->evqueue
.msg_crst
);
4442 if ((EventCode
== EC_COMPLETE
) && This
->HandleEcComplete
)
4444 TRACE("Process EC_COMPLETE notification\n");
4445 if (++This
->EcCompleteCount
== This
->nRenderers
)
4447 evt
.lEventCode
= EC_COMPLETE
;
4450 TRACE("Send EC_COMPLETE to app\n");
4451 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4452 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4454 TRACE("Send Window message\n");
4455 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4457 This
->CompletionStatus
= EC_COMPLETE
;
4458 SetEvent(This
->hEventCompletion
);
4461 else if ((EventCode
== EC_REPAINT
) && This
->HandleEcRepaint
)
4463 /* FIXME: Not handled yet */
4467 evt
.lEventCode
= EventCode
;
4468 evt
.lParam1
= EventParam1
;
4469 evt
.lParam2
= EventParam2
;
4470 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4471 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4472 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4475 LeaveCriticalSection(&This
->evqueue
.msg_crst
);
4479 static const IMediaEventSinkVtbl IMediaEventSink_VTable
=
4481 MediaEventSink_QueryInterface
,
4482 MediaEventSink_AddRef
,
4483 MediaEventSink_Release
,
4484 MediaEventSink_Notify
4487 static HRESULT WINAPI
GraphConfig_QueryInterface(IGraphConfig
*iface
, REFIID riid
, LPVOID
*ppv
)
4489 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4491 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4494 static ULONG WINAPI
GraphConfig_AddRef(IGraphConfig
*iface
)
4496 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4498 return Filtergraph_AddRef(This
);
4501 static ULONG WINAPI
GraphConfig_Release(IGraphConfig
*iface
)
4503 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4505 return Filtergraph_Release(This
);
4508 static HRESULT WINAPI
GraphConfig_Reconnect(IGraphConfig
*iface
,
4511 const AM_MEDIA_TYPE
* pmtFirstConnection
,
4512 IBaseFilter
* pUsingFilter
,
4516 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4518 FIXME("(%p)->(%p, %p, %p, %p, %p, %x): stub!\n", This
, pOutputPin
, pInputPin
, pmtFirstConnection
, pUsingFilter
, hAbortEvent
, dwFlags
);
4523 static HRESULT WINAPI
GraphConfig_Reconfigure(IGraphConfig
*iface
,
4524 IGraphConfigCallback
* pCallback
,
4529 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4531 FIXME("(%p)->(%p, %p, %x, %p): stub!\n", This
, pCallback
, pvContext
, dwFlags
, hAbortEvent
);
4536 static HRESULT WINAPI
GraphConfig_AddFilterToCache(IGraphConfig
*iface
,
4537 IBaseFilter
* pFilter
)
4539 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4541 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4546 static HRESULT WINAPI
GraphConfig_EnumCacheFilter(IGraphConfig
*iface
,
4547 IEnumFilters
** pEnum
)
4549 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4551 FIXME("(%p)->(%p): stub!\n", This
, pEnum
);
4556 static HRESULT WINAPI
GraphConfig_RemoveFilterFromCache(IGraphConfig
*iface
,
4557 IBaseFilter
* pFilter
)
4559 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4561 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4566 static HRESULT WINAPI
GraphConfig_GetStartTime(IGraphConfig
*iface
,
4567 REFERENCE_TIME
* prtStart
)
4569 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4571 FIXME("(%p)->(%p): stub!\n", This
, prtStart
);
4576 static HRESULT WINAPI
GraphConfig_PushThroughData(IGraphConfig
*iface
,
4578 IPinConnection
* pConnection
,
4581 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4583 FIXME("(%p)->(%p, %p, %p): stub!\n", This
, pOutputPin
, pConnection
, hEventAbort
);
4588 static HRESULT WINAPI
GraphConfig_SetFilterFlags(IGraphConfig
*iface
,
4589 IBaseFilter
* pFilter
,
4592 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4594 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4599 static HRESULT WINAPI
GraphConfig_GetFilterFlags(IGraphConfig
*iface
,
4600 IBaseFilter
* pFilter
,
4603 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4605 FIXME("(%p)->(%p, %p): stub!\n", This
, pFilter
, dwFlags
);
4610 static HRESULT WINAPI
GraphConfig_RemoveFilterEx(IGraphConfig
*iface
,
4611 IBaseFilter
* pFilter
,
4614 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4616 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4621 static const IGraphConfigVtbl IGraphConfig_VTable
=
4623 GraphConfig_QueryInterface
,
4625 GraphConfig_Release
,
4626 GraphConfig_Reconnect
,
4627 GraphConfig_Reconfigure
,
4628 GraphConfig_AddFilterToCache
,
4629 GraphConfig_EnumCacheFilter
,
4630 GraphConfig_RemoveFilterFromCache
,
4631 GraphConfig_GetStartTime
,
4632 GraphConfig_PushThroughData
,
4633 GraphConfig_SetFilterFlags
,
4634 GraphConfig_GetFilterFlags
,
4635 GraphConfig_RemoveFilterEx
4638 static const IUnknownVtbl IInner_VTable
=
4640 FilterGraphInner_QueryInterface
,
4641 FilterGraphInner_AddRef
,
4642 FilterGraphInner_Release
4645 static HRESULT WINAPI
Filtergraph_QueryInterface(IFilterGraphImpl
*This
,
4648 if (This
->bAggregatable
)
4649 This
->bUnkOuterValid
= TRUE
;
4651 if (This
->pUnkOuter
)
4653 if (This
->bAggregatable
)
4654 return IUnknown_QueryInterface(This
->pUnkOuter
, riid
, ppv
);
4656 if (IsEqualIID(riid
, &IID_IUnknown
))
4660 IUnknown_AddRef((IUnknown
*)&(This
->IInner_vtbl
));
4661 hr
= IUnknown_QueryInterface((IUnknown
*)&(This
->IInner_vtbl
), riid
, ppv
);
4662 IUnknown_Release((IUnknown
*)&(This
->IInner_vtbl
));
4663 This
->bAggregatable
= TRUE
;
4668 return E_NOINTERFACE
;
4671 return IUnknown_QueryInterface((IUnknown
*)&(This
->IInner_vtbl
), riid
, ppv
);
4674 static ULONG WINAPI
Filtergraph_AddRef(IFilterGraphImpl
*This
) {
4675 if (This
->pUnkOuter
&& This
->bUnkOuterValid
)
4676 return IUnknown_AddRef(This
->pUnkOuter
);
4677 return IUnknown_AddRef((IUnknown
*)&(This
->IInner_vtbl
));
4680 static ULONG WINAPI
Filtergraph_Release(IFilterGraphImpl
*This
) {
4681 if (This
->pUnkOuter
&& This
->bUnkOuterValid
)
4682 return IUnknown_Release(This
->pUnkOuter
);
4683 return IUnknown_Release((IUnknown
*)&(This
->IInner_vtbl
));
4686 /* This is the only function that actually creates a FilterGraph class... */
4687 HRESULT
FilterGraph_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4689 IFilterGraphImpl
*fimpl
;
4692 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
4696 fimpl
= CoTaskMemAlloc(sizeof(*fimpl
));
4697 fimpl
->pUnkOuter
= pUnkOuter
;
4698 fimpl
->bUnkOuterValid
= FALSE
;
4699 fimpl
->bAggregatable
= FALSE
;
4700 fimpl
->IInner_vtbl
= &IInner_VTable
;
4701 fimpl
->IFilterGraph2_vtbl
= &IFilterGraph2_VTable
;
4702 fimpl
->IMediaControl_vtbl
= &IMediaControl_VTable
;
4703 fimpl
->IMediaSeeking_vtbl
= &IMediaSeeking_VTable
;
4704 fimpl
->IBasicAudio_vtbl
= &IBasicAudio_VTable
;
4705 fimpl
->IBasicVideo_vtbl
= &IBasicVideo_VTable
;
4706 fimpl
->IVideoWindow_vtbl
= &IVideoWindow_VTable
;
4707 fimpl
->IMediaEventEx_vtbl
= &IMediaEventEx_VTable
;
4708 fimpl
->IMediaFilter_vtbl
= &IMediaFilter_VTable
;
4709 fimpl
->IMediaEventSink_vtbl
= &IMediaEventSink_VTable
;
4710 fimpl
->IGraphConfig_vtbl
= &IGraphConfig_VTable
;
4711 fimpl
->IMediaPosition_vtbl
= &IMediaPosition_VTable
;
4713 fimpl
->ppFiltersInGraph
= NULL
;
4714 fimpl
->pFilterNames
= NULL
;
4715 fimpl
->nFilters
= 0;
4716 fimpl
->filterCapacity
= 0;
4717 fimpl
->nameIndex
= 1;
4718 fimpl
->refClock
= NULL
;
4719 fimpl
->hEventCompletion
= CreateEventW(0, TRUE
, FALSE
, 0);
4720 fimpl
->HandleEcComplete
= TRUE
;
4721 fimpl
->HandleEcRepaint
= TRUE
;
4722 fimpl
->HandleEcClockChanged
= TRUE
;
4723 fimpl
->notif
.hWnd
= 0;
4724 fimpl
->notif
.disabled
= FALSE
;
4725 fimpl
->nRenderers
= 0;
4726 fimpl
->EcCompleteCount
= 0;
4727 fimpl
->state
= State_Stopped
;
4728 EventsQueue_Init(&fimpl
->evqueue
);
4729 InitializeCriticalSection(&fimpl
->cs
);
4730 fimpl
->cs
.DebugInfo
->Spare
[0] = (DWORD_PTR
)(__FILE__
": IFilterGraphImpl.cs");
4731 fimpl
->nItfCacheEntries
= 0;
4733 hr
= CoCreateInstance(&CLSID_FilterMapper2
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IFilterMapper2
, (LPVOID
*)&fimpl
->pFilterMapper2
);
4735 ERR("Unable to create filter mapper (%x)\n", hr
);
4743 HRESULT
FilterGraphNoThread_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4745 FIXME("CLSID_FilterGraphNoThread partially implemented - Forwarding to CLSID_FilterGraph\n");
4746 return FilterGraph_create(pUnkOuter
, ppObj
);