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
;
193 int HandleEcClockChanged
;
196 ITF_CACHE_ENTRY ItfCacheEntries
[MAX_ITF_CACHE_ENTRIES
];
197 int nItfCacheEntries
;
201 static HRESULT
Filtergraph_QueryInterface(IFilterGraphImpl
*This
,
204 TRACE("(%p)->(%s (%p), %p)\n", This
, debugstr_guid(riid
), riid
, ppvObj
);
206 if (IsEqualGUID(&IID_IUnknown
, riid
) ||
207 IsEqualGUID(&IID_IFilterGraph
, riid
) ||
208 IsEqualGUID(&IID_IGraphBuilder
, riid
)) {
209 *ppvObj
= &(This
->IGraphBuilder_vtbl
);
210 TRACE(" returning IGraphBuilder interface (%p)\n", *ppvObj
);
211 } else if (IsEqualGUID(&IID_IMediaControl
, riid
)) {
212 *ppvObj
= &(This
->IMediaControl_vtbl
);
213 TRACE(" returning IMediaControl interface (%p)\n", *ppvObj
);
214 } else if (IsEqualGUID(&IID_IMediaSeeking
, riid
)) {
215 *ppvObj
= &(This
->IMediaSeeking_vtbl
);
216 TRACE(" returning IMediaSeeking interface (%p)\n", *ppvObj
);
217 } else if (IsEqualGUID(&IID_IBasicAudio
, riid
)) {
218 *ppvObj
= &(This
->IBasicAudio_vtbl
);
219 TRACE(" returning IBasicAudio interface (%p)\n", *ppvObj
);
220 } else if (IsEqualGUID(&IID_IBasicVideo
, riid
)) {
221 *ppvObj
= &(This
->IBasicVideo_vtbl
);
222 TRACE(" returning IBasicVideo interface (%p)\n", *ppvObj
);
223 } else if (IsEqualGUID(&IID_IVideoWindow
, riid
)) {
224 *ppvObj
= &(This
->IVideoWindow_vtbl
);
225 TRACE(" returning IVideoWindow interface (%p)\n", *ppvObj
);
226 } else if (IsEqualGUID(&IID_IMediaEvent
, riid
) ||
227 IsEqualGUID(&IID_IMediaEventEx
, riid
)) {
228 *ppvObj
= &(This
->IMediaEventEx_vtbl
);
229 TRACE(" returning IMediaEvent(Ex) interface (%p)\n", *ppvObj
);
230 } else if (IsEqualGUID(&IID_IMediaFilter
, riid
) ||
231 IsEqualGUID(&IID_IPersist
, riid
)) {
232 *ppvObj
= &(This
->IMediaFilter_vtbl
);
233 TRACE(" returning IMediaFilter interface (%p)\n", *ppvObj
);
234 } else if (IsEqualGUID(&IID_IMediaEventSink
, riid
)) {
235 *ppvObj
= &(This
->IMediaEventSink_vtbl
);
236 TRACE(" returning IMediaEventSink interface (%p)\n", *ppvObj
);
237 } else if (IsEqualGUID(&IID_IGraphConfig
, riid
)) {
238 *ppvObj
= &(This
->IGraphConfig_vtbl
);
239 TRACE(" returning IGraphConfig interface (%p)\n", *ppvObj
);
240 } else if (IsEqualGUID(&IID_IMediaPosition
, riid
)) {
241 *ppvObj
= &(This
->IMediaPosition_vtbl
);
242 TRACE(" returning IMediaPosition interface (%p)\n", *ppvObj
);
245 FIXME("unknown interface %s\n", debugstr_guid(riid
));
246 return E_NOINTERFACE
;
249 InterlockedIncrement(&This
->ref
);
253 static ULONG
Filtergraph_AddRef(IFilterGraphImpl
*This
) {
254 ULONG ref
= InterlockedIncrement(&This
->ref
);
256 TRACE("(%p)->(): new ref = %d\n", This
, ref
);
261 static ULONG
Filtergraph_Release(IFilterGraphImpl
*This
) {
262 ULONG ref
= InterlockedDecrement(&This
->ref
);
264 TRACE("(%p)->(): new ref = %d\n", This
, ref
);
270 IReferenceClock_Release(This
->refClock
);
272 for (i
= 0; i
< This
->nFilters
; i
++)
274 IBaseFilter_SetSyncSource(This
->ppFiltersInGraph
[i
], NULL
);
275 IBaseFilter_Release(This
->ppFiltersInGraph
[i
]);
277 for (i
= 0; i
< This
->nItfCacheEntries
; i
++)
279 if (This
->ItfCacheEntries
[i
].iface
)
280 IUnknown_Release(This
->ItfCacheEntries
[i
].iface
);
282 IFilterMapper2_Release(This
->pFilterMapper2
);
283 CloseHandle(This
->hEventCompletion
);
284 EventsQueue_Destroy(&This
->evqueue
);
285 This
->cs
.DebugInfo
->Spare
[0] = 0;
286 DeleteCriticalSection(&This
->cs
);
287 CoTaskMemFree(This
->ppFiltersInGraph
);
288 CoTaskMemFree(This
->pFilterNames
);
295 /*** IUnknown methods ***/
296 static HRESULT WINAPI
GraphBuilder_QueryInterface(IGraphBuilder
*iface
,
299 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
301 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
302 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
305 static ULONG WINAPI
GraphBuilder_AddRef(IGraphBuilder
*iface
) {
306 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
308 TRACE("(%p/%p)->() calling FilterGraph AddRef\n", This
, iface
);
310 return Filtergraph_AddRef(This
);
313 static ULONG WINAPI
GraphBuilder_Release(IGraphBuilder
*iface
) {
314 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
316 TRACE("(%p/%p)->() calling FilterGraph Release\n", This
, iface
);
318 return Filtergraph_Release(This
);
321 /*** IFilterGraph methods ***/
322 static HRESULT WINAPI
GraphBuilder_AddFilter(IGraphBuilder
*iface
,
323 IBaseFilter
*pFilter
,
325 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
328 WCHAR
* wszFilterName
= NULL
;
329 int duplicate_name
= FALSE
;
331 TRACE("(%p/%p)->(%p, %s (%p))\n", This
, iface
, pFilter
, debugstr_w(pName
), pName
);
333 wszFilterName
= (WCHAR
*) CoTaskMemAlloc( (pName
? strlenW(pName
) + 6 : 5) * sizeof(WCHAR
) );
337 /* Check if name already exists */
338 for(i
= 0; i
< This
->nFilters
; i
++)
339 if (!strcmpW(This
->pFilterNames
[i
], pName
))
341 duplicate_name
= TRUE
;
346 /* If no name given or name already existing, generate one */
347 if (!pName
|| duplicate_name
)
349 static const WCHAR wszFmt1
[] = {'%','s',' ','%','0','4','d',0};
350 static const WCHAR wszFmt2
[] = {'%','0','4','d',0};
352 for (j
= 0; j
< 10000 ; j
++)
356 sprintfW(wszFilterName
, wszFmt1
, pName
, This
->nameIndex
);
358 sprintfW(wszFilterName
, wszFmt2
, This
->nameIndex
);
359 TRACE("Generated name %s\n", debugstr_w(wszFilterName
));
361 /* Check if the generated name already exists */
362 for(i
= 0; i
< This
->nFilters
; i
++)
363 if (!strcmpW(This
->pFilterNames
[i
], wszFilterName
))
366 /* Compute next index and exit if generated name is suitable */
367 if (This
->nameIndex
++ == 10000)
369 if (i
== This
->nFilters
)
372 /* Unable to find a suitable name */
375 CoTaskMemFree(wszFilterName
);
376 return VFW_E_DUPLICATE_NAME
;
380 memcpy(wszFilterName
, pName
, (strlenW(pName
) + 1) * sizeof(WCHAR
));
382 if (This
->nFilters
+ 1 > This
->filterCapacity
)
384 int newCapacity
= This
->filterCapacity
? 2 * This
->filterCapacity
: 1;
385 IBaseFilter
** ppNewFilters
= CoTaskMemAlloc(newCapacity
* sizeof(IBaseFilter
*));
386 LPWSTR
* pNewNames
= CoTaskMemAlloc(newCapacity
* sizeof(LPWSTR
));
387 memcpy(ppNewFilters
, This
->ppFiltersInGraph
, This
->nFilters
* sizeof(IBaseFilter
*));
388 memcpy(pNewNames
, This
->pFilterNames
, This
->nFilters
* sizeof(LPWSTR
));
389 if (!This
->filterCapacity
)
391 CoTaskMemFree(This
->ppFiltersInGraph
);
392 CoTaskMemFree(This
->pFilterNames
);
394 This
->ppFiltersInGraph
= ppNewFilters
;
395 This
->pFilterNames
= pNewNames
;
396 This
->filterCapacity
= newCapacity
;
399 hr
= IBaseFilter_JoinFilterGraph(pFilter
, (IFilterGraph
*)This
, wszFilterName
);
403 IBaseFilter_AddRef(pFilter
);
404 This
->ppFiltersInGraph
[This
->nFilters
] = pFilter
;
405 This
->pFilterNames
[This
->nFilters
] = wszFilterName
;
407 IBaseFilter_SetSyncSource(pFilter
, This
->refClock
);
410 CoTaskMemFree(wszFilterName
);
412 if (SUCCEEDED(hr
) && duplicate_name
)
413 return VFW_S_DUPLICATE_NAME
;
418 static HRESULT WINAPI
GraphBuilder_RemoveFilter(IGraphBuilder
*iface
,
419 IBaseFilter
*pFilter
) {
420 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
424 TRACE("(%p/%p)->(%p)\n", This
, iface
, pFilter
);
426 /* FIXME: check graph is stopped */
428 for (i
= 0; i
< This
->nFilters
; i
++)
430 if (This
->ppFiltersInGraph
[i
] == pFilter
)
432 IEnumPins
*penumpins
;
433 hr
= IBaseFilter_EnumPins(pFilter
, &penumpins
);
436 while(IEnumPins_Next(penumpins
, 1, &ppin
, NULL
) == S_OK
) {
437 IPin_Disconnect(ppin
);
440 IEnumPins_Release(penumpins
);
443 hr
= IBaseFilter_JoinFilterGraph(pFilter
, NULL
, This
->pFilterNames
[i
]);
446 IBaseFilter_SetSyncSource(pFilter
, NULL
);
447 IBaseFilter_Release(pFilter
);
448 CoTaskMemFree(This
->pFilterNames
[i
]);
449 memmove(This
->ppFiltersInGraph
+i
, This
->ppFiltersInGraph
+i
+1, sizeof(IBaseFilter
*)*(This
->nFilters
- 1 - i
));
450 memmove(This
->pFilterNames
+i
, This
->pFilterNames
+i
+1, sizeof(LPWSTR
)*(This
->nFilters
- 1 - i
));
452 /* Invalidate interfaces in the cache */
453 for (i
= 0; i
< This
->nItfCacheEntries
; i
++)
454 if (pFilter
== This
->ItfCacheEntries
[i
].filter
)
456 IUnknown_Release(This
->ItfCacheEntries
[i
].iface
);
457 This
->ItfCacheEntries
[i
].iface
= NULL
;
458 This
->ItfCacheEntries
[i
].filter
= NULL
;
466 return hr
; /* FIXME: check this error code */
469 static HRESULT WINAPI
GraphBuilder_EnumFilters(IGraphBuilder
*iface
,
470 IEnumFilters
**ppEnum
) {
471 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
473 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppEnum
);
475 return IEnumFiltersImpl_Construct(This
->ppFiltersInGraph
, This
->nFilters
, ppEnum
);
478 static HRESULT WINAPI
GraphBuilder_FindFilterByName(IGraphBuilder
*iface
,
480 IBaseFilter
**ppFilter
) {
481 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
484 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_w(pName
), pName
, ppFilter
);
488 for (i
= 0; i
< This
->nFilters
; i
++)
490 if (!strcmpW(pName
, This
->pFilterNames
[i
]))
492 *ppFilter
= This
->ppFiltersInGraph
[i
];
493 IBaseFilter_AddRef(*ppFilter
);
498 return E_FAIL
; /* FIXME: check this error code */
501 /* NOTE: despite the implication, it doesn't matter which
502 * way round you put in the input and output pins */
503 static HRESULT WINAPI
GraphBuilder_ConnectDirect(IGraphBuilder
*iface
,
506 const AM_MEDIA_TYPE
*pmt
) {
510 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
512 TRACE("(%p/%p)->(%p, %p, %p)\n", This
, iface
, ppinIn
, ppinOut
, pmt
);
514 /* FIXME: check pins are in graph */
516 if (TRACE_ON(quartz
))
520 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
524 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
525 IBaseFilter_Release(PinInfo
.pFilter
);
527 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
531 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
532 IBaseFilter_Release(PinInfo
.pFilter
);
535 hr
= IPin_QueryDirection(ppinIn
, &dir
);
538 if (dir
== PINDIR_INPUT
)
539 hr
= IPin_Connect(ppinOut
, ppinIn
, pmt
);
541 hr
= IPin_Connect(ppinIn
, ppinOut
, pmt
);
547 static HRESULT WINAPI
GraphBuilder_Reconnect(IGraphBuilder
*iface
,
549 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
550 IPin
*pConnectedTo
= NULL
;
552 PIN_DIRECTION pindir
;
554 IPin_QueryDirection(ppin
, &pindir
);
555 hr
= IPin_ConnectedTo(ppin
, &pConnectedTo
);
557 TRACE("Querying connected to failed: %x\n", hr
);
560 IPin_Disconnect(ppin
);
561 IPin_Disconnect(pConnectedTo
);
562 if (pindir
== PINDIR_INPUT
)
563 hr
= IPin_Connect(pConnectedTo
, ppin
, NULL
);
565 hr
= IPin_Connect(ppin
, pConnectedTo
, NULL
);
566 IPin_Release(pConnectedTo
);
568 ERR("Reconnecting pins failed, pins are not connected now..\n");
569 TRACE("(%p->%p) -- %p %p -> %x\n", iface
, This
, ppin
, pConnectedTo
, hr
);
573 static HRESULT WINAPI
GraphBuilder_Disconnect(IGraphBuilder
*iface
,
575 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
577 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppin
);
579 return IPin_Disconnect(ppin
);
582 static HRESULT WINAPI
GraphBuilder_SetDefaultSyncSource(IGraphBuilder
*iface
) {
583 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
585 TRACE("(%p/%p)->(): stub !!!\n", iface
, This
);
590 static HRESULT
GetFilterInfo(IMoniker
* pMoniker
, GUID
* pclsid
, VARIANT
* pvar
)
592 static const WCHAR wszClsidName
[] = {'C','L','S','I','D',0};
593 static const WCHAR wszFriendlyName
[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
594 IPropertyBag
* pPropBagCat
= NULL
;
598 V_VT(pvar
) = VT_BSTR
;
600 hr
= IMoniker_BindToStorage(pMoniker
, NULL
, NULL
, &IID_IPropertyBag
, (LPVOID
*)&pPropBagCat
);
603 hr
= IPropertyBag_Read(pPropBagCat
, wszClsidName
, pvar
, NULL
);
606 hr
= CLSIDFromString(V_UNION(pvar
, bstrVal
), pclsid
);
609 hr
= IPropertyBag_Read(pPropBagCat
, wszFriendlyName
, pvar
, NULL
);
612 TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid
), debugstr_w(V_UNION(pvar
, bstrVal
)));
615 IPropertyBag_Release(pPropBagCat
);
620 static HRESULT
GetInternalConnections(IBaseFilter
* pfilter
, IPin
* pinputpin
, IPin
*** pppins
, ULONG
* pnb
)
625 TRACE("(%p, %p, %p, %p)\n", pfilter
, pinputpin
, pppins
, pnb
);
626 hr
= IPin_QueryInternalConnections(pinputpin
, NULL
, &nb
);
629 } else if (hr
== S_FALSE
) {
630 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*nb
);
631 hr
= IPin_QueryInternalConnections(pinputpin
, *pppins
, &nb
);
633 ERR("Error (%x)\n", hr
);
635 } else if (hr
== E_NOTIMPL
) {
636 /* Input connected to all outputs */
637 IEnumPins
* penumpins
;
640 TRACE("E_NOTIMPL\n");
641 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
643 ERR("filter Enumpins failed (%x)\n", hr
);
647 /* Count output pins */
648 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
649 PIN_DIRECTION pindir
;
650 IPin_QueryDirection(ppin
, &pindir
);
651 if (pindir
== PINDIR_OUTPUT
)
655 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*i
);
656 /* Retrieve output pins */
657 IEnumPins_Reset(penumpins
);
659 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
660 PIN_DIRECTION pindir
;
661 IPin_QueryDirection(ppin
, &pindir
);
662 if (pindir
== PINDIR_OUTPUT
)
663 (*pppins
)[i
++] = ppin
;
667 IEnumPins_Release(penumpins
);
670 ERR("Next failed (%x)\n", hr
);
673 } else if (FAILED(hr
)) {
674 ERR("Cannot get internal connection (%x)\n", hr
);
682 /*** IGraphBuilder methods ***/
683 static HRESULT WINAPI
GraphBuilder_Connect(IGraphBuilder
*iface
,
686 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
689 IEnumMediaTypes
* penummt
;
691 IEnumPins
* penumpins
;
692 IEnumMoniker
* pEnumMoniker
;
700 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, ppinOut
, ppinIn
);
702 if (TRACE_ON(quartz
))
704 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
708 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
709 IBaseFilter_Release(PinInfo
.pFilter
);
711 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
715 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
716 IBaseFilter_Release(PinInfo
.pFilter
);
719 /* Try direct connection first */
720 hr
= IPin_Connect(ppinOut
, ppinIn
, NULL
);
724 TRACE("Direct connection failed, trying to insert other filters\n");
726 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
730 hr
= IBaseFilter_GetClassID(PinInfo
.pFilter
, &FilterCLSID
);
731 IBaseFilter_Release(PinInfo
.pFilter
);
735 /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream
736 * filter to the minor mediatype of input pin of the renderer */
737 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
739 ERR("EnumMediaTypes (%x)\n", hr
);
743 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
745 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
750 ERR("No media type found!\n");
753 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
754 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
756 /* Try to find a suitable filter that can connect to the pin to render */
757 tab
[0] = mt
->majortype
;
758 tab
[1] = mt
->subtype
;
759 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
761 ERR("Unable to enum filters (%x)\n", hr
);
765 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
770 IPin
* ppinfilter
= NULL
;
771 IBaseFilter
* pfilter
= NULL
;
773 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
774 IMoniker_Release(pMoniker
);
776 ERR("Unable to retrieve filter info (%x)\n", hr
);
780 if (IsEqualGUID(&clsid
, &FilterCLSID
)) {
781 /* Skip filter (same as the one the output pin belongs to) */
785 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
787 ERR("Unable to create filter (%x), trying next one\n", hr
);
791 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, V_UNION(&var
, bstrVal
));
793 ERR("Unable to add filter (%x)\n", hr
);
794 IBaseFilter_Release(pfilter
);
799 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
801 ERR("Enumpins (%x)\n", hr
);
805 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
806 IEnumPins_Release(penumpins
);
809 ERR("Next (%x)\n", hr
);
817 hr
= IPin_Connect(ppinOut
, ppinfilter
, NULL
);
819 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
822 TRACE("Successfully connected to filter, follow chain...\n");
824 /* Render all output pins of the filter by calling IGraphBuilder_Render on each of them */
825 hr
= GetInternalConnections(pfilter
, ppinfilter
, &ppins
, &nb
);
830 IPin_Disconnect(ppinOut
);
833 TRACE("pins to consider: %d\n", nb
);
834 for(i
= 0; i
< nb
; i
++) {
835 TRACE("Processing pin %d\n", i
);
836 hr
= IGraphBuilder_Connect(iface
, ppins
[i
], ppinIn
);
838 TRACE("Cannot render pin %p (%x)\n", ppinfilter
, hr
);
840 IPin_Release(ppins
[i
]);
841 if (SUCCEEDED(hr
)) break;
843 while (++i
< nb
) IPin_Release(ppins
[i
]);
844 CoTaskMemFree(ppins
);
845 IPin_Release(ppinfilter
);
846 IBaseFilter_Release(pfilter
);
851 if (ppinfilter
) IPin_Release(ppinfilter
);
853 IGraphBuilder_RemoveFilter(iface
, pfilter
);
854 IBaseFilter_Release(pfilter
);
858 IEnumMediaTypes_Release(penummt
);
864 static HRESULT WINAPI
GraphBuilder_Render(IGraphBuilder
*iface
,
866 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
867 IEnumMediaTypes
* penummt
;
872 IEnumMoniker
* pEnumMoniker
;
877 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppinOut
);
879 if (TRACE_ON(quartz
))
883 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
887 TRACE("Filter owning pin => %p\n", PinInfo
.pFilter
);
888 IBaseFilter_Release(PinInfo
.pFilter
);
891 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
893 ERR("EnumMediaTypes (%x)\n", hr
);
899 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
901 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
906 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
907 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
909 /* Try to find a suitable renderer with the same media type */
910 tab
[0] = mt
->majortype
;
912 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, TRUE
, FALSE
, 0, NULL
, NULL
, NULL
);
914 ERR("Unable to enum filters (%x)\n", hr
);
918 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
923 IBaseFilter
* pfilter
= NULL
;
924 IEnumPins
* penumpins
;
927 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
928 IMoniker_Release(pMoniker
);
930 ERR("Unable to retrieve filter info (%x)\n", hr
);
934 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
936 ERR("Unable to create filter (%x), trying next one\n", hr
);
940 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, V_UNION(&var
, bstrVal
));
942 ERR("Unable to add filter (%x)\n", hr
);
943 IBaseFilter_Release(pfilter
);
948 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
950 ERR("Splitter Enumpins (%x)\n", hr
);
953 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
954 IEnumPins_Release(penumpins
);
956 ERR("Next (%x)\n", hr
);
964 /* Connect the pin to render to the renderer */
965 hr
= IGraphBuilder_Connect(iface
, ppinOut
, ppinfilter
);
967 TRACE("Unable to connect to renderer (%x)\n", hr
);
968 IPin_Release(ppinfilter
);
971 IPin_Release(ppinfilter
);
972 IBaseFilter_Release(pfilter
);
978 IGraphBuilder_RemoveFilter(iface
, pfilter
);
979 IBaseFilter_Release(pfilter
);
987 IEnumMediaTypes_Release(penummt
);
992 static HRESULT WINAPI
GraphBuilder_RenderFile(IGraphBuilder
*iface
,
994 LPCWSTR lpcwstrPlayList
) {
995 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
996 static const WCHAR string
[] = {'R','e','a','d','e','r',0};
997 IBaseFilter
* preader
= NULL
;
998 IBaseFilter
* psplitter
= NULL
;
999 IPin
* ppinreader
= NULL
;
1000 IPin
* ppinsplitter
= NULL
;
1001 IEnumPins
* penumpins
;
1004 IEnumMoniker
* pEnumMoniker
= NULL
;
1006 IPin
** ppins
= NULL
;
1009 IFileSourceFilter
* pfile
= NULL
;
1013 TRACE("(%p/%p)->(%s, %s)\n", This
, iface
, debugstr_w(lpcwstrFile
), debugstr_w(lpcwstrPlayList
));
1015 if (lpcwstrPlayList
!= NULL
)
1016 return E_INVALIDARG
;
1018 hr
= IGraphBuilder_AddSourceFilter(iface
, lpcwstrFile
, string
, &preader
);
1020 /* Retrieve file media type */
1022 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1023 if (SUCCEEDED(hr
)) {
1024 hr
= IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1025 IFileSourceFilter_Release(pfile
);
1029 hr
= IBaseFilter_EnumPins(preader
, &penumpins
);
1030 if (SUCCEEDED(hr
)) {
1031 hr
= IEnumPins_Next(penumpins
, 1, &ppinreader
, &pin
);
1032 IEnumPins_Release(penumpins
);
1035 if (SUCCEEDED(hr
)) {
1036 tab
[0] = mt
.majortype
;
1037 tab
[1] = mt
.subtype
;
1038 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
1044 IPin_Release(ppinreader
);
1046 IEnumMoniker_Release(pEnumMoniker
);
1048 IGraphBuilder_RemoveFilter(iface
, preader
);
1049 IBaseFilter_Release(preader
);
1054 hr
= VFW_E_CANNOT_RENDER
;
1055 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
1060 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
1061 IMoniker_Release(pMoniker
);
1063 ERR("Unable to retrieve filter info (%x)\n", hr
);
1067 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&psplitter
);
1069 ERR("Unable to create filter (%x), trying next one\n", hr
);
1073 hr
= IGraphBuilder_AddFilter(iface
, psplitter
, V_UNION(&var
, bstrVal
));
1075 ERR("Unable add filter (%x)\n", hr
);
1076 IBaseFilter_Release(psplitter
);
1080 /* Connect file source and splitter filters together */
1081 /* Make the splitter analyze incoming data */
1083 hr
= IBaseFilter_EnumPins(psplitter
, &penumpins
);
1084 if (SUCCEEDED(hr
)) {
1085 hr
= IEnumPins_Next(penumpins
, 1, &ppinsplitter
, &pin
);
1086 IEnumPins_Release(penumpins
);
1090 hr
= IPin_Connect(ppinreader
, ppinsplitter
, NULL
);
1092 /* Make sure there's some output pins in the filter */
1094 hr
= GetInternalConnections(psplitter
, ppinsplitter
, &ppins
, &nb
);
1095 if (SUCCEEDED(hr
)) {
1097 IPin_Disconnect(ppinreader
);
1098 TRACE("No output pins found in filter\n");
1099 hr
= VFW_E_CANNOT_RENDER
;
1104 IPin_Release(ppinsplitter
);
1105 ppinsplitter
= NULL
;
1107 if (SUCCEEDED(hr
)) {
1108 TRACE("Successfully connected to filter\n");
1112 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
1115 CoTaskMemFree(ppins
);
1118 IGraphBuilder_RemoveFilter(iface
, psplitter
);
1119 IBaseFilter_Release(psplitter
);
1123 /* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
1124 if (SUCCEEDED(hr
)) {
1127 TRACE("pins to consider: %d\n", nb
);
1128 for(i
= 0; i
< nb
; i
++) {
1129 TRACE("Processing pin %d\n", i
);
1130 hr
= IGraphBuilder_Render(iface
, ppins
[i
]);
1132 ERR("Cannot render pin %p (%x)\n", ppins
[i
], hr
);
1135 IPin_Release(ppins
[i
]);
1137 CoTaskMemFree(ppins
);
1139 hr
= (partial
? VFW_S_PARTIAL_RENDER
: S_OK
);
1142 IPin_Release(ppinreader
);
1143 IBaseFilter_Release(preader
);
1145 IBaseFilter_Release(psplitter
);
1150 static HRESULT WINAPI
GraphBuilder_AddSourceFilter(IGraphBuilder
*iface
,
1151 LPCWSTR lpcwstrFileName
,
1152 LPCWSTR lpcwstrFilterName
,
1153 IBaseFilter
**ppFilter
) {
1154 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1156 IBaseFilter
* preader
;
1157 IFileSourceFilter
* pfile
= NULL
;
1161 TRACE("(%p/%p)->(%s, %s, %p)\n", This
, iface
, debugstr_w(lpcwstrFileName
), debugstr_w(lpcwstrFilterName
), ppFilter
);
1163 /* Instantiate a file source filter */
1164 hr
= CoCreateInstance(&CLSID_AsyncReader
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&preader
);
1166 ERR("Unable to create file source filter (%x)\n", hr
);
1170 hr
= IGraphBuilder_AddFilter(iface
, preader
, lpcwstrFilterName
);
1172 ERR("Unable add filter (%x)\n", hr
);
1173 IBaseFilter_Release(preader
);
1177 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1179 ERR("Unable to get IFileSourceInterface (%x)\n", hr
);
1183 /* Load the file in the file source filter */
1184 hr
= IFileSourceFilter_Load(pfile
, lpcwstrFileName
, NULL
);
1186 ERR("Load (%x)\n", hr
);
1190 IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1192 ERR("GetCurFile (%x)\n", hr
);
1195 TRACE("File %s\n", debugstr_w(filename
));
1196 TRACE("MajorType %s\n", debugstr_guid(&mt
.majortype
));
1197 TRACE("SubType %s\n", debugstr_guid(&mt
.subtype
));
1200 *ppFilter
= preader
;
1201 IFileSourceFilter_Release(pfile
);
1207 IFileSourceFilter_Release(pfile
);
1208 IGraphBuilder_RemoveFilter(iface
, preader
);
1209 IBaseFilter_Release(preader
);
1214 static HRESULT WINAPI
GraphBuilder_SetLogFile(IGraphBuilder
*iface
,
1216 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1218 TRACE("(%p/%p)->(%08x): stub !!!\n", This
, iface
, (DWORD
) hFile
);
1223 static HRESULT WINAPI
GraphBuilder_Abort(IGraphBuilder
*iface
) {
1224 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1226 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1231 static HRESULT WINAPI
GraphBuilder_ShouldOperationContinue(IGraphBuilder
*iface
) {
1232 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1234 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1240 static const IGraphBuilderVtbl IGraphBuilder_VTable
=
1242 GraphBuilder_QueryInterface
,
1243 GraphBuilder_AddRef
,
1244 GraphBuilder_Release
,
1245 GraphBuilder_AddFilter
,
1246 GraphBuilder_RemoveFilter
,
1247 GraphBuilder_EnumFilters
,
1248 GraphBuilder_FindFilterByName
,
1249 GraphBuilder_ConnectDirect
,
1250 GraphBuilder_Reconnect
,
1251 GraphBuilder_Disconnect
,
1252 GraphBuilder_SetDefaultSyncSource
,
1253 GraphBuilder_Connect
,
1254 GraphBuilder_Render
,
1255 GraphBuilder_RenderFile
,
1256 GraphBuilder_AddSourceFilter
,
1257 GraphBuilder_SetLogFile
,
1259 GraphBuilder_ShouldOperationContinue
1262 /*** IUnknown methods ***/
1263 static HRESULT WINAPI
MediaControl_QueryInterface(IMediaControl
*iface
,
1266 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1268 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1270 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1273 static ULONG WINAPI
MediaControl_AddRef(IMediaControl
*iface
) {
1274 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1276 TRACE("(%p/%p)->()\n", This
, iface
);
1278 return Filtergraph_AddRef(This
);
1281 static ULONG WINAPI
MediaControl_Release(IMediaControl
*iface
) {
1282 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1284 TRACE("(%p/%p)->()\n", This
, iface
);
1286 return Filtergraph_Release(This
);
1290 /*** IDispatch methods ***/
1291 static HRESULT WINAPI
MediaControl_GetTypeInfoCount(IMediaControl
*iface
,
1293 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1295 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1300 static HRESULT WINAPI
MediaControl_GetTypeInfo(IMediaControl
*iface
,
1303 ITypeInfo
**ppTInfo
) {
1304 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1306 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1311 static HRESULT WINAPI
MediaControl_GetIDsOfNames(IMediaControl
*iface
,
1317 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1319 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1324 static HRESULT WINAPI
MediaControl_Invoke(IMediaControl
*iface
,
1325 DISPID dispIdMember
,
1329 DISPPARAMS
*pDispParams
,
1331 EXCEPINFO
*pExepInfo
,
1333 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1335 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
);
1340 typedef HRESULT(WINAPI
*fnFoundFilter
)(IBaseFilter
*);
1342 static HRESULT
ExploreGraph(IFilterGraphImpl
* pGraph
, IPin
* pOutputPin
, fnFoundFilter FoundFilter
)
1351 TRACE("%p %p\n", pGraph
, pOutputPin
);
1352 PinInfo
.pFilter
= NULL
;
1354 hr
= IPin_ConnectedTo(pOutputPin
, &pInputPin
);
1358 hr
= IPin_QueryPinInfo(pInputPin
, &PinInfo
);
1360 hr
= GetInternalConnections(PinInfo
.pFilter
, pInputPin
, &ppPins
, &nb
);
1361 IPin_Release(pInputPin
);
1368 TRACE("Reached a renderer\n");
1369 /* Count renderers for end of stream notification */
1370 pGraph
->nRenderers
++;
1374 for(i
= 0; i
< nb
; i
++)
1376 /* Explore the graph downstream from this pin
1377 * FIXME: We should prevent exploring from a pin more than once. This can happens when
1378 * several input pins are connected to the same output (a MUX for instance). */
1379 ExploreGraph(pGraph
, ppPins
[i
], FoundFilter
);
1380 IPin_Release(ppPins
[i
]);
1383 CoTaskMemFree(ppPins
);
1385 TRACE("Doing stuff with filter %p\n", PinInfo
.pFilter
);
1386 FoundFilter(PinInfo
.pFilter
);
1389 if (PinInfo
.pFilter
) IBaseFilter_Release(PinInfo
.pFilter
);
1393 static HRESULT WINAPI
SendRun(IBaseFilter
*pFilter
) {
1394 return IBaseFilter_Run(pFilter
, 0);
1397 static HRESULT WINAPI
SendPause(IBaseFilter
*pFilter
) {
1398 return IBaseFilter_Pause(pFilter
);
1401 static HRESULT WINAPI
SendStop(IBaseFilter
*pFilter
) {
1402 return IBaseFilter_Stop(pFilter
);
1405 static HRESULT
SendFilterMessage(IMediaControl
*iface
, fnFoundFilter FoundFilter
) {
1406 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1408 IBaseFilter
* pfilter
;
1414 TRACE("(%p/%p)->()\n", This
, iface
);
1416 /* Explorer the graph from source filters to renderers, determine renderers
1417 * number and run filters from renderers to source filters */
1418 This
->nRenderers
= 0;
1419 ResetEvent(This
->hEventCompletion
);
1421 for(i
= 0; i
< This
->nFilters
; i
++)
1424 pfilter
= This
->ppFiltersInGraph
[i
];
1425 hr
= IBaseFilter_EnumPins(pfilter
, &pEnum
);
1428 ERR("Enum pins failed %x\n", hr
);
1431 /* Check if it is a source filter */
1432 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1434 IPin_QueryDirection(pPin
, &dir
);
1436 if (dir
== PINDIR_INPUT
)
1444 TRACE("Found a source filter %p\n", pfilter
);
1445 IEnumPins_Reset(pEnum
);
1446 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1448 /* Explore the graph downstream from this pin */
1449 ExploreGraph(This
, pPin
, FoundFilter
);
1452 FoundFilter(pfilter
);
1454 IEnumPins_Release(pEnum
);
1460 /*** IMediaControl methods ***/
1461 static HRESULT WINAPI
MediaControl_Run(IMediaControl
*iface
) {
1462 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1463 TRACE("(%p/%p)->()\n", This
, iface
);
1465 if (This
->state
== State_Running
) return S_OK
;
1467 EnterCriticalSection(&This
->cs
);
1468 SendFilterMessage(iface
, SendRun
);
1469 This
->state
= State_Running
;
1470 LeaveCriticalSection(&This
->cs
);
1474 static HRESULT WINAPI
MediaControl_Pause(IMediaControl
*iface
) {
1475 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1476 TRACE("(%p/%p)->()\n", This
, iface
);
1478 if (This
->state
== State_Paused
) return S_OK
;
1480 EnterCriticalSection(&This
->cs
);
1481 SendFilterMessage(iface
, SendPause
);
1482 This
->state
= State_Paused
;
1483 LeaveCriticalSection(&This
->cs
);
1487 static HRESULT WINAPI
MediaControl_Stop(IMediaControl
*iface
) {
1488 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1489 TRACE("(%p/%p)->()\n", This
, iface
);
1491 if (This
->state
== State_Stopped
) return S_OK
;
1493 EnterCriticalSection(&This
->cs
);
1494 if (This
->state
== State_Running
) SendFilterMessage(iface
, SendPause
);
1495 SendFilterMessage(iface
, SendStop
);
1496 This
->state
= State_Stopped
;
1497 LeaveCriticalSection(&This
->cs
);
1501 static HRESULT WINAPI
MediaControl_GetState(IMediaControl
*iface
,
1503 OAFilterState
*pfs
) {
1504 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1506 TRACE("(%p/%p)->(%d, %p): semi-stub !!!\n", This
, iface
, msTimeout
, pfs
);
1508 EnterCriticalSection(&This
->cs
);
1512 LeaveCriticalSection(&This
->cs
);
1517 static HRESULT WINAPI
MediaControl_RenderFile(IMediaControl
*iface
,
1519 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1521 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
);
1526 static HRESULT WINAPI
MediaControl_AddSourceFilter(IMediaControl
*iface
,
1528 IDispatch
**ppUnk
) {
1529 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1531 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
, ppUnk
);
1536 static HRESULT WINAPI
MediaControl_get_FilterCollection(IMediaControl
*iface
,
1537 IDispatch
**ppUnk
) {
1538 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1540 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1545 static HRESULT WINAPI
MediaControl_get_RegFilterCollection(IMediaControl
*iface
,
1546 IDispatch
**ppUnk
) {
1547 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1549 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1554 static HRESULT WINAPI
MediaControl_StopWhenReady(IMediaControl
*iface
) {
1555 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1557 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1563 static const IMediaControlVtbl IMediaControl_VTable
=
1565 MediaControl_QueryInterface
,
1566 MediaControl_AddRef
,
1567 MediaControl_Release
,
1568 MediaControl_GetTypeInfoCount
,
1569 MediaControl_GetTypeInfo
,
1570 MediaControl_GetIDsOfNames
,
1571 MediaControl_Invoke
,
1575 MediaControl_GetState
,
1576 MediaControl_RenderFile
,
1577 MediaControl_AddSourceFilter
,
1578 MediaControl_get_FilterCollection
,
1579 MediaControl_get_RegFilterCollection
,
1580 MediaControl_StopWhenReady
1584 /*** IUnknown methods ***/
1585 static HRESULT WINAPI
MediaSeeking_QueryInterface(IMediaSeeking
*iface
,
1588 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1590 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1592 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1595 static ULONG WINAPI
MediaSeeking_AddRef(IMediaSeeking
*iface
) {
1596 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1598 TRACE("(%p/%p)->()\n", This
, iface
);
1600 return Filtergraph_AddRef(This
);
1603 static ULONG WINAPI
MediaSeeking_Release(IMediaSeeking
*iface
) {
1604 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1606 TRACE("(%p/%p)->()\n", This
, iface
);
1608 return Filtergraph_Release(This
);
1611 /*** IMediaSeeking methods ***/
1612 static HRESULT WINAPI
MediaSeeking_GetCapabilities(IMediaSeeking
*iface
,
1613 DWORD
*pCapabilities
) {
1614 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1616 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1621 static HRESULT WINAPI
MediaSeeking_CheckCapabilities(IMediaSeeking
*iface
,
1622 DWORD
*pCapabilities
) {
1623 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1625 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1630 static HRESULT WINAPI
MediaSeeking_IsFormatSupported(IMediaSeeking
*iface
,
1631 const GUID
*pFormat
) {
1632 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1634 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1639 static HRESULT WINAPI
MediaSeeking_QueryPreferredFormat(IMediaSeeking
*iface
,
1641 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1643 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1648 static HRESULT WINAPI
MediaSeeking_GetTimeFormat(IMediaSeeking
*iface
,
1650 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1652 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1657 static HRESULT WINAPI
MediaSeeking_IsUsingTimeFormat(IMediaSeeking
*iface
,
1658 const GUID
*pFormat
) {
1659 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1661 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1666 static HRESULT WINAPI
MediaSeeking_SetTimeFormat(IMediaSeeking
*iface
,
1667 const GUID
*pFormat
) {
1668 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1670 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1675 static HRESULT WINAPI
MediaSeeking_GetDuration(IMediaSeeking
*iface
,
1676 LONGLONG
*pDuration
) {
1677 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1679 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDuration
);
1684 static HRESULT WINAPI
MediaSeeking_GetStopPosition(IMediaSeeking
*iface
,
1686 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1688 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pStop
);
1693 static HRESULT WINAPI
MediaSeeking_GetCurrentPosition(IMediaSeeking
*iface
,
1694 LONGLONG
*pCurrent
) {
1695 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1697 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCurrent
);
1702 static HRESULT WINAPI
MediaSeeking_ConvertTimeFormat(IMediaSeeking
*iface
,
1704 const GUID
*pTargetFormat
,
1706 const GUID
*pSourceFormat
) {
1707 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1709 TRACE("(%p/%p)->(%p, %p, 0x%s, %p): stub !!!\n", This
, iface
, pTarget
,
1710 pTargetFormat
, wine_dbgstr_longlong(Source
), pSourceFormat
);
1715 static HRESULT WINAPI
MediaSeeking_SetPositions(IMediaSeeking
*iface
,
1717 DWORD dwCurrentFlags
,
1719 DWORD dwStopFlags
) {
1720 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1722 TRACE("(%p/%p)->(%p, %08x, %p, %08x): stub !!!\n", This
, iface
, pCurrent
, dwCurrentFlags
, pStop
, dwStopFlags
);
1727 static HRESULT WINAPI
MediaSeeking_GetPositions(IMediaSeeking
*iface
,
1730 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1732 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pCurrent
, pStop
);
1737 static HRESULT WINAPI
MediaSeeking_GetAvailable(IMediaSeeking
*iface
,
1738 LONGLONG
*pEarliest
,
1739 LONGLONG
*pLatest
) {
1740 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1742 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pEarliest
, pLatest
);
1747 static HRESULT WINAPI
MediaSeeking_SetRate(IMediaSeeking
*iface
,
1749 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1751 TRACE("(%p/%p)->(%f): stub !!!\n", This
, iface
, dRate
);
1756 static HRESULT WINAPI
MediaSeeking_GetRate(IMediaSeeking
*iface
,
1758 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1760 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pdRate
);
1765 static HRESULT WINAPI
MediaSeeking_GetPreroll(IMediaSeeking
*iface
,
1766 LONGLONG
*pllPreroll
) {
1767 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1769 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pllPreroll
);
1775 static const IMediaSeekingVtbl IMediaSeeking_VTable
=
1777 MediaSeeking_QueryInterface
,
1778 MediaSeeking_AddRef
,
1779 MediaSeeking_Release
,
1780 MediaSeeking_GetCapabilities
,
1781 MediaSeeking_CheckCapabilities
,
1782 MediaSeeking_IsFormatSupported
,
1783 MediaSeeking_QueryPreferredFormat
,
1784 MediaSeeking_GetTimeFormat
,
1785 MediaSeeking_IsUsingTimeFormat
,
1786 MediaSeeking_SetTimeFormat
,
1787 MediaSeeking_GetDuration
,
1788 MediaSeeking_GetStopPosition
,
1789 MediaSeeking_GetCurrentPosition
,
1790 MediaSeeking_ConvertTimeFormat
,
1791 MediaSeeking_SetPositions
,
1792 MediaSeeking_GetPositions
,
1793 MediaSeeking_GetAvailable
,
1794 MediaSeeking_SetRate
,
1795 MediaSeeking_GetRate
,
1796 MediaSeeking_GetPreroll
1799 /*** IUnknown methods ***/
1800 static HRESULT WINAPI
MediaPosition_QueryInterface(IMediaPosition
* iface
, REFIID riid
, void** ppvObj
){
1801 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1803 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1805 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1808 static ULONG WINAPI
MediaPosition_AddRef(IMediaPosition
*iface
){
1809 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1811 TRACE("(%p/%p)->()\n", This
, iface
);
1813 return Filtergraph_AddRef(This
);
1816 static ULONG WINAPI
MediaPosition_Release(IMediaPosition
*iface
){
1817 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1819 TRACE("(%p/%p)->()\n", This
, iface
);
1821 return Filtergraph_Release(This
);
1824 /*** IDispatch methods ***/
1825 static HRESULT WINAPI
MediaPosition_GetTypeInfoCount(IMediaPosition
*iface
, UINT
* pctinfo
){
1826 FIXME("(%p) stub!\n", iface
);
1830 static HRESULT WINAPI
MediaPosition_GetTypeInfo(IMediaPosition
*iface
, UINT iTInfo
, LCID lcid
, ITypeInfo
** ppTInfo
){
1831 FIXME("(%p) stub!\n", iface
);
1835 static HRESULT WINAPI
MediaPosition_GetIDsOfNames(IMediaPosition
* iface
, REFIID riid
, LPOLESTR
* rgszNames
, UINT cNames
, LCID lcid
, DISPID
* rgDispId
){
1836 FIXME("(%p) stub!\n", iface
);
1840 static HRESULT WINAPI
MediaPosition_Invoke(IMediaPosition
* iface
, DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
* pDispParams
, VARIANT
* pVarResult
, EXCEPINFO
* pExcepInfo
, UINT
* puArgErr
){
1841 FIXME("(%p) stub!\n", iface
);
1845 /*** IMediaPosition methods ***/
1846 static HRESULT WINAPI
MediaPosition_get_Duration(IMediaPosition
* iface
, REFTIME
*plength
){
1847 FIXME("(%p)->(%p) stub!\n", iface
, plength
);
1851 static HRESULT WINAPI
MediaPosition_put_CurrentPosition(IMediaPosition
* iface
, REFTIME llTime
){
1852 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1856 static HRESULT WINAPI
MediaPosition_get_CurrentPosition(IMediaPosition
* iface
, REFTIME
*pllTime
){
1857 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1861 static HRESULT WINAPI
MediaPosition_get_StopTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1862 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1866 static HRESULT WINAPI
MediaPosition_put_StopTime(IMediaPosition
* iface
, REFTIME llTime
){
1867 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1871 static HRESULT WINAPI
MediaPosition_get_PrerollTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1872 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1876 static HRESULT WINAPI
MediaPosition_put_PrerollTime(IMediaPosition
* iface
, REFTIME llTime
){
1877 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1881 static HRESULT WINAPI
MediaPosition_put_Rate(IMediaPosition
* iface
, double dRate
){
1882 FIXME("(%p)->(%f) stub!\n", iface
, dRate
);
1886 static HRESULT WINAPI
MediaPosition_get_Rate(IMediaPosition
* iface
, double *pdRate
){
1887 FIXME("(%p)->(%p) stub!\n", iface
, pdRate
);
1891 static HRESULT WINAPI
MediaPosition_CanSeekForward(IMediaPosition
* iface
, LONG
*pCanSeekForward
){
1892 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekForward
);
1896 static HRESULT WINAPI
MediaPosition_CanSeekBackward(IMediaPosition
* iface
, LONG
*pCanSeekBackward
){
1897 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekBackward
);
1902 static const IMediaPositionVtbl IMediaPosition_VTable
=
1904 MediaPosition_QueryInterface
,
1905 MediaPosition_AddRef
,
1906 MediaPosition_Release
,
1907 MediaPosition_GetTypeInfoCount
,
1908 MediaPosition_GetTypeInfo
,
1909 MediaPosition_GetIDsOfNames
,
1910 MediaPosition_Invoke
,
1911 MediaPosition_get_Duration
,
1912 MediaPosition_put_CurrentPosition
,
1913 MediaPosition_get_CurrentPosition
,
1914 MediaPosition_get_StopTime
,
1915 MediaPosition_put_StopTime
,
1916 MediaPosition_get_PrerollTime
,
1917 MediaPosition_put_PrerollTime
,
1918 MediaPosition_put_Rate
,
1919 MediaPosition_get_Rate
,
1920 MediaPosition_CanSeekForward
,
1921 MediaPosition_CanSeekBackward
1924 static HRESULT
GetTargetInterface(IFilterGraphImpl
* pGraph
, REFIID riid
, LPVOID
* ppvObj
)
1926 HRESULT hr
= E_NOINTERFACE
;
1930 /* Check if the interface type is already registered */
1931 for (entry
= 0; entry
< pGraph
->nItfCacheEntries
; entry
++)
1932 if (riid
== pGraph
->ItfCacheEntries
[entry
].riid
)
1934 if (pGraph
->ItfCacheEntries
[entry
].iface
)
1936 /* Return the interface if available */
1937 *ppvObj
= pGraph
->ItfCacheEntries
[entry
].iface
;
1943 if (entry
>= MAX_ITF_CACHE_ENTRIES
)
1945 FIXME("Not enough space to store interface in the cache\n");
1946 return E_OUTOFMEMORY
;
1949 /* Find a filter supporting the requested interface */
1950 for (i
= 0; i
< pGraph
->nFilters
; i
++)
1952 hr
= IBaseFilter_QueryInterface(pGraph
->ppFiltersInGraph
[i
], riid
, ppvObj
);
1955 pGraph
->ItfCacheEntries
[entry
].riid
= riid
;
1956 pGraph
->ItfCacheEntries
[entry
].filter
= pGraph
->ppFiltersInGraph
[i
];
1957 pGraph
->ItfCacheEntries
[entry
].iface
= (IUnknown
*)*ppvObj
;
1958 if (entry
>= pGraph
->nItfCacheEntries
)
1959 pGraph
->nItfCacheEntries
++;
1962 if (hr
!= E_NOINTERFACE
)
1969 /*** IUnknown methods ***/
1970 static HRESULT WINAPI
BasicAudio_QueryInterface(IBasicAudio
*iface
,
1973 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1975 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1977 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1980 static ULONG WINAPI
BasicAudio_AddRef(IBasicAudio
*iface
) {
1981 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1983 TRACE("(%p/%p)->()\n", This
, iface
);
1985 return Filtergraph_AddRef(This
);
1988 static ULONG WINAPI
BasicAudio_Release(IBasicAudio
*iface
) {
1989 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1991 TRACE("(%p/%p)->()\n", This
, iface
);
1993 return Filtergraph_Release(This
);
1996 /*** IDispatch methods ***/
1997 static HRESULT WINAPI
BasicAudio_GetTypeInfoCount(IBasicAudio
*iface
,
1999 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2000 IBasicAudio
* pBasicAudio
;
2003 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
2005 EnterCriticalSection(&This
->cs
);
2007 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2010 hr
= IBasicAudio_GetTypeInfoCount(pBasicAudio
, pctinfo
);
2012 LeaveCriticalSection(&This
->cs
);
2017 static HRESULT WINAPI
BasicAudio_GetTypeInfo(IBasicAudio
*iface
,
2020 ITypeInfo
**ppTInfo
) {
2021 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2022 IBasicAudio
* pBasicAudio
;
2025 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2027 EnterCriticalSection(&This
->cs
);
2029 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2032 hr
= IBasicAudio_GetTypeInfo(pBasicAudio
, iTInfo
, lcid
, ppTInfo
);
2034 LeaveCriticalSection(&This
->cs
);
2039 static HRESULT WINAPI
BasicAudio_GetIDsOfNames(IBasicAudio
*iface
,
2045 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2046 IBasicAudio
* pBasicAudio
;
2049 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2051 EnterCriticalSection(&This
->cs
);
2053 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2056 hr
= IBasicAudio_GetIDsOfNames(pBasicAudio
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2058 LeaveCriticalSection(&This
->cs
);
2063 static HRESULT WINAPI
BasicAudio_Invoke(IBasicAudio
*iface
,
2064 DISPID dispIdMember
,
2068 DISPPARAMS
*pDispParams
,
2070 EXCEPINFO
*pExepInfo
,
2072 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2073 IBasicAudio
* pBasicAudio
;
2076 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
);
2078 EnterCriticalSection(&This
->cs
);
2080 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2083 hr
= IBasicAudio_Invoke(pBasicAudio
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2085 LeaveCriticalSection(&This
->cs
);
2090 /*** IBasicAudio methods ***/
2091 static HRESULT WINAPI
BasicAudio_put_Volume(IBasicAudio
*iface
,
2093 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2094 IBasicAudio
* pBasicAudio
;
2097 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lVolume
);
2099 EnterCriticalSection(&This
->cs
);
2101 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2104 hr
= IBasicAudio_put_Volume(pBasicAudio
, lVolume
);
2106 LeaveCriticalSection(&This
->cs
);
2111 static HRESULT WINAPI
BasicAudio_get_Volume(IBasicAudio
*iface
,
2113 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2114 IBasicAudio
* pBasicAudio
;
2117 TRACE("(%p/%p)->(%p)\n", This
, iface
, plVolume
);
2119 EnterCriticalSection(&This
->cs
);
2121 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2124 hr
= IBasicAudio_get_Volume(pBasicAudio
, plVolume
);
2126 LeaveCriticalSection(&This
->cs
);
2131 static HRESULT WINAPI
BasicAudio_put_Balance(IBasicAudio
*iface
,
2133 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2134 IBasicAudio
* pBasicAudio
;
2137 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lBalance
);
2139 EnterCriticalSection(&This
->cs
);
2141 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2144 hr
= IBasicAudio_put_Balance(pBasicAudio
, lBalance
);
2146 LeaveCriticalSection(&This
->cs
);
2151 static HRESULT WINAPI
BasicAudio_get_Balance(IBasicAudio
*iface
,
2153 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2154 IBasicAudio
* pBasicAudio
;
2157 TRACE("(%p/%p)->(%p)\n", This
, iface
, plBalance
);
2159 EnterCriticalSection(&This
->cs
);
2161 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2164 hr
= IBasicAudio_get_Balance(pBasicAudio
, plBalance
);
2166 LeaveCriticalSection(&This
->cs
);
2171 static const IBasicAudioVtbl IBasicAudio_VTable
=
2173 BasicAudio_QueryInterface
,
2176 BasicAudio_GetTypeInfoCount
,
2177 BasicAudio_GetTypeInfo
,
2178 BasicAudio_GetIDsOfNames
,
2180 BasicAudio_put_Volume
,
2181 BasicAudio_get_Volume
,
2182 BasicAudio_put_Balance
,
2183 BasicAudio_get_Balance
2186 /*** IUnknown methods ***/
2187 static HRESULT WINAPI
BasicVideo_QueryInterface(IBasicVideo
*iface
,
2190 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2192 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2194 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2197 static ULONG WINAPI
BasicVideo_AddRef(IBasicVideo
*iface
) {
2198 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2200 TRACE("(%p/%p)->()\n", This
, iface
);
2202 return Filtergraph_AddRef(This
);
2205 static ULONG WINAPI
BasicVideo_Release(IBasicVideo
*iface
) {
2206 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2208 TRACE("(%p/%p)->()\n", This
, iface
);
2210 return Filtergraph_Release(This
);
2213 /*** IDispatch methods ***/
2214 static HRESULT WINAPI
BasicVideo_GetTypeInfoCount(IBasicVideo
*iface
,
2216 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2217 IBasicVideo
* pBasicVideo
;
2220 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
2222 EnterCriticalSection(&This
->cs
);
2224 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2227 hr
= IBasicVideo_GetTypeInfoCount(pBasicVideo
, pctinfo
);
2229 LeaveCriticalSection(&This
->cs
);
2234 static HRESULT WINAPI
BasicVideo_GetTypeInfo(IBasicVideo
*iface
,
2237 ITypeInfo
**ppTInfo
) {
2238 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2239 IBasicVideo
* pBasicVideo
;
2242 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2244 EnterCriticalSection(&This
->cs
);
2246 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2249 hr
= IBasicVideo_GetTypeInfo(pBasicVideo
, iTInfo
, lcid
, ppTInfo
);
2251 LeaveCriticalSection(&This
->cs
);
2256 static HRESULT WINAPI
BasicVideo_GetIDsOfNames(IBasicVideo
*iface
,
2262 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2263 IBasicVideo
* pBasicVideo
;
2266 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2268 EnterCriticalSection(&This
->cs
);
2270 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2273 hr
= IBasicVideo_GetIDsOfNames(pBasicVideo
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2275 LeaveCriticalSection(&This
->cs
);
2280 static HRESULT WINAPI
BasicVideo_Invoke(IBasicVideo
*iface
,
2281 DISPID dispIdMember
,
2285 DISPPARAMS
*pDispParams
,
2287 EXCEPINFO
*pExepInfo
,
2289 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2290 IBasicVideo
* pBasicVideo
;
2293 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
);
2295 EnterCriticalSection(&This
->cs
);
2297 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2300 hr
= IBasicVideo_Invoke(pBasicVideo
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2302 LeaveCriticalSection(&This
->cs
);
2307 /*** IBasicVideo methods ***/
2308 static HRESULT WINAPI
BasicVideo_get_AvgTimePerFrame(IBasicVideo
*iface
,
2309 REFTIME
*pAvgTimePerFrame
) {
2310 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2311 IBasicVideo
* pBasicVideo
;
2314 TRACE("(%p/%p)->(%p)\n", This
, iface
, pAvgTimePerFrame
);
2316 EnterCriticalSection(&This
->cs
);
2318 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2321 hr
= IBasicVideo_get_AvgTimePerFrame(pBasicVideo
, pAvgTimePerFrame
);
2323 LeaveCriticalSection(&This
->cs
);
2328 static HRESULT WINAPI
BasicVideo_get_BitRate(IBasicVideo
*iface
,
2330 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2331 IBasicVideo
* pBasicVideo
;
2334 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitRate
);
2336 EnterCriticalSection(&This
->cs
);
2338 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2341 hr
= IBasicVideo_get_BitRate(pBasicVideo
, pBitRate
);
2343 LeaveCriticalSection(&This
->cs
);
2348 static HRESULT WINAPI
BasicVideo_get_BitErrorRate(IBasicVideo
*iface
,
2349 long *pBitErrorRate
) {
2350 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2351 IBasicVideo
* pBasicVideo
;
2354 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitErrorRate
);
2356 EnterCriticalSection(&This
->cs
);
2358 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2361 hr
= IBasicVideo_get_BitErrorRate(pBasicVideo
, pBitErrorRate
);
2363 LeaveCriticalSection(&This
->cs
);
2368 static HRESULT WINAPI
BasicVideo_get_VideoWidth(IBasicVideo
*iface
,
2369 long *pVideoWidth
) {
2370 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2371 IBasicVideo
* pBasicVideo
;
2374 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoWidth
);
2376 EnterCriticalSection(&This
->cs
);
2378 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2381 hr
= IBasicVideo_get_VideoWidth(pBasicVideo
, pVideoWidth
);
2383 LeaveCriticalSection(&This
->cs
);
2388 static HRESULT WINAPI
BasicVideo_get_VideoHeight(IBasicVideo
*iface
,
2389 long *pVideoHeight
) {
2390 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2391 IBasicVideo
* pBasicVideo
;
2394 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoHeight
);
2396 EnterCriticalSection(&This
->cs
);
2398 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2401 hr
= IBasicVideo_get_VideoHeight(pBasicVideo
, pVideoHeight
);
2403 LeaveCriticalSection(&This
->cs
);
2408 static HRESULT WINAPI
BasicVideo_put_SourceLeft(IBasicVideo
*iface
,
2410 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2411 IBasicVideo
* pBasicVideo
;
2414 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceLeft
);
2416 EnterCriticalSection(&This
->cs
);
2418 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2421 hr
= IBasicVideo_put_SourceLeft(pBasicVideo
, SourceLeft
);
2423 LeaveCriticalSection(&This
->cs
);
2428 static HRESULT WINAPI
BasicVideo_get_SourceLeft(IBasicVideo
*iface
,
2429 long *pSourceLeft
) {
2430 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2431 IBasicVideo
* pBasicVideo
;
2434 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceLeft
);
2436 EnterCriticalSection(&This
->cs
);
2438 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2441 hr
= IBasicVideo_get_SourceLeft(pBasicVideo
, pSourceLeft
);
2443 LeaveCriticalSection(&This
->cs
);
2448 static HRESULT WINAPI
BasicVideo_put_SourceWidth(IBasicVideo
*iface
,
2450 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2451 IBasicVideo
* pBasicVideo
;
2454 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceWidth
);
2456 EnterCriticalSection(&This
->cs
);
2458 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2461 hr
= IBasicVideo_put_SourceWidth(pBasicVideo
, SourceWidth
);
2463 LeaveCriticalSection(&This
->cs
);
2468 static HRESULT WINAPI
BasicVideo_get_SourceWidth(IBasicVideo
*iface
,
2469 long *pSourceWidth
) {
2470 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2471 IBasicVideo
* pBasicVideo
;
2474 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceWidth
);
2476 EnterCriticalSection(&This
->cs
);
2478 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2481 hr
= IBasicVideo_get_SourceWidth(pBasicVideo
, pSourceWidth
);
2483 LeaveCriticalSection(&This
->cs
);
2488 static HRESULT WINAPI
BasicVideo_put_SourceTop(IBasicVideo
*iface
,
2490 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2491 IBasicVideo
* pBasicVideo
;
2494 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceTop
);
2496 EnterCriticalSection(&This
->cs
);
2498 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2501 hr
= IBasicVideo_put_SourceTop(pBasicVideo
, SourceTop
);
2503 LeaveCriticalSection(&This
->cs
);
2508 static HRESULT WINAPI
BasicVideo_get_SourceTop(IBasicVideo
*iface
,
2510 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2511 IBasicVideo
* pBasicVideo
;
2514 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceTop
);
2516 EnterCriticalSection(&This
->cs
);
2518 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2521 hr
= IBasicVideo_get_SourceTop(pBasicVideo
, pSourceTop
);
2523 LeaveCriticalSection(&This
->cs
);
2528 static HRESULT WINAPI
BasicVideo_put_SourceHeight(IBasicVideo
*iface
,
2529 long SourceHeight
) {
2530 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2531 IBasicVideo
* pBasicVideo
;
2534 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceHeight
);
2536 EnterCriticalSection(&This
->cs
);
2538 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2541 hr
= IBasicVideo_put_SourceHeight(pBasicVideo
, SourceHeight
);
2543 LeaveCriticalSection(&This
->cs
);
2548 static HRESULT WINAPI
BasicVideo_get_SourceHeight(IBasicVideo
*iface
,
2549 long *pSourceHeight
) {
2550 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2551 IBasicVideo
* pBasicVideo
;
2554 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceHeight
);
2556 EnterCriticalSection(&This
->cs
);
2558 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2561 hr
= IBasicVideo_get_SourceHeight(pBasicVideo
, pSourceHeight
);
2563 LeaveCriticalSection(&This
->cs
);
2568 static HRESULT WINAPI
BasicVideo_put_DestinationLeft(IBasicVideo
*iface
,
2569 long DestinationLeft
) {
2570 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2571 IBasicVideo
* pBasicVideo
;
2574 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationLeft
);
2576 EnterCriticalSection(&This
->cs
);
2578 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2581 hr
= IBasicVideo_put_DestinationLeft(pBasicVideo
, DestinationLeft
);
2583 LeaveCriticalSection(&This
->cs
);
2588 static HRESULT WINAPI
BasicVideo_get_DestinationLeft(IBasicVideo
*iface
,
2589 long *pDestinationLeft
) {
2590 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2591 IBasicVideo
* pBasicVideo
;
2594 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationLeft
);
2596 EnterCriticalSection(&This
->cs
);
2598 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2601 hr
= IBasicVideo_get_DestinationLeft(pBasicVideo
, pDestinationLeft
);
2603 LeaveCriticalSection(&This
->cs
);
2608 static HRESULT WINAPI
BasicVideo_put_DestinationWidth(IBasicVideo
*iface
,
2609 long DestinationWidth
) {
2610 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2611 IBasicVideo
* pBasicVideo
;
2614 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationWidth
);
2616 EnterCriticalSection(&This
->cs
);
2618 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2621 hr
= IBasicVideo_put_DestinationWidth(pBasicVideo
, DestinationWidth
);
2623 LeaveCriticalSection(&This
->cs
);
2628 static HRESULT WINAPI
BasicVideo_get_DestinationWidth(IBasicVideo
*iface
,
2629 long *pDestinationWidth
) {
2630 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2631 IBasicVideo
* pBasicVideo
;
2634 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationWidth
);
2636 EnterCriticalSection(&This
->cs
);
2638 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2641 hr
= IBasicVideo_get_DestinationWidth(pBasicVideo
, pDestinationWidth
);
2643 LeaveCriticalSection(&This
->cs
);
2648 static HRESULT WINAPI
BasicVideo_put_DestinationTop(IBasicVideo
*iface
,
2649 long DestinationTop
) {
2650 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2651 IBasicVideo
* pBasicVideo
;
2654 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationTop
);
2656 EnterCriticalSection(&This
->cs
);
2658 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2661 hr
= IBasicVideo_put_DestinationTop(pBasicVideo
, DestinationTop
);
2663 LeaveCriticalSection(&This
->cs
);
2668 static HRESULT WINAPI
BasicVideo_get_DestinationTop(IBasicVideo
*iface
,
2669 long *pDestinationTop
) {
2670 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2671 IBasicVideo
* pBasicVideo
;
2674 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationTop
);
2676 EnterCriticalSection(&This
->cs
);
2678 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2681 hr
= IBasicVideo_get_DestinationTop(pBasicVideo
, pDestinationTop
);
2683 LeaveCriticalSection(&This
->cs
);
2688 static HRESULT WINAPI
BasicVideo_put_DestinationHeight(IBasicVideo
*iface
,
2689 long DestinationHeight
) {
2690 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2691 IBasicVideo
* pBasicVideo
;
2694 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationHeight
);
2696 EnterCriticalSection(&This
->cs
);
2698 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2701 hr
= IBasicVideo_put_DestinationHeight(pBasicVideo
, DestinationHeight
);
2703 LeaveCriticalSection(&This
->cs
);
2708 static HRESULT WINAPI
BasicVideo_get_DestinationHeight(IBasicVideo
*iface
,
2709 long *pDestinationHeight
) {
2710 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2711 IBasicVideo
* pBasicVideo
;
2714 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationHeight
);
2716 EnterCriticalSection(&This
->cs
);
2718 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2721 hr
= IBasicVideo_get_DestinationHeight(pBasicVideo
, pDestinationHeight
);
2723 LeaveCriticalSection(&This
->cs
);
2728 static HRESULT WINAPI
BasicVideo_SetSourcePosition(IBasicVideo
*iface
,
2733 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2734 IBasicVideo
* pBasicVideo
;
2737 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2739 EnterCriticalSection(&This
->cs
);
2741 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2744 hr
= IBasicVideo_SetSourcePosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2746 LeaveCriticalSection(&This
->cs
);
2751 static HRESULT WINAPI
BasicVideo_GetSourcePosition(IBasicVideo
*iface
,
2756 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2757 IBasicVideo
* pBasicVideo
;
2760 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2762 EnterCriticalSection(&This
->cs
);
2764 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2767 hr
= IBasicVideo_GetSourcePosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2769 LeaveCriticalSection(&This
->cs
);
2774 static HRESULT WINAPI
BasicVideo_SetDefaultSourcePosition(IBasicVideo
*iface
) {
2775 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2776 IBasicVideo
* pBasicVideo
;
2779 TRACE("(%p/%p)->()\n", This
, iface
);
2781 EnterCriticalSection(&This
->cs
);
2783 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2786 hr
= IBasicVideo_SetDefaultSourcePosition(pBasicVideo
);
2788 LeaveCriticalSection(&This
->cs
);
2793 static HRESULT WINAPI
BasicVideo_SetDestinationPosition(IBasicVideo
*iface
,
2798 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2799 IBasicVideo
* pBasicVideo
;
2802 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2804 EnterCriticalSection(&This
->cs
);
2806 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2809 hr
= IBasicVideo_SetDestinationPosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2811 LeaveCriticalSection(&This
->cs
);
2816 static HRESULT WINAPI
BasicVideo_GetDestinationPosition(IBasicVideo
*iface
,
2821 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2822 IBasicVideo
* pBasicVideo
;
2825 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2827 EnterCriticalSection(&This
->cs
);
2829 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2832 hr
= IBasicVideo_GetDestinationPosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2834 LeaveCriticalSection(&This
->cs
);
2839 static HRESULT WINAPI
BasicVideo_SetDefaultDestinationPosition(IBasicVideo
*iface
) {
2840 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2841 IBasicVideo
* pBasicVideo
;
2844 TRACE("(%p/%p)->()\n", This
, iface
);
2846 EnterCriticalSection(&This
->cs
);
2848 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2851 hr
= IBasicVideo_SetDefaultDestinationPosition(pBasicVideo
);
2853 LeaveCriticalSection(&This
->cs
);
2858 static HRESULT WINAPI
BasicVideo_GetVideoSize(IBasicVideo
*iface
,
2861 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2862 IBasicVideo
* pBasicVideo
;
2865 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
2867 EnterCriticalSection(&This
->cs
);
2869 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2872 hr
= IBasicVideo_GetVideoSize(pBasicVideo
, pWidth
, pHeight
);
2874 LeaveCriticalSection(&This
->cs
);
2879 static HRESULT WINAPI
BasicVideo_GetVideoPaletteEntries(IBasicVideo
*iface
,
2884 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2885 IBasicVideo
* pBasicVideo
;
2888 TRACE("(%p/%p)->(%ld, %ld, %p, %p)\n", This
, iface
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2890 EnterCriticalSection(&This
->cs
);
2892 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2895 hr
= IBasicVideo_GetVideoPaletteEntries(pBasicVideo
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2897 LeaveCriticalSection(&This
->cs
);
2902 static HRESULT WINAPI
BasicVideo_GetCurrentImage(IBasicVideo
*iface
,
2905 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2906 IBasicVideo
* pBasicVideo
;
2909 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pBufferSize
, pDIBImage
);
2911 EnterCriticalSection(&This
->cs
);
2913 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2916 hr
= IBasicVideo_GetCurrentImage(pBasicVideo
, pBufferSize
, pDIBImage
);
2918 LeaveCriticalSection(&This
->cs
);
2923 static HRESULT WINAPI
BasicVideo_IsUsingDefaultSource(IBasicVideo
*iface
) {
2924 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2925 IBasicVideo
* pBasicVideo
;
2928 TRACE("(%p/%p)->()\n", This
, iface
);
2930 EnterCriticalSection(&This
->cs
);
2932 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2935 hr
= IBasicVideo_IsUsingDefaultSource(pBasicVideo
);
2937 LeaveCriticalSection(&This
->cs
);
2942 static HRESULT WINAPI
BasicVideo_IsUsingDefaultDestination(IBasicVideo
*iface
) {
2943 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2944 IBasicVideo
* pBasicVideo
;
2947 TRACE("(%p/%p)->()\n", This
, iface
);
2949 EnterCriticalSection(&This
->cs
);
2951 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2954 hr
= IBasicVideo_IsUsingDefaultDestination(pBasicVideo
);
2956 LeaveCriticalSection(&This
->cs
);
2962 static const IBasicVideoVtbl IBasicVideo_VTable
=
2964 BasicVideo_QueryInterface
,
2967 BasicVideo_GetTypeInfoCount
,
2968 BasicVideo_GetTypeInfo
,
2969 BasicVideo_GetIDsOfNames
,
2971 BasicVideo_get_AvgTimePerFrame
,
2972 BasicVideo_get_BitRate
,
2973 BasicVideo_get_BitErrorRate
,
2974 BasicVideo_get_VideoWidth
,
2975 BasicVideo_get_VideoHeight
,
2976 BasicVideo_put_SourceLeft
,
2977 BasicVideo_get_SourceLeft
,
2978 BasicVideo_put_SourceWidth
,
2979 BasicVideo_get_SourceWidth
,
2980 BasicVideo_put_SourceTop
,
2981 BasicVideo_get_SourceTop
,
2982 BasicVideo_put_SourceHeight
,
2983 BasicVideo_get_SourceHeight
,
2984 BasicVideo_put_DestinationLeft
,
2985 BasicVideo_get_DestinationLeft
,
2986 BasicVideo_put_DestinationWidth
,
2987 BasicVideo_get_DestinationWidth
,
2988 BasicVideo_put_DestinationTop
,
2989 BasicVideo_get_DestinationTop
,
2990 BasicVideo_put_DestinationHeight
,
2991 BasicVideo_get_DestinationHeight
,
2992 BasicVideo_SetSourcePosition
,
2993 BasicVideo_GetSourcePosition
,
2994 BasicVideo_SetDefaultSourcePosition
,
2995 BasicVideo_SetDestinationPosition
,
2996 BasicVideo_GetDestinationPosition
,
2997 BasicVideo_SetDefaultDestinationPosition
,
2998 BasicVideo_GetVideoSize
,
2999 BasicVideo_GetVideoPaletteEntries
,
3000 BasicVideo_GetCurrentImage
,
3001 BasicVideo_IsUsingDefaultSource
,
3002 BasicVideo_IsUsingDefaultDestination
3006 /*** IUnknown methods ***/
3007 static HRESULT WINAPI
VideoWindow_QueryInterface(IVideoWindow
*iface
,
3010 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3012 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
3014 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
3017 static ULONG WINAPI
VideoWindow_AddRef(IVideoWindow
*iface
) {
3018 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3020 TRACE("(%p/%p)->()\n", This
, iface
);
3022 return Filtergraph_AddRef(This
);
3025 static ULONG WINAPI
VideoWindow_Release(IVideoWindow
*iface
) {
3026 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3028 TRACE("(%p/%p)->()\n", This
, iface
);
3030 return Filtergraph_Release(This
);
3033 /*** IDispatch methods ***/
3034 static HRESULT WINAPI
VideoWindow_GetTypeInfoCount(IVideoWindow
*iface
,
3036 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3037 IVideoWindow
* pVideoWindow
;
3040 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
3042 EnterCriticalSection(&This
->cs
);
3044 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3047 hr
= IVideoWindow_GetTypeInfoCount(pVideoWindow
, pctinfo
);
3049 LeaveCriticalSection(&This
->cs
);
3054 static HRESULT WINAPI
VideoWindow_GetTypeInfo(IVideoWindow
*iface
,
3057 ITypeInfo
**ppTInfo
) {
3058 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3059 IVideoWindow
* pVideoWindow
;
3062 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
3064 EnterCriticalSection(&This
->cs
);
3066 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3069 hr
= IVideoWindow_GetTypeInfo(pVideoWindow
, iTInfo
, lcid
, ppTInfo
);
3071 LeaveCriticalSection(&This
->cs
);
3076 static HRESULT WINAPI
VideoWindow_GetIDsOfNames(IVideoWindow
*iface
,
3082 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3083 IVideoWindow
* pVideoWindow
;
3086 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3088 EnterCriticalSection(&This
->cs
);
3090 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3093 hr
= IVideoWindow_GetIDsOfNames(pVideoWindow
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3095 LeaveCriticalSection(&This
->cs
);
3100 static HRESULT WINAPI
VideoWindow_Invoke(IVideoWindow
*iface
,
3101 DISPID dispIdMember
,
3105 DISPPARAMS
*pDispParams
,
3107 EXCEPINFO
*pExepInfo
,
3109 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3110 IVideoWindow
* pVideoWindow
;
3113 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
);
3115 EnterCriticalSection(&This
->cs
);
3117 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3120 hr
= IVideoWindow_Invoke(pVideoWindow
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
3122 LeaveCriticalSection(&This
->cs
);
3128 /*** IVideoWindow methods ***/
3129 static HRESULT WINAPI
VideoWindow_put_Caption(IVideoWindow
*iface
,
3131 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3132 IVideoWindow
* pVideoWindow
;
3135 TRACE("(%p/%p)->(%s (%p))\n", This
, iface
, debugstr_w(strCaption
), strCaption
);
3137 EnterCriticalSection(&This
->cs
);
3139 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3142 hr
= IVideoWindow_put_Caption(pVideoWindow
, strCaption
);
3144 LeaveCriticalSection(&This
->cs
);
3149 static HRESULT WINAPI
VideoWindow_get_Caption(IVideoWindow
*iface
,
3151 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3152 IVideoWindow
* pVideoWindow
;
3155 TRACE("(%p/%p)->(%p)\n", This
, iface
, strCaption
);
3157 EnterCriticalSection(&This
->cs
);
3159 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3162 hr
= IVideoWindow_get_Caption(pVideoWindow
, strCaption
);
3164 LeaveCriticalSection(&This
->cs
);
3169 static HRESULT WINAPI
VideoWindow_put_WindowStyle(IVideoWindow
*iface
,
3171 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3172 IVideoWindow
* pVideoWindow
;
3175 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyle
);
3177 EnterCriticalSection(&This
->cs
);
3179 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3182 hr
= IVideoWindow_put_WindowStyle(pVideoWindow
, WindowStyle
);
3184 LeaveCriticalSection(&This
->cs
);
3189 static HRESULT WINAPI
VideoWindow_get_WindowStyle(IVideoWindow
*iface
,
3190 long *WindowStyle
) {
3191 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3192 IVideoWindow
* pVideoWindow
;
3195 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyle
);
3197 EnterCriticalSection(&This
->cs
);
3199 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3202 hr
= IVideoWindow_get_WindowStyle(pVideoWindow
, WindowStyle
);
3204 LeaveCriticalSection(&This
->cs
);
3209 static HRESULT WINAPI
VideoWindow_put_WindowStyleEx(IVideoWindow
*iface
,
3210 long WindowStyleEx
) {
3211 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3212 IVideoWindow
* pVideoWindow
;
3215 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyleEx
);
3217 EnterCriticalSection(&This
->cs
);
3219 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3222 hr
= IVideoWindow_put_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3224 LeaveCriticalSection(&This
->cs
);
3229 static HRESULT WINAPI
VideoWindow_get_WindowStyleEx(IVideoWindow
*iface
,
3230 long *WindowStyleEx
) {
3231 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3232 IVideoWindow
* pVideoWindow
;
3235 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyleEx
);
3237 EnterCriticalSection(&This
->cs
);
3239 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3242 hr
= IVideoWindow_get_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3244 LeaveCriticalSection(&This
->cs
);
3249 static HRESULT WINAPI
VideoWindow_put_AutoShow(IVideoWindow
*iface
,
3251 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3252 IVideoWindow
* pVideoWindow
;
3255 TRACE("(%p/%p)->(%ld)\n", This
, iface
, AutoShow
);
3257 EnterCriticalSection(&This
->cs
);
3259 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3262 hr
= IVideoWindow_put_AutoShow(pVideoWindow
, AutoShow
);
3264 LeaveCriticalSection(&This
->cs
);
3269 static HRESULT WINAPI
VideoWindow_get_AutoShow(IVideoWindow
*iface
,
3271 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3272 IVideoWindow
* pVideoWindow
;
3275 TRACE("(%p/%p)->(%p)\n", This
, iface
, AutoShow
);
3277 EnterCriticalSection(&This
->cs
);
3279 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3282 hr
= IVideoWindow_get_AutoShow(pVideoWindow
, AutoShow
);
3284 LeaveCriticalSection(&This
->cs
);
3289 static HRESULT WINAPI
VideoWindow_put_WindowState(IVideoWindow
*iface
,
3291 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3292 IVideoWindow
* pVideoWindow
;
3295 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowState
);
3297 EnterCriticalSection(&This
->cs
);
3299 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3302 hr
= IVideoWindow_put_WindowState(pVideoWindow
, WindowState
);
3304 LeaveCriticalSection(&This
->cs
);
3309 static HRESULT WINAPI
VideoWindow_get_WindowState(IVideoWindow
*iface
,
3310 long *WindowState
) {
3311 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3312 IVideoWindow
* pVideoWindow
;
3315 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowState
);
3317 EnterCriticalSection(&This
->cs
);
3319 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3322 hr
= IVideoWindow_get_WindowState(pVideoWindow
, WindowState
);
3324 LeaveCriticalSection(&This
->cs
);
3329 static HRESULT WINAPI
VideoWindow_put_BackgroundPalette(IVideoWindow
*iface
,
3330 long BackgroundPalette
) {
3331 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3332 IVideoWindow
* pVideoWindow
;
3335 TRACE("(%p/%p)->(%ld)\n", This
, iface
, BackgroundPalette
);
3337 EnterCriticalSection(&This
->cs
);
3339 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3342 hr
= IVideoWindow_put_BackgroundPalette(pVideoWindow
, BackgroundPalette
);
3344 LeaveCriticalSection(&This
->cs
);
3349 static HRESULT WINAPI
VideoWindow_get_BackgroundPalette(IVideoWindow
*iface
,
3350 long *pBackgroundPalette
) {
3351 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3352 IVideoWindow
* pVideoWindow
;
3355 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBackgroundPalette
);
3357 EnterCriticalSection(&This
->cs
);
3359 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3362 hr
= IVideoWindow_get_BackgroundPalette(pVideoWindow
, pBackgroundPalette
);
3364 LeaveCriticalSection(&This
->cs
);
3369 static HRESULT WINAPI
VideoWindow_put_Visible(IVideoWindow
*iface
,
3371 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3372 IVideoWindow
* pVideoWindow
;
3375 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Visible
);
3377 EnterCriticalSection(&This
->cs
);
3379 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3382 hr
= IVideoWindow_put_Visible(pVideoWindow
, Visible
);
3384 LeaveCriticalSection(&This
->cs
);
3389 static HRESULT WINAPI
VideoWindow_get_Visible(IVideoWindow
*iface
,
3391 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3392 IVideoWindow
* pVideoWindow
;
3395 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVisible
);
3397 EnterCriticalSection(&This
->cs
);
3399 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3402 hr
= IVideoWindow_get_Visible(pVideoWindow
, pVisible
);
3404 LeaveCriticalSection(&This
->cs
);
3409 static HRESULT WINAPI
VideoWindow_put_Left(IVideoWindow
*iface
,
3411 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3412 IVideoWindow
* pVideoWindow
;
3415 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Left
);
3417 EnterCriticalSection(&This
->cs
);
3419 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3422 hr
= IVideoWindow_put_Left(pVideoWindow
, Left
);
3424 LeaveCriticalSection(&This
->cs
);
3429 static HRESULT WINAPI
VideoWindow_get_Left(IVideoWindow
*iface
,
3431 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3432 IVideoWindow
* pVideoWindow
;
3435 TRACE("(%p/%p)->(%p)\n", This
, iface
, pLeft
);
3437 EnterCriticalSection(&This
->cs
);
3439 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3442 hr
= IVideoWindow_get_Left(pVideoWindow
, pLeft
);
3444 LeaveCriticalSection(&This
->cs
);
3449 static HRESULT WINAPI
VideoWindow_put_Width(IVideoWindow
*iface
,
3451 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3452 IVideoWindow
* pVideoWindow
;
3455 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Width
);
3457 EnterCriticalSection(&This
->cs
);
3459 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3462 hr
= IVideoWindow_put_Width(pVideoWindow
, Width
);
3464 LeaveCriticalSection(&This
->cs
);
3469 static HRESULT WINAPI
VideoWindow_get_Width(IVideoWindow
*iface
,
3471 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3472 IVideoWindow
* pVideoWindow
;
3475 TRACE("(%p/%p)->(%p)\n", This
, iface
, pWidth
);
3477 EnterCriticalSection(&This
->cs
);
3479 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3482 hr
= IVideoWindow_get_Width(pVideoWindow
, pWidth
);
3484 LeaveCriticalSection(&This
->cs
);
3489 static HRESULT WINAPI
VideoWindow_put_Top(IVideoWindow
*iface
,
3491 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3492 IVideoWindow
* pVideoWindow
;
3495 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Top
);
3497 EnterCriticalSection(&This
->cs
);
3499 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3502 hr
= IVideoWindow_put_Top(pVideoWindow
, Top
);
3504 LeaveCriticalSection(&This
->cs
);
3509 static HRESULT WINAPI
VideoWindow_get_Top(IVideoWindow
*iface
,
3511 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3512 IVideoWindow
* pVideoWindow
;
3515 TRACE("(%p/%p)->(%p)\n", This
, iface
, pTop
);
3517 EnterCriticalSection(&This
->cs
);
3519 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3522 hr
= IVideoWindow_get_Top(pVideoWindow
, pTop
);
3524 LeaveCriticalSection(&This
->cs
);
3529 static HRESULT WINAPI
VideoWindow_put_Height(IVideoWindow
*iface
,
3531 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3532 IVideoWindow
* pVideoWindow
;
3535 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Height
);
3537 EnterCriticalSection(&This
->cs
);
3539 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3542 hr
= IVideoWindow_put_Height(pVideoWindow
, Height
);
3544 LeaveCriticalSection(&This
->cs
);
3549 static HRESULT WINAPI
VideoWindow_get_Height(IVideoWindow
*iface
,
3551 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3552 IVideoWindow
* pVideoWindow
;
3555 TRACE("(%p/%p)->(%p)\n", This
, iface
, pHeight
);
3557 EnterCriticalSection(&This
->cs
);
3559 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3562 hr
= IVideoWindow_get_Height(pVideoWindow
, pHeight
);
3564 LeaveCriticalSection(&This
->cs
);
3569 static HRESULT WINAPI
VideoWindow_put_Owner(IVideoWindow
*iface
,
3571 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3572 IVideoWindow
* pVideoWindow
;
3575 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Owner
);
3577 EnterCriticalSection(&This
->cs
);
3579 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3582 hr
= IVideoWindow_put_Owner(pVideoWindow
, Owner
);
3584 LeaveCriticalSection(&This
->cs
);
3589 static HRESULT WINAPI
VideoWindow_get_Owner(IVideoWindow
*iface
,
3591 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3592 IVideoWindow
* pVideoWindow
;
3595 TRACE("(%p/%p)->(%p)\n", This
, iface
, Owner
);
3597 EnterCriticalSection(&This
->cs
);
3599 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3602 hr
= IVideoWindow_get_Owner(pVideoWindow
, Owner
);
3604 LeaveCriticalSection(&This
->cs
);
3609 static HRESULT WINAPI
VideoWindow_put_MessageDrain(IVideoWindow
*iface
,
3611 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3612 IVideoWindow
* pVideoWindow
;
3615 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Drain
);
3617 EnterCriticalSection(&This
->cs
);
3619 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3622 hr
= IVideoWindow_put_MessageDrain(pVideoWindow
, Drain
);
3624 LeaveCriticalSection(&This
->cs
);
3629 static HRESULT WINAPI
VideoWindow_get_MessageDrain(IVideoWindow
*iface
,
3631 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3632 IVideoWindow
* pVideoWindow
;
3635 TRACE("(%p/%p)->(%p)\n", This
, iface
, Drain
);
3637 EnterCriticalSection(&This
->cs
);
3639 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3642 hr
= IVideoWindow_get_MessageDrain(pVideoWindow
, Drain
);
3644 LeaveCriticalSection(&This
->cs
);
3649 static HRESULT WINAPI
VideoWindow_get_BorderColor(IVideoWindow
*iface
,
3651 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3652 IVideoWindow
* pVideoWindow
;
3655 TRACE("(%p/%p)->(%p)\n", This
, iface
, Color
);
3657 EnterCriticalSection(&This
->cs
);
3659 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3662 hr
= IVideoWindow_get_BorderColor(pVideoWindow
, Color
);
3664 LeaveCriticalSection(&This
->cs
);
3669 static HRESULT WINAPI
VideoWindow_put_BorderColor(IVideoWindow
*iface
,
3671 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3672 IVideoWindow
* pVideoWindow
;
3675 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Color
);
3677 EnterCriticalSection(&This
->cs
);
3679 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3682 hr
= IVideoWindow_put_BorderColor(pVideoWindow
, Color
);
3684 LeaveCriticalSection(&This
->cs
);
3689 static HRESULT WINAPI
VideoWindow_get_FullScreenMode(IVideoWindow
*iface
,
3690 long *FullScreenMode
) {
3691 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3692 IVideoWindow
* pVideoWindow
;
3695 TRACE("(%p/%p)->(%p)\n", This
, iface
, FullScreenMode
);
3697 EnterCriticalSection(&This
->cs
);
3699 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3702 hr
= IVideoWindow_get_FullScreenMode(pVideoWindow
, FullScreenMode
);
3704 LeaveCriticalSection(&This
->cs
);
3709 static HRESULT WINAPI
VideoWindow_put_FullScreenMode(IVideoWindow
*iface
,
3710 long FullScreenMode
) {
3711 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3712 IVideoWindow
* pVideoWindow
;
3715 TRACE("(%p/%p)->(%ld)\n", This
, iface
, FullScreenMode
);
3717 EnterCriticalSection(&This
->cs
);
3719 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3722 hr
= IVideoWindow_put_FullScreenMode(pVideoWindow
, FullScreenMode
);
3724 LeaveCriticalSection(&This
->cs
);
3729 static HRESULT WINAPI
VideoWindow_SetWindowForeground(IVideoWindow
*iface
,
3731 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3732 IVideoWindow
* pVideoWindow
;
3735 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Focus
);
3737 EnterCriticalSection(&This
->cs
);
3739 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3742 hr
= IVideoWindow_SetWindowForeground(pVideoWindow
, Focus
);
3744 LeaveCriticalSection(&This
->cs
);
3749 static HRESULT WINAPI
VideoWindow_NotifyOwnerMessage(IVideoWindow
*iface
,
3754 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3755 IVideoWindow
* pVideoWindow
;
3758 TRACE("(%p/%p)->(%08x, %ld, %08lx, %08lx)\n", This
, iface
, (DWORD
) hwnd
, uMsg
, wParam
, lParam
);
3760 EnterCriticalSection(&This
->cs
);
3762 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3765 hr
= IVideoWindow_NotifyOwnerMessage(pVideoWindow
, hwnd
, uMsg
, wParam
, lParam
);
3767 LeaveCriticalSection(&This
->cs
);
3772 static HRESULT WINAPI
VideoWindow_SetWindowPosition(IVideoWindow
*iface
,
3777 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3778 IVideoWindow
* pVideoWindow
;
3781 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
3783 EnterCriticalSection(&This
->cs
);
3785 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3788 hr
= IVideoWindow_SetWindowPosition(pVideoWindow
, Left
, Top
, Width
, Height
);
3790 LeaveCriticalSection(&This
->cs
);
3795 static HRESULT WINAPI
VideoWindow_GetWindowPosition(IVideoWindow
*iface
,
3800 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3801 IVideoWindow
* pVideoWindow
;
3804 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3806 EnterCriticalSection(&This
->cs
);
3808 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3811 hr
= IVideoWindow_GetWindowPosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3813 LeaveCriticalSection(&This
->cs
);
3818 static HRESULT WINAPI
VideoWindow_GetMinIdealImageSize(IVideoWindow
*iface
,
3821 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3822 IVideoWindow
* pVideoWindow
;
3825 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3827 EnterCriticalSection(&This
->cs
);
3829 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3832 hr
= IVideoWindow_GetMinIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3834 LeaveCriticalSection(&This
->cs
);
3839 static HRESULT WINAPI
VideoWindow_GetMaxIdealImageSize(IVideoWindow
*iface
,
3842 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3843 IVideoWindow
* pVideoWindow
;
3846 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3848 EnterCriticalSection(&This
->cs
);
3850 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3853 hr
= IVideoWindow_GetMaxIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3855 LeaveCriticalSection(&This
->cs
);
3860 static HRESULT WINAPI
VideoWindow_GetRestorePosition(IVideoWindow
*iface
,
3865 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3866 IVideoWindow
* pVideoWindow
;
3869 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3871 EnterCriticalSection(&This
->cs
);
3873 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3876 hr
= IVideoWindow_GetRestorePosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3878 LeaveCriticalSection(&This
->cs
);
3883 static HRESULT WINAPI
VideoWindow_HideCursor(IVideoWindow
*iface
,
3885 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3886 IVideoWindow
* pVideoWindow
;
3889 TRACE("(%p/%p)->(%ld)\n", This
, iface
, HideCursor
);
3891 EnterCriticalSection(&This
->cs
);
3893 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3896 hr
= IVideoWindow_HideCursor(pVideoWindow
, HideCursor
);
3898 LeaveCriticalSection(&This
->cs
);
3903 static HRESULT WINAPI
VideoWindow_IsCursorHidden(IVideoWindow
*iface
,
3904 long *CursorHidden
) {
3905 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3906 IVideoWindow
* pVideoWindow
;
3909 TRACE("(%p/%p)->(%p)\n", This
, iface
, CursorHidden
);
3911 EnterCriticalSection(&This
->cs
);
3913 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3916 hr
= IVideoWindow_IsCursorHidden(pVideoWindow
, CursorHidden
);
3918 LeaveCriticalSection(&This
->cs
);
3924 static const IVideoWindowVtbl IVideoWindow_VTable
=
3926 VideoWindow_QueryInterface
,
3928 VideoWindow_Release
,
3929 VideoWindow_GetTypeInfoCount
,
3930 VideoWindow_GetTypeInfo
,
3931 VideoWindow_GetIDsOfNames
,
3933 VideoWindow_put_Caption
,
3934 VideoWindow_get_Caption
,
3935 VideoWindow_put_WindowStyle
,
3936 VideoWindow_get_WindowStyle
,
3937 VideoWindow_put_WindowStyleEx
,
3938 VideoWindow_get_WindowStyleEx
,
3939 VideoWindow_put_AutoShow
,
3940 VideoWindow_get_AutoShow
,
3941 VideoWindow_put_WindowState
,
3942 VideoWindow_get_WindowState
,
3943 VideoWindow_put_BackgroundPalette
,
3944 VideoWindow_get_BackgroundPalette
,
3945 VideoWindow_put_Visible
,
3946 VideoWindow_get_Visible
,
3947 VideoWindow_put_Left
,
3948 VideoWindow_get_Left
,
3949 VideoWindow_put_Width
,
3950 VideoWindow_get_Width
,
3951 VideoWindow_put_Top
,
3952 VideoWindow_get_Top
,
3953 VideoWindow_put_Height
,
3954 VideoWindow_get_Height
,
3955 VideoWindow_put_Owner
,
3956 VideoWindow_get_Owner
,
3957 VideoWindow_put_MessageDrain
,
3958 VideoWindow_get_MessageDrain
,
3959 VideoWindow_get_BorderColor
,
3960 VideoWindow_put_BorderColor
,
3961 VideoWindow_get_FullScreenMode
,
3962 VideoWindow_put_FullScreenMode
,
3963 VideoWindow_SetWindowForeground
,
3964 VideoWindow_NotifyOwnerMessage
,
3965 VideoWindow_SetWindowPosition
,
3966 VideoWindow_GetWindowPosition
,
3967 VideoWindow_GetMinIdealImageSize
,
3968 VideoWindow_GetMaxIdealImageSize
,
3969 VideoWindow_GetRestorePosition
,
3970 VideoWindow_HideCursor
,
3971 VideoWindow_IsCursorHidden
3975 /*** IUnknown methods ***/
3976 static HRESULT WINAPI
MediaEvent_QueryInterface(IMediaEventEx
*iface
,
3979 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3981 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
3983 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
3986 static ULONG WINAPI
MediaEvent_AddRef(IMediaEventEx
*iface
) {
3987 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3989 TRACE("(%p/%p)->()\n", This
, iface
);
3991 return Filtergraph_AddRef(This
);
3994 static ULONG WINAPI
MediaEvent_Release(IMediaEventEx
*iface
) {
3995 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3997 TRACE("(%p/%p)->()\n", This
, iface
);
3999 return Filtergraph_Release(This
);
4002 /*** IDispatch methods ***/
4003 static HRESULT WINAPI
MediaEvent_GetTypeInfoCount(IMediaEventEx
*iface
,
4005 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4007 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
4012 static HRESULT WINAPI
MediaEvent_GetTypeInfo(IMediaEventEx
*iface
,
4015 ITypeInfo
**ppTInfo
) {
4016 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4018 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
4023 static HRESULT WINAPI
MediaEvent_GetIDsOfNames(IMediaEventEx
*iface
,
4029 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4031 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
4036 static HRESULT WINAPI
MediaEvent_Invoke(IMediaEventEx
*iface
,
4037 DISPID dispIdMember
,
4041 DISPPARAMS
*pDispParams
,
4043 EXCEPINFO
*pExepInfo
,
4045 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4047 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
);
4052 /*** IMediaEvent methods ***/
4053 static HRESULT WINAPI
MediaEvent_GetEventHandle(IMediaEventEx
*iface
,
4055 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4057 TRACE("(%p/%p)->(%p)\n", This
, iface
, hEvent
);
4059 *hEvent
= (OAEVENT
)This
->evqueue
.msg_event
;
4064 static HRESULT WINAPI
MediaEvent_GetEvent(IMediaEventEx
*iface
,
4069 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4072 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This
, iface
, lEventCode
, lParam1
, lParam2
, msTimeout
);
4074 if (EventsQueue_GetEvent(&This
->evqueue
, &evt
, msTimeout
))
4076 *lEventCode
= evt
.lEventCode
;
4077 *lParam1
= evt
.lParam1
;
4078 *lParam2
= evt
.lParam2
;
4086 static HRESULT WINAPI
MediaEvent_WaitForCompletion(IMediaEventEx
*iface
,
4089 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4091 TRACE("(%p/%p)->(%ld, %p)\n", This
, iface
, msTimeout
, pEvCode
);
4093 if (WaitForSingleObject(This
->hEventCompletion
, msTimeout
) == WAIT_OBJECT_0
)
4095 *pEvCode
= This
->CompletionStatus
;
4103 static HRESULT WINAPI
MediaEvent_CancelDefaultHandling(IMediaEventEx
*iface
,
4105 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4107 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4109 if (lEvCode
== EC_COMPLETE
)
4110 This
->HandleEcComplete
= FALSE
;
4111 else if (lEvCode
== EC_REPAINT
)
4112 This
->HandleEcRepaint
= FALSE
;
4113 else if (lEvCode
== EC_CLOCK_CHANGED
)
4114 This
->HandleEcClockChanged
= FALSE
;
4121 static HRESULT WINAPI
MediaEvent_RestoreDefaultHandling(IMediaEventEx
*iface
,
4123 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4125 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4127 if (lEvCode
== EC_COMPLETE
)
4128 This
->HandleEcComplete
= TRUE
;
4129 else if (lEvCode
== EC_REPAINT
)
4130 This
->HandleEcRepaint
= TRUE
;
4131 else if (lEvCode
== EC_CLOCK_CHANGED
)
4132 This
->HandleEcClockChanged
= TRUE
;
4139 static HRESULT WINAPI
MediaEvent_FreeEventParams(IMediaEventEx
*iface
,
4143 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4145 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This
, iface
, lEvCode
, lParam1
, lParam2
);
4150 /*** IMediaEventEx methods ***/
4151 static HRESULT WINAPI
MediaEvent_SetNotifyWindow(IMediaEventEx
*iface
,
4154 LONG_PTR lInstanceData
) {
4155 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4157 TRACE("(%p/%p)->(%08x, %ld, %08lx)\n", This
, iface
, (DWORD
) hwnd
, lMsg
, lInstanceData
);
4159 This
->notif
.hWnd
= (HWND
)hwnd
;
4160 This
->notif
.msg
= lMsg
;
4161 This
->notif
.instance
= (long) lInstanceData
;
4166 static HRESULT WINAPI
MediaEvent_SetNotifyFlags(IMediaEventEx
*iface
,
4167 long lNoNotifyFlags
) {
4168 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4170 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lNoNotifyFlags
);
4172 if ((lNoNotifyFlags
!= 0) && (lNoNotifyFlags
!= 1))
4173 return E_INVALIDARG
;
4175 This
->notif
.disabled
= lNoNotifyFlags
;
4180 static HRESULT WINAPI
MediaEvent_GetNotifyFlags(IMediaEventEx
*iface
,
4181 long *lplNoNotifyFlags
) {
4182 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4184 TRACE("(%p/%p)->(%p)\n", This
, iface
, lplNoNotifyFlags
);
4186 if (!lplNoNotifyFlags
)
4189 *lplNoNotifyFlags
= This
->notif
.disabled
;
4195 static const IMediaEventExVtbl IMediaEventEx_VTable
=
4197 MediaEvent_QueryInterface
,
4200 MediaEvent_GetTypeInfoCount
,
4201 MediaEvent_GetTypeInfo
,
4202 MediaEvent_GetIDsOfNames
,
4204 MediaEvent_GetEventHandle
,
4205 MediaEvent_GetEvent
,
4206 MediaEvent_WaitForCompletion
,
4207 MediaEvent_CancelDefaultHandling
,
4208 MediaEvent_RestoreDefaultHandling
,
4209 MediaEvent_FreeEventParams
,
4210 MediaEvent_SetNotifyWindow
,
4211 MediaEvent_SetNotifyFlags
,
4212 MediaEvent_GetNotifyFlags
4216 static HRESULT WINAPI
MediaFilter_QueryInterface(IMediaFilter
*iface
, REFIID riid
, LPVOID
*ppv
)
4218 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4220 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4223 static ULONG WINAPI
MediaFilter_AddRef(IMediaFilter
*iface
)
4225 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4227 return Filtergraph_AddRef(This
);
4230 static ULONG WINAPI
MediaFilter_Release(IMediaFilter
*iface
)
4232 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4234 return Filtergraph_Release(This
);
4237 static HRESULT WINAPI
MediaFilter_GetClassID(IMediaFilter
*iface
, CLSID
* pClassID
)
4239 FIXME("(%p): stub\n", pClassID
);
4244 static HRESULT WINAPI
MediaFilter_Stop(IMediaFilter
*iface
)
4246 FIXME("(): stub\n");
4251 static HRESULT WINAPI
MediaFilter_Pause(IMediaFilter
*iface
)
4253 FIXME("(): stub\n");
4258 static HRESULT WINAPI
MediaFilter_Run(IMediaFilter
*iface
, REFERENCE_TIME tStart
)
4260 FIXME("(0x%s): stub\n", wine_dbgstr_longlong(tStart
));
4265 static HRESULT WINAPI
MediaFilter_GetState(IMediaFilter
*iface
, DWORD dwMsTimeout
, FILTER_STATE
* pState
)
4267 FIXME("(%d, %p): stub\n", dwMsTimeout
, pState
);
4272 static HRESULT WINAPI
MediaFilter_SetSyncSource(IMediaFilter
*iface
, IReferenceClock
*pClock
)
4274 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4278 TRACE("(%p/%p)->(%p)\n", iface
, This
, pClock
);
4280 EnterCriticalSection(&This
->cs
);
4282 for (i
= 0;i
< This
->nFilters
;i
++)
4284 hr
= IBaseFilter_SetSyncSource(This
->ppFiltersInGraph
[i
], pClock
);
4292 IBaseFilter_SetSyncSource(This
->ppFiltersInGraph
[i
], This
->refClock
);
4297 IReferenceClock_Release(This
->refClock
);
4298 This
->refClock
= pClock
;
4300 IReferenceClock_AddRef(This
->refClock
);
4302 if (This
->HandleEcClockChanged
)
4304 IMediaEventSink
*pEventSink
;
4307 eshr
= IMediaFilter_QueryInterface(iface
, &IID_IMediaEventSink
, (LPVOID
)&pEventSink
);
4308 if (SUCCEEDED(eshr
))
4310 IMediaEventSink_Notify(pEventSink
, EC_CLOCK_CHANGED
, 0, 0);
4311 IMediaEventSink_Release(pEventSink
);
4316 LeaveCriticalSection(&This
->cs
);
4321 static HRESULT WINAPI
MediaFilter_GetSyncSource(IMediaFilter
*iface
, IReferenceClock
**ppClock
)
4323 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4325 TRACE("(%p/%p)->(%p)\n", iface
, This
, ppClock
);
4330 EnterCriticalSection(&This
->cs
);
4332 *ppClock
= This
->refClock
;
4334 IReferenceClock_AddRef(*ppClock
);
4336 LeaveCriticalSection(&This
->cs
);
4341 static const IMediaFilterVtbl IMediaFilter_VTable
=
4343 MediaFilter_QueryInterface
,
4345 MediaFilter_Release
,
4346 MediaFilter_GetClassID
,
4350 MediaFilter_GetState
,
4351 MediaFilter_SetSyncSource
,
4352 MediaFilter_GetSyncSource
4355 static HRESULT WINAPI
MediaEventSink_QueryInterface(IMediaEventSink
*iface
, REFIID riid
, LPVOID
*ppv
)
4357 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4359 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4362 static ULONG WINAPI
MediaEventSink_AddRef(IMediaEventSink
*iface
)
4364 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4366 return Filtergraph_AddRef(This
);
4369 static ULONG WINAPI
MediaEventSink_Release(IMediaEventSink
*iface
)
4371 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4373 return Filtergraph_Release(This
);
4376 static HRESULT WINAPI
MediaEventSink_Notify(IMediaEventSink
*iface
, long EventCode
, LONG_PTR EventParam1
, LONG_PTR EventParam2
)
4378 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4381 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This
, iface
, EventCode
, EventParam1
, EventParam2
);
4383 /* We need thread safety here, let's use the events queue's one */
4384 EnterCriticalSection(&This
->evqueue
.msg_crst
);
4386 if ((EventCode
== EC_COMPLETE
) && This
->HandleEcComplete
)
4388 TRACE("Process EC_COMPLETE notification\n");
4389 if (++This
->EcCompleteCount
== This
->nRenderers
)
4391 evt
.lEventCode
= EC_COMPLETE
;
4394 TRACE("Send EC_COMPLETE to app\n");
4395 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4396 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4398 TRACE("Send Window message\n");
4399 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4401 This
->CompletionStatus
= EC_COMPLETE
;
4402 SetEvent(This
->hEventCompletion
);
4405 else if ((EventCode
== EC_REPAINT
) && This
->HandleEcRepaint
)
4407 /* FIXME: Not handled yet */
4411 evt
.lEventCode
= EventCode
;
4412 evt
.lParam1
= EventParam1
;
4413 evt
.lParam2
= EventParam2
;
4414 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4415 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4416 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4419 LeaveCriticalSection(&This
->evqueue
.msg_crst
);
4423 static const IMediaEventSinkVtbl IMediaEventSink_VTable
=
4425 MediaEventSink_QueryInterface
,
4426 MediaEventSink_AddRef
,
4427 MediaEventSink_Release
,
4428 MediaEventSink_Notify
4431 static HRESULT WINAPI
GraphConfig_QueryInterface(IGraphConfig
*iface
, REFIID riid
, LPVOID
*ppv
)
4433 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4435 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4438 static ULONG WINAPI
GraphConfig_AddRef(IGraphConfig
*iface
)
4440 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4442 return Filtergraph_AddRef(This
);
4445 static ULONG WINAPI
GraphConfig_Release(IGraphConfig
*iface
)
4447 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4449 return Filtergraph_Release(This
);
4452 static HRESULT WINAPI
GraphConfig_Reconnect(IGraphConfig
*iface
,
4455 const AM_MEDIA_TYPE
* pmtFirstConnection
,
4456 IBaseFilter
* pUsingFilter
,
4460 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4462 FIXME("(%p)->(%p, %p, %p, %p, %p, %x): stub!\n", This
, pOutputPin
, pInputPin
, pmtFirstConnection
, pUsingFilter
, hAbortEvent
, dwFlags
);
4467 static HRESULT WINAPI
GraphConfig_Reconfigure(IGraphConfig
*iface
,
4468 IGraphConfigCallback
* pCallback
,
4473 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4475 FIXME("(%p)->(%p, %p, %x, %p): stub!\n", This
, pCallback
, pvContext
, dwFlags
, hAbortEvent
);
4480 static HRESULT WINAPI
GraphConfig_AddFilterToCache(IGraphConfig
*iface
,
4481 IBaseFilter
* pFilter
)
4483 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4485 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4490 static HRESULT WINAPI
GraphConfig_EnumCacheFilter(IGraphConfig
*iface
,
4491 IEnumFilters
** pEnum
)
4493 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4495 FIXME("(%p)->(%p): stub!\n", This
, pEnum
);
4500 static HRESULT WINAPI
GraphConfig_RemoveFilterFromCache(IGraphConfig
*iface
,
4501 IBaseFilter
* pFilter
)
4503 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4505 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4510 static HRESULT WINAPI
GraphConfig_GetStartTime(IGraphConfig
*iface
,
4511 REFERENCE_TIME
* prtStart
)
4513 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4515 FIXME("(%p)->(%p): stub!\n", This
, prtStart
);
4520 static HRESULT WINAPI
GraphConfig_PushThroughData(IGraphConfig
*iface
,
4522 IPinConnection
* pConnection
,
4525 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4527 FIXME("(%p)->(%p, %p, %p): stub!\n", This
, pOutputPin
, pConnection
, hEventAbort
);
4532 static HRESULT WINAPI
GraphConfig_SetFilterFlags(IGraphConfig
*iface
,
4533 IBaseFilter
* pFilter
,
4536 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4538 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4543 static HRESULT WINAPI
GraphConfig_GetFilterFlags(IGraphConfig
*iface
,
4544 IBaseFilter
* pFilter
,
4547 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4549 FIXME("(%p)->(%p, %p): stub!\n", This
, pFilter
, dwFlags
);
4554 static HRESULT WINAPI
GraphConfig_RemoveFilterEx(IGraphConfig
*iface
,
4555 IBaseFilter
* pFilter
,
4558 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4560 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4565 static const IGraphConfigVtbl IGraphConfig_VTable
=
4567 GraphConfig_QueryInterface
,
4569 GraphConfig_Release
,
4570 GraphConfig_Reconnect
,
4571 GraphConfig_Reconfigure
,
4572 GraphConfig_AddFilterToCache
,
4573 GraphConfig_EnumCacheFilter
,
4574 GraphConfig_RemoveFilterFromCache
,
4575 GraphConfig_GetStartTime
,
4576 GraphConfig_PushThroughData
,
4577 GraphConfig_SetFilterFlags
,
4578 GraphConfig_GetFilterFlags
,
4579 GraphConfig_RemoveFilterEx
4582 /* This is the only function that actually creates a FilterGraph class... */
4583 HRESULT
FilterGraph_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4585 IFilterGraphImpl
*fimpl
;
4588 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
4591 return CLASS_E_NOAGGREGATION
;
4593 fimpl
= CoTaskMemAlloc(sizeof(*fimpl
));
4594 fimpl
->IGraphBuilder_vtbl
= &IGraphBuilder_VTable
;
4595 fimpl
->IMediaControl_vtbl
= &IMediaControl_VTable
;
4596 fimpl
->IMediaSeeking_vtbl
= &IMediaSeeking_VTable
;
4597 fimpl
->IBasicAudio_vtbl
= &IBasicAudio_VTable
;
4598 fimpl
->IBasicVideo_vtbl
= &IBasicVideo_VTable
;
4599 fimpl
->IVideoWindow_vtbl
= &IVideoWindow_VTable
;
4600 fimpl
->IMediaEventEx_vtbl
= &IMediaEventEx_VTable
;
4601 fimpl
->IMediaFilter_vtbl
= &IMediaFilter_VTable
;
4602 fimpl
->IMediaEventSink_vtbl
= &IMediaEventSink_VTable
;
4603 fimpl
->IGraphConfig_vtbl
= &IGraphConfig_VTable
;
4604 fimpl
->IMediaPosition_vtbl
= &IMediaPosition_VTable
;
4606 fimpl
->ppFiltersInGraph
= NULL
;
4607 fimpl
->pFilterNames
= NULL
;
4608 fimpl
->nFilters
= 0;
4609 fimpl
->filterCapacity
= 0;
4610 fimpl
->nameIndex
= 1;
4611 fimpl
->refClock
= NULL
;
4612 fimpl
->hEventCompletion
= CreateEventW(0, TRUE
, FALSE
, 0);
4613 fimpl
->HandleEcComplete
= TRUE
;
4614 fimpl
->HandleEcRepaint
= TRUE
;
4615 fimpl
->HandleEcClockChanged
= TRUE
;
4616 fimpl
->notif
.hWnd
= 0;
4617 fimpl
->notif
.disabled
= FALSE
;
4618 fimpl
->nRenderers
= 0;
4619 fimpl
->EcCompleteCount
= 0;
4620 fimpl
->state
= State_Stopped
;
4621 EventsQueue_Init(&fimpl
->evqueue
);
4622 InitializeCriticalSection(&fimpl
->cs
);
4623 fimpl
->cs
.DebugInfo
->Spare
[0] = (DWORD_PTR
)(__FILE__
": IFilterGraphImpl.cs");
4624 fimpl
->nItfCacheEntries
= 0;
4626 hr
= CoCreateInstance(&CLSID_FilterMapper2
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IFilterMapper2
, (LPVOID
*)&fimpl
->pFilterMapper2
);
4628 ERR("Unable to create filter mapper (%x)\n", hr
);
4636 HRESULT
FilterGraphNoThread_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4638 FIXME("CLSID_FilterGraphNoThread partially implemented - Forwarding to CLSID_FilterGraph\n");
4639 return FilterGraph_create(pUnkOuter
, ppObj
);