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
, 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 IGraphBuilderVtbl
*IGraphBuilder_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 /* 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
;
195 ITF_CACHE_ENTRY ItfCacheEntries
[MAX_ITF_CACHE_ENTRIES
];
196 int nItfCacheEntries
;
200 static HRESULT
Filtergraph_QueryInterface(IFilterGraphImpl
*This
,
203 TRACE("(%p)->(%s (%p), %p)\n", This
, debugstr_guid(riid
), riid
, ppvObj
);
205 if (IsEqualGUID(&IID_IUnknown
, riid
) ||
206 IsEqualGUID(&IID_IFilterGraph
, riid
) ||
207 IsEqualGUID(&IID_IGraphBuilder
, riid
)) {
208 *ppvObj
= &(This
->IGraphBuilder_vtbl
);
209 TRACE(" returning IGraphBuilder interface (%p)\n", *ppvObj
);
210 } else if (IsEqualGUID(&IID_IMediaControl
, riid
)) {
211 *ppvObj
= &(This
->IMediaControl_vtbl
);
212 TRACE(" returning IMediaControl interface (%p)\n", *ppvObj
);
213 } else if (IsEqualGUID(&IID_IMediaSeeking
, riid
)) {
214 *ppvObj
= &(This
->IMediaSeeking_vtbl
);
215 TRACE(" returning IMediaSeeking interface (%p)\n", *ppvObj
);
216 } else if (IsEqualGUID(&IID_IBasicAudio
, riid
)) {
217 *ppvObj
= &(This
->IBasicAudio_vtbl
);
218 TRACE(" returning IBasicAudio interface (%p)\n", *ppvObj
);
219 } else if (IsEqualGUID(&IID_IBasicVideo
, riid
)) {
220 *ppvObj
= &(This
->IBasicVideo_vtbl
);
221 TRACE(" returning IBasicVideo interface (%p)\n", *ppvObj
);
222 } else if (IsEqualGUID(&IID_IVideoWindow
, riid
)) {
223 *ppvObj
= &(This
->IVideoWindow_vtbl
);
224 TRACE(" returning IVideoWindow interface (%p)\n", *ppvObj
);
225 } else if (IsEqualGUID(&IID_IMediaEvent
, riid
) ||
226 IsEqualGUID(&IID_IMediaEventEx
, riid
)) {
227 *ppvObj
= &(This
->IMediaEventEx_vtbl
);
228 TRACE(" returning IMediaEvent(Ex) interface (%p)\n", *ppvObj
);
229 } else if (IsEqualGUID(&IID_IMediaFilter
, riid
) ||
230 IsEqualGUID(&IID_IPersist
, riid
)) {
231 *ppvObj
= &(This
->IMediaFilter_vtbl
);
232 TRACE(" returning IMediaFilter interface (%p)\n", *ppvObj
);
233 } else if (IsEqualGUID(&IID_IMediaEventSink
, riid
)) {
234 *ppvObj
= &(This
->IMediaEventSink_vtbl
);
235 TRACE(" returning IMediaEventSink interface (%p)\n", *ppvObj
);
236 } else if (IsEqualGUID(&IID_IGraphConfig
, riid
)) {
237 *ppvObj
= &(This
->IGraphConfig_vtbl
);
238 TRACE(" returning IGraphConfig interface (%p)\n", *ppvObj
);
239 } else if (IsEqualGUID(&IID_IMediaPosition
, riid
)) {
240 *ppvObj
= &(This
->IMediaPosition_vtbl
);
241 TRACE(" returning IMediaPosition interface (%p)\n", *ppvObj
);
244 FIXME("unknown interface %s\n", debugstr_guid(riid
));
245 return E_NOINTERFACE
;
248 InterlockedIncrement(&This
->ref
);
252 static ULONG
Filtergraph_AddRef(IFilterGraphImpl
*This
) {
253 ULONG ref
= InterlockedIncrement(&This
->ref
);
255 TRACE("(%p)->(): new ref = %d\n", This
, ref
);
260 static ULONG
Filtergraph_Release(IFilterGraphImpl
*This
) {
261 ULONG ref
= InterlockedDecrement(&This
->ref
);
263 TRACE("(%p)->(): new ref = %d\n", This
, ref
);
269 IReferenceClock_Release(This
->refClock
);
271 for (i
= 0; i
< This
->nFilters
; i
++)
273 IBaseFilter_SetSyncSource(This
->ppFiltersInGraph
[i
], NULL
);
274 IBaseFilter_Release(This
->ppFiltersInGraph
[i
]);
276 for (i
= 0; i
< This
->nItfCacheEntries
; i
++)
277 IUnknown_Release(This
->ItfCacheEntries
[i
].iface
);
278 IFilterMapper2_Release(This
->pFilterMapper2
);
279 CloseHandle(This
->hEventCompletion
);
280 EventsQueue_Destroy(&This
->evqueue
);
281 This
->cs
.DebugInfo
->Spare
[0] = 0;
282 DeleteCriticalSection(&This
->cs
);
283 CoTaskMemFree(This
->ppFiltersInGraph
);
284 CoTaskMemFree(This
->pFilterNames
);
291 /*** IUnknown methods ***/
292 static HRESULT WINAPI
GraphBuilder_QueryInterface(IGraphBuilder
*iface
,
295 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
297 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
298 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
301 static ULONG WINAPI
GraphBuilder_AddRef(IGraphBuilder
*iface
) {
302 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
304 TRACE("(%p/%p)->() calling FilterGraph AddRef\n", This
, iface
);
306 return Filtergraph_AddRef(This
);
309 static ULONG WINAPI
GraphBuilder_Release(IGraphBuilder
*iface
) {
310 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
312 TRACE("(%p/%p)->() calling FilterGraph Release\n", This
, iface
);
314 return Filtergraph_Release(This
);
317 /*** IFilterGraph methods ***/
318 static HRESULT WINAPI
GraphBuilder_AddFilter(IGraphBuilder
*iface
,
319 IBaseFilter
*pFilter
,
321 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
324 WCHAR
* wszFilterName
= NULL
;
325 int duplicate_name
= FALSE
;
327 TRACE("(%p/%p)->(%p, %s (%p))\n", This
, iface
, pFilter
, debugstr_w(pName
), pName
);
329 wszFilterName
= (WCHAR
*) CoTaskMemAlloc( (pName
? strlenW(pName
) + 6 : 5) * sizeof(WCHAR
) );
333 /* Check if name already exists */
334 for(i
= 0; i
< This
->nFilters
; i
++)
335 if (!strcmpW(This
->pFilterNames
[i
], pName
))
337 duplicate_name
= TRUE
;
342 /* If no name given or name already existing, generate one */
343 if (!pName
|| duplicate_name
)
345 static const WCHAR wszFmt1
[] = {'%','s',' ','%','0','4','d',0};
346 static const WCHAR wszFmt2
[] = {'%','0','4','d',0};
348 for (j
= 0; j
< 10000 ; j
++)
352 sprintfW(wszFilterName
, wszFmt1
, pName
, This
->nameIndex
);
354 sprintfW(wszFilterName
, wszFmt2
, This
->nameIndex
);
355 TRACE("Generated name %s\n", debugstr_w(wszFilterName
));
357 /* Check if the generated name already exists */
358 for(i
= 0; i
< This
->nFilters
; i
++)
359 if (!strcmpW(This
->pFilterNames
[i
], wszFilterName
))
362 /* Compute next index and exit if generated name is suitable */
363 if (This
->nameIndex
++ == 10000)
365 if (i
== This
->nFilters
)
368 /* Unable to find a suitable name */
371 CoTaskMemFree(wszFilterName
);
372 return VFW_E_DUPLICATE_NAME
;
376 memcpy(wszFilterName
, pName
, (strlenW(pName
) + 1) * sizeof(WCHAR
));
378 if (This
->nFilters
+ 1 > This
->filterCapacity
)
380 int newCapacity
= This
->filterCapacity
? 2 * This
->filterCapacity
: 1;
381 IBaseFilter
** ppNewFilters
= CoTaskMemAlloc(newCapacity
* sizeof(IBaseFilter
*));
382 LPWSTR
* pNewNames
= CoTaskMemAlloc(newCapacity
* sizeof(LPWSTR
));
383 memcpy(ppNewFilters
, This
->ppFiltersInGraph
, This
->nFilters
* sizeof(IBaseFilter
*));
384 memcpy(pNewNames
, This
->pFilterNames
, This
->nFilters
* sizeof(LPWSTR
));
385 if (!This
->filterCapacity
)
387 CoTaskMemFree(This
->ppFiltersInGraph
);
388 CoTaskMemFree(This
->pFilterNames
);
390 This
->ppFiltersInGraph
= ppNewFilters
;
391 This
->pFilterNames
= pNewNames
;
392 This
->filterCapacity
= newCapacity
;
395 hr
= IBaseFilter_JoinFilterGraph(pFilter
, (IFilterGraph
*)This
, wszFilterName
);
399 IBaseFilter_AddRef(pFilter
);
400 This
->ppFiltersInGraph
[This
->nFilters
] = pFilter
;
401 This
->pFilterNames
[This
->nFilters
] = wszFilterName
;
403 IBaseFilter_SetSyncSource(pFilter
, This
->refClock
);
406 CoTaskMemFree(wszFilterName
);
408 if (SUCCEEDED(hr
) && duplicate_name
)
409 return VFW_S_DUPLICATE_NAME
;
414 static HRESULT WINAPI
GraphBuilder_RemoveFilter(IGraphBuilder
*iface
,
415 IBaseFilter
*pFilter
) {
416 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
420 TRACE("(%p/%p)->(%p)\n", This
, iface
, pFilter
);
422 /* FIXME: check graph is stopped */
424 for (i
= 0; i
< This
->nFilters
; i
++)
426 if (This
->ppFiltersInGraph
[i
] == pFilter
)
428 IEnumPins
*penumpins
;
429 hr
= IBaseFilter_EnumPins(pFilter
, &penumpins
);
432 while(IEnumPins_Next(penumpins
, 1, &ppin
, NULL
) == S_OK
) {
433 IPin_Disconnect(ppin
);
436 IEnumPins_Release(penumpins
);
439 hr
= IBaseFilter_JoinFilterGraph(pFilter
, NULL
, This
->pFilterNames
[i
]);
442 IBaseFilter_SetSyncSource(pFilter
, NULL
);
443 IBaseFilter_Release(pFilter
);
444 CoTaskMemFree(This
->pFilterNames
[i
]);
445 memmove(This
->ppFiltersInGraph
+i
, This
->ppFiltersInGraph
+i
+1, sizeof(IBaseFilter
*)*(This
->nFilters
- 1 - i
));
446 memmove(This
->pFilterNames
+i
, This
->pFilterNames
+i
+1, sizeof(LPWSTR
)*(This
->nFilters
- 1 - i
));
448 /* Invalidate interfaces in the cache */
449 for (i
= 0; i
< This
->nItfCacheEntries
; i
++)
450 if (pFilter
== This
->ItfCacheEntries
[i
].filter
)
452 IUnknown_Release(This
->ItfCacheEntries
[i
].iface
);
453 This
->ItfCacheEntries
[i
].iface
= NULL
;
454 This
->ItfCacheEntries
[i
].filter
= NULL
;
462 return hr
; /* FIXME: check this error code */
465 static HRESULT WINAPI
GraphBuilder_EnumFilters(IGraphBuilder
*iface
,
466 IEnumFilters
**ppEnum
) {
467 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
469 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppEnum
);
471 return IEnumFiltersImpl_Construct(This
->ppFiltersInGraph
, This
->nFilters
, ppEnum
);
474 static HRESULT WINAPI
GraphBuilder_FindFilterByName(IGraphBuilder
*iface
,
476 IBaseFilter
**ppFilter
) {
477 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
480 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_w(pName
), pName
, ppFilter
);
484 for (i
= 0; i
< This
->nFilters
; i
++)
486 if (!strcmpW(pName
, This
->pFilterNames
[i
]))
488 *ppFilter
= This
->ppFiltersInGraph
[i
];
489 IBaseFilter_AddRef(*ppFilter
);
494 return E_FAIL
; /* FIXME: check this error code */
497 /* NOTE: despite the implication, it doesn't matter which
498 * way round you put in the input and output pins */
499 static HRESULT WINAPI
GraphBuilder_ConnectDirect(IGraphBuilder
*iface
,
502 const AM_MEDIA_TYPE
*pmt
) {
506 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
508 TRACE("(%p/%p)->(%p, %p, %p)\n", This
, iface
, ppinIn
, ppinOut
, pmt
);
510 /* FIXME: check pins are in graph */
512 if (TRACE_ON(quartz
))
516 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
520 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
521 IBaseFilter_Release(PinInfo
.pFilter
);
523 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
527 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
528 IBaseFilter_Release(PinInfo
.pFilter
);
531 hr
= IPin_QueryDirection(ppinIn
, &dir
);
534 if (dir
== PINDIR_INPUT
)
535 hr
= IPin_Connect(ppinOut
, ppinIn
, pmt
);
537 hr
= IPin_Connect(ppinIn
, ppinOut
, pmt
);
543 static HRESULT WINAPI
GraphBuilder_Reconnect(IGraphBuilder
*iface
,
545 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
546 IPin
*pConnectedTo
= NULL
;
548 PIN_DIRECTION pindir
;
550 IPin_QueryDirection(ppin
, &pindir
);
551 hr
= IPin_ConnectedTo(ppin
, &pConnectedTo
);
553 TRACE("Querying connected to failed: %x\n", hr
);
556 IPin_Disconnect(ppin
);
557 IPin_Disconnect(pConnectedTo
);
558 if (pindir
== PINDIR_INPUT
)
559 hr
= IPin_Connect(pConnectedTo
, ppin
, NULL
);
561 hr
= IPin_Connect(ppin
, pConnectedTo
, NULL
);
562 IPin_Release(pConnectedTo
);
564 ERR("Reconnecting pins failed, pins are not connected now..\n");
565 TRACE("(%p->%p) -- %p %p -> %x\n", iface
, This
, ppin
, pConnectedTo
, hr
);
569 static HRESULT WINAPI
GraphBuilder_Disconnect(IGraphBuilder
*iface
,
571 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
573 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppin
);
575 return IPin_Disconnect(ppin
);
578 static HRESULT WINAPI
GraphBuilder_SetDefaultSyncSource(IGraphBuilder
*iface
) {
579 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
581 TRACE("(%p/%p)->(): stub !!!\n", iface
, This
);
586 static HRESULT
GetFilterInfo(IMoniker
* pMoniker
, GUID
* pclsid
, VARIANT
* pvar
)
588 static const WCHAR wszClsidName
[] = {'C','L','S','I','D',0};
589 static const WCHAR wszFriendlyName
[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
590 IPropertyBag
* pPropBagCat
= NULL
;
594 V_VT(pvar
) = VT_BSTR
;
596 hr
= IMoniker_BindToStorage(pMoniker
, NULL
, NULL
, &IID_IPropertyBag
, (LPVOID
*)&pPropBagCat
);
599 hr
= IPropertyBag_Read(pPropBagCat
, wszClsidName
, pvar
, NULL
);
602 hr
= CLSIDFromString(V_UNION(pvar
, bstrVal
), pclsid
);
605 hr
= IPropertyBag_Read(pPropBagCat
, wszFriendlyName
, pvar
, NULL
);
608 TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid
), debugstr_w(V_UNION(pvar
, bstrVal
)));
611 IPropertyBag_Release(pPropBagCat
);
616 static HRESULT
GetInternalConnections(IBaseFilter
* pfilter
, IPin
* pinputpin
, IPin
*** pppins
, ULONG
* pnb
)
621 TRACE("(%p, %p, %p, %p)\n", pfilter
, pinputpin
, pppins
, pnb
);
622 hr
= IPin_QueryInternalConnections(pinputpin
, NULL
, &nb
);
625 } else if (hr
== S_FALSE
) {
626 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*nb
);
627 hr
= IPin_QueryInternalConnections(pinputpin
, *pppins
, &nb
);
629 ERR("Error (%x)\n", hr
);
631 } else if (hr
== E_NOTIMPL
) {
632 /* Input connected to all outputs */
633 IEnumPins
* penumpins
;
636 TRACE("E_NOTIMPL\n");
637 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
639 ERR("filter Enumpins failed (%x)\n", hr
);
643 /* Count output pins */
644 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
645 PIN_DIRECTION pindir
;
646 IPin_QueryDirection(ppin
, &pindir
);
647 if (pindir
== PINDIR_OUTPUT
)
651 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*i
);
652 /* Retrieve output pins */
653 IEnumPins_Reset(penumpins
);
655 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
656 PIN_DIRECTION pindir
;
657 IPin_QueryDirection(ppin
, &pindir
);
658 if (pindir
== PINDIR_OUTPUT
)
659 (*pppins
)[i
++] = ppin
;
663 IEnumPins_Release(penumpins
);
666 ERR("Next failed (%x)\n", hr
);
669 } else if (FAILED(hr
)) {
670 ERR("Cannot get internal connection (%x)\n", hr
);
678 /*** IGraphBuilder methods ***/
679 static HRESULT WINAPI
GraphBuilder_Connect(IGraphBuilder
*iface
,
682 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
685 IEnumMediaTypes
* penummt
;
687 IEnumPins
* penumpins
;
688 IEnumMoniker
* pEnumMoniker
;
696 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, ppinOut
, ppinIn
);
698 if (TRACE_ON(quartz
))
700 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
704 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
705 IBaseFilter_Release(PinInfo
.pFilter
);
707 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
711 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
712 IBaseFilter_Release(PinInfo
.pFilter
);
715 /* Try direct connection first */
716 hr
= IPin_Connect(ppinOut
, ppinIn
, NULL
);
720 TRACE("Direct connection failed, trying to insert other filters\n");
722 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
726 hr
= IBaseFilter_GetClassID(PinInfo
.pFilter
, &FilterCLSID
);
727 IBaseFilter_Release(PinInfo
.pFilter
);
731 /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream
732 * filter to the minor mediatype of input pin of the renderer */
733 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
735 ERR("EnumMediaTypes (%x)\n", hr
);
739 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
741 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
746 ERR("No media type found!\n");
749 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
750 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
752 /* Try to find a suitable filter that can connect to the pin to render */
753 tab
[0] = mt
->majortype
;
754 tab
[1] = mt
->subtype
;
755 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
757 ERR("Unable to enum filters (%x)\n", hr
);
761 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
766 IPin
* ppinfilter
= NULL
;
767 IBaseFilter
* pfilter
= NULL
;
769 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
770 IMoniker_Release(pMoniker
);
772 ERR("Unable to retrieve filter info (%x)\n", hr
);
776 if (IsEqualGUID(&clsid
, &FilterCLSID
)) {
777 /* Skip filter (same as the one the output pin belongs to) */
781 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
783 ERR("Unable to create filter (%x), trying next one\n", hr
);
787 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, V_UNION(&var
, bstrVal
));
789 ERR("Unable to add filter (%x)\n", hr
);
790 IBaseFilter_Release(pfilter
);
795 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
797 ERR("Enumpins (%x)\n", hr
);
801 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
802 IEnumPins_Release(penumpins
);
805 ERR("Next (%x)\n", hr
);
813 hr
= IPin_Connect(ppinOut
, ppinfilter
, NULL
);
815 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
818 TRACE("Successfully connected to filter, follow chain...\n");
820 /* Render all output pins of the filter by calling IGraphBuilder_Render on each of them */
821 hr
= GetInternalConnections(pfilter
, ppinfilter
, &ppins
, &nb
);
826 IPin_Disconnect(ppinOut
);
829 TRACE("pins to consider: %d\n", nb
);
830 for(i
= 0; i
< nb
; i
++) {
831 TRACE("Processing pin %d\n", i
);
832 hr
= IGraphBuilder_Connect(iface
, ppins
[i
], ppinIn
);
834 TRACE("Cannot render pin %p (%x)\n", ppinfilter
, hr
);
836 IPin_Release(ppins
[i
]);
837 if (SUCCEEDED(hr
)) break;
839 while (++i
< nb
) IPin_Release(ppins
[i
]);
840 CoTaskMemFree(ppins
);
841 IPin_Release(ppinfilter
);
842 IBaseFilter_Release(pfilter
);
847 if (ppinfilter
) IPin_Release(ppinfilter
);
849 IGraphBuilder_RemoveFilter(iface
, pfilter
);
850 IBaseFilter_Release(pfilter
);
854 IEnumMediaTypes_Release(penummt
);
860 static HRESULT WINAPI
GraphBuilder_Render(IGraphBuilder
*iface
,
862 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
863 IEnumMediaTypes
* penummt
;
868 IEnumMoniker
* pEnumMoniker
;
873 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppinOut
);
875 if (TRACE_ON(quartz
))
879 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
883 TRACE("Filter owning pin => %p\n", PinInfo
.pFilter
);
884 IBaseFilter_Release(PinInfo
.pFilter
);
887 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
889 ERR("EnumMediaTypes (%x)\n", hr
);
895 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
897 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
902 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
903 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
905 /* Try to find a suitable renderer with the same media type */
906 tab
[0] = mt
->majortype
;
908 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, TRUE
, FALSE
, 0, NULL
, NULL
, NULL
);
910 ERR("Unable to enum filters (%x)\n", hr
);
914 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
919 IBaseFilter
* pfilter
= NULL
;
920 IEnumPins
* penumpins
;
923 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
924 IMoniker_Release(pMoniker
);
926 ERR("Unable to retrieve filter info (%x)\n", hr
);
930 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
932 ERR("Unable to create filter (%x), trying next one\n", hr
);
936 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, V_UNION(&var
, bstrVal
));
938 ERR("Unable to add filter (%x)\n", hr
);
939 IBaseFilter_Release(pfilter
);
944 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
946 ERR("Splitter Enumpins (%x)\n", hr
);
949 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
950 IEnumPins_Release(penumpins
);
952 ERR("Next (%x)\n", hr
);
960 /* Connect the pin to render to the renderer */
961 hr
= IGraphBuilder_Connect(iface
, ppinOut
, ppinfilter
);
963 TRACE("Unable to connect to renderer (%x)\n", hr
);
964 IPin_Release(ppinfilter
);
967 IPin_Release(ppinfilter
);
968 IBaseFilter_Release(pfilter
);
974 IGraphBuilder_RemoveFilter(iface
, pfilter
);
975 IBaseFilter_Release(pfilter
);
983 IEnumMediaTypes_Release(penummt
);
988 static HRESULT WINAPI
GraphBuilder_RenderFile(IGraphBuilder
*iface
,
990 LPCWSTR lpcwstrPlayList
) {
991 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
992 static const WCHAR string
[] = {'R','e','a','d','e','r',0};
993 IBaseFilter
* preader
= NULL
;
994 IBaseFilter
* psplitter
= NULL
;
995 IPin
* ppinreader
= NULL
;
997 IEnumPins
* penumpins
;
1000 IEnumMoniker
* pEnumMoniker
= NULL
;
1002 IPin
** ppins
= NULL
;
1005 IFileSourceFilter
* pfile
= NULL
;
1009 TRACE("(%p/%p)->(%s, %s)\n", This
, iface
, debugstr_w(lpcwstrFile
), debugstr_w(lpcwstrPlayList
));
1011 if (lpcwstrPlayList
!= NULL
)
1012 return E_INVALIDARG
;
1014 hr
= IGraphBuilder_AddSourceFilter(iface
, lpcwstrFile
, string
, &preader
);
1016 /* Retrieve file media type */
1018 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1019 if (SUCCEEDED(hr
)) {
1020 hr
= IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1021 IFileSourceFilter_Release(pfile
);
1025 hr
= IBaseFilter_EnumPins(preader
, &penumpins
);
1026 if (SUCCEEDED(hr
)) {
1027 hr
= IEnumPins_Next(penumpins
, 1, &ppinreader
, &pin
);
1028 IEnumPins_Release(penumpins
);
1031 if (SUCCEEDED(hr
)) {
1032 tab
[0] = mt
.majortype
;
1033 tab
[1] = mt
.subtype
;
1034 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
1040 IPin_Release(ppinreader
);
1042 IEnumMoniker_Release(pEnumMoniker
);
1044 IGraphBuilder_RemoveFilter(iface
, preader
);
1045 IBaseFilter_Release(preader
);
1050 hr
= VFW_E_CANNOT_RENDER
;
1051 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
1056 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
1057 IMoniker_Release(pMoniker
);
1059 ERR("Unable to retrieve filter info (%x)\n", hr
);
1063 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&psplitter
);
1065 ERR("Unable to create filter (%x), trying next one\n", hr
);
1069 hr
= IGraphBuilder_AddFilter(iface
, psplitter
, V_UNION(&var
, bstrVal
));
1071 ERR("Unable add filter (%x)\n", hr
);
1072 IBaseFilter_Release(psplitter
);
1076 /* Connect file source and splitter filters together */
1077 /* Make the splitter analyze incoming data */
1079 hr
= IBaseFilter_EnumPins(psplitter
, &penumpins
);
1080 if (SUCCEEDED(hr
)) {
1081 hr
= IEnumPins_Next(penumpins
, 1, &ppinsplitter
, &pin
);
1082 IEnumPins_Release(penumpins
);
1086 hr
= IPin_Connect(ppinreader
, ppinsplitter
, NULL
);
1088 /* Make sure there's some output pins in the filter */
1090 hr
= GetInternalConnections(psplitter
, ppinsplitter
, &ppins
, &nb
);
1091 if (SUCCEEDED(hr
)) {
1093 IPin_Disconnect(ppinreader
);
1094 TRACE("No output pins found in filter\n");
1095 hr
= VFW_E_CANNOT_RENDER
;
1100 IPin_Release(ppinsplitter
);
1101 ppinsplitter
= NULL
;
1103 if (SUCCEEDED(hr
)) {
1104 TRACE("Successfully connected to filter\n");
1108 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
1111 CoTaskMemFree(ppins
);
1114 IGraphBuilder_RemoveFilter(iface
, psplitter
);
1115 IBaseFilter_Release(psplitter
);
1119 /* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
1120 if (SUCCEEDED(hr
)) {
1123 TRACE("pins to consider: %d\n", nb
);
1124 for(i
= 0; i
< nb
; i
++) {
1125 TRACE("Processing pin %d\n", i
);
1126 hr
= IGraphBuilder_Render(iface
, ppins
[i
]);
1128 ERR("Cannot render pin %p (%x)\n", ppins
[i
], hr
);
1131 IPin_Release(ppins
[i
]);
1133 CoTaskMemFree(ppins
);
1135 hr
= (partial
? VFW_S_PARTIAL_RENDER
: S_OK
);
1138 IPin_Release(ppinreader
);
1139 IBaseFilter_Release(preader
);
1141 IBaseFilter_Release(psplitter
);
1146 static HRESULT WINAPI
GraphBuilder_AddSourceFilter(IGraphBuilder
*iface
,
1147 LPCWSTR lpcwstrFileName
,
1148 LPCWSTR lpcwstrFilterName
,
1149 IBaseFilter
**ppFilter
) {
1150 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1152 IBaseFilter
* preader
;
1153 IFileSourceFilter
* pfile
= NULL
;
1157 TRACE("(%p/%p)->(%s, %s, %p)\n", This
, iface
, debugstr_w(lpcwstrFileName
), debugstr_w(lpcwstrFilterName
), ppFilter
);
1159 /* Instantiate a file source filter */
1160 hr
= CoCreateInstance(&CLSID_AsyncReader
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&preader
);
1162 ERR("Unable to create file source filter (%x)\n", hr
);
1166 hr
= IGraphBuilder_AddFilter(iface
, preader
, lpcwstrFilterName
);
1168 ERR("Unable add filter (%x)\n", hr
);
1169 IBaseFilter_Release(preader
);
1173 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1175 ERR("Unable to get IFileSourceInterface (%x)\n", hr
);
1179 /* Load the file in the file source filter */
1180 hr
= IFileSourceFilter_Load(pfile
, lpcwstrFileName
, NULL
);
1182 ERR("Load (%x)\n", hr
);
1186 IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1188 ERR("GetCurFile (%x)\n", hr
);
1191 TRACE("File %s\n", debugstr_w(filename
));
1192 TRACE("MajorType %s\n", debugstr_guid(&mt
.majortype
));
1193 TRACE("SubType %s\n", debugstr_guid(&mt
.subtype
));
1196 *ppFilter
= preader
;
1197 IFileSourceFilter_Release(pfile
);
1203 IFileSourceFilter_Release(pfile
);
1204 IGraphBuilder_RemoveFilter(iface
, preader
);
1205 IBaseFilter_Release(preader
);
1210 static HRESULT WINAPI
GraphBuilder_SetLogFile(IGraphBuilder
*iface
,
1212 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1214 TRACE("(%p/%p)->(%08x): stub !!!\n", This
, iface
, (DWORD
) hFile
);
1219 static HRESULT WINAPI
GraphBuilder_Abort(IGraphBuilder
*iface
) {
1220 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1222 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1227 static HRESULT WINAPI
GraphBuilder_ShouldOperationContinue(IGraphBuilder
*iface
) {
1228 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1230 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1236 static const IGraphBuilderVtbl IGraphBuilder_VTable
=
1238 GraphBuilder_QueryInterface
,
1239 GraphBuilder_AddRef
,
1240 GraphBuilder_Release
,
1241 GraphBuilder_AddFilter
,
1242 GraphBuilder_RemoveFilter
,
1243 GraphBuilder_EnumFilters
,
1244 GraphBuilder_FindFilterByName
,
1245 GraphBuilder_ConnectDirect
,
1246 GraphBuilder_Reconnect
,
1247 GraphBuilder_Disconnect
,
1248 GraphBuilder_SetDefaultSyncSource
,
1249 GraphBuilder_Connect
,
1250 GraphBuilder_Render
,
1251 GraphBuilder_RenderFile
,
1252 GraphBuilder_AddSourceFilter
,
1253 GraphBuilder_SetLogFile
,
1255 GraphBuilder_ShouldOperationContinue
1258 /*** IUnknown methods ***/
1259 static HRESULT WINAPI
MediaControl_QueryInterface(IMediaControl
*iface
,
1262 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1264 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1266 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1269 static ULONG WINAPI
MediaControl_AddRef(IMediaControl
*iface
) {
1270 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1272 TRACE("(%p/%p)->()\n", This
, iface
);
1274 return Filtergraph_AddRef(This
);
1277 static ULONG WINAPI
MediaControl_Release(IMediaControl
*iface
) {
1278 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1280 TRACE("(%p/%p)->()\n", This
, iface
);
1282 return Filtergraph_Release(This
);
1286 /*** IDispatch methods ***/
1287 static HRESULT WINAPI
MediaControl_GetTypeInfoCount(IMediaControl
*iface
,
1289 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1291 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1296 static HRESULT WINAPI
MediaControl_GetTypeInfo(IMediaControl
*iface
,
1299 ITypeInfo
**ppTInfo
) {
1300 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1302 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1307 static HRESULT WINAPI
MediaControl_GetIDsOfNames(IMediaControl
*iface
,
1313 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1315 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1320 static HRESULT WINAPI
MediaControl_Invoke(IMediaControl
*iface
,
1321 DISPID dispIdMember
,
1325 DISPPARAMS
*pDispParams
,
1327 EXCEPINFO
*pExepInfo
,
1329 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1331 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
);
1336 typedef HRESULT(WINAPI
*fnFoundFilter
)(IBaseFilter
*);
1338 static HRESULT
ExploreGraph(IFilterGraphImpl
* pGraph
, IPin
* pOutputPin
, fnFoundFilter FoundFilter
)
1347 TRACE("%p %p\n", pGraph
, pOutputPin
);
1348 PinInfo
.pFilter
= NULL
;
1350 hr
= IPin_ConnectedTo(pOutputPin
, &pInputPin
);
1354 hr
= IPin_QueryPinInfo(pInputPin
, &PinInfo
);
1356 hr
= GetInternalConnections(PinInfo
.pFilter
, pInputPin
, &ppPins
, &nb
);
1357 IPin_Release(pInputPin
);
1364 TRACE("Reached a renderer\n");
1365 /* Count renderers for end of stream notification */
1366 pGraph
->nRenderers
++;
1370 for(i
= 0; i
< nb
; i
++)
1372 /* Explore the graph downstream from this pin
1373 * FIXME: We should prevent exploring from a pin more than once. This can happens when
1374 * several input pins are connected to the same output (a MUX for instance). */
1375 ExploreGraph(pGraph
, ppPins
[i
], FoundFilter
);
1376 IPin_Release(ppPins
[i
]);
1379 CoTaskMemFree(ppPins
);
1381 TRACE("Doing stuff with filter %p\n", PinInfo
.pFilter
);
1382 FoundFilter(PinInfo
.pFilter
);
1385 if (PinInfo
.pFilter
) IBaseFilter_Release(PinInfo
.pFilter
);
1389 static HRESULT WINAPI
SendRun(IBaseFilter
*pFilter
) {
1390 return IBaseFilter_Run(pFilter
, 0);
1393 static HRESULT WINAPI
SendPause(IBaseFilter
*pFilter
) {
1394 return IBaseFilter_Pause(pFilter
);
1397 static HRESULT WINAPI
SendStop(IBaseFilter
*pFilter
) {
1398 return IBaseFilter_Stop(pFilter
);
1401 static HRESULT
SendFilterMessage(IMediaControl
*iface
, fnFoundFilter FoundFilter
) {
1402 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1404 IBaseFilter
* pfilter
;
1410 TRACE("(%p/%p)->()\n", This
, iface
);
1412 /* Explorer the graph from source filters to renderers, determine renderers
1413 * number and run filters from renderers to source filters */
1414 This
->nRenderers
= 0;
1415 ResetEvent(This
->hEventCompletion
);
1417 for(i
= 0; i
< This
->nFilters
; i
++)
1420 pfilter
= This
->ppFiltersInGraph
[i
];
1421 hr
= IBaseFilter_EnumPins(pfilter
, &pEnum
);
1424 ERR("Enum pins failed %x\n", hr
);
1427 /* Check if it is a source filter */
1428 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1430 IPin_QueryDirection(pPin
, &dir
);
1432 if (dir
== PINDIR_INPUT
)
1440 TRACE("Found a source filter %p\n", pfilter
);
1441 IEnumPins_Reset(pEnum
);
1442 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1444 /* Explore the graph downstream from this pin */
1445 ExploreGraph(This
, pPin
, FoundFilter
);
1448 FoundFilter(pfilter
);
1450 IEnumPins_Release(pEnum
);
1456 /*** IMediaControl methods ***/
1457 static HRESULT WINAPI
MediaControl_Run(IMediaControl
*iface
) {
1458 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1459 TRACE("(%p/%p)->()\n", This
, iface
);
1461 if (This
->state
== State_Running
) return S_OK
;
1463 EnterCriticalSection(&This
->cs
);
1464 SendFilterMessage(iface
, SendRun
);
1465 This
->state
= State_Running
;
1466 LeaveCriticalSection(&This
->cs
);
1470 static HRESULT WINAPI
MediaControl_Pause(IMediaControl
*iface
) {
1471 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1472 TRACE("(%p/%p)->()\n", This
, iface
);
1474 if (This
->state
== State_Paused
) return S_OK
;
1476 EnterCriticalSection(&This
->cs
);
1477 SendFilterMessage(iface
, SendPause
);
1478 This
->state
= State_Paused
;
1479 LeaveCriticalSection(&This
->cs
);
1483 static HRESULT WINAPI
MediaControl_Stop(IMediaControl
*iface
) {
1484 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1485 TRACE("(%p/%p)->()\n", This
, iface
);
1487 if (This
->state
== State_Stopped
) return S_OK
;
1489 EnterCriticalSection(&This
->cs
);
1490 if (This
->state
== State_Running
) SendFilterMessage(iface
, SendPause
);
1491 SendFilterMessage(iface
, SendStop
);
1492 This
->state
= State_Stopped
;
1493 LeaveCriticalSection(&This
->cs
);
1497 static HRESULT WINAPI
MediaControl_GetState(IMediaControl
*iface
,
1499 OAFilterState
*pfs
) {
1500 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1502 TRACE("(%p/%p)->(%d, %p): semi-stub !!!\n", This
, iface
, msTimeout
, pfs
);
1504 EnterCriticalSection(&This
->cs
);
1508 LeaveCriticalSection(&This
->cs
);
1513 static HRESULT WINAPI
MediaControl_RenderFile(IMediaControl
*iface
,
1515 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1517 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
);
1522 static HRESULT WINAPI
MediaControl_AddSourceFilter(IMediaControl
*iface
,
1524 IDispatch
**ppUnk
) {
1525 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1527 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
, ppUnk
);
1532 static HRESULT WINAPI
MediaControl_get_FilterCollection(IMediaControl
*iface
,
1533 IDispatch
**ppUnk
) {
1534 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1536 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1541 static HRESULT WINAPI
MediaControl_get_RegFilterCollection(IMediaControl
*iface
,
1542 IDispatch
**ppUnk
) {
1543 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1545 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1550 static HRESULT WINAPI
MediaControl_StopWhenReady(IMediaControl
*iface
) {
1551 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1553 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1559 static const IMediaControlVtbl IMediaControl_VTable
=
1561 MediaControl_QueryInterface
,
1562 MediaControl_AddRef
,
1563 MediaControl_Release
,
1564 MediaControl_GetTypeInfoCount
,
1565 MediaControl_GetTypeInfo
,
1566 MediaControl_GetIDsOfNames
,
1567 MediaControl_Invoke
,
1571 MediaControl_GetState
,
1572 MediaControl_RenderFile
,
1573 MediaControl_AddSourceFilter
,
1574 MediaControl_get_FilterCollection
,
1575 MediaControl_get_RegFilterCollection
,
1576 MediaControl_StopWhenReady
1580 /*** IUnknown methods ***/
1581 static HRESULT WINAPI
MediaSeeking_QueryInterface(IMediaSeeking
*iface
,
1584 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1586 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1588 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1591 static ULONG WINAPI
MediaSeeking_AddRef(IMediaSeeking
*iface
) {
1592 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1594 TRACE("(%p/%p)->()\n", This
, iface
);
1596 return Filtergraph_AddRef(This
);
1599 static ULONG WINAPI
MediaSeeking_Release(IMediaSeeking
*iface
) {
1600 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1602 TRACE("(%p/%p)->()\n", This
, iface
);
1604 return Filtergraph_Release(This
);
1607 /*** IMediaSeeking methods ***/
1608 static HRESULT WINAPI
MediaSeeking_GetCapabilities(IMediaSeeking
*iface
,
1609 DWORD
*pCapabilities
) {
1610 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1612 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1617 static HRESULT WINAPI
MediaSeeking_CheckCapabilities(IMediaSeeking
*iface
,
1618 DWORD
*pCapabilities
) {
1619 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1621 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1626 static HRESULT WINAPI
MediaSeeking_IsFormatSupported(IMediaSeeking
*iface
,
1627 const GUID
*pFormat
) {
1628 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1630 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1635 static HRESULT WINAPI
MediaSeeking_QueryPreferredFormat(IMediaSeeking
*iface
,
1637 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1639 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1644 static HRESULT WINAPI
MediaSeeking_GetTimeFormat(IMediaSeeking
*iface
,
1646 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1648 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1653 static HRESULT WINAPI
MediaSeeking_IsUsingTimeFormat(IMediaSeeking
*iface
,
1654 const GUID
*pFormat
) {
1655 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1657 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1662 static HRESULT WINAPI
MediaSeeking_SetTimeFormat(IMediaSeeking
*iface
,
1663 const GUID
*pFormat
) {
1664 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1666 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1671 static HRESULT WINAPI
MediaSeeking_GetDuration(IMediaSeeking
*iface
,
1672 LONGLONG
*pDuration
) {
1673 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1675 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDuration
);
1680 static HRESULT WINAPI
MediaSeeking_GetStopPosition(IMediaSeeking
*iface
,
1682 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1684 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pStop
);
1689 static HRESULT WINAPI
MediaSeeking_GetCurrentPosition(IMediaSeeking
*iface
,
1690 LONGLONG
*pCurrent
) {
1691 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1693 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCurrent
);
1698 static HRESULT WINAPI
MediaSeeking_ConvertTimeFormat(IMediaSeeking
*iface
,
1700 const GUID
*pTargetFormat
,
1702 const GUID
*pSourceFormat
) {
1703 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1705 TRACE("(%p/%p)->(%p, %p, 0x%s, %p): stub !!!\n", This
, iface
, pTarget
,
1706 pTargetFormat
, wine_dbgstr_longlong(Source
), pSourceFormat
);
1711 static HRESULT WINAPI
MediaSeeking_SetPositions(IMediaSeeking
*iface
,
1713 DWORD dwCurrentFlags
,
1715 DWORD dwStopFlags
) {
1716 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1718 TRACE("(%p/%p)->(%p, %08x, %p, %08x): stub !!!\n", This
, iface
, pCurrent
, dwCurrentFlags
, pStop
, dwStopFlags
);
1723 static HRESULT WINAPI
MediaSeeking_GetPositions(IMediaSeeking
*iface
,
1726 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1728 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pCurrent
, pStop
);
1733 static HRESULT WINAPI
MediaSeeking_GetAvailable(IMediaSeeking
*iface
,
1734 LONGLONG
*pEarliest
,
1735 LONGLONG
*pLatest
) {
1736 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1738 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pEarliest
, pLatest
);
1743 static HRESULT WINAPI
MediaSeeking_SetRate(IMediaSeeking
*iface
,
1745 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1747 TRACE("(%p/%p)->(%f): stub !!!\n", This
, iface
, dRate
);
1752 static HRESULT WINAPI
MediaSeeking_GetRate(IMediaSeeking
*iface
,
1754 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1756 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pdRate
);
1761 static HRESULT WINAPI
MediaSeeking_GetPreroll(IMediaSeeking
*iface
,
1762 LONGLONG
*pllPreroll
) {
1763 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1765 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pllPreroll
);
1771 static const IMediaSeekingVtbl IMediaSeeking_VTable
=
1773 MediaSeeking_QueryInterface
,
1774 MediaSeeking_AddRef
,
1775 MediaSeeking_Release
,
1776 MediaSeeking_GetCapabilities
,
1777 MediaSeeking_CheckCapabilities
,
1778 MediaSeeking_IsFormatSupported
,
1779 MediaSeeking_QueryPreferredFormat
,
1780 MediaSeeking_GetTimeFormat
,
1781 MediaSeeking_IsUsingTimeFormat
,
1782 MediaSeeking_SetTimeFormat
,
1783 MediaSeeking_GetDuration
,
1784 MediaSeeking_GetStopPosition
,
1785 MediaSeeking_GetCurrentPosition
,
1786 MediaSeeking_ConvertTimeFormat
,
1787 MediaSeeking_SetPositions
,
1788 MediaSeeking_GetPositions
,
1789 MediaSeeking_GetAvailable
,
1790 MediaSeeking_SetRate
,
1791 MediaSeeking_GetRate
,
1792 MediaSeeking_GetPreroll
1795 /*** IUnknown methods ***/
1796 static HRESULT WINAPI
MediaPosition_QueryInterface(IMediaPosition
* iface
, REFIID riid
, void** ppvObj
){
1797 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1799 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1801 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1804 static ULONG WINAPI
MediaPosition_AddRef(IMediaPosition
*iface
){
1805 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1807 TRACE("(%p/%p)->()\n", This
, iface
);
1809 return Filtergraph_AddRef(This
);
1812 static ULONG WINAPI
MediaPosition_Release(IMediaPosition
*iface
){
1813 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1815 TRACE("(%p/%p)->()\n", This
, iface
);
1817 return Filtergraph_Release(This
);
1820 /*** IDispatch methods ***/
1821 static HRESULT WINAPI
MediaPosition_GetTypeInfoCount(IMediaPosition
*iface
, UINT
* pctinfo
){
1822 FIXME("(%p) stub!\n", iface
);
1826 static HRESULT WINAPI
MediaPosition_GetTypeInfo(IMediaPosition
*iface
, UINT iTInfo
, LCID lcid
, ITypeInfo
** ppTInfo
){
1827 FIXME("(%p) stub!\n", iface
);
1831 static HRESULT WINAPI
MediaPosition_GetIDsOfNames(IMediaPosition
* iface
, REFIID riid
, LPOLESTR
* rgszNames
, UINT cNames
, LCID lcid
, DISPID
* rgDispId
){
1832 FIXME("(%p) stub!\n", iface
);
1836 static HRESULT WINAPI
MediaPosition_Invoke(IMediaPosition
* iface
, DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
* pDispParams
, VARIANT
* pVarResult
, EXCEPINFO
* pExcepInfo
, UINT
* puArgErr
){
1837 FIXME("(%p) stub!\n", iface
);
1841 /*** IMediaPosition methods ***/
1842 static HRESULT WINAPI
MediaPosition_get_Duration(IMediaPosition
* iface
, REFTIME
*plength
){
1843 FIXME("(%p)->(%p) stub!\n", iface
, plength
);
1847 static HRESULT WINAPI
MediaPosition_put_CurrentPosition(IMediaPosition
* iface
, REFTIME llTime
){
1848 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1852 static HRESULT WINAPI
MediaPosition_get_CurrentPosition(IMediaPosition
* iface
, REFTIME
*pllTime
){
1853 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1857 static HRESULT WINAPI
MediaPosition_get_StopTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1858 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1862 static HRESULT WINAPI
MediaPosition_put_StopTime(IMediaPosition
* iface
, REFTIME llTime
){
1863 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1867 static HRESULT WINAPI
MediaPosition_get_PrerollTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1868 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1872 static HRESULT WINAPI
MediaPosition_put_PrerollTime(IMediaPosition
* iface
, REFTIME llTime
){
1873 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1877 static HRESULT WINAPI
MediaPosition_put_Rate(IMediaPosition
* iface
, double dRate
){
1878 FIXME("(%p)->(%f) stub!\n", iface
, dRate
);
1882 static HRESULT WINAPI
MediaPosition_get_Rate(IMediaPosition
* iface
, double *pdRate
){
1883 FIXME("(%p)->(%p) stub!\n", iface
, pdRate
);
1887 static HRESULT WINAPI
MediaPosition_CanSeekForward(IMediaPosition
* iface
, LONG
*pCanSeekForward
){
1888 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekForward
);
1892 static HRESULT WINAPI
MediaPosition_CanSeekBackward(IMediaPosition
* iface
, LONG
*pCanSeekBackward
){
1893 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekBackward
);
1898 static const IMediaPositionVtbl IMediaPosition_VTable
=
1900 MediaPosition_QueryInterface
,
1901 MediaPosition_AddRef
,
1902 MediaPosition_Release
,
1903 MediaPosition_GetTypeInfoCount
,
1904 MediaPosition_GetTypeInfo
,
1905 MediaPosition_GetIDsOfNames
,
1906 MediaPosition_Invoke
,
1907 MediaPosition_get_Duration
,
1908 MediaPosition_put_CurrentPosition
,
1909 MediaPosition_get_CurrentPosition
,
1910 MediaPosition_get_StopTime
,
1911 MediaPosition_put_StopTime
,
1912 MediaPosition_get_PrerollTime
,
1913 MediaPosition_put_PrerollTime
,
1914 MediaPosition_put_Rate
,
1915 MediaPosition_get_Rate
,
1916 MediaPosition_CanSeekForward
,
1917 MediaPosition_CanSeekBackward
1920 static HRESULT
GetTargetInterface(IFilterGraphImpl
* pGraph
, REFIID riid
, LPVOID
* ppvObj
)
1922 HRESULT hr
= E_NOINTERFACE
;
1926 /* Check if the interface type is already registered */
1927 for (entry
= 0; entry
< pGraph
->nItfCacheEntries
; entry
++)
1928 if (riid
== pGraph
->ItfCacheEntries
[entry
].riid
)
1930 if (pGraph
->ItfCacheEntries
[entry
].iface
)
1932 /* Return the interface if available */
1933 *ppvObj
= pGraph
->ItfCacheEntries
[entry
].iface
;
1939 if (entry
>= MAX_ITF_CACHE_ENTRIES
)
1941 FIXME("Not enough space to store interface in the cache\n");
1942 return E_OUTOFMEMORY
;
1945 /* Find a filter supporting the requested interface */
1946 for (i
= 0; i
< pGraph
->nFilters
; i
++)
1948 hr
= IBaseFilter_QueryInterface(pGraph
->ppFiltersInGraph
[i
], riid
, ppvObj
);
1951 pGraph
->ItfCacheEntries
[entry
].riid
= riid
;
1952 pGraph
->ItfCacheEntries
[entry
].filter
= pGraph
->ppFiltersInGraph
[i
];
1953 pGraph
->ItfCacheEntries
[entry
].iface
= (IUnknown
*)*ppvObj
;
1954 if (entry
>= pGraph
->nItfCacheEntries
)
1955 pGraph
->nItfCacheEntries
++;
1958 if (hr
!= E_NOINTERFACE
)
1965 /*** IUnknown methods ***/
1966 static HRESULT WINAPI
BasicAudio_QueryInterface(IBasicAudio
*iface
,
1969 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1971 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1973 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1976 static ULONG WINAPI
BasicAudio_AddRef(IBasicAudio
*iface
) {
1977 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1979 TRACE("(%p/%p)->()\n", This
, iface
);
1981 return Filtergraph_AddRef(This
);
1984 static ULONG WINAPI
BasicAudio_Release(IBasicAudio
*iface
) {
1985 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1987 TRACE("(%p/%p)->()\n", This
, iface
);
1989 return Filtergraph_Release(This
);
1992 /*** IDispatch methods ***/
1993 static HRESULT WINAPI
BasicAudio_GetTypeInfoCount(IBasicAudio
*iface
,
1995 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1996 IBasicAudio
* pBasicAudio
;
1999 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
2001 EnterCriticalSection(&This
->cs
);
2003 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2006 hr
= IBasicAudio_GetTypeInfoCount(pBasicAudio
, pctinfo
);
2008 LeaveCriticalSection(&This
->cs
);
2013 static HRESULT WINAPI
BasicAudio_GetTypeInfo(IBasicAudio
*iface
,
2016 ITypeInfo
**ppTInfo
) {
2017 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2018 IBasicAudio
* pBasicAudio
;
2021 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2023 EnterCriticalSection(&This
->cs
);
2025 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2028 hr
= IBasicAudio_GetTypeInfo(pBasicAudio
, iTInfo
, lcid
, ppTInfo
);
2030 LeaveCriticalSection(&This
->cs
);
2035 static HRESULT WINAPI
BasicAudio_GetIDsOfNames(IBasicAudio
*iface
,
2041 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2042 IBasicAudio
* pBasicAudio
;
2045 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2047 EnterCriticalSection(&This
->cs
);
2049 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2052 hr
= IBasicAudio_GetIDsOfNames(pBasicAudio
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2054 LeaveCriticalSection(&This
->cs
);
2059 static HRESULT WINAPI
BasicAudio_Invoke(IBasicAudio
*iface
,
2060 DISPID dispIdMember
,
2064 DISPPARAMS
*pDispParams
,
2066 EXCEPINFO
*pExepInfo
,
2068 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2069 IBasicAudio
* pBasicAudio
;
2072 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
);
2074 EnterCriticalSection(&This
->cs
);
2076 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2079 hr
= IBasicAudio_Invoke(pBasicAudio
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2081 LeaveCriticalSection(&This
->cs
);
2086 /*** IBasicAudio methods ***/
2087 static HRESULT WINAPI
BasicAudio_put_Volume(IBasicAudio
*iface
,
2089 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2090 IBasicAudio
* pBasicAudio
;
2093 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lVolume
);
2095 EnterCriticalSection(&This
->cs
);
2097 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2100 hr
= IBasicAudio_put_Volume(pBasicAudio
, lVolume
);
2102 LeaveCriticalSection(&This
->cs
);
2107 static HRESULT WINAPI
BasicAudio_get_Volume(IBasicAudio
*iface
,
2109 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2110 IBasicAudio
* pBasicAudio
;
2113 TRACE("(%p/%p)->(%p)\n", This
, iface
, plVolume
);
2115 EnterCriticalSection(&This
->cs
);
2117 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2120 hr
= IBasicAudio_get_Volume(pBasicAudio
, plVolume
);
2122 LeaveCriticalSection(&This
->cs
);
2127 static HRESULT WINAPI
BasicAudio_put_Balance(IBasicAudio
*iface
,
2129 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2130 IBasicAudio
* pBasicAudio
;
2133 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lBalance
);
2135 EnterCriticalSection(&This
->cs
);
2137 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2140 hr
= IBasicAudio_put_Balance(pBasicAudio
, lBalance
);
2142 LeaveCriticalSection(&This
->cs
);
2147 static HRESULT WINAPI
BasicAudio_get_Balance(IBasicAudio
*iface
,
2149 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2150 IBasicAudio
* pBasicAudio
;
2153 TRACE("(%p/%p)->(%p)\n", This
, iface
, plBalance
);
2155 EnterCriticalSection(&This
->cs
);
2157 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2160 hr
= IBasicAudio_get_Balance(pBasicAudio
, plBalance
);
2162 LeaveCriticalSection(&This
->cs
);
2167 static const IBasicAudioVtbl IBasicAudio_VTable
=
2169 BasicAudio_QueryInterface
,
2172 BasicAudio_GetTypeInfoCount
,
2173 BasicAudio_GetTypeInfo
,
2174 BasicAudio_GetIDsOfNames
,
2176 BasicAudio_put_Volume
,
2177 BasicAudio_get_Volume
,
2178 BasicAudio_put_Balance
,
2179 BasicAudio_get_Balance
2182 /*** IUnknown methods ***/
2183 static HRESULT WINAPI
BasicVideo_QueryInterface(IBasicVideo
*iface
,
2186 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2188 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2190 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2193 static ULONG WINAPI
BasicVideo_AddRef(IBasicVideo
*iface
) {
2194 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2196 TRACE("(%p/%p)->()\n", This
, iface
);
2198 return Filtergraph_AddRef(This
);
2201 static ULONG WINAPI
BasicVideo_Release(IBasicVideo
*iface
) {
2202 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2204 TRACE("(%p/%p)->()\n", This
, iface
);
2206 return Filtergraph_Release(This
);
2209 /*** IDispatch methods ***/
2210 static HRESULT WINAPI
BasicVideo_GetTypeInfoCount(IBasicVideo
*iface
,
2212 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2213 IBasicVideo
* pBasicVideo
;
2216 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
2218 EnterCriticalSection(&This
->cs
);
2220 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2223 hr
= IBasicVideo_GetTypeInfoCount(pBasicVideo
, pctinfo
);
2225 LeaveCriticalSection(&This
->cs
);
2230 static HRESULT WINAPI
BasicVideo_GetTypeInfo(IBasicVideo
*iface
,
2233 ITypeInfo
**ppTInfo
) {
2234 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2235 IBasicVideo
* pBasicVideo
;
2238 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2240 EnterCriticalSection(&This
->cs
);
2242 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2245 hr
= IBasicVideo_GetTypeInfo(pBasicVideo
, iTInfo
, lcid
, ppTInfo
);
2247 LeaveCriticalSection(&This
->cs
);
2252 static HRESULT WINAPI
BasicVideo_GetIDsOfNames(IBasicVideo
*iface
,
2258 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2259 IBasicVideo
* pBasicVideo
;
2262 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2264 EnterCriticalSection(&This
->cs
);
2266 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2269 hr
= IBasicVideo_GetIDsOfNames(pBasicVideo
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2271 LeaveCriticalSection(&This
->cs
);
2276 static HRESULT WINAPI
BasicVideo_Invoke(IBasicVideo
*iface
,
2277 DISPID dispIdMember
,
2281 DISPPARAMS
*pDispParams
,
2283 EXCEPINFO
*pExepInfo
,
2285 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2286 IBasicVideo
* pBasicVideo
;
2289 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
);
2291 EnterCriticalSection(&This
->cs
);
2293 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2296 hr
= IBasicVideo_Invoke(pBasicVideo
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2298 LeaveCriticalSection(&This
->cs
);
2303 /*** IBasicVideo methods ***/
2304 static HRESULT WINAPI
BasicVideo_get_AvgTimePerFrame(IBasicVideo
*iface
,
2305 REFTIME
*pAvgTimePerFrame
) {
2306 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2307 IBasicVideo
* pBasicVideo
;
2310 TRACE("(%p/%p)->(%p)\n", This
, iface
, pAvgTimePerFrame
);
2312 EnterCriticalSection(&This
->cs
);
2314 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2317 hr
= IBasicVideo_get_AvgTimePerFrame(pBasicVideo
, pAvgTimePerFrame
);
2319 LeaveCriticalSection(&This
->cs
);
2324 static HRESULT WINAPI
BasicVideo_get_BitRate(IBasicVideo
*iface
,
2326 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2327 IBasicVideo
* pBasicVideo
;
2330 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitRate
);
2332 EnterCriticalSection(&This
->cs
);
2334 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2337 hr
= IBasicVideo_get_BitRate(pBasicVideo
, pBitRate
);
2339 LeaveCriticalSection(&This
->cs
);
2344 static HRESULT WINAPI
BasicVideo_get_BitErrorRate(IBasicVideo
*iface
,
2345 long *pBitErrorRate
) {
2346 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2347 IBasicVideo
* pBasicVideo
;
2350 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitErrorRate
);
2352 EnterCriticalSection(&This
->cs
);
2354 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2357 hr
= IBasicVideo_get_BitErrorRate(pBasicVideo
, pBitErrorRate
);
2359 LeaveCriticalSection(&This
->cs
);
2364 static HRESULT WINAPI
BasicVideo_get_VideoWidth(IBasicVideo
*iface
,
2365 long *pVideoWidth
) {
2366 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2367 IBasicVideo
* pBasicVideo
;
2370 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoWidth
);
2372 EnterCriticalSection(&This
->cs
);
2374 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2377 hr
= IBasicVideo_get_VideoWidth(pBasicVideo
, pVideoWidth
);
2379 LeaveCriticalSection(&This
->cs
);
2384 static HRESULT WINAPI
BasicVideo_get_VideoHeight(IBasicVideo
*iface
,
2385 long *pVideoHeight
) {
2386 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2387 IBasicVideo
* pBasicVideo
;
2390 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoHeight
);
2392 EnterCriticalSection(&This
->cs
);
2394 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2397 hr
= IBasicVideo_get_VideoHeight(pBasicVideo
, pVideoHeight
);
2399 LeaveCriticalSection(&This
->cs
);
2404 static HRESULT WINAPI
BasicVideo_put_SourceLeft(IBasicVideo
*iface
,
2406 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2407 IBasicVideo
* pBasicVideo
;
2410 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceLeft
);
2412 EnterCriticalSection(&This
->cs
);
2414 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2417 hr
= IBasicVideo_put_SourceLeft(pBasicVideo
, SourceLeft
);
2419 LeaveCriticalSection(&This
->cs
);
2424 static HRESULT WINAPI
BasicVideo_get_SourceLeft(IBasicVideo
*iface
,
2425 long *pSourceLeft
) {
2426 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2427 IBasicVideo
* pBasicVideo
;
2430 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceLeft
);
2432 EnterCriticalSection(&This
->cs
);
2434 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2437 hr
= IBasicVideo_get_SourceLeft(pBasicVideo
, pSourceLeft
);
2439 LeaveCriticalSection(&This
->cs
);
2444 static HRESULT WINAPI
BasicVideo_put_SourceWidth(IBasicVideo
*iface
,
2446 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2447 IBasicVideo
* pBasicVideo
;
2450 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceWidth
);
2452 EnterCriticalSection(&This
->cs
);
2454 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2457 hr
= IBasicVideo_put_SourceWidth(pBasicVideo
, SourceWidth
);
2459 LeaveCriticalSection(&This
->cs
);
2464 static HRESULT WINAPI
BasicVideo_get_SourceWidth(IBasicVideo
*iface
,
2465 long *pSourceWidth
) {
2466 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2467 IBasicVideo
* pBasicVideo
;
2470 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceWidth
);
2472 EnterCriticalSection(&This
->cs
);
2474 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2477 hr
= IBasicVideo_get_SourceWidth(pBasicVideo
, pSourceWidth
);
2479 LeaveCriticalSection(&This
->cs
);
2484 static HRESULT WINAPI
BasicVideo_put_SourceTop(IBasicVideo
*iface
,
2486 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2487 IBasicVideo
* pBasicVideo
;
2490 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceTop
);
2492 EnterCriticalSection(&This
->cs
);
2494 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2497 hr
= IBasicVideo_put_SourceTop(pBasicVideo
, SourceTop
);
2499 LeaveCriticalSection(&This
->cs
);
2504 static HRESULT WINAPI
BasicVideo_get_SourceTop(IBasicVideo
*iface
,
2506 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2507 IBasicVideo
* pBasicVideo
;
2510 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceTop
);
2512 EnterCriticalSection(&This
->cs
);
2514 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2517 hr
= IBasicVideo_get_SourceTop(pBasicVideo
, pSourceTop
);
2519 LeaveCriticalSection(&This
->cs
);
2524 static HRESULT WINAPI
BasicVideo_put_SourceHeight(IBasicVideo
*iface
,
2525 long SourceHeight
) {
2526 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2527 IBasicVideo
* pBasicVideo
;
2530 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceHeight
);
2532 EnterCriticalSection(&This
->cs
);
2534 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2537 hr
= IBasicVideo_put_SourceHeight(pBasicVideo
, SourceHeight
);
2539 LeaveCriticalSection(&This
->cs
);
2544 static HRESULT WINAPI
BasicVideo_get_SourceHeight(IBasicVideo
*iface
,
2545 long *pSourceHeight
) {
2546 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2547 IBasicVideo
* pBasicVideo
;
2550 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceHeight
);
2552 EnterCriticalSection(&This
->cs
);
2554 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2557 hr
= IBasicVideo_get_SourceHeight(pBasicVideo
, pSourceHeight
);
2559 LeaveCriticalSection(&This
->cs
);
2564 static HRESULT WINAPI
BasicVideo_put_DestinationLeft(IBasicVideo
*iface
,
2565 long DestinationLeft
) {
2566 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2567 IBasicVideo
* pBasicVideo
;
2570 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationLeft
);
2572 EnterCriticalSection(&This
->cs
);
2574 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2577 hr
= IBasicVideo_put_DestinationLeft(pBasicVideo
, DestinationLeft
);
2579 LeaveCriticalSection(&This
->cs
);
2584 static HRESULT WINAPI
BasicVideo_get_DestinationLeft(IBasicVideo
*iface
,
2585 long *pDestinationLeft
) {
2586 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2587 IBasicVideo
* pBasicVideo
;
2590 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationLeft
);
2592 EnterCriticalSection(&This
->cs
);
2594 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2597 hr
= IBasicVideo_get_DestinationLeft(pBasicVideo
, pDestinationLeft
);
2599 LeaveCriticalSection(&This
->cs
);
2604 static HRESULT WINAPI
BasicVideo_put_DestinationWidth(IBasicVideo
*iface
,
2605 long DestinationWidth
) {
2606 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2607 IBasicVideo
* pBasicVideo
;
2610 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationWidth
);
2612 EnterCriticalSection(&This
->cs
);
2614 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2617 hr
= IBasicVideo_put_DestinationWidth(pBasicVideo
, DestinationWidth
);
2619 LeaveCriticalSection(&This
->cs
);
2624 static HRESULT WINAPI
BasicVideo_get_DestinationWidth(IBasicVideo
*iface
,
2625 long *pDestinationWidth
) {
2626 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2627 IBasicVideo
* pBasicVideo
;
2630 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationWidth
);
2632 EnterCriticalSection(&This
->cs
);
2634 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2637 hr
= IBasicVideo_get_DestinationWidth(pBasicVideo
, pDestinationWidth
);
2639 LeaveCriticalSection(&This
->cs
);
2644 static HRESULT WINAPI
BasicVideo_put_DestinationTop(IBasicVideo
*iface
,
2645 long DestinationTop
) {
2646 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2647 IBasicVideo
* pBasicVideo
;
2650 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationTop
);
2652 EnterCriticalSection(&This
->cs
);
2654 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2657 hr
= IBasicVideo_put_DestinationTop(pBasicVideo
, DestinationTop
);
2659 LeaveCriticalSection(&This
->cs
);
2664 static HRESULT WINAPI
BasicVideo_get_DestinationTop(IBasicVideo
*iface
,
2665 long *pDestinationTop
) {
2666 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2667 IBasicVideo
* pBasicVideo
;
2670 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationTop
);
2672 EnterCriticalSection(&This
->cs
);
2674 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2677 hr
= IBasicVideo_get_DestinationTop(pBasicVideo
, pDestinationTop
);
2679 LeaveCriticalSection(&This
->cs
);
2684 static HRESULT WINAPI
BasicVideo_put_DestinationHeight(IBasicVideo
*iface
,
2685 long DestinationHeight
) {
2686 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2687 IBasicVideo
* pBasicVideo
;
2690 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationHeight
);
2692 EnterCriticalSection(&This
->cs
);
2694 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2697 hr
= IBasicVideo_put_DestinationHeight(pBasicVideo
, DestinationHeight
);
2699 LeaveCriticalSection(&This
->cs
);
2704 static HRESULT WINAPI
BasicVideo_get_DestinationHeight(IBasicVideo
*iface
,
2705 long *pDestinationHeight
) {
2706 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2707 IBasicVideo
* pBasicVideo
;
2710 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationHeight
);
2712 EnterCriticalSection(&This
->cs
);
2714 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2717 hr
= IBasicVideo_get_DestinationHeight(pBasicVideo
, pDestinationHeight
);
2719 LeaveCriticalSection(&This
->cs
);
2724 static HRESULT WINAPI
BasicVideo_SetSourcePosition(IBasicVideo
*iface
,
2729 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2730 IBasicVideo
* pBasicVideo
;
2733 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2735 EnterCriticalSection(&This
->cs
);
2737 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2740 hr
= IBasicVideo_SetSourcePosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2742 LeaveCriticalSection(&This
->cs
);
2747 static HRESULT WINAPI
BasicVideo_GetSourcePosition(IBasicVideo
*iface
,
2752 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2753 IBasicVideo
* pBasicVideo
;
2756 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2758 EnterCriticalSection(&This
->cs
);
2760 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2763 hr
= IBasicVideo_GetSourcePosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2765 LeaveCriticalSection(&This
->cs
);
2770 static HRESULT WINAPI
BasicVideo_SetDefaultSourcePosition(IBasicVideo
*iface
) {
2771 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2772 IBasicVideo
* pBasicVideo
;
2775 TRACE("(%p/%p)->()\n", This
, iface
);
2777 EnterCriticalSection(&This
->cs
);
2779 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2782 hr
= IBasicVideo_SetDefaultSourcePosition(pBasicVideo
);
2784 LeaveCriticalSection(&This
->cs
);
2789 static HRESULT WINAPI
BasicVideo_SetDestinationPosition(IBasicVideo
*iface
,
2794 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2795 IBasicVideo
* pBasicVideo
;
2798 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2800 EnterCriticalSection(&This
->cs
);
2802 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2805 hr
= IBasicVideo_SetDestinationPosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2807 LeaveCriticalSection(&This
->cs
);
2812 static HRESULT WINAPI
BasicVideo_GetDestinationPosition(IBasicVideo
*iface
,
2817 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2818 IBasicVideo
* pBasicVideo
;
2821 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2823 EnterCriticalSection(&This
->cs
);
2825 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2828 hr
= IBasicVideo_GetDestinationPosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2830 LeaveCriticalSection(&This
->cs
);
2835 static HRESULT WINAPI
BasicVideo_SetDefaultDestinationPosition(IBasicVideo
*iface
) {
2836 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2837 IBasicVideo
* pBasicVideo
;
2840 TRACE("(%p/%p)->()\n", This
, iface
);
2842 EnterCriticalSection(&This
->cs
);
2844 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2847 hr
= IBasicVideo_SetDefaultDestinationPosition(pBasicVideo
);
2849 LeaveCriticalSection(&This
->cs
);
2854 static HRESULT WINAPI
BasicVideo_GetVideoSize(IBasicVideo
*iface
,
2857 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2858 IBasicVideo
* pBasicVideo
;
2861 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
2863 EnterCriticalSection(&This
->cs
);
2865 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2868 hr
= IBasicVideo_GetVideoSize(pBasicVideo
, pWidth
, pHeight
);
2870 LeaveCriticalSection(&This
->cs
);
2875 static HRESULT WINAPI
BasicVideo_GetVideoPaletteEntries(IBasicVideo
*iface
,
2880 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2881 IBasicVideo
* pBasicVideo
;
2884 TRACE("(%p/%p)->(%ld, %ld, %p, %p)\n", This
, iface
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2886 EnterCriticalSection(&This
->cs
);
2888 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2891 hr
= IBasicVideo_GetVideoPaletteEntries(pBasicVideo
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2893 LeaveCriticalSection(&This
->cs
);
2898 static HRESULT WINAPI
BasicVideo_GetCurrentImage(IBasicVideo
*iface
,
2901 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2902 IBasicVideo
* pBasicVideo
;
2905 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pBufferSize
, pDIBImage
);
2907 EnterCriticalSection(&This
->cs
);
2909 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2912 hr
= IBasicVideo_GetCurrentImage(pBasicVideo
, pBufferSize
, pDIBImage
);
2914 LeaveCriticalSection(&This
->cs
);
2919 static HRESULT WINAPI
BasicVideo_IsUsingDefaultSource(IBasicVideo
*iface
) {
2920 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2921 IBasicVideo
* pBasicVideo
;
2924 TRACE("(%p/%p)->()\n", This
, iface
);
2926 EnterCriticalSection(&This
->cs
);
2928 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2931 hr
= IBasicVideo_IsUsingDefaultSource(pBasicVideo
);
2933 LeaveCriticalSection(&This
->cs
);
2938 static HRESULT WINAPI
BasicVideo_IsUsingDefaultDestination(IBasicVideo
*iface
) {
2939 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2940 IBasicVideo
* pBasicVideo
;
2943 TRACE("(%p/%p)->()\n", This
, iface
);
2945 EnterCriticalSection(&This
->cs
);
2947 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2950 hr
= IBasicVideo_IsUsingDefaultDestination(pBasicVideo
);
2952 LeaveCriticalSection(&This
->cs
);
2958 static const IBasicVideoVtbl IBasicVideo_VTable
=
2960 BasicVideo_QueryInterface
,
2963 BasicVideo_GetTypeInfoCount
,
2964 BasicVideo_GetTypeInfo
,
2965 BasicVideo_GetIDsOfNames
,
2967 BasicVideo_get_AvgTimePerFrame
,
2968 BasicVideo_get_BitRate
,
2969 BasicVideo_get_BitErrorRate
,
2970 BasicVideo_get_VideoWidth
,
2971 BasicVideo_get_VideoHeight
,
2972 BasicVideo_put_SourceLeft
,
2973 BasicVideo_get_SourceLeft
,
2974 BasicVideo_put_SourceWidth
,
2975 BasicVideo_get_SourceWidth
,
2976 BasicVideo_put_SourceTop
,
2977 BasicVideo_get_SourceTop
,
2978 BasicVideo_put_SourceHeight
,
2979 BasicVideo_get_SourceHeight
,
2980 BasicVideo_put_DestinationLeft
,
2981 BasicVideo_get_DestinationLeft
,
2982 BasicVideo_put_DestinationWidth
,
2983 BasicVideo_get_DestinationWidth
,
2984 BasicVideo_put_DestinationTop
,
2985 BasicVideo_get_DestinationTop
,
2986 BasicVideo_put_DestinationHeight
,
2987 BasicVideo_get_DestinationHeight
,
2988 BasicVideo_SetSourcePosition
,
2989 BasicVideo_GetSourcePosition
,
2990 BasicVideo_SetDefaultSourcePosition
,
2991 BasicVideo_SetDestinationPosition
,
2992 BasicVideo_GetDestinationPosition
,
2993 BasicVideo_SetDefaultDestinationPosition
,
2994 BasicVideo_GetVideoSize
,
2995 BasicVideo_GetVideoPaletteEntries
,
2996 BasicVideo_GetCurrentImage
,
2997 BasicVideo_IsUsingDefaultSource
,
2998 BasicVideo_IsUsingDefaultDestination
3002 /*** IUnknown methods ***/
3003 static HRESULT WINAPI
VideoWindow_QueryInterface(IVideoWindow
*iface
,
3006 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3008 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
3010 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
3013 static ULONG WINAPI
VideoWindow_AddRef(IVideoWindow
*iface
) {
3014 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3016 TRACE("(%p/%p)->()\n", This
, iface
);
3018 return Filtergraph_AddRef(This
);
3021 static ULONG WINAPI
VideoWindow_Release(IVideoWindow
*iface
) {
3022 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3024 TRACE("(%p/%p)->()\n", This
, iface
);
3026 return Filtergraph_Release(This
);
3029 /*** IDispatch methods ***/
3030 static HRESULT WINAPI
VideoWindow_GetTypeInfoCount(IVideoWindow
*iface
,
3032 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3033 IVideoWindow
* pVideoWindow
;
3036 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
3038 EnterCriticalSection(&This
->cs
);
3040 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3043 hr
= IVideoWindow_GetTypeInfoCount(pVideoWindow
, pctinfo
);
3045 LeaveCriticalSection(&This
->cs
);
3050 static HRESULT WINAPI
VideoWindow_GetTypeInfo(IVideoWindow
*iface
,
3053 ITypeInfo
**ppTInfo
) {
3054 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3055 IVideoWindow
* pVideoWindow
;
3058 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
3060 EnterCriticalSection(&This
->cs
);
3062 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3065 hr
= IVideoWindow_GetTypeInfo(pVideoWindow
, iTInfo
, lcid
, ppTInfo
);
3067 LeaveCriticalSection(&This
->cs
);
3072 static HRESULT WINAPI
VideoWindow_GetIDsOfNames(IVideoWindow
*iface
,
3078 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3079 IVideoWindow
* pVideoWindow
;
3082 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3084 EnterCriticalSection(&This
->cs
);
3086 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3089 hr
= IVideoWindow_GetIDsOfNames(pVideoWindow
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3091 LeaveCriticalSection(&This
->cs
);
3096 static HRESULT WINAPI
VideoWindow_Invoke(IVideoWindow
*iface
,
3097 DISPID dispIdMember
,
3101 DISPPARAMS
*pDispParams
,
3103 EXCEPINFO
*pExepInfo
,
3105 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3106 IVideoWindow
* pVideoWindow
;
3109 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
);
3111 EnterCriticalSection(&This
->cs
);
3113 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3116 hr
= IVideoWindow_Invoke(pVideoWindow
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
3118 LeaveCriticalSection(&This
->cs
);
3124 /*** IVideoWindow methods ***/
3125 static HRESULT WINAPI
VideoWindow_put_Caption(IVideoWindow
*iface
,
3127 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3128 IVideoWindow
* pVideoWindow
;
3131 TRACE("(%p/%p)->(%s (%p))\n", This
, iface
, debugstr_w(strCaption
), strCaption
);
3133 EnterCriticalSection(&This
->cs
);
3135 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3138 hr
= IVideoWindow_put_Caption(pVideoWindow
, strCaption
);
3140 LeaveCriticalSection(&This
->cs
);
3145 static HRESULT WINAPI
VideoWindow_get_Caption(IVideoWindow
*iface
,
3147 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3148 IVideoWindow
* pVideoWindow
;
3151 TRACE("(%p/%p)->(%p)\n", This
, iface
, strCaption
);
3153 EnterCriticalSection(&This
->cs
);
3155 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3158 hr
= IVideoWindow_get_Caption(pVideoWindow
, strCaption
);
3160 LeaveCriticalSection(&This
->cs
);
3165 static HRESULT WINAPI
VideoWindow_put_WindowStyle(IVideoWindow
*iface
,
3167 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3168 IVideoWindow
* pVideoWindow
;
3171 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyle
);
3173 EnterCriticalSection(&This
->cs
);
3175 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3178 hr
= IVideoWindow_put_WindowStyle(pVideoWindow
, WindowStyle
);
3180 LeaveCriticalSection(&This
->cs
);
3185 static HRESULT WINAPI
VideoWindow_get_WindowStyle(IVideoWindow
*iface
,
3186 long *WindowStyle
) {
3187 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3188 IVideoWindow
* pVideoWindow
;
3191 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyle
);
3193 EnterCriticalSection(&This
->cs
);
3195 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3198 hr
= IVideoWindow_get_WindowStyle(pVideoWindow
, WindowStyle
);
3200 LeaveCriticalSection(&This
->cs
);
3205 static HRESULT WINAPI
VideoWindow_put_WindowStyleEx(IVideoWindow
*iface
,
3206 long WindowStyleEx
) {
3207 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3208 IVideoWindow
* pVideoWindow
;
3211 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyleEx
);
3213 EnterCriticalSection(&This
->cs
);
3215 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3218 hr
= IVideoWindow_put_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3220 LeaveCriticalSection(&This
->cs
);
3225 static HRESULT WINAPI
VideoWindow_get_WindowStyleEx(IVideoWindow
*iface
,
3226 long *WindowStyleEx
) {
3227 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3228 IVideoWindow
* pVideoWindow
;
3231 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyleEx
);
3233 EnterCriticalSection(&This
->cs
);
3235 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3238 hr
= IVideoWindow_get_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3240 LeaveCriticalSection(&This
->cs
);
3245 static HRESULT WINAPI
VideoWindow_put_AutoShow(IVideoWindow
*iface
,
3247 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3248 IVideoWindow
* pVideoWindow
;
3251 TRACE("(%p/%p)->(%ld)\n", This
, iface
, AutoShow
);
3253 EnterCriticalSection(&This
->cs
);
3255 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3258 hr
= IVideoWindow_put_AutoShow(pVideoWindow
, AutoShow
);
3260 LeaveCriticalSection(&This
->cs
);
3265 static HRESULT WINAPI
VideoWindow_get_AutoShow(IVideoWindow
*iface
,
3267 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3268 IVideoWindow
* pVideoWindow
;
3271 TRACE("(%p/%p)->(%p)\n", This
, iface
, AutoShow
);
3273 EnterCriticalSection(&This
->cs
);
3275 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3278 hr
= IVideoWindow_get_AutoShow(pVideoWindow
, AutoShow
);
3280 LeaveCriticalSection(&This
->cs
);
3285 static HRESULT WINAPI
VideoWindow_put_WindowState(IVideoWindow
*iface
,
3287 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3288 IVideoWindow
* pVideoWindow
;
3291 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowState
);
3293 EnterCriticalSection(&This
->cs
);
3295 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3298 hr
= IVideoWindow_put_WindowState(pVideoWindow
, WindowState
);
3300 LeaveCriticalSection(&This
->cs
);
3305 static HRESULT WINAPI
VideoWindow_get_WindowState(IVideoWindow
*iface
,
3306 long *WindowState
) {
3307 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3308 IVideoWindow
* pVideoWindow
;
3311 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowState
);
3313 EnterCriticalSection(&This
->cs
);
3315 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3318 hr
= IVideoWindow_get_WindowState(pVideoWindow
, WindowState
);
3320 LeaveCriticalSection(&This
->cs
);
3325 static HRESULT WINAPI
VideoWindow_put_BackgroundPalette(IVideoWindow
*iface
,
3326 long BackgroundPalette
) {
3327 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3328 IVideoWindow
* pVideoWindow
;
3331 TRACE("(%p/%p)->(%ld)\n", This
, iface
, BackgroundPalette
);
3333 EnterCriticalSection(&This
->cs
);
3335 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3338 hr
= IVideoWindow_put_BackgroundPalette(pVideoWindow
, BackgroundPalette
);
3340 LeaveCriticalSection(&This
->cs
);
3345 static HRESULT WINAPI
VideoWindow_get_BackgroundPalette(IVideoWindow
*iface
,
3346 long *pBackgroundPalette
) {
3347 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3348 IVideoWindow
* pVideoWindow
;
3351 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBackgroundPalette
);
3353 EnterCriticalSection(&This
->cs
);
3355 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3358 hr
= IVideoWindow_get_BackgroundPalette(pVideoWindow
, pBackgroundPalette
);
3360 LeaveCriticalSection(&This
->cs
);
3365 static HRESULT WINAPI
VideoWindow_put_Visible(IVideoWindow
*iface
,
3367 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3368 IVideoWindow
* pVideoWindow
;
3371 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Visible
);
3373 EnterCriticalSection(&This
->cs
);
3375 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3378 hr
= IVideoWindow_put_Visible(pVideoWindow
, Visible
);
3380 LeaveCriticalSection(&This
->cs
);
3385 static HRESULT WINAPI
VideoWindow_get_Visible(IVideoWindow
*iface
,
3387 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3388 IVideoWindow
* pVideoWindow
;
3391 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVisible
);
3393 EnterCriticalSection(&This
->cs
);
3395 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3398 hr
= IVideoWindow_get_Visible(pVideoWindow
, pVisible
);
3400 LeaveCriticalSection(&This
->cs
);
3405 static HRESULT WINAPI
VideoWindow_put_Left(IVideoWindow
*iface
,
3407 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3408 IVideoWindow
* pVideoWindow
;
3411 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Left
);
3413 EnterCriticalSection(&This
->cs
);
3415 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3418 hr
= IVideoWindow_put_Left(pVideoWindow
, Left
);
3420 LeaveCriticalSection(&This
->cs
);
3425 static HRESULT WINAPI
VideoWindow_get_Left(IVideoWindow
*iface
,
3427 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3428 IVideoWindow
* pVideoWindow
;
3431 TRACE("(%p/%p)->(%p)\n", This
, iface
, pLeft
);
3433 EnterCriticalSection(&This
->cs
);
3435 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3438 hr
= IVideoWindow_get_Left(pVideoWindow
, pLeft
);
3440 LeaveCriticalSection(&This
->cs
);
3445 static HRESULT WINAPI
VideoWindow_put_Width(IVideoWindow
*iface
,
3447 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3448 IVideoWindow
* pVideoWindow
;
3451 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Width
);
3453 EnterCriticalSection(&This
->cs
);
3455 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3458 hr
= IVideoWindow_put_Width(pVideoWindow
, Width
);
3460 LeaveCriticalSection(&This
->cs
);
3465 static HRESULT WINAPI
VideoWindow_get_Width(IVideoWindow
*iface
,
3467 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3468 IVideoWindow
* pVideoWindow
;
3471 TRACE("(%p/%p)->(%p)\n", This
, iface
, pWidth
);
3473 EnterCriticalSection(&This
->cs
);
3475 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3478 hr
= IVideoWindow_get_Width(pVideoWindow
, pWidth
);
3480 LeaveCriticalSection(&This
->cs
);
3485 static HRESULT WINAPI
VideoWindow_put_Top(IVideoWindow
*iface
,
3487 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3488 IVideoWindow
* pVideoWindow
;
3491 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Top
);
3493 EnterCriticalSection(&This
->cs
);
3495 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3498 hr
= IVideoWindow_put_Top(pVideoWindow
, Top
);
3500 LeaveCriticalSection(&This
->cs
);
3505 static HRESULT WINAPI
VideoWindow_get_Top(IVideoWindow
*iface
,
3507 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3508 IVideoWindow
* pVideoWindow
;
3511 TRACE("(%p/%p)->(%p)\n", This
, iface
, pTop
);
3513 EnterCriticalSection(&This
->cs
);
3515 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3518 hr
= IVideoWindow_get_Top(pVideoWindow
, pTop
);
3520 LeaveCriticalSection(&This
->cs
);
3525 static HRESULT WINAPI
VideoWindow_put_Height(IVideoWindow
*iface
,
3527 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3528 IVideoWindow
* pVideoWindow
;
3531 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Height
);
3533 EnterCriticalSection(&This
->cs
);
3535 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3538 hr
= IVideoWindow_put_Height(pVideoWindow
, Height
);
3540 LeaveCriticalSection(&This
->cs
);
3545 static HRESULT WINAPI
VideoWindow_get_Height(IVideoWindow
*iface
,
3547 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3548 IVideoWindow
* pVideoWindow
;
3551 TRACE("(%p/%p)->(%p)\n", This
, iface
, pHeight
);
3553 EnterCriticalSection(&This
->cs
);
3555 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3558 hr
= IVideoWindow_get_Height(pVideoWindow
, pHeight
);
3560 LeaveCriticalSection(&This
->cs
);
3565 static HRESULT WINAPI
VideoWindow_put_Owner(IVideoWindow
*iface
,
3567 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3568 IVideoWindow
* pVideoWindow
;
3571 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Owner
);
3573 EnterCriticalSection(&This
->cs
);
3575 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3578 hr
= IVideoWindow_put_Owner(pVideoWindow
, Owner
);
3580 LeaveCriticalSection(&This
->cs
);
3585 static HRESULT WINAPI
VideoWindow_get_Owner(IVideoWindow
*iface
,
3587 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3588 IVideoWindow
* pVideoWindow
;
3591 TRACE("(%p/%p)->(%p)\n", This
, iface
, Owner
);
3593 EnterCriticalSection(&This
->cs
);
3595 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3598 hr
= IVideoWindow_get_Owner(pVideoWindow
, Owner
);
3600 LeaveCriticalSection(&This
->cs
);
3605 static HRESULT WINAPI
VideoWindow_put_MessageDrain(IVideoWindow
*iface
,
3607 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3608 IVideoWindow
* pVideoWindow
;
3611 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Drain
);
3613 EnterCriticalSection(&This
->cs
);
3615 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3618 hr
= IVideoWindow_put_MessageDrain(pVideoWindow
, Drain
);
3620 LeaveCriticalSection(&This
->cs
);
3625 static HRESULT WINAPI
VideoWindow_get_MessageDrain(IVideoWindow
*iface
,
3627 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3628 IVideoWindow
* pVideoWindow
;
3631 TRACE("(%p/%p)->(%p)\n", This
, iface
, Drain
);
3633 EnterCriticalSection(&This
->cs
);
3635 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3638 hr
= IVideoWindow_get_MessageDrain(pVideoWindow
, Drain
);
3640 LeaveCriticalSection(&This
->cs
);
3645 static HRESULT WINAPI
VideoWindow_get_BorderColor(IVideoWindow
*iface
,
3647 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3648 IVideoWindow
* pVideoWindow
;
3651 TRACE("(%p/%p)->(%p)\n", This
, iface
, Color
);
3653 EnterCriticalSection(&This
->cs
);
3655 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3658 hr
= IVideoWindow_get_BorderColor(pVideoWindow
, Color
);
3660 LeaveCriticalSection(&This
->cs
);
3665 static HRESULT WINAPI
VideoWindow_put_BorderColor(IVideoWindow
*iface
,
3667 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3668 IVideoWindow
* pVideoWindow
;
3671 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Color
);
3673 EnterCriticalSection(&This
->cs
);
3675 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3678 hr
= IVideoWindow_put_BorderColor(pVideoWindow
, Color
);
3680 LeaveCriticalSection(&This
->cs
);
3685 static HRESULT WINAPI
VideoWindow_get_FullScreenMode(IVideoWindow
*iface
,
3686 long *FullScreenMode
) {
3687 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3688 IVideoWindow
* pVideoWindow
;
3691 TRACE("(%p/%p)->(%p)\n", This
, iface
, FullScreenMode
);
3693 EnterCriticalSection(&This
->cs
);
3695 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3698 hr
= IVideoWindow_get_FullScreenMode(pVideoWindow
, FullScreenMode
);
3700 LeaveCriticalSection(&This
->cs
);
3705 static HRESULT WINAPI
VideoWindow_put_FullScreenMode(IVideoWindow
*iface
,
3706 long FullScreenMode
) {
3707 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3708 IVideoWindow
* pVideoWindow
;
3711 TRACE("(%p/%p)->(%ld)\n", This
, iface
, FullScreenMode
);
3713 EnterCriticalSection(&This
->cs
);
3715 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3718 hr
= IVideoWindow_put_FullScreenMode(pVideoWindow
, FullScreenMode
);
3720 LeaveCriticalSection(&This
->cs
);
3725 static HRESULT WINAPI
VideoWindow_SetWindowForeground(IVideoWindow
*iface
,
3727 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3728 IVideoWindow
* pVideoWindow
;
3731 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Focus
);
3733 EnterCriticalSection(&This
->cs
);
3735 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3738 hr
= IVideoWindow_SetWindowForeground(pVideoWindow
, Focus
);
3740 LeaveCriticalSection(&This
->cs
);
3745 static HRESULT WINAPI
VideoWindow_NotifyOwnerMessage(IVideoWindow
*iface
,
3750 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3751 IVideoWindow
* pVideoWindow
;
3754 TRACE("(%p/%p)->(%08x, %ld, %08lx, %08lx)\n", This
, iface
, (DWORD
) hwnd
, uMsg
, wParam
, lParam
);
3756 EnterCriticalSection(&This
->cs
);
3758 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3761 hr
= IVideoWindow_NotifyOwnerMessage(pVideoWindow
, hwnd
, uMsg
, wParam
, lParam
);
3763 LeaveCriticalSection(&This
->cs
);
3768 static HRESULT WINAPI
VideoWindow_SetWindowPosition(IVideoWindow
*iface
,
3773 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3774 IVideoWindow
* pVideoWindow
;
3777 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
3779 EnterCriticalSection(&This
->cs
);
3781 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3784 hr
= IVideoWindow_SetWindowPosition(pVideoWindow
, Left
, Top
, Width
, Height
);
3786 LeaveCriticalSection(&This
->cs
);
3791 static HRESULT WINAPI
VideoWindow_GetWindowPosition(IVideoWindow
*iface
,
3796 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3797 IVideoWindow
* pVideoWindow
;
3800 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3802 EnterCriticalSection(&This
->cs
);
3804 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3807 hr
= IVideoWindow_GetWindowPosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3809 LeaveCriticalSection(&This
->cs
);
3814 static HRESULT WINAPI
VideoWindow_GetMinIdealImageSize(IVideoWindow
*iface
,
3817 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3818 IVideoWindow
* pVideoWindow
;
3821 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3823 EnterCriticalSection(&This
->cs
);
3825 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3828 hr
= IVideoWindow_GetMinIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3830 LeaveCriticalSection(&This
->cs
);
3835 static HRESULT WINAPI
VideoWindow_GetMaxIdealImageSize(IVideoWindow
*iface
,
3838 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3839 IVideoWindow
* pVideoWindow
;
3842 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3844 EnterCriticalSection(&This
->cs
);
3846 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3849 hr
= IVideoWindow_GetMaxIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3851 LeaveCriticalSection(&This
->cs
);
3856 static HRESULT WINAPI
VideoWindow_GetRestorePosition(IVideoWindow
*iface
,
3861 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3862 IVideoWindow
* pVideoWindow
;
3865 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3867 EnterCriticalSection(&This
->cs
);
3869 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3872 hr
= IVideoWindow_GetRestorePosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3874 LeaveCriticalSection(&This
->cs
);
3879 static HRESULT WINAPI
VideoWindow_HideCursor(IVideoWindow
*iface
,
3881 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3882 IVideoWindow
* pVideoWindow
;
3885 TRACE("(%p/%p)->(%ld)\n", This
, iface
, HideCursor
);
3887 EnterCriticalSection(&This
->cs
);
3889 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3892 hr
= IVideoWindow_HideCursor(pVideoWindow
, HideCursor
);
3894 LeaveCriticalSection(&This
->cs
);
3899 static HRESULT WINAPI
VideoWindow_IsCursorHidden(IVideoWindow
*iface
,
3900 long *CursorHidden
) {
3901 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3902 IVideoWindow
* pVideoWindow
;
3905 TRACE("(%p/%p)->(%p)\n", This
, iface
, CursorHidden
);
3907 EnterCriticalSection(&This
->cs
);
3909 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3912 hr
= IVideoWindow_IsCursorHidden(pVideoWindow
, CursorHidden
);
3914 LeaveCriticalSection(&This
->cs
);
3920 static const IVideoWindowVtbl IVideoWindow_VTable
=
3922 VideoWindow_QueryInterface
,
3924 VideoWindow_Release
,
3925 VideoWindow_GetTypeInfoCount
,
3926 VideoWindow_GetTypeInfo
,
3927 VideoWindow_GetIDsOfNames
,
3929 VideoWindow_put_Caption
,
3930 VideoWindow_get_Caption
,
3931 VideoWindow_put_WindowStyle
,
3932 VideoWindow_get_WindowStyle
,
3933 VideoWindow_put_WindowStyleEx
,
3934 VideoWindow_get_WindowStyleEx
,
3935 VideoWindow_put_AutoShow
,
3936 VideoWindow_get_AutoShow
,
3937 VideoWindow_put_WindowState
,
3938 VideoWindow_get_WindowState
,
3939 VideoWindow_put_BackgroundPalette
,
3940 VideoWindow_get_BackgroundPalette
,
3941 VideoWindow_put_Visible
,
3942 VideoWindow_get_Visible
,
3943 VideoWindow_put_Left
,
3944 VideoWindow_get_Left
,
3945 VideoWindow_put_Width
,
3946 VideoWindow_get_Width
,
3947 VideoWindow_put_Top
,
3948 VideoWindow_get_Top
,
3949 VideoWindow_put_Height
,
3950 VideoWindow_get_Height
,
3951 VideoWindow_put_Owner
,
3952 VideoWindow_get_Owner
,
3953 VideoWindow_put_MessageDrain
,
3954 VideoWindow_get_MessageDrain
,
3955 VideoWindow_get_BorderColor
,
3956 VideoWindow_put_BorderColor
,
3957 VideoWindow_get_FullScreenMode
,
3958 VideoWindow_put_FullScreenMode
,
3959 VideoWindow_SetWindowForeground
,
3960 VideoWindow_NotifyOwnerMessage
,
3961 VideoWindow_SetWindowPosition
,
3962 VideoWindow_GetWindowPosition
,
3963 VideoWindow_GetMinIdealImageSize
,
3964 VideoWindow_GetMaxIdealImageSize
,
3965 VideoWindow_GetRestorePosition
,
3966 VideoWindow_HideCursor
,
3967 VideoWindow_IsCursorHidden
3971 /*** IUnknown methods ***/
3972 static HRESULT WINAPI
MediaEvent_QueryInterface(IMediaEventEx
*iface
,
3975 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3977 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
3979 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
3982 static ULONG WINAPI
MediaEvent_AddRef(IMediaEventEx
*iface
) {
3983 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3985 TRACE("(%p/%p)->()\n", This
, iface
);
3987 return Filtergraph_AddRef(This
);
3990 static ULONG WINAPI
MediaEvent_Release(IMediaEventEx
*iface
) {
3991 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3993 TRACE("(%p/%p)->()\n", This
, iface
);
3995 return Filtergraph_Release(This
);
3998 /*** IDispatch methods ***/
3999 static HRESULT WINAPI
MediaEvent_GetTypeInfoCount(IMediaEventEx
*iface
,
4001 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4003 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
4008 static HRESULT WINAPI
MediaEvent_GetTypeInfo(IMediaEventEx
*iface
,
4011 ITypeInfo
**ppTInfo
) {
4012 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4014 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
4019 static HRESULT WINAPI
MediaEvent_GetIDsOfNames(IMediaEventEx
*iface
,
4025 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4027 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
4032 static HRESULT WINAPI
MediaEvent_Invoke(IMediaEventEx
*iface
,
4033 DISPID dispIdMember
,
4037 DISPPARAMS
*pDispParams
,
4039 EXCEPINFO
*pExepInfo
,
4041 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4043 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
);
4048 /*** IMediaEvent methods ***/
4049 static HRESULT WINAPI
MediaEvent_GetEventHandle(IMediaEventEx
*iface
,
4051 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4053 TRACE("(%p/%p)->(%p)\n", This
, iface
, hEvent
);
4055 *hEvent
= (OAEVENT
)This
->evqueue
.msg_event
;
4060 static HRESULT WINAPI
MediaEvent_GetEvent(IMediaEventEx
*iface
,
4065 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4068 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This
, iface
, lEventCode
, lParam1
, lParam2
, msTimeout
);
4070 if (EventsQueue_GetEvent(&This
->evqueue
, &evt
, msTimeout
))
4072 *lEventCode
= evt
.lEventCode
;
4073 *lParam1
= evt
.lParam1
;
4074 *lParam2
= evt
.lParam2
;
4082 static HRESULT WINAPI
MediaEvent_WaitForCompletion(IMediaEventEx
*iface
,
4085 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4087 TRACE("(%p/%p)->(%ld, %p)\n", This
, iface
, msTimeout
, pEvCode
);
4089 if (WaitForSingleObject(This
->hEventCompletion
, msTimeout
) == WAIT_OBJECT_0
)
4091 *pEvCode
= This
->CompletionStatus
;
4099 static HRESULT WINAPI
MediaEvent_CancelDefaultHandling(IMediaEventEx
*iface
,
4101 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4103 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4105 if (lEvCode
== EC_COMPLETE
)
4106 This
->HandleEcComplete
= FALSE
;
4107 else if (lEvCode
== EC_REPAINT
)
4108 This
->HandleEcRepaint
= FALSE
;
4115 static HRESULT WINAPI
MediaEvent_RestoreDefaultHandling(IMediaEventEx
*iface
,
4117 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4119 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4121 if (lEvCode
== EC_COMPLETE
)
4122 This
->HandleEcComplete
= TRUE
;
4123 else if (lEvCode
== EC_REPAINT
)
4124 This
->HandleEcRepaint
= TRUE
;
4131 static HRESULT WINAPI
MediaEvent_FreeEventParams(IMediaEventEx
*iface
,
4135 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4137 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This
, iface
, lEvCode
, lParam1
, lParam2
);
4142 /*** IMediaEventEx methods ***/
4143 static HRESULT WINAPI
MediaEvent_SetNotifyWindow(IMediaEventEx
*iface
,
4146 LONG_PTR lInstanceData
) {
4147 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4149 TRACE("(%p/%p)->(%08x, %ld, %08lx)\n", This
, iface
, (DWORD
) hwnd
, lMsg
, lInstanceData
);
4151 This
->notif
.hWnd
= (HWND
)hwnd
;
4152 This
->notif
.msg
= lMsg
;
4153 This
->notif
.instance
= (long) lInstanceData
;
4158 static HRESULT WINAPI
MediaEvent_SetNotifyFlags(IMediaEventEx
*iface
,
4159 long lNoNotifyFlags
) {
4160 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4162 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lNoNotifyFlags
);
4164 if ((lNoNotifyFlags
!= 0) && (lNoNotifyFlags
!= 1))
4165 return E_INVALIDARG
;
4167 This
->notif
.disabled
= lNoNotifyFlags
;
4172 static HRESULT WINAPI
MediaEvent_GetNotifyFlags(IMediaEventEx
*iface
,
4173 long *lplNoNotifyFlags
) {
4174 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4176 TRACE("(%p/%p)->(%p)\n", This
, iface
, lplNoNotifyFlags
);
4178 if (!lplNoNotifyFlags
)
4181 *lplNoNotifyFlags
= This
->notif
.disabled
;
4187 static const IMediaEventExVtbl IMediaEventEx_VTable
=
4189 MediaEvent_QueryInterface
,
4192 MediaEvent_GetTypeInfoCount
,
4193 MediaEvent_GetTypeInfo
,
4194 MediaEvent_GetIDsOfNames
,
4196 MediaEvent_GetEventHandle
,
4197 MediaEvent_GetEvent
,
4198 MediaEvent_WaitForCompletion
,
4199 MediaEvent_CancelDefaultHandling
,
4200 MediaEvent_RestoreDefaultHandling
,
4201 MediaEvent_FreeEventParams
,
4202 MediaEvent_SetNotifyWindow
,
4203 MediaEvent_SetNotifyFlags
,
4204 MediaEvent_GetNotifyFlags
4208 static HRESULT WINAPI
MediaFilter_QueryInterface(IMediaFilter
*iface
, REFIID riid
, LPVOID
*ppv
)
4210 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4212 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4215 static ULONG WINAPI
MediaFilter_AddRef(IMediaFilter
*iface
)
4217 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4219 return Filtergraph_AddRef(This
);
4222 static ULONG WINAPI
MediaFilter_Release(IMediaFilter
*iface
)
4224 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4226 return Filtergraph_Release(This
);
4229 static HRESULT WINAPI
MediaFilter_GetClassID(IMediaFilter
*iface
, CLSID
* pClassID
)
4231 FIXME("(%p): stub\n", pClassID
);
4236 static HRESULT WINAPI
MediaFilter_Stop(IMediaFilter
*iface
)
4238 FIXME("(): stub\n");
4243 static HRESULT WINAPI
MediaFilter_Pause(IMediaFilter
*iface
)
4245 FIXME("(): stub\n");
4250 static HRESULT WINAPI
MediaFilter_Run(IMediaFilter
*iface
, REFERENCE_TIME tStart
)
4252 FIXME("(0x%s): stub\n", wine_dbgstr_longlong(tStart
));
4257 static HRESULT WINAPI
MediaFilter_GetState(IMediaFilter
*iface
, DWORD dwMsTimeout
, FILTER_STATE
* pState
)
4259 FIXME("(%d, %p): stub\n", dwMsTimeout
, pState
);
4264 static HRESULT WINAPI
MediaFilter_SetSyncSource(IMediaFilter
*iface
, IReferenceClock
*pClock
)
4266 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4270 TRACE("(%p/%p)->(%p)\n", iface
, This
, pClock
);
4272 EnterCriticalSection(&This
->cs
);
4274 for (i
= 0;i
< This
->nFilters
;i
++)
4276 hr
= IBaseFilter_SetSyncSource(This
->ppFiltersInGraph
[i
], pClock
);
4284 IBaseFilter_SetSyncSource(This
->ppFiltersInGraph
[i
], This
->refClock
);
4289 IReferenceClock_Release(This
->refClock
);
4290 This
->refClock
= pClock
;
4292 IReferenceClock_AddRef(This
->refClock
);
4295 LeaveCriticalSection(&This
->cs
);
4300 static HRESULT WINAPI
MediaFilter_GetSyncSource(IMediaFilter
*iface
, IReferenceClock
**ppClock
)
4302 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4304 TRACE("(%p/%p)->(%p)\n", iface
, This
, ppClock
);
4309 EnterCriticalSection(&This
->cs
);
4311 *ppClock
= This
->refClock
;
4313 IReferenceClock_AddRef(*ppClock
);
4315 LeaveCriticalSection(&This
->cs
);
4320 static const IMediaFilterVtbl IMediaFilter_VTable
=
4322 MediaFilter_QueryInterface
,
4324 MediaFilter_Release
,
4325 MediaFilter_GetClassID
,
4329 MediaFilter_GetState
,
4330 MediaFilter_SetSyncSource
,
4331 MediaFilter_GetSyncSource
4334 static HRESULT WINAPI
MediaEventSink_QueryInterface(IMediaEventSink
*iface
, REFIID riid
, LPVOID
*ppv
)
4336 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4338 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4341 static ULONG WINAPI
MediaEventSink_AddRef(IMediaEventSink
*iface
)
4343 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4345 return Filtergraph_AddRef(This
);
4348 static ULONG WINAPI
MediaEventSink_Release(IMediaEventSink
*iface
)
4350 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4352 return Filtergraph_Release(This
);
4355 static HRESULT WINAPI
MediaEventSink_Notify(IMediaEventSink
*iface
, long EventCode
, LONG_PTR EventParam1
, LONG_PTR EventParam2
)
4357 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4360 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This
, iface
, EventCode
, EventParam1
, EventParam2
);
4362 /* We need thread safety here, let's use the events queue's one */
4363 EnterCriticalSection(&This
->evqueue
.msg_crst
);
4365 if ((EventCode
== EC_COMPLETE
) && This
->HandleEcComplete
)
4367 TRACE("Process EC_COMPLETE notification\n");
4368 if (++This
->EcCompleteCount
== This
->nRenderers
)
4370 evt
.lEventCode
= EC_COMPLETE
;
4373 TRACE("Send EC_COMPLETE to app\n");
4374 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4375 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4377 TRACE("Send Window message\n");
4378 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4380 This
->CompletionStatus
= EC_COMPLETE
;
4381 SetEvent(This
->hEventCompletion
);
4384 else if ((EventCode
== EC_REPAINT
) && This
->HandleEcRepaint
)
4386 /* FIXME: Not handled yet */
4390 evt
.lEventCode
= EventCode
;
4391 evt
.lParam1
= EventParam1
;
4392 evt
.lParam2
= EventParam2
;
4393 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4394 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4395 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4398 LeaveCriticalSection(&This
->evqueue
.msg_crst
);
4402 static const IMediaEventSinkVtbl IMediaEventSink_VTable
=
4404 MediaEventSink_QueryInterface
,
4405 MediaEventSink_AddRef
,
4406 MediaEventSink_Release
,
4407 MediaEventSink_Notify
4410 static HRESULT WINAPI
GraphConfig_QueryInterface(IGraphConfig
*iface
, REFIID riid
, LPVOID
*ppv
)
4412 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4414 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4417 static ULONG WINAPI
GraphConfig_AddRef(IGraphConfig
*iface
)
4419 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4421 return Filtergraph_AddRef(This
);
4424 static ULONG WINAPI
GraphConfig_Release(IGraphConfig
*iface
)
4426 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4428 return Filtergraph_Release(This
);
4431 static HRESULT WINAPI
GraphConfig_Reconnect(IGraphConfig
*iface
,
4434 const AM_MEDIA_TYPE
* pmtFirstConnection
,
4435 IBaseFilter
* pUsingFilter
,
4439 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4441 FIXME("(%p)->(%p, %p, %p, %p, %p, %x): stub!\n", This
, pOutputPin
, pInputPin
, pmtFirstConnection
, pUsingFilter
, hAbortEvent
, dwFlags
);
4446 static HRESULT WINAPI
GraphConfig_Reconfigure(IGraphConfig
*iface
,
4447 IGraphConfigCallback
* pCallback
,
4452 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4454 FIXME("(%p)->(%p, %p, %x, %p): stub!\n", This
, pCallback
, pvContext
, dwFlags
, hAbortEvent
);
4459 static HRESULT WINAPI
GraphConfig_AddFilterToCache(IGraphConfig
*iface
,
4460 IBaseFilter
* pFilter
)
4462 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4464 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4469 static HRESULT WINAPI
GraphConfig_EnumCacheFilter(IGraphConfig
*iface
,
4470 IEnumFilters
** pEnum
)
4472 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4474 FIXME("(%p)->(%p): stub!\n", This
, pEnum
);
4479 static HRESULT WINAPI
GraphConfig_RemoveFilterFromCache(IGraphConfig
*iface
,
4480 IBaseFilter
* pFilter
)
4482 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4484 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4489 static HRESULT WINAPI
GraphConfig_GetStartTime(IGraphConfig
*iface
,
4490 REFERENCE_TIME
* prtStart
)
4492 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4494 FIXME("(%p)->(%p): stub!\n", This
, prtStart
);
4499 static HRESULT WINAPI
GraphConfig_PushThroughData(IGraphConfig
*iface
,
4501 IPinConnection
* pConnection
,
4504 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4506 FIXME("(%p)->(%p, %p, %p): stub!\n", This
, pOutputPin
, pConnection
, hEventAbort
);
4511 static HRESULT WINAPI
GraphConfig_SetFilterFlags(IGraphConfig
*iface
,
4512 IBaseFilter
* pFilter
,
4515 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4517 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4522 static HRESULT WINAPI
GraphConfig_GetFilterFlags(IGraphConfig
*iface
,
4523 IBaseFilter
* pFilter
,
4526 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4528 FIXME("(%p)->(%p, %p): stub!\n", This
, pFilter
, dwFlags
);
4533 static HRESULT WINAPI
GraphConfig_RemoveFilterEx(IGraphConfig
*iface
,
4534 IBaseFilter
* pFilter
,
4537 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4539 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4544 static const IGraphConfigVtbl IGraphConfig_VTable
=
4546 GraphConfig_QueryInterface
,
4548 GraphConfig_Release
,
4549 GraphConfig_Reconnect
,
4550 GraphConfig_Reconfigure
,
4551 GraphConfig_AddFilterToCache
,
4552 GraphConfig_EnumCacheFilter
,
4553 GraphConfig_RemoveFilterFromCache
,
4554 GraphConfig_GetStartTime
,
4555 GraphConfig_PushThroughData
,
4556 GraphConfig_SetFilterFlags
,
4557 GraphConfig_GetFilterFlags
,
4558 GraphConfig_RemoveFilterEx
4561 /* This is the only function that actually creates a FilterGraph class... */
4562 HRESULT
FilterGraph_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4564 IFilterGraphImpl
*fimpl
;
4567 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
4570 return CLASS_E_NOAGGREGATION
;
4572 fimpl
= CoTaskMemAlloc(sizeof(*fimpl
));
4573 fimpl
->IGraphBuilder_vtbl
= &IGraphBuilder_VTable
;
4574 fimpl
->IMediaControl_vtbl
= &IMediaControl_VTable
;
4575 fimpl
->IMediaSeeking_vtbl
= &IMediaSeeking_VTable
;
4576 fimpl
->IBasicAudio_vtbl
= &IBasicAudio_VTable
;
4577 fimpl
->IBasicVideo_vtbl
= &IBasicVideo_VTable
;
4578 fimpl
->IVideoWindow_vtbl
= &IVideoWindow_VTable
;
4579 fimpl
->IMediaEventEx_vtbl
= &IMediaEventEx_VTable
;
4580 fimpl
->IMediaFilter_vtbl
= &IMediaFilter_VTable
;
4581 fimpl
->IMediaEventSink_vtbl
= &IMediaEventSink_VTable
;
4582 fimpl
->IGraphConfig_vtbl
= &IGraphConfig_VTable
;
4583 fimpl
->IMediaPosition_vtbl
= &IMediaPosition_VTable
;
4585 fimpl
->ppFiltersInGraph
= NULL
;
4586 fimpl
->pFilterNames
= NULL
;
4587 fimpl
->nFilters
= 0;
4588 fimpl
->filterCapacity
= 0;
4589 fimpl
->nameIndex
= 1;
4590 fimpl
->refClock
= NULL
;
4591 fimpl
->hEventCompletion
= CreateEventW(0, TRUE
, FALSE
, 0);
4592 fimpl
->HandleEcComplete
= TRUE
;
4593 fimpl
->HandleEcRepaint
= TRUE
;
4594 fimpl
->notif
.hWnd
= 0;
4595 fimpl
->notif
.disabled
= FALSE
;
4596 fimpl
->nRenderers
= 0;
4597 fimpl
->EcCompleteCount
= 0;
4598 fimpl
->state
= State_Stopped
;
4599 EventsQueue_Init(&fimpl
->evqueue
);
4600 InitializeCriticalSection(&fimpl
->cs
);
4601 fimpl
->cs
.DebugInfo
->Spare
[0] = (DWORD_PTR
)(__FILE__
": IFilterGraphImpl.cs");
4602 fimpl
->nItfCacheEntries
= 0;
4604 hr
= CoCreateInstance(&CLSID_FilterMapper2
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IFilterMapper2
, (LPVOID
*)&fimpl
->pFilterMapper2
);
4606 ERR("Unable to create filter mapper (%x)\n", hr
);
4614 HRESULT
FilterGraphNoThread_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4616 FIXME("CLSID_FilterGraphNoThread partially implemented - Forwarding to CLSID_FilterGraph\n");
4617 return FilterGraph_create(pUnkOuter
, ppObj
);