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
;
185 HANDLE hEventCompletion
;
186 int CompletionStatus
;
190 int HandleEcComplete
;
194 ITF_CACHE_ENTRY ItfCacheEntries
[MAX_ITF_CACHE_ENTRIES
];
195 int nItfCacheEntries
;
199 static HRESULT
Filtergraph_QueryInterface(IFilterGraphImpl
*This
,
202 TRACE("(%p)->(%s (%p), %p)\n", This
, debugstr_guid(riid
), riid
, ppvObj
);
204 if (IsEqualGUID(&IID_IUnknown
, riid
) ||
205 IsEqualGUID(&IID_IFilterGraph
, riid
) ||
206 IsEqualGUID(&IID_IGraphBuilder
, riid
)) {
207 *ppvObj
= &(This
->IGraphBuilder_vtbl
);
208 TRACE(" returning IGraphBuilder interface (%p)\n", *ppvObj
);
209 } else if (IsEqualGUID(&IID_IMediaControl
, riid
)) {
210 *ppvObj
= &(This
->IMediaControl_vtbl
);
211 TRACE(" returning IMediaControl interface (%p)\n", *ppvObj
);
212 } else if (IsEqualGUID(&IID_IMediaSeeking
, riid
)) {
213 *ppvObj
= &(This
->IMediaSeeking_vtbl
);
214 TRACE(" returning IMediaSeeking interface (%p)\n", *ppvObj
);
215 } else if (IsEqualGUID(&IID_IBasicAudio
, riid
)) {
216 *ppvObj
= &(This
->IBasicAudio_vtbl
);
217 TRACE(" returning IBasicAudio interface (%p)\n", *ppvObj
);
218 } else if (IsEqualGUID(&IID_IBasicVideo
, riid
)) {
219 *ppvObj
= &(This
->IBasicVideo_vtbl
);
220 TRACE(" returning IBasicVideo interface (%p)\n", *ppvObj
);
221 } else if (IsEqualGUID(&IID_IVideoWindow
, riid
)) {
222 *ppvObj
= &(This
->IVideoWindow_vtbl
);
223 TRACE(" returning IVideoWindow interface (%p)\n", *ppvObj
);
224 } else if (IsEqualGUID(&IID_IMediaEvent
, riid
) ||
225 IsEqualGUID(&IID_IMediaEventEx
, riid
)) {
226 *ppvObj
= &(This
->IMediaEventEx_vtbl
);
227 TRACE(" returning IMediaEvent(Ex) interface (%p)\n", *ppvObj
);
228 } else if (IsEqualGUID(&IID_IMediaFilter
, riid
) ||
229 IsEqualGUID(&IID_IPersist
, riid
)) {
230 *ppvObj
= &(This
->IMediaFilter_vtbl
);
231 TRACE(" returning IMediaFilter interface (%p)\n", *ppvObj
);
232 } else if (IsEqualGUID(&IID_IMediaEventSink
, riid
)) {
233 *ppvObj
= &(This
->IMediaEventSink_vtbl
);
234 TRACE(" returning IMediaEventSink interface (%p)\n", *ppvObj
);
235 } else if (IsEqualGUID(&IID_IGraphConfig
, riid
)) {
236 *ppvObj
= &(This
->IGraphConfig_vtbl
);
237 TRACE(" returning IGraphConfig interface (%p)\n", *ppvObj
);
238 } else if (IsEqualGUID(&IID_IMediaPosition
, riid
)) {
239 *ppvObj
= &(This
->IMediaPosition_vtbl
);
240 TRACE(" returning IMediaPosition interface (%p)\n", *ppvObj
);
243 FIXME("unknown interface %s\n", debugstr_guid(riid
));
244 return E_NOINTERFACE
;
247 InterlockedIncrement(&This
->ref
);
251 static ULONG
Filtergraph_AddRef(IFilterGraphImpl
*This
) {
252 ULONG ref
= InterlockedIncrement(&This
->ref
);
254 TRACE("(%p)->(): new ref = %d\n", This
, ref
);
259 static ULONG
Filtergraph_Release(IFilterGraphImpl
*This
) {
260 ULONG ref
= InterlockedDecrement(&This
->ref
);
262 TRACE("(%p)->(): new ref = %d\n", This
, ref
);
266 for (i
= 0; i
< This
->nFilters
; i
++)
267 IBaseFilter_Release(This
->ppFiltersInGraph
[i
]);
268 for (i
= 0; i
< This
->nItfCacheEntries
; i
++)
269 IUnknown_Release(This
->ItfCacheEntries
[i
].iface
);
270 IFilterMapper2_Release(This
->pFilterMapper2
);
271 CloseHandle(This
->hEventCompletion
);
272 EventsQueue_Destroy(&This
->evqueue
);
273 This
->cs
.DebugInfo
->Spare
[0] = 0;
274 DeleteCriticalSection(&This
->cs
);
275 CoTaskMemFree(This
->ppFiltersInGraph
);
276 CoTaskMemFree(This
->pFilterNames
);
283 /*** IUnknown methods ***/
284 static HRESULT WINAPI
GraphBuilder_QueryInterface(IGraphBuilder
*iface
,
287 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
289 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
290 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
293 static ULONG WINAPI
GraphBuilder_AddRef(IGraphBuilder
*iface
) {
294 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
296 TRACE("(%p/%p)->() calling FilterGraph AddRef\n", This
, iface
);
298 return Filtergraph_AddRef(This
);
301 static ULONG WINAPI
GraphBuilder_Release(IGraphBuilder
*iface
) {
302 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
304 TRACE("(%p/%p)->() calling FilterGraph Release\n", This
, iface
);
306 return Filtergraph_Release(This
);
309 /*** IFilterGraph methods ***/
310 static HRESULT WINAPI
GraphBuilder_AddFilter(IGraphBuilder
*iface
,
311 IBaseFilter
*pFilter
,
313 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
316 WCHAR
* wszFilterName
= NULL
;
317 int duplicate_name
= FALSE
;
319 TRACE("(%p/%p)->(%p, %s (%p))\n", This
, iface
, pFilter
, debugstr_w(pName
), pName
);
321 wszFilterName
= (WCHAR
*) CoTaskMemAlloc( (pName
? strlenW(pName
) + 6 : 5) * sizeof(WCHAR
) );
325 /* Check if name already exists */
326 for(i
= 0; i
< This
->nFilters
; i
++)
327 if (!strcmpW(This
->pFilterNames
[i
], pName
))
329 duplicate_name
= TRUE
;
334 /* If no name given or name already existing, generate one */
335 if (!pName
|| duplicate_name
)
337 static const WCHAR wszFmt1
[] = {'%','s',' ','%','0','4','d',0};
338 static const WCHAR wszFmt2
[] = {'%','0','4','d',0};
340 for (j
= 0; j
< 10000 ; j
++)
344 sprintfW(wszFilterName
, wszFmt1
, pName
, This
->nameIndex
);
346 sprintfW(wszFilterName
, wszFmt2
, This
->nameIndex
);
347 TRACE("Generated name %s\n", debugstr_w(wszFilterName
));
349 /* Check if the generated name already exists */
350 for(i
= 0; i
< This
->nFilters
; i
++)
351 if (!strcmpW(This
->pFilterNames
[i
], wszFilterName
))
354 /* Compute next index and exit if generated name is suitable */
355 if (This
->nameIndex
++ == 10000)
357 if (i
== This
->nFilters
)
360 /* Unable to find a suitable name */
363 CoTaskMemFree(wszFilterName
);
364 return VFW_E_DUPLICATE_NAME
;
368 memcpy(wszFilterName
, pName
, (strlenW(pName
) + 1) * sizeof(WCHAR
));
370 if (This
->nFilters
+ 1 > This
->filterCapacity
)
372 int newCapacity
= This
->filterCapacity
? 2 * This
->filterCapacity
: 1;
373 IBaseFilter
** ppNewFilters
= CoTaskMemAlloc(newCapacity
* sizeof(IBaseFilter
*));
374 LPWSTR
* pNewNames
= CoTaskMemAlloc(newCapacity
* sizeof(LPWSTR
));
375 memcpy(ppNewFilters
, This
->ppFiltersInGraph
, This
->nFilters
* sizeof(IBaseFilter
*));
376 memcpy(pNewNames
, This
->pFilterNames
, This
->nFilters
* sizeof(LPWSTR
));
377 if (!This
->filterCapacity
)
379 CoTaskMemFree(This
->ppFiltersInGraph
);
380 CoTaskMemFree(This
->pFilterNames
);
382 This
->ppFiltersInGraph
= ppNewFilters
;
383 This
->pFilterNames
= pNewNames
;
384 This
->filterCapacity
= newCapacity
;
387 hr
= IBaseFilter_JoinFilterGraph(pFilter
, (IFilterGraph
*)This
, wszFilterName
);
391 IBaseFilter_AddRef(pFilter
);
392 This
->ppFiltersInGraph
[This
->nFilters
] = pFilter
;
393 This
->pFilterNames
[This
->nFilters
] = wszFilterName
;
397 CoTaskMemFree(wszFilterName
);
399 if (SUCCEEDED(hr
) && duplicate_name
)
400 return VFW_S_DUPLICATE_NAME
;
405 static HRESULT WINAPI
GraphBuilder_RemoveFilter(IGraphBuilder
*iface
,
406 IBaseFilter
*pFilter
) {
407 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
411 TRACE("(%p/%p)->(%p)\n", This
, iface
, pFilter
);
413 /* FIXME: check graph is stopped */
415 for (i
= 0; i
< This
->nFilters
; i
++)
417 if (This
->ppFiltersInGraph
[i
] == pFilter
)
419 IEnumPins
*penumpins
;
420 hr
= IBaseFilter_EnumPins(pFilter
, &penumpins
);
423 while(IEnumPins_Next(penumpins
, 1, &ppin
, NULL
) == S_OK
) {
424 IPin_Disconnect(ppin
);
427 IEnumPins_Release(penumpins
);
430 hr
= IBaseFilter_JoinFilterGraph(pFilter
, NULL
, This
->pFilterNames
[i
]);
433 IBaseFilter_Release(pFilter
);
434 CoTaskMemFree(This
->pFilterNames
[i
]);
435 memmove(This
->ppFiltersInGraph
+i
, This
->ppFiltersInGraph
+i
+1, sizeof(IBaseFilter
*)*(This
->nFilters
- 1 - i
));
436 memmove(This
->pFilterNames
+i
, This
->pFilterNames
+i
+1, sizeof(LPWSTR
)*(This
->nFilters
- 1 - i
));
438 /* Invalidate interfaces in the cache */
439 for (i
= 0; i
< This
->nItfCacheEntries
; i
++)
440 if (pFilter
== This
->ItfCacheEntries
[i
].filter
)
442 IUnknown_Release(This
->ItfCacheEntries
[i
].iface
);
443 This
->ItfCacheEntries
[i
].iface
= NULL
;
444 This
->ItfCacheEntries
[i
].filter
= NULL
;
452 return hr
; /* FIXME: check this error code */
455 static HRESULT WINAPI
GraphBuilder_EnumFilters(IGraphBuilder
*iface
,
456 IEnumFilters
**ppEnum
) {
457 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
459 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppEnum
);
461 return IEnumFiltersImpl_Construct(This
->ppFiltersInGraph
, This
->nFilters
, ppEnum
);
464 static HRESULT WINAPI
GraphBuilder_FindFilterByName(IGraphBuilder
*iface
,
466 IBaseFilter
**ppFilter
) {
467 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
470 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_w(pName
), pName
, ppFilter
);
474 for (i
= 0; i
< This
->nFilters
; i
++)
476 if (!strcmpW(pName
, This
->pFilterNames
[i
]))
478 *ppFilter
= This
->ppFiltersInGraph
[i
];
479 IBaseFilter_AddRef(*ppFilter
);
484 return E_FAIL
; /* FIXME: check this error code */
487 /* NOTE: despite the implication, it doesn't matter which
488 * way round you put in the input and output pins */
489 static HRESULT WINAPI
GraphBuilder_ConnectDirect(IGraphBuilder
*iface
,
492 const AM_MEDIA_TYPE
*pmt
) {
496 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
498 TRACE("(%p/%p)->(%p, %p, %p)\n", This
, iface
, ppinIn
, ppinOut
, pmt
);
500 /* FIXME: check pins are in graph */
502 if (TRACE_ON(quartz
))
506 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
510 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
511 IBaseFilter_Release(PinInfo
.pFilter
);
513 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
517 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
518 IBaseFilter_Release(PinInfo
.pFilter
);
521 hr
= IPin_QueryDirection(ppinIn
, &dir
);
524 if (dir
== PINDIR_INPUT
)
525 hr
= IPin_Connect(ppinOut
, ppinIn
, pmt
);
527 hr
= IPin_Connect(ppinIn
, ppinOut
, pmt
);
533 static HRESULT WINAPI
GraphBuilder_Reconnect(IGraphBuilder
*iface
,
535 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
536 IPin
*pConnectedTo
= NULL
;
538 PIN_DIRECTION pindir
;
540 IPin_QueryDirection(ppin
, &pindir
);
541 hr
= IPin_ConnectedTo(ppin
, &pConnectedTo
);
543 TRACE("Querying connected to failed: %x\n", hr
);
546 IPin_Disconnect(ppin
);
547 IPin_Disconnect(pConnectedTo
);
548 if (pindir
== PINDIR_INPUT
)
549 hr
= IPin_Connect(pConnectedTo
, ppin
, NULL
);
551 hr
= IPin_Connect(ppin
, pConnectedTo
, NULL
);
552 IPin_Release(pConnectedTo
);
554 ERR("Reconnecting pins failed, pins are not connected now..\n");
555 TRACE("(%p->%p) -- %p %p -> %x\n", iface
, This
, ppin
, pConnectedTo
, hr
);
559 static HRESULT WINAPI
GraphBuilder_Disconnect(IGraphBuilder
*iface
,
561 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
563 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppin
);
565 return IPin_Disconnect(ppin
);
568 static HRESULT WINAPI
GraphBuilder_SetDefaultSyncSource(IGraphBuilder
*iface
) {
569 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
571 TRACE("(%p/%p)->(): stub !!!\n", iface
, This
);
576 static HRESULT
GetFilterInfo(IMoniker
* pMoniker
, GUID
* pclsid
, VARIANT
* pvar
)
578 static const WCHAR wszClsidName
[] = {'C','L','S','I','D',0};
579 static const WCHAR wszFriendlyName
[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
580 IPropertyBag
* pPropBagCat
= NULL
;
584 V_VT(pvar
) = VT_BSTR
;
586 hr
= IMoniker_BindToStorage(pMoniker
, NULL
, NULL
, &IID_IPropertyBag
, (LPVOID
*)&pPropBagCat
);
589 hr
= IPropertyBag_Read(pPropBagCat
, wszClsidName
, pvar
, NULL
);
592 hr
= CLSIDFromString(V_UNION(pvar
, bstrVal
), pclsid
);
595 hr
= IPropertyBag_Read(pPropBagCat
, wszFriendlyName
, pvar
, NULL
);
598 TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid
), debugstr_w(V_UNION(pvar
, bstrVal
)));
601 IPropertyBag_Release(pPropBagCat
);
606 static HRESULT
GetInternalConnections(IBaseFilter
* pfilter
, IPin
* pinputpin
, IPin
*** pppins
, ULONG
* pnb
)
611 TRACE("(%p, %p, %p, %p)\n", pfilter
, pinputpin
, pppins
, pnb
);
612 hr
= IPin_QueryInternalConnections(pinputpin
, NULL
, &nb
);
615 } else if (hr
== S_FALSE
) {
616 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*nb
);
617 hr
= IPin_QueryInternalConnections(pinputpin
, *pppins
, &nb
);
619 ERR("Error (%x)\n", hr
);
621 } else if (hr
== E_NOTIMPL
) {
622 /* Input connected to all outputs */
623 IEnumPins
* penumpins
;
626 TRACE("E_NOTIMPL\n");
627 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
629 ERR("filter Enumpins failed (%x)\n", hr
);
633 /* Count output pins */
634 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
635 PIN_DIRECTION pindir
;
636 IPin_QueryDirection(ppin
, &pindir
);
637 if (pindir
== PINDIR_OUTPUT
)
641 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*i
);
642 /* Retrieve output pins */
643 IEnumPins_Reset(penumpins
);
645 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
646 PIN_DIRECTION pindir
;
647 IPin_QueryDirection(ppin
, &pindir
);
648 if (pindir
== PINDIR_OUTPUT
)
649 (*pppins
)[i
++] = ppin
;
653 IEnumPins_Release(penumpins
);
656 ERR("Next failed (%x)\n", hr
);
659 } else if (FAILED(hr
)) {
660 ERR("Cannot get internal connection (%x)\n", hr
);
668 /*** IGraphBuilder methods ***/
669 static HRESULT WINAPI
GraphBuilder_Connect(IGraphBuilder
*iface
,
672 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
675 IEnumMediaTypes
* penummt
;
677 IEnumPins
* penumpins
;
678 IEnumMoniker
* pEnumMoniker
;
686 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, ppinOut
, ppinIn
);
688 if (TRACE_ON(quartz
))
690 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
694 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
695 IBaseFilter_Release(PinInfo
.pFilter
);
697 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
701 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
702 IBaseFilter_Release(PinInfo
.pFilter
);
705 /* Try direct connection first */
706 hr
= IPin_Connect(ppinOut
, ppinIn
, NULL
);
710 TRACE("Direct connection failed, trying to insert other filters\n");
712 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
716 hr
= IBaseFilter_GetClassID(PinInfo
.pFilter
, &FilterCLSID
);
717 IBaseFilter_Release(PinInfo
.pFilter
);
721 /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream
722 * filter to the minor mediatype of input pin of the renderer */
723 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
725 ERR("EnumMediaTypes (%x)\n", hr
);
729 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
731 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
736 ERR("No media type found!\n");
739 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
740 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
742 /* Try to find a suitable filter that can connect to the pin to render */
743 tab
[0] = mt
->majortype
;
744 tab
[1] = mt
->subtype
;
745 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
747 ERR("Unable to enum filters (%x)\n", hr
);
751 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
756 IPin
* ppinfilter
= NULL
;
757 IBaseFilter
* pfilter
= NULL
;
759 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
760 IMoniker_Release(pMoniker
);
762 ERR("Unable to retrieve filter info (%x)\n", hr
);
766 if (IsEqualGUID(&clsid
, &FilterCLSID
)) {
767 /* Skip filter (same as the one the output pin belongs to) */
771 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
773 ERR("Unable to create filter (%x), trying next one\n", hr
);
777 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, NULL
);
779 ERR("Unable to add filter (%x)\n", hr
);
780 IBaseFilter_Release(pfilter
);
785 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
787 ERR("Enumpins (%x)\n", hr
);
791 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
792 IEnumPins_Release(penumpins
);
795 ERR("Next (%x)\n", hr
);
803 hr
= IPin_Connect(ppinOut
, ppinfilter
, NULL
);
805 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
808 TRACE("Successfully connected to filter, follow chain...\n");
810 /* Render all output pins of the filter by calling IGraphBuilder_Render on each of them */
811 hr
= GetInternalConnections(pfilter
, ppinfilter
, &ppins
, &nb
);
816 IPin_Disconnect(ppinOut
);
819 TRACE("pins to consider: %d\n", nb
);
820 for(i
= 0; i
< nb
; i
++) {
821 TRACE("Processing pin %d\n", i
);
822 hr
= IGraphBuilder_Connect(iface
, ppins
[i
], ppinIn
);
824 TRACE("Cannot render pin %p (%x)\n", ppinfilter
, hr
);
826 IPin_Release(ppins
[i
]);
827 if (SUCCEEDED(hr
)) break;
829 while (++i
< nb
) IPin_Release(ppins
[i
]);
830 CoTaskMemFree(ppins
);
831 IPin_Release(ppinfilter
);
832 IBaseFilter_Release(pfilter
);
837 if (ppinfilter
) IPin_Release(ppinfilter
);
839 IGraphBuilder_RemoveFilter(iface
, pfilter
);
840 IBaseFilter_Release(pfilter
);
844 IEnumMediaTypes_Release(penummt
);
850 static HRESULT WINAPI
GraphBuilder_Render(IGraphBuilder
*iface
,
852 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
853 IEnumMediaTypes
* penummt
;
858 IEnumMoniker
* pEnumMoniker
;
863 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppinOut
);
865 if (TRACE_ON(quartz
))
869 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
873 TRACE("Filter owning pin => %p\n", PinInfo
.pFilter
);
874 IBaseFilter_Release(PinInfo
.pFilter
);
877 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
879 ERR("EnumMediaTypes (%x)\n", hr
);
885 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
887 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
892 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
893 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
895 /* Try to find a suitable renderer with the same media type */
896 tab
[0] = mt
->majortype
;
898 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, TRUE
, FALSE
, 0, NULL
, NULL
, NULL
);
900 ERR("Unable to enum filters (%x)\n", hr
);
904 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
909 IBaseFilter
* pfilter
= NULL
;
910 IEnumPins
* penumpins
;
913 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
914 IMoniker_Release(pMoniker
);
916 ERR("Unable to retrieve filter info (%x)\n", hr
);
920 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
922 ERR("Unable to create filter (%x), trying next one\n", hr
);
926 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, NULL
);
928 ERR("Unable to add filter (%x)\n", hr
);
929 IBaseFilter_Release(pfilter
);
934 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
936 ERR("Splitter Enumpins (%x)\n", hr
);
939 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
940 IEnumPins_Release(penumpins
);
942 ERR("Next (%x)\n", hr
);
950 /* Connect the pin to render to the renderer */
951 hr
= IGraphBuilder_Connect(iface
, ppinOut
, ppinfilter
);
953 TRACE("Unable to connect to renderer (%x)\n", hr
);
954 IPin_Release(ppinfilter
);
957 IPin_Release(ppinfilter
);
958 IBaseFilter_Release(pfilter
);
964 IGraphBuilder_RemoveFilter(iface
, pfilter
);
965 IBaseFilter_Release(pfilter
);
973 IEnumMediaTypes_Release(penummt
);
978 static HRESULT WINAPI
GraphBuilder_RenderFile(IGraphBuilder
*iface
,
980 LPCWSTR lpcwstrPlayList
) {
981 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
982 static const WCHAR string
[] = {'R','e','a','d','e','r',0};
983 IBaseFilter
* preader
= NULL
;
984 IBaseFilter
* psplitter
= NULL
;
985 IPin
* ppinreader
= NULL
;
987 IEnumPins
* penumpins
;
990 IEnumMoniker
* pEnumMoniker
= NULL
;
995 IFileSourceFilter
* pfile
= NULL
;
999 TRACE("(%p/%p)->(%s, %s)\n", This
, iface
, debugstr_w(lpcwstrFile
), debugstr_w(lpcwstrPlayList
));
1001 if (lpcwstrPlayList
!= NULL
)
1002 return E_INVALIDARG
;
1004 hr
= IGraphBuilder_AddSourceFilter(iface
, lpcwstrFile
, string
, &preader
);
1006 /* Retrieve file media type */
1008 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1009 if (SUCCEEDED(hr
)) {
1010 hr
= IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1011 IFileSourceFilter_Release(pfile
);
1015 hr
= IBaseFilter_EnumPins(preader
, &penumpins
);
1016 if (SUCCEEDED(hr
)) {
1017 hr
= IEnumPins_Next(penumpins
, 1, &ppinreader
, &pin
);
1018 IEnumPins_Release(penumpins
);
1021 if (SUCCEEDED(hr
)) {
1022 tab
[0] = mt
.majortype
;
1023 tab
[1] = mt
.subtype
;
1024 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
1030 IPin_Release(ppinreader
);
1032 IEnumMoniker_Release(pEnumMoniker
);
1034 IGraphBuilder_RemoveFilter(iface
, preader
);
1035 IBaseFilter_Release(preader
);
1040 hr
= VFW_E_CANNOT_RENDER
;
1041 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
1046 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
1047 IMoniker_Release(pMoniker
);
1049 ERR("Unable to retrieve filter info (%x)\n", hr
);
1053 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&psplitter
);
1055 ERR("Unable to create filter (%x), trying next one\n", hr
);
1059 hr
= IGraphBuilder_AddFilter(iface
, psplitter
, NULL
);
1061 ERR("Unable add filter (%x)\n", hr
);
1062 IBaseFilter_Release(psplitter
);
1066 /* Connect file source and splitter filters together */
1067 /* Make the splitter analyze incoming data */
1069 hr
= IBaseFilter_EnumPins(psplitter
, &penumpins
);
1070 if (SUCCEEDED(hr
)) {
1071 hr
= IEnumPins_Next(penumpins
, 1, &ppinsplitter
, &pin
);
1072 IEnumPins_Release(penumpins
);
1076 hr
= IPin_Connect(ppinreader
, ppinsplitter
, NULL
);
1078 /* Make sure there's some output pins in the filter */
1080 hr
= GetInternalConnections(psplitter
, ppinsplitter
, &ppins
, &nb
);
1081 if (SUCCEEDED(hr
)) {
1083 IPin_Disconnect(ppinreader
);
1084 TRACE("No output pins found in filter\n");
1085 hr
= VFW_E_CANNOT_RENDER
;
1090 IPin_Release(ppinsplitter
);
1091 ppinsplitter
= NULL
;
1093 if (SUCCEEDED(hr
)) {
1094 TRACE("Successfully connected to filter\n");
1098 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
1101 CoTaskMemFree(ppins
);
1104 IGraphBuilder_RemoveFilter(iface
, psplitter
);
1105 IBaseFilter_Release(psplitter
);
1109 /* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
1110 if (SUCCEEDED(hr
)) {
1113 TRACE("pins to consider: %d\n", nb
);
1114 for(i
= 0; i
< nb
; i
++) {
1115 TRACE("Processing pin %d\n", i
);
1116 hr
= IGraphBuilder_Render(iface
, ppins
[i
]);
1118 ERR("Cannot render pin %p (%x)\n", ppins
[i
], hr
);
1121 IPin_Release(ppins
[i
]);
1123 CoTaskMemFree(ppins
);
1125 hr
= (partial
? VFW_S_PARTIAL_RENDER
: S_OK
);
1128 IPin_Release(ppinreader
);
1129 IBaseFilter_Release(preader
);
1131 IBaseFilter_Release(psplitter
);
1136 static HRESULT WINAPI
GraphBuilder_AddSourceFilter(IGraphBuilder
*iface
,
1137 LPCWSTR lpcwstrFileName
,
1138 LPCWSTR lpcwstrFilterName
,
1139 IBaseFilter
**ppFilter
) {
1140 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1142 IBaseFilter
* preader
;
1143 IFileSourceFilter
* pfile
= NULL
;
1147 TRACE("(%p/%p)->(%s, %s, %p)\n", This
, iface
, debugstr_w(lpcwstrFileName
), debugstr_w(lpcwstrFilterName
), ppFilter
);
1149 /* Instantiate a file source filter */
1150 hr
= CoCreateInstance(&CLSID_AsyncReader
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&preader
);
1152 ERR("Unable to create file source filter (%x)\n", hr
);
1156 hr
= IGraphBuilder_AddFilter(iface
, preader
, lpcwstrFilterName
);
1158 ERR("Unable add filter (%x)\n", hr
);
1159 IBaseFilter_Release(preader
);
1163 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1165 ERR("Unable to get IFileSourceInterface (%x)\n", hr
);
1169 /* Load the file in the file source filter */
1170 hr
= IFileSourceFilter_Load(pfile
, lpcwstrFileName
, NULL
);
1172 ERR("Load (%x)\n", hr
);
1176 IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1178 ERR("GetCurFile (%x)\n", hr
);
1181 TRACE("File %s\n", debugstr_w(filename
));
1182 TRACE("MajorType %s\n", debugstr_guid(&mt
.majortype
));
1183 TRACE("SubType %s\n", debugstr_guid(&mt
.subtype
));
1186 *ppFilter
= preader
;
1187 IFileSourceFilter_Release(pfile
);
1193 IFileSourceFilter_Release(pfile
);
1194 IGraphBuilder_RemoveFilter(iface
, preader
);
1195 IBaseFilter_Release(preader
);
1200 static HRESULT WINAPI
GraphBuilder_SetLogFile(IGraphBuilder
*iface
,
1202 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1204 TRACE("(%p/%p)->(%08x): stub !!!\n", This
, iface
, (DWORD
) hFile
);
1209 static HRESULT WINAPI
GraphBuilder_Abort(IGraphBuilder
*iface
) {
1210 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1212 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1217 static HRESULT WINAPI
GraphBuilder_ShouldOperationContinue(IGraphBuilder
*iface
) {
1218 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1220 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1226 static const IGraphBuilderVtbl IGraphBuilder_VTable
=
1228 GraphBuilder_QueryInterface
,
1229 GraphBuilder_AddRef
,
1230 GraphBuilder_Release
,
1231 GraphBuilder_AddFilter
,
1232 GraphBuilder_RemoveFilter
,
1233 GraphBuilder_EnumFilters
,
1234 GraphBuilder_FindFilterByName
,
1235 GraphBuilder_ConnectDirect
,
1236 GraphBuilder_Reconnect
,
1237 GraphBuilder_Disconnect
,
1238 GraphBuilder_SetDefaultSyncSource
,
1239 GraphBuilder_Connect
,
1240 GraphBuilder_Render
,
1241 GraphBuilder_RenderFile
,
1242 GraphBuilder_AddSourceFilter
,
1243 GraphBuilder_SetLogFile
,
1245 GraphBuilder_ShouldOperationContinue
1248 /*** IUnknown methods ***/
1249 static HRESULT WINAPI
MediaControl_QueryInterface(IMediaControl
*iface
,
1252 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1254 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1256 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1259 static ULONG WINAPI
MediaControl_AddRef(IMediaControl
*iface
) {
1260 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1262 TRACE("(%p/%p)->()\n", This
, iface
);
1264 return Filtergraph_AddRef(This
);
1267 static ULONG WINAPI
MediaControl_Release(IMediaControl
*iface
) {
1268 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1270 TRACE("(%p/%p)->()\n", This
, iface
);
1272 return Filtergraph_Release(This
);
1276 /*** IDispatch methods ***/
1277 static HRESULT WINAPI
MediaControl_GetTypeInfoCount(IMediaControl
*iface
,
1279 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1281 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1286 static HRESULT WINAPI
MediaControl_GetTypeInfo(IMediaControl
*iface
,
1289 ITypeInfo
**ppTInfo
) {
1290 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1292 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1297 static HRESULT WINAPI
MediaControl_GetIDsOfNames(IMediaControl
*iface
,
1303 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1305 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1310 static HRESULT WINAPI
MediaControl_Invoke(IMediaControl
*iface
,
1311 DISPID dispIdMember
,
1315 DISPPARAMS
*pDispParams
,
1317 EXCEPINFO
*pExepInfo
,
1319 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1321 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
);
1326 typedef HRESULT(WINAPI
*fnFoundFilter
)(IBaseFilter
*);
1328 static HRESULT
ExploreGraph(IFilterGraphImpl
* pGraph
, IPin
* pOutputPin
, fnFoundFilter FoundFilter
)
1337 TRACE("%p %p\n", pGraph
, pOutputPin
);
1338 PinInfo
.pFilter
= NULL
;
1340 hr
= IPin_ConnectedTo(pOutputPin
, &pInputPin
);
1344 hr
= IPin_QueryPinInfo(pInputPin
, &PinInfo
);
1346 hr
= GetInternalConnections(PinInfo
.pFilter
, pInputPin
, &ppPins
, &nb
);
1347 IPin_Release(pInputPin
);
1354 TRACE("Reached a renderer\n");
1355 /* Count renderers for end of stream notification */
1356 pGraph
->nRenderers
++;
1360 for(i
= 0; i
< nb
; i
++)
1362 /* Explore the graph downstream from this pin
1363 * FIXME: We should prevent exploring from a pin more than once. This can happens when
1364 * several input pins are connected to the same output (a MUX for instance). */
1365 ExploreGraph(pGraph
, ppPins
[i
], FoundFilter
);
1366 IPin_Release(ppPins
[i
]);
1369 CoTaskMemFree(ppPins
);
1371 TRACE("Doing stuff with filter %p\n", PinInfo
.pFilter
);
1372 FoundFilter(PinInfo
.pFilter
);
1375 if (PinInfo
.pFilter
) IBaseFilter_Release(PinInfo
.pFilter
);
1379 static HRESULT WINAPI
SendRun(IBaseFilter
*pFilter
) {
1380 return IBaseFilter_Run(pFilter
, 0);
1383 static HRESULT WINAPI
SendPause(IBaseFilter
*pFilter
) {
1384 return IBaseFilter_Pause(pFilter
);
1387 static HRESULT WINAPI
SendStop(IBaseFilter
*pFilter
) {
1388 return IBaseFilter_Stop(pFilter
);
1391 static HRESULT
SendFilterMessage(IMediaControl
*iface
, fnFoundFilter FoundFilter
) {
1392 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1394 IBaseFilter
* pfilter
;
1400 TRACE("(%p/%p)->()\n", This
, iface
);
1402 /* Explorer the graph from source filters to renderers, determine renderers
1403 * number and run filters from renderers to source filters */
1404 This
->nRenderers
= 0;
1405 ResetEvent(This
->hEventCompletion
);
1407 for(i
= 0; i
< This
->nFilters
; i
++)
1410 pfilter
= This
->ppFiltersInGraph
[i
];
1411 hr
= IBaseFilter_EnumPins(pfilter
, &pEnum
);
1414 ERR("Enum pins failed %x\n", hr
);
1417 /* Check if it is a source filter */
1418 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1420 IPin_QueryDirection(pPin
, &dir
);
1422 if (dir
== PINDIR_INPUT
)
1430 TRACE("Found a source filter %p\n", pfilter
);
1431 IEnumPins_Reset(pEnum
);
1432 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1434 /* Explore the graph downstream from this pin */
1435 ExploreGraph(This
, pPin
, FoundFilter
);
1438 FoundFilter(pfilter
);
1440 IEnumPins_Release(pEnum
);
1446 /*** IMediaControl methods ***/
1447 static HRESULT WINAPI
MediaControl_Run(IMediaControl
*iface
) {
1448 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1449 TRACE("(%p/%p)->()\n", This
, iface
);
1451 if (This
->state
== State_Running
) return S_OK
;
1453 EnterCriticalSection(&This
->cs
);
1454 SendFilterMessage(iface
, SendRun
);
1455 This
->state
= State_Running
;
1456 LeaveCriticalSection(&This
->cs
);
1460 static HRESULT WINAPI
MediaControl_Pause(IMediaControl
*iface
) {
1461 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1462 TRACE("(%p/%p)->()\n", This
, iface
);
1464 if (This
->state
== State_Paused
) return S_OK
;
1466 EnterCriticalSection(&This
->cs
);
1467 SendFilterMessage(iface
, SendPause
);
1468 This
->state
= State_Paused
;
1469 LeaveCriticalSection(&This
->cs
);
1473 static HRESULT WINAPI
MediaControl_Stop(IMediaControl
*iface
) {
1474 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1475 TRACE("(%p/%p)->()\n", This
, iface
);
1477 if (This
->state
== State_Stopped
) return S_OK
;
1479 EnterCriticalSection(&This
->cs
);
1480 if (This
->state
== State_Running
) SendFilterMessage(iface
, SendPause
);
1481 SendFilterMessage(iface
, SendStop
);
1482 This
->state
= State_Stopped
;
1483 LeaveCriticalSection(&This
->cs
);
1487 static HRESULT WINAPI
MediaControl_GetState(IMediaControl
*iface
,
1489 OAFilterState
*pfs
) {
1490 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1492 TRACE("(%p/%p)->(%d, %p): semi-stub !!!\n", This
, iface
, msTimeout
, pfs
);
1494 EnterCriticalSection(&This
->cs
);
1498 LeaveCriticalSection(&This
->cs
);
1503 static HRESULT WINAPI
MediaControl_RenderFile(IMediaControl
*iface
,
1505 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1507 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
);
1512 static HRESULT WINAPI
MediaControl_AddSourceFilter(IMediaControl
*iface
,
1514 IDispatch
**ppUnk
) {
1515 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1517 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
, ppUnk
);
1522 static HRESULT WINAPI
MediaControl_get_FilterCollection(IMediaControl
*iface
,
1523 IDispatch
**ppUnk
) {
1524 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1526 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1531 static HRESULT WINAPI
MediaControl_get_RegFilterCollection(IMediaControl
*iface
,
1532 IDispatch
**ppUnk
) {
1533 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1535 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1540 static HRESULT WINAPI
MediaControl_StopWhenReady(IMediaControl
*iface
) {
1541 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1543 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1549 static const IMediaControlVtbl IMediaControl_VTable
=
1551 MediaControl_QueryInterface
,
1552 MediaControl_AddRef
,
1553 MediaControl_Release
,
1554 MediaControl_GetTypeInfoCount
,
1555 MediaControl_GetTypeInfo
,
1556 MediaControl_GetIDsOfNames
,
1557 MediaControl_Invoke
,
1561 MediaControl_GetState
,
1562 MediaControl_RenderFile
,
1563 MediaControl_AddSourceFilter
,
1564 MediaControl_get_FilterCollection
,
1565 MediaControl_get_RegFilterCollection
,
1566 MediaControl_StopWhenReady
1570 /*** IUnknown methods ***/
1571 static HRESULT WINAPI
MediaSeeking_QueryInterface(IMediaSeeking
*iface
,
1574 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1576 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1578 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1581 static ULONG WINAPI
MediaSeeking_AddRef(IMediaSeeking
*iface
) {
1582 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1584 TRACE("(%p/%p)->()\n", This
, iface
);
1586 return Filtergraph_AddRef(This
);
1589 static ULONG WINAPI
MediaSeeking_Release(IMediaSeeking
*iface
) {
1590 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1592 TRACE("(%p/%p)->()\n", This
, iface
);
1594 return Filtergraph_Release(This
);
1597 /*** IMediaSeeking methods ***/
1598 static HRESULT WINAPI
MediaSeeking_GetCapabilities(IMediaSeeking
*iface
,
1599 DWORD
*pCapabilities
) {
1600 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1602 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1607 static HRESULT WINAPI
MediaSeeking_CheckCapabilities(IMediaSeeking
*iface
,
1608 DWORD
*pCapabilities
) {
1609 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1611 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1616 static HRESULT WINAPI
MediaSeeking_IsFormatSupported(IMediaSeeking
*iface
,
1617 const GUID
*pFormat
) {
1618 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1620 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1625 static HRESULT WINAPI
MediaSeeking_QueryPreferredFormat(IMediaSeeking
*iface
,
1627 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1629 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1634 static HRESULT WINAPI
MediaSeeking_GetTimeFormat(IMediaSeeking
*iface
,
1636 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1638 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1643 static HRESULT WINAPI
MediaSeeking_IsUsingTimeFormat(IMediaSeeking
*iface
,
1644 const GUID
*pFormat
) {
1645 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1647 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1652 static HRESULT WINAPI
MediaSeeking_SetTimeFormat(IMediaSeeking
*iface
,
1653 const GUID
*pFormat
) {
1654 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1656 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1661 static HRESULT WINAPI
MediaSeeking_GetDuration(IMediaSeeking
*iface
,
1662 LONGLONG
*pDuration
) {
1663 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1665 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDuration
);
1670 static HRESULT WINAPI
MediaSeeking_GetStopPosition(IMediaSeeking
*iface
,
1672 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1674 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pStop
);
1679 static HRESULT WINAPI
MediaSeeking_GetCurrentPosition(IMediaSeeking
*iface
,
1680 LONGLONG
*pCurrent
) {
1681 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1683 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCurrent
);
1688 static HRESULT WINAPI
MediaSeeking_ConvertTimeFormat(IMediaSeeking
*iface
,
1690 const GUID
*pTargetFormat
,
1692 const GUID
*pSourceFormat
) {
1693 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1695 TRACE("(%p/%p)->(%p, %p, 0x%s, %p): stub !!!\n", This
, iface
, pTarget
,
1696 pTargetFormat
, wine_dbgstr_longlong(Source
), pSourceFormat
);
1701 static HRESULT WINAPI
MediaSeeking_SetPositions(IMediaSeeking
*iface
,
1703 DWORD dwCurrentFlags
,
1705 DWORD dwStopFlags
) {
1706 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1708 TRACE("(%p/%p)->(%p, %08x, %p, %08x): stub !!!\n", This
, iface
, pCurrent
, dwCurrentFlags
, pStop
, dwStopFlags
);
1713 static HRESULT WINAPI
MediaSeeking_GetPositions(IMediaSeeking
*iface
,
1716 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1718 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pCurrent
, pStop
);
1723 static HRESULT WINAPI
MediaSeeking_GetAvailable(IMediaSeeking
*iface
,
1724 LONGLONG
*pEarliest
,
1725 LONGLONG
*pLatest
) {
1726 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1728 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pEarliest
, pLatest
);
1733 static HRESULT WINAPI
MediaSeeking_SetRate(IMediaSeeking
*iface
,
1735 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1737 TRACE("(%p/%p)->(%f): stub !!!\n", This
, iface
, dRate
);
1742 static HRESULT WINAPI
MediaSeeking_GetRate(IMediaSeeking
*iface
,
1744 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1746 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pdRate
);
1751 static HRESULT WINAPI
MediaSeeking_GetPreroll(IMediaSeeking
*iface
,
1752 LONGLONG
*pllPreroll
) {
1753 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1755 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pllPreroll
);
1761 static const IMediaSeekingVtbl IMediaSeeking_VTable
=
1763 MediaSeeking_QueryInterface
,
1764 MediaSeeking_AddRef
,
1765 MediaSeeking_Release
,
1766 MediaSeeking_GetCapabilities
,
1767 MediaSeeking_CheckCapabilities
,
1768 MediaSeeking_IsFormatSupported
,
1769 MediaSeeking_QueryPreferredFormat
,
1770 MediaSeeking_GetTimeFormat
,
1771 MediaSeeking_IsUsingTimeFormat
,
1772 MediaSeeking_SetTimeFormat
,
1773 MediaSeeking_GetDuration
,
1774 MediaSeeking_GetStopPosition
,
1775 MediaSeeking_GetCurrentPosition
,
1776 MediaSeeking_ConvertTimeFormat
,
1777 MediaSeeking_SetPositions
,
1778 MediaSeeking_GetPositions
,
1779 MediaSeeking_GetAvailable
,
1780 MediaSeeking_SetRate
,
1781 MediaSeeking_GetRate
,
1782 MediaSeeking_GetPreroll
1785 /*** IUnknown methods ***/
1786 static HRESULT WINAPI
MediaPosition_QueryInterface(IMediaPosition
* iface
, REFIID riid
, void** ppvObj
){
1787 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1789 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1791 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1794 static ULONG WINAPI
MediaPosition_AddRef(IMediaPosition
*iface
){
1795 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1797 TRACE("(%p/%p)->()\n", This
, iface
);
1799 return Filtergraph_AddRef(This
);
1802 static ULONG WINAPI
MediaPosition_Release(IMediaPosition
*iface
){
1803 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1805 TRACE("(%p/%p)->()\n", This
, iface
);
1807 return Filtergraph_Release(This
);
1810 /*** IDispatch methods ***/
1811 static HRESULT WINAPI
MediaPosition_GetTypeInfoCount(IMediaPosition
*iface
, UINT
* pctinfo
){
1812 FIXME("(%p) stub!\n", iface
);
1816 static HRESULT WINAPI
MediaPosition_GetTypeInfo(IMediaPosition
*iface
, UINT iTInfo
, LCID lcid
, ITypeInfo
** ppTInfo
){
1817 FIXME("(%p) stub!\n", iface
);
1821 static HRESULT WINAPI
MediaPosition_GetIDsOfNames(IMediaPosition
* iface
, REFIID riid
, LPOLESTR
* rgszNames
, UINT cNames
, LCID lcid
, DISPID
* rgDispId
){
1822 FIXME("(%p) stub!\n", iface
);
1826 static HRESULT WINAPI
MediaPosition_Invoke(IMediaPosition
* iface
, DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
* pDispParams
, VARIANT
* pVarResult
, EXCEPINFO
* pExcepInfo
, UINT
* puArgErr
){
1827 FIXME("(%p) stub!\n", iface
);
1831 /*** IMediaPosition methods ***/
1832 static HRESULT WINAPI
MediaPosition_get_Duration(IMediaPosition
* iface
, REFTIME
*plength
){
1833 FIXME("(%p)->(%p) stub!\n", iface
, plength
);
1837 static HRESULT WINAPI
MediaPosition_put_CurrentPosition(IMediaPosition
* iface
, REFTIME llTime
){
1838 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1842 static HRESULT WINAPI
MediaPosition_get_CurrentPosition(IMediaPosition
* iface
, REFTIME
*pllTime
){
1843 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1847 static HRESULT WINAPI
MediaPosition_get_StopTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1848 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1852 static HRESULT WINAPI
MediaPosition_put_StopTime(IMediaPosition
* iface
, REFTIME llTime
){
1853 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1857 static HRESULT WINAPI
MediaPosition_get_PrerollTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1858 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1862 static HRESULT WINAPI
MediaPosition_put_PrerollTime(IMediaPosition
* iface
, REFTIME llTime
){
1863 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1867 static HRESULT WINAPI
MediaPosition_put_Rate(IMediaPosition
* iface
, double dRate
){
1868 FIXME("(%p)->(%f) stub!\n", iface
, dRate
);
1872 static HRESULT WINAPI
MediaPosition_get_Rate(IMediaPosition
* iface
, double *pdRate
){
1873 FIXME("(%p)->(%p) stub!\n", iface
, pdRate
);
1877 static HRESULT WINAPI
MediaPosition_CanSeekForward(IMediaPosition
* iface
, LONG
*pCanSeekForward
){
1878 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekForward
);
1882 static HRESULT WINAPI
MediaPosition_CanSeekBackward(IMediaPosition
* iface
, LONG
*pCanSeekBackward
){
1883 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekBackward
);
1888 static const IMediaPositionVtbl IMediaPosition_VTable
=
1890 MediaPosition_QueryInterface
,
1891 MediaPosition_AddRef
,
1892 MediaPosition_Release
,
1893 MediaPosition_GetTypeInfoCount
,
1894 MediaPosition_GetTypeInfo
,
1895 MediaPosition_GetIDsOfNames
,
1896 MediaPosition_Invoke
,
1897 MediaPosition_get_Duration
,
1898 MediaPosition_put_CurrentPosition
,
1899 MediaPosition_get_CurrentPosition
,
1900 MediaPosition_get_StopTime
,
1901 MediaPosition_put_StopTime
,
1902 MediaPosition_get_PrerollTime
,
1903 MediaPosition_put_PrerollTime
,
1904 MediaPosition_put_Rate
,
1905 MediaPosition_get_Rate
,
1906 MediaPosition_CanSeekForward
,
1907 MediaPosition_CanSeekBackward
1910 static HRESULT
GetTargetInterface(IFilterGraphImpl
* pGraph
, REFIID riid
, LPVOID
* ppvObj
)
1912 HRESULT hr
= E_NOINTERFACE
;
1916 /* Check if the interface type is already registered */
1917 for (entry
= 0; entry
< pGraph
->nItfCacheEntries
; entry
++)
1918 if (riid
== pGraph
->ItfCacheEntries
[entry
].riid
)
1920 if (pGraph
->ItfCacheEntries
[entry
].iface
)
1922 /* Return the interface if available */
1923 *ppvObj
= pGraph
->ItfCacheEntries
[entry
].iface
;
1929 if (entry
>= MAX_ITF_CACHE_ENTRIES
)
1931 FIXME("Not enough space to store interface in the cache\n");
1932 return E_OUTOFMEMORY
;
1935 /* Find a filter supporting the requested interface */
1936 for (i
= 0; i
< pGraph
->nFilters
; i
++)
1938 hr
= IBaseFilter_QueryInterface(pGraph
->ppFiltersInGraph
[i
], riid
, ppvObj
);
1941 pGraph
->ItfCacheEntries
[entry
].riid
= riid
;
1942 pGraph
->ItfCacheEntries
[entry
].filter
= pGraph
->ppFiltersInGraph
[i
];
1943 pGraph
->ItfCacheEntries
[entry
].iface
= (IUnknown
*)*ppvObj
;
1944 if (entry
>= pGraph
->nItfCacheEntries
)
1945 pGraph
->nItfCacheEntries
++;
1948 if (hr
!= E_NOINTERFACE
)
1955 /*** IUnknown methods ***/
1956 static HRESULT WINAPI
BasicAudio_QueryInterface(IBasicAudio
*iface
,
1959 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1961 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1963 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1966 static ULONG WINAPI
BasicAudio_AddRef(IBasicAudio
*iface
) {
1967 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1969 TRACE("(%p/%p)->()\n", This
, iface
);
1971 return Filtergraph_AddRef(This
);
1974 static ULONG WINAPI
BasicAudio_Release(IBasicAudio
*iface
) {
1975 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1977 TRACE("(%p/%p)->()\n", This
, iface
);
1979 return Filtergraph_Release(This
);
1982 /*** IDispatch methods ***/
1983 static HRESULT WINAPI
BasicAudio_GetTypeInfoCount(IBasicAudio
*iface
,
1985 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1986 IBasicAudio
* pBasicAudio
;
1989 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
1991 EnterCriticalSection(&This
->cs
);
1993 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
1996 hr
= IBasicAudio_GetTypeInfoCount(pBasicAudio
, pctinfo
);
1998 LeaveCriticalSection(&This
->cs
);
2003 static HRESULT WINAPI
BasicAudio_GetTypeInfo(IBasicAudio
*iface
,
2006 ITypeInfo
**ppTInfo
) {
2007 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2008 IBasicAudio
* pBasicAudio
;
2011 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2013 EnterCriticalSection(&This
->cs
);
2015 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2018 hr
= IBasicAudio_GetTypeInfo(pBasicAudio
, iTInfo
, lcid
, ppTInfo
);
2020 LeaveCriticalSection(&This
->cs
);
2025 static HRESULT WINAPI
BasicAudio_GetIDsOfNames(IBasicAudio
*iface
,
2031 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2032 IBasicAudio
* pBasicAudio
;
2035 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2037 EnterCriticalSection(&This
->cs
);
2039 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2042 hr
= IBasicAudio_GetIDsOfNames(pBasicAudio
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2044 LeaveCriticalSection(&This
->cs
);
2049 static HRESULT WINAPI
BasicAudio_Invoke(IBasicAudio
*iface
,
2050 DISPID dispIdMember
,
2054 DISPPARAMS
*pDispParams
,
2056 EXCEPINFO
*pExepInfo
,
2058 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2059 IBasicAudio
* pBasicAudio
;
2062 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
);
2064 EnterCriticalSection(&This
->cs
);
2066 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2069 hr
= IBasicAudio_Invoke(pBasicAudio
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2071 LeaveCriticalSection(&This
->cs
);
2076 /*** IBasicAudio methods ***/
2077 static HRESULT WINAPI
BasicAudio_put_Volume(IBasicAudio
*iface
,
2079 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2080 IBasicAudio
* pBasicAudio
;
2083 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lVolume
);
2085 EnterCriticalSection(&This
->cs
);
2087 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2090 hr
= IBasicAudio_put_Volume(pBasicAudio
, lVolume
);
2092 LeaveCriticalSection(&This
->cs
);
2097 static HRESULT WINAPI
BasicAudio_get_Volume(IBasicAudio
*iface
,
2099 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2100 IBasicAudio
* pBasicAudio
;
2103 TRACE("(%p/%p)->(%p)\n", This
, iface
, plVolume
);
2105 EnterCriticalSection(&This
->cs
);
2107 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2110 hr
= IBasicAudio_get_Volume(pBasicAudio
, plVolume
);
2112 LeaveCriticalSection(&This
->cs
);
2117 static HRESULT WINAPI
BasicAudio_put_Balance(IBasicAudio
*iface
,
2119 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2120 IBasicAudio
* pBasicAudio
;
2123 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lBalance
);
2125 EnterCriticalSection(&This
->cs
);
2127 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2130 hr
= IBasicAudio_put_Balance(pBasicAudio
, lBalance
);
2132 LeaveCriticalSection(&This
->cs
);
2137 static HRESULT WINAPI
BasicAudio_get_Balance(IBasicAudio
*iface
,
2139 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2140 IBasicAudio
* pBasicAudio
;
2143 TRACE("(%p/%p)->(%p)\n", This
, iface
, plBalance
);
2145 EnterCriticalSection(&This
->cs
);
2147 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2150 hr
= IBasicAudio_get_Balance(pBasicAudio
, plBalance
);
2152 LeaveCriticalSection(&This
->cs
);
2157 static const IBasicAudioVtbl IBasicAudio_VTable
=
2159 BasicAudio_QueryInterface
,
2162 BasicAudio_GetTypeInfoCount
,
2163 BasicAudio_GetTypeInfo
,
2164 BasicAudio_GetIDsOfNames
,
2166 BasicAudio_put_Volume
,
2167 BasicAudio_get_Volume
,
2168 BasicAudio_put_Balance
,
2169 BasicAudio_get_Balance
2172 /*** IUnknown methods ***/
2173 static HRESULT WINAPI
BasicVideo_QueryInterface(IBasicVideo
*iface
,
2176 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2178 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2180 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2183 static ULONG WINAPI
BasicVideo_AddRef(IBasicVideo
*iface
) {
2184 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2186 TRACE("(%p/%p)->()\n", This
, iface
);
2188 return Filtergraph_AddRef(This
);
2191 static ULONG WINAPI
BasicVideo_Release(IBasicVideo
*iface
) {
2192 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2194 TRACE("(%p/%p)->()\n", This
, iface
);
2196 return Filtergraph_Release(This
);
2199 /*** IDispatch methods ***/
2200 static HRESULT WINAPI
BasicVideo_GetTypeInfoCount(IBasicVideo
*iface
,
2202 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2203 IBasicVideo
* pBasicVideo
;
2206 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
2208 EnterCriticalSection(&This
->cs
);
2210 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2213 hr
= IBasicVideo_GetTypeInfoCount(pBasicVideo
, pctinfo
);
2215 LeaveCriticalSection(&This
->cs
);
2220 static HRESULT WINAPI
BasicVideo_GetTypeInfo(IBasicVideo
*iface
,
2223 ITypeInfo
**ppTInfo
) {
2224 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2225 IBasicVideo
* pBasicVideo
;
2228 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2230 EnterCriticalSection(&This
->cs
);
2232 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2235 hr
= IBasicVideo_GetTypeInfo(pBasicVideo
, iTInfo
, lcid
, ppTInfo
);
2237 LeaveCriticalSection(&This
->cs
);
2242 static HRESULT WINAPI
BasicVideo_GetIDsOfNames(IBasicVideo
*iface
,
2248 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2249 IBasicVideo
* pBasicVideo
;
2252 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2254 EnterCriticalSection(&This
->cs
);
2256 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2259 hr
= IBasicVideo_GetIDsOfNames(pBasicVideo
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2261 LeaveCriticalSection(&This
->cs
);
2266 static HRESULT WINAPI
BasicVideo_Invoke(IBasicVideo
*iface
,
2267 DISPID dispIdMember
,
2271 DISPPARAMS
*pDispParams
,
2273 EXCEPINFO
*pExepInfo
,
2275 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2276 IBasicVideo
* pBasicVideo
;
2279 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
);
2281 EnterCriticalSection(&This
->cs
);
2283 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2286 hr
= IBasicVideo_Invoke(pBasicVideo
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2288 LeaveCriticalSection(&This
->cs
);
2293 /*** IBasicVideo methods ***/
2294 static HRESULT WINAPI
BasicVideo_get_AvgTimePerFrame(IBasicVideo
*iface
,
2295 REFTIME
*pAvgTimePerFrame
) {
2296 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2297 IBasicVideo
* pBasicVideo
;
2300 TRACE("(%p/%p)->(%p)\n", This
, iface
, pAvgTimePerFrame
);
2302 EnterCriticalSection(&This
->cs
);
2304 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2307 hr
= IBasicVideo_get_AvgTimePerFrame(pBasicVideo
, pAvgTimePerFrame
);
2309 LeaveCriticalSection(&This
->cs
);
2314 static HRESULT WINAPI
BasicVideo_get_BitRate(IBasicVideo
*iface
,
2316 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2317 IBasicVideo
* pBasicVideo
;
2320 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitRate
);
2322 EnterCriticalSection(&This
->cs
);
2324 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2327 hr
= IBasicVideo_get_BitRate(pBasicVideo
, pBitRate
);
2329 LeaveCriticalSection(&This
->cs
);
2334 static HRESULT WINAPI
BasicVideo_get_BitErrorRate(IBasicVideo
*iface
,
2335 long *pBitErrorRate
) {
2336 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2337 IBasicVideo
* pBasicVideo
;
2340 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitErrorRate
);
2342 EnterCriticalSection(&This
->cs
);
2344 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2347 hr
= IBasicVideo_get_BitErrorRate(pBasicVideo
, pBitErrorRate
);
2349 LeaveCriticalSection(&This
->cs
);
2354 static HRESULT WINAPI
BasicVideo_get_VideoWidth(IBasicVideo
*iface
,
2355 long *pVideoWidth
) {
2356 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2357 IBasicVideo
* pBasicVideo
;
2360 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoWidth
);
2362 EnterCriticalSection(&This
->cs
);
2364 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2367 hr
= IBasicVideo_get_VideoWidth(pBasicVideo
, pVideoWidth
);
2369 LeaveCriticalSection(&This
->cs
);
2374 static HRESULT WINAPI
BasicVideo_get_VideoHeight(IBasicVideo
*iface
,
2375 long *pVideoHeight
) {
2376 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2377 IBasicVideo
* pBasicVideo
;
2380 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoHeight
);
2382 EnterCriticalSection(&This
->cs
);
2384 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2387 hr
= IBasicVideo_get_VideoHeight(pBasicVideo
, pVideoHeight
);
2389 LeaveCriticalSection(&This
->cs
);
2394 static HRESULT WINAPI
BasicVideo_put_SourceLeft(IBasicVideo
*iface
,
2396 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2397 IBasicVideo
* pBasicVideo
;
2400 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceLeft
);
2402 EnterCriticalSection(&This
->cs
);
2404 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2407 hr
= IBasicVideo_put_SourceLeft(pBasicVideo
, SourceLeft
);
2409 LeaveCriticalSection(&This
->cs
);
2414 static HRESULT WINAPI
BasicVideo_get_SourceLeft(IBasicVideo
*iface
,
2415 long *pSourceLeft
) {
2416 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2417 IBasicVideo
* pBasicVideo
;
2420 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceLeft
);
2422 EnterCriticalSection(&This
->cs
);
2424 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2427 hr
= IBasicVideo_get_SourceLeft(pBasicVideo
, pSourceLeft
);
2429 LeaveCriticalSection(&This
->cs
);
2434 static HRESULT WINAPI
BasicVideo_put_SourceWidth(IBasicVideo
*iface
,
2436 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2437 IBasicVideo
* pBasicVideo
;
2440 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceWidth
);
2442 EnterCriticalSection(&This
->cs
);
2444 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2447 hr
= IBasicVideo_put_SourceWidth(pBasicVideo
, SourceWidth
);
2449 LeaveCriticalSection(&This
->cs
);
2454 static HRESULT WINAPI
BasicVideo_get_SourceWidth(IBasicVideo
*iface
,
2455 long *pSourceWidth
) {
2456 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2457 IBasicVideo
* pBasicVideo
;
2460 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceWidth
);
2462 EnterCriticalSection(&This
->cs
);
2464 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2467 hr
= IBasicVideo_get_SourceWidth(pBasicVideo
, pSourceWidth
);
2469 LeaveCriticalSection(&This
->cs
);
2474 static HRESULT WINAPI
BasicVideo_put_SourceTop(IBasicVideo
*iface
,
2476 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2477 IBasicVideo
* pBasicVideo
;
2480 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceTop
);
2482 EnterCriticalSection(&This
->cs
);
2484 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2487 hr
= IBasicVideo_put_SourceTop(pBasicVideo
, SourceTop
);
2489 LeaveCriticalSection(&This
->cs
);
2494 static HRESULT WINAPI
BasicVideo_get_SourceTop(IBasicVideo
*iface
,
2496 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2497 IBasicVideo
* pBasicVideo
;
2500 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceTop
);
2502 EnterCriticalSection(&This
->cs
);
2504 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2507 hr
= IBasicVideo_get_SourceTop(pBasicVideo
, pSourceTop
);
2509 LeaveCriticalSection(&This
->cs
);
2514 static HRESULT WINAPI
BasicVideo_put_SourceHeight(IBasicVideo
*iface
,
2515 long SourceHeight
) {
2516 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2517 IBasicVideo
* pBasicVideo
;
2520 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceHeight
);
2522 EnterCriticalSection(&This
->cs
);
2524 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2527 hr
= IBasicVideo_put_SourceHeight(pBasicVideo
, SourceHeight
);
2529 LeaveCriticalSection(&This
->cs
);
2534 static HRESULT WINAPI
BasicVideo_get_SourceHeight(IBasicVideo
*iface
,
2535 long *pSourceHeight
) {
2536 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2537 IBasicVideo
* pBasicVideo
;
2540 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceHeight
);
2542 EnterCriticalSection(&This
->cs
);
2544 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2547 hr
= IBasicVideo_get_SourceHeight(pBasicVideo
, pSourceHeight
);
2549 LeaveCriticalSection(&This
->cs
);
2554 static HRESULT WINAPI
BasicVideo_put_DestinationLeft(IBasicVideo
*iface
,
2555 long DestinationLeft
) {
2556 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2557 IBasicVideo
* pBasicVideo
;
2560 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationLeft
);
2562 EnterCriticalSection(&This
->cs
);
2564 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2567 hr
= IBasicVideo_put_DestinationLeft(pBasicVideo
, DestinationLeft
);
2569 LeaveCriticalSection(&This
->cs
);
2574 static HRESULT WINAPI
BasicVideo_get_DestinationLeft(IBasicVideo
*iface
,
2575 long *pDestinationLeft
) {
2576 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2577 IBasicVideo
* pBasicVideo
;
2580 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationLeft
);
2582 EnterCriticalSection(&This
->cs
);
2584 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2587 hr
= IBasicVideo_get_DestinationLeft(pBasicVideo
, pDestinationLeft
);
2589 LeaveCriticalSection(&This
->cs
);
2594 static HRESULT WINAPI
BasicVideo_put_DestinationWidth(IBasicVideo
*iface
,
2595 long DestinationWidth
) {
2596 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2597 IBasicVideo
* pBasicVideo
;
2600 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationWidth
);
2602 EnterCriticalSection(&This
->cs
);
2604 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2607 hr
= IBasicVideo_put_DestinationWidth(pBasicVideo
, DestinationWidth
);
2609 LeaveCriticalSection(&This
->cs
);
2614 static HRESULT WINAPI
BasicVideo_get_DestinationWidth(IBasicVideo
*iface
,
2615 long *pDestinationWidth
) {
2616 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2617 IBasicVideo
* pBasicVideo
;
2620 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationWidth
);
2622 EnterCriticalSection(&This
->cs
);
2624 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2627 hr
= IBasicVideo_get_DestinationWidth(pBasicVideo
, pDestinationWidth
);
2629 LeaveCriticalSection(&This
->cs
);
2634 static HRESULT WINAPI
BasicVideo_put_DestinationTop(IBasicVideo
*iface
,
2635 long DestinationTop
) {
2636 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2637 IBasicVideo
* pBasicVideo
;
2640 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationTop
);
2642 EnterCriticalSection(&This
->cs
);
2644 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2647 hr
= IBasicVideo_put_DestinationTop(pBasicVideo
, DestinationTop
);
2649 LeaveCriticalSection(&This
->cs
);
2654 static HRESULT WINAPI
BasicVideo_get_DestinationTop(IBasicVideo
*iface
,
2655 long *pDestinationTop
) {
2656 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2657 IBasicVideo
* pBasicVideo
;
2660 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationTop
);
2662 EnterCriticalSection(&This
->cs
);
2664 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2667 hr
= IBasicVideo_get_DestinationTop(pBasicVideo
, pDestinationTop
);
2669 LeaveCriticalSection(&This
->cs
);
2674 static HRESULT WINAPI
BasicVideo_put_DestinationHeight(IBasicVideo
*iface
,
2675 long DestinationHeight
) {
2676 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2677 IBasicVideo
* pBasicVideo
;
2680 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationHeight
);
2682 EnterCriticalSection(&This
->cs
);
2684 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2687 hr
= IBasicVideo_put_DestinationHeight(pBasicVideo
, DestinationHeight
);
2689 LeaveCriticalSection(&This
->cs
);
2694 static HRESULT WINAPI
BasicVideo_get_DestinationHeight(IBasicVideo
*iface
,
2695 long *pDestinationHeight
) {
2696 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2697 IBasicVideo
* pBasicVideo
;
2700 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationHeight
);
2702 EnterCriticalSection(&This
->cs
);
2704 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2707 hr
= IBasicVideo_get_DestinationHeight(pBasicVideo
, pDestinationHeight
);
2709 LeaveCriticalSection(&This
->cs
);
2714 static HRESULT WINAPI
BasicVideo_SetSourcePosition(IBasicVideo
*iface
,
2719 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2720 IBasicVideo
* pBasicVideo
;
2723 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2725 EnterCriticalSection(&This
->cs
);
2727 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2730 hr
= IBasicVideo_SetSourcePosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2732 LeaveCriticalSection(&This
->cs
);
2737 static HRESULT WINAPI
BasicVideo_GetSourcePosition(IBasicVideo
*iface
,
2742 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2743 IBasicVideo
* pBasicVideo
;
2746 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2748 EnterCriticalSection(&This
->cs
);
2750 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2753 hr
= IBasicVideo_GetSourcePosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2755 LeaveCriticalSection(&This
->cs
);
2760 static HRESULT WINAPI
BasicVideo_SetDefaultSourcePosition(IBasicVideo
*iface
) {
2761 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2762 IBasicVideo
* pBasicVideo
;
2765 TRACE("(%p/%p)->()\n", This
, iface
);
2767 EnterCriticalSection(&This
->cs
);
2769 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2772 hr
= IBasicVideo_SetDefaultSourcePosition(pBasicVideo
);
2774 LeaveCriticalSection(&This
->cs
);
2779 static HRESULT WINAPI
BasicVideo_SetDestinationPosition(IBasicVideo
*iface
,
2784 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2785 IBasicVideo
* pBasicVideo
;
2788 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2790 EnterCriticalSection(&This
->cs
);
2792 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2795 hr
= IBasicVideo_SetDestinationPosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2797 LeaveCriticalSection(&This
->cs
);
2802 static HRESULT WINAPI
BasicVideo_GetDestinationPosition(IBasicVideo
*iface
,
2807 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2808 IBasicVideo
* pBasicVideo
;
2811 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2813 EnterCriticalSection(&This
->cs
);
2815 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2818 hr
= IBasicVideo_GetDestinationPosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2820 LeaveCriticalSection(&This
->cs
);
2825 static HRESULT WINAPI
BasicVideo_SetDefaultDestinationPosition(IBasicVideo
*iface
) {
2826 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2827 IBasicVideo
* pBasicVideo
;
2830 TRACE("(%p/%p)->()\n", This
, iface
);
2832 EnterCriticalSection(&This
->cs
);
2834 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2837 hr
= IBasicVideo_SetDefaultDestinationPosition(pBasicVideo
);
2839 LeaveCriticalSection(&This
->cs
);
2844 static HRESULT WINAPI
BasicVideo_GetVideoSize(IBasicVideo
*iface
,
2847 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2848 IBasicVideo
* pBasicVideo
;
2851 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
2853 EnterCriticalSection(&This
->cs
);
2855 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2858 hr
= IBasicVideo_GetVideoSize(pBasicVideo
, pWidth
, pHeight
);
2860 LeaveCriticalSection(&This
->cs
);
2865 static HRESULT WINAPI
BasicVideo_GetVideoPaletteEntries(IBasicVideo
*iface
,
2870 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2871 IBasicVideo
* pBasicVideo
;
2874 TRACE("(%p/%p)->(%ld, %ld, %p, %p)\n", This
, iface
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2876 EnterCriticalSection(&This
->cs
);
2878 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2881 hr
= IBasicVideo_GetVideoPaletteEntries(pBasicVideo
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2883 LeaveCriticalSection(&This
->cs
);
2888 static HRESULT WINAPI
BasicVideo_GetCurrentImage(IBasicVideo
*iface
,
2891 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2892 IBasicVideo
* pBasicVideo
;
2895 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pBufferSize
, pDIBImage
);
2897 EnterCriticalSection(&This
->cs
);
2899 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2902 hr
= IBasicVideo_GetCurrentImage(pBasicVideo
, pBufferSize
, pDIBImage
);
2904 LeaveCriticalSection(&This
->cs
);
2909 static HRESULT WINAPI
BasicVideo_IsUsingDefaultSource(IBasicVideo
*iface
) {
2910 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2911 IBasicVideo
* pBasicVideo
;
2914 TRACE("(%p/%p)->()\n", This
, iface
);
2916 EnterCriticalSection(&This
->cs
);
2918 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2921 hr
= IBasicVideo_IsUsingDefaultSource(pBasicVideo
);
2923 LeaveCriticalSection(&This
->cs
);
2928 static HRESULT WINAPI
BasicVideo_IsUsingDefaultDestination(IBasicVideo
*iface
) {
2929 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2930 IBasicVideo
* pBasicVideo
;
2933 TRACE("(%p/%p)->()\n", This
, iface
);
2935 EnterCriticalSection(&This
->cs
);
2937 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2940 hr
= IBasicVideo_IsUsingDefaultDestination(pBasicVideo
);
2942 LeaveCriticalSection(&This
->cs
);
2948 static const IBasicVideoVtbl IBasicVideo_VTable
=
2950 BasicVideo_QueryInterface
,
2953 BasicVideo_GetTypeInfoCount
,
2954 BasicVideo_GetTypeInfo
,
2955 BasicVideo_GetIDsOfNames
,
2957 BasicVideo_get_AvgTimePerFrame
,
2958 BasicVideo_get_BitRate
,
2959 BasicVideo_get_BitErrorRate
,
2960 BasicVideo_get_VideoWidth
,
2961 BasicVideo_get_VideoHeight
,
2962 BasicVideo_put_SourceLeft
,
2963 BasicVideo_get_SourceLeft
,
2964 BasicVideo_put_SourceWidth
,
2965 BasicVideo_get_SourceWidth
,
2966 BasicVideo_put_SourceTop
,
2967 BasicVideo_get_SourceTop
,
2968 BasicVideo_put_SourceHeight
,
2969 BasicVideo_get_SourceHeight
,
2970 BasicVideo_put_DestinationLeft
,
2971 BasicVideo_get_DestinationLeft
,
2972 BasicVideo_put_DestinationWidth
,
2973 BasicVideo_get_DestinationWidth
,
2974 BasicVideo_put_DestinationTop
,
2975 BasicVideo_get_DestinationTop
,
2976 BasicVideo_put_DestinationHeight
,
2977 BasicVideo_get_DestinationHeight
,
2978 BasicVideo_SetSourcePosition
,
2979 BasicVideo_GetSourcePosition
,
2980 BasicVideo_SetDefaultSourcePosition
,
2981 BasicVideo_SetDestinationPosition
,
2982 BasicVideo_GetDestinationPosition
,
2983 BasicVideo_SetDefaultDestinationPosition
,
2984 BasicVideo_GetVideoSize
,
2985 BasicVideo_GetVideoPaletteEntries
,
2986 BasicVideo_GetCurrentImage
,
2987 BasicVideo_IsUsingDefaultSource
,
2988 BasicVideo_IsUsingDefaultDestination
2992 /*** IUnknown methods ***/
2993 static HRESULT WINAPI
VideoWindow_QueryInterface(IVideoWindow
*iface
,
2996 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2998 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
3000 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
3003 static ULONG WINAPI
VideoWindow_AddRef(IVideoWindow
*iface
) {
3004 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3006 TRACE("(%p/%p)->()\n", This
, iface
);
3008 return Filtergraph_AddRef(This
);
3011 static ULONG WINAPI
VideoWindow_Release(IVideoWindow
*iface
) {
3012 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3014 TRACE("(%p/%p)->()\n", This
, iface
);
3016 return Filtergraph_Release(This
);
3019 /*** IDispatch methods ***/
3020 static HRESULT WINAPI
VideoWindow_GetTypeInfoCount(IVideoWindow
*iface
,
3022 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3023 IVideoWindow
* pVideoWindow
;
3026 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
3028 EnterCriticalSection(&This
->cs
);
3030 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3033 hr
= IVideoWindow_GetTypeInfoCount(pVideoWindow
, pctinfo
);
3035 LeaveCriticalSection(&This
->cs
);
3040 static HRESULT WINAPI
VideoWindow_GetTypeInfo(IVideoWindow
*iface
,
3043 ITypeInfo
**ppTInfo
) {
3044 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3045 IVideoWindow
* pVideoWindow
;
3048 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
3050 EnterCriticalSection(&This
->cs
);
3052 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3055 hr
= IVideoWindow_GetTypeInfo(pVideoWindow
, iTInfo
, lcid
, ppTInfo
);
3057 LeaveCriticalSection(&This
->cs
);
3062 static HRESULT WINAPI
VideoWindow_GetIDsOfNames(IVideoWindow
*iface
,
3068 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3069 IVideoWindow
* pVideoWindow
;
3072 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3074 EnterCriticalSection(&This
->cs
);
3076 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3079 hr
= IVideoWindow_GetIDsOfNames(pVideoWindow
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3081 LeaveCriticalSection(&This
->cs
);
3086 static HRESULT WINAPI
VideoWindow_Invoke(IVideoWindow
*iface
,
3087 DISPID dispIdMember
,
3091 DISPPARAMS
*pDispParams
,
3093 EXCEPINFO
*pExepInfo
,
3095 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3096 IVideoWindow
* pVideoWindow
;
3099 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
);
3101 EnterCriticalSection(&This
->cs
);
3103 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3106 hr
= IVideoWindow_Invoke(pVideoWindow
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
3108 LeaveCriticalSection(&This
->cs
);
3114 /*** IVideoWindow methods ***/
3115 static HRESULT WINAPI
VideoWindow_put_Caption(IVideoWindow
*iface
,
3117 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3118 IVideoWindow
* pVideoWindow
;
3121 TRACE("(%p/%p)->(%s (%p))\n", This
, iface
, debugstr_w(strCaption
), strCaption
);
3123 EnterCriticalSection(&This
->cs
);
3125 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3128 hr
= IVideoWindow_put_Caption(pVideoWindow
, strCaption
);
3130 LeaveCriticalSection(&This
->cs
);
3135 static HRESULT WINAPI
VideoWindow_get_Caption(IVideoWindow
*iface
,
3137 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3138 IVideoWindow
* pVideoWindow
;
3141 TRACE("(%p/%p)->(%p)\n", This
, iface
, strCaption
);
3143 EnterCriticalSection(&This
->cs
);
3145 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3148 hr
= IVideoWindow_get_Caption(pVideoWindow
, strCaption
);
3150 LeaveCriticalSection(&This
->cs
);
3155 static HRESULT WINAPI
VideoWindow_put_WindowStyle(IVideoWindow
*iface
,
3157 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3158 IVideoWindow
* pVideoWindow
;
3161 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyle
);
3163 EnterCriticalSection(&This
->cs
);
3165 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3168 hr
= IVideoWindow_put_WindowStyle(pVideoWindow
, WindowStyle
);
3170 LeaveCriticalSection(&This
->cs
);
3175 static HRESULT WINAPI
VideoWindow_get_WindowStyle(IVideoWindow
*iface
,
3176 long *WindowStyle
) {
3177 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3178 IVideoWindow
* pVideoWindow
;
3181 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyle
);
3183 EnterCriticalSection(&This
->cs
);
3185 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3188 hr
= IVideoWindow_get_WindowStyle(pVideoWindow
, WindowStyle
);
3190 LeaveCriticalSection(&This
->cs
);
3195 static HRESULT WINAPI
VideoWindow_put_WindowStyleEx(IVideoWindow
*iface
,
3196 long WindowStyleEx
) {
3197 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3198 IVideoWindow
* pVideoWindow
;
3201 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyleEx
);
3203 EnterCriticalSection(&This
->cs
);
3205 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3208 hr
= IVideoWindow_put_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3210 LeaveCriticalSection(&This
->cs
);
3215 static HRESULT WINAPI
VideoWindow_get_WindowStyleEx(IVideoWindow
*iface
,
3216 long *WindowStyleEx
) {
3217 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3218 IVideoWindow
* pVideoWindow
;
3221 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyleEx
);
3223 EnterCriticalSection(&This
->cs
);
3225 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3228 hr
= IVideoWindow_get_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3230 LeaveCriticalSection(&This
->cs
);
3235 static HRESULT WINAPI
VideoWindow_put_AutoShow(IVideoWindow
*iface
,
3237 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3238 IVideoWindow
* pVideoWindow
;
3241 TRACE("(%p/%p)->(%ld)\n", This
, iface
, AutoShow
);
3243 EnterCriticalSection(&This
->cs
);
3245 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3248 hr
= IVideoWindow_put_AutoShow(pVideoWindow
, AutoShow
);
3250 LeaveCriticalSection(&This
->cs
);
3255 static HRESULT WINAPI
VideoWindow_get_AutoShow(IVideoWindow
*iface
,
3257 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3258 IVideoWindow
* pVideoWindow
;
3261 TRACE("(%p/%p)->(%p)\n", This
, iface
, AutoShow
);
3263 EnterCriticalSection(&This
->cs
);
3265 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3268 hr
= IVideoWindow_get_AutoShow(pVideoWindow
, AutoShow
);
3270 LeaveCriticalSection(&This
->cs
);
3275 static HRESULT WINAPI
VideoWindow_put_WindowState(IVideoWindow
*iface
,
3277 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3278 IVideoWindow
* pVideoWindow
;
3281 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowState
);
3283 EnterCriticalSection(&This
->cs
);
3285 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3288 hr
= IVideoWindow_put_WindowState(pVideoWindow
, WindowState
);
3290 LeaveCriticalSection(&This
->cs
);
3295 static HRESULT WINAPI
VideoWindow_get_WindowState(IVideoWindow
*iface
,
3296 long *WindowState
) {
3297 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3298 IVideoWindow
* pVideoWindow
;
3301 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowState
);
3303 EnterCriticalSection(&This
->cs
);
3305 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3308 hr
= IVideoWindow_get_WindowState(pVideoWindow
, WindowState
);
3310 LeaveCriticalSection(&This
->cs
);
3315 static HRESULT WINAPI
VideoWindow_put_BackgroundPalette(IVideoWindow
*iface
,
3316 long BackgroundPalette
) {
3317 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3318 IVideoWindow
* pVideoWindow
;
3321 TRACE("(%p/%p)->(%ld)\n", This
, iface
, BackgroundPalette
);
3323 EnterCriticalSection(&This
->cs
);
3325 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3328 hr
= IVideoWindow_put_BackgroundPalette(pVideoWindow
, BackgroundPalette
);
3330 LeaveCriticalSection(&This
->cs
);
3335 static HRESULT WINAPI
VideoWindow_get_BackgroundPalette(IVideoWindow
*iface
,
3336 long *pBackgroundPalette
) {
3337 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3338 IVideoWindow
* pVideoWindow
;
3341 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBackgroundPalette
);
3343 EnterCriticalSection(&This
->cs
);
3345 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3348 hr
= IVideoWindow_get_BackgroundPalette(pVideoWindow
, pBackgroundPalette
);
3350 LeaveCriticalSection(&This
->cs
);
3355 static HRESULT WINAPI
VideoWindow_put_Visible(IVideoWindow
*iface
,
3357 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3358 IVideoWindow
* pVideoWindow
;
3361 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Visible
);
3363 EnterCriticalSection(&This
->cs
);
3365 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3368 hr
= IVideoWindow_put_Visible(pVideoWindow
, Visible
);
3370 LeaveCriticalSection(&This
->cs
);
3375 static HRESULT WINAPI
VideoWindow_get_Visible(IVideoWindow
*iface
,
3377 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3378 IVideoWindow
* pVideoWindow
;
3381 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVisible
);
3383 EnterCriticalSection(&This
->cs
);
3385 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3388 hr
= IVideoWindow_get_Visible(pVideoWindow
, pVisible
);
3390 LeaveCriticalSection(&This
->cs
);
3395 static HRESULT WINAPI
VideoWindow_put_Left(IVideoWindow
*iface
,
3397 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3398 IVideoWindow
* pVideoWindow
;
3401 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Left
);
3403 EnterCriticalSection(&This
->cs
);
3405 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3408 hr
= IVideoWindow_put_Left(pVideoWindow
, Left
);
3410 LeaveCriticalSection(&This
->cs
);
3415 static HRESULT WINAPI
VideoWindow_get_Left(IVideoWindow
*iface
,
3417 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3418 IVideoWindow
* pVideoWindow
;
3421 TRACE("(%p/%p)->(%p)\n", This
, iface
, pLeft
);
3423 EnterCriticalSection(&This
->cs
);
3425 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3428 hr
= IVideoWindow_get_Left(pVideoWindow
, pLeft
);
3430 LeaveCriticalSection(&This
->cs
);
3435 static HRESULT WINAPI
VideoWindow_put_Width(IVideoWindow
*iface
,
3437 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3438 IVideoWindow
* pVideoWindow
;
3441 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Width
);
3443 EnterCriticalSection(&This
->cs
);
3445 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3448 hr
= IVideoWindow_put_Width(pVideoWindow
, Width
);
3450 LeaveCriticalSection(&This
->cs
);
3455 static HRESULT WINAPI
VideoWindow_get_Width(IVideoWindow
*iface
,
3457 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3458 IVideoWindow
* pVideoWindow
;
3461 TRACE("(%p/%p)->(%p)\n", This
, iface
, pWidth
);
3463 EnterCriticalSection(&This
->cs
);
3465 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3468 hr
= IVideoWindow_get_Width(pVideoWindow
, pWidth
);
3470 LeaveCriticalSection(&This
->cs
);
3475 static HRESULT WINAPI
VideoWindow_put_Top(IVideoWindow
*iface
,
3477 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3478 IVideoWindow
* pVideoWindow
;
3481 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Top
);
3483 EnterCriticalSection(&This
->cs
);
3485 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3488 hr
= IVideoWindow_put_Top(pVideoWindow
, Top
);
3490 LeaveCriticalSection(&This
->cs
);
3495 static HRESULT WINAPI
VideoWindow_get_Top(IVideoWindow
*iface
,
3497 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3498 IVideoWindow
* pVideoWindow
;
3501 TRACE("(%p/%p)->(%p)\n", This
, iface
, pTop
);
3503 EnterCriticalSection(&This
->cs
);
3505 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3508 hr
= IVideoWindow_get_Top(pVideoWindow
, pTop
);
3510 LeaveCriticalSection(&This
->cs
);
3515 static HRESULT WINAPI
VideoWindow_put_Height(IVideoWindow
*iface
,
3517 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3518 IVideoWindow
* pVideoWindow
;
3521 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Height
);
3523 EnterCriticalSection(&This
->cs
);
3525 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3528 hr
= IVideoWindow_put_Height(pVideoWindow
, Height
);
3530 LeaveCriticalSection(&This
->cs
);
3535 static HRESULT WINAPI
VideoWindow_get_Height(IVideoWindow
*iface
,
3537 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3538 IVideoWindow
* pVideoWindow
;
3541 TRACE("(%p/%p)->(%p)\n", This
, iface
, pHeight
);
3543 EnterCriticalSection(&This
->cs
);
3545 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3548 hr
= IVideoWindow_get_Height(pVideoWindow
, pHeight
);
3550 LeaveCriticalSection(&This
->cs
);
3555 static HRESULT WINAPI
VideoWindow_put_Owner(IVideoWindow
*iface
,
3557 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3558 IVideoWindow
* pVideoWindow
;
3561 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Owner
);
3563 EnterCriticalSection(&This
->cs
);
3565 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3568 hr
= IVideoWindow_put_Owner(pVideoWindow
, Owner
);
3570 LeaveCriticalSection(&This
->cs
);
3575 static HRESULT WINAPI
VideoWindow_get_Owner(IVideoWindow
*iface
,
3577 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3578 IVideoWindow
* pVideoWindow
;
3581 TRACE("(%p/%p)->(%p)\n", This
, iface
, Owner
);
3583 EnterCriticalSection(&This
->cs
);
3585 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3588 hr
= IVideoWindow_get_Owner(pVideoWindow
, Owner
);
3590 LeaveCriticalSection(&This
->cs
);
3595 static HRESULT WINAPI
VideoWindow_put_MessageDrain(IVideoWindow
*iface
,
3597 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3598 IVideoWindow
* pVideoWindow
;
3601 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Drain
);
3603 EnterCriticalSection(&This
->cs
);
3605 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3608 hr
= IVideoWindow_put_MessageDrain(pVideoWindow
, Drain
);
3610 LeaveCriticalSection(&This
->cs
);
3615 static HRESULT WINAPI
VideoWindow_get_MessageDrain(IVideoWindow
*iface
,
3617 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3618 IVideoWindow
* pVideoWindow
;
3621 TRACE("(%p/%p)->(%p)\n", This
, iface
, Drain
);
3623 EnterCriticalSection(&This
->cs
);
3625 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3628 hr
= IVideoWindow_get_MessageDrain(pVideoWindow
, Drain
);
3630 LeaveCriticalSection(&This
->cs
);
3635 static HRESULT WINAPI
VideoWindow_get_BorderColor(IVideoWindow
*iface
,
3637 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3638 IVideoWindow
* pVideoWindow
;
3641 TRACE("(%p/%p)->(%p)\n", This
, iface
, Color
);
3643 EnterCriticalSection(&This
->cs
);
3645 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3648 hr
= IVideoWindow_get_BorderColor(pVideoWindow
, Color
);
3650 LeaveCriticalSection(&This
->cs
);
3655 static HRESULT WINAPI
VideoWindow_put_BorderColor(IVideoWindow
*iface
,
3657 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3658 IVideoWindow
* pVideoWindow
;
3661 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Color
);
3663 EnterCriticalSection(&This
->cs
);
3665 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3668 hr
= IVideoWindow_put_BorderColor(pVideoWindow
, Color
);
3670 LeaveCriticalSection(&This
->cs
);
3675 static HRESULT WINAPI
VideoWindow_get_FullScreenMode(IVideoWindow
*iface
,
3676 long *FullScreenMode
) {
3677 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3678 IVideoWindow
* pVideoWindow
;
3681 TRACE("(%p/%p)->(%p)\n", This
, iface
, FullScreenMode
);
3683 EnterCriticalSection(&This
->cs
);
3685 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3688 hr
= IVideoWindow_get_FullScreenMode(pVideoWindow
, FullScreenMode
);
3690 LeaveCriticalSection(&This
->cs
);
3695 static HRESULT WINAPI
VideoWindow_put_FullScreenMode(IVideoWindow
*iface
,
3696 long FullScreenMode
) {
3697 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3698 IVideoWindow
* pVideoWindow
;
3701 TRACE("(%p/%p)->(%ld)\n", This
, iface
, FullScreenMode
);
3703 EnterCriticalSection(&This
->cs
);
3705 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3708 hr
= IVideoWindow_put_FullScreenMode(pVideoWindow
, FullScreenMode
);
3710 LeaveCriticalSection(&This
->cs
);
3715 static HRESULT WINAPI
VideoWindow_SetWindowForeground(IVideoWindow
*iface
,
3717 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3718 IVideoWindow
* pVideoWindow
;
3721 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Focus
);
3723 EnterCriticalSection(&This
->cs
);
3725 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3728 hr
= IVideoWindow_SetWindowForeground(pVideoWindow
, Focus
);
3730 LeaveCriticalSection(&This
->cs
);
3735 static HRESULT WINAPI
VideoWindow_NotifyOwnerMessage(IVideoWindow
*iface
,
3740 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3741 IVideoWindow
* pVideoWindow
;
3744 TRACE("(%p/%p)->(%08x, %ld, %08lx, %08lx)\n", This
, iface
, (DWORD
) hwnd
, uMsg
, wParam
, lParam
);
3746 EnterCriticalSection(&This
->cs
);
3748 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3751 hr
= IVideoWindow_NotifyOwnerMessage(pVideoWindow
, hwnd
, uMsg
, wParam
, lParam
);
3753 LeaveCriticalSection(&This
->cs
);
3758 static HRESULT WINAPI
VideoWindow_SetWindowPosition(IVideoWindow
*iface
,
3763 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3764 IVideoWindow
* pVideoWindow
;
3767 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
3769 EnterCriticalSection(&This
->cs
);
3771 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3774 hr
= IVideoWindow_SetWindowPosition(pVideoWindow
, Left
, Top
, Width
, Height
);
3776 LeaveCriticalSection(&This
->cs
);
3781 static HRESULT WINAPI
VideoWindow_GetWindowPosition(IVideoWindow
*iface
,
3786 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3787 IVideoWindow
* pVideoWindow
;
3790 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3792 EnterCriticalSection(&This
->cs
);
3794 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3797 hr
= IVideoWindow_GetWindowPosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3799 LeaveCriticalSection(&This
->cs
);
3804 static HRESULT WINAPI
VideoWindow_GetMinIdealImageSize(IVideoWindow
*iface
,
3807 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3808 IVideoWindow
* pVideoWindow
;
3811 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3813 EnterCriticalSection(&This
->cs
);
3815 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3818 hr
= IVideoWindow_GetMinIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3820 LeaveCriticalSection(&This
->cs
);
3825 static HRESULT WINAPI
VideoWindow_GetMaxIdealImageSize(IVideoWindow
*iface
,
3828 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3829 IVideoWindow
* pVideoWindow
;
3832 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3834 EnterCriticalSection(&This
->cs
);
3836 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3839 hr
= IVideoWindow_GetMaxIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3841 LeaveCriticalSection(&This
->cs
);
3846 static HRESULT WINAPI
VideoWindow_GetRestorePosition(IVideoWindow
*iface
,
3851 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3852 IVideoWindow
* pVideoWindow
;
3855 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3857 EnterCriticalSection(&This
->cs
);
3859 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3862 hr
= IVideoWindow_GetRestorePosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3864 LeaveCriticalSection(&This
->cs
);
3869 static HRESULT WINAPI
VideoWindow_HideCursor(IVideoWindow
*iface
,
3871 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3872 IVideoWindow
* pVideoWindow
;
3875 TRACE("(%p/%p)->(%ld)\n", This
, iface
, HideCursor
);
3877 EnterCriticalSection(&This
->cs
);
3879 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3882 hr
= IVideoWindow_HideCursor(pVideoWindow
, HideCursor
);
3884 LeaveCriticalSection(&This
->cs
);
3889 static HRESULT WINAPI
VideoWindow_IsCursorHidden(IVideoWindow
*iface
,
3890 long *CursorHidden
) {
3891 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3892 IVideoWindow
* pVideoWindow
;
3895 TRACE("(%p/%p)->(%p)\n", This
, iface
, CursorHidden
);
3897 EnterCriticalSection(&This
->cs
);
3899 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3902 hr
= IVideoWindow_IsCursorHidden(pVideoWindow
, CursorHidden
);
3904 LeaveCriticalSection(&This
->cs
);
3910 static const IVideoWindowVtbl IVideoWindow_VTable
=
3912 VideoWindow_QueryInterface
,
3914 VideoWindow_Release
,
3915 VideoWindow_GetTypeInfoCount
,
3916 VideoWindow_GetTypeInfo
,
3917 VideoWindow_GetIDsOfNames
,
3919 VideoWindow_put_Caption
,
3920 VideoWindow_get_Caption
,
3921 VideoWindow_put_WindowStyle
,
3922 VideoWindow_get_WindowStyle
,
3923 VideoWindow_put_WindowStyleEx
,
3924 VideoWindow_get_WindowStyleEx
,
3925 VideoWindow_put_AutoShow
,
3926 VideoWindow_get_AutoShow
,
3927 VideoWindow_put_WindowState
,
3928 VideoWindow_get_WindowState
,
3929 VideoWindow_put_BackgroundPalette
,
3930 VideoWindow_get_BackgroundPalette
,
3931 VideoWindow_put_Visible
,
3932 VideoWindow_get_Visible
,
3933 VideoWindow_put_Left
,
3934 VideoWindow_get_Left
,
3935 VideoWindow_put_Width
,
3936 VideoWindow_get_Width
,
3937 VideoWindow_put_Top
,
3938 VideoWindow_get_Top
,
3939 VideoWindow_put_Height
,
3940 VideoWindow_get_Height
,
3941 VideoWindow_put_Owner
,
3942 VideoWindow_get_Owner
,
3943 VideoWindow_put_MessageDrain
,
3944 VideoWindow_get_MessageDrain
,
3945 VideoWindow_get_BorderColor
,
3946 VideoWindow_put_BorderColor
,
3947 VideoWindow_get_FullScreenMode
,
3948 VideoWindow_put_FullScreenMode
,
3949 VideoWindow_SetWindowForeground
,
3950 VideoWindow_NotifyOwnerMessage
,
3951 VideoWindow_SetWindowPosition
,
3952 VideoWindow_GetWindowPosition
,
3953 VideoWindow_GetMinIdealImageSize
,
3954 VideoWindow_GetMaxIdealImageSize
,
3955 VideoWindow_GetRestorePosition
,
3956 VideoWindow_HideCursor
,
3957 VideoWindow_IsCursorHidden
3961 /*** IUnknown methods ***/
3962 static HRESULT WINAPI
MediaEvent_QueryInterface(IMediaEventEx
*iface
,
3965 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3967 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
3969 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
3972 static ULONG WINAPI
MediaEvent_AddRef(IMediaEventEx
*iface
) {
3973 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3975 TRACE("(%p/%p)->()\n", This
, iface
);
3977 return Filtergraph_AddRef(This
);
3980 static ULONG WINAPI
MediaEvent_Release(IMediaEventEx
*iface
) {
3981 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3983 TRACE("(%p/%p)->()\n", This
, iface
);
3985 return Filtergraph_Release(This
);
3988 /*** IDispatch methods ***/
3989 static HRESULT WINAPI
MediaEvent_GetTypeInfoCount(IMediaEventEx
*iface
,
3991 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3993 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
3998 static HRESULT WINAPI
MediaEvent_GetTypeInfo(IMediaEventEx
*iface
,
4001 ITypeInfo
**ppTInfo
) {
4002 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4004 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
4009 static HRESULT WINAPI
MediaEvent_GetIDsOfNames(IMediaEventEx
*iface
,
4015 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4017 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
4022 static HRESULT WINAPI
MediaEvent_Invoke(IMediaEventEx
*iface
,
4023 DISPID dispIdMember
,
4027 DISPPARAMS
*pDispParams
,
4029 EXCEPINFO
*pExepInfo
,
4031 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4033 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
);
4038 /*** IMediaEvent methods ***/
4039 static HRESULT WINAPI
MediaEvent_GetEventHandle(IMediaEventEx
*iface
,
4041 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4043 TRACE("(%p/%p)->(%p)\n", This
, iface
, hEvent
);
4045 *hEvent
= (OAEVENT
)This
->evqueue
.msg_event
;
4050 static HRESULT WINAPI
MediaEvent_GetEvent(IMediaEventEx
*iface
,
4055 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4058 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This
, iface
, lEventCode
, lParam1
, lParam2
, msTimeout
);
4060 if (EventsQueue_GetEvent(&This
->evqueue
, &evt
, msTimeout
))
4062 *lEventCode
= evt
.lEventCode
;
4063 *lParam1
= evt
.lParam1
;
4064 *lParam2
= evt
.lParam2
;
4072 static HRESULT WINAPI
MediaEvent_WaitForCompletion(IMediaEventEx
*iface
,
4075 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4077 TRACE("(%p/%p)->(%ld, %p)\n", This
, iface
, msTimeout
, pEvCode
);
4079 if (WaitForSingleObject(This
->hEventCompletion
, msTimeout
) == WAIT_OBJECT_0
)
4081 *pEvCode
= This
->CompletionStatus
;
4089 static HRESULT WINAPI
MediaEvent_CancelDefaultHandling(IMediaEventEx
*iface
,
4091 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4093 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4095 if (lEvCode
== EC_COMPLETE
)
4096 This
->HandleEcComplete
= FALSE
;
4097 else if (lEvCode
== EC_REPAINT
)
4098 This
->HandleEcRepaint
= FALSE
;
4105 static HRESULT WINAPI
MediaEvent_RestoreDefaultHandling(IMediaEventEx
*iface
,
4107 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4109 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4111 if (lEvCode
== EC_COMPLETE
)
4112 This
->HandleEcComplete
= TRUE
;
4113 else if (lEvCode
== EC_REPAINT
)
4114 This
->HandleEcRepaint
= TRUE
;
4121 static HRESULT WINAPI
MediaEvent_FreeEventParams(IMediaEventEx
*iface
,
4125 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4127 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This
, iface
, lEvCode
, lParam1
, lParam2
);
4132 /*** IMediaEventEx methods ***/
4133 static HRESULT WINAPI
MediaEvent_SetNotifyWindow(IMediaEventEx
*iface
,
4136 LONG_PTR lInstanceData
) {
4137 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4139 TRACE("(%p/%p)->(%08x, %ld, %08lx)\n", This
, iface
, (DWORD
) hwnd
, lMsg
, lInstanceData
);
4141 This
->notif
.hWnd
= (HWND
)hwnd
;
4142 This
->notif
.msg
= lMsg
;
4143 This
->notif
.instance
= (long) lInstanceData
;
4148 static HRESULT WINAPI
MediaEvent_SetNotifyFlags(IMediaEventEx
*iface
,
4149 long lNoNotifyFlags
) {
4150 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4152 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lNoNotifyFlags
);
4154 if ((lNoNotifyFlags
!= 0) && (lNoNotifyFlags
!= 1))
4155 return E_INVALIDARG
;
4157 This
->notif
.disabled
= lNoNotifyFlags
;
4162 static HRESULT WINAPI
MediaEvent_GetNotifyFlags(IMediaEventEx
*iface
,
4163 long *lplNoNotifyFlags
) {
4164 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4166 TRACE("(%p/%p)->(%p)\n", This
, iface
, lplNoNotifyFlags
);
4168 if (!lplNoNotifyFlags
)
4171 *lplNoNotifyFlags
= This
->notif
.disabled
;
4177 static const IMediaEventExVtbl IMediaEventEx_VTable
=
4179 MediaEvent_QueryInterface
,
4182 MediaEvent_GetTypeInfoCount
,
4183 MediaEvent_GetTypeInfo
,
4184 MediaEvent_GetIDsOfNames
,
4186 MediaEvent_GetEventHandle
,
4187 MediaEvent_GetEvent
,
4188 MediaEvent_WaitForCompletion
,
4189 MediaEvent_CancelDefaultHandling
,
4190 MediaEvent_RestoreDefaultHandling
,
4191 MediaEvent_FreeEventParams
,
4192 MediaEvent_SetNotifyWindow
,
4193 MediaEvent_SetNotifyFlags
,
4194 MediaEvent_GetNotifyFlags
4198 static HRESULT WINAPI
MediaFilter_QueryInterface(IMediaFilter
*iface
, REFIID riid
, LPVOID
*ppv
)
4200 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4202 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4205 static ULONG WINAPI
MediaFilter_AddRef(IMediaFilter
*iface
)
4207 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4209 return Filtergraph_AddRef(This
);
4212 static ULONG WINAPI
MediaFilter_Release(IMediaFilter
*iface
)
4214 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4216 return Filtergraph_Release(This
);
4219 static HRESULT WINAPI
MediaFilter_GetClassID(IMediaFilter
*iface
, CLSID
* pClassID
)
4221 FIXME("(%p): stub\n", pClassID
);
4226 static HRESULT WINAPI
MediaFilter_Stop(IMediaFilter
*iface
)
4228 FIXME("(): stub\n");
4233 static HRESULT WINAPI
MediaFilter_Pause(IMediaFilter
*iface
)
4235 FIXME("(): stub\n");
4240 static HRESULT WINAPI
MediaFilter_Run(IMediaFilter
*iface
, REFERENCE_TIME tStart
)
4242 FIXME("(0x%s): stub\n", wine_dbgstr_longlong(tStart
));
4247 static HRESULT WINAPI
MediaFilter_GetState(IMediaFilter
*iface
, DWORD dwMsTimeout
, FILTER_STATE
* pState
)
4249 FIXME("(%d, %p): stub\n", dwMsTimeout
, pState
);
4254 static HRESULT WINAPI
MediaFilter_SetSyncSource(IMediaFilter
*iface
, IReferenceClock
*pClock
)
4256 FIXME("(%p): stub\n", pClock
);
4261 static HRESULT WINAPI
MediaFilter_GetSyncSource(IMediaFilter
*iface
, IReferenceClock
**ppClock
)
4263 FIXME("(%p): stub\n", ppClock
);
4268 static const IMediaFilterVtbl IMediaFilter_VTable
=
4270 MediaFilter_QueryInterface
,
4272 MediaFilter_Release
,
4273 MediaFilter_GetClassID
,
4277 MediaFilter_GetState
,
4278 MediaFilter_SetSyncSource
,
4279 MediaFilter_GetSyncSource
4282 static HRESULT WINAPI
MediaEventSink_QueryInterface(IMediaEventSink
*iface
, REFIID riid
, LPVOID
*ppv
)
4284 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4286 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4289 static ULONG WINAPI
MediaEventSink_AddRef(IMediaEventSink
*iface
)
4291 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4293 return Filtergraph_AddRef(This
);
4296 static ULONG WINAPI
MediaEventSink_Release(IMediaEventSink
*iface
)
4298 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4300 return Filtergraph_Release(This
);
4303 static HRESULT WINAPI
MediaEventSink_Notify(IMediaEventSink
*iface
, long EventCode
, LONG_PTR EventParam1
, LONG_PTR EventParam2
)
4305 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4308 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This
, iface
, EventCode
, EventParam1
, EventParam2
);
4310 /* We need thread safety here, let's use the events queue's one */
4311 EnterCriticalSection(&This
->evqueue
.msg_crst
);
4313 if ((EventCode
== EC_COMPLETE
) && This
->HandleEcComplete
)
4315 TRACE("Process EC_COMPLETE notification\n");
4316 if (++This
->EcCompleteCount
== This
->nRenderers
)
4318 evt
.lEventCode
= EC_COMPLETE
;
4321 TRACE("Send EC_COMPLETE to app\n");
4322 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4323 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4325 TRACE("Send Window message\n");
4326 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4328 This
->CompletionStatus
= EC_COMPLETE
;
4329 SetEvent(This
->hEventCompletion
);
4332 else if ((EventCode
== EC_REPAINT
) && This
->HandleEcRepaint
)
4334 /* FIXME: Not handled yet */
4338 evt
.lEventCode
= EventCode
;
4339 evt
.lParam1
= EventParam1
;
4340 evt
.lParam2
= EventParam2
;
4341 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4342 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4343 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4346 LeaveCriticalSection(&This
->evqueue
.msg_crst
);
4350 static const IMediaEventSinkVtbl IMediaEventSink_VTable
=
4352 MediaEventSink_QueryInterface
,
4353 MediaEventSink_AddRef
,
4354 MediaEventSink_Release
,
4355 MediaEventSink_Notify
4358 static HRESULT WINAPI
GraphConfig_QueryInterface(IGraphConfig
*iface
, REFIID riid
, LPVOID
*ppv
)
4360 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4362 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4365 static ULONG WINAPI
GraphConfig_AddRef(IGraphConfig
*iface
)
4367 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4369 return Filtergraph_AddRef(This
);
4372 static ULONG WINAPI
GraphConfig_Release(IGraphConfig
*iface
)
4374 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4376 return Filtergraph_Release(This
);
4379 static HRESULT WINAPI
GraphConfig_Reconnect(IGraphConfig
*iface
,
4382 const AM_MEDIA_TYPE
* pmtFirstConnection
,
4383 IBaseFilter
* pUsingFilter
,
4387 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4389 FIXME("(%p)->(%p, %p, %p, %p, %p, %x): stub!\n", This
, pOutputPin
, pInputPin
, pmtFirstConnection
, pUsingFilter
, hAbortEvent
, dwFlags
);
4394 static HRESULT WINAPI
GraphConfig_Reconfigure(IGraphConfig
*iface
,
4395 IGraphConfigCallback
* pCallback
,
4400 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4402 FIXME("(%p)->(%p, %p, %x, %p): stub!\n", This
, pCallback
, pvContext
, dwFlags
, hAbortEvent
);
4407 static HRESULT WINAPI
GraphConfig_AddFilterToCache(IGraphConfig
*iface
,
4408 IBaseFilter
* pFilter
)
4410 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4412 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4417 static HRESULT WINAPI
GraphConfig_EnumCacheFilter(IGraphConfig
*iface
,
4418 IEnumFilters
** pEnum
)
4420 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4422 FIXME("(%p)->(%p): stub!\n", This
, pEnum
);
4427 static HRESULT WINAPI
GraphConfig_RemoveFilterFromCache(IGraphConfig
*iface
,
4428 IBaseFilter
* pFilter
)
4430 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4432 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4437 static HRESULT WINAPI
GraphConfig_GetStartTime(IGraphConfig
*iface
,
4438 REFERENCE_TIME
* prtStart
)
4440 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4442 FIXME("(%p)->(%p): stub!\n", This
, prtStart
);
4447 static HRESULT WINAPI
GraphConfig_PushThroughData(IGraphConfig
*iface
,
4449 IPinConnection
* pConnection
,
4452 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4454 FIXME("(%p)->(%p, %p, %p): stub!\n", This
, pOutputPin
, pConnection
, hEventAbort
);
4459 static HRESULT WINAPI
GraphConfig_SetFilterFlags(IGraphConfig
*iface
,
4460 IBaseFilter
* pFilter
,
4463 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4465 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4470 static HRESULT WINAPI
GraphConfig_GetFilterFlags(IGraphConfig
*iface
,
4471 IBaseFilter
* pFilter
,
4474 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4476 FIXME("(%p)->(%p, %p): stub!\n", This
, pFilter
, dwFlags
);
4481 static HRESULT WINAPI
GraphConfig_RemoveFilterEx(IGraphConfig
*iface
,
4482 IBaseFilter
* pFilter
,
4485 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4487 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4492 static const IGraphConfigVtbl IGraphConfig_VTable
=
4494 GraphConfig_QueryInterface
,
4496 GraphConfig_Release
,
4497 GraphConfig_Reconnect
,
4498 GraphConfig_Reconfigure
,
4499 GraphConfig_AddFilterToCache
,
4500 GraphConfig_EnumCacheFilter
,
4501 GraphConfig_RemoveFilterFromCache
,
4502 GraphConfig_GetStartTime
,
4503 GraphConfig_PushThroughData
,
4504 GraphConfig_SetFilterFlags
,
4505 GraphConfig_GetFilterFlags
,
4506 GraphConfig_RemoveFilterEx
4509 /* This is the only function that actually creates a FilterGraph class... */
4510 HRESULT
FilterGraph_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4512 IFilterGraphImpl
*fimpl
;
4515 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
4518 return CLASS_E_NOAGGREGATION
;
4520 fimpl
= CoTaskMemAlloc(sizeof(*fimpl
));
4521 fimpl
->IGraphBuilder_vtbl
= &IGraphBuilder_VTable
;
4522 fimpl
->IMediaControl_vtbl
= &IMediaControl_VTable
;
4523 fimpl
->IMediaSeeking_vtbl
= &IMediaSeeking_VTable
;
4524 fimpl
->IBasicAudio_vtbl
= &IBasicAudio_VTable
;
4525 fimpl
->IBasicVideo_vtbl
= &IBasicVideo_VTable
;
4526 fimpl
->IVideoWindow_vtbl
= &IVideoWindow_VTable
;
4527 fimpl
->IMediaEventEx_vtbl
= &IMediaEventEx_VTable
;
4528 fimpl
->IMediaFilter_vtbl
= &IMediaFilter_VTable
;
4529 fimpl
->IMediaEventSink_vtbl
= &IMediaEventSink_VTable
;
4530 fimpl
->IGraphConfig_vtbl
= &IGraphConfig_VTable
;
4531 fimpl
->IMediaPosition_vtbl
= &IMediaPosition_VTable
;
4533 fimpl
->ppFiltersInGraph
= NULL
;
4534 fimpl
->pFilterNames
= NULL
;
4535 fimpl
->nFilters
= 0;
4536 fimpl
->filterCapacity
= 0;
4537 fimpl
->nameIndex
= 1;
4538 fimpl
->hEventCompletion
= CreateEventW(0, TRUE
, FALSE
, 0);
4539 fimpl
->HandleEcComplete
= TRUE
;
4540 fimpl
->HandleEcRepaint
= TRUE
;
4541 fimpl
->notif
.hWnd
= 0;
4542 fimpl
->notif
.disabled
= FALSE
;
4543 fimpl
->nRenderers
= 0;
4544 fimpl
->EcCompleteCount
= 0;
4545 fimpl
->state
= State_Stopped
;
4546 EventsQueue_Init(&fimpl
->evqueue
);
4547 InitializeCriticalSection(&fimpl
->cs
);
4548 fimpl
->cs
.DebugInfo
->Spare
[0] = (DWORD_PTR
)(__FILE__
": IFilterGraphImpl.cs");
4549 fimpl
->nItfCacheEntries
= 0;
4551 hr
= CoCreateInstance(&CLSID_FilterMapper2
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IFilterMapper2
, (LPVOID
*)&fimpl
->pFilterMapper2
);
4553 ERR("Unable to create filter mapper (%x)\n", hr
);
4561 HRESULT
FilterGraphNoThread_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4563 FIXME("CLSID_FilterGraphNoThread partially implemented - Forwarding to CLSID_FilterGraph\n");
4564 return FilterGraph_create(pUnkOuter
, ppObj
);