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
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
,omr
->ring_buffer_size
* sizeof(Event
));
77 InitializeCriticalSection(&omr
->msg_crst
);
81 static int EventsQueue_Destroy(EventsQueue
* omr
)
83 CloseHandle(omr
->msg_event
);
84 HeapFree(GetProcessHeap(),0,omr
->messages
);
85 DeleteCriticalSection(&omr
->msg_crst
);
89 static int EventsQueue_PutEvent(EventsQueue
* omr
, Event
* evt
)
91 EnterCriticalSection(&omr
->msg_crst
);
92 if ((omr
->msg_toget
== ((omr
->msg_tosave
+ 1) % omr
->ring_buffer_size
)))
94 int old_ring_buffer_size
= omr
->ring_buffer_size
;
95 omr
->ring_buffer_size
+= EVENTS_RING_BUFFER_INCREMENT
;
96 TRACE("omr->ring_buffer_size=%d\n",omr
->ring_buffer_size
);
97 omr
->messages
= HeapReAlloc(GetProcessHeap(),0,omr
->messages
, omr
->ring_buffer_size
* sizeof(Event
));
98 /* Now we need to rearrange the ring buffer so that the new
99 buffers just allocated are in between omr->msg_tosave and
102 if (omr
->msg_tosave
< omr
->msg_toget
)
104 memmove(&(omr
->messages
[omr
->msg_toget
+ EVENTS_RING_BUFFER_INCREMENT
]),
105 &(omr
->messages
[omr
->msg_toget
]),
106 sizeof(Event
)*(old_ring_buffer_size
- omr
->msg_toget
)
108 omr
->msg_toget
+= EVENTS_RING_BUFFER_INCREMENT
;
111 omr
->messages
[omr
->msg_tosave
] = *evt
;
112 SetEvent(omr
->msg_event
);
113 omr
->msg_tosave
= (omr
->msg_tosave
+ 1) % omr
->ring_buffer_size
;
114 LeaveCriticalSection(&omr
->msg_crst
);
118 static int EventsQueue_GetEvent(EventsQueue
* omr
, Event
* evt
, long msTimeOut
)
120 if (WaitForSingleObject(omr
->msg_event
, msTimeOut
) != WAIT_OBJECT_0
)
123 EnterCriticalSection(&omr
->msg_crst
);
125 if (omr
->msg_toget
== omr
->msg_tosave
) /* buffer empty ? */
127 LeaveCriticalSection(&omr
->msg_crst
);
131 *evt
= omr
->messages
[omr
->msg_toget
];
132 omr
->msg_toget
= (omr
->msg_toget
+ 1) % omr
->ring_buffer_size
;
134 /* Mark the buffer as empty if needed */
135 if (omr
->msg_toget
== omr
->msg_tosave
) /* buffer empty ? */
136 ResetEvent(omr
->msg_event
);
138 LeaveCriticalSection(&omr
->msg_crst
);
142 #define MAX_ITF_CACHE_ENTRIES 3
143 typedef struct _ITF_CACHE_ENTRY
{
149 typedef struct _IFilterGraphImpl
{
150 const IGraphBuilderVtbl
*IGraphBuilder_vtbl
;
151 const IMediaControlVtbl
*IMediaControl_vtbl
;
152 const IMediaSeekingVtbl
*IMediaSeeking_vtbl
;
153 const IBasicAudioVtbl
*IBasicAudio_vtbl
;
154 const IBasicVideoVtbl
*IBasicVideo_vtbl
;
155 const IVideoWindowVtbl
*IVideoWindow_vtbl
;
156 const IMediaEventExVtbl
*IMediaEventEx_vtbl
;
157 const IMediaFilterVtbl
*IMediaFilter_vtbl
;
158 const IMediaEventSinkVtbl
*IMediaEventSink_vtbl
;
159 const IGraphConfigVtbl
*IGraphConfig_vtbl
;
160 const IMediaPositionVtbl
*IMediaPosition_vtbl
;
161 /* IAMGraphStreams */
169 /* IRegisterServiceProvider */
170 /* IResourceMananger */
171 /* IServiceProvider */
172 /* IVideoFrameStep */
175 IFilterMapper2
* pFilterMapper2
;
176 IBaseFilter
** ppFiltersInGraph
;
177 LPWSTR
* pFilterNames
;
182 HANDLE hEventCompletion
;
183 int CompletionStatus
;
187 int HandleEcComplete
;
191 ITF_CACHE_ENTRY ItfCacheEntries
[MAX_ITF_CACHE_ENTRIES
];
192 int nItfCacheEntries
;
196 static HRESULT
Filtergraph_QueryInterface(IFilterGraphImpl
*This
,
199 TRACE("(%p)->(%s (%p), %p)\n", This
, debugstr_guid(riid
), riid
, ppvObj
);
201 if (IsEqualGUID(&IID_IUnknown
, riid
) ||
202 IsEqualGUID(&IID_IFilterGraph
, riid
) ||
203 IsEqualGUID(&IID_IGraphBuilder
, riid
)) {
204 *ppvObj
= &(This
->IGraphBuilder_vtbl
);
205 TRACE(" returning IGraphBuilder interface (%p)\n", *ppvObj
);
206 } else if (IsEqualGUID(&IID_IMediaControl
, riid
)) {
207 *ppvObj
= &(This
->IMediaControl_vtbl
);
208 TRACE(" returning IMediaControl interface (%p)\n", *ppvObj
);
209 } else if (IsEqualGUID(&IID_IMediaSeeking
, riid
)) {
210 *ppvObj
= &(This
->IMediaSeeking_vtbl
);
211 TRACE(" returning IMediaSeeking interface (%p)\n", *ppvObj
);
212 } else if (IsEqualGUID(&IID_IBasicAudio
, riid
)) {
213 *ppvObj
= &(This
->IBasicAudio_vtbl
);
214 TRACE(" returning IBasicAudio interface (%p)\n", *ppvObj
);
215 } else if (IsEqualGUID(&IID_IBasicVideo
, riid
)) {
216 *ppvObj
= &(This
->IBasicVideo_vtbl
);
217 TRACE(" returning IBasicVideo interface (%p)\n", *ppvObj
);
218 } else if (IsEqualGUID(&IID_IVideoWindow
, riid
)) {
219 *ppvObj
= &(This
->IVideoWindow_vtbl
);
220 TRACE(" returning IVideoWindow interface (%p)\n", *ppvObj
);
221 } else if (IsEqualGUID(&IID_IMediaEvent
, riid
) ||
222 IsEqualGUID(&IID_IMediaEventEx
, riid
)) {
223 *ppvObj
= &(This
->IMediaEventEx_vtbl
);
224 TRACE(" returning IMediaEvent(Ex) interface (%p)\n", *ppvObj
);
225 } else if (IsEqualGUID(&IID_IMediaFilter
, riid
) ||
226 IsEqualGUID(&IID_IPersist
, riid
)) {
227 *ppvObj
= &(This
->IMediaFilter_vtbl
);
228 TRACE(" returning IMediaFilter interface (%p)\n", *ppvObj
);
229 } else if (IsEqualGUID(&IID_IMediaEventSink
, riid
)) {
230 *ppvObj
= &(This
->IMediaEventSink_vtbl
);
231 TRACE(" returning IMediaEventSink interface (%p)\n", *ppvObj
);
232 } else if (IsEqualGUID(&IID_IGraphConfig
, riid
)) {
233 *ppvObj
= &(This
->IGraphConfig_vtbl
);
234 TRACE(" returning IGraphConfig interface (%p)\n", *ppvObj
);
235 } else if (IsEqualGUID(&IID_IMediaPosition
, riid
)) {
236 *ppvObj
= &(This
->IMediaPosition_vtbl
);
237 TRACE(" returning IMediaPosition interface (%p)\n", *ppvObj
);
240 FIXME("unknown interface %s\n", debugstr_guid(riid
));
241 return E_NOINTERFACE
;
244 InterlockedIncrement(&This
->ref
);
248 static ULONG
Filtergraph_AddRef(IFilterGraphImpl
*This
) {
249 ULONG ref
= InterlockedIncrement(&This
->ref
);
251 TRACE("(%p)->(): new ref = %d\n", This
, ref
);
256 static ULONG
Filtergraph_Release(IFilterGraphImpl
*This
) {
257 ULONG ref
= InterlockedDecrement(&This
->ref
);
259 TRACE("(%p)->(): new ref = %d\n", This
, ref
);
263 for (i
= 0; i
< This
->nFilters
; i
++)
264 IBaseFilter_Release(This
->ppFiltersInGraph
[i
]);
265 for (i
= 0; i
< This
->nItfCacheEntries
; i
++)
266 IUnknown_Release(This
->ItfCacheEntries
[i
].iface
);
267 IFilterMapper2_Release(This
->pFilterMapper2
);
268 CloseHandle(This
->hEventCompletion
);
269 EventsQueue_Destroy(&This
->evqueue
);
270 DeleteCriticalSection(&This
->cs
);
271 HeapFree(GetProcessHeap(), 0, This
->ppFiltersInGraph
);
272 HeapFree(GetProcessHeap(), 0, This
->pFilterNames
);
273 HeapFree(GetProcessHeap(), 0, This
);
279 /*** IUnknown methods ***/
280 static HRESULT WINAPI
GraphBuilder_QueryInterface(IGraphBuilder
*iface
,
283 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
285 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
286 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
289 static ULONG WINAPI
GraphBuilder_AddRef(IGraphBuilder
*iface
) {
290 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
292 TRACE("(%p/%p)->() calling FilterGraph AddRef\n", This
, iface
);
294 return Filtergraph_AddRef(This
);
297 static ULONG WINAPI
GraphBuilder_Release(IGraphBuilder
*iface
) {
298 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
300 TRACE("(%p/%p)->() calling FilterGraph Release\n", This
, iface
);
302 return Filtergraph_Release(This
);
305 /*** IFilterGraph methods ***/
306 static HRESULT WINAPI
GraphBuilder_AddFilter(IGraphBuilder
*iface
,
307 IBaseFilter
*pFilter
,
309 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
312 WCHAR
* wszFilterName
= NULL
;
313 int duplicate_name
= FALSE
;
315 TRACE("(%p/%p)->(%p, %s (%p))\n", This
, iface
, pFilter
, debugstr_w(pName
), pName
);
317 wszFilterName
= (WCHAR
*) CoTaskMemAlloc( (pName
? strlenW(pName
) + 6 : 5) * sizeof(WCHAR
) );
321 /* Check if name already exists */
322 for(i
= 0; i
< This
->nFilters
; i
++)
323 if (!strcmpW(This
->pFilterNames
[i
], pName
))
325 duplicate_name
= TRUE
;
330 /* If no name given or name already existing, generate one */
331 if (!pName
|| duplicate_name
)
333 static const WCHAR wszFmt1
[] = {'%','s',' ','%','0','4','d',0};
334 static const WCHAR wszFmt2
[] = {'%','0','4','d',0};
336 for (j
= 0; j
< 10000 ; j
++)
340 sprintfW(wszFilterName
, wszFmt1
, pName
, This
->nameIndex
);
342 sprintfW(wszFilterName
, wszFmt2
, This
->nameIndex
);
343 TRACE("Generated name %s\n", debugstr_w(wszFilterName
));
345 /* Check if the generated name already exists */
346 for(i
= 0; i
< This
->nFilters
; i
++)
347 if (!strcmpW(This
->pFilterNames
[i
], wszFilterName
))
350 /* Compute next index and exit if generated name is suitable */
351 if (This
->nameIndex
++ == 10000)
353 if (i
== This
->nFilters
)
356 /* Unable to find a suitable name */
359 CoTaskMemFree(wszFilterName
);
360 return VFW_E_DUPLICATE_NAME
;
364 memcpy(wszFilterName
, pName
, (strlenW(pName
) + 1) * sizeof(WCHAR
));
366 if (This
->nFilters
+ 1 > This
->filterCapacity
)
368 int newCapacity
= This
->filterCapacity
? 2 * This
->filterCapacity
: 1;
369 IBaseFilter
** ppNewFilters
= CoTaskMemAlloc(newCapacity
* sizeof(IBaseFilter
*));
370 LPWSTR
* pNewNames
= CoTaskMemAlloc(newCapacity
* sizeof(LPWSTR
));
371 memcpy(ppNewFilters
, This
->ppFiltersInGraph
, This
->nFilters
* sizeof(IBaseFilter
*));
372 memcpy(pNewNames
, This
->pFilterNames
, This
->nFilters
* sizeof(LPWSTR
));
373 if (!This
->filterCapacity
)
375 CoTaskMemFree(This
->ppFiltersInGraph
);
376 CoTaskMemFree(This
->pFilterNames
);
378 This
->ppFiltersInGraph
= ppNewFilters
;
379 This
->pFilterNames
= pNewNames
;
380 This
->filterCapacity
= newCapacity
;
383 hr
= IBaseFilter_JoinFilterGraph(pFilter
, (IFilterGraph
*)This
, wszFilterName
);
387 IBaseFilter_AddRef(pFilter
);
388 This
->ppFiltersInGraph
[This
->nFilters
] = pFilter
;
389 This
->pFilterNames
[This
->nFilters
] = wszFilterName
;
393 CoTaskMemFree(wszFilterName
);
395 if (SUCCEEDED(hr
) && duplicate_name
)
396 return VFW_S_DUPLICATE_NAME
;
401 static HRESULT WINAPI
GraphBuilder_RemoveFilter(IGraphBuilder
*iface
,
402 IBaseFilter
*pFilter
) {
403 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
407 TRACE("(%p/%p)->(%p)\n", This
, iface
, pFilter
);
409 /* FIXME: check graph is stopped */
411 for (i
= 0; i
< This
->nFilters
; i
++)
413 if (This
->ppFiltersInGraph
[i
] == pFilter
)
415 /* FIXME: disconnect pins */
416 hr
= IBaseFilter_JoinFilterGraph(pFilter
, NULL
, This
->pFilterNames
[i
]);
419 IPin_Release(pFilter
);
420 CoTaskMemFree(This
->pFilterNames
[i
]);
421 memmove(This
->ppFiltersInGraph
+i
, This
->ppFiltersInGraph
+i
+1, sizeof(IBaseFilter
*)*(This
->nFilters
- 1 - i
));
422 memmove(This
->pFilterNames
+i
, This
->pFilterNames
+i
+1, sizeof(LPWSTR
)*(This
->nFilters
- 1 - i
));
424 /* Invalidate interfaces in the cache */
425 for (i
= 0; i
< This
->nItfCacheEntries
; i
++)
426 if (pFilter
== This
->ItfCacheEntries
[i
].filter
)
428 IUnknown_Release(This
->ItfCacheEntries
[i
].iface
);
429 This
->ItfCacheEntries
[i
].iface
= NULL
;
430 This
->ItfCacheEntries
[i
].filter
= NULL
;
438 return hr
; /* FIXME: check this error code */
441 static HRESULT WINAPI
GraphBuilder_EnumFilters(IGraphBuilder
*iface
,
442 IEnumFilters
**ppEnum
) {
443 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
445 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppEnum
);
447 return IEnumFiltersImpl_Construct(This
->ppFiltersInGraph
, This
->nFilters
, ppEnum
);
450 static HRESULT WINAPI
GraphBuilder_FindFilterByName(IGraphBuilder
*iface
,
452 IBaseFilter
**ppFilter
) {
453 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
456 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_w(pName
), pName
, ppFilter
);
460 for (i
= 0; i
< This
->nFilters
; i
++)
462 if (!strcmpW(pName
, This
->pFilterNames
[i
]))
464 *ppFilter
= This
->ppFiltersInGraph
[i
];
465 IBaseFilter_AddRef(*ppFilter
);
470 return E_FAIL
; /* FIXME: check this error code */
473 /* NOTE: despite the implication, it doesn't matter which
474 * way round you put in the input and output pins */
475 static HRESULT WINAPI
GraphBuilder_ConnectDirect(IGraphBuilder
*iface
,
478 const AM_MEDIA_TYPE
*pmt
) {
482 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
484 TRACE("(%p/%p)->(%p, %p, %p)\n", This
, iface
, ppinIn
, ppinOut
, pmt
);
486 /* FIXME: check pins are in graph */
488 if (TRACE_ON(quartz
))
492 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
496 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
497 IBaseFilter_Release(PinInfo
.pFilter
);
499 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
503 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
504 IBaseFilter_Release(PinInfo
.pFilter
);
507 hr
= IPin_QueryDirection(ppinIn
, &dir
);
510 if (dir
== PINDIR_INPUT
)
511 hr
= IPin_Connect(ppinOut
, ppinIn
, pmt
);
513 hr
= IPin_Connect(ppinIn
, ppinOut
, pmt
);
519 static HRESULT WINAPI
GraphBuilder_Reconnect(IGraphBuilder
*iface
,
521 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
522 IPin
*pConnectedTo
= NULL
;
524 PIN_DIRECTION pindir
;
526 IPin_QueryDirection(ppin
, &pindir
);
527 hr
= IPin_ConnectedTo(ppin
, &pConnectedTo
);
529 TRACE("Querying connected to failed: %x\n", hr
);
532 IPin_Disconnect(ppin
);
533 IPin_Disconnect(pConnectedTo
);
534 if (pindir
== PINDIR_INPUT
)
535 hr
= IPin_Connect(pConnectedTo
, ppin
, NULL
);
537 hr
= IPin_Connect(ppin
, pConnectedTo
, NULL
);
538 IPin_Release(pConnectedTo
);
540 ERR("Reconnecting pins failed, pins are not connected now..\n");
541 TRACE("(%p->%p) -- %p %p -> %x\n", iface
, This
, ppin
, pConnectedTo
, hr
);
545 static HRESULT WINAPI
GraphBuilder_Disconnect(IGraphBuilder
*iface
,
547 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
549 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppin
);
551 return IPin_Disconnect(ppin
);
554 static HRESULT WINAPI
GraphBuilder_SetDefaultSyncSource(IGraphBuilder
*iface
) {
555 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
557 TRACE("(%p/%p)->(): stub !!!\n", iface
, This
);
562 static HRESULT
GetFilterInfo(IMoniker
* pMoniker
, GUID
* pclsid
, VARIANT
* pvar
)
564 static const WCHAR wszClsidName
[] = {'C','L','S','I','D',0};
565 static const WCHAR wszFriendlyName
[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
566 IPropertyBag
* pPropBagCat
= NULL
;
570 V_VT(pvar
) = VT_BSTR
;
572 hr
= IMoniker_BindToStorage(pMoniker
, NULL
, NULL
, &IID_IPropertyBag
, (LPVOID
*)&pPropBagCat
);
575 hr
= IPropertyBag_Read(pPropBagCat
, wszClsidName
, pvar
, NULL
);
578 hr
= CLSIDFromString(V_UNION(pvar
, bstrVal
), pclsid
);
581 hr
= IPropertyBag_Read(pPropBagCat
, wszFriendlyName
, pvar
, NULL
);
584 TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid
), debugstr_w(V_UNION(pvar
, bstrVal
)));
587 IPropertyBag_Release(pPropBagCat
);
592 static HRESULT
GetInternalConnections(IBaseFilter
* pfilter
, IPin
* pinputpin
, IPin
*** pppins
, ULONG
* pnb
)
597 TRACE("(%p, %p, %p, %p)\n", pfilter
, pinputpin
, pppins
, pnb
);
598 hr
= IPin_QueryInternalConnections(pinputpin
, NULL
, &nb
);
601 } else if (hr
== S_FALSE
) {
602 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*nb
);
603 hr
= IPin_QueryInternalConnections(pinputpin
, *pppins
, &nb
);
605 ERR("Error (%x)\n", hr
);
607 } else if (hr
== E_NOTIMPL
) {
608 /* Input connected to all outputs */
609 IEnumPins
* penumpins
;
612 TRACE("E_NOTIMPL\n");
613 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
615 ERR("filter Enumpins failed (%x)\n", hr
);
619 /* Count output pins */
620 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
621 PIN_DIRECTION pindir
;
622 IPin_QueryDirection(ppin
, &pindir
);
623 if (pindir
== PINDIR_OUTPUT
)
627 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*i
);
628 /* Retrieve output pins */
629 IEnumPins_Reset(penumpins
);
631 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
632 PIN_DIRECTION pindir
;
633 IPin_QueryDirection(ppin
, &pindir
);
634 if (pindir
== PINDIR_OUTPUT
)
635 (*pppins
)[i
++] = ppin
;
641 ERR("Next failed (%x)\n", hr
);
644 IEnumPins_Release(penumpins
);
645 } else if (FAILED(hr
)) {
646 ERR("Cannot get internal connection (%x)\n", hr
);
654 /*** IGraphBuilder methods ***/
655 static HRESULT WINAPI
GraphBuilder_Connect(IGraphBuilder
*iface
,
658 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
661 IEnumMediaTypes
* penummt
;
663 IEnumPins
* penumpins
;
664 IEnumMoniker
* pEnumMoniker
;
672 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, ppinOut
, ppinIn
);
674 if (TRACE_ON(quartz
))
676 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
680 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
681 IBaseFilter_Release(PinInfo
.pFilter
);
683 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
687 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
688 IBaseFilter_Release(PinInfo
.pFilter
);
691 /* Try direct connection first */
692 hr
= IPin_Connect(ppinOut
, ppinIn
, NULL
);
696 TRACE("Direct connection failed, trying to insert other filters\n");
698 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
702 hr
= IBaseFilter_GetClassID(PinInfo
.pFilter
, &FilterCLSID
);
706 IBaseFilter_Release(PinInfo
.pFilter
);
708 /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream
709 * filter to the minor mediatype of input pin of the renderer */
710 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
712 ERR("EnumMediaTypes (%x)\n", hr
);
716 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
718 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
723 ERR("No media type found!\n");
726 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
727 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
729 /* Try to find a suitable filter that can connect to the pin to render */
730 tab
[0] = mt
->majortype
;
731 tab
[1] = mt
->subtype
;
732 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
734 ERR("Unable to enum filters (%x)\n", hr
);
738 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
743 IPin
* ppinfilter
= NULL
;
744 IBaseFilter
* pfilter
= NULL
;
746 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
747 IMoniker_Release(pMoniker
);
749 ERR("Unable to retrieve filter info (%x)\n", hr
);
753 if (IsEqualGUID(&clsid
, &FilterCLSID
)) {
754 /* Skip filter (same as the one the output pin belongs to) */
758 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
760 ERR("Unable to create filter (%x), trying next one\n", hr
);
764 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, NULL
);
766 ERR("Unable to add filter (%x)\n", hr
);
767 IBaseFilter_Release(pfilter
);
772 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
774 ERR("Enumpins (%x)\n", hr
);
778 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
779 IEnumPins_Release(penumpins
);
782 ERR("Next (%x)\n", hr
);
790 hr
= IPin_Connect(ppinOut
, ppinfilter
, NULL
);
792 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
795 TRACE("Successfully connected to filter, follow chain...\n");
797 /* Render all output pins of the filter by calling IGraphBuilder_Render on each of them */
798 hr
= GetInternalConnections(pfilter
, ppinfilter
, &ppins
, &nb
);
803 IPin_Disconnect(ppinOut
);
806 TRACE("pins to consider: %d\n", nb
);
807 for(i
= 0; i
< nb
; i
++) {
808 TRACE("Processing pin %d\n", i
);
809 hr
= IGraphBuilder_Connect(iface
, ppins
[i
], ppinIn
);
811 TRACE("Cannot render pin %p (%x)\n", ppinfilter
, hr
);
813 IPin_Release(ppins
[i
]);
814 if (SUCCEEDED(hr
)) break;
816 while (++i
< nb
) IPin_Release(ppins
[i
]);
817 CoTaskMemFree(ppins
);
818 IPin_Release(ppinfilter
);
823 if (ppinfilter
) IPin_Release(ppinfilter
);
825 IGraphBuilder_RemoveFilter(iface
, pfilter
);
826 IBaseFilter_Release(pfilter
);
830 IEnumMediaTypes_Release(penummt
);
836 static HRESULT WINAPI
GraphBuilder_Render(IGraphBuilder
*iface
,
838 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
839 IEnumMediaTypes
* penummt
;
844 IEnumMoniker
* pEnumMoniker
;
849 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppinOut
);
851 if (TRACE_ON(quartz
))
855 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
859 TRACE("Filter owning pin => %p\n", PinInfo
.pFilter
);
860 IBaseFilter_Release(PinInfo
.pFilter
);
863 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
865 ERR("EnumMediaTypes (%x)\n", hr
);
871 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
873 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
878 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
879 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
881 /* Try to find a suitable renderer with the same media type */
882 tab
[0] = mt
->majortype
;
884 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, TRUE
, FALSE
, 0, NULL
, NULL
, NULL
);
886 ERR("Unable to enum filters (%x)\n", hr
);
890 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
895 IBaseFilter
* pfilter
= NULL
;
896 IEnumPins
* penumpins
;
899 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
900 IMoniker_Release(pMoniker
);
902 ERR("Unable to retrieve filter info (%x)\n", hr
);
906 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
908 ERR("Unable to create filter (%x), trying next one\n", hr
);
912 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, NULL
);
914 ERR("Unable to add filter (%x)\n", hr
);
919 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
921 ERR("Splitter Enumpins (%x)\n", hr
);
924 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
926 ERR("Next (%x)\n", hr
);
933 IEnumPins_Release(penumpins
);
935 /* Connect the pin to render to the renderer */
936 hr
= IGraphBuilder_Connect(iface
, ppinOut
, ppinfilter
);
938 TRACE("Unable to connect to renderer (%x)\n", hr
);
945 IGraphBuilder_RemoveFilter(iface
, pfilter
);
946 IBaseFilter_Release(pfilter
);
954 IEnumMediaTypes_Release(penummt
);
959 static HRESULT WINAPI
GraphBuilder_RenderFile(IGraphBuilder
*iface
,
961 LPCWSTR lpcwstrPlayList
) {
962 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
963 static const WCHAR string
[] = {'R','e','a','d','e','r',0};
964 IBaseFilter
* preader
= NULL
;
965 IBaseFilter
* psplitter
= NULL
;
968 IEnumPins
* penumpins
;
971 IEnumMoniker
* pEnumMoniker
= NULL
;
976 IFileSourceFilter
* pfile
= NULL
;
980 TRACE("(%p/%p)->(%s, %s)\n", This
, iface
, debugstr_w(lpcwstrFile
), debugstr_w(lpcwstrPlayList
));
982 if (lpcwstrPlayList
!= NULL
)
985 hr
= IGraphBuilder_AddSourceFilter(iface
, lpcwstrFile
, string
, &preader
);
987 /* Retrieve file media type */
989 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
991 hr
= IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
992 IFileSourceFilter_Release(pfile
);
996 hr
= IBaseFilter_EnumPins(preader
, &penumpins
);
998 hr
= IEnumPins_Next(penumpins
, 1, &ppinreader
, &pin
);
999 IEnumPins_Release(penumpins
);
1002 if (SUCCEEDED(hr
)) {
1003 tab
[0] = mt
.majortype
;
1004 tab
[1] = mt
.subtype
;
1005 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
1011 IEnumMoniker_Release(pEnumMoniker
);
1013 IGraphBuilder_RemoveFilter(iface
, preader
);
1014 IBaseFilter_Release(preader
);
1019 hr
= VFW_E_CANNOT_RENDER
;
1020 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
1025 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
1026 IMoniker_Release(pMoniker
);
1028 ERR("Unable to retrieve filter info (%x)\n", hr
);
1032 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&psplitter
);
1034 ERR("Unable to create filter (%x), trying next one\n", hr
);
1038 hr
= IGraphBuilder_AddFilter(iface
, psplitter
, NULL
);
1040 ERR("Unable add filter (%x)\n", hr
);
1041 IBaseFilter_Release(psplitter
);
1045 /* Connect file source and splitter filters together */
1046 /* Make the splitter analyze incoming data */
1048 hr
= IBaseFilter_EnumPins(psplitter
, &penumpins
);
1049 if (SUCCEEDED(hr
)) {
1050 hr
= IEnumPins_Next(penumpins
, 1, &ppinsplitter
, &pin
);
1051 IEnumPins_Release(penumpins
);
1055 hr
= IPin_Connect(ppinreader
, ppinsplitter
, NULL
);
1057 /* Make sure there's some output pins in the filter */
1059 hr
= GetInternalConnections(psplitter
, ppinsplitter
, &ppins
, &nb
);
1060 if (SUCCEEDED(hr
)) {
1062 IPin_Disconnect(ppinreader
);
1063 TRACE("No output pins found in filter\n");
1064 hr
= VFW_E_CANNOT_RENDER
;
1068 IPin_Release(ppinsplitter
);
1069 ppinsplitter
= NULL
;
1071 if (SUCCEEDED(hr
)) {
1072 TRACE("Successfully connected to filter\n");
1076 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
1079 CoTaskMemFree(ppins
);
1082 IGraphBuilder_RemoveFilter(iface
, psplitter
);
1083 IBaseFilter_Release(psplitter
);
1087 /* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
1088 if (SUCCEEDED(hr
)) {
1091 TRACE("pins to consider: %d\n", nb
);
1092 for(i
= 0; i
< nb
; i
++) {
1093 TRACE("Processing pin %d\n", i
);
1094 hr
= IGraphBuilder_Render(iface
, ppins
[i
]);
1096 ERR("Cannot render pin %p (%x)\n", ppins
[i
], hr
);
1099 IPin_Release(ppins
[i
]);
1101 CoTaskMemFree(ppins
);
1103 hr
= (partial
? VFW_S_PARTIAL_RENDER
: S_OK
);
1109 static HRESULT WINAPI
GraphBuilder_AddSourceFilter(IGraphBuilder
*iface
,
1110 LPCWSTR lpcwstrFileName
,
1111 LPCWSTR lpcwstrFilterName
,
1112 IBaseFilter
**ppFilter
) {
1113 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1115 IBaseFilter
* preader
;
1116 IFileSourceFilter
* pfile
= NULL
;
1120 TRACE("(%p/%p)->(%s, %s, %p)\n", This
, iface
, debugstr_w(lpcwstrFileName
), debugstr_w(lpcwstrFilterName
), ppFilter
);
1122 /* Instantiate a file source filter */
1123 hr
= CoCreateInstance(&CLSID_AsyncReader
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&preader
);
1125 ERR("Unable to create file source filter (%x)\n", hr
);
1129 hr
= IGraphBuilder_AddFilter(iface
, preader
, lpcwstrFilterName
);
1131 ERR("Unable add filter (%x)\n", hr
);
1132 IBaseFilter_Release(preader
);
1136 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1138 ERR("Unable to get IFileSourceInterface (%x)\n", hr
);
1142 /* Load the file in the file source filter */
1143 hr
= IFileSourceFilter_Load(pfile
, lpcwstrFileName
, NULL
);
1145 ERR("Load (%x)\n", hr
);
1149 IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1151 ERR("GetCurFile (%x)\n", hr
);
1154 TRACE("File %s\n", debugstr_w(filename
));
1155 TRACE("MajorType %s\n", debugstr_guid(&mt
.majortype
));
1156 TRACE("SubType %s\n", debugstr_guid(&mt
.subtype
));
1159 *ppFilter
= preader
;
1165 IFileSourceFilter_Release(pfile
);
1166 IGraphBuilder_RemoveFilter(iface
, preader
);
1167 IBaseFilter_Release(preader
);
1172 static HRESULT WINAPI
GraphBuilder_SetLogFile(IGraphBuilder
*iface
,
1174 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1176 TRACE("(%p/%p)->(%08x): stub !!!\n", This
, iface
, (DWORD
) hFile
);
1181 static HRESULT WINAPI
GraphBuilder_Abort(IGraphBuilder
*iface
) {
1182 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1184 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1189 static HRESULT WINAPI
GraphBuilder_ShouldOperationContinue(IGraphBuilder
*iface
) {
1190 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1192 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1198 static const IGraphBuilderVtbl IGraphBuilder_VTable
=
1200 GraphBuilder_QueryInterface
,
1201 GraphBuilder_AddRef
,
1202 GraphBuilder_Release
,
1203 GraphBuilder_AddFilter
,
1204 GraphBuilder_RemoveFilter
,
1205 GraphBuilder_EnumFilters
,
1206 GraphBuilder_FindFilterByName
,
1207 GraphBuilder_ConnectDirect
,
1208 GraphBuilder_Reconnect
,
1209 GraphBuilder_Disconnect
,
1210 GraphBuilder_SetDefaultSyncSource
,
1211 GraphBuilder_Connect
,
1212 GraphBuilder_Render
,
1213 GraphBuilder_RenderFile
,
1214 GraphBuilder_AddSourceFilter
,
1215 GraphBuilder_SetLogFile
,
1217 GraphBuilder_ShouldOperationContinue
1220 /*** IUnknown methods ***/
1221 static HRESULT WINAPI
MediaControl_QueryInterface(IMediaControl
*iface
,
1224 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1226 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1228 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1231 static ULONG WINAPI
MediaControl_AddRef(IMediaControl
*iface
) {
1232 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1234 TRACE("(%p/%p)->()\n", This
, iface
);
1236 return Filtergraph_AddRef(This
);
1239 static ULONG WINAPI
MediaControl_Release(IMediaControl
*iface
) {
1240 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1242 TRACE("(%p/%p)->()\n", This
, iface
);
1244 return Filtergraph_Release(This
);
1248 /*** IDispatch methods ***/
1249 static HRESULT WINAPI
MediaControl_GetTypeInfoCount(IMediaControl
*iface
,
1251 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1253 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1258 static HRESULT WINAPI
MediaControl_GetTypeInfo(IMediaControl
*iface
,
1261 ITypeInfo
**ppTInfo
) {
1262 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1264 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1269 static HRESULT WINAPI
MediaControl_GetIDsOfNames(IMediaControl
*iface
,
1275 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1277 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1282 static HRESULT WINAPI
MediaControl_Invoke(IMediaControl
*iface
,
1283 DISPID dispIdMember
,
1287 DISPPARAMS
*pDispParams
,
1289 EXCEPINFO
*pExepInfo
,
1291 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1293 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
);
1298 typedef HRESULT(WINAPI
*fnFoundFilter
)(IBaseFilter
*);
1300 static HRESULT
ExploreGraph(IFilterGraphImpl
* pGraph
, IPin
* pOutputPin
, fnFoundFilter FoundFilter
)
1309 TRACE("%p %p\n", pGraph
, pOutputPin
);
1310 PinInfo
.pFilter
= NULL
;
1312 hr
= IPin_ConnectedTo(pOutputPin
, &pInputPin
);
1315 hr
= IPin_QueryPinInfo(pInputPin
, &PinInfo
);
1318 hr
= GetInternalConnections(PinInfo
.pFilter
, pInputPin
, &ppPins
, &nb
);
1324 TRACE("Reached a renderer\n");
1325 /* Count renderers for end of stream notification */
1326 pGraph
->nRenderers
++;
1330 for(i
= 0; i
< nb
; i
++)
1332 /* Explore the graph downstream from this pin
1333 * FIXME: We should prevent exploring from a pin more than once. This can happens when
1334 * several input pins are connected to the same output (a MUX for instance). */
1335 ExploreGraph(pGraph
, ppPins
[i
], FoundFilter
);
1336 IPin_Release(ppPins
[i
]);
1339 CoTaskMemFree(ppPins
);
1341 TRACE("Doing stuff with filter %p\n", PinInfo
.pFilter
);
1342 FoundFilter(PinInfo
.pFilter
);
1345 if (PinInfo
.pFilter
) IBaseFilter_Release(PinInfo
.pFilter
);
1349 static HRESULT WINAPI
SendRun(IBaseFilter
*pFilter
) {
1350 return IBaseFilter_Run(pFilter
, 0);
1353 static HRESULT WINAPI
SendPause(IBaseFilter
*pFilter
) {
1354 return IBaseFilter_Pause(pFilter
);
1357 static HRESULT WINAPI
SendStop(IBaseFilter
*pFilter
) {
1358 return IBaseFilter_Stop(pFilter
);
1361 static HRESULT
SendFilterMessage(IMediaControl
*iface
, fnFoundFilter FoundFilter
) {
1362 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1364 IBaseFilter
* pfilter
;
1370 TRACE("(%p/%p)->()\n", This
, iface
);
1372 /* Explorer the graph from source filters to renderers, determine renderers
1373 * number and run filters from renderers to source filters */
1374 This
->nRenderers
= 0;
1375 ResetEvent(This
->hEventCompletion
);
1377 for(i
= 0; i
< This
->nFilters
; i
++)
1380 pfilter
= This
->ppFiltersInGraph
[i
];
1381 hr
= IBaseFilter_EnumPins(pfilter
, &pEnum
);
1384 ERR("Enum pins failed %x\n", hr
);
1387 /* Check if it is a source filter */
1388 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1390 IPin_QueryDirection(pPin
, &dir
);
1392 if (dir
== PINDIR_INPUT
)
1400 TRACE("Found a source filter %p\n", pfilter
);
1401 IEnumPins_Reset(pEnum
);
1402 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1404 /* Explore the graph downstream from this pin */
1405 ExploreGraph(This
, pPin
, FoundFilter
);
1408 FoundFilter(pfilter
);
1410 IEnumPins_Release(pEnum
);
1416 /*** IMediaControl methods ***/
1417 static HRESULT WINAPI
MediaControl_Run(IMediaControl
*iface
) {
1418 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1419 TRACE("(%p/%p)->()\n", This
, iface
);
1421 if (This
->state
== State_Running
) return S_OK
;
1423 EnterCriticalSection(&This
->cs
);
1424 SendFilterMessage(iface
, SendRun
);
1425 This
->state
= State_Running
;
1426 LeaveCriticalSection(&This
->cs
);
1430 static HRESULT WINAPI
MediaControl_Pause(IMediaControl
*iface
) {
1431 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1432 TRACE("(%p/%p)->()\n", This
, iface
);
1434 if (This
->state
== State_Paused
) return S_OK
;
1436 EnterCriticalSection(&This
->cs
);
1437 SendFilterMessage(iface
, SendPause
);
1438 This
->state
= State_Paused
;
1439 LeaveCriticalSection(&This
->cs
);
1443 static HRESULT WINAPI
MediaControl_Stop(IMediaControl
*iface
) {
1444 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1445 TRACE("(%p/%p)->()\n", This
, iface
);
1447 if (This
->state
== State_Stopped
) return S_OK
;
1449 EnterCriticalSection(&This
->cs
);
1450 if (This
->state
== State_Running
) SendFilterMessage(iface
, SendPause
);
1451 SendFilterMessage(iface
, SendStop
);
1452 This
->state
= State_Stopped
;
1453 LeaveCriticalSection(&This
->cs
);
1457 static HRESULT WINAPI
MediaControl_GetState(IMediaControl
*iface
,
1459 OAFilterState
*pfs
) {
1460 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1462 TRACE("(%p/%p)->(%d, %p): semi-stub !!!\n", This
, iface
, msTimeout
, pfs
);
1464 EnterCriticalSection(&This
->cs
);
1468 LeaveCriticalSection(&This
->cs
);
1473 static HRESULT WINAPI
MediaControl_RenderFile(IMediaControl
*iface
,
1475 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1477 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
);
1482 static HRESULT WINAPI
MediaControl_AddSourceFilter(IMediaControl
*iface
,
1484 IDispatch
**ppUnk
) {
1485 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1487 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
, ppUnk
);
1492 static HRESULT WINAPI
MediaControl_get_FilterCollection(IMediaControl
*iface
,
1493 IDispatch
**ppUnk
) {
1494 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1496 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1501 static HRESULT WINAPI
MediaControl_get_RegFilterCollection(IMediaControl
*iface
,
1502 IDispatch
**ppUnk
) {
1503 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1505 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1510 static HRESULT WINAPI
MediaControl_StopWhenReady(IMediaControl
*iface
) {
1511 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1513 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1519 static const IMediaControlVtbl IMediaControl_VTable
=
1521 MediaControl_QueryInterface
,
1522 MediaControl_AddRef
,
1523 MediaControl_Release
,
1524 MediaControl_GetTypeInfoCount
,
1525 MediaControl_GetTypeInfo
,
1526 MediaControl_GetIDsOfNames
,
1527 MediaControl_Invoke
,
1531 MediaControl_GetState
,
1532 MediaControl_RenderFile
,
1533 MediaControl_AddSourceFilter
,
1534 MediaControl_get_FilterCollection
,
1535 MediaControl_get_RegFilterCollection
,
1536 MediaControl_StopWhenReady
1540 /*** IUnknown methods ***/
1541 static HRESULT WINAPI
MediaSeeking_QueryInterface(IMediaSeeking
*iface
,
1544 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1546 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1548 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1551 static ULONG WINAPI
MediaSeeking_AddRef(IMediaSeeking
*iface
) {
1552 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1554 TRACE("(%p/%p)->()\n", This
, iface
);
1556 return Filtergraph_AddRef(This
);
1559 static ULONG WINAPI
MediaSeeking_Release(IMediaSeeking
*iface
) {
1560 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1562 TRACE("(%p/%p)->()\n", This
, iface
);
1564 return Filtergraph_Release(This
);
1567 /*** IMediaSeeking methods ***/
1568 static HRESULT WINAPI
MediaSeeking_GetCapabilities(IMediaSeeking
*iface
,
1569 DWORD
*pCapabilities
) {
1570 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1572 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1577 static HRESULT WINAPI
MediaSeeking_CheckCapabilities(IMediaSeeking
*iface
,
1578 DWORD
*pCapabilities
) {
1579 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1581 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1586 static HRESULT WINAPI
MediaSeeking_IsFormatSupported(IMediaSeeking
*iface
,
1587 const GUID
*pFormat
) {
1588 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1590 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1595 static HRESULT WINAPI
MediaSeeking_QueryPreferredFormat(IMediaSeeking
*iface
,
1597 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1599 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1604 static HRESULT WINAPI
MediaSeeking_GetTimeFormat(IMediaSeeking
*iface
,
1606 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1608 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1613 static HRESULT WINAPI
MediaSeeking_IsUsingTimeFormat(IMediaSeeking
*iface
,
1614 const GUID
*pFormat
) {
1615 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1617 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1622 static HRESULT WINAPI
MediaSeeking_SetTimeFormat(IMediaSeeking
*iface
,
1623 const GUID
*pFormat
) {
1624 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1626 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1631 static HRESULT WINAPI
MediaSeeking_GetDuration(IMediaSeeking
*iface
,
1632 LONGLONG
*pDuration
) {
1633 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1635 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDuration
);
1640 static HRESULT WINAPI
MediaSeeking_GetStopPosition(IMediaSeeking
*iface
,
1642 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1644 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pStop
);
1649 static HRESULT WINAPI
MediaSeeking_GetCurrentPosition(IMediaSeeking
*iface
,
1650 LONGLONG
*pCurrent
) {
1651 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1653 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCurrent
);
1658 static HRESULT WINAPI
MediaSeeking_ConvertTimeFormat(IMediaSeeking
*iface
,
1660 const GUID
*pTargetFormat
,
1662 const GUID
*pSourceFormat
) {
1663 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1665 TRACE("(%p/%p)->(%p, %p, 0x%s, %p): stub !!!\n", This
, iface
, pTarget
,
1666 pTargetFormat
, wine_dbgstr_longlong(Source
), pSourceFormat
);
1671 static HRESULT WINAPI
MediaSeeking_SetPositions(IMediaSeeking
*iface
,
1673 DWORD dwCurrentFlags
,
1675 DWORD dwStopFlags
) {
1676 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1678 TRACE("(%p/%p)->(%p, %08x, %p, %08x): stub !!!\n", This
, iface
, pCurrent
, dwCurrentFlags
, pStop
, dwStopFlags
);
1683 static HRESULT WINAPI
MediaSeeking_GetPositions(IMediaSeeking
*iface
,
1686 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1688 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pCurrent
, pStop
);
1693 static HRESULT WINAPI
MediaSeeking_GetAvailable(IMediaSeeking
*iface
,
1694 LONGLONG
*pEarliest
,
1695 LONGLONG
*pLatest
) {
1696 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1698 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pEarliest
, pLatest
);
1703 static HRESULT WINAPI
MediaSeeking_SetRate(IMediaSeeking
*iface
,
1705 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1707 TRACE("(%p/%p)->(%f): stub !!!\n", This
, iface
, dRate
);
1712 static HRESULT WINAPI
MediaSeeking_GetRate(IMediaSeeking
*iface
,
1714 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1716 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pdRate
);
1721 static HRESULT WINAPI
MediaSeeking_GetPreroll(IMediaSeeking
*iface
,
1722 LONGLONG
*pllPreroll
) {
1723 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1725 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pllPreroll
);
1731 static const IMediaSeekingVtbl IMediaSeeking_VTable
=
1733 MediaSeeking_QueryInterface
,
1734 MediaSeeking_AddRef
,
1735 MediaSeeking_Release
,
1736 MediaSeeking_GetCapabilities
,
1737 MediaSeeking_CheckCapabilities
,
1738 MediaSeeking_IsFormatSupported
,
1739 MediaSeeking_QueryPreferredFormat
,
1740 MediaSeeking_GetTimeFormat
,
1741 MediaSeeking_IsUsingTimeFormat
,
1742 MediaSeeking_SetTimeFormat
,
1743 MediaSeeking_GetDuration
,
1744 MediaSeeking_GetStopPosition
,
1745 MediaSeeking_GetCurrentPosition
,
1746 MediaSeeking_ConvertTimeFormat
,
1747 MediaSeeking_SetPositions
,
1748 MediaSeeking_GetPositions
,
1749 MediaSeeking_GetAvailable
,
1750 MediaSeeking_SetRate
,
1751 MediaSeeking_GetRate
,
1752 MediaSeeking_GetPreroll
1755 /*** IUnknown methods ***/
1756 static HRESULT WINAPI
MediaPosition_QueryInterface(IMediaPosition
* iface
, REFIID riid
, void** ppvObject
){
1757 FIXME("(%p) stub!\n", iface
);
1761 static ULONG WINAPI
MediaPosition_AddRef(IMediaPosition
*iface
){
1762 FIXME("(%p) stub!\n", iface
);
1766 static ULONG WINAPI
MediaPosition_Release(IMediaPosition
*iface
){
1767 FIXME("(%p) stub!\n", iface
);
1771 /*** IDispatch methods ***/
1772 static HRESULT WINAPI
MediaPosition_GetTypeInfoCount(IMediaPosition
*iface
, UINT
* pctinfo
){
1773 FIXME("(%p) stub!\n", iface
);
1777 static HRESULT WINAPI
MediaPosition_GetTypeInfo(IMediaPosition
*iface
, UINT iTInfo
, LCID lcid
, ITypeInfo
** ppTInfo
){
1778 FIXME("(%p) stub!\n", iface
);
1782 static HRESULT WINAPI
MediaPosition_GetIDsOfNames(IMediaPosition
* iface
, REFIID riid
, LPOLESTR
* rgszNames
, UINT cNames
, LCID lcid
, DISPID
* rgDispId
){
1783 FIXME("(%p) stub!\n", iface
);
1787 static HRESULT WINAPI
MediaPosition_Invoke(IMediaPosition
* iface
, DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
* pDispParams
, VARIANT
* pVarResult
, EXCEPINFO
* pExcepInfo
, UINT
* puArgErr
){
1788 FIXME("(%p) stub!\n", iface
);
1792 /*** IMediaPosition methods ***/
1793 static HRESULT WINAPI
MediaPosition_get_Duration(IMediaPosition
* iface
, REFTIME
*plength
){
1794 FIXME("(%p)->(%p) stub!\n", iface
, plength
);
1798 static HRESULT WINAPI
MediaPosition_put_CurrentPosition(IMediaPosition
* iface
, REFTIME llTime
){
1799 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1803 static HRESULT WINAPI
MediaPosition_get_CurrentPosition(IMediaPosition
* iface
, REFTIME
*pllTime
){
1804 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1808 static HRESULT WINAPI
MediaPosition_get_StopTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1809 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1813 static HRESULT WINAPI
MediaPosition_put_StopTime(IMediaPosition
* iface
, REFTIME llTime
){
1814 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1818 static HRESULT WINAPI
MediaPosition_get_PrerollTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1819 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1823 static HRESULT WINAPI
MediaPosition_put_PrerollTime(IMediaPosition
* iface
, REFTIME llTime
){
1824 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1828 static HRESULT WINAPI
MediaPosition_put_Rate(IMediaPosition
* iface
, double dRate
){
1829 FIXME("(%p)->(%f) stub!\n", iface
, dRate
);
1833 static HRESULT WINAPI
MediaPosition_get_Rate(IMediaPosition
* iface
, double *pdRate
){
1834 FIXME("(%p)->(%p) stub!\n", iface
, pdRate
);
1838 static HRESULT WINAPI
MediaPosition_CanSeekForward(IMediaPosition
* iface
, LONG
*pCanSeekForward
){
1839 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekForward
);
1843 static HRESULT WINAPI
MediaPosition_CanSeekBackward(IMediaPosition
* iface
, LONG
*pCanSeekBackward
){
1844 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekBackward
);
1849 static const IMediaPositionVtbl IMediaPosition_VTable
=
1851 MediaPosition_QueryInterface
,
1852 MediaPosition_AddRef
,
1853 MediaPosition_Release
,
1854 MediaPosition_GetTypeInfoCount
,
1855 MediaPosition_GetTypeInfo
,
1856 MediaPosition_GetIDsOfNames
,
1857 MediaPosition_Invoke
,
1858 MediaPosition_get_Duration
,
1859 MediaPosition_put_CurrentPosition
,
1860 MediaPosition_get_CurrentPosition
,
1861 MediaPosition_get_StopTime
,
1862 MediaPosition_put_StopTime
,
1863 MediaPosition_get_PrerollTime
,
1864 MediaPosition_put_PrerollTime
,
1865 MediaPosition_put_Rate
,
1866 MediaPosition_get_Rate
,
1867 MediaPosition_CanSeekForward
,
1868 MediaPosition_CanSeekBackward
1871 static HRESULT
GetTargetInterface(IFilterGraphImpl
* pGraph
, REFIID riid
, LPVOID
* ppvObj
)
1873 HRESULT hr
= E_NOINTERFACE
;
1877 /* Check if the interface type is already registered */
1878 for (entry
= 0; entry
< pGraph
->nItfCacheEntries
; entry
++)
1879 if (riid
== pGraph
->ItfCacheEntries
[entry
].riid
)
1881 if (pGraph
->ItfCacheEntries
[entry
].iface
)
1883 /* Return the interface if available */
1884 *ppvObj
= pGraph
->ItfCacheEntries
[entry
].iface
;
1890 if (entry
>= MAX_ITF_CACHE_ENTRIES
)
1892 FIXME("Not enough space to store interface in the cache\n");
1893 return E_OUTOFMEMORY
;
1896 /* Find a filter supporting the requested interface */
1897 for (i
= 0; i
< pGraph
->nFilters
; i
++)
1899 hr
= IBaseFilter_QueryInterface(pGraph
->ppFiltersInGraph
[i
], riid
, ppvObj
);
1902 pGraph
->ItfCacheEntries
[entry
].riid
= riid
;
1903 pGraph
->ItfCacheEntries
[entry
].filter
= pGraph
->ppFiltersInGraph
[i
];
1904 pGraph
->ItfCacheEntries
[entry
].iface
= (IUnknown
*)*ppvObj
;
1905 if (entry
>= pGraph
->nItfCacheEntries
)
1906 pGraph
->nItfCacheEntries
++;
1909 if (hr
!= E_NOINTERFACE
)
1916 /*** IUnknown methods ***/
1917 static HRESULT WINAPI
BasicAudio_QueryInterface(IBasicAudio
*iface
,
1920 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1922 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1924 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1927 static ULONG WINAPI
BasicAudio_AddRef(IBasicAudio
*iface
) {
1928 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1930 TRACE("(%p/%p)->()\n", This
, iface
);
1932 return Filtergraph_AddRef(This
);
1935 static ULONG WINAPI
BasicAudio_Release(IBasicAudio
*iface
) {
1936 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1938 TRACE("(%p/%p)->()\n", This
, iface
);
1940 return Filtergraph_Release(This
);
1943 /*** IDispatch methods ***/
1944 static HRESULT WINAPI
BasicAudio_GetTypeInfoCount(IBasicAudio
*iface
,
1946 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1947 IBasicAudio
* pBasicAudio
;
1950 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
1952 EnterCriticalSection(&This
->cs
);
1954 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
1957 hr
= IBasicAudio_GetTypeInfoCount(pBasicAudio
, pctinfo
);
1959 LeaveCriticalSection(&This
->cs
);
1964 static HRESULT WINAPI
BasicAudio_GetTypeInfo(IBasicAudio
*iface
,
1967 ITypeInfo
**ppTInfo
) {
1968 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1969 IBasicAudio
* pBasicAudio
;
1972 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1974 EnterCriticalSection(&This
->cs
);
1976 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
1979 hr
= IBasicAudio_GetTypeInfo(pBasicAudio
, iTInfo
, lcid
, ppTInfo
);
1981 LeaveCriticalSection(&This
->cs
);
1986 static HRESULT WINAPI
BasicAudio_GetIDsOfNames(IBasicAudio
*iface
,
1992 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1993 IBasicAudio
* pBasicAudio
;
1996 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1998 EnterCriticalSection(&This
->cs
);
2000 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2003 hr
= IBasicAudio_GetIDsOfNames(pBasicAudio
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2005 LeaveCriticalSection(&This
->cs
);
2010 static HRESULT WINAPI
BasicAudio_Invoke(IBasicAudio
*iface
,
2011 DISPID dispIdMember
,
2015 DISPPARAMS
*pDispParams
,
2017 EXCEPINFO
*pExepInfo
,
2019 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2020 IBasicAudio
* pBasicAudio
;
2023 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
);
2025 EnterCriticalSection(&This
->cs
);
2027 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2030 hr
= IBasicAudio_Invoke(pBasicAudio
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2032 LeaveCriticalSection(&This
->cs
);
2037 /*** IBasicAudio methods ***/
2038 static HRESULT WINAPI
BasicAudio_put_Volume(IBasicAudio
*iface
,
2040 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2041 IBasicAudio
* pBasicAudio
;
2044 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lVolume
);
2046 EnterCriticalSection(&This
->cs
);
2048 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2051 hr
= IBasicAudio_put_Volume(pBasicAudio
, lVolume
);
2053 LeaveCriticalSection(&This
->cs
);
2058 static HRESULT WINAPI
BasicAudio_get_Volume(IBasicAudio
*iface
,
2060 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2061 IBasicAudio
* pBasicAudio
;
2064 TRACE("(%p/%p)->(%p)\n", This
, iface
, plVolume
);
2066 EnterCriticalSection(&This
->cs
);
2068 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2071 hr
= IBasicAudio_get_Volume(pBasicAudio
, plVolume
);
2073 LeaveCriticalSection(&This
->cs
);
2078 static HRESULT WINAPI
BasicAudio_put_Balance(IBasicAudio
*iface
,
2080 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2081 IBasicAudio
* pBasicAudio
;
2084 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lBalance
);
2086 EnterCriticalSection(&This
->cs
);
2088 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2091 hr
= IBasicAudio_put_Balance(pBasicAudio
, lBalance
);
2093 LeaveCriticalSection(&This
->cs
);
2098 static HRESULT WINAPI
BasicAudio_get_Balance(IBasicAudio
*iface
,
2100 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2101 IBasicAudio
* pBasicAudio
;
2104 TRACE("(%p/%p)->(%p)\n", This
, iface
, plBalance
);
2106 EnterCriticalSection(&This
->cs
);
2108 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2111 hr
= IBasicAudio_get_Balance(pBasicAudio
, plBalance
);
2113 LeaveCriticalSection(&This
->cs
);
2118 static const IBasicAudioVtbl IBasicAudio_VTable
=
2120 BasicAudio_QueryInterface
,
2123 BasicAudio_GetTypeInfoCount
,
2124 BasicAudio_GetTypeInfo
,
2125 BasicAudio_GetIDsOfNames
,
2127 BasicAudio_put_Volume
,
2128 BasicAudio_get_Volume
,
2129 BasicAudio_put_Balance
,
2130 BasicAudio_get_Balance
2133 /*** IUnknown methods ***/
2134 static HRESULT WINAPI
BasicVideo_QueryInterface(IBasicVideo
*iface
,
2137 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2139 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2141 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2144 static ULONG WINAPI
BasicVideo_AddRef(IBasicVideo
*iface
) {
2145 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2147 TRACE("(%p/%p)->()\n", This
, iface
);
2149 return Filtergraph_AddRef(This
);
2152 static ULONG WINAPI
BasicVideo_Release(IBasicVideo
*iface
) {
2153 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2155 TRACE("(%p/%p)->()\n", This
, iface
);
2157 return Filtergraph_Release(This
);
2160 /*** IDispatch methods ***/
2161 static HRESULT WINAPI
BasicVideo_GetTypeInfoCount(IBasicVideo
*iface
,
2163 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2164 IBasicVideo
* pBasicVideo
;
2167 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
2169 EnterCriticalSection(&This
->cs
);
2171 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2174 hr
= IBasicVideo_GetTypeInfoCount(pBasicVideo
, pctinfo
);
2176 LeaveCriticalSection(&This
->cs
);
2181 static HRESULT WINAPI
BasicVideo_GetTypeInfo(IBasicVideo
*iface
,
2184 ITypeInfo
**ppTInfo
) {
2185 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2186 IBasicVideo
* pBasicVideo
;
2189 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2191 EnterCriticalSection(&This
->cs
);
2193 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2196 hr
= IBasicVideo_GetTypeInfo(pBasicVideo
, iTInfo
, lcid
, ppTInfo
);
2198 LeaveCriticalSection(&This
->cs
);
2203 static HRESULT WINAPI
BasicVideo_GetIDsOfNames(IBasicVideo
*iface
,
2209 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2210 IBasicVideo
* pBasicVideo
;
2213 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2215 EnterCriticalSection(&This
->cs
);
2217 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2220 hr
= IBasicVideo_GetIDsOfNames(pBasicVideo
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2222 LeaveCriticalSection(&This
->cs
);
2227 static HRESULT WINAPI
BasicVideo_Invoke(IBasicVideo
*iface
,
2228 DISPID dispIdMember
,
2232 DISPPARAMS
*pDispParams
,
2234 EXCEPINFO
*pExepInfo
,
2236 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2237 IBasicVideo
* pBasicVideo
;
2240 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
);
2242 EnterCriticalSection(&This
->cs
);
2244 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2247 hr
= IBasicVideo_Invoke(pBasicVideo
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2249 LeaveCriticalSection(&This
->cs
);
2254 /*** IBasicVideo methods ***/
2255 static HRESULT WINAPI
BasicVideo_get_AvgTimePerFrame(IBasicVideo
*iface
,
2256 REFTIME
*pAvgTimePerFrame
) {
2257 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2258 IBasicVideo
* pBasicVideo
;
2261 TRACE("(%p/%p)->(%p)\n", This
, iface
, pAvgTimePerFrame
);
2263 EnterCriticalSection(&This
->cs
);
2265 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2268 hr
= IBasicVideo_get_AvgTimePerFrame(pBasicVideo
, pAvgTimePerFrame
);
2270 LeaveCriticalSection(&This
->cs
);
2275 static HRESULT WINAPI
BasicVideo_get_BitRate(IBasicVideo
*iface
,
2277 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2278 IBasicVideo
* pBasicVideo
;
2281 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitRate
);
2283 EnterCriticalSection(&This
->cs
);
2285 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2288 hr
= IBasicVideo_get_BitRate(pBasicVideo
, pBitRate
);
2290 LeaveCriticalSection(&This
->cs
);
2295 static HRESULT WINAPI
BasicVideo_get_BitErrorRate(IBasicVideo
*iface
,
2296 long *pBitErrorRate
) {
2297 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2298 IBasicVideo
* pBasicVideo
;
2301 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitErrorRate
);
2303 EnterCriticalSection(&This
->cs
);
2305 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2308 hr
= IBasicVideo_get_BitErrorRate(pBasicVideo
, pBitErrorRate
);
2310 LeaveCriticalSection(&This
->cs
);
2315 static HRESULT WINAPI
BasicVideo_get_VideoWidth(IBasicVideo
*iface
,
2316 long *pVideoWidth
) {
2317 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2318 IBasicVideo
* pBasicVideo
;
2321 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoWidth
);
2323 EnterCriticalSection(&This
->cs
);
2325 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2328 hr
= IBasicVideo_get_VideoWidth(pBasicVideo
, pVideoWidth
);
2330 LeaveCriticalSection(&This
->cs
);
2335 static HRESULT WINAPI
BasicVideo_get_VideoHeight(IBasicVideo
*iface
,
2336 long *pVideoHeight
) {
2337 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2338 IBasicVideo
* pBasicVideo
;
2341 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoHeight
);
2343 EnterCriticalSection(&This
->cs
);
2345 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2348 hr
= IBasicVideo_get_VideoHeight(pBasicVideo
, pVideoHeight
);
2350 LeaveCriticalSection(&This
->cs
);
2355 static HRESULT WINAPI
BasicVideo_put_SourceLeft(IBasicVideo
*iface
,
2357 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2358 IBasicVideo
* pBasicVideo
;
2361 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceLeft
);
2363 EnterCriticalSection(&This
->cs
);
2365 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2368 hr
= IBasicVideo_put_SourceLeft(pBasicVideo
, SourceLeft
);
2370 LeaveCriticalSection(&This
->cs
);
2375 static HRESULT WINAPI
BasicVideo_get_SourceLeft(IBasicVideo
*iface
,
2376 long *pSourceLeft
) {
2377 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2378 IBasicVideo
* pBasicVideo
;
2381 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceLeft
);
2383 EnterCriticalSection(&This
->cs
);
2385 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2388 hr
= IBasicVideo_get_SourceLeft(pBasicVideo
, pSourceLeft
);
2390 LeaveCriticalSection(&This
->cs
);
2395 static HRESULT WINAPI
BasicVideo_put_SourceWidth(IBasicVideo
*iface
,
2397 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2398 IBasicVideo
* pBasicVideo
;
2401 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceWidth
);
2403 EnterCriticalSection(&This
->cs
);
2405 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2408 hr
= IBasicVideo_put_SourceWidth(pBasicVideo
, SourceWidth
);
2410 LeaveCriticalSection(&This
->cs
);
2415 static HRESULT WINAPI
BasicVideo_get_SourceWidth(IBasicVideo
*iface
,
2416 long *pSourceWidth
) {
2417 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2418 IBasicVideo
* pBasicVideo
;
2421 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceWidth
);
2423 EnterCriticalSection(&This
->cs
);
2425 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2428 hr
= IBasicVideo_get_SourceWidth(pBasicVideo
, pSourceWidth
);
2430 LeaveCriticalSection(&This
->cs
);
2435 static HRESULT WINAPI
BasicVideo_put_SourceTop(IBasicVideo
*iface
,
2437 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2438 IBasicVideo
* pBasicVideo
;
2441 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceTop
);
2443 EnterCriticalSection(&This
->cs
);
2445 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2448 hr
= IBasicVideo_put_SourceTop(pBasicVideo
, SourceTop
);
2450 LeaveCriticalSection(&This
->cs
);
2455 static HRESULT WINAPI
BasicVideo_get_SourceTop(IBasicVideo
*iface
,
2457 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2458 IBasicVideo
* pBasicVideo
;
2461 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceTop
);
2463 EnterCriticalSection(&This
->cs
);
2465 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2468 hr
= IBasicVideo_get_SourceTop(pBasicVideo
, pSourceTop
);
2470 LeaveCriticalSection(&This
->cs
);
2475 static HRESULT WINAPI
BasicVideo_put_SourceHeight(IBasicVideo
*iface
,
2476 long SourceHeight
) {
2477 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2478 IBasicVideo
* pBasicVideo
;
2481 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceHeight
);
2483 EnterCriticalSection(&This
->cs
);
2485 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2488 hr
= IBasicVideo_put_SourceHeight(pBasicVideo
, SourceHeight
);
2490 LeaveCriticalSection(&This
->cs
);
2495 static HRESULT WINAPI
BasicVideo_get_SourceHeight(IBasicVideo
*iface
,
2496 long *pSourceHeight
) {
2497 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2498 IBasicVideo
* pBasicVideo
;
2501 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceHeight
);
2503 EnterCriticalSection(&This
->cs
);
2505 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2508 hr
= IBasicVideo_get_SourceHeight(pBasicVideo
, pSourceHeight
);
2510 LeaveCriticalSection(&This
->cs
);
2515 static HRESULT WINAPI
BasicVideo_put_DestinationLeft(IBasicVideo
*iface
,
2516 long DestinationLeft
) {
2517 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2518 IBasicVideo
* pBasicVideo
;
2521 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationLeft
);
2523 EnterCriticalSection(&This
->cs
);
2525 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2528 hr
= IBasicVideo_put_DestinationLeft(pBasicVideo
, DestinationLeft
);
2530 LeaveCriticalSection(&This
->cs
);
2535 static HRESULT WINAPI
BasicVideo_get_DestinationLeft(IBasicVideo
*iface
,
2536 long *pDestinationLeft
) {
2537 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2538 IBasicVideo
* pBasicVideo
;
2541 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationLeft
);
2543 EnterCriticalSection(&This
->cs
);
2545 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2548 hr
= IBasicVideo_get_DestinationLeft(pBasicVideo
, pDestinationLeft
);
2550 LeaveCriticalSection(&This
->cs
);
2555 static HRESULT WINAPI
BasicVideo_put_DestinationWidth(IBasicVideo
*iface
,
2556 long DestinationWidth
) {
2557 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2558 IBasicVideo
* pBasicVideo
;
2561 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationWidth
);
2563 EnterCriticalSection(&This
->cs
);
2565 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2568 hr
= IBasicVideo_put_DestinationWidth(pBasicVideo
, DestinationWidth
);
2570 LeaveCriticalSection(&This
->cs
);
2575 static HRESULT WINAPI
BasicVideo_get_DestinationWidth(IBasicVideo
*iface
,
2576 long *pDestinationWidth
) {
2577 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2578 IBasicVideo
* pBasicVideo
;
2581 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationWidth
);
2583 EnterCriticalSection(&This
->cs
);
2585 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2588 hr
= IBasicVideo_get_DestinationWidth(pBasicVideo
, pDestinationWidth
);
2590 LeaveCriticalSection(&This
->cs
);
2595 static HRESULT WINAPI
BasicVideo_put_DestinationTop(IBasicVideo
*iface
,
2596 long DestinationTop
) {
2597 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2598 IBasicVideo
* pBasicVideo
;
2601 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationTop
);
2603 EnterCriticalSection(&This
->cs
);
2605 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2608 hr
= IBasicVideo_put_DestinationTop(pBasicVideo
, DestinationTop
);
2610 LeaveCriticalSection(&This
->cs
);
2615 static HRESULT WINAPI
BasicVideo_get_DestinationTop(IBasicVideo
*iface
,
2616 long *pDestinationTop
) {
2617 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2618 IBasicVideo
* pBasicVideo
;
2621 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationTop
);
2623 EnterCriticalSection(&This
->cs
);
2625 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2628 hr
= IBasicVideo_get_DestinationTop(pBasicVideo
, pDestinationTop
);
2630 LeaveCriticalSection(&This
->cs
);
2635 static HRESULT WINAPI
BasicVideo_put_DestinationHeight(IBasicVideo
*iface
,
2636 long DestinationHeight
) {
2637 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2638 IBasicVideo
* pBasicVideo
;
2641 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationHeight
);
2643 EnterCriticalSection(&This
->cs
);
2645 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2648 hr
= IBasicVideo_put_DestinationHeight(pBasicVideo
, DestinationHeight
);
2650 LeaveCriticalSection(&This
->cs
);
2655 static HRESULT WINAPI
BasicVideo_get_DestinationHeight(IBasicVideo
*iface
,
2656 long *pDestinationHeight
) {
2657 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2658 IBasicVideo
* pBasicVideo
;
2661 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationHeight
);
2663 EnterCriticalSection(&This
->cs
);
2665 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2668 hr
= IBasicVideo_get_DestinationHeight(pBasicVideo
, pDestinationHeight
);
2670 LeaveCriticalSection(&This
->cs
);
2675 static HRESULT WINAPI
BasicVideo_SetSourcePosition(IBasicVideo
*iface
,
2680 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2681 IBasicVideo
* pBasicVideo
;
2684 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2686 EnterCriticalSection(&This
->cs
);
2688 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2691 hr
= IBasicVideo_SetSourcePosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2693 LeaveCriticalSection(&This
->cs
);
2698 static HRESULT WINAPI
BasicVideo_GetSourcePosition(IBasicVideo
*iface
,
2703 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2704 IBasicVideo
* pBasicVideo
;
2707 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2709 EnterCriticalSection(&This
->cs
);
2711 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2714 hr
= IBasicVideo_GetSourcePosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2716 LeaveCriticalSection(&This
->cs
);
2721 static HRESULT WINAPI
BasicVideo_SetDefaultSourcePosition(IBasicVideo
*iface
) {
2722 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2723 IBasicVideo
* pBasicVideo
;
2726 TRACE("(%p/%p)->()\n", This
, iface
);
2728 EnterCriticalSection(&This
->cs
);
2730 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2733 hr
= IBasicVideo_SetDefaultSourcePosition(pBasicVideo
);
2735 LeaveCriticalSection(&This
->cs
);
2740 static HRESULT WINAPI
BasicVideo_SetDestinationPosition(IBasicVideo
*iface
,
2745 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2746 IBasicVideo
* pBasicVideo
;
2749 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2751 EnterCriticalSection(&This
->cs
);
2753 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2756 hr
= IBasicVideo_SetDestinationPosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2758 LeaveCriticalSection(&This
->cs
);
2763 static HRESULT WINAPI
BasicVideo_GetDestinationPosition(IBasicVideo
*iface
,
2768 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2769 IBasicVideo
* pBasicVideo
;
2772 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2774 EnterCriticalSection(&This
->cs
);
2776 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2779 hr
= IBasicVideo_GetDestinationPosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2781 LeaveCriticalSection(&This
->cs
);
2786 static HRESULT WINAPI
BasicVideo_SetDefaultDestinationPosition(IBasicVideo
*iface
) {
2787 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2788 IBasicVideo
* pBasicVideo
;
2791 TRACE("(%p/%p)->()\n", This
, iface
);
2793 EnterCriticalSection(&This
->cs
);
2795 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2798 hr
= IBasicVideo_SetDefaultDestinationPosition(pBasicVideo
);
2800 LeaveCriticalSection(&This
->cs
);
2805 static HRESULT WINAPI
BasicVideo_GetVideoSize(IBasicVideo
*iface
,
2808 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2809 IBasicVideo
* pBasicVideo
;
2812 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
2814 EnterCriticalSection(&This
->cs
);
2816 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2819 hr
= IBasicVideo_GetVideoSize(pBasicVideo
, pWidth
, pHeight
);
2821 LeaveCriticalSection(&This
->cs
);
2826 static HRESULT WINAPI
BasicVideo_GetVideoPaletteEntries(IBasicVideo
*iface
,
2831 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2832 IBasicVideo
* pBasicVideo
;
2835 TRACE("(%p/%p)->(%ld, %ld, %p, %p)\n", This
, iface
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2837 EnterCriticalSection(&This
->cs
);
2839 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2842 hr
= IBasicVideo_GetVideoPaletteEntries(pBasicVideo
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2844 LeaveCriticalSection(&This
->cs
);
2849 static HRESULT WINAPI
BasicVideo_GetCurrentImage(IBasicVideo
*iface
,
2852 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2853 IBasicVideo
* pBasicVideo
;
2856 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pBufferSize
, pDIBImage
);
2858 EnterCriticalSection(&This
->cs
);
2860 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2863 hr
= IBasicVideo_GetCurrentImage(pBasicVideo
, pBufferSize
, pDIBImage
);
2865 LeaveCriticalSection(&This
->cs
);
2870 static HRESULT WINAPI
BasicVideo_IsUsingDefaultSource(IBasicVideo
*iface
) {
2871 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2872 IBasicVideo
* pBasicVideo
;
2875 TRACE("(%p/%p)->()\n", This
, iface
);
2877 EnterCriticalSection(&This
->cs
);
2879 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2882 hr
= IBasicVideo_IsUsingDefaultSource(pBasicVideo
);
2884 LeaveCriticalSection(&This
->cs
);
2889 static HRESULT WINAPI
BasicVideo_IsUsingDefaultDestination(IBasicVideo
*iface
) {
2890 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2891 IBasicVideo
* pBasicVideo
;
2894 TRACE("(%p/%p)->()\n", This
, iface
);
2896 EnterCriticalSection(&This
->cs
);
2898 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2901 hr
= IBasicVideo_IsUsingDefaultDestination(pBasicVideo
);
2903 LeaveCriticalSection(&This
->cs
);
2909 static const IBasicVideoVtbl IBasicVideo_VTable
=
2911 BasicVideo_QueryInterface
,
2914 BasicVideo_GetTypeInfoCount
,
2915 BasicVideo_GetTypeInfo
,
2916 BasicVideo_GetIDsOfNames
,
2918 BasicVideo_get_AvgTimePerFrame
,
2919 BasicVideo_get_BitRate
,
2920 BasicVideo_get_BitErrorRate
,
2921 BasicVideo_get_VideoWidth
,
2922 BasicVideo_get_VideoHeight
,
2923 BasicVideo_put_SourceLeft
,
2924 BasicVideo_get_SourceLeft
,
2925 BasicVideo_put_SourceWidth
,
2926 BasicVideo_get_SourceWidth
,
2927 BasicVideo_put_SourceTop
,
2928 BasicVideo_get_SourceTop
,
2929 BasicVideo_put_SourceHeight
,
2930 BasicVideo_get_SourceHeight
,
2931 BasicVideo_put_DestinationLeft
,
2932 BasicVideo_get_DestinationLeft
,
2933 BasicVideo_put_DestinationWidth
,
2934 BasicVideo_get_DestinationWidth
,
2935 BasicVideo_put_DestinationTop
,
2936 BasicVideo_get_DestinationTop
,
2937 BasicVideo_put_DestinationHeight
,
2938 BasicVideo_get_DestinationHeight
,
2939 BasicVideo_SetSourcePosition
,
2940 BasicVideo_GetSourcePosition
,
2941 BasicVideo_SetDefaultSourcePosition
,
2942 BasicVideo_SetDestinationPosition
,
2943 BasicVideo_GetDestinationPosition
,
2944 BasicVideo_SetDefaultDestinationPosition
,
2945 BasicVideo_GetVideoSize
,
2946 BasicVideo_GetVideoPaletteEntries
,
2947 BasicVideo_GetCurrentImage
,
2948 BasicVideo_IsUsingDefaultSource
,
2949 BasicVideo_IsUsingDefaultDestination
2953 /*** IUnknown methods ***/
2954 static HRESULT WINAPI
VideoWindow_QueryInterface(IVideoWindow
*iface
,
2957 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2959 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2961 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2964 static ULONG WINAPI
VideoWindow_AddRef(IVideoWindow
*iface
) {
2965 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2967 TRACE("(%p/%p)->()\n", This
, iface
);
2969 return Filtergraph_AddRef(This
);
2972 static ULONG WINAPI
VideoWindow_Release(IVideoWindow
*iface
) {
2973 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2975 TRACE("(%p/%p)->()\n", This
, iface
);
2977 return Filtergraph_Release(This
);
2980 /*** IDispatch methods ***/
2981 static HRESULT WINAPI
VideoWindow_GetTypeInfoCount(IVideoWindow
*iface
,
2983 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2984 IVideoWindow
* pVideoWindow
;
2987 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
2989 EnterCriticalSection(&This
->cs
);
2991 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
2994 hr
= IVideoWindow_GetTypeInfoCount(pVideoWindow
, pctinfo
);
2996 LeaveCriticalSection(&This
->cs
);
3001 static HRESULT WINAPI
VideoWindow_GetTypeInfo(IVideoWindow
*iface
,
3004 ITypeInfo
**ppTInfo
) {
3005 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3006 IVideoWindow
* pVideoWindow
;
3009 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
3011 EnterCriticalSection(&This
->cs
);
3013 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3016 hr
= IVideoWindow_GetTypeInfo(pVideoWindow
, iTInfo
, lcid
, ppTInfo
);
3018 LeaveCriticalSection(&This
->cs
);
3023 static HRESULT WINAPI
VideoWindow_GetIDsOfNames(IVideoWindow
*iface
,
3029 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3030 IVideoWindow
* pVideoWindow
;
3033 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3035 EnterCriticalSection(&This
->cs
);
3037 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3040 hr
= IVideoWindow_GetIDsOfNames(pVideoWindow
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3042 LeaveCriticalSection(&This
->cs
);
3047 static HRESULT WINAPI
VideoWindow_Invoke(IVideoWindow
*iface
,
3048 DISPID dispIdMember
,
3052 DISPPARAMS
*pDispParams
,
3054 EXCEPINFO
*pExepInfo
,
3056 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3057 IVideoWindow
* pVideoWindow
;
3060 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
);
3062 EnterCriticalSection(&This
->cs
);
3064 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3067 hr
= IVideoWindow_Invoke(pVideoWindow
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
3069 LeaveCriticalSection(&This
->cs
);
3075 /*** IVideoWindow methods ***/
3076 static HRESULT WINAPI
VideoWindow_put_Caption(IVideoWindow
*iface
,
3078 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3079 IVideoWindow
* pVideoWindow
;
3082 TRACE("(%p/%p)->(%s (%p))\n", This
, iface
, debugstr_w(strCaption
), strCaption
);
3084 EnterCriticalSection(&This
->cs
);
3086 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3089 hr
= IVideoWindow_put_Caption(pVideoWindow
, strCaption
);
3091 LeaveCriticalSection(&This
->cs
);
3096 static HRESULT WINAPI
VideoWindow_get_Caption(IVideoWindow
*iface
,
3098 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3099 IVideoWindow
* pVideoWindow
;
3102 TRACE("(%p/%p)->(%p)\n", This
, iface
, strCaption
);
3104 EnterCriticalSection(&This
->cs
);
3106 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3109 hr
= IVideoWindow_get_Caption(pVideoWindow
, strCaption
);
3111 LeaveCriticalSection(&This
->cs
);
3116 static HRESULT WINAPI
VideoWindow_put_WindowStyle(IVideoWindow
*iface
,
3118 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3119 IVideoWindow
* pVideoWindow
;
3122 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyle
);
3124 EnterCriticalSection(&This
->cs
);
3126 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3129 hr
= IVideoWindow_put_WindowStyle(pVideoWindow
, WindowStyle
);
3131 LeaveCriticalSection(&This
->cs
);
3136 static HRESULT WINAPI
VideoWindow_get_WindowStyle(IVideoWindow
*iface
,
3137 long *WindowStyle
) {
3138 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3139 IVideoWindow
* pVideoWindow
;
3142 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyle
);
3144 EnterCriticalSection(&This
->cs
);
3146 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3149 hr
= IVideoWindow_get_WindowStyle(pVideoWindow
, WindowStyle
);
3151 LeaveCriticalSection(&This
->cs
);
3156 static HRESULT WINAPI
VideoWindow_put_WindowStyleEx(IVideoWindow
*iface
,
3157 long WindowStyleEx
) {
3158 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3159 IVideoWindow
* pVideoWindow
;
3162 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyleEx
);
3164 EnterCriticalSection(&This
->cs
);
3166 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3169 hr
= IVideoWindow_put_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3171 LeaveCriticalSection(&This
->cs
);
3176 static HRESULT WINAPI
VideoWindow_get_WindowStyleEx(IVideoWindow
*iface
,
3177 long *WindowStyleEx
) {
3178 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3179 IVideoWindow
* pVideoWindow
;
3182 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyleEx
);
3184 EnterCriticalSection(&This
->cs
);
3186 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3189 hr
= IVideoWindow_get_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3191 LeaveCriticalSection(&This
->cs
);
3196 static HRESULT WINAPI
VideoWindow_put_AutoShow(IVideoWindow
*iface
,
3198 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3199 IVideoWindow
* pVideoWindow
;
3202 TRACE("(%p/%p)->(%ld)\n", This
, iface
, AutoShow
);
3204 EnterCriticalSection(&This
->cs
);
3206 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3209 hr
= IVideoWindow_put_AutoShow(pVideoWindow
, AutoShow
);
3211 LeaveCriticalSection(&This
->cs
);
3216 static HRESULT WINAPI
VideoWindow_get_AutoShow(IVideoWindow
*iface
,
3218 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3219 IVideoWindow
* pVideoWindow
;
3222 TRACE("(%p/%p)->(%p)\n", This
, iface
, AutoShow
);
3224 EnterCriticalSection(&This
->cs
);
3226 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3229 hr
= IVideoWindow_get_AutoShow(pVideoWindow
, AutoShow
);
3231 LeaveCriticalSection(&This
->cs
);
3236 static HRESULT WINAPI
VideoWindow_put_WindowState(IVideoWindow
*iface
,
3238 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3239 IVideoWindow
* pVideoWindow
;
3242 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowState
);
3244 EnterCriticalSection(&This
->cs
);
3246 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3249 hr
= IVideoWindow_put_WindowState(pVideoWindow
, WindowState
);
3251 LeaveCriticalSection(&This
->cs
);
3256 static HRESULT WINAPI
VideoWindow_get_WindowState(IVideoWindow
*iface
,
3257 long *WindowState
) {
3258 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3259 IVideoWindow
* pVideoWindow
;
3262 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowState
);
3264 EnterCriticalSection(&This
->cs
);
3266 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3269 hr
= IVideoWindow_get_WindowState(pVideoWindow
, WindowState
);
3271 LeaveCriticalSection(&This
->cs
);
3276 static HRESULT WINAPI
VideoWindow_put_BackgroundPalette(IVideoWindow
*iface
,
3277 long BackgroundPalette
) {
3278 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3279 IVideoWindow
* pVideoWindow
;
3282 TRACE("(%p/%p)->(%ld)\n", This
, iface
, BackgroundPalette
);
3284 EnterCriticalSection(&This
->cs
);
3286 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3289 hr
= IVideoWindow_put_BackgroundPalette(pVideoWindow
, BackgroundPalette
);
3291 LeaveCriticalSection(&This
->cs
);
3296 static HRESULT WINAPI
VideoWindow_get_BackgroundPalette(IVideoWindow
*iface
,
3297 long *pBackgroundPalette
) {
3298 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3299 IVideoWindow
* pVideoWindow
;
3302 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBackgroundPalette
);
3304 EnterCriticalSection(&This
->cs
);
3306 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3309 hr
= IVideoWindow_get_BackgroundPalette(pVideoWindow
, pBackgroundPalette
);
3311 LeaveCriticalSection(&This
->cs
);
3316 static HRESULT WINAPI
VideoWindow_put_Visible(IVideoWindow
*iface
,
3318 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3319 IVideoWindow
* pVideoWindow
;
3322 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Visible
);
3324 EnterCriticalSection(&This
->cs
);
3326 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3329 hr
= IVideoWindow_put_Visible(pVideoWindow
, Visible
);
3331 LeaveCriticalSection(&This
->cs
);
3336 static HRESULT WINAPI
VideoWindow_get_Visible(IVideoWindow
*iface
,
3338 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3339 IVideoWindow
* pVideoWindow
;
3342 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVisible
);
3344 EnterCriticalSection(&This
->cs
);
3346 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3349 hr
= IVideoWindow_get_Visible(pVideoWindow
, pVisible
);
3351 LeaveCriticalSection(&This
->cs
);
3356 static HRESULT WINAPI
VideoWindow_put_Left(IVideoWindow
*iface
,
3358 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3359 IVideoWindow
* pVideoWindow
;
3362 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Left
);
3364 EnterCriticalSection(&This
->cs
);
3366 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3369 hr
= IVideoWindow_put_Left(pVideoWindow
, Left
);
3371 LeaveCriticalSection(&This
->cs
);
3376 static HRESULT WINAPI
VideoWindow_get_Left(IVideoWindow
*iface
,
3378 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3379 IVideoWindow
* pVideoWindow
;
3382 TRACE("(%p/%p)->(%p)\n", This
, iface
, pLeft
);
3384 EnterCriticalSection(&This
->cs
);
3386 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3389 hr
= IVideoWindow_get_Left(pVideoWindow
, pLeft
);
3391 LeaveCriticalSection(&This
->cs
);
3396 static HRESULT WINAPI
VideoWindow_put_Width(IVideoWindow
*iface
,
3398 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3399 IVideoWindow
* pVideoWindow
;
3402 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Width
);
3404 EnterCriticalSection(&This
->cs
);
3406 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3409 hr
= IVideoWindow_put_Width(pVideoWindow
, Width
);
3411 LeaveCriticalSection(&This
->cs
);
3416 static HRESULT WINAPI
VideoWindow_get_Width(IVideoWindow
*iface
,
3418 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3419 IVideoWindow
* pVideoWindow
;
3422 TRACE("(%p/%p)->(%p)\n", This
, iface
, pWidth
);
3424 EnterCriticalSection(&This
->cs
);
3426 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3429 hr
= IVideoWindow_get_Width(pVideoWindow
, pWidth
);
3431 LeaveCriticalSection(&This
->cs
);
3436 static HRESULT WINAPI
VideoWindow_put_Top(IVideoWindow
*iface
,
3438 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3439 IVideoWindow
* pVideoWindow
;
3442 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Top
);
3444 EnterCriticalSection(&This
->cs
);
3446 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3449 hr
= IVideoWindow_put_Top(pVideoWindow
, Top
);
3451 LeaveCriticalSection(&This
->cs
);
3456 static HRESULT WINAPI
VideoWindow_get_Top(IVideoWindow
*iface
,
3458 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3459 IVideoWindow
* pVideoWindow
;
3462 TRACE("(%p/%p)->(%p)\n", This
, iface
, pTop
);
3464 EnterCriticalSection(&This
->cs
);
3466 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3469 hr
= IVideoWindow_get_Top(pVideoWindow
, pTop
);
3471 LeaveCriticalSection(&This
->cs
);
3476 static HRESULT WINAPI
VideoWindow_put_Height(IVideoWindow
*iface
,
3478 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3479 IVideoWindow
* pVideoWindow
;
3482 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Height
);
3484 EnterCriticalSection(&This
->cs
);
3486 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3489 hr
= IVideoWindow_put_Height(pVideoWindow
, Height
);
3491 LeaveCriticalSection(&This
->cs
);
3496 static HRESULT WINAPI
VideoWindow_get_Height(IVideoWindow
*iface
,
3498 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3499 IVideoWindow
* pVideoWindow
;
3502 TRACE("(%p/%p)->(%p)\n", This
, iface
, pHeight
);
3504 EnterCriticalSection(&This
->cs
);
3506 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3509 hr
= IVideoWindow_get_Height(pVideoWindow
, pHeight
);
3511 LeaveCriticalSection(&This
->cs
);
3516 static HRESULT WINAPI
VideoWindow_put_Owner(IVideoWindow
*iface
,
3518 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3519 IVideoWindow
* pVideoWindow
;
3522 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Owner
);
3524 EnterCriticalSection(&This
->cs
);
3526 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3529 hr
= IVideoWindow_put_Owner(pVideoWindow
, Owner
);
3531 LeaveCriticalSection(&This
->cs
);
3536 static HRESULT WINAPI
VideoWindow_get_Owner(IVideoWindow
*iface
,
3538 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3539 IVideoWindow
* pVideoWindow
;
3542 TRACE("(%p/%p)->(%p)\n", This
, iface
, Owner
);
3544 EnterCriticalSection(&This
->cs
);
3546 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3549 hr
= IVideoWindow_get_Owner(pVideoWindow
, Owner
);
3551 LeaveCriticalSection(&This
->cs
);
3556 static HRESULT WINAPI
VideoWindow_put_MessageDrain(IVideoWindow
*iface
,
3558 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3559 IVideoWindow
* pVideoWindow
;
3562 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Drain
);
3564 EnterCriticalSection(&This
->cs
);
3566 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3569 hr
= IVideoWindow_put_MessageDrain(pVideoWindow
, Drain
);
3571 LeaveCriticalSection(&This
->cs
);
3576 static HRESULT WINAPI
VideoWindow_get_MessageDrain(IVideoWindow
*iface
,
3578 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3579 IVideoWindow
* pVideoWindow
;
3582 TRACE("(%p/%p)->(%p)\n", This
, iface
, Drain
);
3584 EnterCriticalSection(&This
->cs
);
3586 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3589 hr
= IVideoWindow_get_MessageDrain(pVideoWindow
, Drain
);
3591 LeaveCriticalSection(&This
->cs
);
3596 static HRESULT WINAPI
VideoWindow_get_BorderColor(IVideoWindow
*iface
,
3598 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3599 IVideoWindow
* pVideoWindow
;
3602 TRACE("(%p/%p)->(%p)\n", This
, iface
, Color
);
3604 EnterCriticalSection(&This
->cs
);
3606 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3609 hr
= IVideoWindow_get_BorderColor(pVideoWindow
, Color
);
3611 LeaveCriticalSection(&This
->cs
);
3616 static HRESULT WINAPI
VideoWindow_put_BorderColor(IVideoWindow
*iface
,
3618 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3619 IVideoWindow
* pVideoWindow
;
3622 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Color
);
3624 EnterCriticalSection(&This
->cs
);
3626 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3629 hr
= IVideoWindow_put_BorderColor(pVideoWindow
, Color
);
3631 LeaveCriticalSection(&This
->cs
);
3636 static HRESULT WINAPI
VideoWindow_get_FullScreenMode(IVideoWindow
*iface
,
3637 long *FullScreenMode
) {
3638 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3639 IVideoWindow
* pVideoWindow
;
3642 TRACE("(%p/%p)->(%p)\n", This
, iface
, FullScreenMode
);
3644 EnterCriticalSection(&This
->cs
);
3646 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3649 hr
= IVideoWindow_get_FullScreenMode(pVideoWindow
, FullScreenMode
);
3651 LeaveCriticalSection(&This
->cs
);
3656 static HRESULT WINAPI
VideoWindow_put_FullScreenMode(IVideoWindow
*iface
,
3657 long FullScreenMode
) {
3658 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3659 IVideoWindow
* pVideoWindow
;
3662 TRACE("(%p/%p)->(%ld)\n", This
, iface
, FullScreenMode
);
3664 EnterCriticalSection(&This
->cs
);
3666 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3669 hr
= IVideoWindow_put_FullScreenMode(pVideoWindow
, FullScreenMode
);
3671 LeaveCriticalSection(&This
->cs
);
3676 static HRESULT WINAPI
VideoWindow_SetWindowForeground(IVideoWindow
*iface
,
3678 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3679 IVideoWindow
* pVideoWindow
;
3682 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Focus
);
3684 EnterCriticalSection(&This
->cs
);
3686 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3689 hr
= IVideoWindow_SetWindowForeground(pVideoWindow
, Focus
);
3691 LeaveCriticalSection(&This
->cs
);
3696 static HRESULT WINAPI
VideoWindow_NotifyOwnerMessage(IVideoWindow
*iface
,
3701 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3702 IVideoWindow
* pVideoWindow
;
3705 TRACE("(%p/%p)->(%08x, %ld, %08lx, %08lx)\n", This
, iface
, (DWORD
) hwnd
, uMsg
, wParam
, lParam
);
3707 EnterCriticalSection(&This
->cs
);
3709 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3712 hr
= IVideoWindow_NotifyOwnerMessage(pVideoWindow
, hwnd
, uMsg
, wParam
, lParam
);
3714 LeaveCriticalSection(&This
->cs
);
3719 static HRESULT WINAPI
VideoWindow_SetWindowPosition(IVideoWindow
*iface
,
3724 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3725 IVideoWindow
* pVideoWindow
;
3728 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
3730 EnterCriticalSection(&This
->cs
);
3732 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3735 hr
= IVideoWindow_SetWindowPosition(pVideoWindow
, Left
, Top
, Width
, Height
);
3737 LeaveCriticalSection(&This
->cs
);
3742 static HRESULT WINAPI
VideoWindow_GetWindowPosition(IVideoWindow
*iface
,
3747 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3748 IVideoWindow
* pVideoWindow
;
3751 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3753 EnterCriticalSection(&This
->cs
);
3755 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3758 hr
= IVideoWindow_GetWindowPosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3760 LeaveCriticalSection(&This
->cs
);
3765 static HRESULT WINAPI
VideoWindow_GetMinIdealImageSize(IVideoWindow
*iface
,
3768 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3769 IVideoWindow
* pVideoWindow
;
3772 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3774 EnterCriticalSection(&This
->cs
);
3776 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3779 hr
= IVideoWindow_GetMinIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3781 LeaveCriticalSection(&This
->cs
);
3786 static HRESULT WINAPI
VideoWindow_GetMaxIdealImageSize(IVideoWindow
*iface
,
3789 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3790 IVideoWindow
* pVideoWindow
;
3793 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3795 EnterCriticalSection(&This
->cs
);
3797 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3800 hr
= IVideoWindow_GetMaxIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3802 LeaveCriticalSection(&This
->cs
);
3807 static HRESULT WINAPI
VideoWindow_GetRestorePosition(IVideoWindow
*iface
,
3812 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3813 IVideoWindow
* pVideoWindow
;
3816 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3818 EnterCriticalSection(&This
->cs
);
3820 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3823 hr
= IVideoWindow_GetRestorePosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3825 LeaveCriticalSection(&This
->cs
);
3830 static HRESULT WINAPI
VideoWindow_HideCursor(IVideoWindow
*iface
,
3832 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3833 IVideoWindow
* pVideoWindow
;
3836 TRACE("(%p/%p)->(%ld)\n", This
, iface
, HideCursor
);
3838 EnterCriticalSection(&This
->cs
);
3840 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3843 hr
= IVideoWindow_HideCursor(pVideoWindow
, HideCursor
);
3845 LeaveCriticalSection(&This
->cs
);
3850 static HRESULT WINAPI
VideoWindow_IsCursorHidden(IVideoWindow
*iface
,
3851 long *CursorHidden
) {
3852 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3853 IVideoWindow
* pVideoWindow
;
3856 TRACE("(%p/%p)->(%p)\n", This
, iface
, CursorHidden
);
3858 EnterCriticalSection(&This
->cs
);
3860 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3863 hr
= IVideoWindow_IsCursorHidden(pVideoWindow
, CursorHidden
);
3865 LeaveCriticalSection(&This
->cs
);
3871 static const IVideoWindowVtbl IVideoWindow_VTable
=
3873 VideoWindow_QueryInterface
,
3875 VideoWindow_Release
,
3876 VideoWindow_GetTypeInfoCount
,
3877 VideoWindow_GetTypeInfo
,
3878 VideoWindow_GetIDsOfNames
,
3880 VideoWindow_put_Caption
,
3881 VideoWindow_get_Caption
,
3882 VideoWindow_put_WindowStyle
,
3883 VideoWindow_get_WindowStyle
,
3884 VideoWindow_put_WindowStyleEx
,
3885 VideoWindow_get_WindowStyleEx
,
3886 VideoWindow_put_AutoShow
,
3887 VideoWindow_get_AutoShow
,
3888 VideoWindow_put_WindowState
,
3889 VideoWindow_get_WindowState
,
3890 VideoWindow_put_BackgroundPalette
,
3891 VideoWindow_get_BackgroundPalette
,
3892 VideoWindow_put_Visible
,
3893 VideoWindow_get_Visible
,
3894 VideoWindow_put_Left
,
3895 VideoWindow_get_Left
,
3896 VideoWindow_put_Width
,
3897 VideoWindow_get_Width
,
3898 VideoWindow_put_Top
,
3899 VideoWindow_get_Top
,
3900 VideoWindow_put_Height
,
3901 VideoWindow_get_Height
,
3902 VideoWindow_put_Owner
,
3903 VideoWindow_get_Owner
,
3904 VideoWindow_put_MessageDrain
,
3905 VideoWindow_get_MessageDrain
,
3906 VideoWindow_get_BorderColor
,
3907 VideoWindow_put_BorderColor
,
3908 VideoWindow_get_FullScreenMode
,
3909 VideoWindow_put_FullScreenMode
,
3910 VideoWindow_SetWindowForeground
,
3911 VideoWindow_NotifyOwnerMessage
,
3912 VideoWindow_SetWindowPosition
,
3913 VideoWindow_GetWindowPosition
,
3914 VideoWindow_GetMinIdealImageSize
,
3915 VideoWindow_GetMaxIdealImageSize
,
3916 VideoWindow_GetRestorePosition
,
3917 VideoWindow_HideCursor
,
3918 VideoWindow_IsCursorHidden
3922 /*** IUnknown methods ***/
3923 static HRESULT WINAPI
MediaEvent_QueryInterface(IMediaEventEx
*iface
,
3926 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3928 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
3930 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
3933 static ULONG WINAPI
MediaEvent_AddRef(IMediaEventEx
*iface
) {
3934 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3936 TRACE("(%p/%p)->()\n", This
, iface
);
3938 return Filtergraph_AddRef(This
);
3941 static ULONG WINAPI
MediaEvent_Release(IMediaEventEx
*iface
) {
3942 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3944 TRACE("(%p/%p)->()\n", This
, iface
);
3946 return Filtergraph_Release(This
);
3949 /*** IDispatch methods ***/
3950 static HRESULT WINAPI
MediaEvent_GetTypeInfoCount(IMediaEventEx
*iface
,
3952 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3954 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
3959 static HRESULT WINAPI
MediaEvent_GetTypeInfo(IMediaEventEx
*iface
,
3962 ITypeInfo
**ppTInfo
) {
3963 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3965 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
3970 static HRESULT WINAPI
MediaEvent_GetIDsOfNames(IMediaEventEx
*iface
,
3976 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3978 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3983 static HRESULT WINAPI
MediaEvent_Invoke(IMediaEventEx
*iface
,
3984 DISPID dispIdMember
,
3988 DISPPARAMS
*pDispParams
,
3990 EXCEPINFO
*pExepInfo
,
3992 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3994 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
);
3999 /*** IMediaEvent methods ***/
4000 static HRESULT WINAPI
MediaEvent_GetEventHandle(IMediaEventEx
*iface
,
4002 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4004 TRACE("(%p/%p)->(%p)\n", This
, iface
, hEvent
);
4006 *hEvent
= (OAEVENT
)This
->evqueue
.msg_event
;
4011 static HRESULT WINAPI
MediaEvent_GetEvent(IMediaEventEx
*iface
,
4016 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4019 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This
, iface
, lEventCode
, lParam1
, lParam2
, msTimeout
);
4021 if (EventsQueue_GetEvent(&This
->evqueue
, &evt
, msTimeout
))
4023 *lEventCode
= evt
.lEventCode
;
4024 *lParam1
= evt
.lParam1
;
4025 *lParam2
= evt
.lParam2
;
4033 static HRESULT WINAPI
MediaEvent_WaitForCompletion(IMediaEventEx
*iface
,
4036 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4038 TRACE("(%p/%p)->(%ld, %p)\n", This
, iface
, msTimeout
, pEvCode
);
4040 if (WaitForSingleObject(This
->hEventCompletion
, msTimeout
) == WAIT_OBJECT_0
)
4042 *pEvCode
= This
->CompletionStatus
;
4050 static HRESULT WINAPI
MediaEvent_CancelDefaultHandling(IMediaEventEx
*iface
,
4052 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4054 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4056 if (lEvCode
== EC_COMPLETE
)
4057 This
->HandleEcComplete
= FALSE
;
4058 else if (lEvCode
== EC_REPAINT
)
4059 This
->HandleEcRepaint
= FALSE
;
4066 static HRESULT WINAPI
MediaEvent_RestoreDefaultHandling(IMediaEventEx
*iface
,
4068 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4070 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4072 if (lEvCode
== EC_COMPLETE
)
4073 This
->HandleEcComplete
= TRUE
;
4074 else if (lEvCode
== EC_REPAINT
)
4075 This
->HandleEcRepaint
= TRUE
;
4082 static HRESULT WINAPI
MediaEvent_FreeEventParams(IMediaEventEx
*iface
,
4086 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4088 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This
, iface
, lEvCode
, lParam1
, lParam2
);
4093 /*** IMediaEventEx methods ***/
4094 static HRESULT WINAPI
MediaEvent_SetNotifyWindow(IMediaEventEx
*iface
,
4097 LONG_PTR lInstanceData
) {
4098 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4100 TRACE("(%p/%p)->(%08x, %ld, %08lx)\n", This
, iface
, (DWORD
) hwnd
, lMsg
, lInstanceData
);
4102 This
->notif
.hWnd
= (HWND
)hwnd
;
4103 This
->notif
.msg
= lMsg
;
4104 This
->notif
.instance
= (long) lInstanceData
;
4109 static HRESULT WINAPI
MediaEvent_SetNotifyFlags(IMediaEventEx
*iface
,
4110 long lNoNotifyFlags
) {
4111 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4113 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lNoNotifyFlags
);
4115 if ((lNoNotifyFlags
!= 0) && (lNoNotifyFlags
!= 1))
4116 return E_INVALIDARG
;
4118 This
->notif
.disabled
= lNoNotifyFlags
;
4123 static HRESULT WINAPI
MediaEvent_GetNotifyFlags(IMediaEventEx
*iface
,
4124 long *lplNoNotifyFlags
) {
4125 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4127 TRACE("(%p/%p)->(%p)\n", This
, iface
, lplNoNotifyFlags
);
4129 if (!lplNoNotifyFlags
)
4132 *lplNoNotifyFlags
= This
->notif
.disabled
;
4138 static const IMediaEventExVtbl IMediaEventEx_VTable
=
4140 MediaEvent_QueryInterface
,
4143 MediaEvent_GetTypeInfoCount
,
4144 MediaEvent_GetTypeInfo
,
4145 MediaEvent_GetIDsOfNames
,
4147 MediaEvent_GetEventHandle
,
4148 MediaEvent_GetEvent
,
4149 MediaEvent_WaitForCompletion
,
4150 MediaEvent_CancelDefaultHandling
,
4151 MediaEvent_RestoreDefaultHandling
,
4152 MediaEvent_FreeEventParams
,
4153 MediaEvent_SetNotifyWindow
,
4154 MediaEvent_SetNotifyFlags
,
4155 MediaEvent_GetNotifyFlags
4159 static HRESULT WINAPI
MediaFilter_QueryInterface(IMediaFilter
*iface
, REFIID riid
, LPVOID
*ppv
)
4161 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4163 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4166 static ULONG WINAPI
MediaFilter_AddRef(IMediaFilter
*iface
)
4168 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4170 return Filtergraph_AddRef(This
);
4173 static ULONG WINAPI
MediaFilter_Release(IMediaFilter
*iface
)
4175 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4177 return Filtergraph_Release(This
);
4180 static HRESULT WINAPI
MediaFilter_GetClassID(IMediaFilter
*iface
, CLSID
* pClassID
)
4182 FIXME("(%p): stub\n", pClassID
);
4187 static HRESULT WINAPI
MediaFilter_Stop(IMediaFilter
*iface
)
4189 FIXME("(): stub\n");
4194 static HRESULT WINAPI
MediaFilter_Pause(IMediaFilter
*iface
)
4196 FIXME("(): stub\n");
4201 static HRESULT WINAPI
MediaFilter_Run(IMediaFilter
*iface
, REFERENCE_TIME tStart
)
4203 FIXME("(0x%s): stub\n", wine_dbgstr_longlong(tStart
));
4208 static HRESULT WINAPI
MediaFilter_GetState(IMediaFilter
*iface
, DWORD dwMsTimeout
, FILTER_STATE
* pState
)
4210 FIXME("(%d, %p): stub\n", dwMsTimeout
, pState
);
4215 static HRESULT WINAPI
MediaFilter_SetSyncSource(IMediaFilter
*iface
, IReferenceClock
*pClock
)
4217 FIXME("(%p): stub\n", pClock
);
4222 static HRESULT WINAPI
MediaFilter_GetSyncSource(IMediaFilter
*iface
, IReferenceClock
**ppClock
)
4224 FIXME("(%p): stub\n", ppClock
);
4229 static const IMediaFilterVtbl IMediaFilter_VTable
=
4231 MediaFilter_QueryInterface
,
4233 MediaFilter_Release
,
4234 MediaFilter_GetClassID
,
4238 MediaFilter_GetState
,
4239 MediaFilter_SetSyncSource
,
4240 MediaFilter_GetSyncSource
4243 static HRESULT WINAPI
MediaEventSink_QueryInterface(IMediaEventSink
*iface
, REFIID riid
, LPVOID
*ppv
)
4245 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4247 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4250 static ULONG WINAPI
MediaEventSink_AddRef(IMediaEventSink
*iface
)
4252 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4254 return Filtergraph_AddRef(This
);
4257 static ULONG WINAPI
MediaEventSink_Release(IMediaEventSink
*iface
)
4259 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4261 return Filtergraph_Release(This
);
4264 static HRESULT WINAPI
MediaEventSink_Notify(IMediaEventSink
*iface
, long EventCode
, LONG_PTR EventParam1
, LONG_PTR EventParam2
)
4266 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4269 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This
, iface
, EventCode
, EventParam1
, EventParam2
);
4271 /* We need thread safety here, let's use the events queue's one */
4272 EnterCriticalSection(&This
->evqueue
.msg_crst
);
4274 if ((EventCode
== EC_COMPLETE
) && This
->HandleEcComplete
)
4276 TRACE("Process EC_COMPLETE notification\n");
4277 if (++This
->EcCompleteCount
== This
->nRenderers
)
4279 evt
.lEventCode
= EC_COMPLETE
;
4282 TRACE("Send EC_COMPLETE to app\n");
4283 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4284 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4286 TRACE("Send Window message\n");
4287 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4289 This
->CompletionStatus
= EC_COMPLETE
;
4290 SetEvent(This
->hEventCompletion
);
4293 else if ((EventCode
== EC_REPAINT
) && This
->HandleEcRepaint
)
4295 /* FIXME: Not handled yet */
4299 evt
.lEventCode
= EventCode
;
4300 evt
.lParam1
= EventParam1
;
4301 evt
.lParam2
= EventParam2
;
4302 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4303 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4304 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4307 LeaveCriticalSection(&This
->evqueue
.msg_crst
);
4311 static const IMediaEventSinkVtbl IMediaEventSink_VTable
=
4313 MediaEventSink_QueryInterface
,
4314 MediaEventSink_AddRef
,
4315 MediaEventSink_Release
,
4316 MediaEventSink_Notify
4319 static HRESULT WINAPI
GraphConfig_QueryInterface(IGraphConfig
*iface
, REFIID riid
, LPVOID
*ppv
)
4321 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4323 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4326 static ULONG WINAPI
GraphConfig_AddRef(IGraphConfig
*iface
)
4328 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4330 return Filtergraph_AddRef(This
);
4333 static ULONG WINAPI
GraphConfig_Release(IGraphConfig
*iface
)
4335 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4337 return Filtergraph_Release(This
);
4340 static HRESULT WINAPI
GraphConfig_Reconnect(IGraphConfig
*iface
,
4343 const AM_MEDIA_TYPE
* pmtFirstConnection
,
4344 IBaseFilter
* pUsingFilter
,
4348 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4350 FIXME("(%p)->(%p, %p, %p, %p, %p, %x): stub!\n", This
, pOutputPin
, pInputPin
, pmtFirstConnection
, pUsingFilter
, hAbortEvent
, dwFlags
);
4355 static HRESULT WINAPI
GraphConfig_Reconfigure(IGraphConfig
*iface
,
4356 IGraphConfigCallback
* pCallback
,
4361 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4363 FIXME("(%p)->(%p, %p, %x, %p): stub!\n", This
, pCallback
, pvContext
, dwFlags
, hAbortEvent
);
4368 static HRESULT WINAPI
GraphConfig_AddFilterToCache(IGraphConfig
*iface
,
4369 IBaseFilter
* pFilter
)
4371 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4373 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4378 static HRESULT WINAPI
GraphConfig_EnumCacheFilter(IGraphConfig
*iface
,
4379 IEnumFilters
** pEnum
)
4381 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4383 FIXME("(%p)->(%p): stub!\n", This
, pEnum
);
4388 static HRESULT WINAPI
GraphConfig_RemoveFilterFromCache(IGraphConfig
*iface
,
4389 IBaseFilter
* pFilter
)
4391 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4393 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4398 static HRESULT WINAPI
GraphConfig_GetStartTime(IGraphConfig
*iface
,
4399 REFERENCE_TIME
* prtStart
)
4401 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4403 FIXME("(%p)->(%p): stub!\n", This
, prtStart
);
4408 static HRESULT WINAPI
GraphConfig_PushThroughData(IGraphConfig
*iface
,
4410 IPinConnection
* pConnection
,
4413 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4415 FIXME("(%p)->(%p, %p, %p): stub!\n", This
, pOutputPin
, pConnection
, hEventAbort
);
4420 static HRESULT WINAPI
GraphConfig_SetFilterFlags(IGraphConfig
*iface
,
4421 IBaseFilter
* pFilter
,
4424 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4426 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4431 static HRESULT WINAPI
GraphConfig_GetFilterFlags(IGraphConfig
*iface
,
4432 IBaseFilter
* pFilter
,
4435 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4437 FIXME("(%p)->(%p, %p): stub!\n", This
, pFilter
, dwFlags
);
4442 static HRESULT WINAPI
GraphConfig_RemoveFilterEx(IGraphConfig
*iface
,
4443 IBaseFilter
* pFilter
,
4446 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4448 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4453 static const IGraphConfigVtbl IGraphConfig_VTable
=
4455 GraphConfig_QueryInterface
,
4457 GraphConfig_Release
,
4458 GraphConfig_Reconnect
,
4459 GraphConfig_Reconfigure
,
4460 GraphConfig_AddFilterToCache
,
4461 GraphConfig_EnumCacheFilter
,
4462 GraphConfig_RemoveFilterFromCache
,
4463 GraphConfig_GetStartTime
,
4464 GraphConfig_PushThroughData
,
4465 GraphConfig_SetFilterFlags
,
4466 GraphConfig_GetFilterFlags
,
4467 GraphConfig_RemoveFilterEx
4470 /* This is the only function that actually creates a FilterGraph class... */
4471 HRESULT
FilterGraph_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4473 IFilterGraphImpl
*fimpl
;
4476 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
4479 return CLASS_E_NOAGGREGATION
;
4481 fimpl
= HeapAlloc(GetProcessHeap(), 0, sizeof(*fimpl
));
4482 fimpl
->IGraphBuilder_vtbl
= &IGraphBuilder_VTable
;
4483 fimpl
->IMediaControl_vtbl
= &IMediaControl_VTable
;
4484 fimpl
->IMediaSeeking_vtbl
= &IMediaSeeking_VTable
;
4485 fimpl
->IBasicAudio_vtbl
= &IBasicAudio_VTable
;
4486 fimpl
->IBasicVideo_vtbl
= &IBasicVideo_VTable
;
4487 fimpl
->IVideoWindow_vtbl
= &IVideoWindow_VTable
;
4488 fimpl
->IMediaEventEx_vtbl
= &IMediaEventEx_VTable
;
4489 fimpl
->IMediaFilter_vtbl
= &IMediaFilter_VTable
;
4490 fimpl
->IMediaEventSink_vtbl
= &IMediaEventSink_VTable
;
4491 fimpl
->IGraphConfig_vtbl
= &IGraphConfig_VTable
;
4492 fimpl
->IMediaPosition_vtbl
= &IMediaPosition_VTable
;
4494 fimpl
->ppFiltersInGraph
= NULL
;
4495 fimpl
->pFilterNames
= NULL
;
4496 fimpl
->nFilters
= 0;
4497 fimpl
->filterCapacity
= 0;
4498 fimpl
->nameIndex
= 1;
4499 fimpl
->hEventCompletion
= CreateEventW(0, TRUE
, FALSE
, 0);
4500 fimpl
->HandleEcComplete
= TRUE
;
4501 fimpl
->HandleEcRepaint
= TRUE
;
4502 fimpl
->notif
.hWnd
= 0;
4503 fimpl
->notif
.disabled
= FALSE
;
4504 fimpl
->nRenderers
= 0;
4505 fimpl
->EcCompleteCount
= 0;
4506 fimpl
->state
= State_Stopped
;
4507 EventsQueue_Init(&fimpl
->evqueue
);
4508 InitializeCriticalSection(&fimpl
->cs
);
4509 fimpl
->nItfCacheEntries
= 0;
4511 hr
= CoCreateInstance(&CLSID_FilterMapper
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IFilterMapper2
, (LPVOID
*)&fimpl
->pFilterMapper2
);
4513 ERR("Unable to create filter mapper (%x)\n", hr
);
4521 HRESULT
FilterGraphNoThread_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4523 FIXME("CLSID_FilterGraphNoThread partially implemented - Forwarding to CLSID_FilterGraph\n");
4524 return FilterGraph_create(pUnkOuter
, ppObj
);