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
]);
293 for (i
= 0; i
< This
->nItfCacheEntries
; i
++)
295 if (This
->ItfCacheEntries
[i
].iface
)
296 IUnknown_Release(This
->ItfCacheEntries
[i
].iface
);
298 IFilterMapper2_Release(This
->pFilterMapper2
);
299 CloseHandle(This
->hEventCompletion
);
300 EventsQueue_Destroy(&This
->evqueue
);
301 This
->cs
.DebugInfo
->Spare
[0] = 0;
302 DeleteCriticalSection(&This
->cs
);
303 CoTaskMemFree(This
->ppFiltersInGraph
);
304 CoTaskMemFree(This
->pFilterNames
);
311 /*** IUnknown methods ***/
312 static HRESULT WINAPI
FilterGraph2_QueryInterface(IFilterGraph2
*iface
,
315 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
317 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
318 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
321 static ULONG WINAPI
FilterGraph2_AddRef(IFilterGraph2
*iface
) {
322 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
324 TRACE("(%p/%p)->() calling FilterGraph AddRef\n", This
, iface
);
326 return Filtergraph_AddRef(This
);
329 static ULONG WINAPI
FilterGraph2_Release(IFilterGraph2
*iface
) {
330 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
332 TRACE("(%p/%p)->() calling FilterGraph Release\n", This
, iface
);
334 return Filtergraph_Release(This
);
337 /*** IFilterGraph methods ***/
338 static HRESULT WINAPI
FilterGraph2_AddFilter(IFilterGraph2
*iface
,
339 IBaseFilter
*pFilter
,
341 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
344 WCHAR
* wszFilterName
= NULL
;
345 int duplicate_name
= FALSE
;
347 TRACE("(%p/%p)->(%p, %s (%p))\n", This
, iface
, pFilter
, debugstr_w(pName
), pName
);
349 wszFilterName
= CoTaskMemAlloc( (pName
? strlenW(pName
) + 6 : 5) * sizeof(WCHAR
) );
353 /* Check if name already exists */
354 for(i
= 0; i
< This
->nFilters
; i
++)
355 if (!strcmpW(This
->pFilterNames
[i
], pName
))
357 duplicate_name
= TRUE
;
362 /* If no name given or name already existing, generate one */
363 if (!pName
|| duplicate_name
)
365 static const WCHAR wszFmt1
[] = {'%','s',' ','%','0','4','d',0};
366 static const WCHAR wszFmt2
[] = {'%','0','4','d',0};
368 for (j
= 0; j
< 10000 ; j
++)
372 sprintfW(wszFilterName
, wszFmt1
, pName
, This
->nameIndex
);
374 sprintfW(wszFilterName
, wszFmt2
, This
->nameIndex
);
375 TRACE("Generated name %s\n", debugstr_w(wszFilterName
));
377 /* Check if the generated name already exists */
378 for(i
= 0; i
< This
->nFilters
; i
++)
379 if (!strcmpW(This
->pFilterNames
[i
], wszFilterName
))
382 /* Compute next index and exit if generated name is suitable */
383 if (This
->nameIndex
++ == 10000)
385 if (i
== This
->nFilters
)
388 /* Unable to find a suitable name */
391 CoTaskMemFree(wszFilterName
);
392 return VFW_E_DUPLICATE_NAME
;
396 memcpy(wszFilterName
, pName
, (strlenW(pName
) + 1) * sizeof(WCHAR
));
398 if (This
->nFilters
+ 1 > This
->filterCapacity
)
400 int newCapacity
= This
->filterCapacity
? 2 * This
->filterCapacity
: 1;
401 IBaseFilter
** ppNewFilters
= CoTaskMemAlloc(newCapacity
* sizeof(IBaseFilter
*));
402 LPWSTR
* pNewNames
= CoTaskMemAlloc(newCapacity
* sizeof(LPWSTR
));
403 memcpy(ppNewFilters
, This
->ppFiltersInGraph
, This
->nFilters
* sizeof(IBaseFilter
*));
404 memcpy(pNewNames
, This
->pFilterNames
, This
->nFilters
* sizeof(LPWSTR
));
405 if (!This
->filterCapacity
)
407 CoTaskMemFree(This
->ppFiltersInGraph
);
408 CoTaskMemFree(This
->pFilterNames
);
410 This
->ppFiltersInGraph
= ppNewFilters
;
411 This
->pFilterNames
= pNewNames
;
412 This
->filterCapacity
= newCapacity
;
415 hr
= IBaseFilter_JoinFilterGraph(pFilter
, (IFilterGraph
*)This
, wszFilterName
);
419 IBaseFilter_AddRef(pFilter
);
420 This
->ppFiltersInGraph
[This
->nFilters
] = pFilter
;
421 This
->pFilterNames
[This
->nFilters
] = wszFilterName
;
423 IBaseFilter_SetSyncSource(pFilter
, This
->refClock
);
426 CoTaskMemFree(wszFilterName
);
428 if (SUCCEEDED(hr
) && duplicate_name
)
429 return VFW_S_DUPLICATE_NAME
;
434 static HRESULT WINAPI
FilterGraph2_RemoveFilter(IFilterGraph2
*iface
,
435 IBaseFilter
*pFilter
) {
436 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
440 TRACE("(%p/%p)->(%p)\n", This
, iface
, pFilter
);
442 /* FIXME: check graph is stopped */
444 for (i
= 0; i
< This
->nFilters
; i
++)
446 if (This
->ppFiltersInGraph
[i
] == pFilter
)
448 IEnumPins
*penumpins
;
449 hr
= IBaseFilter_EnumPins(pFilter
, &penumpins
);
452 while(IEnumPins_Next(penumpins
, 1, &ppin
, NULL
) == S_OK
) {
453 IPin_Disconnect(ppin
);
456 IEnumPins_Release(penumpins
);
459 hr
= IBaseFilter_JoinFilterGraph(pFilter
, NULL
, This
->pFilterNames
[i
]);
462 IBaseFilter_SetSyncSource(pFilter
, NULL
);
463 IBaseFilter_Release(pFilter
);
464 CoTaskMemFree(This
->pFilterNames
[i
]);
465 memmove(This
->ppFiltersInGraph
+i
, This
->ppFiltersInGraph
+i
+1, sizeof(IBaseFilter
*)*(This
->nFilters
- 1 - i
));
466 memmove(This
->pFilterNames
+i
, This
->pFilterNames
+i
+1, sizeof(LPWSTR
)*(This
->nFilters
- 1 - i
));
468 /* Invalidate interfaces in the cache */
469 for (i
= 0; i
< This
->nItfCacheEntries
; i
++)
470 if (pFilter
== This
->ItfCacheEntries
[i
].filter
)
472 IUnknown_Release(This
->ItfCacheEntries
[i
].iface
);
473 This
->ItfCacheEntries
[i
].iface
= NULL
;
474 This
->ItfCacheEntries
[i
].filter
= NULL
;
482 return hr
; /* FIXME: check this error code */
485 static HRESULT WINAPI
FilterGraph2_EnumFilters(IFilterGraph2
*iface
,
486 IEnumFilters
**ppEnum
) {
487 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
489 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppEnum
);
491 return IEnumFiltersImpl_Construct(This
->ppFiltersInGraph
, This
->nFilters
, ppEnum
);
494 static HRESULT WINAPI
FilterGraph2_FindFilterByName(IFilterGraph2
*iface
,
496 IBaseFilter
**ppFilter
) {
497 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
500 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_w(pName
), pName
, ppFilter
);
505 for (i
= 0; i
< This
->nFilters
; i
++)
507 if (!strcmpW(pName
, This
->pFilterNames
[i
]))
509 *ppFilter
= This
->ppFiltersInGraph
[i
];
510 IBaseFilter_AddRef(*ppFilter
);
516 return VFW_E_NOT_FOUND
;
519 /* NOTE: despite the implication, it doesn't matter which
520 * way round you put in the input and output pins */
521 static HRESULT WINAPI
FilterGraph2_ConnectDirect(IFilterGraph2
*iface
,
524 const AM_MEDIA_TYPE
*pmt
) {
528 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
530 TRACE("(%p/%p)->(%p, %p, %p)\n", This
, iface
, ppinIn
, ppinOut
, pmt
);
532 /* FIXME: check pins are in graph */
534 if (TRACE_ON(quartz
))
538 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
542 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
543 IBaseFilter_Release(PinInfo
.pFilter
);
545 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
549 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
550 IBaseFilter_Release(PinInfo
.pFilter
);
553 hr
= IPin_QueryDirection(ppinIn
, &dir
);
556 if (dir
== PINDIR_INPUT
)
557 hr
= IPin_Connect(ppinOut
, ppinIn
, pmt
);
559 hr
= IPin_Connect(ppinIn
, ppinOut
, pmt
);
565 static HRESULT WINAPI
FilterGraph2_Reconnect(IFilterGraph2
*iface
,
567 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
568 IPin
*pConnectedTo
= NULL
;
570 PIN_DIRECTION pindir
;
572 IPin_QueryDirection(ppin
, &pindir
);
573 hr
= IPin_ConnectedTo(ppin
, &pConnectedTo
);
575 TRACE("Querying connected to failed: %x\n", hr
);
578 IPin_Disconnect(ppin
);
579 IPin_Disconnect(pConnectedTo
);
580 if (pindir
== PINDIR_INPUT
)
581 hr
= IPin_Connect(pConnectedTo
, ppin
, NULL
);
583 hr
= IPin_Connect(ppin
, pConnectedTo
, NULL
);
584 IPin_Release(pConnectedTo
);
586 ERR("Reconnecting pins failed, pins are not connected now..\n");
587 TRACE("(%p->%p) -- %p %p -> %x\n", iface
, This
, ppin
, pConnectedTo
, hr
);
591 static HRESULT WINAPI
FilterGraph2_Disconnect(IFilterGraph2
*iface
,
593 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
595 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppin
);
597 return IPin_Disconnect(ppin
);
600 static HRESULT WINAPI
FilterGraph2_SetDefaultSyncSource(IFilterGraph2
*iface
) {
601 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
603 TRACE("(%p/%p)->(): stub !!!\n", iface
, This
);
608 static HRESULT
GetFilterInfo(IMoniker
* pMoniker
, GUID
* pclsid
, VARIANT
* pvar
)
610 static const WCHAR wszClsidName
[] = {'C','L','S','I','D',0};
611 static const WCHAR wszFriendlyName
[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
612 IPropertyBag
* pPropBagCat
= NULL
;
616 V_VT(pvar
) = VT_BSTR
;
618 hr
= IMoniker_BindToStorage(pMoniker
, NULL
, NULL
, &IID_IPropertyBag
, (LPVOID
*)&pPropBagCat
);
621 hr
= IPropertyBag_Read(pPropBagCat
, wszClsidName
, pvar
, NULL
);
624 hr
= CLSIDFromString(V_UNION(pvar
, bstrVal
), pclsid
);
627 hr
= IPropertyBag_Read(pPropBagCat
, wszFriendlyName
, pvar
, NULL
);
630 TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid
), debugstr_w(V_UNION(pvar
, bstrVal
)));
633 IPropertyBag_Release(pPropBagCat
);
638 static HRESULT
GetInternalConnections(IBaseFilter
* pfilter
, IPin
* pinputpin
, IPin
*** pppins
, ULONG
* pnb
)
643 TRACE("(%p, %p, %p, %p)\n", pfilter
, pinputpin
, pppins
, pnb
);
644 hr
= IPin_QueryInternalConnections(pinputpin
, NULL
, &nb
);
647 } else if (hr
== S_FALSE
) {
648 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*nb
);
649 hr
= IPin_QueryInternalConnections(pinputpin
, *pppins
, &nb
);
651 ERR("Error (%x)\n", hr
);
653 } else if (hr
== E_NOTIMPL
) {
654 /* Input connected to all outputs */
655 IEnumPins
* penumpins
;
658 TRACE("E_NOTIMPL\n");
659 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
661 ERR("filter Enumpins failed (%x)\n", hr
);
665 /* Count output pins */
666 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
667 PIN_DIRECTION pindir
;
668 IPin_QueryDirection(ppin
, &pindir
);
669 if (pindir
== PINDIR_OUTPUT
)
673 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*i
);
674 /* Retrieve output pins */
675 IEnumPins_Reset(penumpins
);
677 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
678 PIN_DIRECTION pindir
;
679 IPin_QueryDirection(ppin
, &pindir
);
680 if (pindir
== PINDIR_OUTPUT
)
681 (*pppins
)[i
++] = ppin
;
685 IEnumPins_Release(penumpins
);
688 ERR("Next failed (%x)\n", hr
);
691 } else if (FAILED(hr
)) {
692 ERR("Cannot get internal connection (%x)\n", hr
);
700 /*** IGraphBuilder methods ***/
701 static HRESULT WINAPI
FilterGraph2_Connect(IFilterGraph2
*iface
,
704 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
707 IEnumMediaTypes
* penummt
;
709 IEnumPins
* penumpins
;
710 IEnumMoniker
* pEnumMoniker
;
718 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, ppinOut
, ppinIn
);
720 if (TRACE_ON(quartz
))
722 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
726 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
727 IBaseFilter_Release(PinInfo
.pFilter
);
729 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
733 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
734 IBaseFilter_Release(PinInfo
.pFilter
);
737 /* Try direct connection first */
738 hr
= IPin_Connect(ppinOut
, ppinIn
, NULL
);
742 TRACE("Direct connection failed, trying to insert other filters\n");
744 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
748 hr
= IBaseFilter_GetClassID(PinInfo
.pFilter
, &FilterCLSID
);
749 IBaseFilter_Release(PinInfo
.pFilter
);
753 /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream
754 * filter to the minor mediatype of input pin of the renderer */
755 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
757 ERR("EnumMediaTypes (%x)\n", hr
);
761 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
763 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
768 ERR("No media type found!\n");
771 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
772 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
774 /* Try to find a suitable filter that can connect to the pin to render */
775 tab
[0] = mt
->majortype
;
776 tab
[1] = mt
->subtype
;
777 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
779 ERR("Unable to enum filters (%x)\n", hr
);
783 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
788 IPin
* ppinfilter
= NULL
;
789 IBaseFilter
* pfilter
= NULL
;
791 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
792 IMoniker_Release(pMoniker
);
794 ERR("Unable to retrieve filter info (%x)\n", hr
);
798 if (IsEqualGUID(&clsid
, &FilterCLSID
)) {
799 /* Skip filter (same as the one the output pin belongs to) */
803 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
805 ERR("Unable to create filter (%x), trying next one\n", hr
);
809 hr
= IFilterGraph2_AddFilter(iface
, pfilter
, V_UNION(&var
, bstrVal
));
811 ERR("Unable to add filter (%x)\n", hr
);
812 IBaseFilter_Release(pfilter
);
817 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
819 ERR("Enumpins (%x)\n", hr
);
823 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
824 IEnumPins_Release(penumpins
);
827 ERR("Next (%x)\n", hr
);
835 hr
= IPin_Connect(ppinOut
, ppinfilter
, NULL
);
837 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
840 TRACE("Successfully connected to filter, follow chain...\n");
842 /* Render all output pins of the filter by calling IFilterGraph2_Render on each of them */
843 hr
= GetInternalConnections(pfilter
, ppinfilter
, &ppins
, &nb
);
848 IPin_Disconnect(ppinOut
);
851 TRACE("pins to consider: %d\n", nb
);
852 for(i
= 0; i
< nb
; i
++) {
853 TRACE("Processing pin %d\n", i
);
854 hr
= IFilterGraph2_Connect(iface
, ppins
[i
], ppinIn
);
856 TRACE("Cannot render pin %p (%x)\n", ppinfilter
, hr
);
858 IPin_Release(ppins
[i
]);
859 if (SUCCEEDED(hr
)) break;
861 while (++i
< nb
) IPin_Release(ppins
[i
]);
862 CoTaskMemFree(ppins
);
863 IPin_Release(ppinfilter
);
864 IBaseFilter_Release(pfilter
);
869 if (ppinfilter
) IPin_Release(ppinfilter
);
871 IFilterGraph2_RemoveFilter(iface
, pfilter
);
872 IBaseFilter_Release(pfilter
);
876 IEnumMediaTypes_Release(penummt
);
882 static HRESULT WINAPI
FilterGraph2_Render(IFilterGraph2
*iface
,
884 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
885 IEnumMediaTypes
* penummt
;
890 IEnumMoniker
* pEnumMoniker
;
895 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppinOut
);
897 if (TRACE_ON(quartz
))
901 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
905 TRACE("Filter owning pin => %p\n", PinInfo
.pFilter
);
906 IBaseFilter_Release(PinInfo
.pFilter
);
909 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
911 ERR("EnumMediaTypes (%x)\n", hr
);
917 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
919 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
924 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
925 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
927 /* Try to find a suitable renderer with the same media type */
928 tab
[0] = mt
->majortype
;
930 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, TRUE
, FALSE
, 0, NULL
, NULL
, NULL
);
932 ERR("Unable to enum filters (%x)\n", hr
);
936 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
941 IBaseFilter
* pfilter
= NULL
;
942 IEnumPins
* penumpins
;
945 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
946 IMoniker_Release(pMoniker
);
948 ERR("Unable to retrieve filter info (%x)\n", hr
);
952 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
954 ERR("Unable to create filter (%x), trying next one\n", hr
);
958 hr
= IFilterGraph2_AddFilter(iface
, pfilter
, V_UNION(&var
, bstrVal
));
960 ERR("Unable to add filter (%x)\n", hr
);
961 IBaseFilter_Release(pfilter
);
966 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
968 ERR("Splitter Enumpins (%x)\n", hr
);
971 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
972 IEnumPins_Release(penumpins
);
974 ERR("Next (%x)\n", hr
);
982 /* Connect the pin to render to the renderer */
983 hr
= IFilterGraph2_Connect(iface
, ppinOut
, ppinfilter
);
985 TRACE("Unable to connect to renderer (%x)\n", hr
);
986 IPin_Release(ppinfilter
);
989 IPin_Release(ppinfilter
);
990 IBaseFilter_Release(pfilter
);
996 IFilterGraph2_RemoveFilter(iface
, pfilter
);
997 IBaseFilter_Release(pfilter
);
1001 DeleteMediaType(mt
);
1005 IEnumMediaTypes_Release(penummt
);
1010 static HRESULT WINAPI
FilterGraph2_RenderFile(IFilterGraph2
*iface
,
1011 LPCWSTR lpcwstrFile
,
1012 LPCWSTR lpcwstrPlayList
) {
1013 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1014 static const WCHAR string
[] = {'R','e','a','d','e','r',0};
1015 IBaseFilter
* preader
= NULL
;
1016 IBaseFilter
* psplitter
= NULL
;
1017 IPin
* ppinreader
= NULL
;
1018 IPin
* ppinsplitter
= NULL
;
1019 IEnumPins
* penumpins
;
1022 IEnumMoniker
* pEnumMoniker
= NULL
;
1024 IPin
** ppins
= NULL
;
1027 IFileSourceFilter
* pfile
= NULL
;
1031 TRACE("(%p/%p)->(%s, %s)\n", This
, iface
, debugstr_w(lpcwstrFile
), debugstr_w(lpcwstrPlayList
));
1033 if (lpcwstrPlayList
!= NULL
)
1034 return E_INVALIDARG
;
1036 hr
= IFilterGraph2_AddSourceFilter(iface
, lpcwstrFile
, string
, &preader
);
1038 /* Retrieve file media type */
1040 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1041 if (SUCCEEDED(hr
)) {
1042 hr
= IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1043 IFileSourceFilter_Release(pfile
);
1047 hr
= IBaseFilter_EnumPins(preader
, &penumpins
);
1048 if (SUCCEEDED(hr
)) {
1049 hr
= IEnumPins_Next(penumpins
, 1, &ppinreader
, &pin
);
1050 IEnumPins_Release(penumpins
);
1053 if (SUCCEEDED(hr
)) {
1054 tab
[0] = mt
.majortype
;
1055 tab
[1] = mt
.subtype
;
1056 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
1062 IPin_Release(ppinreader
);
1064 IEnumMoniker_Release(pEnumMoniker
);
1066 IFilterGraph2_RemoveFilter(iface
, preader
);
1067 IBaseFilter_Release(preader
);
1072 hr
= VFW_E_CANNOT_RENDER
;
1073 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
1078 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
1079 IMoniker_Release(pMoniker
);
1081 ERR("Unable to retrieve filter info (%x)\n", hr
);
1085 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&psplitter
);
1087 ERR("Unable to create filter (%x), trying next one\n", hr
);
1091 hr
= IFilterGraph2_AddFilter(iface
, psplitter
, V_UNION(&var
, bstrVal
));
1093 ERR("Unable add filter (%x)\n", hr
);
1094 IBaseFilter_Release(psplitter
);
1098 /* Connect file source and splitter filters together */
1099 /* Make the splitter analyze incoming data */
1101 hr
= IBaseFilter_EnumPins(psplitter
, &penumpins
);
1102 if (SUCCEEDED(hr
)) {
1103 hr
= IEnumPins_Next(penumpins
, 1, &ppinsplitter
, &pin
);
1104 IEnumPins_Release(penumpins
);
1108 hr
= IPin_Connect(ppinreader
, ppinsplitter
, NULL
);
1110 /* Make sure there's some output pins in the filter */
1112 hr
= GetInternalConnections(psplitter
, ppinsplitter
, &ppins
, &nb
);
1113 if (SUCCEEDED(hr
)) {
1115 IPin_Disconnect(ppinreader
);
1116 TRACE("No output pins found in filter\n");
1117 hr
= VFW_E_CANNOT_RENDER
;
1122 IPin_Release(ppinsplitter
);
1123 ppinsplitter
= NULL
;
1125 if (SUCCEEDED(hr
)) {
1126 TRACE("Successfully connected to filter\n");
1130 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
1133 CoTaskMemFree(ppins
);
1136 IFilterGraph2_RemoveFilter(iface
, psplitter
);
1137 IBaseFilter_Release(psplitter
);
1141 /* Render all output pin of the splitter by calling IFilterGraph2_Render on each of them */
1142 if (SUCCEEDED(hr
)) {
1145 TRACE("pins to consider: %d\n", nb
);
1146 for(i
= 0; i
< nb
; i
++) {
1147 TRACE("Processing pin %d\n", i
);
1148 hr
= IFilterGraph2_Render(iface
, ppins
[i
]);
1150 ERR("Cannot render pin %p (%x)\n", ppins
[i
], hr
);
1153 IPin_Release(ppins
[i
]);
1155 CoTaskMemFree(ppins
);
1157 hr
= (partial
? VFW_S_PARTIAL_RENDER
: S_OK
);
1160 IPin_Release(ppinreader
);
1161 IBaseFilter_Release(preader
);
1163 IBaseFilter_Release(psplitter
);
1168 static HRESULT WINAPI
FilterGraph2_AddSourceFilter(IFilterGraph2
*iface
,
1169 LPCWSTR lpcwstrFileName
,
1170 LPCWSTR lpcwstrFilterName
,
1171 IBaseFilter
**ppFilter
) {
1172 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1174 IBaseFilter
* preader
;
1175 IFileSourceFilter
* pfile
= NULL
;
1179 TRACE("(%p/%p)->(%s, %s, %p)\n", This
, iface
, debugstr_w(lpcwstrFileName
), debugstr_w(lpcwstrFilterName
), ppFilter
);
1181 /* Instantiate a file source filter */
1182 hr
= CoCreateInstance(&CLSID_AsyncReader
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&preader
);
1184 ERR("Unable to create file source filter (%x)\n", hr
);
1188 hr
= IFilterGraph2_AddFilter(iface
, preader
, lpcwstrFilterName
);
1190 ERR("Unable add filter (%x)\n", hr
);
1191 IBaseFilter_Release(preader
);
1195 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1197 ERR("Unable to get IFileSourceInterface (%x)\n", hr
);
1201 /* Load the file in the file source filter */
1202 hr
= IFileSourceFilter_Load(pfile
, lpcwstrFileName
, NULL
);
1204 ERR("Load (%x)\n", hr
);
1208 IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1210 ERR("GetCurFile (%x)\n", hr
);
1213 TRACE("File %s\n", debugstr_w(filename
));
1214 TRACE("MajorType %s\n", debugstr_guid(&mt
.majortype
));
1215 TRACE("SubType %s\n", debugstr_guid(&mt
.subtype
));
1218 *ppFilter
= preader
;
1219 IFileSourceFilter_Release(pfile
);
1225 IFileSourceFilter_Release(pfile
);
1226 IFilterGraph2_RemoveFilter(iface
, preader
);
1227 IBaseFilter_Release(preader
);
1232 static HRESULT WINAPI
FilterGraph2_SetLogFile(IFilterGraph2
*iface
,
1234 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1236 TRACE("(%p/%p)->(%08x): stub !!!\n", This
, iface
, (DWORD
) hFile
);
1241 static HRESULT WINAPI
FilterGraph2_Abort(IFilterGraph2
*iface
) {
1242 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1244 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1249 static HRESULT WINAPI
FilterGraph2_ShouldOperationContinue(IFilterGraph2
*iface
) {
1250 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1252 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1257 /*** IFilterGraph2 methods ***/
1258 static HRESULT WINAPI
FilterGraph2_AddSourceFilterForMoniker(IFilterGraph2
*iface
,
1261 LPCWSTR lpcwstrFilterName
,
1262 IBaseFilter
**ppFilter
) {
1263 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1265 TRACE("(%p/%p)->(%p %p %s %p): stub !!!\n", This
, iface
, pMoniker
, pCtx
, debugstr_w(lpcwstrFilterName
), ppFilter
);
1270 static HRESULT WINAPI
FilterGraph2_ReconnectEx(IFilterGraph2
*iface
,
1272 const AM_MEDIA_TYPE
*pmt
) {
1273 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1275 TRACE("(%p/%p)->(%p %p): stub !!!\n", This
, iface
, ppin
, pmt
);
1280 static HRESULT WINAPI
FilterGraph2_RenderEx(IFilterGraph2
*iface
,
1284 ICOM_THIS_MULTI(IFilterGraphImpl
, IFilterGraph2_vtbl
, iface
);
1286 TRACE("(%p/%p)->(%p %08x %p): stub !!!\n", This
, iface
, pPinOut
, dwFlags
, pvContext
);
1292 static const IFilterGraph2Vtbl IFilterGraph2_VTable
=
1294 FilterGraph2_QueryInterface
,
1295 FilterGraph2_AddRef
,
1296 FilterGraph2_Release
,
1297 FilterGraph2_AddFilter
,
1298 FilterGraph2_RemoveFilter
,
1299 FilterGraph2_EnumFilters
,
1300 FilterGraph2_FindFilterByName
,
1301 FilterGraph2_ConnectDirect
,
1302 FilterGraph2_Reconnect
,
1303 FilterGraph2_Disconnect
,
1304 FilterGraph2_SetDefaultSyncSource
,
1305 FilterGraph2_Connect
,
1306 FilterGraph2_Render
,
1307 FilterGraph2_RenderFile
,
1308 FilterGraph2_AddSourceFilter
,
1309 FilterGraph2_SetLogFile
,
1311 FilterGraph2_ShouldOperationContinue
,
1312 FilterGraph2_AddSourceFilterForMoniker
,
1313 FilterGraph2_ReconnectEx
,
1314 FilterGraph2_RenderEx
1317 /*** IUnknown methods ***/
1318 static HRESULT WINAPI
MediaControl_QueryInterface(IMediaControl
*iface
,
1321 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1323 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1325 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1328 static ULONG WINAPI
MediaControl_AddRef(IMediaControl
*iface
) {
1329 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1331 TRACE("(%p/%p)->()\n", This
, iface
);
1333 return Filtergraph_AddRef(This
);
1336 static ULONG WINAPI
MediaControl_Release(IMediaControl
*iface
) {
1337 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1339 TRACE("(%p/%p)->()\n", This
, iface
);
1341 return Filtergraph_Release(This
);
1345 /*** IDispatch methods ***/
1346 static HRESULT WINAPI
MediaControl_GetTypeInfoCount(IMediaControl
*iface
,
1348 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1350 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1355 static HRESULT WINAPI
MediaControl_GetTypeInfo(IMediaControl
*iface
,
1358 ITypeInfo
**ppTInfo
) {
1359 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1361 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1366 static HRESULT WINAPI
MediaControl_GetIDsOfNames(IMediaControl
*iface
,
1372 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1374 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1379 static HRESULT WINAPI
MediaControl_Invoke(IMediaControl
*iface
,
1380 DISPID dispIdMember
,
1384 DISPPARAMS
*pDispParams
,
1386 EXCEPINFO
*pExepInfo
,
1388 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1390 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
);
1395 typedef HRESULT(WINAPI
*fnFoundFilter
)(IBaseFilter
*);
1397 static HRESULT
ExploreGraph(IFilterGraphImpl
* pGraph
, IPin
* pOutputPin
, fnFoundFilter FoundFilter
)
1406 TRACE("%p %p\n", pGraph
, pOutputPin
);
1407 PinInfo
.pFilter
= NULL
;
1409 hr
= IPin_ConnectedTo(pOutputPin
, &pInputPin
);
1413 hr
= IPin_QueryPinInfo(pInputPin
, &PinInfo
);
1415 hr
= GetInternalConnections(PinInfo
.pFilter
, pInputPin
, &ppPins
, &nb
);
1416 IPin_Release(pInputPin
);
1423 TRACE("Reached a renderer\n");
1424 /* Count renderers for end of stream notification */
1425 pGraph
->nRenderers
++;
1429 for(i
= 0; i
< nb
; i
++)
1431 /* Explore the graph downstream from this pin
1432 * FIXME: We should prevent exploring from a pin more than once. This can happens when
1433 * several input pins are connected to the same output (a MUX for instance). */
1434 ExploreGraph(pGraph
, ppPins
[i
], FoundFilter
);
1435 IPin_Release(ppPins
[i
]);
1438 CoTaskMemFree(ppPins
);
1440 TRACE("Doing stuff with filter %p\n", PinInfo
.pFilter
);
1441 FoundFilter(PinInfo
.pFilter
);
1444 if (PinInfo
.pFilter
) IBaseFilter_Release(PinInfo
.pFilter
);
1448 static HRESULT WINAPI
SendRun(IBaseFilter
*pFilter
) {
1449 return IBaseFilter_Run(pFilter
, 0);
1452 static HRESULT WINAPI
SendPause(IBaseFilter
*pFilter
) {
1453 return IBaseFilter_Pause(pFilter
);
1456 static HRESULT WINAPI
SendStop(IBaseFilter
*pFilter
) {
1457 return IBaseFilter_Stop(pFilter
);
1460 static HRESULT
SendFilterMessage(IMediaControl
*iface
, fnFoundFilter FoundFilter
) {
1461 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1463 IBaseFilter
* pfilter
;
1469 TRACE("(%p/%p)->()\n", This
, iface
);
1471 /* Explorer the graph from source filters to renderers, determine renderers
1472 * number and run filters from renderers to source filters */
1473 This
->nRenderers
= 0;
1474 ResetEvent(This
->hEventCompletion
);
1476 for(i
= 0; i
< This
->nFilters
; i
++)
1479 pfilter
= This
->ppFiltersInGraph
[i
];
1480 hr
= IBaseFilter_EnumPins(pfilter
, &pEnum
);
1483 ERR("Enum pins failed %x\n", hr
);
1486 /* Check if it is a source filter */
1487 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1489 IPin_QueryDirection(pPin
, &dir
);
1491 if (dir
== PINDIR_INPUT
)
1499 TRACE("Found a source filter %p\n", pfilter
);
1500 IEnumPins_Reset(pEnum
);
1501 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1503 /* Explore the graph downstream from this pin */
1504 ExploreGraph(This
, pPin
, FoundFilter
);
1507 FoundFilter(pfilter
);
1509 IEnumPins_Release(pEnum
);
1515 /*** IMediaControl methods ***/
1516 static HRESULT WINAPI
MediaControl_Run(IMediaControl
*iface
) {
1517 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1518 TRACE("(%p/%p)->()\n", This
, iface
);
1520 if (This
->state
== State_Running
) return S_OK
;
1522 EnterCriticalSection(&This
->cs
);
1523 SendFilterMessage(iface
, SendRun
);
1524 This
->state
= State_Running
;
1525 LeaveCriticalSection(&This
->cs
);
1529 static HRESULT WINAPI
MediaControl_Pause(IMediaControl
*iface
) {
1530 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1531 TRACE("(%p/%p)->()\n", This
, iface
);
1533 if (This
->state
== State_Paused
) return S_OK
;
1535 EnterCriticalSection(&This
->cs
);
1536 SendFilterMessage(iface
, SendPause
);
1537 This
->state
= State_Paused
;
1538 LeaveCriticalSection(&This
->cs
);
1542 static HRESULT WINAPI
MediaControl_Stop(IMediaControl
*iface
) {
1543 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1544 TRACE("(%p/%p)->()\n", This
, iface
);
1546 if (This
->state
== State_Stopped
) return S_OK
;
1548 EnterCriticalSection(&This
->cs
);
1549 if (This
->state
== State_Running
) SendFilterMessage(iface
, SendPause
);
1550 SendFilterMessage(iface
, SendStop
);
1551 This
->state
= State_Stopped
;
1552 LeaveCriticalSection(&This
->cs
);
1556 static HRESULT WINAPI
MediaControl_GetState(IMediaControl
*iface
,
1558 OAFilterState
*pfs
) {
1559 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1561 TRACE("(%p/%p)->(%d, %p): semi-stub !!!\n", This
, iface
, msTimeout
, pfs
);
1563 EnterCriticalSection(&This
->cs
);
1567 LeaveCriticalSection(&This
->cs
);
1572 static HRESULT WINAPI
MediaControl_RenderFile(IMediaControl
*iface
,
1574 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1576 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
);
1581 static HRESULT WINAPI
MediaControl_AddSourceFilter(IMediaControl
*iface
,
1583 IDispatch
**ppUnk
) {
1584 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1586 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
, ppUnk
);
1591 static HRESULT WINAPI
MediaControl_get_FilterCollection(IMediaControl
*iface
,
1592 IDispatch
**ppUnk
) {
1593 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1595 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1600 static HRESULT WINAPI
MediaControl_get_RegFilterCollection(IMediaControl
*iface
,
1601 IDispatch
**ppUnk
) {
1602 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1604 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1609 static HRESULT WINAPI
MediaControl_StopWhenReady(IMediaControl
*iface
) {
1610 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1612 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1618 static const IMediaControlVtbl IMediaControl_VTable
=
1620 MediaControl_QueryInterface
,
1621 MediaControl_AddRef
,
1622 MediaControl_Release
,
1623 MediaControl_GetTypeInfoCount
,
1624 MediaControl_GetTypeInfo
,
1625 MediaControl_GetIDsOfNames
,
1626 MediaControl_Invoke
,
1630 MediaControl_GetState
,
1631 MediaControl_RenderFile
,
1632 MediaControl_AddSourceFilter
,
1633 MediaControl_get_FilterCollection
,
1634 MediaControl_get_RegFilterCollection
,
1635 MediaControl_StopWhenReady
1639 /*** IUnknown methods ***/
1640 static HRESULT WINAPI
MediaSeeking_QueryInterface(IMediaSeeking
*iface
,
1643 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1645 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1647 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1650 static ULONG WINAPI
MediaSeeking_AddRef(IMediaSeeking
*iface
) {
1651 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1653 TRACE("(%p/%p)->()\n", This
, iface
);
1655 return Filtergraph_AddRef(This
);
1658 static ULONG WINAPI
MediaSeeking_Release(IMediaSeeking
*iface
) {
1659 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1661 TRACE("(%p/%p)->()\n", This
, iface
);
1663 return Filtergraph_Release(This
);
1666 /*** IMediaSeeking methods ***/
1667 static HRESULT WINAPI
MediaSeeking_GetCapabilities(IMediaSeeking
*iface
,
1668 DWORD
*pCapabilities
) {
1669 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1671 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1676 static HRESULT WINAPI
MediaSeeking_CheckCapabilities(IMediaSeeking
*iface
,
1677 DWORD
*pCapabilities
) {
1678 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1680 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1685 static HRESULT WINAPI
MediaSeeking_IsFormatSupported(IMediaSeeking
*iface
,
1686 const GUID
*pFormat
) {
1687 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1689 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1694 static HRESULT WINAPI
MediaSeeking_QueryPreferredFormat(IMediaSeeking
*iface
,
1696 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1698 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1703 static HRESULT WINAPI
MediaSeeking_GetTimeFormat(IMediaSeeking
*iface
,
1705 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1707 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1712 static HRESULT WINAPI
MediaSeeking_IsUsingTimeFormat(IMediaSeeking
*iface
,
1713 const GUID
*pFormat
) {
1714 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1716 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1721 static HRESULT WINAPI
MediaSeeking_SetTimeFormat(IMediaSeeking
*iface
,
1722 const GUID
*pFormat
) {
1723 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1725 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1730 static HRESULT WINAPI
MediaSeeking_GetDuration(IMediaSeeking
*iface
,
1731 LONGLONG
*pDuration
) {
1732 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1734 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDuration
);
1739 static HRESULT WINAPI
MediaSeeking_GetStopPosition(IMediaSeeking
*iface
,
1741 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1743 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pStop
);
1748 static HRESULT WINAPI
MediaSeeking_GetCurrentPosition(IMediaSeeking
*iface
,
1749 LONGLONG
*pCurrent
) {
1750 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1752 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCurrent
);
1757 static HRESULT WINAPI
MediaSeeking_ConvertTimeFormat(IMediaSeeking
*iface
,
1759 const GUID
*pTargetFormat
,
1761 const GUID
*pSourceFormat
) {
1762 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1764 TRACE("(%p/%p)->(%p, %p, 0x%s, %p): stub !!!\n", This
, iface
, pTarget
,
1765 pTargetFormat
, wine_dbgstr_longlong(Source
), pSourceFormat
);
1770 static HRESULT WINAPI
MediaSeeking_SetPositions(IMediaSeeking
*iface
,
1772 DWORD dwCurrentFlags
,
1774 DWORD dwStopFlags
) {
1775 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1777 TRACE("(%p/%p)->(%p, %08x, %p, %08x): stub !!!\n", This
, iface
, pCurrent
, dwCurrentFlags
, pStop
, dwStopFlags
);
1782 static HRESULT WINAPI
MediaSeeking_GetPositions(IMediaSeeking
*iface
,
1785 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1787 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pCurrent
, pStop
);
1792 static HRESULT WINAPI
MediaSeeking_GetAvailable(IMediaSeeking
*iface
,
1793 LONGLONG
*pEarliest
,
1794 LONGLONG
*pLatest
) {
1795 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1797 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pEarliest
, pLatest
);
1802 static HRESULT WINAPI
MediaSeeking_SetRate(IMediaSeeking
*iface
,
1804 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1806 TRACE("(%p/%p)->(%f): stub !!!\n", This
, iface
, dRate
);
1811 static HRESULT WINAPI
MediaSeeking_GetRate(IMediaSeeking
*iface
,
1813 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1815 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pdRate
);
1820 static HRESULT WINAPI
MediaSeeking_GetPreroll(IMediaSeeking
*iface
,
1821 LONGLONG
*pllPreroll
) {
1822 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1824 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pllPreroll
);
1830 static const IMediaSeekingVtbl IMediaSeeking_VTable
=
1832 MediaSeeking_QueryInterface
,
1833 MediaSeeking_AddRef
,
1834 MediaSeeking_Release
,
1835 MediaSeeking_GetCapabilities
,
1836 MediaSeeking_CheckCapabilities
,
1837 MediaSeeking_IsFormatSupported
,
1838 MediaSeeking_QueryPreferredFormat
,
1839 MediaSeeking_GetTimeFormat
,
1840 MediaSeeking_IsUsingTimeFormat
,
1841 MediaSeeking_SetTimeFormat
,
1842 MediaSeeking_GetDuration
,
1843 MediaSeeking_GetStopPosition
,
1844 MediaSeeking_GetCurrentPosition
,
1845 MediaSeeking_ConvertTimeFormat
,
1846 MediaSeeking_SetPositions
,
1847 MediaSeeking_GetPositions
,
1848 MediaSeeking_GetAvailable
,
1849 MediaSeeking_SetRate
,
1850 MediaSeeking_GetRate
,
1851 MediaSeeking_GetPreroll
1854 /*** IUnknown methods ***/
1855 static HRESULT WINAPI
MediaPosition_QueryInterface(IMediaPosition
* iface
, REFIID riid
, void** ppvObj
){
1856 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1858 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1860 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1863 static ULONG WINAPI
MediaPosition_AddRef(IMediaPosition
*iface
){
1864 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1866 TRACE("(%p/%p)->()\n", This
, iface
);
1868 return Filtergraph_AddRef(This
);
1871 static ULONG WINAPI
MediaPosition_Release(IMediaPosition
*iface
){
1872 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1874 TRACE("(%p/%p)->()\n", This
, iface
);
1876 return Filtergraph_Release(This
);
1879 /*** IDispatch methods ***/
1880 static HRESULT WINAPI
MediaPosition_GetTypeInfoCount(IMediaPosition
*iface
, UINT
* pctinfo
){
1881 FIXME("(%p) stub!\n", iface
);
1885 static HRESULT WINAPI
MediaPosition_GetTypeInfo(IMediaPosition
*iface
, UINT iTInfo
, LCID lcid
, ITypeInfo
** ppTInfo
){
1886 FIXME("(%p) stub!\n", iface
);
1890 static HRESULT WINAPI
MediaPosition_GetIDsOfNames(IMediaPosition
* iface
, REFIID riid
, LPOLESTR
* rgszNames
, UINT cNames
, LCID lcid
, DISPID
* rgDispId
){
1891 FIXME("(%p) stub!\n", iface
);
1895 static HRESULT WINAPI
MediaPosition_Invoke(IMediaPosition
* iface
, DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
* pDispParams
, VARIANT
* pVarResult
, EXCEPINFO
* pExcepInfo
, UINT
* puArgErr
){
1896 FIXME("(%p) stub!\n", iface
);
1900 /*** IMediaPosition methods ***/
1901 static HRESULT WINAPI
MediaPosition_get_Duration(IMediaPosition
* iface
, REFTIME
*plength
){
1902 FIXME("(%p)->(%p) stub!\n", iface
, plength
);
1906 static HRESULT WINAPI
MediaPosition_put_CurrentPosition(IMediaPosition
* iface
, REFTIME llTime
){
1907 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1911 static HRESULT WINAPI
MediaPosition_get_CurrentPosition(IMediaPosition
* iface
, REFTIME
*pllTime
){
1912 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1916 static HRESULT WINAPI
MediaPosition_get_StopTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1917 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1921 static HRESULT WINAPI
MediaPosition_put_StopTime(IMediaPosition
* iface
, REFTIME llTime
){
1922 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1926 static HRESULT WINAPI
MediaPosition_get_PrerollTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1927 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1931 static HRESULT WINAPI
MediaPosition_put_PrerollTime(IMediaPosition
* iface
, REFTIME llTime
){
1932 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1936 static HRESULT WINAPI
MediaPosition_put_Rate(IMediaPosition
* iface
, double dRate
){
1937 FIXME("(%p)->(%f) stub!\n", iface
, dRate
);
1941 static HRESULT WINAPI
MediaPosition_get_Rate(IMediaPosition
* iface
, double *pdRate
){
1942 FIXME("(%p)->(%p) stub!\n", iface
, pdRate
);
1946 static HRESULT WINAPI
MediaPosition_CanSeekForward(IMediaPosition
* iface
, LONG
*pCanSeekForward
){
1947 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekForward
);
1951 static HRESULT WINAPI
MediaPosition_CanSeekBackward(IMediaPosition
* iface
, LONG
*pCanSeekBackward
){
1952 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekBackward
);
1957 static const IMediaPositionVtbl IMediaPosition_VTable
=
1959 MediaPosition_QueryInterface
,
1960 MediaPosition_AddRef
,
1961 MediaPosition_Release
,
1962 MediaPosition_GetTypeInfoCount
,
1963 MediaPosition_GetTypeInfo
,
1964 MediaPosition_GetIDsOfNames
,
1965 MediaPosition_Invoke
,
1966 MediaPosition_get_Duration
,
1967 MediaPosition_put_CurrentPosition
,
1968 MediaPosition_get_CurrentPosition
,
1969 MediaPosition_get_StopTime
,
1970 MediaPosition_put_StopTime
,
1971 MediaPosition_get_PrerollTime
,
1972 MediaPosition_put_PrerollTime
,
1973 MediaPosition_put_Rate
,
1974 MediaPosition_get_Rate
,
1975 MediaPosition_CanSeekForward
,
1976 MediaPosition_CanSeekBackward
1979 static HRESULT
GetTargetInterface(IFilterGraphImpl
* pGraph
, REFIID riid
, LPVOID
* ppvObj
)
1981 HRESULT hr
= E_NOINTERFACE
;
1985 /* Check if the interface type is already registered */
1986 for (entry
= 0; entry
< pGraph
->nItfCacheEntries
; entry
++)
1987 if (riid
== pGraph
->ItfCacheEntries
[entry
].riid
)
1989 if (pGraph
->ItfCacheEntries
[entry
].iface
)
1991 /* Return the interface if available */
1992 *ppvObj
= pGraph
->ItfCacheEntries
[entry
].iface
;
1998 if (entry
>= MAX_ITF_CACHE_ENTRIES
)
2000 FIXME("Not enough space to store interface in the cache\n");
2001 return E_OUTOFMEMORY
;
2004 /* Find a filter supporting the requested interface */
2005 for (i
= 0; i
< pGraph
->nFilters
; i
++)
2007 hr
= IBaseFilter_QueryInterface(pGraph
->ppFiltersInGraph
[i
], riid
, ppvObj
);
2010 pGraph
->ItfCacheEntries
[entry
].riid
= riid
;
2011 pGraph
->ItfCacheEntries
[entry
].filter
= pGraph
->ppFiltersInGraph
[i
];
2012 pGraph
->ItfCacheEntries
[entry
].iface
= (IUnknown
*)*ppvObj
;
2013 if (entry
>= pGraph
->nItfCacheEntries
)
2014 pGraph
->nItfCacheEntries
++;
2017 if (hr
!= E_NOINTERFACE
)
2024 /*** IUnknown methods ***/
2025 static HRESULT WINAPI
BasicAudio_QueryInterface(IBasicAudio
*iface
,
2028 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2030 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2032 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2035 static ULONG WINAPI
BasicAudio_AddRef(IBasicAudio
*iface
) {
2036 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2038 TRACE("(%p/%p)->()\n", This
, iface
);
2040 return Filtergraph_AddRef(This
);
2043 static ULONG WINAPI
BasicAudio_Release(IBasicAudio
*iface
) {
2044 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2046 TRACE("(%p/%p)->()\n", This
, iface
);
2048 return Filtergraph_Release(This
);
2051 /*** IDispatch methods ***/
2052 static HRESULT WINAPI
BasicAudio_GetTypeInfoCount(IBasicAudio
*iface
,
2054 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2055 IBasicAudio
* pBasicAudio
;
2058 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
2060 EnterCriticalSection(&This
->cs
);
2062 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2065 hr
= IBasicAudio_GetTypeInfoCount(pBasicAudio
, pctinfo
);
2067 LeaveCriticalSection(&This
->cs
);
2072 static HRESULT WINAPI
BasicAudio_GetTypeInfo(IBasicAudio
*iface
,
2075 ITypeInfo
**ppTInfo
) {
2076 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2077 IBasicAudio
* pBasicAudio
;
2080 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2082 EnterCriticalSection(&This
->cs
);
2084 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2087 hr
= IBasicAudio_GetTypeInfo(pBasicAudio
, iTInfo
, lcid
, ppTInfo
);
2089 LeaveCriticalSection(&This
->cs
);
2094 static HRESULT WINAPI
BasicAudio_GetIDsOfNames(IBasicAudio
*iface
,
2100 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2101 IBasicAudio
* pBasicAudio
;
2104 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2106 EnterCriticalSection(&This
->cs
);
2108 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2111 hr
= IBasicAudio_GetIDsOfNames(pBasicAudio
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2113 LeaveCriticalSection(&This
->cs
);
2118 static HRESULT WINAPI
BasicAudio_Invoke(IBasicAudio
*iface
,
2119 DISPID dispIdMember
,
2123 DISPPARAMS
*pDispParams
,
2125 EXCEPINFO
*pExepInfo
,
2127 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2128 IBasicAudio
* pBasicAudio
;
2131 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
);
2133 EnterCriticalSection(&This
->cs
);
2135 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2138 hr
= IBasicAudio_Invoke(pBasicAudio
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2140 LeaveCriticalSection(&This
->cs
);
2145 /*** IBasicAudio methods ***/
2146 static HRESULT WINAPI
BasicAudio_put_Volume(IBasicAudio
*iface
,
2148 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2149 IBasicAudio
* pBasicAudio
;
2152 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lVolume
);
2154 EnterCriticalSection(&This
->cs
);
2156 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2159 hr
= IBasicAudio_put_Volume(pBasicAudio
, lVolume
);
2161 LeaveCriticalSection(&This
->cs
);
2166 static HRESULT WINAPI
BasicAudio_get_Volume(IBasicAudio
*iface
,
2168 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2169 IBasicAudio
* pBasicAudio
;
2172 TRACE("(%p/%p)->(%p)\n", This
, iface
, plVolume
);
2174 EnterCriticalSection(&This
->cs
);
2176 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2179 hr
= IBasicAudio_get_Volume(pBasicAudio
, plVolume
);
2181 LeaveCriticalSection(&This
->cs
);
2186 static HRESULT WINAPI
BasicAudio_put_Balance(IBasicAudio
*iface
,
2188 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2189 IBasicAudio
* pBasicAudio
;
2192 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lBalance
);
2194 EnterCriticalSection(&This
->cs
);
2196 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2199 hr
= IBasicAudio_put_Balance(pBasicAudio
, lBalance
);
2201 LeaveCriticalSection(&This
->cs
);
2206 static HRESULT WINAPI
BasicAudio_get_Balance(IBasicAudio
*iface
,
2208 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2209 IBasicAudio
* pBasicAudio
;
2212 TRACE("(%p/%p)->(%p)\n", This
, iface
, plBalance
);
2214 EnterCriticalSection(&This
->cs
);
2216 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2219 hr
= IBasicAudio_get_Balance(pBasicAudio
, plBalance
);
2221 LeaveCriticalSection(&This
->cs
);
2226 static const IBasicAudioVtbl IBasicAudio_VTable
=
2228 BasicAudio_QueryInterface
,
2231 BasicAudio_GetTypeInfoCount
,
2232 BasicAudio_GetTypeInfo
,
2233 BasicAudio_GetIDsOfNames
,
2235 BasicAudio_put_Volume
,
2236 BasicAudio_get_Volume
,
2237 BasicAudio_put_Balance
,
2238 BasicAudio_get_Balance
2241 /*** IUnknown methods ***/
2242 static HRESULT WINAPI
BasicVideo_QueryInterface(IBasicVideo
*iface
,
2245 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2247 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2249 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2252 static ULONG WINAPI
BasicVideo_AddRef(IBasicVideo
*iface
) {
2253 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2255 TRACE("(%p/%p)->()\n", This
, iface
);
2257 return Filtergraph_AddRef(This
);
2260 static ULONG WINAPI
BasicVideo_Release(IBasicVideo
*iface
) {
2261 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2263 TRACE("(%p/%p)->()\n", This
, iface
);
2265 return Filtergraph_Release(This
);
2268 /*** IDispatch methods ***/
2269 static HRESULT WINAPI
BasicVideo_GetTypeInfoCount(IBasicVideo
*iface
,
2271 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2272 IBasicVideo
* pBasicVideo
;
2275 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
2277 EnterCriticalSection(&This
->cs
);
2279 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2282 hr
= IBasicVideo_GetTypeInfoCount(pBasicVideo
, pctinfo
);
2284 LeaveCriticalSection(&This
->cs
);
2289 static HRESULT WINAPI
BasicVideo_GetTypeInfo(IBasicVideo
*iface
,
2292 ITypeInfo
**ppTInfo
) {
2293 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2294 IBasicVideo
* pBasicVideo
;
2297 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2299 EnterCriticalSection(&This
->cs
);
2301 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2304 hr
= IBasicVideo_GetTypeInfo(pBasicVideo
, iTInfo
, lcid
, ppTInfo
);
2306 LeaveCriticalSection(&This
->cs
);
2311 static HRESULT WINAPI
BasicVideo_GetIDsOfNames(IBasicVideo
*iface
,
2317 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2318 IBasicVideo
* pBasicVideo
;
2321 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2323 EnterCriticalSection(&This
->cs
);
2325 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2328 hr
= IBasicVideo_GetIDsOfNames(pBasicVideo
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2330 LeaveCriticalSection(&This
->cs
);
2335 static HRESULT WINAPI
BasicVideo_Invoke(IBasicVideo
*iface
,
2336 DISPID dispIdMember
,
2340 DISPPARAMS
*pDispParams
,
2342 EXCEPINFO
*pExepInfo
,
2344 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2345 IBasicVideo
* pBasicVideo
;
2348 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
);
2350 EnterCriticalSection(&This
->cs
);
2352 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2355 hr
= IBasicVideo_Invoke(pBasicVideo
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2357 LeaveCriticalSection(&This
->cs
);
2362 /*** IBasicVideo methods ***/
2363 static HRESULT WINAPI
BasicVideo_get_AvgTimePerFrame(IBasicVideo
*iface
,
2364 REFTIME
*pAvgTimePerFrame
) {
2365 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2366 IBasicVideo
* pBasicVideo
;
2369 TRACE("(%p/%p)->(%p)\n", This
, iface
, pAvgTimePerFrame
);
2371 EnterCriticalSection(&This
->cs
);
2373 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2376 hr
= IBasicVideo_get_AvgTimePerFrame(pBasicVideo
, pAvgTimePerFrame
);
2378 LeaveCriticalSection(&This
->cs
);
2383 static HRESULT WINAPI
BasicVideo_get_BitRate(IBasicVideo
*iface
,
2385 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2386 IBasicVideo
* pBasicVideo
;
2389 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitRate
);
2391 EnterCriticalSection(&This
->cs
);
2393 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2396 hr
= IBasicVideo_get_BitRate(pBasicVideo
, pBitRate
);
2398 LeaveCriticalSection(&This
->cs
);
2403 static HRESULT WINAPI
BasicVideo_get_BitErrorRate(IBasicVideo
*iface
,
2404 long *pBitErrorRate
) {
2405 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2406 IBasicVideo
* pBasicVideo
;
2409 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitErrorRate
);
2411 EnterCriticalSection(&This
->cs
);
2413 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2416 hr
= IBasicVideo_get_BitErrorRate(pBasicVideo
, pBitErrorRate
);
2418 LeaveCriticalSection(&This
->cs
);
2423 static HRESULT WINAPI
BasicVideo_get_VideoWidth(IBasicVideo
*iface
,
2424 long *pVideoWidth
) {
2425 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2426 IBasicVideo
* pBasicVideo
;
2429 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoWidth
);
2431 EnterCriticalSection(&This
->cs
);
2433 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2436 hr
= IBasicVideo_get_VideoWidth(pBasicVideo
, pVideoWidth
);
2438 LeaveCriticalSection(&This
->cs
);
2443 static HRESULT WINAPI
BasicVideo_get_VideoHeight(IBasicVideo
*iface
,
2444 long *pVideoHeight
) {
2445 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2446 IBasicVideo
* pBasicVideo
;
2449 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoHeight
);
2451 EnterCriticalSection(&This
->cs
);
2453 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2456 hr
= IBasicVideo_get_VideoHeight(pBasicVideo
, pVideoHeight
);
2458 LeaveCriticalSection(&This
->cs
);
2463 static HRESULT WINAPI
BasicVideo_put_SourceLeft(IBasicVideo
*iface
,
2465 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2466 IBasicVideo
* pBasicVideo
;
2469 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceLeft
);
2471 EnterCriticalSection(&This
->cs
);
2473 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2476 hr
= IBasicVideo_put_SourceLeft(pBasicVideo
, SourceLeft
);
2478 LeaveCriticalSection(&This
->cs
);
2483 static HRESULT WINAPI
BasicVideo_get_SourceLeft(IBasicVideo
*iface
,
2484 long *pSourceLeft
) {
2485 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2486 IBasicVideo
* pBasicVideo
;
2489 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceLeft
);
2491 EnterCriticalSection(&This
->cs
);
2493 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2496 hr
= IBasicVideo_get_SourceLeft(pBasicVideo
, pSourceLeft
);
2498 LeaveCriticalSection(&This
->cs
);
2503 static HRESULT WINAPI
BasicVideo_put_SourceWidth(IBasicVideo
*iface
,
2505 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2506 IBasicVideo
* pBasicVideo
;
2509 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceWidth
);
2511 EnterCriticalSection(&This
->cs
);
2513 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2516 hr
= IBasicVideo_put_SourceWidth(pBasicVideo
, SourceWidth
);
2518 LeaveCriticalSection(&This
->cs
);
2523 static HRESULT WINAPI
BasicVideo_get_SourceWidth(IBasicVideo
*iface
,
2524 long *pSourceWidth
) {
2525 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2526 IBasicVideo
* pBasicVideo
;
2529 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceWidth
);
2531 EnterCriticalSection(&This
->cs
);
2533 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2536 hr
= IBasicVideo_get_SourceWidth(pBasicVideo
, pSourceWidth
);
2538 LeaveCriticalSection(&This
->cs
);
2543 static HRESULT WINAPI
BasicVideo_put_SourceTop(IBasicVideo
*iface
,
2545 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2546 IBasicVideo
* pBasicVideo
;
2549 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceTop
);
2551 EnterCriticalSection(&This
->cs
);
2553 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2556 hr
= IBasicVideo_put_SourceTop(pBasicVideo
, SourceTop
);
2558 LeaveCriticalSection(&This
->cs
);
2563 static HRESULT WINAPI
BasicVideo_get_SourceTop(IBasicVideo
*iface
,
2565 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2566 IBasicVideo
* pBasicVideo
;
2569 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceTop
);
2571 EnterCriticalSection(&This
->cs
);
2573 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2576 hr
= IBasicVideo_get_SourceTop(pBasicVideo
, pSourceTop
);
2578 LeaveCriticalSection(&This
->cs
);
2583 static HRESULT WINAPI
BasicVideo_put_SourceHeight(IBasicVideo
*iface
,
2584 long SourceHeight
) {
2585 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2586 IBasicVideo
* pBasicVideo
;
2589 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceHeight
);
2591 EnterCriticalSection(&This
->cs
);
2593 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2596 hr
= IBasicVideo_put_SourceHeight(pBasicVideo
, SourceHeight
);
2598 LeaveCriticalSection(&This
->cs
);
2603 static HRESULT WINAPI
BasicVideo_get_SourceHeight(IBasicVideo
*iface
,
2604 long *pSourceHeight
) {
2605 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2606 IBasicVideo
* pBasicVideo
;
2609 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceHeight
);
2611 EnterCriticalSection(&This
->cs
);
2613 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2616 hr
= IBasicVideo_get_SourceHeight(pBasicVideo
, pSourceHeight
);
2618 LeaveCriticalSection(&This
->cs
);
2623 static HRESULT WINAPI
BasicVideo_put_DestinationLeft(IBasicVideo
*iface
,
2624 long DestinationLeft
) {
2625 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2626 IBasicVideo
* pBasicVideo
;
2629 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationLeft
);
2631 EnterCriticalSection(&This
->cs
);
2633 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2636 hr
= IBasicVideo_put_DestinationLeft(pBasicVideo
, DestinationLeft
);
2638 LeaveCriticalSection(&This
->cs
);
2643 static HRESULT WINAPI
BasicVideo_get_DestinationLeft(IBasicVideo
*iface
,
2644 long *pDestinationLeft
) {
2645 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2646 IBasicVideo
* pBasicVideo
;
2649 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationLeft
);
2651 EnterCriticalSection(&This
->cs
);
2653 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2656 hr
= IBasicVideo_get_DestinationLeft(pBasicVideo
, pDestinationLeft
);
2658 LeaveCriticalSection(&This
->cs
);
2663 static HRESULT WINAPI
BasicVideo_put_DestinationWidth(IBasicVideo
*iface
,
2664 long DestinationWidth
) {
2665 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2666 IBasicVideo
* pBasicVideo
;
2669 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationWidth
);
2671 EnterCriticalSection(&This
->cs
);
2673 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2676 hr
= IBasicVideo_put_DestinationWidth(pBasicVideo
, DestinationWidth
);
2678 LeaveCriticalSection(&This
->cs
);
2683 static HRESULT WINAPI
BasicVideo_get_DestinationWidth(IBasicVideo
*iface
,
2684 long *pDestinationWidth
) {
2685 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2686 IBasicVideo
* pBasicVideo
;
2689 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationWidth
);
2691 EnterCriticalSection(&This
->cs
);
2693 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2696 hr
= IBasicVideo_get_DestinationWidth(pBasicVideo
, pDestinationWidth
);
2698 LeaveCriticalSection(&This
->cs
);
2703 static HRESULT WINAPI
BasicVideo_put_DestinationTop(IBasicVideo
*iface
,
2704 long DestinationTop
) {
2705 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2706 IBasicVideo
* pBasicVideo
;
2709 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationTop
);
2711 EnterCriticalSection(&This
->cs
);
2713 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2716 hr
= IBasicVideo_put_DestinationTop(pBasicVideo
, DestinationTop
);
2718 LeaveCriticalSection(&This
->cs
);
2723 static HRESULT WINAPI
BasicVideo_get_DestinationTop(IBasicVideo
*iface
,
2724 long *pDestinationTop
) {
2725 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2726 IBasicVideo
* pBasicVideo
;
2729 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationTop
);
2731 EnterCriticalSection(&This
->cs
);
2733 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2736 hr
= IBasicVideo_get_DestinationTop(pBasicVideo
, pDestinationTop
);
2738 LeaveCriticalSection(&This
->cs
);
2743 static HRESULT WINAPI
BasicVideo_put_DestinationHeight(IBasicVideo
*iface
,
2744 long DestinationHeight
) {
2745 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2746 IBasicVideo
* pBasicVideo
;
2749 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationHeight
);
2751 EnterCriticalSection(&This
->cs
);
2753 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2756 hr
= IBasicVideo_put_DestinationHeight(pBasicVideo
, DestinationHeight
);
2758 LeaveCriticalSection(&This
->cs
);
2763 static HRESULT WINAPI
BasicVideo_get_DestinationHeight(IBasicVideo
*iface
,
2764 long *pDestinationHeight
) {
2765 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2766 IBasicVideo
* pBasicVideo
;
2769 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationHeight
);
2771 EnterCriticalSection(&This
->cs
);
2773 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2776 hr
= IBasicVideo_get_DestinationHeight(pBasicVideo
, pDestinationHeight
);
2778 LeaveCriticalSection(&This
->cs
);
2783 static HRESULT WINAPI
BasicVideo_SetSourcePosition(IBasicVideo
*iface
,
2788 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2789 IBasicVideo
* pBasicVideo
;
2792 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2794 EnterCriticalSection(&This
->cs
);
2796 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2799 hr
= IBasicVideo_SetSourcePosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2801 LeaveCriticalSection(&This
->cs
);
2806 static HRESULT WINAPI
BasicVideo_GetSourcePosition(IBasicVideo
*iface
,
2811 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2812 IBasicVideo
* pBasicVideo
;
2815 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2817 EnterCriticalSection(&This
->cs
);
2819 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2822 hr
= IBasicVideo_GetSourcePosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2824 LeaveCriticalSection(&This
->cs
);
2829 static HRESULT WINAPI
BasicVideo_SetDefaultSourcePosition(IBasicVideo
*iface
) {
2830 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2831 IBasicVideo
* pBasicVideo
;
2834 TRACE("(%p/%p)->()\n", This
, iface
);
2836 EnterCriticalSection(&This
->cs
);
2838 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2841 hr
= IBasicVideo_SetDefaultSourcePosition(pBasicVideo
);
2843 LeaveCriticalSection(&This
->cs
);
2848 static HRESULT WINAPI
BasicVideo_SetDestinationPosition(IBasicVideo
*iface
,
2853 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2854 IBasicVideo
* pBasicVideo
;
2857 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2859 EnterCriticalSection(&This
->cs
);
2861 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2864 hr
= IBasicVideo_SetDestinationPosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2866 LeaveCriticalSection(&This
->cs
);
2871 static HRESULT WINAPI
BasicVideo_GetDestinationPosition(IBasicVideo
*iface
,
2876 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2877 IBasicVideo
* pBasicVideo
;
2880 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2882 EnterCriticalSection(&This
->cs
);
2884 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2887 hr
= IBasicVideo_GetDestinationPosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2889 LeaveCriticalSection(&This
->cs
);
2894 static HRESULT WINAPI
BasicVideo_SetDefaultDestinationPosition(IBasicVideo
*iface
) {
2895 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2896 IBasicVideo
* pBasicVideo
;
2899 TRACE("(%p/%p)->()\n", This
, iface
);
2901 EnterCriticalSection(&This
->cs
);
2903 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2906 hr
= IBasicVideo_SetDefaultDestinationPosition(pBasicVideo
);
2908 LeaveCriticalSection(&This
->cs
);
2913 static HRESULT WINAPI
BasicVideo_GetVideoSize(IBasicVideo
*iface
,
2916 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2917 IBasicVideo
* pBasicVideo
;
2920 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
2922 EnterCriticalSection(&This
->cs
);
2924 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2927 hr
= IBasicVideo_GetVideoSize(pBasicVideo
, pWidth
, pHeight
);
2929 LeaveCriticalSection(&This
->cs
);
2934 static HRESULT WINAPI
BasicVideo_GetVideoPaletteEntries(IBasicVideo
*iface
,
2939 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2940 IBasicVideo
* pBasicVideo
;
2943 TRACE("(%p/%p)->(%ld, %ld, %p, %p)\n", This
, iface
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2945 EnterCriticalSection(&This
->cs
);
2947 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2950 hr
= IBasicVideo_GetVideoPaletteEntries(pBasicVideo
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2952 LeaveCriticalSection(&This
->cs
);
2957 static HRESULT WINAPI
BasicVideo_GetCurrentImage(IBasicVideo
*iface
,
2960 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2961 IBasicVideo
* pBasicVideo
;
2964 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pBufferSize
, pDIBImage
);
2966 EnterCriticalSection(&This
->cs
);
2968 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2971 hr
= IBasicVideo_GetCurrentImage(pBasicVideo
, pBufferSize
, pDIBImage
);
2973 LeaveCriticalSection(&This
->cs
);
2978 static HRESULT WINAPI
BasicVideo_IsUsingDefaultSource(IBasicVideo
*iface
) {
2979 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2980 IBasicVideo
* pBasicVideo
;
2983 TRACE("(%p/%p)->()\n", This
, iface
);
2985 EnterCriticalSection(&This
->cs
);
2987 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2990 hr
= IBasicVideo_IsUsingDefaultSource(pBasicVideo
);
2992 LeaveCriticalSection(&This
->cs
);
2997 static HRESULT WINAPI
BasicVideo_IsUsingDefaultDestination(IBasicVideo
*iface
) {
2998 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2999 IBasicVideo
* pBasicVideo
;
3002 TRACE("(%p/%p)->()\n", This
, iface
);
3004 EnterCriticalSection(&This
->cs
);
3006 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
3009 hr
= IBasicVideo_IsUsingDefaultDestination(pBasicVideo
);
3011 LeaveCriticalSection(&This
->cs
);
3017 static const IBasicVideoVtbl IBasicVideo_VTable
=
3019 BasicVideo_QueryInterface
,
3022 BasicVideo_GetTypeInfoCount
,
3023 BasicVideo_GetTypeInfo
,
3024 BasicVideo_GetIDsOfNames
,
3026 BasicVideo_get_AvgTimePerFrame
,
3027 BasicVideo_get_BitRate
,
3028 BasicVideo_get_BitErrorRate
,
3029 BasicVideo_get_VideoWidth
,
3030 BasicVideo_get_VideoHeight
,
3031 BasicVideo_put_SourceLeft
,
3032 BasicVideo_get_SourceLeft
,
3033 BasicVideo_put_SourceWidth
,
3034 BasicVideo_get_SourceWidth
,
3035 BasicVideo_put_SourceTop
,
3036 BasicVideo_get_SourceTop
,
3037 BasicVideo_put_SourceHeight
,
3038 BasicVideo_get_SourceHeight
,
3039 BasicVideo_put_DestinationLeft
,
3040 BasicVideo_get_DestinationLeft
,
3041 BasicVideo_put_DestinationWidth
,
3042 BasicVideo_get_DestinationWidth
,
3043 BasicVideo_put_DestinationTop
,
3044 BasicVideo_get_DestinationTop
,
3045 BasicVideo_put_DestinationHeight
,
3046 BasicVideo_get_DestinationHeight
,
3047 BasicVideo_SetSourcePosition
,
3048 BasicVideo_GetSourcePosition
,
3049 BasicVideo_SetDefaultSourcePosition
,
3050 BasicVideo_SetDestinationPosition
,
3051 BasicVideo_GetDestinationPosition
,
3052 BasicVideo_SetDefaultDestinationPosition
,
3053 BasicVideo_GetVideoSize
,
3054 BasicVideo_GetVideoPaletteEntries
,
3055 BasicVideo_GetCurrentImage
,
3056 BasicVideo_IsUsingDefaultSource
,
3057 BasicVideo_IsUsingDefaultDestination
3061 /*** IUnknown methods ***/
3062 static HRESULT WINAPI
VideoWindow_QueryInterface(IVideoWindow
*iface
,
3065 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3067 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
3069 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
3072 static ULONG WINAPI
VideoWindow_AddRef(IVideoWindow
*iface
) {
3073 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3075 TRACE("(%p/%p)->()\n", This
, iface
);
3077 return Filtergraph_AddRef(This
);
3080 static ULONG WINAPI
VideoWindow_Release(IVideoWindow
*iface
) {
3081 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3083 TRACE("(%p/%p)->()\n", This
, iface
);
3085 return Filtergraph_Release(This
);
3088 /*** IDispatch methods ***/
3089 static HRESULT WINAPI
VideoWindow_GetTypeInfoCount(IVideoWindow
*iface
,
3091 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3092 IVideoWindow
* pVideoWindow
;
3095 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
3097 EnterCriticalSection(&This
->cs
);
3099 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3102 hr
= IVideoWindow_GetTypeInfoCount(pVideoWindow
, pctinfo
);
3104 LeaveCriticalSection(&This
->cs
);
3109 static HRESULT WINAPI
VideoWindow_GetTypeInfo(IVideoWindow
*iface
,
3112 ITypeInfo
**ppTInfo
) {
3113 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3114 IVideoWindow
* pVideoWindow
;
3117 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
3119 EnterCriticalSection(&This
->cs
);
3121 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3124 hr
= IVideoWindow_GetTypeInfo(pVideoWindow
, iTInfo
, lcid
, ppTInfo
);
3126 LeaveCriticalSection(&This
->cs
);
3131 static HRESULT WINAPI
VideoWindow_GetIDsOfNames(IVideoWindow
*iface
,
3137 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3138 IVideoWindow
* pVideoWindow
;
3141 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3143 EnterCriticalSection(&This
->cs
);
3145 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3148 hr
= IVideoWindow_GetIDsOfNames(pVideoWindow
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3150 LeaveCriticalSection(&This
->cs
);
3155 static HRESULT WINAPI
VideoWindow_Invoke(IVideoWindow
*iface
,
3156 DISPID dispIdMember
,
3160 DISPPARAMS
*pDispParams
,
3162 EXCEPINFO
*pExepInfo
,
3164 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3165 IVideoWindow
* pVideoWindow
;
3168 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
);
3170 EnterCriticalSection(&This
->cs
);
3172 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3175 hr
= IVideoWindow_Invoke(pVideoWindow
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
3177 LeaveCriticalSection(&This
->cs
);
3183 /*** IVideoWindow methods ***/
3184 static HRESULT WINAPI
VideoWindow_put_Caption(IVideoWindow
*iface
,
3186 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3187 IVideoWindow
* pVideoWindow
;
3190 TRACE("(%p/%p)->(%s (%p))\n", This
, iface
, debugstr_w(strCaption
), strCaption
);
3192 EnterCriticalSection(&This
->cs
);
3194 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3197 hr
= IVideoWindow_put_Caption(pVideoWindow
, strCaption
);
3199 LeaveCriticalSection(&This
->cs
);
3204 static HRESULT WINAPI
VideoWindow_get_Caption(IVideoWindow
*iface
,
3206 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3207 IVideoWindow
* pVideoWindow
;
3210 TRACE("(%p/%p)->(%p)\n", This
, iface
, strCaption
);
3212 EnterCriticalSection(&This
->cs
);
3214 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3217 hr
= IVideoWindow_get_Caption(pVideoWindow
, strCaption
);
3219 LeaveCriticalSection(&This
->cs
);
3224 static HRESULT WINAPI
VideoWindow_put_WindowStyle(IVideoWindow
*iface
,
3226 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3227 IVideoWindow
* pVideoWindow
;
3230 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyle
);
3232 EnterCriticalSection(&This
->cs
);
3234 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3237 hr
= IVideoWindow_put_WindowStyle(pVideoWindow
, WindowStyle
);
3239 LeaveCriticalSection(&This
->cs
);
3244 static HRESULT WINAPI
VideoWindow_get_WindowStyle(IVideoWindow
*iface
,
3245 long *WindowStyle
) {
3246 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3247 IVideoWindow
* pVideoWindow
;
3250 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyle
);
3252 EnterCriticalSection(&This
->cs
);
3254 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3257 hr
= IVideoWindow_get_WindowStyle(pVideoWindow
, WindowStyle
);
3259 LeaveCriticalSection(&This
->cs
);
3264 static HRESULT WINAPI
VideoWindow_put_WindowStyleEx(IVideoWindow
*iface
,
3265 long WindowStyleEx
) {
3266 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3267 IVideoWindow
* pVideoWindow
;
3270 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyleEx
);
3272 EnterCriticalSection(&This
->cs
);
3274 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3277 hr
= IVideoWindow_put_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3279 LeaveCriticalSection(&This
->cs
);
3284 static HRESULT WINAPI
VideoWindow_get_WindowStyleEx(IVideoWindow
*iface
,
3285 long *WindowStyleEx
) {
3286 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3287 IVideoWindow
* pVideoWindow
;
3290 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyleEx
);
3292 EnterCriticalSection(&This
->cs
);
3294 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3297 hr
= IVideoWindow_get_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3299 LeaveCriticalSection(&This
->cs
);
3304 static HRESULT WINAPI
VideoWindow_put_AutoShow(IVideoWindow
*iface
,
3306 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3307 IVideoWindow
* pVideoWindow
;
3310 TRACE("(%p/%p)->(%ld)\n", This
, iface
, AutoShow
);
3312 EnterCriticalSection(&This
->cs
);
3314 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3317 hr
= IVideoWindow_put_AutoShow(pVideoWindow
, AutoShow
);
3319 LeaveCriticalSection(&This
->cs
);
3324 static HRESULT WINAPI
VideoWindow_get_AutoShow(IVideoWindow
*iface
,
3326 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3327 IVideoWindow
* pVideoWindow
;
3330 TRACE("(%p/%p)->(%p)\n", This
, iface
, AutoShow
);
3332 EnterCriticalSection(&This
->cs
);
3334 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3337 hr
= IVideoWindow_get_AutoShow(pVideoWindow
, AutoShow
);
3339 LeaveCriticalSection(&This
->cs
);
3344 static HRESULT WINAPI
VideoWindow_put_WindowState(IVideoWindow
*iface
,
3346 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3347 IVideoWindow
* pVideoWindow
;
3350 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowState
);
3352 EnterCriticalSection(&This
->cs
);
3354 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3357 hr
= IVideoWindow_put_WindowState(pVideoWindow
, WindowState
);
3359 LeaveCriticalSection(&This
->cs
);
3364 static HRESULT WINAPI
VideoWindow_get_WindowState(IVideoWindow
*iface
,
3365 long *WindowState
) {
3366 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3367 IVideoWindow
* pVideoWindow
;
3370 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowState
);
3372 EnterCriticalSection(&This
->cs
);
3374 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3377 hr
= IVideoWindow_get_WindowState(pVideoWindow
, WindowState
);
3379 LeaveCriticalSection(&This
->cs
);
3384 static HRESULT WINAPI
VideoWindow_put_BackgroundPalette(IVideoWindow
*iface
,
3385 long BackgroundPalette
) {
3386 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3387 IVideoWindow
* pVideoWindow
;
3390 TRACE("(%p/%p)->(%ld)\n", This
, iface
, BackgroundPalette
);
3392 EnterCriticalSection(&This
->cs
);
3394 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3397 hr
= IVideoWindow_put_BackgroundPalette(pVideoWindow
, BackgroundPalette
);
3399 LeaveCriticalSection(&This
->cs
);
3404 static HRESULT WINAPI
VideoWindow_get_BackgroundPalette(IVideoWindow
*iface
,
3405 long *pBackgroundPalette
) {
3406 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3407 IVideoWindow
* pVideoWindow
;
3410 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBackgroundPalette
);
3412 EnterCriticalSection(&This
->cs
);
3414 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3417 hr
= IVideoWindow_get_BackgroundPalette(pVideoWindow
, pBackgroundPalette
);
3419 LeaveCriticalSection(&This
->cs
);
3424 static HRESULT WINAPI
VideoWindow_put_Visible(IVideoWindow
*iface
,
3426 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3427 IVideoWindow
* pVideoWindow
;
3430 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Visible
);
3432 EnterCriticalSection(&This
->cs
);
3434 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3437 hr
= IVideoWindow_put_Visible(pVideoWindow
, Visible
);
3439 LeaveCriticalSection(&This
->cs
);
3444 static HRESULT WINAPI
VideoWindow_get_Visible(IVideoWindow
*iface
,
3446 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3447 IVideoWindow
* pVideoWindow
;
3450 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVisible
);
3452 EnterCriticalSection(&This
->cs
);
3454 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3457 hr
= IVideoWindow_get_Visible(pVideoWindow
, pVisible
);
3459 LeaveCriticalSection(&This
->cs
);
3464 static HRESULT WINAPI
VideoWindow_put_Left(IVideoWindow
*iface
,
3466 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3467 IVideoWindow
* pVideoWindow
;
3470 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Left
);
3472 EnterCriticalSection(&This
->cs
);
3474 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3477 hr
= IVideoWindow_put_Left(pVideoWindow
, Left
);
3479 LeaveCriticalSection(&This
->cs
);
3484 static HRESULT WINAPI
VideoWindow_get_Left(IVideoWindow
*iface
,
3486 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3487 IVideoWindow
* pVideoWindow
;
3490 TRACE("(%p/%p)->(%p)\n", This
, iface
, pLeft
);
3492 EnterCriticalSection(&This
->cs
);
3494 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3497 hr
= IVideoWindow_get_Left(pVideoWindow
, pLeft
);
3499 LeaveCriticalSection(&This
->cs
);
3504 static HRESULT WINAPI
VideoWindow_put_Width(IVideoWindow
*iface
,
3506 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3507 IVideoWindow
* pVideoWindow
;
3510 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Width
);
3512 EnterCriticalSection(&This
->cs
);
3514 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3517 hr
= IVideoWindow_put_Width(pVideoWindow
, Width
);
3519 LeaveCriticalSection(&This
->cs
);
3524 static HRESULT WINAPI
VideoWindow_get_Width(IVideoWindow
*iface
,
3526 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3527 IVideoWindow
* pVideoWindow
;
3530 TRACE("(%p/%p)->(%p)\n", This
, iface
, pWidth
);
3532 EnterCriticalSection(&This
->cs
);
3534 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3537 hr
= IVideoWindow_get_Width(pVideoWindow
, pWidth
);
3539 LeaveCriticalSection(&This
->cs
);
3544 static HRESULT WINAPI
VideoWindow_put_Top(IVideoWindow
*iface
,
3546 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3547 IVideoWindow
* pVideoWindow
;
3550 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Top
);
3552 EnterCriticalSection(&This
->cs
);
3554 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3557 hr
= IVideoWindow_put_Top(pVideoWindow
, Top
);
3559 LeaveCriticalSection(&This
->cs
);
3564 static HRESULT WINAPI
VideoWindow_get_Top(IVideoWindow
*iface
,
3566 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3567 IVideoWindow
* pVideoWindow
;
3570 TRACE("(%p/%p)->(%p)\n", This
, iface
, pTop
);
3572 EnterCriticalSection(&This
->cs
);
3574 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3577 hr
= IVideoWindow_get_Top(pVideoWindow
, pTop
);
3579 LeaveCriticalSection(&This
->cs
);
3584 static HRESULT WINAPI
VideoWindow_put_Height(IVideoWindow
*iface
,
3586 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3587 IVideoWindow
* pVideoWindow
;
3590 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Height
);
3592 EnterCriticalSection(&This
->cs
);
3594 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3597 hr
= IVideoWindow_put_Height(pVideoWindow
, Height
);
3599 LeaveCriticalSection(&This
->cs
);
3604 static HRESULT WINAPI
VideoWindow_get_Height(IVideoWindow
*iface
,
3606 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3607 IVideoWindow
* pVideoWindow
;
3610 TRACE("(%p/%p)->(%p)\n", This
, iface
, pHeight
);
3612 EnterCriticalSection(&This
->cs
);
3614 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3617 hr
= IVideoWindow_get_Height(pVideoWindow
, pHeight
);
3619 LeaveCriticalSection(&This
->cs
);
3624 static HRESULT WINAPI
VideoWindow_put_Owner(IVideoWindow
*iface
,
3626 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3627 IVideoWindow
* pVideoWindow
;
3630 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Owner
);
3632 EnterCriticalSection(&This
->cs
);
3634 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3637 hr
= IVideoWindow_put_Owner(pVideoWindow
, Owner
);
3639 LeaveCriticalSection(&This
->cs
);
3644 static HRESULT WINAPI
VideoWindow_get_Owner(IVideoWindow
*iface
,
3646 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3647 IVideoWindow
* pVideoWindow
;
3650 TRACE("(%p/%p)->(%p)\n", This
, iface
, Owner
);
3652 EnterCriticalSection(&This
->cs
);
3654 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3657 hr
= IVideoWindow_get_Owner(pVideoWindow
, Owner
);
3659 LeaveCriticalSection(&This
->cs
);
3664 static HRESULT WINAPI
VideoWindow_put_MessageDrain(IVideoWindow
*iface
,
3666 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3667 IVideoWindow
* pVideoWindow
;
3670 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Drain
);
3672 EnterCriticalSection(&This
->cs
);
3674 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3677 hr
= IVideoWindow_put_MessageDrain(pVideoWindow
, Drain
);
3679 LeaveCriticalSection(&This
->cs
);
3684 static HRESULT WINAPI
VideoWindow_get_MessageDrain(IVideoWindow
*iface
,
3686 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3687 IVideoWindow
* pVideoWindow
;
3690 TRACE("(%p/%p)->(%p)\n", This
, iface
, Drain
);
3692 EnterCriticalSection(&This
->cs
);
3694 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3697 hr
= IVideoWindow_get_MessageDrain(pVideoWindow
, Drain
);
3699 LeaveCriticalSection(&This
->cs
);
3704 static HRESULT WINAPI
VideoWindow_get_BorderColor(IVideoWindow
*iface
,
3706 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3707 IVideoWindow
* pVideoWindow
;
3710 TRACE("(%p/%p)->(%p)\n", This
, iface
, Color
);
3712 EnterCriticalSection(&This
->cs
);
3714 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3717 hr
= IVideoWindow_get_BorderColor(pVideoWindow
, Color
);
3719 LeaveCriticalSection(&This
->cs
);
3724 static HRESULT WINAPI
VideoWindow_put_BorderColor(IVideoWindow
*iface
,
3726 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3727 IVideoWindow
* pVideoWindow
;
3730 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Color
);
3732 EnterCriticalSection(&This
->cs
);
3734 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3737 hr
= IVideoWindow_put_BorderColor(pVideoWindow
, Color
);
3739 LeaveCriticalSection(&This
->cs
);
3744 static HRESULT WINAPI
VideoWindow_get_FullScreenMode(IVideoWindow
*iface
,
3745 long *FullScreenMode
) {
3746 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3747 IVideoWindow
* pVideoWindow
;
3750 TRACE("(%p/%p)->(%p)\n", This
, iface
, FullScreenMode
);
3752 EnterCriticalSection(&This
->cs
);
3754 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3757 hr
= IVideoWindow_get_FullScreenMode(pVideoWindow
, FullScreenMode
);
3759 LeaveCriticalSection(&This
->cs
);
3764 static HRESULT WINAPI
VideoWindow_put_FullScreenMode(IVideoWindow
*iface
,
3765 long FullScreenMode
) {
3766 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3767 IVideoWindow
* pVideoWindow
;
3770 TRACE("(%p/%p)->(%ld)\n", This
, iface
, FullScreenMode
);
3772 EnterCriticalSection(&This
->cs
);
3774 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3777 hr
= IVideoWindow_put_FullScreenMode(pVideoWindow
, FullScreenMode
);
3779 LeaveCriticalSection(&This
->cs
);
3784 static HRESULT WINAPI
VideoWindow_SetWindowForeground(IVideoWindow
*iface
,
3786 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3787 IVideoWindow
* pVideoWindow
;
3790 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Focus
);
3792 EnterCriticalSection(&This
->cs
);
3794 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3797 hr
= IVideoWindow_SetWindowForeground(pVideoWindow
, Focus
);
3799 LeaveCriticalSection(&This
->cs
);
3804 static HRESULT WINAPI
VideoWindow_NotifyOwnerMessage(IVideoWindow
*iface
,
3809 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3810 IVideoWindow
* pVideoWindow
;
3813 TRACE("(%p/%p)->(%08x, %ld, %08lx, %08lx)\n", This
, iface
, (DWORD
) hwnd
, uMsg
, wParam
, lParam
);
3815 EnterCriticalSection(&This
->cs
);
3817 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3820 hr
= IVideoWindow_NotifyOwnerMessage(pVideoWindow
, hwnd
, uMsg
, wParam
, lParam
);
3822 LeaveCriticalSection(&This
->cs
);
3827 static HRESULT WINAPI
VideoWindow_SetWindowPosition(IVideoWindow
*iface
,
3832 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3833 IVideoWindow
* pVideoWindow
;
3836 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
3838 EnterCriticalSection(&This
->cs
);
3840 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3843 hr
= IVideoWindow_SetWindowPosition(pVideoWindow
, Left
, Top
, Width
, Height
);
3845 LeaveCriticalSection(&This
->cs
);
3850 static HRESULT WINAPI
VideoWindow_GetWindowPosition(IVideoWindow
*iface
,
3855 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3856 IVideoWindow
* pVideoWindow
;
3859 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3861 EnterCriticalSection(&This
->cs
);
3863 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3866 hr
= IVideoWindow_GetWindowPosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3868 LeaveCriticalSection(&This
->cs
);
3873 static HRESULT WINAPI
VideoWindow_GetMinIdealImageSize(IVideoWindow
*iface
,
3876 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3877 IVideoWindow
* pVideoWindow
;
3880 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3882 EnterCriticalSection(&This
->cs
);
3884 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3887 hr
= IVideoWindow_GetMinIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3889 LeaveCriticalSection(&This
->cs
);
3894 static HRESULT WINAPI
VideoWindow_GetMaxIdealImageSize(IVideoWindow
*iface
,
3897 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3898 IVideoWindow
* pVideoWindow
;
3901 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3903 EnterCriticalSection(&This
->cs
);
3905 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3908 hr
= IVideoWindow_GetMaxIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3910 LeaveCriticalSection(&This
->cs
);
3915 static HRESULT WINAPI
VideoWindow_GetRestorePosition(IVideoWindow
*iface
,
3920 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3921 IVideoWindow
* pVideoWindow
;
3924 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3926 EnterCriticalSection(&This
->cs
);
3928 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3931 hr
= IVideoWindow_GetRestorePosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3933 LeaveCriticalSection(&This
->cs
);
3938 static HRESULT WINAPI
VideoWindow_HideCursor(IVideoWindow
*iface
,
3940 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3941 IVideoWindow
* pVideoWindow
;
3944 TRACE("(%p/%p)->(%ld)\n", This
, iface
, HideCursor
);
3946 EnterCriticalSection(&This
->cs
);
3948 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3951 hr
= IVideoWindow_HideCursor(pVideoWindow
, HideCursor
);
3953 LeaveCriticalSection(&This
->cs
);
3958 static HRESULT WINAPI
VideoWindow_IsCursorHidden(IVideoWindow
*iface
,
3959 long *CursorHidden
) {
3960 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3961 IVideoWindow
* pVideoWindow
;
3964 TRACE("(%p/%p)->(%p)\n", This
, iface
, CursorHidden
);
3966 EnterCriticalSection(&This
->cs
);
3968 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3971 hr
= IVideoWindow_IsCursorHidden(pVideoWindow
, CursorHidden
);
3973 LeaveCriticalSection(&This
->cs
);
3979 static const IVideoWindowVtbl IVideoWindow_VTable
=
3981 VideoWindow_QueryInterface
,
3983 VideoWindow_Release
,
3984 VideoWindow_GetTypeInfoCount
,
3985 VideoWindow_GetTypeInfo
,
3986 VideoWindow_GetIDsOfNames
,
3988 VideoWindow_put_Caption
,
3989 VideoWindow_get_Caption
,
3990 VideoWindow_put_WindowStyle
,
3991 VideoWindow_get_WindowStyle
,
3992 VideoWindow_put_WindowStyleEx
,
3993 VideoWindow_get_WindowStyleEx
,
3994 VideoWindow_put_AutoShow
,
3995 VideoWindow_get_AutoShow
,
3996 VideoWindow_put_WindowState
,
3997 VideoWindow_get_WindowState
,
3998 VideoWindow_put_BackgroundPalette
,
3999 VideoWindow_get_BackgroundPalette
,
4000 VideoWindow_put_Visible
,
4001 VideoWindow_get_Visible
,
4002 VideoWindow_put_Left
,
4003 VideoWindow_get_Left
,
4004 VideoWindow_put_Width
,
4005 VideoWindow_get_Width
,
4006 VideoWindow_put_Top
,
4007 VideoWindow_get_Top
,
4008 VideoWindow_put_Height
,
4009 VideoWindow_get_Height
,
4010 VideoWindow_put_Owner
,
4011 VideoWindow_get_Owner
,
4012 VideoWindow_put_MessageDrain
,
4013 VideoWindow_get_MessageDrain
,
4014 VideoWindow_get_BorderColor
,
4015 VideoWindow_put_BorderColor
,
4016 VideoWindow_get_FullScreenMode
,
4017 VideoWindow_put_FullScreenMode
,
4018 VideoWindow_SetWindowForeground
,
4019 VideoWindow_NotifyOwnerMessage
,
4020 VideoWindow_SetWindowPosition
,
4021 VideoWindow_GetWindowPosition
,
4022 VideoWindow_GetMinIdealImageSize
,
4023 VideoWindow_GetMaxIdealImageSize
,
4024 VideoWindow_GetRestorePosition
,
4025 VideoWindow_HideCursor
,
4026 VideoWindow_IsCursorHidden
4030 /*** IUnknown methods ***/
4031 static HRESULT WINAPI
MediaEvent_QueryInterface(IMediaEventEx
*iface
,
4034 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4036 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
4038 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
4041 static ULONG WINAPI
MediaEvent_AddRef(IMediaEventEx
*iface
) {
4042 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4044 TRACE("(%p/%p)->()\n", This
, iface
);
4046 return Filtergraph_AddRef(This
);
4049 static ULONG WINAPI
MediaEvent_Release(IMediaEventEx
*iface
) {
4050 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4052 TRACE("(%p/%p)->()\n", This
, iface
);
4054 return Filtergraph_Release(This
);
4057 /*** IDispatch methods ***/
4058 static HRESULT WINAPI
MediaEvent_GetTypeInfoCount(IMediaEventEx
*iface
,
4060 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4062 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
4067 static HRESULT WINAPI
MediaEvent_GetTypeInfo(IMediaEventEx
*iface
,
4070 ITypeInfo
**ppTInfo
) {
4071 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4073 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
4078 static HRESULT WINAPI
MediaEvent_GetIDsOfNames(IMediaEventEx
*iface
,
4084 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4086 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
4091 static HRESULT WINAPI
MediaEvent_Invoke(IMediaEventEx
*iface
,
4092 DISPID dispIdMember
,
4096 DISPPARAMS
*pDispParams
,
4098 EXCEPINFO
*pExepInfo
,
4100 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4102 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
);
4107 /*** IMediaEvent methods ***/
4108 static HRESULT WINAPI
MediaEvent_GetEventHandle(IMediaEventEx
*iface
,
4110 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4112 TRACE("(%p/%p)->(%p)\n", This
, iface
, hEvent
);
4114 *hEvent
= (OAEVENT
)This
->evqueue
.msg_event
;
4119 static HRESULT WINAPI
MediaEvent_GetEvent(IMediaEventEx
*iface
,
4124 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4127 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This
, iface
, lEventCode
, lParam1
, lParam2
, msTimeout
);
4129 if (EventsQueue_GetEvent(&This
->evqueue
, &evt
, msTimeout
))
4131 *lEventCode
= evt
.lEventCode
;
4132 *lParam1
= evt
.lParam1
;
4133 *lParam2
= evt
.lParam2
;
4141 static HRESULT WINAPI
MediaEvent_WaitForCompletion(IMediaEventEx
*iface
,
4144 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4146 TRACE("(%p/%p)->(%ld, %p)\n", This
, iface
, msTimeout
, pEvCode
);
4148 if (WaitForSingleObject(This
->hEventCompletion
, msTimeout
) == WAIT_OBJECT_0
)
4150 *pEvCode
= This
->CompletionStatus
;
4158 static HRESULT WINAPI
MediaEvent_CancelDefaultHandling(IMediaEventEx
*iface
,
4160 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4162 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4164 if (lEvCode
== EC_COMPLETE
)
4165 This
->HandleEcComplete
= FALSE
;
4166 else if (lEvCode
== EC_REPAINT
)
4167 This
->HandleEcRepaint
= FALSE
;
4168 else if (lEvCode
== EC_CLOCK_CHANGED
)
4169 This
->HandleEcClockChanged
= FALSE
;
4176 static HRESULT WINAPI
MediaEvent_RestoreDefaultHandling(IMediaEventEx
*iface
,
4178 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4180 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4182 if (lEvCode
== EC_COMPLETE
)
4183 This
->HandleEcComplete
= TRUE
;
4184 else if (lEvCode
== EC_REPAINT
)
4185 This
->HandleEcRepaint
= TRUE
;
4186 else if (lEvCode
== EC_CLOCK_CHANGED
)
4187 This
->HandleEcClockChanged
= TRUE
;
4194 static HRESULT WINAPI
MediaEvent_FreeEventParams(IMediaEventEx
*iface
,
4198 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4200 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This
, iface
, lEvCode
, lParam1
, lParam2
);
4205 /*** IMediaEventEx methods ***/
4206 static HRESULT WINAPI
MediaEvent_SetNotifyWindow(IMediaEventEx
*iface
,
4209 LONG_PTR lInstanceData
) {
4210 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4212 TRACE("(%p/%p)->(%08x, %ld, %08lx)\n", This
, iface
, (DWORD
) hwnd
, lMsg
, lInstanceData
);
4214 This
->notif
.hWnd
= (HWND
)hwnd
;
4215 This
->notif
.msg
= lMsg
;
4216 This
->notif
.instance
= (long) lInstanceData
;
4221 static HRESULT WINAPI
MediaEvent_SetNotifyFlags(IMediaEventEx
*iface
,
4222 long lNoNotifyFlags
) {
4223 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4225 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lNoNotifyFlags
);
4227 if ((lNoNotifyFlags
!= 0) && (lNoNotifyFlags
!= 1))
4228 return E_INVALIDARG
;
4230 This
->notif
.disabled
= lNoNotifyFlags
;
4235 static HRESULT WINAPI
MediaEvent_GetNotifyFlags(IMediaEventEx
*iface
,
4236 long *lplNoNotifyFlags
) {
4237 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4239 TRACE("(%p/%p)->(%p)\n", This
, iface
, lplNoNotifyFlags
);
4241 if (!lplNoNotifyFlags
)
4244 *lplNoNotifyFlags
= This
->notif
.disabled
;
4250 static const IMediaEventExVtbl IMediaEventEx_VTable
=
4252 MediaEvent_QueryInterface
,
4255 MediaEvent_GetTypeInfoCount
,
4256 MediaEvent_GetTypeInfo
,
4257 MediaEvent_GetIDsOfNames
,
4259 MediaEvent_GetEventHandle
,
4260 MediaEvent_GetEvent
,
4261 MediaEvent_WaitForCompletion
,
4262 MediaEvent_CancelDefaultHandling
,
4263 MediaEvent_RestoreDefaultHandling
,
4264 MediaEvent_FreeEventParams
,
4265 MediaEvent_SetNotifyWindow
,
4266 MediaEvent_SetNotifyFlags
,
4267 MediaEvent_GetNotifyFlags
4271 static HRESULT WINAPI
MediaFilter_QueryInterface(IMediaFilter
*iface
, REFIID riid
, LPVOID
*ppv
)
4273 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4275 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4278 static ULONG WINAPI
MediaFilter_AddRef(IMediaFilter
*iface
)
4280 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4282 return Filtergraph_AddRef(This
);
4285 static ULONG WINAPI
MediaFilter_Release(IMediaFilter
*iface
)
4287 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4289 return Filtergraph_Release(This
);
4292 static HRESULT WINAPI
MediaFilter_GetClassID(IMediaFilter
*iface
, CLSID
* pClassID
)
4294 FIXME("(%p): stub\n", pClassID
);
4299 static HRESULT WINAPI
MediaFilter_Stop(IMediaFilter
*iface
)
4301 FIXME("(): stub\n");
4306 static HRESULT WINAPI
MediaFilter_Pause(IMediaFilter
*iface
)
4308 FIXME("(): stub\n");
4313 static HRESULT WINAPI
MediaFilter_Run(IMediaFilter
*iface
, REFERENCE_TIME tStart
)
4315 FIXME("(0x%s): stub\n", wine_dbgstr_longlong(tStart
));
4320 static HRESULT WINAPI
MediaFilter_GetState(IMediaFilter
*iface
, DWORD dwMsTimeout
, FILTER_STATE
* pState
)
4322 FIXME("(%d, %p): stub\n", dwMsTimeout
, pState
);
4327 static HRESULT WINAPI
MediaFilter_SetSyncSource(IMediaFilter
*iface
, IReferenceClock
*pClock
)
4329 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4333 TRACE("(%p/%p)->(%p)\n", iface
, This
, pClock
);
4335 EnterCriticalSection(&This
->cs
);
4337 for (i
= 0;i
< This
->nFilters
;i
++)
4339 hr
= IBaseFilter_SetSyncSource(This
->ppFiltersInGraph
[i
], pClock
);
4347 IBaseFilter_SetSyncSource(This
->ppFiltersInGraph
[i
], This
->refClock
);
4352 IReferenceClock_Release(This
->refClock
);
4353 This
->refClock
= pClock
;
4355 IReferenceClock_AddRef(This
->refClock
);
4357 if (This
->HandleEcClockChanged
)
4359 IMediaEventSink
*pEventSink
;
4362 eshr
= IMediaFilter_QueryInterface(iface
, &IID_IMediaEventSink
, (LPVOID
)&pEventSink
);
4363 if (SUCCEEDED(eshr
))
4365 IMediaEventSink_Notify(pEventSink
, EC_CLOCK_CHANGED
, 0, 0);
4366 IMediaEventSink_Release(pEventSink
);
4371 LeaveCriticalSection(&This
->cs
);
4376 static HRESULT WINAPI
MediaFilter_GetSyncSource(IMediaFilter
*iface
, IReferenceClock
**ppClock
)
4378 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4380 TRACE("(%p/%p)->(%p)\n", iface
, This
, ppClock
);
4385 EnterCriticalSection(&This
->cs
);
4387 *ppClock
= This
->refClock
;
4389 IReferenceClock_AddRef(*ppClock
);
4391 LeaveCriticalSection(&This
->cs
);
4396 static const IMediaFilterVtbl IMediaFilter_VTable
=
4398 MediaFilter_QueryInterface
,
4400 MediaFilter_Release
,
4401 MediaFilter_GetClassID
,
4405 MediaFilter_GetState
,
4406 MediaFilter_SetSyncSource
,
4407 MediaFilter_GetSyncSource
4410 static HRESULT WINAPI
MediaEventSink_QueryInterface(IMediaEventSink
*iface
, REFIID riid
, LPVOID
*ppv
)
4412 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4414 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4417 static ULONG WINAPI
MediaEventSink_AddRef(IMediaEventSink
*iface
)
4419 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4421 return Filtergraph_AddRef(This
);
4424 static ULONG WINAPI
MediaEventSink_Release(IMediaEventSink
*iface
)
4426 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4428 return Filtergraph_Release(This
);
4431 static HRESULT WINAPI
MediaEventSink_Notify(IMediaEventSink
*iface
, long EventCode
, LONG_PTR EventParam1
, LONG_PTR EventParam2
)
4433 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4436 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This
, iface
, EventCode
, EventParam1
, EventParam2
);
4438 /* We need thread safety here, let's use the events queue's one */
4439 EnterCriticalSection(&This
->evqueue
.msg_crst
);
4441 if ((EventCode
== EC_COMPLETE
) && This
->HandleEcComplete
)
4443 TRACE("Process EC_COMPLETE notification\n");
4444 if (++This
->EcCompleteCount
== This
->nRenderers
)
4446 evt
.lEventCode
= EC_COMPLETE
;
4449 TRACE("Send EC_COMPLETE to app\n");
4450 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4451 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4453 TRACE("Send Window message\n");
4454 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4456 This
->CompletionStatus
= EC_COMPLETE
;
4457 SetEvent(This
->hEventCompletion
);
4460 else if ((EventCode
== EC_REPAINT
) && This
->HandleEcRepaint
)
4462 /* FIXME: Not handled yet */
4466 evt
.lEventCode
= EventCode
;
4467 evt
.lParam1
= EventParam1
;
4468 evt
.lParam2
= EventParam2
;
4469 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4470 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4471 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4474 LeaveCriticalSection(&This
->evqueue
.msg_crst
);
4478 static const IMediaEventSinkVtbl IMediaEventSink_VTable
=
4480 MediaEventSink_QueryInterface
,
4481 MediaEventSink_AddRef
,
4482 MediaEventSink_Release
,
4483 MediaEventSink_Notify
4486 static HRESULT WINAPI
GraphConfig_QueryInterface(IGraphConfig
*iface
, REFIID riid
, LPVOID
*ppv
)
4488 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4490 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4493 static ULONG WINAPI
GraphConfig_AddRef(IGraphConfig
*iface
)
4495 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4497 return Filtergraph_AddRef(This
);
4500 static ULONG WINAPI
GraphConfig_Release(IGraphConfig
*iface
)
4502 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4504 return Filtergraph_Release(This
);
4507 static HRESULT WINAPI
GraphConfig_Reconnect(IGraphConfig
*iface
,
4510 const AM_MEDIA_TYPE
* pmtFirstConnection
,
4511 IBaseFilter
* pUsingFilter
,
4515 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4517 FIXME("(%p)->(%p, %p, %p, %p, %p, %x): stub!\n", This
, pOutputPin
, pInputPin
, pmtFirstConnection
, pUsingFilter
, hAbortEvent
, dwFlags
);
4522 static HRESULT WINAPI
GraphConfig_Reconfigure(IGraphConfig
*iface
,
4523 IGraphConfigCallback
* pCallback
,
4528 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4530 FIXME("(%p)->(%p, %p, %x, %p): stub!\n", This
, pCallback
, pvContext
, dwFlags
, hAbortEvent
);
4535 static HRESULT WINAPI
GraphConfig_AddFilterToCache(IGraphConfig
*iface
,
4536 IBaseFilter
* pFilter
)
4538 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4540 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4545 static HRESULT WINAPI
GraphConfig_EnumCacheFilter(IGraphConfig
*iface
,
4546 IEnumFilters
** pEnum
)
4548 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4550 FIXME("(%p)->(%p): stub!\n", This
, pEnum
);
4555 static HRESULT WINAPI
GraphConfig_RemoveFilterFromCache(IGraphConfig
*iface
,
4556 IBaseFilter
* pFilter
)
4558 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4560 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4565 static HRESULT WINAPI
GraphConfig_GetStartTime(IGraphConfig
*iface
,
4566 REFERENCE_TIME
* prtStart
)
4568 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4570 FIXME("(%p)->(%p): stub!\n", This
, prtStart
);
4575 static HRESULT WINAPI
GraphConfig_PushThroughData(IGraphConfig
*iface
,
4577 IPinConnection
* pConnection
,
4580 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4582 FIXME("(%p)->(%p, %p, %p): stub!\n", This
, pOutputPin
, pConnection
, hEventAbort
);
4587 static HRESULT WINAPI
GraphConfig_SetFilterFlags(IGraphConfig
*iface
,
4588 IBaseFilter
* pFilter
,
4591 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4593 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4598 static HRESULT WINAPI
GraphConfig_GetFilterFlags(IGraphConfig
*iface
,
4599 IBaseFilter
* pFilter
,
4602 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4604 FIXME("(%p)->(%p, %p): stub!\n", This
, pFilter
, dwFlags
);
4609 static HRESULT WINAPI
GraphConfig_RemoveFilterEx(IGraphConfig
*iface
,
4610 IBaseFilter
* pFilter
,
4613 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4615 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4620 static const IGraphConfigVtbl IGraphConfig_VTable
=
4622 GraphConfig_QueryInterface
,
4624 GraphConfig_Release
,
4625 GraphConfig_Reconnect
,
4626 GraphConfig_Reconfigure
,
4627 GraphConfig_AddFilterToCache
,
4628 GraphConfig_EnumCacheFilter
,
4629 GraphConfig_RemoveFilterFromCache
,
4630 GraphConfig_GetStartTime
,
4631 GraphConfig_PushThroughData
,
4632 GraphConfig_SetFilterFlags
,
4633 GraphConfig_GetFilterFlags
,
4634 GraphConfig_RemoveFilterEx
4637 static const IUnknownVtbl IInner_VTable
=
4639 FilterGraphInner_QueryInterface
,
4640 FilterGraphInner_AddRef
,
4641 FilterGraphInner_Release
4644 static HRESULT WINAPI
Filtergraph_QueryInterface(IFilterGraphImpl
*This
,
4647 if (This
->bAggregatable
)
4648 This
->bUnkOuterValid
= TRUE
;
4650 if (This
->pUnkOuter
)
4652 if (This
->bAggregatable
)
4653 return IUnknown_QueryInterface(This
->pUnkOuter
, riid
, ppv
);
4655 if (IsEqualIID(riid
, &IID_IUnknown
))
4659 IUnknown_AddRef((IUnknown
*)&(This
->IInner_vtbl
));
4660 hr
= IUnknown_QueryInterface((IUnknown
*)&(This
->IInner_vtbl
), riid
, ppv
);
4661 IUnknown_Release((IUnknown
*)&(This
->IInner_vtbl
));
4662 This
->bAggregatable
= TRUE
;
4667 return E_NOINTERFACE
;
4670 return IUnknown_QueryInterface((IUnknown
*)&(This
->IInner_vtbl
), riid
, ppv
);
4673 static ULONG WINAPI
Filtergraph_AddRef(IFilterGraphImpl
*This
) {
4674 if (This
->pUnkOuter
&& This
->bUnkOuterValid
)
4675 return IUnknown_AddRef(This
->pUnkOuter
);
4676 return IUnknown_AddRef((IUnknown
*)&(This
->IInner_vtbl
));
4679 static ULONG WINAPI
Filtergraph_Release(IFilterGraphImpl
*This
) {
4680 if (This
->pUnkOuter
&& This
->bUnkOuterValid
)
4681 return IUnknown_Release(This
->pUnkOuter
);
4682 return IUnknown_Release((IUnknown
*)&(This
->IInner_vtbl
));
4685 /* This is the only function that actually creates a FilterGraph class... */
4686 HRESULT
FilterGraph_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4688 IFilterGraphImpl
*fimpl
;
4691 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
4695 fimpl
= CoTaskMemAlloc(sizeof(*fimpl
));
4696 fimpl
->pUnkOuter
= pUnkOuter
;
4697 fimpl
->bUnkOuterValid
= FALSE
;
4698 fimpl
->bAggregatable
= FALSE
;
4699 fimpl
->IInner_vtbl
= &IInner_VTable
;
4700 fimpl
->IFilterGraph2_vtbl
= &IFilterGraph2_VTable
;
4701 fimpl
->IMediaControl_vtbl
= &IMediaControl_VTable
;
4702 fimpl
->IMediaSeeking_vtbl
= &IMediaSeeking_VTable
;
4703 fimpl
->IBasicAudio_vtbl
= &IBasicAudio_VTable
;
4704 fimpl
->IBasicVideo_vtbl
= &IBasicVideo_VTable
;
4705 fimpl
->IVideoWindow_vtbl
= &IVideoWindow_VTable
;
4706 fimpl
->IMediaEventEx_vtbl
= &IMediaEventEx_VTable
;
4707 fimpl
->IMediaFilter_vtbl
= &IMediaFilter_VTable
;
4708 fimpl
->IMediaEventSink_vtbl
= &IMediaEventSink_VTable
;
4709 fimpl
->IGraphConfig_vtbl
= &IGraphConfig_VTable
;
4710 fimpl
->IMediaPosition_vtbl
= &IMediaPosition_VTable
;
4712 fimpl
->ppFiltersInGraph
= NULL
;
4713 fimpl
->pFilterNames
= NULL
;
4714 fimpl
->nFilters
= 0;
4715 fimpl
->filterCapacity
= 0;
4716 fimpl
->nameIndex
= 1;
4717 fimpl
->refClock
= NULL
;
4718 fimpl
->hEventCompletion
= CreateEventW(0, TRUE
, FALSE
, 0);
4719 fimpl
->HandleEcComplete
= TRUE
;
4720 fimpl
->HandleEcRepaint
= TRUE
;
4721 fimpl
->HandleEcClockChanged
= TRUE
;
4722 fimpl
->notif
.hWnd
= 0;
4723 fimpl
->notif
.disabled
= FALSE
;
4724 fimpl
->nRenderers
= 0;
4725 fimpl
->EcCompleteCount
= 0;
4726 fimpl
->state
= State_Stopped
;
4727 EventsQueue_Init(&fimpl
->evqueue
);
4728 InitializeCriticalSection(&fimpl
->cs
);
4729 fimpl
->cs
.DebugInfo
->Spare
[0] = (DWORD_PTR
)(__FILE__
": IFilterGraphImpl.cs");
4730 fimpl
->nItfCacheEntries
= 0;
4732 hr
= CoCreateInstance(&CLSID_FilterMapper2
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IFilterMapper2
, (LPVOID
*)&fimpl
->pFilterMapper2
);
4734 ERR("Unable to create filter mapper (%x)\n", hr
);
4742 HRESULT
FilterGraphNoThread_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4744 FIXME("CLSID_FilterGraphNoThread partially implemented - Forwarding to CLSID_FilterGraph\n");
4745 return FilterGraph_create(pUnkOuter
, ppObj
);