1 /* DirectShow FilterGraph object (QUARTZ.DLL)
3 * Copyright 2002 Lionel Ulmer
4 * Copyright 2004 Christian Costa
6 * This file contains the (internal) driver registration functions,
7 * driver enumeration APIs and DirectDraw creation functions.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
33 #include "wine/debug.h"
34 #include "quartz_private.h"
40 #include "wine/unicode.h"
43 WINE_DEFAULT_DEBUG_CHANNEL(quartz
);
46 HWND hWnd
; /* Target window */
47 long msg
; /* User window message */
48 long instance
; /* User data */
49 int disabled
; /* Disabled messages posting */
53 long lEventCode
; /* Event code */
54 LONG_PTR lParam1
; /* Param1 */
55 LONG_PTR lParam2
; /* Param2 */
58 /* messages ring implementation for queuing events (taken from winmm) */
59 #define EVENTS_RING_BUFFER_INCREMENT 64
65 CRITICAL_SECTION msg_crst
;
66 HANDLE msg_event
; /* Signaled for no empty queue */
69 static int EventsQueue_Init(EventsQueue
* omr
)
73 omr
->msg_event
= CreateEventW(NULL
, TRUE
, FALSE
, NULL
);
74 omr
->ring_buffer_size
= EVENTS_RING_BUFFER_INCREMENT
;
75 omr
->messages
= CoTaskMemAlloc(omr
->ring_buffer_size
* sizeof(Event
));
76 ZeroMemory(omr
->messages
, omr
->ring_buffer_size
* sizeof(Event
));
78 InitializeCriticalSection(&omr
->msg_crst
);
79 omr
->msg_crst
.DebugInfo
->Spare
[0] = (DWORD_PTR
)(__FILE__
": EventsQueue.msg_crst");
83 static int EventsQueue_Destroy(EventsQueue
* omr
)
85 CloseHandle(omr
->msg_event
);
86 CoTaskMemFree(omr
->messages
);
87 omr
->msg_crst
.DebugInfo
->Spare
[0] = 0;
88 DeleteCriticalSection(&omr
->msg_crst
);
92 static int EventsQueue_PutEvent(EventsQueue
* omr
, Event
* evt
)
94 EnterCriticalSection(&omr
->msg_crst
);
95 if ((omr
->msg_toget
== ((omr
->msg_tosave
+ 1) % omr
->ring_buffer_size
)))
97 int old_ring_buffer_size
= omr
->ring_buffer_size
;
98 omr
->ring_buffer_size
+= EVENTS_RING_BUFFER_INCREMENT
;
99 TRACE("omr->ring_buffer_size=%d\n",omr
->ring_buffer_size
);
100 omr
->messages
= HeapReAlloc(GetProcessHeap(),0,omr
->messages
, omr
->ring_buffer_size
* sizeof(Event
));
101 /* Now we need to rearrange the ring buffer so that the new
102 buffers just allocated are in between omr->msg_tosave and
105 if (omr
->msg_tosave
< omr
->msg_toget
)
107 memmove(&(omr
->messages
[omr
->msg_toget
+ EVENTS_RING_BUFFER_INCREMENT
]),
108 &(omr
->messages
[omr
->msg_toget
]),
109 sizeof(Event
)*(old_ring_buffer_size
- omr
->msg_toget
)
111 omr
->msg_toget
+= EVENTS_RING_BUFFER_INCREMENT
;
114 omr
->messages
[omr
->msg_tosave
] = *evt
;
115 SetEvent(omr
->msg_event
);
116 omr
->msg_tosave
= (omr
->msg_tosave
+ 1) % omr
->ring_buffer_size
;
117 LeaveCriticalSection(&omr
->msg_crst
);
121 static int EventsQueue_GetEvent(EventsQueue
* omr
, Event
* evt
, long msTimeOut
)
123 if (WaitForSingleObject(omr
->msg_event
, msTimeOut
) != WAIT_OBJECT_0
)
126 EnterCriticalSection(&omr
->msg_crst
);
128 if (omr
->msg_toget
== omr
->msg_tosave
) /* buffer empty ? */
130 LeaveCriticalSection(&omr
->msg_crst
);
134 *evt
= omr
->messages
[omr
->msg_toget
];
135 omr
->msg_toget
= (omr
->msg_toget
+ 1) % omr
->ring_buffer_size
;
137 /* Mark the buffer as empty if needed */
138 if (omr
->msg_toget
== omr
->msg_tosave
) /* buffer empty ? */
139 ResetEvent(omr
->msg_event
);
141 LeaveCriticalSection(&omr
->msg_crst
);
145 #define MAX_ITF_CACHE_ENTRIES 3
146 typedef struct _ITF_CACHE_ENTRY
{
152 typedef struct _IFilterGraphImpl
{
153 const IGraphBuilderVtbl
*IGraphBuilder_vtbl
;
154 const IMediaControlVtbl
*IMediaControl_vtbl
;
155 const IMediaSeekingVtbl
*IMediaSeeking_vtbl
;
156 const IBasicAudioVtbl
*IBasicAudio_vtbl
;
157 const IBasicVideoVtbl
*IBasicVideo_vtbl
;
158 const IVideoWindowVtbl
*IVideoWindow_vtbl
;
159 const IMediaEventExVtbl
*IMediaEventEx_vtbl
;
160 const IMediaFilterVtbl
*IMediaFilter_vtbl
;
161 const IMediaEventSinkVtbl
*IMediaEventSink_vtbl
;
162 const IGraphConfigVtbl
*IGraphConfig_vtbl
;
163 const IMediaPositionVtbl
*IMediaPosition_vtbl
;
164 /* IAMGraphStreams */
172 /* IRegisterServiceProvider */
173 /* IResourceMananger */
174 /* IServiceProvider */
175 /* IVideoFrameStep */
178 IFilterMapper2
* pFilterMapper2
;
179 IBaseFilter
** ppFiltersInGraph
;
180 LPWSTR
* pFilterNames
;
185 HANDLE hEventCompletion
;
186 int CompletionStatus
;
190 int HandleEcComplete
;
194 ITF_CACHE_ENTRY ItfCacheEntries
[MAX_ITF_CACHE_ENTRIES
];
195 int nItfCacheEntries
;
199 static HRESULT
Filtergraph_QueryInterface(IFilterGraphImpl
*This
,
202 TRACE("(%p)->(%s (%p), %p)\n", This
, debugstr_guid(riid
), riid
, ppvObj
);
204 if (IsEqualGUID(&IID_IUnknown
, riid
) ||
205 IsEqualGUID(&IID_IFilterGraph
, riid
) ||
206 IsEqualGUID(&IID_IGraphBuilder
, riid
)) {
207 *ppvObj
= &(This
->IGraphBuilder_vtbl
);
208 TRACE(" returning IGraphBuilder interface (%p)\n", *ppvObj
);
209 } else if (IsEqualGUID(&IID_IMediaControl
, riid
)) {
210 *ppvObj
= &(This
->IMediaControl_vtbl
);
211 TRACE(" returning IMediaControl interface (%p)\n", *ppvObj
);
212 } else if (IsEqualGUID(&IID_IMediaSeeking
, riid
)) {
213 *ppvObj
= &(This
->IMediaSeeking_vtbl
);
214 TRACE(" returning IMediaSeeking interface (%p)\n", *ppvObj
);
215 } else if (IsEqualGUID(&IID_IBasicAudio
, riid
)) {
216 *ppvObj
= &(This
->IBasicAudio_vtbl
);
217 TRACE(" returning IBasicAudio interface (%p)\n", *ppvObj
);
218 } else if (IsEqualGUID(&IID_IBasicVideo
, riid
)) {
219 *ppvObj
= &(This
->IBasicVideo_vtbl
);
220 TRACE(" returning IBasicVideo interface (%p)\n", *ppvObj
);
221 } else if (IsEqualGUID(&IID_IVideoWindow
, riid
)) {
222 *ppvObj
= &(This
->IVideoWindow_vtbl
);
223 TRACE(" returning IVideoWindow interface (%p)\n", *ppvObj
);
224 } else if (IsEqualGUID(&IID_IMediaEvent
, riid
) ||
225 IsEqualGUID(&IID_IMediaEventEx
, riid
)) {
226 *ppvObj
= &(This
->IMediaEventEx_vtbl
);
227 TRACE(" returning IMediaEvent(Ex) interface (%p)\n", *ppvObj
);
228 } else if (IsEqualGUID(&IID_IMediaFilter
, riid
) ||
229 IsEqualGUID(&IID_IPersist
, riid
)) {
230 *ppvObj
= &(This
->IMediaFilter_vtbl
);
231 TRACE(" returning IMediaFilter interface (%p)\n", *ppvObj
);
232 } else if (IsEqualGUID(&IID_IMediaEventSink
, riid
)) {
233 *ppvObj
= &(This
->IMediaEventSink_vtbl
);
234 TRACE(" returning IMediaEventSink interface (%p)\n", *ppvObj
);
235 } else if (IsEqualGUID(&IID_IGraphConfig
, riid
)) {
236 *ppvObj
= &(This
->IGraphConfig_vtbl
);
237 TRACE(" returning IGraphConfig interface (%p)\n", *ppvObj
);
238 } else if (IsEqualGUID(&IID_IMediaPosition
, riid
)) {
239 *ppvObj
= &(This
->IMediaPosition_vtbl
);
240 TRACE(" returning IMediaPosition interface (%p)\n", *ppvObj
);
243 FIXME("unknown interface %s\n", debugstr_guid(riid
));
244 return E_NOINTERFACE
;
247 InterlockedIncrement(&This
->ref
);
251 static ULONG
Filtergraph_AddRef(IFilterGraphImpl
*This
) {
252 ULONG ref
= InterlockedIncrement(&This
->ref
);
254 TRACE("(%p)->(): new ref = %d\n", This
, ref
);
259 static ULONG
Filtergraph_Release(IFilterGraphImpl
*This
) {
260 ULONG ref
= InterlockedDecrement(&This
->ref
);
262 TRACE("(%p)->(): new ref = %d\n", This
, ref
);
266 for (i
= 0; i
< This
->nFilters
; i
++)
267 IBaseFilter_Release(This
->ppFiltersInGraph
[i
]);
268 for (i
= 0; i
< This
->nItfCacheEntries
; i
++)
269 IUnknown_Release(This
->ItfCacheEntries
[i
].iface
);
270 IFilterMapper2_Release(This
->pFilterMapper2
);
271 CloseHandle(This
->hEventCompletion
);
272 EventsQueue_Destroy(&This
->evqueue
);
273 This
->cs
.DebugInfo
->Spare
[0] = 0;
274 DeleteCriticalSection(&This
->cs
);
275 CoTaskMemFree(This
->ppFiltersInGraph
);
276 CoTaskMemFree(This
->pFilterNames
);
283 /*** IUnknown methods ***/
284 static HRESULT WINAPI
GraphBuilder_QueryInterface(IGraphBuilder
*iface
,
287 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
289 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
290 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
293 static ULONG WINAPI
GraphBuilder_AddRef(IGraphBuilder
*iface
) {
294 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
296 TRACE("(%p/%p)->() calling FilterGraph AddRef\n", This
, iface
);
298 return Filtergraph_AddRef(This
);
301 static ULONG WINAPI
GraphBuilder_Release(IGraphBuilder
*iface
) {
302 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
304 TRACE("(%p/%p)->() calling FilterGraph Release\n", This
, iface
);
306 return Filtergraph_Release(This
);
309 /*** IFilterGraph methods ***/
310 static HRESULT WINAPI
GraphBuilder_AddFilter(IGraphBuilder
*iface
,
311 IBaseFilter
*pFilter
,
313 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
316 WCHAR
* wszFilterName
= NULL
;
317 int duplicate_name
= FALSE
;
319 TRACE("(%p/%p)->(%p, %s (%p))\n", This
, iface
, pFilter
, debugstr_w(pName
), pName
);
321 wszFilterName
= (WCHAR
*) CoTaskMemAlloc( (pName
? strlenW(pName
) + 6 : 5) * sizeof(WCHAR
) );
325 /* Check if name already exists */
326 for(i
= 0; i
< This
->nFilters
; i
++)
327 if (!strcmpW(This
->pFilterNames
[i
], pName
))
329 duplicate_name
= TRUE
;
334 /* If no name given or name already existing, generate one */
335 if (!pName
|| duplicate_name
)
337 static const WCHAR wszFmt1
[] = {'%','s',' ','%','0','4','d',0};
338 static const WCHAR wszFmt2
[] = {'%','0','4','d',0};
340 for (j
= 0; j
< 10000 ; j
++)
344 sprintfW(wszFilterName
, wszFmt1
, pName
, This
->nameIndex
);
346 sprintfW(wszFilterName
, wszFmt2
, This
->nameIndex
);
347 TRACE("Generated name %s\n", debugstr_w(wszFilterName
));
349 /* Check if the generated name already exists */
350 for(i
= 0; i
< This
->nFilters
; i
++)
351 if (!strcmpW(This
->pFilterNames
[i
], wszFilterName
))
354 /* Compute next index and exit if generated name is suitable */
355 if (This
->nameIndex
++ == 10000)
357 if (i
== This
->nFilters
)
360 /* Unable to find a suitable name */
363 CoTaskMemFree(wszFilterName
);
364 return VFW_E_DUPLICATE_NAME
;
368 memcpy(wszFilterName
, pName
, (strlenW(pName
) + 1) * sizeof(WCHAR
));
370 if (This
->nFilters
+ 1 > This
->filterCapacity
)
372 int newCapacity
= This
->filterCapacity
? 2 * This
->filterCapacity
: 1;
373 IBaseFilter
** ppNewFilters
= CoTaskMemAlloc(newCapacity
* sizeof(IBaseFilter
*));
374 LPWSTR
* pNewNames
= CoTaskMemAlloc(newCapacity
* sizeof(LPWSTR
));
375 memcpy(ppNewFilters
, This
->ppFiltersInGraph
, This
->nFilters
* sizeof(IBaseFilter
*));
376 memcpy(pNewNames
, This
->pFilterNames
, This
->nFilters
* sizeof(LPWSTR
));
377 if (!This
->filterCapacity
)
379 CoTaskMemFree(This
->ppFiltersInGraph
);
380 CoTaskMemFree(This
->pFilterNames
);
382 This
->ppFiltersInGraph
= ppNewFilters
;
383 This
->pFilterNames
= pNewNames
;
384 This
->filterCapacity
= newCapacity
;
387 hr
= IBaseFilter_JoinFilterGraph(pFilter
, (IFilterGraph
*)This
, wszFilterName
);
391 IBaseFilter_AddRef(pFilter
);
392 This
->ppFiltersInGraph
[This
->nFilters
] = pFilter
;
393 This
->pFilterNames
[This
->nFilters
] = wszFilterName
;
397 CoTaskMemFree(wszFilterName
);
399 if (SUCCEEDED(hr
) && duplicate_name
)
400 return VFW_S_DUPLICATE_NAME
;
405 static HRESULT WINAPI
GraphBuilder_RemoveFilter(IGraphBuilder
*iface
,
406 IBaseFilter
*pFilter
) {
407 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
411 TRACE("(%p/%p)->(%p)\n", This
, iface
, pFilter
);
413 /* FIXME: check graph is stopped */
415 for (i
= 0; i
< This
->nFilters
; i
++)
417 if (This
->ppFiltersInGraph
[i
] == pFilter
)
419 IEnumPins
*penumpins
;
420 hr
= IBaseFilter_EnumPins(pFilter
, &penumpins
);
423 while(IEnumPins_Next(penumpins
, 1, &ppin
, NULL
) == S_OK
) {
424 IPin_Disconnect(ppin
);
427 IEnumPins_Release(penumpins
);
430 hr
= IBaseFilter_JoinFilterGraph(pFilter
, NULL
, This
->pFilterNames
[i
]);
433 IPin_Release(pFilter
);
434 CoTaskMemFree(This
->pFilterNames
[i
]);
435 memmove(This
->ppFiltersInGraph
+i
, This
->ppFiltersInGraph
+i
+1, sizeof(IBaseFilter
*)*(This
->nFilters
- 1 - i
));
436 memmove(This
->pFilterNames
+i
, This
->pFilterNames
+i
+1, sizeof(LPWSTR
)*(This
->nFilters
- 1 - i
));
438 /* Invalidate interfaces in the cache */
439 for (i
= 0; i
< This
->nItfCacheEntries
; i
++)
440 if (pFilter
== This
->ItfCacheEntries
[i
].filter
)
442 IUnknown_Release(This
->ItfCacheEntries
[i
].iface
);
443 This
->ItfCacheEntries
[i
].iface
= NULL
;
444 This
->ItfCacheEntries
[i
].filter
= NULL
;
452 return hr
; /* FIXME: check this error code */
455 static HRESULT WINAPI
GraphBuilder_EnumFilters(IGraphBuilder
*iface
,
456 IEnumFilters
**ppEnum
) {
457 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
459 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppEnum
);
461 return IEnumFiltersImpl_Construct(This
->ppFiltersInGraph
, This
->nFilters
, ppEnum
);
464 static HRESULT WINAPI
GraphBuilder_FindFilterByName(IGraphBuilder
*iface
,
466 IBaseFilter
**ppFilter
) {
467 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
470 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_w(pName
), pName
, ppFilter
);
474 for (i
= 0; i
< This
->nFilters
; i
++)
476 if (!strcmpW(pName
, This
->pFilterNames
[i
]))
478 *ppFilter
= This
->ppFiltersInGraph
[i
];
479 IBaseFilter_AddRef(*ppFilter
);
484 return E_FAIL
; /* FIXME: check this error code */
487 /* NOTE: despite the implication, it doesn't matter which
488 * way round you put in the input and output pins */
489 static HRESULT WINAPI
GraphBuilder_ConnectDirect(IGraphBuilder
*iface
,
492 const AM_MEDIA_TYPE
*pmt
) {
496 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
498 TRACE("(%p/%p)->(%p, %p, %p)\n", This
, iface
, ppinIn
, ppinOut
, pmt
);
500 /* FIXME: check pins are in graph */
502 if (TRACE_ON(quartz
))
506 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
510 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
511 IBaseFilter_Release(PinInfo
.pFilter
);
513 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
517 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
518 IBaseFilter_Release(PinInfo
.pFilter
);
521 hr
= IPin_QueryDirection(ppinIn
, &dir
);
524 if (dir
== PINDIR_INPUT
)
525 hr
= IPin_Connect(ppinOut
, ppinIn
, pmt
);
527 hr
= IPin_Connect(ppinIn
, ppinOut
, pmt
);
533 static HRESULT WINAPI
GraphBuilder_Reconnect(IGraphBuilder
*iface
,
535 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
536 IPin
*pConnectedTo
= NULL
;
538 PIN_DIRECTION pindir
;
540 IPin_QueryDirection(ppin
, &pindir
);
541 hr
= IPin_ConnectedTo(ppin
, &pConnectedTo
);
543 TRACE("Querying connected to failed: %x\n", hr
);
546 IPin_Disconnect(ppin
);
547 IPin_Disconnect(pConnectedTo
);
548 if (pindir
== PINDIR_INPUT
)
549 hr
= IPin_Connect(pConnectedTo
, ppin
, NULL
);
551 hr
= IPin_Connect(ppin
, pConnectedTo
, NULL
);
552 IPin_Release(pConnectedTo
);
554 ERR("Reconnecting pins failed, pins are not connected now..\n");
555 TRACE("(%p->%p) -- %p %p -> %x\n", iface
, This
, ppin
, pConnectedTo
, hr
);
559 static HRESULT WINAPI
GraphBuilder_Disconnect(IGraphBuilder
*iface
,
561 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
563 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppin
);
565 return IPin_Disconnect(ppin
);
568 static HRESULT WINAPI
GraphBuilder_SetDefaultSyncSource(IGraphBuilder
*iface
) {
569 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
571 TRACE("(%p/%p)->(): stub !!!\n", iface
, This
);
576 static HRESULT
GetFilterInfo(IMoniker
* pMoniker
, GUID
* pclsid
, VARIANT
* pvar
)
578 static const WCHAR wszClsidName
[] = {'C','L','S','I','D',0};
579 static const WCHAR wszFriendlyName
[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
580 IPropertyBag
* pPropBagCat
= NULL
;
584 V_VT(pvar
) = VT_BSTR
;
586 hr
= IMoniker_BindToStorage(pMoniker
, NULL
, NULL
, &IID_IPropertyBag
, (LPVOID
*)&pPropBagCat
);
589 hr
= IPropertyBag_Read(pPropBagCat
, wszClsidName
, pvar
, NULL
);
592 hr
= CLSIDFromString(V_UNION(pvar
, bstrVal
), pclsid
);
595 hr
= IPropertyBag_Read(pPropBagCat
, wszFriendlyName
, pvar
, NULL
);
598 TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid
), debugstr_w(V_UNION(pvar
, bstrVal
)));
601 IPropertyBag_Release(pPropBagCat
);
606 static HRESULT
GetInternalConnections(IBaseFilter
* pfilter
, IPin
* pinputpin
, IPin
*** pppins
, ULONG
* pnb
)
611 TRACE("(%p, %p, %p, %p)\n", pfilter
, pinputpin
, pppins
, pnb
);
612 hr
= IPin_QueryInternalConnections(pinputpin
, NULL
, &nb
);
615 } else if (hr
== S_FALSE
) {
616 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*nb
);
617 hr
= IPin_QueryInternalConnections(pinputpin
, *pppins
, &nb
);
619 ERR("Error (%x)\n", hr
);
621 } else if (hr
== E_NOTIMPL
) {
622 /* Input connected to all outputs */
623 IEnumPins
* penumpins
;
626 TRACE("E_NOTIMPL\n");
627 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
629 ERR("filter Enumpins failed (%x)\n", hr
);
633 /* Count output pins */
634 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
635 PIN_DIRECTION pindir
;
636 IPin_QueryDirection(ppin
, &pindir
);
637 if (pindir
== PINDIR_OUTPUT
)
641 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*i
);
642 /* Retrieve output pins */
643 IEnumPins_Reset(penumpins
);
645 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
646 PIN_DIRECTION pindir
;
647 IPin_QueryDirection(ppin
, &pindir
);
648 if (pindir
== PINDIR_OUTPUT
)
649 (*pppins
)[i
++] = ppin
;
655 ERR("Next failed (%x)\n", hr
);
658 IEnumPins_Release(penumpins
);
659 } else if (FAILED(hr
)) {
660 ERR("Cannot get internal connection (%x)\n", hr
);
668 /*** IGraphBuilder methods ***/
669 static HRESULT WINAPI
GraphBuilder_Connect(IGraphBuilder
*iface
,
672 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
675 IEnumMediaTypes
* penummt
;
677 IEnumPins
* penumpins
;
678 IEnumMoniker
* pEnumMoniker
;
686 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, ppinOut
, ppinIn
);
688 if (TRACE_ON(quartz
))
690 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
694 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
695 IBaseFilter_Release(PinInfo
.pFilter
);
697 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
701 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
702 IBaseFilter_Release(PinInfo
.pFilter
);
705 /* Try direct connection first */
706 hr
= IPin_Connect(ppinOut
, ppinIn
, NULL
);
710 TRACE("Direct connection failed, trying to insert other filters\n");
712 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
716 hr
= IBaseFilter_GetClassID(PinInfo
.pFilter
, &FilterCLSID
);
720 IBaseFilter_Release(PinInfo
.pFilter
);
722 /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream
723 * filter to the minor mediatype of input pin of the renderer */
724 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
726 ERR("EnumMediaTypes (%x)\n", hr
);
730 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
732 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
737 ERR("No media type found!\n");
740 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
741 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
743 /* Try to find a suitable filter that can connect to the pin to render */
744 tab
[0] = mt
->majortype
;
745 tab
[1] = mt
->subtype
;
746 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
748 ERR("Unable to enum filters (%x)\n", hr
);
752 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
757 IPin
* ppinfilter
= NULL
;
758 IBaseFilter
* pfilter
= NULL
;
760 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
761 IMoniker_Release(pMoniker
);
763 ERR("Unable to retrieve filter info (%x)\n", hr
);
767 if (IsEqualGUID(&clsid
, &FilterCLSID
)) {
768 /* Skip filter (same as the one the output pin belongs to) */
772 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
774 ERR("Unable to create filter (%x), trying next one\n", hr
);
778 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, NULL
);
780 ERR("Unable to add filter (%x)\n", hr
);
781 IBaseFilter_Release(pfilter
);
786 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
788 ERR("Enumpins (%x)\n", hr
);
792 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
793 IEnumPins_Release(penumpins
);
796 ERR("Next (%x)\n", hr
);
804 hr
= IPin_Connect(ppinOut
, ppinfilter
, NULL
);
806 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
809 TRACE("Successfully connected to filter, follow chain...\n");
811 /* Render all output pins of the filter by calling IGraphBuilder_Render on each of them */
812 hr
= GetInternalConnections(pfilter
, ppinfilter
, &ppins
, &nb
);
817 IPin_Disconnect(ppinOut
);
820 TRACE("pins to consider: %d\n", nb
);
821 for(i
= 0; i
< nb
; i
++) {
822 TRACE("Processing pin %d\n", i
);
823 hr
= IGraphBuilder_Connect(iface
, ppins
[i
], ppinIn
);
825 TRACE("Cannot render pin %p (%x)\n", ppinfilter
, hr
);
827 IPin_Release(ppins
[i
]);
828 if (SUCCEEDED(hr
)) break;
830 while (++i
< nb
) IPin_Release(ppins
[i
]);
831 CoTaskMemFree(ppins
);
832 IPin_Release(ppinfilter
);
837 if (ppinfilter
) IPin_Release(ppinfilter
);
839 IGraphBuilder_RemoveFilter(iface
, pfilter
);
840 IBaseFilter_Release(pfilter
);
844 IEnumMediaTypes_Release(penummt
);
850 static HRESULT WINAPI
GraphBuilder_Render(IGraphBuilder
*iface
,
852 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
853 IEnumMediaTypes
* penummt
;
858 IEnumMoniker
* pEnumMoniker
;
863 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppinOut
);
865 if (TRACE_ON(quartz
))
869 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
873 TRACE("Filter owning pin => %p\n", PinInfo
.pFilter
);
874 IBaseFilter_Release(PinInfo
.pFilter
);
877 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
879 ERR("EnumMediaTypes (%x)\n", hr
);
885 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
887 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
892 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
893 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
895 /* Try to find a suitable renderer with the same media type */
896 tab
[0] = mt
->majortype
;
898 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, TRUE
, FALSE
, 0, NULL
, NULL
, NULL
);
900 ERR("Unable to enum filters (%x)\n", hr
);
904 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
909 IBaseFilter
* pfilter
= NULL
;
910 IEnumPins
* penumpins
;
913 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
914 IMoniker_Release(pMoniker
);
916 ERR("Unable to retrieve filter info (%x)\n", hr
);
920 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
922 ERR("Unable to create filter (%x), trying next one\n", hr
);
926 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, NULL
);
928 ERR("Unable to add filter (%x)\n", hr
);
933 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
935 ERR("Splitter Enumpins (%x)\n", hr
);
938 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
940 ERR("Next (%x)\n", hr
);
947 IEnumPins_Release(penumpins
);
949 /* Connect the pin to render to the renderer */
950 hr
= IGraphBuilder_Connect(iface
, ppinOut
, ppinfilter
);
952 TRACE("Unable to connect to renderer (%x)\n", hr
);
959 IGraphBuilder_RemoveFilter(iface
, pfilter
);
960 IBaseFilter_Release(pfilter
);
968 IEnumMediaTypes_Release(penummt
);
973 static HRESULT WINAPI
GraphBuilder_RenderFile(IGraphBuilder
*iface
,
975 LPCWSTR lpcwstrPlayList
) {
976 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
977 static const WCHAR string
[] = {'R','e','a','d','e','r',0};
978 IBaseFilter
* preader
= NULL
;
979 IBaseFilter
* psplitter
= NULL
;
982 IEnumPins
* penumpins
;
985 IEnumMoniker
* pEnumMoniker
= NULL
;
990 IFileSourceFilter
* pfile
= NULL
;
994 TRACE("(%p/%p)->(%s, %s)\n", This
, iface
, debugstr_w(lpcwstrFile
), debugstr_w(lpcwstrPlayList
));
996 if (lpcwstrPlayList
!= NULL
)
999 hr
= IGraphBuilder_AddSourceFilter(iface
, lpcwstrFile
, string
, &preader
);
1001 /* Retrieve file media type */
1003 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1004 if (SUCCEEDED(hr
)) {
1005 hr
= IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1006 IFileSourceFilter_Release(pfile
);
1010 hr
= IBaseFilter_EnumPins(preader
, &penumpins
);
1011 if (SUCCEEDED(hr
)) {
1012 hr
= IEnumPins_Next(penumpins
, 1, &ppinreader
, &pin
);
1013 IEnumPins_Release(penumpins
);
1016 if (SUCCEEDED(hr
)) {
1017 tab
[0] = mt
.majortype
;
1018 tab
[1] = mt
.subtype
;
1019 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
1025 IEnumMoniker_Release(pEnumMoniker
);
1027 IGraphBuilder_RemoveFilter(iface
, preader
);
1028 IBaseFilter_Release(preader
);
1033 hr
= VFW_E_CANNOT_RENDER
;
1034 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
1039 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
1040 IMoniker_Release(pMoniker
);
1042 ERR("Unable to retrieve filter info (%x)\n", hr
);
1046 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&psplitter
);
1048 ERR("Unable to create filter (%x), trying next one\n", hr
);
1052 hr
= IGraphBuilder_AddFilter(iface
, psplitter
, NULL
);
1054 ERR("Unable add filter (%x)\n", hr
);
1055 IBaseFilter_Release(psplitter
);
1059 /* Connect file source and splitter filters together */
1060 /* Make the splitter analyze incoming data */
1062 hr
= IBaseFilter_EnumPins(psplitter
, &penumpins
);
1063 if (SUCCEEDED(hr
)) {
1064 hr
= IEnumPins_Next(penumpins
, 1, &ppinsplitter
, &pin
);
1065 IEnumPins_Release(penumpins
);
1069 hr
= IPin_Connect(ppinreader
, ppinsplitter
, NULL
);
1071 /* Make sure there's some output pins in the filter */
1073 hr
= GetInternalConnections(psplitter
, ppinsplitter
, &ppins
, &nb
);
1074 if (SUCCEEDED(hr
)) {
1076 IPin_Disconnect(ppinreader
);
1077 TRACE("No output pins found in filter\n");
1078 hr
= VFW_E_CANNOT_RENDER
;
1082 IPin_Release(ppinsplitter
);
1083 ppinsplitter
= NULL
;
1085 if (SUCCEEDED(hr
)) {
1086 TRACE("Successfully connected to filter\n");
1090 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
1093 CoTaskMemFree(ppins
);
1096 IGraphBuilder_RemoveFilter(iface
, psplitter
);
1097 IBaseFilter_Release(psplitter
);
1101 /* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
1102 if (SUCCEEDED(hr
)) {
1105 TRACE("pins to consider: %d\n", nb
);
1106 for(i
= 0; i
< nb
; i
++) {
1107 TRACE("Processing pin %d\n", i
);
1108 hr
= IGraphBuilder_Render(iface
, ppins
[i
]);
1110 ERR("Cannot render pin %p (%x)\n", ppins
[i
], hr
);
1113 IPin_Release(ppins
[i
]);
1115 CoTaskMemFree(ppins
);
1117 hr
= (partial
? VFW_S_PARTIAL_RENDER
: S_OK
);
1123 static HRESULT WINAPI
GraphBuilder_AddSourceFilter(IGraphBuilder
*iface
,
1124 LPCWSTR lpcwstrFileName
,
1125 LPCWSTR lpcwstrFilterName
,
1126 IBaseFilter
**ppFilter
) {
1127 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1129 IBaseFilter
* preader
;
1130 IFileSourceFilter
* pfile
= NULL
;
1134 TRACE("(%p/%p)->(%s, %s, %p)\n", This
, iface
, debugstr_w(lpcwstrFileName
), debugstr_w(lpcwstrFilterName
), ppFilter
);
1136 /* Instantiate a file source filter */
1137 hr
= CoCreateInstance(&CLSID_AsyncReader
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&preader
);
1139 ERR("Unable to create file source filter (%x)\n", hr
);
1143 hr
= IGraphBuilder_AddFilter(iface
, preader
, lpcwstrFilterName
);
1145 ERR("Unable add filter (%x)\n", hr
);
1146 IBaseFilter_Release(preader
);
1150 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1152 ERR("Unable to get IFileSourceInterface (%x)\n", hr
);
1156 /* Load the file in the file source filter */
1157 hr
= IFileSourceFilter_Load(pfile
, lpcwstrFileName
, NULL
);
1159 ERR("Load (%x)\n", hr
);
1163 IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1165 ERR("GetCurFile (%x)\n", hr
);
1168 TRACE("File %s\n", debugstr_w(filename
));
1169 TRACE("MajorType %s\n", debugstr_guid(&mt
.majortype
));
1170 TRACE("SubType %s\n", debugstr_guid(&mt
.subtype
));
1173 *ppFilter
= preader
;
1179 IFileSourceFilter_Release(pfile
);
1180 IGraphBuilder_RemoveFilter(iface
, preader
);
1181 IBaseFilter_Release(preader
);
1186 static HRESULT WINAPI
GraphBuilder_SetLogFile(IGraphBuilder
*iface
,
1188 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1190 TRACE("(%p/%p)->(%08x): stub !!!\n", This
, iface
, (DWORD
) hFile
);
1195 static HRESULT WINAPI
GraphBuilder_Abort(IGraphBuilder
*iface
) {
1196 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1198 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1203 static HRESULT WINAPI
GraphBuilder_ShouldOperationContinue(IGraphBuilder
*iface
) {
1204 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1206 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1212 static const IGraphBuilderVtbl IGraphBuilder_VTable
=
1214 GraphBuilder_QueryInterface
,
1215 GraphBuilder_AddRef
,
1216 GraphBuilder_Release
,
1217 GraphBuilder_AddFilter
,
1218 GraphBuilder_RemoveFilter
,
1219 GraphBuilder_EnumFilters
,
1220 GraphBuilder_FindFilterByName
,
1221 GraphBuilder_ConnectDirect
,
1222 GraphBuilder_Reconnect
,
1223 GraphBuilder_Disconnect
,
1224 GraphBuilder_SetDefaultSyncSource
,
1225 GraphBuilder_Connect
,
1226 GraphBuilder_Render
,
1227 GraphBuilder_RenderFile
,
1228 GraphBuilder_AddSourceFilter
,
1229 GraphBuilder_SetLogFile
,
1231 GraphBuilder_ShouldOperationContinue
1234 /*** IUnknown methods ***/
1235 static HRESULT WINAPI
MediaControl_QueryInterface(IMediaControl
*iface
,
1238 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1240 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1242 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1245 static ULONG WINAPI
MediaControl_AddRef(IMediaControl
*iface
) {
1246 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1248 TRACE("(%p/%p)->()\n", This
, iface
);
1250 return Filtergraph_AddRef(This
);
1253 static ULONG WINAPI
MediaControl_Release(IMediaControl
*iface
) {
1254 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1256 TRACE("(%p/%p)->()\n", This
, iface
);
1258 return Filtergraph_Release(This
);
1262 /*** IDispatch methods ***/
1263 static HRESULT WINAPI
MediaControl_GetTypeInfoCount(IMediaControl
*iface
,
1265 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1267 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1272 static HRESULT WINAPI
MediaControl_GetTypeInfo(IMediaControl
*iface
,
1275 ITypeInfo
**ppTInfo
) {
1276 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1278 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1283 static HRESULT WINAPI
MediaControl_GetIDsOfNames(IMediaControl
*iface
,
1289 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1291 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1296 static HRESULT WINAPI
MediaControl_Invoke(IMediaControl
*iface
,
1297 DISPID dispIdMember
,
1301 DISPPARAMS
*pDispParams
,
1303 EXCEPINFO
*pExepInfo
,
1305 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1307 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
);
1312 typedef HRESULT(WINAPI
*fnFoundFilter
)(IBaseFilter
*);
1314 static HRESULT
ExploreGraph(IFilterGraphImpl
* pGraph
, IPin
* pOutputPin
, fnFoundFilter FoundFilter
)
1323 TRACE("%p %p\n", pGraph
, pOutputPin
);
1324 PinInfo
.pFilter
= NULL
;
1326 hr
= IPin_ConnectedTo(pOutputPin
, &pInputPin
);
1329 hr
= IPin_QueryPinInfo(pInputPin
, &PinInfo
);
1332 hr
= GetInternalConnections(PinInfo
.pFilter
, pInputPin
, &ppPins
, &nb
);
1338 TRACE("Reached a renderer\n");
1339 /* Count renderers for end of stream notification */
1340 pGraph
->nRenderers
++;
1344 for(i
= 0; i
< nb
; i
++)
1346 /* Explore the graph downstream from this pin
1347 * FIXME: We should prevent exploring from a pin more than once. This can happens when
1348 * several input pins are connected to the same output (a MUX for instance). */
1349 ExploreGraph(pGraph
, ppPins
[i
], FoundFilter
);
1350 IPin_Release(ppPins
[i
]);
1353 CoTaskMemFree(ppPins
);
1355 TRACE("Doing stuff with filter %p\n", PinInfo
.pFilter
);
1356 FoundFilter(PinInfo
.pFilter
);
1359 if (PinInfo
.pFilter
) IBaseFilter_Release(PinInfo
.pFilter
);
1363 static HRESULT WINAPI
SendRun(IBaseFilter
*pFilter
) {
1364 return IBaseFilter_Run(pFilter
, 0);
1367 static HRESULT WINAPI
SendPause(IBaseFilter
*pFilter
) {
1368 return IBaseFilter_Pause(pFilter
);
1371 static HRESULT WINAPI
SendStop(IBaseFilter
*pFilter
) {
1372 return IBaseFilter_Stop(pFilter
);
1375 static HRESULT
SendFilterMessage(IMediaControl
*iface
, fnFoundFilter FoundFilter
) {
1376 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1378 IBaseFilter
* pfilter
;
1384 TRACE("(%p/%p)->()\n", This
, iface
);
1386 /* Explorer the graph from source filters to renderers, determine renderers
1387 * number and run filters from renderers to source filters */
1388 This
->nRenderers
= 0;
1389 ResetEvent(This
->hEventCompletion
);
1391 for(i
= 0; i
< This
->nFilters
; i
++)
1394 pfilter
= This
->ppFiltersInGraph
[i
];
1395 hr
= IBaseFilter_EnumPins(pfilter
, &pEnum
);
1398 ERR("Enum pins failed %x\n", hr
);
1401 /* Check if it is a source filter */
1402 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1404 IPin_QueryDirection(pPin
, &dir
);
1406 if (dir
== PINDIR_INPUT
)
1414 TRACE("Found a source filter %p\n", pfilter
);
1415 IEnumPins_Reset(pEnum
);
1416 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1418 /* Explore the graph downstream from this pin */
1419 ExploreGraph(This
, pPin
, FoundFilter
);
1422 FoundFilter(pfilter
);
1424 IEnumPins_Release(pEnum
);
1430 /*** IMediaControl methods ***/
1431 static HRESULT WINAPI
MediaControl_Run(IMediaControl
*iface
) {
1432 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1433 TRACE("(%p/%p)->()\n", This
, iface
);
1435 if (This
->state
== State_Running
) return S_OK
;
1437 EnterCriticalSection(&This
->cs
);
1438 SendFilterMessage(iface
, SendRun
);
1439 This
->state
= State_Running
;
1440 LeaveCriticalSection(&This
->cs
);
1444 static HRESULT WINAPI
MediaControl_Pause(IMediaControl
*iface
) {
1445 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1446 TRACE("(%p/%p)->()\n", This
, iface
);
1448 if (This
->state
== State_Paused
) return S_OK
;
1450 EnterCriticalSection(&This
->cs
);
1451 SendFilterMessage(iface
, SendPause
);
1452 This
->state
= State_Paused
;
1453 LeaveCriticalSection(&This
->cs
);
1457 static HRESULT WINAPI
MediaControl_Stop(IMediaControl
*iface
) {
1458 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1459 TRACE("(%p/%p)->()\n", This
, iface
);
1461 if (This
->state
== State_Stopped
) return S_OK
;
1463 EnterCriticalSection(&This
->cs
);
1464 if (This
->state
== State_Running
) SendFilterMessage(iface
, SendPause
);
1465 SendFilterMessage(iface
, SendStop
);
1466 This
->state
= State_Stopped
;
1467 LeaveCriticalSection(&This
->cs
);
1471 static HRESULT WINAPI
MediaControl_GetState(IMediaControl
*iface
,
1473 OAFilterState
*pfs
) {
1474 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1476 TRACE("(%p/%p)->(%d, %p): semi-stub !!!\n", This
, iface
, msTimeout
, pfs
);
1478 EnterCriticalSection(&This
->cs
);
1482 LeaveCriticalSection(&This
->cs
);
1487 static HRESULT WINAPI
MediaControl_RenderFile(IMediaControl
*iface
,
1489 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1491 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
);
1496 static HRESULT WINAPI
MediaControl_AddSourceFilter(IMediaControl
*iface
,
1498 IDispatch
**ppUnk
) {
1499 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1501 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
, ppUnk
);
1506 static HRESULT WINAPI
MediaControl_get_FilterCollection(IMediaControl
*iface
,
1507 IDispatch
**ppUnk
) {
1508 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1510 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1515 static HRESULT WINAPI
MediaControl_get_RegFilterCollection(IMediaControl
*iface
,
1516 IDispatch
**ppUnk
) {
1517 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1519 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1524 static HRESULT WINAPI
MediaControl_StopWhenReady(IMediaControl
*iface
) {
1525 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1527 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1533 static const IMediaControlVtbl IMediaControl_VTable
=
1535 MediaControl_QueryInterface
,
1536 MediaControl_AddRef
,
1537 MediaControl_Release
,
1538 MediaControl_GetTypeInfoCount
,
1539 MediaControl_GetTypeInfo
,
1540 MediaControl_GetIDsOfNames
,
1541 MediaControl_Invoke
,
1545 MediaControl_GetState
,
1546 MediaControl_RenderFile
,
1547 MediaControl_AddSourceFilter
,
1548 MediaControl_get_FilterCollection
,
1549 MediaControl_get_RegFilterCollection
,
1550 MediaControl_StopWhenReady
1554 /*** IUnknown methods ***/
1555 static HRESULT WINAPI
MediaSeeking_QueryInterface(IMediaSeeking
*iface
,
1558 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1560 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1562 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1565 static ULONG WINAPI
MediaSeeking_AddRef(IMediaSeeking
*iface
) {
1566 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1568 TRACE("(%p/%p)->()\n", This
, iface
);
1570 return Filtergraph_AddRef(This
);
1573 static ULONG WINAPI
MediaSeeking_Release(IMediaSeeking
*iface
) {
1574 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1576 TRACE("(%p/%p)->()\n", This
, iface
);
1578 return Filtergraph_Release(This
);
1581 /*** IMediaSeeking methods ***/
1582 static HRESULT WINAPI
MediaSeeking_GetCapabilities(IMediaSeeking
*iface
,
1583 DWORD
*pCapabilities
) {
1584 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1586 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1591 static HRESULT WINAPI
MediaSeeking_CheckCapabilities(IMediaSeeking
*iface
,
1592 DWORD
*pCapabilities
) {
1593 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1595 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1600 static HRESULT WINAPI
MediaSeeking_IsFormatSupported(IMediaSeeking
*iface
,
1601 const GUID
*pFormat
) {
1602 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1604 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1609 static HRESULT WINAPI
MediaSeeking_QueryPreferredFormat(IMediaSeeking
*iface
,
1611 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1613 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1618 static HRESULT WINAPI
MediaSeeking_GetTimeFormat(IMediaSeeking
*iface
,
1620 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1622 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1627 static HRESULT WINAPI
MediaSeeking_IsUsingTimeFormat(IMediaSeeking
*iface
,
1628 const GUID
*pFormat
) {
1629 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1631 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1636 static HRESULT WINAPI
MediaSeeking_SetTimeFormat(IMediaSeeking
*iface
,
1637 const GUID
*pFormat
) {
1638 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1640 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1645 static HRESULT WINAPI
MediaSeeking_GetDuration(IMediaSeeking
*iface
,
1646 LONGLONG
*pDuration
) {
1647 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1649 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDuration
);
1654 static HRESULT WINAPI
MediaSeeking_GetStopPosition(IMediaSeeking
*iface
,
1656 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1658 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pStop
);
1663 static HRESULT WINAPI
MediaSeeking_GetCurrentPosition(IMediaSeeking
*iface
,
1664 LONGLONG
*pCurrent
) {
1665 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1667 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCurrent
);
1672 static HRESULT WINAPI
MediaSeeking_ConvertTimeFormat(IMediaSeeking
*iface
,
1674 const GUID
*pTargetFormat
,
1676 const GUID
*pSourceFormat
) {
1677 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1679 TRACE("(%p/%p)->(%p, %p, 0x%s, %p): stub !!!\n", This
, iface
, pTarget
,
1680 pTargetFormat
, wine_dbgstr_longlong(Source
), pSourceFormat
);
1685 static HRESULT WINAPI
MediaSeeking_SetPositions(IMediaSeeking
*iface
,
1687 DWORD dwCurrentFlags
,
1689 DWORD dwStopFlags
) {
1690 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1692 TRACE("(%p/%p)->(%p, %08x, %p, %08x): stub !!!\n", This
, iface
, pCurrent
, dwCurrentFlags
, pStop
, dwStopFlags
);
1697 static HRESULT WINAPI
MediaSeeking_GetPositions(IMediaSeeking
*iface
,
1700 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1702 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pCurrent
, pStop
);
1707 static HRESULT WINAPI
MediaSeeking_GetAvailable(IMediaSeeking
*iface
,
1708 LONGLONG
*pEarliest
,
1709 LONGLONG
*pLatest
) {
1710 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1712 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pEarliest
, pLatest
);
1717 static HRESULT WINAPI
MediaSeeking_SetRate(IMediaSeeking
*iface
,
1719 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1721 TRACE("(%p/%p)->(%f): stub !!!\n", This
, iface
, dRate
);
1726 static HRESULT WINAPI
MediaSeeking_GetRate(IMediaSeeking
*iface
,
1728 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1730 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pdRate
);
1735 static HRESULT WINAPI
MediaSeeking_GetPreroll(IMediaSeeking
*iface
,
1736 LONGLONG
*pllPreroll
) {
1737 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1739 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pllPreroll
);
1745 static const IMediaSeekingVtbl IMediaSeeking_VTable
=
1747 MediaSeeking_QueryInterface
,
1748 MediaSeeking_AddRef
,
1749 MediaSeeking_Release
,
1750 MediaSeeking_GetCapabilities
,
1751 MediaSeeking_CheckCapabilities
,
1752 MediaSeeking_IsFormatSupported
,
1753 MediaSeeking_QueryPreferredFormat
,
1754 MediaSeeking_GetTimeFormat
,
1755 MediaSeeking_IsUsingTimeFormat
,
1756 MediaSeeking_SetTimeFormat
,
1757 MediaSeeking_GetDuration
,
1758 MediaSeeking_GetStopPosition
,
1759 MediaSeeking_GetCurrentPosition
,
1760 MediaSeeking_ConvertTimeFormat
,
1761 MediaSeeking_SetPositions
,
1762 MediaSeeking_GetPositions
,
1763 MediaSeeking_GetAvailable
,
1764 MediaSeeking_SetRate
,
1765 MediaSeeking_GetRate
,
1766 MediaSeeking_GetPreroll
1769 /*** IUnknown methods ***/
1770 static HRESULT WINAPI
MediaPosition_QueryInterface(IMediaPosition
* iface
, REFIID riid
, void** ppvObj
){
1771 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1773 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1775 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1778 static ULONG WINAPI
MediaPosition_AddRef(IMediaPosition
*iface
){
1779 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1781 TRACE("(%p/%p)->()\n", This
, iface
);
1783 return Filtergraph_AddRef(This
);
1786 static ULONG WINAPI
MediaPosition_Release(IMediaPosition
*iface
){
1787 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1789 TRACE("(%p/%p)->()\n", This
, iface
);
1791 return Filtergraph_Release(This
);
1794 /*** IDispatch methods ***/
1795 static HRESULT WINAPI
MediaPosition_GetTypeInfoCount(IMediaPosition
*iface
, UINT
* pctinfo
){
1796 FIXME("(%p) stub!\n", iface
);
1800 static HRESULT WINAPI
MediaPosition_GetTypeInfo(IMediaPosition
*iface
, UINT iTInfo
, LCID lcid
, ITypeInfo
** ppTInfo
){
1801 FIXME("(%p) stub!\n", iface
);
1805 static HRESULT WINAPI
MediaPosition_GetIDsOfNames(IMediaPosition
* iface
, REFIID riid
, LPOLESTR
* rgszNames
, UINT cNames
, LCID lcid
, DISPID
* rgDispId
){
1806 FIXME("(%p) stub!\n", iface
);
1810 static HRESULT WINAPI
MediaPosition_Invoke(IMediaPosition
* iface
, DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
* pDispParams
, VARIANT
* pVarResult
, EXCEPINFO
* pExcepInfo
, UINT
* puArgErr
){
1811 FIXME("(%p) stub!\n", iface
);
1815 /*** IMediaPosition methods ***/
1816 static HRESULT WINAPI
MediaPosition_get_Duration(IMediaPosition
* iface
, REFTIME
*plength
){
1817 FIXME("(%p)->(%p) stub!\n", iface
, plength
);
1821 static HRESULT WINAPI
MediaPosition_put_CurrentPosition(IMediaPosition
* iface
, REFTIME llTime
){
1822 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1826 static HRESULT WINAPI
MediaPosition_get_CurrentPosition(IMediaPosition
* iface
, REFTIME
*pllTime
){
1827 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1831 static HRESULT WINAPI
MediaPosition_get_StopTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1832 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1836 static HRESULT WINAPI
MediaPosition_put_StopTime(IMediaPosition
* iface
, REFTIME llTime
){
1837 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1841 static HRESULT WINAPI
MediaPosition_get_PrerollTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1842 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1846 static HRESULT WINAPI
MediaPosition_put_PrerollTime(IMediaPosition
* iface
, REFTIME llTime
){
1847 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1851 static HRESULT WINAPI
MediaPosition_put_Rate(IMediaPosition
* iface
, double dRate
){
1852 FIXME("(%p)->(%f) stub!\n", iface
, dRate
);
1856 static HRESULT WINAPI
MediaPosition_get_Rate(IMediaPosition
* iface
, double *pdRate
){
1857 FIXME("(%p)->(%p) stub!\n", iface
, pdRate
);
1861 static HRESULT WINAPI
MediaPosition_CanSeekForward(IMediaPosition
* iface
, LONG
*pCanSeekForward
){
1862 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekForward
);
1866 static HRESULT WINAPI
MediaPosition_CanSeekBackward(IMediaPosition
* iface
, LONG
*pCanSeekBackward
){
1867 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekBackward
);
1872 static const IMediaPositionVtbl IMediaPosition_VTable
=
1874 MediaPosition_QueryInterface
,
1875 MediaPosition_AddRef
,
1876 MediaPosition_Release
,
1877 MediaPosition_GetTypeInfoCount
,
1878 MediaPosition_GetTypeInfo
,
1879 MediaPosition_GetIDsOfNames
,
1880 MediaPosition_Invoke
,
1881 MediaPosition_get_Duration
,
1882 MediaPosition_put_CurrentPosition
,
1883 MediaPosition_get_CurrentPosition
,
1884 MediaPosition_get_StopTime
,
1885 MediaPosition_put_StopTime
,
1886 MediaPosition_get_PrerollTime
,
1887 MediaPosition_put_PrerollTime
,
1888 MediaPosition_put_Rate
,
1889 MediaPosition_get_Rate
,
1890 MediaPosition_CanSeekForward
,
1891 MediaPosition_CanSeekBackward
1894 static HRESULT
GetTargetInterface(IFilterGraphImpl
* pGraph
, REFIID riid
, LPVOID
* ppvObj
)
1896 HRESULT hr
= E_NOINTERFACE
;
1900 /* Check if the interface type is already registered */
1901 for (entry
= 0; entry
< pGraph
->nItfCacheEntries
; entry
++)
1902 if (riid
== pGraph
->ItfCacheEntries
[entry
].riid
)
1904 if (pGraph
->ItfCacheEntries
[entry
].iface
)
1906 /* Return the interface if available */
1907 *ppvObj
= pGraph
->ItfCacheEntries
[entry
].iface
;
1913 if (entry
>= MAX_ITF_CACHE_ENTRIES
)
1915 FIXME("Not enough space to store interface in the cache\n");
1916 return E_OUTOFMEMORY
;
1919 /* Find a filter supporting the requested interface */
1920 for (i
= 0; i
< pGraph
->nFilters
; i
++)
1922 hr
= IBaseFilter_QueryInterface(pGraph
->ppFiltersInGraph
[i
], riid
, ppvObj
);
1925 pGraph
->ItfCacheEntries
[entry
].riid
= riid
;
1926 pGraph
->ItfCacheEntries
[entry
].filter
= pGraph
->ppFiltersInGraph
[i
];
1927 pGraph
->ItfCacheEntries
[entry
].iface
= (IUnknown
*)*ppvObj
;
1928 if (entry
>= pGraph
->nItfCacheEntries
)
1929 pGraph
->nItfCacheEntries
++;
1932 if (hr
!= E_NOINTERFACE
)
1939 /*** IUnknown methods ***/
1940 static HRESULT WINAPI
BasicAudio_QueryInterface(IBasicAudio
*iface
,
1943 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1945 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1947 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1950 static ULONG WINAPI
BasicAudio_AddRef(IBasicAudio
*iface
) {
1951 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1953 TRACE("(%p/%p)->()\n", This
, iface
);
1955 return Filtergraph_AddRef(This
);
1958 static ULONG WINAPI
BasicAudio_Release(IBasicAudio
*iface
) {
1959 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1961 TRACE("(%p/%p)->()\n", This
, iface
);
1963 return Filtergraph_Release(This
);
1966 /*** IDispatch methods ***/
1967 static HRESULT WINAPI
BasicAudio_GetTypeInfoCount(IBasicAudio
*iface
,
1969 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1970 IBasicAudio
* pBasicAudio
;
1973 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
1975 EnterCriticalSection(&This
->cs
);
1977 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
1980 hr
= IBasicAudio_GetTypeInfoCount(pBasicAudio
, pctinfo
);
1982 LeaveCriticalSection(&This
->cs
);
1987 static HRESULT WINAPI
BasicAudio_GetTypeInfo(IBasicAudio
*iface
,
1990 ITypeInfo
**ppTInfo
) {
1991 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1992 IBasicAudio
* pBasicAudio
;
1995 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1997 EnterCriticalSection(&This
->cs
);
1999 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2002 hr
= IBasicAudio_GetTypeInfo(pBasicAudio
, iTInfo
, lcid
, ppTInfo
);
2004 LeaveCriticalSection(&This
->cs
);
2009 static HRESULT WINAPI
BasicAudio_GetIDsOfNames(IBasicAudio
*iface
,
2015 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2016 IBasicAudio
* pBasicAudio
;
2019 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2021 EnterCriticalSection(&This
->cs
);
2023 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2026 hr
= IBasicAudio_GetIDsOfNames(pBasicAudio
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2028 LeaveCriticalSection(&This
->cs
);
2033 static HRESULT WINAPI
BasicAudio_Invoke(IBasicAudio
*iface
,
2034 DISPID dispIdMember
,
2038 DISPPARAMS
*pDispParams
,
2040 EXCEPINFO
*pExepInfo
,
2042 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2043 IBasicAudio
* pBasicAudio
;
2046 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
);
2048 EnterCriticalSection(&This
->cs
);
2050 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2053 hr
= IBasicAudio_Invoke(pBasicAudio
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2055 LeaveCriticalSection(&This
->cs
);
2060 /*** IBasicAudio methods ***/
2061 static HRESULT WINAPI
BasicAudio_put_Volume(IBasicAudio
*iface
,
2063 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2064 IBasicAudio
* pBasicAudio
;
2067 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lVolume
);
2069 EnterCriticalSection(&This
->cs
);
2071 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2074 hr
= IBasicAudio_put_Volume(pBasicAudio
, lVolume
);
2076 LeaveCriticalSection(&This
->cs
);
2081 static HRESULT WINAPI
BasicAudio_get_Volume(IBasicAudio
*iface
,
2083 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2084 IBasicAudio
* pBasicAudio
;
2087 TRACE("(%p/%p)->(%p)\n", This
, iface
, plVolume
);
2089 EnterCriticalSection(&This
->cs
);
2091 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2094 hr
= IBasicAudio_get_Volume(pBasicAudio
, plVolume
);
2096 LeaveCriticalSection(&This
->cs
);
2101 static HRESULT WINAPI
BasicAudio_put_Balance(IBasicAudio
*iface
,
2103 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2104 IBasicAudio
* pBasicAudio
;
2107 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lBalance
);
2109 EnterCriticalSection(&This
->cs
);
2111 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2114 hr
= IBasicAudio_put_Balance(pBasicAudio
, lBalance
);
2116 LeaveCriticalSection(&This
->cs
);
2121 static HRESULT WINAPI
BasicAudio_get_Balance(IBasicAudio
*iface
,
2123 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2124 IBasicAudio
* pBasicAudio
;
2127 TRACE("(%p/%p)->(%p)\n", This
, iface
, plBalance
);
2129 EnterCriticalSection(&This
->cs
);
2131 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2134 hr
= IBasicAudio_get_Balance(pBasicAudio
, plBalance
);
2136 LeaveCriticalSection(&This
->cs
);
2141 static const IBasicAudioVtbl IBasicAudio_VTable
=
2143 BasicAudio_QueryInterface
,
2146 BasicAudio_GetTypeInfoCount
,
2147 BasicAudio_GetTypeInfo
,
2148 BasicAudio_GetIDsOfNames
,
2150 BasicAudio_put_Volume
,
2151 BasicAudio_get_Volume
,
2152 BasicAudio_put_Balance
,
2153 BasicAudio_get_Balance
2156 /*** IUnknown methods ***/
2157 static HRESULT WINAPI
BasicVideo_QueryInterface(IBasicVideo
*iface
,
2160 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2162 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2164 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2167 static ULONG WINAPI
BasicVideo_AddRef(IBasicVideo
*iface
) {
2168 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2170 TRACE("(%p/%p)->()\n", This
, iface
);
2172 return Filtergraph_AddRef(This
);
2175 static ULONG WINAPI
BasicVideo_Release(IBasicVideo
*iface
) {
2176 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2178 TRACE("(%p/%p)->()\n", This
, iface
);
2180 return Filtergraph_Release(This
);
2183 /*** IDispatch methods ***/
2184 static HRESULT WINAPI
BasicVideo_GetTypeInfoCount(IBasicVideo
*iface
,
2186 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2187 IBasicVideo
* pBasicVideo
;
2190 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
2192 EnterCriticalSection(&This
->cs
);
2194 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2197 hr
= IBasicVideo_GetTypeInfoCount(pBasicVideo
, pctinfo
);
2199 LeaveCriticalSection(&This
->cs
);
2204 static HRESULT WINAPI
BasicVideo_GetTypeInfo(IBasicVideo
*iface
,
2207 ITypeInfo
**ppTInfo
) {
2208 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2209 IBasicVideo
* pBasicVideo
;
2212 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2214 EnterCriticalSection(&This
->cs
);
2216 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2219 hr
= IBasicVideo_GetTypeInfo(pBasicVideo
, iTInfo
, lcid
, ppTInfo
);
2221 LeaveCriticalSection(&This
->cs
);
2226 static HRESULT WINAPI
BasicVideo_GetIDsOfNames(IBasicVideo
*iface
,
2232 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2233 IBasicVideo
* pBasicVideo
;
2236 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2238 EnterCriticalSection(&This
->cs
);
2240 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2243 hr
= IBasicVideo_GetIDsOfNames(pBasicVideo
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2245 LeaveCriticalSection(&This
->cs
);
2250 static HRESULT WINAPI
BasicVideo_Invoke(IBasicVideo
*iface
,
2251 DISPID dispIdMember
,
2255 DISPPARAMS
*pDispParams
,
2257 EXCEPINFO
*pExepInfo
,
2259 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2260 IBasicVideo
* pBasicVideo
;
2263 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
);
2265 EnterCriticalSection(&This
->cs
);
2267 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2270 hr
= IBasicVideo_Invoke(pBasicVideo
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2272 LeaveCriticalSection(&This
->cs
);
2277 /*** IBasicVideo methods ***/
2278 static HRESULT WINAPI
BasicVideo_get_AvgTimePerFrame(IBasicVideo
*iface
,
2279 REFTIME
*pAvgTimePerFrame
) {
2280 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2281 IBasicVideo
* pBasicVideo
;
2284 TRACE("(%p/%p)->(%p)\n", This
, iface
, pAvgTimePerFrame
);
2286 EnterCriticalSection(&This
->cs
);
2288 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2291 hr
= IBasicVideo_get_AvgTimePerFrame(pBasicVideo
, pAvgTimePerFrame
);
2293 LeaveCriticalSection(&This
->cs
);
2298 static HRESULT WINAPI
BasicVideo_get_BitRate(IBasicVideo
*iface
,
2300 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2301 IBasicVideo
* pBasicVideo
;
2304 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitRate
);
2306 EnterCriticalSection(&This
->cs
);
2308 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2311 hr
= IBasicVideo_get_BitRate(pBasicVideo
, pBitRate
);
2313 LeaveCriticalSection(&This
->cs
);
2318 static HRESULT WINAPI
BasicVideo_get_BitErrorRate(IBasicVideo
*iface
,
2319 long *pBitErrorRate
) {
2320 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2321 IBasicVideo
* pBasicVideo
;
2324 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitErrorRate
);
2326 EnterCriticalSection(&This
->cs
);
2328 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2331 hr
= IBasicVideo_get_BitErrorRate(pBasicVideo
, pBitErrorRate
);
2333 LeaveCriticalSection(&This
->cs
);
2338 static HRESULT WINAPI
BasicVideo_get_VideoWidth(IBasicVideo
*iface
,
2339 long *pVideoWidth
) {
2340 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2341 IBasicVideo
* pBasicVideo
;
2344 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoWidth
);
2346 EnterCriticalSection(&This
->cs
);
2348 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2351 hr
= IBasicVideo_get_VideoWidth(pBasicVideo
, pVideoWidth
);
2353 LeaveCriticalSection(&This
->cs
);
2358 static HRESULT WINAPI
BasicVideo_get_VideoHeight(IBasicVideo
*iface
,
2359 long *pVideoHeight
) {
2360 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2361 IBasicVideo
* pBasicVideo
;
2364 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoHeight
);
2366 EnterCriticalSection(&This
->cs
);
2368 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2371 hr
= IBasicVideo_get_VideoHeight(pBasicVideo
, pVideoHeight
);
2373 LeaveCriticalSection(&This
->cs
);
2378 static HRESULT WINAPI
BasicVideo_put_SourceLeft(IBasicVideo
*iface
,
2380 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2381 IBasicVideo
* pBasicVideo
;
2384 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceLeft
);
2386 EnterCriticalSection(&This
->cs
);
2388 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2391 hr
= IBasicVideo_put_SourceLeft(pBasicVideo
, SourceLeft
);
2393 LeaveCriticalSection(&This
->cs
);
2398 static HRESULT WINAPI
BasicVideo_get_SourceLeft(IBasicVideo
*iface
,
2399 long *pSourceLeft
) {
2400 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2401 IBasicVideo
* pBasicVideo
;
2404 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceLeft
);
2406 EnterCriticalSection(&This
->cs
);
2408 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2411 hr
= IBasicVideo_get_SourceLeft(pBasicVideo
, pSourceLeft
);
2413 LeaveCriticalSection(&This
->cs
);
2418 static HRESULT WINAPI
BasicVideo_put_SourceWidth(IBasicVideo
*iface
,
2420 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2421 IBasicVideo
* pBasicVideo
;
2424 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceWidth
);
2426 EnterCriticalSection(&This
->cs
);
2428 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2431 hr
= IBasicVideo_put_SourceWidth(pBasicVideo
, SourceWidth
);
2433 LeaveCriticalSection(&This
->cs
);
2438 static HRESULT WINAPI
BasicVideo_get_SourceWidth(IBasicVideo
*iface
,
2439 long *pSourceWidth
) {
2440 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2441 IBasicVideo
* pBasicVideo
;
2444 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceWidth
);
2446 EnterCriticalSection(&This
->cs
);
2448 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2451 hr
= IBasicVideo_get_SourceWidth(pBasicVideo
, pSourceWidth
);
2453 LeaveCriticalSection(&This
->cs
);
2458 static HRESULT WINAPI
BasicVideo_put_SourceTop(IBasicVideo
*iface
,
2460 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2461 IBasicVideo
* pBasicVideo
;
2464 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceTop
);
2466 EnterCriticalSection(&This
->cs
);
2468 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2471 hr
= IBasicVideo_put_SourceTop(pBasicVideo
, SourceTop
);
2473 LeaveCriticalSection(&This
->cs
);
2478 static HRESULT WINAPI
BasicVideo_get_SourceTop(IBasicVideo
*iface
,
2480 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2481 IBasicVideo
* pBasicVideo
;
2484 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceTop
);
2486 EnterCriticalSection(&This
->cs
);
2488 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2491 hr
= IBasicVideo_get_SourceTop(pBasicVideo
, pSourceTop
);
2493 LeaveCriticalSection(&This
->cs
);
2498 static HRESULT WINAPI
BasicVideo_put_SourceHeight(IBasicVideo
*iface
,
2499 long SourceHeight
) {
2500 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2501 IBasicVideo
* pBasicVideo
;
2504 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceHeight
);
2506 EnterCriticalSection(&This
->cs
);
2508 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2511 hr
= IBasicVideo_put_SourceHeight(pBasicVideo
, SourceHeight
);
2513 LeaveCriticalSection(&This
->cs
);
2518 static HRESULT WINAPI
BasicVideo_get_SourceHeight(IBasicVideo
*iface
,
2519 long *pSourceHeight
) {
2520 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2521 IBasicVideo
* pBasicVideo
;
2524 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceHeight
);
2526 EnterCriticalSection(&This
->cs
);
2528 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2531 hr
= IBasicVideo_get_SourceHeight(pBasicVideo
, pSourceHeight
);
2533 LeaveCriticalSection(&This
->cs
);
2538 static HRESULT WINAPI
BasicVideo_put_DestinationLeft(IBasicVideo
*iface
,
2539 long DestinationLeft
) {
2540 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2541 IBasicVideo
* pBasicVideo
;
2544 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationLeft
);
2546 EnterCriticalSection(&This
->cs
);
2548 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2551 hr
= IBasicVideo_put_DestinationLeft(pBasicVideo
, DestinationLeft
);
2553 LeaveCriticalSection(&This
->cs
);
2558 static HRESULT WINAPI
BasicVideo_get_DestinationLeft(IBasicVideo
*iface
,
2559 long *pDestinationLeft
) {
2560 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2561 IBasicVideo
* pBasicVideo
;
2564 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationLeft
);
2566 EnterCriticalSection(&This
->cs
);
2568 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2571 hr
= IBasicVideo_get_DestinationLeft(pBasicVideo
, pDestinationLeft
);
2573 LeaveCriticalSection(&This
->cs
);
2578 static HRESULT WINAPI
BasicVideo_put_DestinationWidth(IBasicVideo
*iface
,
2579 long DestinationWidth
) {
2580 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2581 IBasicVideo
* pBasicVideo
;
2584 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationWidth
);
2586 EnterCriticalSection(&This
->cs
);
2588 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2591 hr
= IBasicVideo_put_DestinationWidth(pBasicVideo
, DestinationWidth
);
2593 LeaveCriticalSection(&This
->cs
);
2598 static HRESULT WINAPI
BasicVideo_get_DestinationWidth(IBasicVideo
*iface
,
2599 long *pDestinationWidth
) {
2600 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2601 IBasicVideo
* pBasicVideo
;
2604 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationWidth
);
2606 EnterCriticalSection(&This
->cs
);
2608 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2611 hr
= IBasicVideo_get_DestinationWidth(pBasicVideo
, pDestinationWidth
);
2613 LeaveCriticalSection(&This
->cs
);
2618 static HRESULT WINAPI
BasicVideo_put_DestinationTop(IBasicVideo
*iface
,
2619 long DestinationTop
) {
2620 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2621 IBasicVideo
* pBasicVideo
;
2624 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationTop
);
2626 EnterCriticalSection(&This
->cs
);
2628 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2631 hr
= IBasicVideo_put_DestinationTop(pBasicVideo
, DestinationTop
);
2633 LeaveCriticalSection(&This
->cs
);
2638 static HRESULT WINAPI
BasicVideo_get_DestinationTop(IBasicVideo
*iface
,
2639 long *pDestinationTop
) {
2640 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2641 IBasicVideo
* pBasicVideo
;
2644 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationTop
);
2646 EnterCriticalSection(&This
->cs
);
2648 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2651 hr
= IBasicVideo_get_DestinationTop(pBasicVideo
, pDestinationTop
);
2653 LeaveCriticalSection(&This
->cs
);
2658 static HRESULT WINAPI
BasicVideo_put_DestinationHeight(IBasicVideo
*iface
,
2659 long DestinationHeight
) {
2660 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2661 IBasicVideo
* pBasicVideo
;
2664 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationHeight
);
2666 EnterCriticalSection(&This
->cs
);
2668 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2671 hr
= IBasicVideo_put_DestinationHeight(pBasicVideo
, DestinationHeight
);
2673 LeaveCriticalSection(&This
->cs
);
2678 static HRESULT WINAPI
BasicVideo_get_DestinationHeight(IBasicVideo
*iface
,
2679 long *pDestinationHeight
) {
2680 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2681 IBasicVideo
* pBasicVideo
;
2684 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationHeight
);
2686 EnterCriticalSection(&This
->cs
);
2688 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2691 hr
= IBasicVideo_get_DestinationHeight(pBasicVideo
, pDestinationHeight
);
2693 LeaveCriticalSection(&This
->cs
);
2698 static HRESULT WINAPI
BasicVideo_SetSourcePosition(IBasicVideo
*iface
,
2703 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2704 IBasicVideo
* pBasicVideo
;
2707 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2709 EnterCriticalSection(&This
->cs
);
2711 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2714 hr
= IBasicVideo_SetSourcePosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2716 LeaveCriticalSection(&This
->cs
);
2721 static HRESULT WINAPI
BasicVideo_GetSourcePosition(IBasicVideo
*iface
,
2726 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2727 IBasicVideo
* pBasicVideo
;
2730 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2732 EnterCriticalSection(&This
->cs
);
2734 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2737 hr
= IBasicVideo_GetSourcePosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2739 LeaveCriticalSection(&This
->cs
);
2744 static HRESULT WINAPI
BasicVideo_SetDefaultSourcePosition(IBasicVideo
*iface
) {
2745 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2746 IBasicVideo
* pBasicVideo
;
2749 TRACE("(%p/%p)->()\n", This
, iface
);
2751 EnterCriticalSection(&This
->cs
);
2753 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2756 hr
= IBasicVideo_SetDefaultSourcePosition(pBasicVideo
);
2758 LeaveCriticalSection(&This
->cs
);
2763 static HRESULT WINAPI
BasicVideo_SetDestinationPosition(IBasicVideo
*iface
,
2768 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2769 IBasicVideo
* pBasicVideo
;
2772 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2774 EnterCriticalSection(&This
->cs
);
2776 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2779 hr
= IBasicVideo_SetDestinationPosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2781 LeaveCriticalSection(&This
->cs
);
2786 static HRESULT WINAPI
BasicVideo_GetDestinationPosition(IBasicVideo
*iface
,
2791 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2792 IBasicVideo
* pBasicVideo
;
2795 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2797 EnterCriticalSection(&This
->cs
);
2799 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2802 hr
= IBasicVideo_GetDestinationPosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2804 LeaveCriticalSection(&This
->cs
);
2809 static HRESULT WINAPI
BasicVideo_SetDefaultDestinationPosition(IBasicVideo
*iface
) {
2810 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2811 IBasicVideo
* pBasicVideo
;
2814 TRACE("(%p/%p)->()\n", This
, iface
);
2816 EnterCriticalSection(&This
->cs
);
2818 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2821 hr
= IBasicVideo_SetDefaultDestinationPosition(pBasicVideo
);
2823 LeaveCriticalSection(&This
->cs
);
2828 static HRESULT WINAPI
BasicVideo_GetVideoSize(IBasicVideo
*iface
,
2831 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2832 IBasicVideo
* pBasicVideo
;
2835 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
2837 EnterCriticalSection(&This
->cs
);
2839 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2842 hr
= IBasicVideo_GetVideoSize(pBasicVideo
, pWidth
, pHeight
);
2844 LeaveCriticalSection(&This
->cs
);
2849 static HRESULT WINAPI
BasicVideo_GetVideoPaletteEntries(IBasicVideo
*iface
,
2854 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2855 IBasicVideo
* pBasicVideo
;
2858 TRACE("(%p/%p)->(%ld, %ld, %p, %p)\n", This
, iface
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2860 EnterCriticalSection(&This
->cs
);
2862 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2865 hr
= IBasicVideo_GetVideoPaletteEntries(pBasicVideo
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2867 LeaveCriticalSection(&This
->cs
);
2872 static HRESULT WINAPI
BasicVideo_GetCurrentImage(IBasicVideo
*iface
,
2875 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2876 IBasicVideo
* pBasicVideo
;
2879 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pBufferSize
, pDIBImage
);
2881 EnterCriticalSection(&This
->cs
);
2883 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2886 hr
= IBasicVideo_GetCurrentImage(pBasicVideo
, pBufferSize
, pDIBImage
);
2888 LeaveCriticalSection(&This
->cs
);
2893 static HRESULT WINAPI
BasicVideo_IsUsingDefaultSource(IBasicVideo
*iface
) {
2894 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2895 IBasicVideo
* pBasicVideo
;
2898 TRACE("(%p/%p)->()\n", This
, iface
);
2900 EnterCriticalSection(&This
->cs
);
2902 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2905 hr
= IBasicVideo_IsUsingDefaultSource(pBasicVideo
);
2907 LeaveCriticalSection(&This
->cs
);
2912 static HRESULT WINAPI
BasicVideo_IsUsingDefaultDestination(IBasicVideo
*iface
) {
2913 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2914 IBasicVideo
* pBasicVideo
;
2917 TRACE("(%p/%p)->()\n", This
, iface
);
2919 EnterCriticalSection(&This
->cs
);
2921 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2924 hr
= IBasicVideo_IsUsingDefaultDestination(pBasicVideo
);
2926 LeaveCriticalSection(&This
->cs
);
2932 static const IBasicVideoVtbl IBasicVideo_VTable
=
2934 BasicVideo_QueryInterface
,
2937 BasicVideo_GetTypeInfoCount
,
2938 BasicVideo_GetTypeInfo
,
2939 BasicVideo_GetIDsOfNames
,
2941 BasicVideo_get_AvgTimePerFrame
,
2942 BasicVideo_get_BitRate
,
2943 BasicVideo_get_BitErrorRate
,
2944 BasicVideo_get_VideoWidth
,
2945 BasicVideo_get_VideoHeight
,
2946 BasicVideo_put_SourceLeft
,
2947 BasicVideo_get_SourceLeft
,
2948 BasicVideo_put_SourceWidth
,
2949 BasicVideo_get_SourceWidth
,
2950 BasicVideo_put_SourceTop
,
2951 BasicVideo_get_SourceTop
,
2952 BasicVideo_put_SourceHeight
,
2953 BasicVideo_get_SourceHeight
,
2954 BasicVideo_put_DestinationLeft
,
2955 BasicVideo_get_DestinationLeft
,
2956 BasicVideo_put_DestinationWidth
,
2957 BasicVideo_get_DestinationWidth
,
2958 BasicVideo_put_DestinationTop
,
2959 BasicVideo_get_DestinationTop
,
2960 BasicVideo_put_DestinationHeight
,
2961 BasicVideo_get_DestinationHeight
,
2962 BasicVideo_SetSourcePosition
,
2963 BasicVideo_GetSourcePosition
,
2964 BasicVideo_SetDefaultSourcePosition
,
2965 BasicVideo_SetDestinationPosition
,
2966 BasicVideo_GetDestinationPosition
,
2967 BasicVideo_SetDefaultDestinationPosition
,
2968 BasicVideo_GetVideoSize
,
2969 BasicVideo_GetVideoPaletteEntries
,
2970 BasicVideo_GetCurrentImage
,
2971 BasicVideo_IsUsingDefaultSource
,
2972 BasicVideo_IsUsingDefaultDestination
2976 /*** IUnknown methods ***/
2977 static HRESULT WINAPI
VideoWindow_QueryInterface(IVideoWindow
*iface
,
2980 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2982 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2984 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2987 static ULONG WINAPI
VideoWindow_AddRef(IVideoWindow
*iface
) {
2988 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2990 TRACE("(%p/%p)->()\n", This
, iface
);
2992 return Filtergraph_AddRef(This
);
2995 static ULONG WINAPI
VideoWindow_Release(IVideoWindow
*iface
) {
2996 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2998 TRACE("(%p/%p)->()\n", This
, iface
);
3000 return Filtergraph_Release(This
);
3003 /*** IDispatch methods ***/
3004 static HRESULT WINAPI
VideoWindow_GetTypeInfoCount(IVideoWindow
*iface
,
3006 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3007 IVideoWindow
* pVideoWindow
;
3010 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
3012 EnterCriticalSection(&This
->cs
);
3014 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3017 hr
= IVideoWindow_GetTypeInfoCount(pVideoWindow
, pctinfo
);
3019 LeaveCriticalSection(&This
->cs
);
3024 static HRESULT WINAPI
VideoWindow_GetTypeInfo(IVideoWindow
*iface
,
3027 ITypeInfo
**ppTInfo
) {
3028 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3029 IVideoWindow
* pVideoWindow
;
3032 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
3034 EnterCriticalSection(&This
->cs
);
3036 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3039 hr
= IVideoWindow_GetTypeInfo(pVideoWindow
, iTInfo
, lcid
, ppTInfo
);
3041 LeaveCriticalSection(&This
->cs
);
3046 static HRESULT WINAPI
VideoWindow_GetIDsOfNames(IVideoWindow
*iface
,
3052 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3053 IVideoWindow
* pVideoWindow
;
3056 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3058 EnterCriticalSection(&This
->cs
);
3060 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3063 hr
= IVideoWindow_GetIDsOfNames(pVideoWindow
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3065 LeaveCriticalSection(&This
->cs
);
3070 static HRESULT WINAPI
VideoWindow_Invoke(IVideoWindow
*iface
,
3071 DISPID dispIdMember
,
3075 DISPPARAMS
*pDispParams
,
3077 EXCEPINFO
*pExepInfo
,
3079 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3080 IVideoWindow
* pVideoWindow
;
3083 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
);
3085 EnterCriticalSection(&This
->cs
);
3087 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3090 hr
= IVideoWindow_Invoke(pVideoWindow
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
3092 LeaveCriticalSection(&This
->cs
);
3098 /*** IVideoWindow methods ***/
3099 static HRESULT WINAPI
VideoWindow_put_Caption(IVideoWindow
*iface
,
3101 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3102 IVideoWindow
* pVideoWindow
;
3105 TRACE("(%p/%p)->(%s (%p))\n", This
, iface
, debugstr_w(strCaption
), strCaption
);
3107 EnterCriticalSection(&This
->cs
);
3109 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3112 hr
= IVideoWindow_put_Caption(pVideoWindow
, strCaption
);
3114 LeaveCriticalSection(&This
->cs
);
3119 static HRESULT WINAPI
VideoWindow_get_Caption(IVideoWindow
*iface
,
3121 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3122 IVideoWindow
* pVideoWindow
;
3125 TRACE("(%p/%p)->(%p)\n", This
, iface
, strCaption
);
3127 EnterCriticalSection(&This
->cs
);
3129 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3132 hr
= IVideoWindow_get_Caption(pVideoWindow
, strCaption
);
3134 LeaveCriticalSection(&This
->cs
);
3139 static HRESULT WINAPI
VideoWindow_put_WindowStyle(IVideoWindow
*iface
,
3141 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3142 IVideoWindow
* pVideoWindow
;
3145 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyle
);
3147 EnterCriticalSection(&This
->cs
);
3149 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3152 hr
= IVideoWindow_put_WindowStyle(pVideoWindow
, WindowStyle
);
3154 LeaveCriticalSection(&This
->cs
);
3159 static HRESULT WINAPI
VideoWindow_get_WindowStyle(IVideoWindow
*iface
,
3160 long *WindowStyle
) {
3161 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3162 IVideoWindow
* pVideoWindow
;
3165 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyle
);
3167 EnterCriticalSection(&This
->cs
);
3169 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3172 hr
= IVideoWindow_get_WindowStyle(pVideoWindow
, WindowStyle
);
3174 LeaveCriticalSection(&This
->cs
);
3179 static HRESULT WINAPI
VideoWindow_put_WindowStyleEx(IVideoWindow
*iface
,
3180 long WindowStyleEx
) {
3181 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3182 IVideoWindow
* pVideoWindow
;
3185 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyleEx
);
3187 EnterCriticalSection(&This
->cs
);
3189 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3192 hr
= IVideoWindow_put_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3194 LeaveCriticalSection(&This
->cs
);
3199 static HRESULT WINAPI
VideoWindow_get_WindowStyleEx(IVideoWindow
*iface
,
3200 long *WindowStyleEx
) {
3201 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3202 IVideoWindow
* pVideoWindow
;
3205 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyleEx
);
3207 EnterCriticalSection(&This
->cs
);
3209 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3212 hr
= IVideoWindow_get_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3214 LeaveCriticalSection(&This
->cs
);
3219 static HRESULT WINAPI
VideoWindow_put_AutoShow(IVideoWindow
*iface
,
3221 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3222 IVideoWindow
* pVideoWindow
;
3225 TRACE("(%p/%p)->(%ld)\n", This
, iface
, AutoShow
);
3227 EnterCriticalSection(&This
->cs
);
3229 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3232 hr
= IVideoWindow_put_AutoShow(pVideoWindow
, AutoShow
);
3234 LeaveCriticalSection(&This
->cs
);
3239 static HRESULT WINAPI
VideoWindow_get_AutoShow(IVideoWindow
*iface
,
3241 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3242 IVideoWindow
* pVideoWindow
;
3245 TRACE("(%p/%p)->(%p)\n", This
, iface
, AutoShow
);
3247 EnterCriticalSection(&This
->cs
);
3249 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3252 hr
= IVideoWindow_get_AutoShow(pVideoWindow
, AutoShow
);
3254 LeaveCriticalSection(&This
->cs
);
3259 static HRESULT WINAPI
VideoWindow_put_WindowState(IVideoWindow
*iface
,
3261 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3262 IVideoWindow
* pVideoWindow
;
3265 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowState
);
3267 EnterCriticalSection(&This
->cs
);
3269 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3272 hr
= IVideoWindow_put_WindowState(pVideoWindow
, WindowState
);
3274 LeaveCriticalSection(&This
->cs
);
3279 static HRESULT WINAPI
VideoWindow_get_WindowState(IVideoWindow
*iface
,
3280 long *WindowState
) {
3281 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3282 IVideoWindow
* pVideoWindow
;
3285 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowState
);
3287 EnterCriticalSection(&This
->cs
);
3289 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3292 hr
= IVideoWindow_get_WindowState(pVideoWindow
, WindowState
);
3294 LeaveCriticalSection(&This
->cs
);
3299 static HRESULT WINAPI
VideoWindow_put_BackgroundPalette(IVideoWindow
*iface
,
3300 long BackgroundPalette
) {
3301 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3302 IVideoWindow
* pVideoWindow
;
3305 TRACE("(%p/%p)->(%ld)\n", This
, iface
, BackgroundPalette
);
3307 EnterCriticalSection(&This
->cs
);
3309 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3312 hr
= IVideoWindow_put_BackgroundPalette(pVideoWindow
, BackgroundPalette
);
3314 LeaveCriticalSection(&This
->cs
);
3319 static HRESULT WINAPI
VideoWindow_get_BackgroundPalette(IVideoWindow
*iface
,
3320 long *pBackgroundPalette
) {
3321 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3322 IVideoWindow
* pVideoWindow
;
3325 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBackgroundPalette
);
3327 EnterCriticalSection(&This
->cs
);
3329 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3332 hr
= IVideoWindow_get_BackgroundPalette(pVideoWindow
, pBackgroundPalette
);
3334 LeaveCriticalSection(&This
->cs
);
3339 static HRESULT WINAPI
VideoWindow_put_Visible(IVideoWindow
*iface
,
3341 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3342 IVideoWindow
* pVideoWindow
;
3345 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Visible
);
3347 EnterCriticalSection(&This
->cs
);
3349 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3352 hr
= IVideoWindow_put_Visible(pVideoWindow
, Visible
);
3354 LeaveCriticalSection(&This
->cs
);
3359 static HRESULT WINAPI
VideoWindow_get_Visible(IVideoWindow
*iface
,
3361 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3362 IVideoWindow
* pVideoWindow
;
3365 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVisible
);
3367 EnterCriticalSection(&This
->cs
);
3369 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3372 hr
= IVideoWindow_get_Visible(pVideoWindow
, pVisible
);
3374 LeaveCriticalSection(&This
->cs
);
3379 static HRESULT WINAPI
VideoWindow_put_Left(IVideoWindow
*iface
,
3381 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3382 IVideoWindow
* pVideoWindow
;
3385 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Left
);
3387 EnterCriticalSection(&This
->cs
);
3389 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3392 hr
= IVideoWindow_put_Left(pVideoWindow
, Left
);
3394 LeaveCriticalSection(&This
->cs
);
3399 static HRESULT WINAPI
VideoWindow_get_Left(IVideoWindow
*iface
,
3401 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3402 IVideoWindow
* pVideoWindow
;
3405 TRACE("(%p/%p)->(%p)\n", This
, iface
, pLeft
);
3407 EnterCriticalSection(&This
->cs
);
3409 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3412 hr
= IVideoWindow_get_Left(pVideoWindow
, pLeft
);
3414 LeaveCriticalSection(&This
->cs
);
3419 static HRESULT WINAPI
VideoWindow_put_Width(IVideoWindow
*iface
,
3421 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3422 IVideoWindow
* pVideoWindow
;
3425 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Width
);
3427 EnterCriticalSection(&This
->cs
);
3429 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3432 hr
= IVideoWindow_put_Width(pVideoWindow
, Width
);
3434 LeaveCriticalSection(&This
->cs
);
3439 static HRESULT WINAPI
VideoWindow_get_Width(IVideoWindow
*iface
,
3441 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3442 IVideoWindow
* pVideoWindow
;
3445 TRACE("(%p/%p)->(%p)\n", This
, iface
, pWidth
);
3447 EnterCriticalSection(&This
->cs
);
3449 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3452 hr
= IVideoWindow_get_Width(pVideoWindow
, pWidth
);
3454 LeaveCriticalSection(&This
->cs
);
3459 static HRESULT WINAPI
VideoWindow_put_Top(IVideoWindow
*iface
,
3461 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3462 IVideoWindow
* pVideoWindow
;
3465 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Top
);
3467 EnterCriticalSection(&This
->cs
);
3469 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3472 hr
= IVideoWindow_put_Top(pVideoWindow
, Top
);
3474 LeaveCriticalSection(&This
->cs
);
3479 static HRESULT WINAPI
VideoWindow_get_Top(IVideoWindow
*iface
,
3481 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3482 IVideoWindow
* pVideoWindow
;
3485 TRACE("(%p/%p)->(%p)\n", This
, iface
, pTop
);
3487 EnterCriticalSection(&This
->cs
);
3489 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3492 hr
= IVideoWindow_get_Top(pVideoWindow
, pTop
);
3494 LeaveCriticalSection(&This
->cs
);
3499 static HRESULT WINAPI
VideoWindow_put_Height(IVideoWindow
*iface
,
3501 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3502 IVideoWindow
* pVideoWindow
;
3505 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Height
);
3507 EnterCriticalSection(&This
->cs
);
3509 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3512 hr
= IVideoWindow_put_Height(pVideoWindow
, Height
);
3514 LeaveCriticalSection(&This
->cs
);
3519 static HRESULT WINAPI
VideoWindow_get_Height(IVideoWindow
*iface
,
3521 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3522 IVideoWindow
* pVideoWindow
;
3525 TRACE("(%p/%p)->(%p)\n", This
, iface
, pHeight
);
3527 EnterCriticalSection(&This
->cs
);
3529 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3532 hr
= IVideoWindow_get_Height(pVideoWindow
, pHeight
);
3534 LeaveCriticalSection(&This
->cs
);
3539 static HRESULT WINAPI
VideoWindow_put_Owner(IVideoWindow
*iface
,
3541 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3542 IVideoWindow
* pVideoWindow
;
3545 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Owner
);
3547 EnterCriticalSection(&This
->cs
);
3549 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3552 hr
= IVideoWindow_put_Owner(pVideoWindow
, Owner
);
3554 LeaveCriticalSection(&This
->cs
);
3559 static HRESULT WINAPI
VideoWindow_get_Owner(IVideoWindow
*iface
,
3561 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3562 IVideoWindow
* pVideoWindow
;
3565 TRACE("(%p/%p)->(%p)\n", This
, iface
, Owner
);
3567 EnterCriticalSection(&This
->cs
);
3569 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3572 hr
= IVideoWindow_get_Owner(pVideoWindow
, Owner
);
3574 LeaveCriticalSection(&This
->cs
);
3579 static HRESULT WINAPI
VideoWindow_put_MessageDrain(IVideoWindow
*iface
,
3581 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3582 IVideoWindow
* pVideoWindow
;
3585 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Drain
);
3587 EnterCriticalSection(&This
->cs
);
3589 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3592 hr
= IVideoWindow_put_MessageDrain(pVideoWindow
, Drain
);
3594 LeaveCriticalSection(&This
->cs
);
3599 static HRESULT WINAPI
VideoWindow_get_MessageDrain(IVideoWindow
*iface
,
3601 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3602 IVideoWindow
* pVideoWindow
;
3605 TRACE("(%p/%p)->(%p)\n", This
, iface
, Drain
);
3607 EnterCriticalSection(&This
->cs
);
3609 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3612 hr
= IVideoWindow_get_MessageDrain(pVideoWindow
, Drain
);
3614 LeaveCriticalSection(&This
->cs
);
3619 static HRESULT WINAPI
VideoWindow_get_BorderColor(IVideoWindow
*iface
,
3621 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3622 IVideoWindow
* pVideoWindow
;
3625 TRACE("(%p/%p)->(%p)\n", This
, iface
, Color
);
3627 EnterCriticalSection(&This
->cs
);
3629 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3632 hr
= IVideoWindow_get_BorderColor(pVideoWindow
, Color
);
3634 LeaveCriticalSection(&This
->cs
);
3639 static HRESULT WINAPI
VideoWindow_put_BorderColor(IVideoWindow
*iface
,
3641 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3642 IVideoWindow
* pVideoWindow
;
3645 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Color
);
3647 EnterCriticalSection(&This
->cs
);
3649 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3652 hr
= IVideoWindow_put_BorderColor(pVideoWindow
, Color
);
3654 LeaveCriticalSection(&This
->cs
);
3659 static HRESULT WINAPI
VideoWindow_get_FullScreenMode(IVideoWindow
*iface
,
3660 long *FullScreenMode
) {
3661 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3662 IVideoWindow
* pVideoWindow
;
3665 TRACE("(%p/%p)->(%p)\n", This
, iface
, FullScreenMode
);
3667 EnterCriticalSection(&This
->cs
);
3669 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3672 hr
= IVideoWindow_get_FullScreenMode(pVideoWindow
, FullScreenMode
);
3674 LeaveCriticalSection(&This
->cs
);
3679 static HRESULT WINAPI
VideoWindow_put_FullScreenMode(IVideoWindow
*iface
,
3680 long FullScreenMode
) {
3681 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3682 IVideoWindow
* pVideoWindow
;
3685 TRACE("(%p/%p)->(%ld)\n", This
, iface
, FullScreenMode
);
3687 EnterCriticalSection(&This
->cs
);
3689 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3692 hr
= IVideoWindow_put_FullScreenMode(pVideoWindow
, FullScreenMode
);
3694 LeaveCriticalSection(&This
->cs
);
3699 static HRESULT WINAPI
VideoWindow_SetWindowForeground(IVideoWindow
*iface
,
3701 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3702 IVideoWindow
* pVideoWindow
;
3705 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Focus
);
3707 EnterCriticalSection(&This
->cs
);
3709 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3712 hr
= IVideoWindow_SetWindowForeground(pVideoWindow
, Focus
);
3714 LeaveCriticalSection(&This
->cs
);
3719 static HRESULT WINAPI
VideoWindow_NotifyOwnerMessage(IVideoWindow
*iface
,
3724 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3725 IVideoWindow
* pVideoWindow
;
3728 TRACE("(%p/%p)->(%08x, %ld, %08lx, %08lx)\n", This
, iface
, (DWORD
) hwnd
, uMsg
, wParam
, lParam
);
3730 EnterCriticalSection(&This
->cs
);
3732 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3735 hr
= IVideoWindow_NotifyOwnerMessage(pVideoWindow
, hwnd
, uMsg
, wParam
, lParam
);
3737 LeaveCriticalSection(&This
->cs
);
3742 static HRESULT WINAPI
VideoWindow_SetWindowPosition(IVideoWindow
*iface
,
3747 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3748 IVideoWindow
* pVideoWindow
;
3751 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
3753 EnterCriticalSection(&This
->cs
);
3755 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3758 hr
= IVideoWindow_SetWindowPosition(pVideoWindow
, Left
, Top
, Width
, Height
);
3760 LeaveCriticalSection(&This
->cs
);
3765 static HRESULT WINAPI
VideoWindow_GetWindowPosition(IVideoWindow
*iface
,
3770 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3771 IVideoWindow
* pVideoWindow
;
3774 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3776 EnterCriticalSection(&This
->cs
);
3778 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3781 hr
= IVideoWindow_GetWindowPosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3783 LeaveCriticalSection(&This
->cs
);
3788 static HRESULT WINAPI
VideoWindow_GetMinIdealImageSize(IVideoWindow
*iface
,
3791 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3792 IVideoWindow
* pVideoWindow
;
3795 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3797 EnterCriticalSection(&This
->cs
);
3799 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3802 hr
= IVideoWindow_GetMinIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3804 LeaveCriticalSection(&This
->cs
);
3809 static HRESULT WINAPI
VideoWindow_GetMaxIdealImageSize(IVideoWindow
*iface
,
3812 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3813 IVideoWindow
* pVideoWindow
;
3816 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3818 EnterCriticalSection(&This
->cs
);
3820 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3823 hr
= IVideoWindow_GetMaxIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3825 LeaveCriticalSection(&This
->cs
);
3830 static HRESULT WINAPI
VideoWindow_GetRestorePosition(IVideoWindow
*iface
,
3835 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3836 IVideoWindow
* pVideoWindow
;
3839 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3841 EnterCriticalSection(&This
->cs
);
3843 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3846 hr
= IVideoWindow_GetRestorePosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3848 LeaveCriticalSection(&This
->cs
);
3853 static HRESULT WINAPI
VideoWindow_HideCursor(IVideoWindow
*iface
,
3855 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3856 IVideoWindow
* pVideoWindow
;
3859 TRACE("(%p/%p)->(%ld)\n", This
, iface
, HideCursor
);
3861 EnterCriticalSection(&This
->cs
);
3863 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3866 hr
= IVideoWindow_HideCursor(pVideoWindow
, HideCursor
);
3868 LeaveCriticalSection(&This
->cs
);
3873 static HRESULT WINAPI
VideoWindow_IsCursorHidden(IVideoWindow
*iface
,
3874 long *CursorHidden
) {
3875 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3876 IVideoWindow
* pVideoWindow
;
3879 TRACE("(%p/%p)->(%p)\n", This
, iface
, CursorHidden
);
3881 EnterCriticalSection(&This
->cs
);
3883 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3886 hr
= IVideoWindow_IsCursorHidden(pVideoWindow
, CursorHidden
);
3888 LeaveCriticalSection(&This
->cs
);
3894 static const IVideoWindowVtbl IVideoWindow_VTable
=
3896 VideoWindow_QueryInterface
,
3898 VideoWindow_Release
,
3899 VideoWindow_GetTypeInfoCount
,
3900 VideoWindow_GetTypeInfo
,
3901 VideoWindow_GetIDsOfNames
,
3903 VideoWindow_put_Caption
,
3904 VideoWindow_get_Caption
,
3905 VideoWindow_put_WindowStyle
,
3906 VideoWindow_get_WindowStyle
,
3907 VideoWindow_put_WindowStyleEx
,
3908 VideoWindow_get_WindowStyleEx
,
3909 VideoWindow_put_AutoShow
,
3910 VideoWindow_get_AutoShow
,
3911 VideoWindow_put_WindowState
,
3912 VideoWindow_get_WindowState
,
3913 VideoWindow_put_BackgroundPalette
,
3914 VideoWindow_get_BackgroundPalette
,
3915 VideoWindow_put_Visible
,
3916 VideoWindow_get_Visible
,
3917 VideoWindow_put_Left
,
3918 VideoWindow_get_Left
,
3919 VideoWindow_put_Width
,
3920 VideoWindow_get_Width
,
3921 VideoWindow_put_Top
,
3922 VideoWindow_get_Top
,
3923 VideoWindow_put_Height
,
3924 VideoWindow_get_Height
,
3925 VideoWindow_put_Owner
,
3926 VideoWindow_get_Owner
,
3927 VideoWindow_put_MessageDrain
,
3928 VideoWindow_get_MessageDrain
,
3929 VideoWindow_get_BorderColor
,
3930 VideoWindow_put_BorderColor
,
3931 VideoWindow_get_FullScreenMode
,
3932 VideoWindow_put_FullScreenMode
,
3933 VideoWindow_SetWindowForeground
,
3934 VideoWindow_NotifyOwnerMessage
,
3935 VideoWindow_SetWindowPosition
,
3936 VideoWindow_GetWindowPosition
,
3937 VideoWindow_GetMinIdealImageSize
,
3938 VideoWindow_GetMaxIdealImageSize
,
3939 VideoWindow_GetRestorePosition
,
3940 VideoWindow_HideCursor
,
3941 VideoWindow_IsCursorHidden
3945 /*** IUnknown methods ***/
3946 static HRESULT WINAPI
MediaEvent_QueryInterface(IMediaEventEx
*iface
,
3949 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3951 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
3953 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
3956 static ULONG WINAPI
MediaEvent_AddRef(IMediaEventEx
*iface
) {
3957 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3959 TRACE("(%p/%p)->()\n", This
, iface
);
3961 return Filtergraph_AddRef(This
);
3964 static ULONG WINAPI
MediaEvent_Release(IMediaEventEx
*iface
) {
3965 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3967 TRACE("(%p/%p)->()\n", This
, iface
);
3969 return Filtergraph_Release(This
);
3972 /*** IDispatch methods ***/
3973 static HRESULT WINAPI
MediaEvent_GetTypeInfoCount(IMediaEventEx
*iface
,
3975 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3977 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
3982 static HRESULT WINAPI
MediaEvent_GetTypeInfo(IMediaEventEx
*iface
,
3985 ITypeInfo
**ppTInfo
) {
3986 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3988 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
3993 static HRESULT WINAPI
MediaEvent_GetIDsOfNames(IMediaEventEx
*iface
,
3999 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4001 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
4006 static HRESULT WINAPI
MediaEvent_Invoke(IMediaEventEx
*iface
,
4007 DISPID dispIdMember
,
4011 DISPPARAMS
*pDispParams
,
4013 EXCEPINFO
*pExepInfo
,
4015 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4017 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
);
4022 /*** IMediaEvent methods ***/
4023 static HRESULT WINAPI
MediaEvent_GetEventHandle(IMediaEventEx
*iface
,
4025 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4027 TRACE("(%p/%p)->(%p)\n", This
, iface
, hEvent
);
4029 *hEvent
= (OAEVENT
)This
->evqueue
.msg_event
;
4034 static HRESULT WINAPI
MediaEvent_GetEvent(IMediaEventEx
*iface
,
4039 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4042 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This
, iface
, lEventCode
, lParam1
, lParam2
, msTimeout
);
4044 if (EventsQueue_GetEvent(&This
->evqueue
, &evt
, msTimeout
))
4046 *lEventCode
= evt
.lEventCode
;
4047 *lParam1
= evt
.lParam1
;
4048 *lParam2
= evt
.lParam2
;
4056 static HRESULT WINAPI
MediaEvent_WaitForCompletion(IMediaEventEx
*iface
,
4059 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4061 TRACE("(%p/%p)->(%ld, %p)\n", This
, iface
, msTimeout
, pEvCode
);
4063 if (WaitForSingleObject(This
->hEventCompletion
, msTimeout
) == WAIT_OBJECT_0
)
4065 *pEvCode
= This
->CompletionStatus
;
4073 static HRESULT WINAPI
MediaEvent_CancelDefaultHandling(IMediaEventEx
*iface
,
4075 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4077 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4079 if (lEvCode
== EC_COMPLETE
)
4080 This
->HandleEcComplete
= FALSE
;
4081 else if (lEvCode
== EC_REPAINT
)
4082 This
->HandleEcRepaint
= FALSE
;
4089 static HRESULT WINAPI
MediaEvent_RestoreDefaultHandling(IMediaEventEx
*iface
,
4091 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4093 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4095 if (lEvCode
== EC_COMPLETE
)
4096 This
->HandleEcComplete
= TRUE
;
4097 else if (lEvCode
== EC_REPAINT
)
4098 This
->HandleEcRepaint
= TRUE
;
4105 static HRESULT WINAPI
MediaEvent_FreeEventParams(IMediaEventEx
*iface
,
4109 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4111 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This
, iface
, lEvCode
, lParam1
, lParam2
);
4116 /*** IMediaEventEx methods ***/
4117 static HRESULT WINAPI
MediaEvent_SetNotifyWindow(IMediaEventEx
*iface
,
4120 LONG_PTR lInstanceData
) {
4121 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4123 TRACE("(%p/%p)->(%08x, %ld, %08lx)\n", This
, iface
, (DWORD
) hwnd
, lMsg
, lInstanceData
);
4125 This
->notif
.hWnd
= (HWND
)hwnd
;
4126 This
->notif
.msg
= lMsg
;
4127 This
->notif
.instance
= (long) lInstanceData
;
4132 static HRESULT WINAPI
MediaEvent_SetNotifyFlags(IMediaEventEx
*iface
,
4133 long lNoNotifyFlags
) {
4134 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4136 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lNoNotifyFlags
);
4138 if ((lNoNotifyFlags
!= 0) && (lNoNotifyFlags
!= 1))
4139 return E_INVALIDARG
;
4141 This
->notif
.disabled
= lNoNotifyFlags
;
4146 static HRESULT WINAPI
MediaEvent_GetNotifyFlags(IMediaEventEx
*iface
,
4147 long *lplNoNotifyFlags
) {
4148 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4150 TRACE("(%p/%p)->(%p)\n", This
, iface
, lplNoNotifyFlags
);
4152 if (!lplNoNotifyFlags
)
4155 *lplNoNotifyFlags
= This
->notif
.disabled
;
4161 static const IMediaEventExVtbl IMediaEventEx_VTable
=
4163 MediaEvent_QueryInterface
,
4166 MediaEvent_GetTypeInfoCount
,
4167 MediaEvent_GetTypeInfo
,
4168 MediaEvent_GetIDsOfNames
,
4170 MediaEvent_GetEventHandle
,
4171 MediaEvent_GetEvent
,
4172 MediaEvent_WaitForCompletion
,
4173 MediaEvent_CancelDefaultHandling
,
4174 MediaEvent_RestoreDefaultHandling
,
4175 MediaEvent_FreeEventParams
,
4176 MediaEvent_SetNotifyWindow
,
4177 MediaEvent_SetNotifyFlags
,
4178 MediaEvent_GetNotifyFlags
4182 static HRESULT WINAPI
MediaFilter_QueryInterface(IMediaFilter
*iface
, REFIID riid
, LPVOID
*ppv
)
4184 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4186 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4189 static ULONG WINAPI
MediaFilter_AddRef(IMediaFilter
*iface
)
4191 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4193 return Filtergraph_AddRef(This
);
4196 static ULONG WINAPI
MediaFilter_Release(IMediaFilter
*iface
)
4198 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4200 return Filtergraph_Release(This
);
4203 static HRESULT WINAPI
MediaFilter_GetClassID(IMediaFilter
*iface
, CLSID
* pClassID
)
4205 FIXME("(%p): stub\n", pClassID
);
4210 static HRESULT WINAPI
MediaFilter_Stop(IMediaFilter
*iface
)
4212 FIXME("(): stub\n");
4217 static HRESULT WINAPI
MediaFilter_Pause(IMediaFilter
*iface
)
4219 FIXME("(): stub\n");
4224 static HRESULT WINAPI
MediaFilter_Run(IMediaFilter
*iface
, REFERENCE_TIME tStart
)
4226 FIXME("(0x%s): stub\n", wine_dbgstr_longlong(tStart
));
4231 static HRESULT WINAPI
MediaFilter_GetState(IMediaFilter
*iface
, DWORD dwMsTimeout
, FILTER_STATE
* pState
)
4233 FIXME("(%d, %p): stub\n", dwMsTimeout
, pState
);
4238 static HRESULT WINAPI
MediaFilter_SetSyncSource(IMediaFilter
*iface
, IReferenceClock
*pClock
)
4240 FIXME("(%p): stub\n", pClock
);
4245 static HRESULT WINAPI
MediaFilter_GetSyncSource(IMediaFilter
*iface
, IReferenceClock
**ppClock
)
4247 FIXME("(%p): stub\n", ppClock
);
4252 static const IMediaFilterVtbl IMediaFilter_VTable
=
4254 MediaFilter_QueryInterface
,
4256 MediaFilter_Release
,
4257 MediaFilter_GetClassID
,
4261 MediaFilter_GetState
,
4262 MediaFilter_SetSyncSource
,
4263 MediaFilter_GetSyncSource
4266 static HRESULT WINAPI
MediaEventSink_QueryInterface(IMediaEventSink
*iface
, REFIID riid
, LPVOID
*ppv
)
4268 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4270 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4273 static ULONG WINAPI
MediaEventSink_AddRef(IMediaEventSink
*iface
)
4275 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4277 return Filtergraph_AddRef(This
);
4280 static ULONG WINAPI
MediaEventSink_Release(IMediaEventSink
*iface
)
4282 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4284 return Filtergraph_Release(This
);
4287 static HRESULT WINAPI
MediaEventSink_Notify(IMediaEventSink
*iface
, long EventCode
, LONG_PTR EventParam1
, LONG_PTR EventParam2
)
4289 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4292 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This
, iface
, EventCode
, EventParam1
, EventParam2
);
4294 /* We need thread safety here, let's use the events queue's one */
4295 EnterCriticalSection(&This
->evqueue
.msg_crst
);
4297 if ((EventCode
== EC_COMPLETE
) && This
->HandleEcComplete
)
4299 TRACE("Process EC_COMPLETE notification\n");
4300 if (++This
->EcCompleteCount
== This
->nRenderers
)
4302 evt
.lEventCode
= EC_COMPLETE
;
4305 TRACE("Send EC_COMPLETE to app\n");
4306 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4307 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4309 TRACE("Send Window message\n");
4310 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4312 This
->CompletionStatus
= EC_COMPLETE
;
4313 SetEvent(This
->hEventCompletion
);
4316 else if ((EventCode
== EC_REPAINT
) && This
->HandleEcRepaint
)
4318 /* FIXME: Not handled yet */
4322 evt
.lEventCode
= EventCode
;
4323 evt
.lParam1
= EventParam1
;
4324 evt
.lParam2
= EventParam2
;
4325 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4326 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4327 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4330 LeaveCriticalSection(&This
->evqueue
.msg_crst
);
4334 static const IMediaEventSinkVtbl IMediaEventSink_VTable
=
4336 MediaEventSink_QueryInterface
,
4337 MediaEventSink_AddRef
,
4338 MediaEventSink_Release
,
4339 MediaEventSink_Notify
4342 static HRESULT WINAPI
GraphConfig_QueryInterface(IGraphConfig
*iface
, REFIID riid
, LPVOID
*ppv
)
4344 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4346 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4349 static ULONG WINAPI
GraphConfig_AddRef(IGraphConfig
*iface
)
4351 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4353 return Filtergraph_AddRef(This
);
4356 static ULONG WINAPI
GraphConfig_Release(IGraphConfig
*iface
)
4358 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4360 return Filtergraph_Release(This
);
4363 static HRESULT WINAPI
GraphConfig_Reconnect(IGraphConfig
*iface
,
4366 const AM_MEDIA_TYPE
* pmtFirstConnection
,
4367 IBaseFilter
* pUsingFilter
,
4371 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4373 FIXME("(%p)->(%p, %p, %p, %p, %p, %x): stub!\n", This
, pOutputPin
, pInputPin
, pmtFirstConnection
, pUsingFilter
, hAbortEvent
, dwFlags
);
4378 static HRESULT WINAPI
GraphConfig_Reconfigure(IGraphConfig
*iface
,
4379 IGraphConfigCallback
* pCallback
,
4384 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4386 FIXME("(%p)->(%p, %p, %x, %p): stub!\n", This
, pCallback
, pvContext
, dwFlags
, hAbortEvent
);
4391 static HRESULT WINAPI
GraphConfig_AddFilterToCache(IGraphConfig
*iface
,
4392 IBaseFilter
* pFilter
)
4394 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4396 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4401 static HRESULT WINAPI
GraphConfig_EnumCacheFilter(IGraphConfig
*iface
,
4402 IEnumFilters
** pEnum
)
4404 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4406 FIXME("(%p)->(%p): stub!\n", This
, pEnum
);
4411 static HRESULT WINAPI
GraphConfig_RemoveFilterFromCache(IGraphConfig
*iface
,
4412 IBaseFilter
* pFilter
)
4414 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4416 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4421 static HRESULT WINAPI
GraphConfig_GetStartTime(IGraphConfig
*iface
,
4422 REFERENCE_TIME
* prtStart
)
4424 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4426 FIXME("(%p)->(%p): stub!\n", This
, prtStart
);
4431 static HRESULT WINAPI
GraphConfig_PushThroughData(IGraphConfig
*iface
,
4433 IPinConnection
* pConnection
,
4436 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4438 FIXME("(%p)->(%p, %p, %p): stub!\n", This
, pOutputPin
, pConnection
, hEventAbort
);
4443 static HRESULT WINAPI
GraphConfig_SetFilterFlags(IGraphConfig
*iface
,
4444 IBaseFilter
* pFilter
,
4447 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4449 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4454 static HRESULT WINAPI
GraphConfig_GetFilterFlags(IGraphConfig
*iface
,
4455 IBaseFilter
* pFilter
,
4458 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4460 FIXME("(%p)->(%p, %p): stub!\n", This
, pFilter
, dwFlags
);
4465 static HRESULT WINAPI
GraphConfig_RemoveFilterEx(IGraphConfig
*iface
,
4466 IBaseFilter
* pFilter
,
4469 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4471 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4476 static const IGraphConfigVtbl IGraphConfig_VTable
=
4478 GraphConfig_QueryInterface
,
4480 GraphConfig_Release
,
4481 GraphConfig_Reconnect
,
4482 GraphConfig_Reconfigure
,
4483 GraphConfig_AddFilterToCache
,
4484 GraphConfig_EnumCacheFilter
,
4485 GraphConfig_RemoveFilterFromCache
,
4486 GraphConfig_GetStartTime
,
4487 GraphConfig_PushThroughData
,
4488 GraphConfig_SetFilterFlags
,
4489 GraphConfig_GetFilterFlags
,
4490 GraphConfig_RemoveFilterEx
4493 /* This is the only function that actually creates a FilterGraph class... */
4494 HRESULT
FilterGraph_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4496 IFilterGraphImpl
*fimpl
;
4499 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
4502 return CLASS_E_NOAGGREGATION
;
4504 fimpl
= CoTaskMemAlloc(sizeof(*fimpl
));
4505 fimpl
->IGraphBuilder_vtbl
= &IGraphBuilder_VTable
;
4506 fimpl
->IMediaControl_vtbl
= &IMediaControl_VTable
;
4507 fimpl
->IMediaSeeking_vtbl
= &IMediaSeeking_VTable
;
4508 fimpl
->IBasicAudio_vtbl
= &IBasicAudio_VTable
;
4509 fimpl
->IBasicVideo_vtbl
= &IBasicVideo_VTable
;
4510 fimpl
->IVideoWindow_vtbl
= &IVideoWindow_VTable
;
4511 fimpl
->IMediaEventEx_vtbl
= &IMediaEventEx_VTable
;
4512 fimpl
->IMediaFilter_vtbl
= &IMediaFilter_VTable
;
4513 fimpl
->IMediaEventSink_vtbl
= &IMediaEventSink_VTable
;
4514 fimpl
->IGraphConfig_vtbl
= &IGraphConfig_VTable
;
4515 fimpl
->IMediaPosition_vtbl
= &IMediaPosition_VTable
;
4517 fimpl
->ppFiltersInGraph
= NULL
;
4518 fimpl
->pFilterNames
= NULL
;
4519 fimpl
->nFilters
= 0;
4520 fimpl
->filterCapacity
= 0;
4521 fimpl
->nameIndex
= 1;
4522 fimpl
->hEventCompletion
= CreateEventW(0, TRUE
, FALSE
, 0);
4523 fimpl
->HandleEcComplete
= TRUE
;
4524 fimpl
->HandleEcRepaint
= TRUE
;
4525 fimpl
->notif
.hWnd
= 0;
4526 fimpl
->notif
.disabled
= FALSE
;
4527 fimpl
->nRenderers
= 0;
4528 fimpl
->EcCompleteCount
= 0;
4529 fimpl
->state
= State_Stopped
;
4530 EventsQueue_Init(&fimpl
->evqueue
);
4531 InitializeCriticalSection(&fimpl
->cs
);
4532 fimpl
->cs
.DebugInfo
->Spare
[0] = (DWORD_PTR
)(__FILE__
": IFilterGraphImpl.cs");
4533 fimpl
->nItfCacheEntries
= 0;
4535 hr
= CoCreateInstance(&CLSID_FilterMapper2
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IFilterMapper2
, (LPVOID
*)&fimpl
->pFilterMapper2
);
4537 ERR("Unable to create filter mapper (%x)\n", hr
);
4545 HRESULT
FilterGraphNoThread_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4547 FIXME("CLSID_FilterGraphNoThread partially implemented - Forwarding to CLSID_FilterGraph\n");
4548 return FilterGraph_create(pUnkOuter
, ppObj
);