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 /* FIXME: disconnect pins */
420 hr
= IBaseFilter_JoinFilterGraph(pFilter
, NULL
, This
->pFilterNames
[i
]);
423 IPin_Release(pFilter
);
424 CoTaskMemFree(This
->pFilterNames
[i
]);
425 memmove(This
->ppFiltersInGraph
+i
, This
->ppFiltersInGraph
+i
+1, sizeof(IBaseFilter
*)*(This
->nFilters
- 1 - i
));
426 memmove(This
->pFilterNames
+i
, This
->pFilterNames
+i
+1, sizeof(LPWSTR
)*(This
->nFilters
- 1 - i
));
428 /* Invalidate interfaces in the cache */
429 for (i
= 0; i
< This
->nItfCacheEntries
; i
++)
430 if (pFilter
== This
->ItfCacheEntries
[i
].filter
)
432 IUnknown_Release(This
->ItfCacheEntries
[i
].iface
);
433 This
->ItfCacheEntries
[i
].iface
= NULL
;
434 This
->ItfCacheEntries
[i
].filter
= NULL
;
442 return hr
; /* FIXME: check this error code */
445 static HRESULT WINAPI
GraphBuilder_EnumFilters(IGraphBuilder
*iface
,
446 IEnumFilters
**ppEnum
) {
447 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
449 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppEnum
);
451 return IEnumFiltersImpl_Construct(This
->ppFiltersInGraph
, This
->nFilters
, ppEnum
);
454 static HRESULT WINAPI
GraphBuilder_FindFilterByName(IGraphBuilder
*iface
,
456 IBaseFilter
**ppFilter
) {
457 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
460 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_w(pName
), pName
, ppFilter
);
464 for (i
= 0; i
< This
->nFilters
; i
++)
466 if (!strcmpW(pName
, This
->pFilterNames
[i
]))
468 *ppFilter
= This
->ppFiltersInGraph
[i
];
469 IBaseFilter_AddRef(*ppFilter
);
474 return E_FAIL
; /* FIXME: check this error code */
477 /* NOTE: despite the implication, it doesn't matter which
478 * way round you put in the input and output pins */
479 static HRESULT WINAPI
GraphBuilder_ConnectDirect(IGraphBuilder
*iface
,
482 const AM_MEDIA_TYPE
*pmt
) {
486 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
488 TRACE("(%p/%p)->(%p, %p, %p)\n", This
, iface
, ppinIn
, ppinOut
, pmt
);
490 /* FIXME: check pins are in graph */
492 if (TRACE_ON(quartz
))
496 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
500 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
501 IBaseFilter_Release(PinInfo
.pFilter
);
503 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
507 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
508 IBaseFilter_Release(PinInfo
.pFilter
);
511 hr
= IPin_QueryDirection(ppinIn
, &dir
);
514 if (dir
== PINDIR_INPUT
)
515 hr
= IPin_Connect(ppinOut
, ppinIn
, pmt
);
517 hr
= IPin_Connect(ppinIn
, ppinOut
, pmt
);
523 static HRESULT WINAPI
GraphBuilder_Reconnect(IGraphBuilder
*iface
,
525 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
526 IPin
*pConnectedTo
= NULL
;
528 PIN_DIRECTION pindir
;
530 IPin_QueryDirection(ppin
, &pindir
);
531 hr
= IPin_ConnectedTo(ppin
, &pConnectedTo
);
533 TRACE("Querying connected to failed: %x\n", hr
);
536 IPin_Disconnect(ppin
);
537 IPin_Disconnect(pConnectedTo
);
538 if (pindir
== PINDIR_INPUT
)
539 hr
= IPin_Connect(pConnectedTo
, ppin
, NULL
);
541 hr
= IPin_Connect(ppin
, pConnectedTo
, NULL
);
542 IPin_Release(pConnectedTo
);
544 ERR("Reconnecting pins failed, pins are not connected now..\n");
545 TRACE("(%p->%p) -- %p %p -> %x\n", iface
, This
, ppin
, pConnectedTo
, hr
);
549 static HRESULT WINAPI
GraphBuilder_Disconnect(IGraphBuilder
*iface
,
551 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
553 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppin
);
555 return IPin_Disconnect(ppin
);
558 static HRESULT WINAPI
GraphBuilder_SetDefaultSyncSource(IGraphBuilder
*iface
) {
559 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
561 TRACE("(%p/%p)->(): stub !!!\n", iface
, This
);
566 static HRESULT
GetFilterInfo(IMoniker
* pMoniker
, GUID
* pclsid
, VARIANT
* pvar
)
568 static const WCHAR wszClsidName
[] = {'C','L','S','I','D',0};
569 static const WCHAR wszFriendlyName
[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
570 IPropertyBag
* pPropBagCat
= NULL
;
574 V_VT(pvar
) = VT_BSTR
;
576 hr
= IMoniker_BindToStorage(pMoniker
, NULL
, NULL
, &IID_IPropertyBag
, (LPVOID
*)&pPropBagCat
);
579 hr
= IPropertyBag_Read(pPropBagCat
, wszClsidName
, pvar
, NULL
);
582 hr
= CLSIDFromString(V_UNION(pvar
, bstrVal
), pclsid
);
585 hr
= IPropertyBag_Read(pPropBagCat
, wszFriendlyName
, pvar
, NULL
);
588 TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid
), debugstr_w(V_UNION(pvar
, bstrVal
)));
591 IPropertyBag_Release(pPropBagCat
);
596 static HRESULT
GetInternalConnections(IBaseFilter
* pfilter
, IPin
* pinputpin
, IPin
*** pppins
, ULONG
* pnb
)
601 TRACE("(%p, %p, %p, %p)\n", pfilter
, pinputpin
, pppins
, pnb
);
602 hr
= IPin_QueryInternalConnections(pinputpin
, NULL
, &nb
);
605 } else if (hr
== S_FALSE
) {
606 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*nb
);
607 hr
= IPin_QueryInternalConnections(pinputpin
, *pppins
, &nb
);
609 ERR("Error (%x)\n", hr
);
611 } else if (hr
== E_NOTIMPL
) {
612 /* Input connected to all outputs */
613 IEnumPins
* penumpins
;
616 TRACE("E_NOTIMPL\n");
617 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
619 ERR("filter Enumpins failed (%x)\n", hr
);
623 /* Count output pins */
624 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
625 PIN_DIRECTION pindir
;
626 IPin_QueryDirection(ppin
, &pindir
);
627 if (pindir
== PINDIR_OUTPUT
)
631 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*i
);
632 /* Retrieve output pins */
633 IEnumPins_Reset(penumpins
);
635 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
636 PIN_DIRECTION pindir
;
637 IPin_QueryDirection(ppin
, &pindir
);
638 if (pindir
== PINDIR_OUTPUT
)
639 (*pppins
)[i
++] = ppin
;
645 ERR("Next failed (%x)\n", hr
);
648 IEnumPins_Release(penumpins
);
649 } else if (FAILED(hr
)) {
650 ERR("Cannot get internal connection (%x)\n", hr
);
658 /*** IGraphBuilder methods ***/
659 static HRESULT WINAPI
GraphBuilder_Connect(IGraphBuilder
*iface
,
662 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
665 IEnumMediaTypes
* penummt
;
667 IEnumPins
* penumpins
;
668 IEnumMoniker
* pEnumMoniker
;
676 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, ppinOut
, ppinIn
);
678 if (TRACE_ON(quartz
))
680 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
684 TRACE("Filter owning first pin => %p\n", PinInfo
.pFilter
);
685 IBaseFilter_Release(PinInfo
.pFilter
);
687 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
691 TRACE("Filter owning second pin => %p\n", PinInfo
.pFilter
);
692 IBaseFilter_Release(PinInfo
.pFilter
);
695 /* Try direct connection first */
696 hr
= IPin_Connect(ppinOut
, ppinIn
, NULL
);
700 TRACE("Direct connection failed, trying to insert other filters\n");
702 hr
= IPin_QueryPinInfo(ppinIn
, &PinInfo
);
706 hr
= IBaseFilter_GetClassID(PinInfo
.pFilter
, &FilterCLSID
);
710 IBaseFilter_Release(PinInfo
.pFilter
);
712 /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream
713 * filter to the minor mediatype of input pin of the renderer */
714 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
716 ERR("EnumMediaTypes (%x)\n", hr
);
720 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
722 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
727 ERR("No media type found!\n");
730 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
731 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
733 /* Try to find a suitable filter that can connect to the pin to render */
734 tab
[0] = mt
->majortype
;
735 tab
[1] = mt
->subtype
;
736 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
738 ERR("Unable to enum filters (%x)\n", hr
);
742 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
747 IPin
* ppinfilter
= NULL
;
748 IBaseFilter
* pfilter
= NULL
;
750 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
751 IMoniker_Release(pMoniker
);
753 ERR("Unable to retrieve filter info (%x)\n", hr
);
757 if (IsEqualGUID(&clsid
, &FilterCLSID
)) {
758 /* Skip filter (same as the one the output pin belongs to) */
762 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
764 ERR("Unable to create filter (%x), trying next one\n", hr
);
768 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, NULL
);
770 ERR("Unable to add filter (%x)\n", hr
);
771 IBaseFilter_Release(pfilter
);
776 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
778 ERR("Enumpins (%x)\n", hr
);
782 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
783 IEnumPins_Release(penumpins
);
786 ERR("Next (%x)\n", hr
);
794 hr
= IPin_Connect(ppinOut
, ppinfilter
, NULL
);
796 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
799 TRACE("Successfully connected to filter, follow chain...\n");
801 /* Render all output pins of the filter by calling IGraphBuilder_Render on each of them */
802 hr
= GetInternalConnections(pfilter
, ppinfilter
, &ppins
, &nb
);
807 IPin_Disconnect(ppinOut
);
810 TRACE("pins to consider: %d\n", nb
);
811 for(i
= 0; i
< nb
; i
++) {
812 TRACE("Processing pin %d\n", i
);
813 hr
= IGraphBuilder_Connect(iface
, ppins
[i
], ppinIn
);
815 TRACE("Cannot render pin %p (%x)\n", ppinfilter
, hr
);
817 IPin_Release(ppins
[i
]);
818 if (SUCCEEDED(hr
)) break;
820 while (++i
< nb
) IPin_Release(ppins
[i
]);
821 CoTaskMemFree(ppins
);
822 IPin_Release(ppinfilter
);
827 if (ppinfilter
) IPin_Release(ppinfilter
);
829 IGraphBuilder_RemoveFilter(iface
, pfilter
);
830 IBaseFilter_Release(pfilter
);
834 IEnumMediaTypes_Release(penummt
);
840 static HRESULT WINAPI
GraphBuilder_Render(IGraphBuilder
*iface
,
842 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
843 IEnumMediaTypes
* penummt
;
848 IEnumMoniker
* pEnumMoniker
;
853 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppinOut
);
855 if (TRACE_ON(quartz
))
859 hr
= IPin_QueryPinInfo(ppinOut
, &PinInfo
);
863 TRACE("Filter owning pin => %p\n", PinInfo
.pFilter
);
864 IBaseFilter_Release(PinInfo
.pFilter
);
867 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
869 ERR("EnumMediaTypes (%x)\n", hr
);
875 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
877 ERR("IEnumMediaTypes_Next (%x)\n", hr
);
882 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
883 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
885 /* Try to find a suitable renderer with the same media type */
886 tab
[0] = mt
->majortype
;
888 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, TRUE
, FALSE
, 0, NULL
, NULL
, NULL
);
890 ERR("Unable to enum filters (%x)\n", hr
);
894 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
899 IBaseFilter
* pfilter
= NULL
;
900 IEnumPins
* penumpins
;
903 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
904 IMoniker_Release(pMoniker
);
906 ERR("Unable to retrieve filter info (%x)\n", hr
);
910 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
912 ERR("Unable to create filter (%x), trying next one\n", hr
);
916 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, NULL
);
918 ERR("Unable to add filter (%x)\n", hr
);
923 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
925 ERR("Splitter Enumpins (%x)\n", hr
);
928 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
930 ERR("Next (%x)\n", hr
);
937 IEnumPins_Release(penumpins
);
939 /* Connect the pin to render to the renderer */
940 hr
= IGraphBuilder_Connect(iface
, ppinOut
, ppinfilter
);
942 TRACE("Unable to connect to renderer (%x)\n", hr
);
949 IGraphBuilder_RemoveFilter(iface
, pfilter
);
950 IBaseFilter_Release(pfilter
);
958 IEnumMediaTypes_Release(penummt
);
963 static HRESULT WINAPI
GraphBuilder_RenderFile(IGraphBuilder
*iface
,
965 LPCWSTR lpcwstrPlayList
) {
966 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
967 static const WCHAR string
[] = {'R','e','a','d','e','r',0};
968 IBaseFilter
* preader
= NULL
;
969 IBaseFilter
* psplitter
= NULL
;
972 IEnumPins
* penumpins
;
975 IEnumMoniker
* pEnumMoniker
= NULL
;
980 IFileSourceFilter
* pfile
= NULL
;
984 TRACE("(%p/%p)->(%s, %s)\n", This
, iface
, debugstr_w(lpcwstrFile
), debugstr_w(lpcwstrPlayList
));
986 if (lpcwstrPlayList
!= NULL
)
989 hr
= IGraphBuilder_AddSourceFilter(iface
, lpcwstrFile
, string
, &preader
);
991 /* Retrieve file media type */
993 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
995 hr
= IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
996 IFileSourceFilter_Release(pfile
);
1000 hr
= IBaseFilter_EnumPins(preader
, &penumpins
);
1001 if (SUCCEEDED(hr
)) {
1002 hr
= IEnumPins_Next(penumpins
, 1, &ppinreader
, &pin
);
1003 IEnumPins_Release(penumpins
);
1006 if (SUCCEEDED(hr
)) {
1007 tab
[0] = mt
.majortype
;
1008 tab
[1] = mt
.subtype
;
1009 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
1015 IEnumMoniker_Release(pEnumMoniker
);
1017 IGraphBuilder_RemoveFilter(iface
, preader
);
1018 IBaseFilter_Release(preader
);
1023 hr
= VFW_E_CANNOT_RENDER
;
1024 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
1029 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
1030 IMoniker_Release(pMoniker
);
1032 ERR("Unable to retrieve filter info (%x)\n", hr
);
1036 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&psplitter
);
1038 ERR("Unable to create filter (%x), trying next one\n", hr
);
1042 hr
= IGraphBuilder_AddFilter(iface
, psplitter
, NULL
);
1044 ERR("Unable add filter (%x)\n", hr
);
1045 IBaseFilter_Release(psplitter
);
1049 /* Connect file source and splitter filters together */
1050 /* Make the splitter analyze incoming data */
1052 hr
= IBaseFilter_EnumPins(psplitter
, &penumpins
);
1053 if (SUCCEEDED(hr
)) {
1054 hr
= IEnumPins_Next(penumpins
, 1, &ppinsplitter
, &pin
);
1055 IEnumPins_Release(penumpins
);
1059 hr
= IPin_Connect(ppinreader
, ppinsplitter
, NULL
);
1061 /* Make sure there's some output pins in the filter */
1063 hr
= GetInternalConnections(psplitter
, ppinsplitter
, &ppins
, &nb
);
1064 if (SUCCEEDED(hr
)) {
1066 IPin_Disconnect(ppinreader
);
1067 TRACE("No output pins found in filter\n");
1068 hr
= VFW_E_CANNOT_RENDER
;
1072 IPin_Release(ppinsplitter
);
1073 ppinsplitter
= NULL
;
1075 if (SUCCEEDED(hr
)) {
1076 TRACE("Successfully connected to filter\n");
1080 TRACE("Cannot connect to filter (%x), trying next one\n", hr
);
1083 CoTaskMemFree(ppins
);
1086 IGraphBuilder_RemoveFilter(iface
, psplitter
);
1087 IBaseFilter_Release(psplitter
);
1091 /* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
1092 if (SUCCEEDED(hr
)) {
1095 TRACE("pins to consider: %d\n", nb
);
1096 for(i
= 0; i
< nb
; i
++) {
1097 TRACE("Processing pin %d\n", i
);
1098 hr
= IGraphBuilder_Render(iface
, ppins
[i
]);
1100 ERR("Cannot render pin %p (%x)\n", ppins
[i
], hr
);
1103 IPin_Release(ppins
[i
]);
1105 CoTaskMemFree(ppins
);
1107 hr
= (partial
? VFW_S_PARTIAL_RENDER
: S_OK
);
1113 static HRESULT WINAPI
GraphBuilder_AddSourceFilter(IGraphBuilder
*iface
,
1114 LPCWSTR lpcwstrFileName
,
1115 LPCWSTR lpcwstrFilterName
,
1116 IBaseFilter
**ppFilter
) {
1117 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1119 IBaseFilter
* preader
;
1120 IFileSourceFilter
* pfile
= NULL
;
1124 TRACE("(%p/%p)->(%s, %s, %p)\n", This
, iface
, debugstr_w(lpcwstrFileName
), debugstr_w(lpcwstrFilterName
), ppFilter
);
1126 /* Instantiate a file source filter */
1127 hr
= CoCreateInstance(&CLSID_AsyncReader
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&preader
);
1129 ERR("Unable to create file source filter (%x)\n", hr
);
1133 hr
= IGraphBuilder_AddFilter(iface
, preader
, lpcwstrFilterName
);
1135 ERR("Unable add filter (%x)\n", hr
);
1136 IBaseFilter_Release(preader
);
1140 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1142 ERR("Unable to get IFileSourceInterface (%x)\n", hr
);
1146 /* Load the file in the file source filter */
1147 hr
= IFileSourceFilter_Load(pfile
, lpcwstrFileName
, NULL
);
1149 ERR("Load (%x)\n", hr
);
1153 IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1155 ERR("GetCurFile (%x)\n", hr
);
1158 TRACE("File %s\n", debugstr_w(filename
));
1159 TRACE("MajorType %s\n", debugstr_guid(&mt
.majortype
));
1160 TRACE("SubType %s\n", debugstr_guid(&mt
.subtype
));
1163 *ppFilter
= preader
;
1169 IFileSourceFilter_Release(pfile
);
1170 IGraphBuilder_RemoveFilter(iface
, preader
);
1171 IBaseFilter_Release(preader
);
1176 static HRESULT WINAPI
GraphBuilder_SetLogFile(IGraphBuilder
*iface
,
1178 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1180 TRACE("(%p/%p)->(%08x): stub !!!\n", This
, iface
, (DWORD
) hFile
);
1185 static HRESULT WINAPI
GraphBuilder_Abort(IGraphBuilder
*iface
) {
1186 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1188 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1193 static HRESULT WINAPI
GraphBuilder_ShouldOperationContinue(IGraphBuilder
*iface
) {
1194 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1196 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1202 static const IGraphBuilderVtbl IGraphBuilder_VTable
=
1204 GraphBuilder_QueryInterface
,
1205 GraphBuilder_AddRef
,
1206 GraphBuilder_Release
,
1207 GraphBuilder_AddFilter
,
1208 GraphBuilder_RemoveFilter
,
1209 GraphBuilder_EnumFilters
,
1210 GraphBuilder_FindFilterByName
,
1211 GraphBuilder_ConnectDirect
,
1212 GraphBuilder_Reconnect
,
1213 GraphBuilder_Disconnect
,
1214 GraphBuilder_SetDefaultSyncSource
,
1215 GraphBuilder_Connect
,
1216 GraphBuilder_Render
,
1217 GraphBuilder_RenderFile
,
1218 GraphBuilder_AddSourceFilter
,
1219 GraphBuilder_SetLogFile
,
1221 GraphBuilder_ShouldOperationContinue
1224 /*** IUnknown methods ***/
1225 static HRESULT WINAPI
MediaControl_QueryInterface(IMediaControl
*iface
,
1228 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1230 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1232 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1235 static ULONG WINAPI
MediaControl_AddRef(IMediaControl
*iface
) {
1236 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1238 TRACE("(%p/%p)->()\n", This
, iface
);
1240 return Filtergraph_AddRef(This
);
1243 static ULONG WINAPI
MediaControl_Release(IMediaControl
*iface
) {
1244 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1246 TRACE("(%p/%p)->()\n", This
, iface
);
1248 return Filtergraph_Release(This
);
1252 /*** IDispatch methods ***/
1253 static HRESULT WINAPI
MediaControl_GetTypeInfoCount(IMediaControl
*iface
,
1255 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1257 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1262 static HRESULT WINAPI
MediaControl_GetTypeInfo(IMediaControl
*iface
,
1265 ITypeInfo
**ppTInfo
) {
1266 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1268 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1273 static HRESULT WINAPI
MediaControl_GetIDsOfNames(IMediaControl
*iface
,
1279 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1281 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1286 static HRESULT WINAPI
MediaControl_Invoke(IMediaControl
*iface
,
1287 DISPID dispIdMember
,
1291 DISPPARAMS
*pDispParams
,
1293 EXCEPINFO
*pExepInfo
,
1295 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1297 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
);
1302 typedef HRESULT(WINAPI
*fnFoundFilter
)(IBaseFilter
*);
1304 static HRESULT
ExploreGraph(IFilterGraphImpl
* pGraph
, IPin
* pOutputPin
, fnFoundFilter FoundFilter
)
1313 TRACE("%p %p\n", pGraph
, pOutputPin
);
1314 PinInfo
.pFilter
= NULL
;
1316 hr
= IPin_ConnectedTo(pOutputPin
, &pInputPin
);
1319 hr
= IPin_QueryPinInfo(pInputPin
, &PinInfo
);
1322 hr
= GetInternalConnections(PinInfo
.pFilter
, pInputPin
, &ppPins
, &nb
);
1328 TRACE("Reached a renderer\n");
1329 /* Count renderers for end of stream notification */
1330 pGraph
->nRenderers
++;
1334 for(i
= 0; i
< nb
; i
++)
1336 /* Explore the graph downstream from this pin
1337 * FIXME: We should prevent exploring from a pin more than once. This can happens when
1338 * several input pins are connected to the same output (a MUX for instance). */
1339 ExploreGraph(pGraph
, ppPins
[i
], FoundFilter
);
1340 IPin_Release(ppPins
[i
]);
1343 CoTaskMemFree(ppPins
);
1345 TRACE("Doing stuff with filter %p\n", PinInfo
.pFilter
);
1346 FoundFilter(PinInfo
.pFilter
);
1349 if (PinInfo
.pFilter
) IBaseFilter_Release(PinInfo
.pFilter
);
1353 static HRESULT WINAPI
SendRun(IBaseFilter
*pFilter
) {
1354 return IBaseFilter_Run(pFilter
, 0);
1357 static HRESULT WINAPI
SendPause(IBaseFilter
*pFilter
) {
1358 return IBaseFilter_Pause(pFilter
);
1361 static HRESULT WINAPI
SendStop(IBaseFilter
*pFilter
) {
1362 return IBaseFilter_Stop(pFilter
);
1365 static HRESULT
SendFilterMessage(IMediaControl
*iface
, fnFoundFilter FoundFilter
) {
1366 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1368 IBaseFilter
* pfilter
;
1374 TRACE("(%p/%p)->()\n", This
, iface
);
1376 /* Explorer the graph from source filters to renderers, determine renderers
1377 * number and run filters from renderers to source filters */
1378 This
->nRenderers
= 0;
1379 ResetEvent(This
->hEventCompletion
);
1381 for(i
= 0; i
< This
->nFilters
; i
++)
1384 pfilter
= This
->ppFiltersInGraph
[i
];
1385 hr
= IBaseFilter_EnumPins(pfilter
, &pEnum
);
1388 ERR("Enum pins failed %x\n", hr
);
1391 /* Check if it is a source filter */
1392 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1394 IPin_QueryDirection(pPin
, &dir
);
1396 if (dir
== PINDIR_INPUT
)
1404 TRACE("Found a source filter %p\n", pfilter
);
1405 IEnumPins_Reset(pEnum
);
1406 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1408 /* Explore the graph downstream from this pin */
1409 ExploreGraph(This
, pPin
, FoundFilter
);
1412 FoundFilter(pfilter
);
1414 IEnumPins_Release(pEnum
);
1420 /*** IMediaControl methods ***/
1421 static HRESULT WINAPI
MediaControl_Run(IMediaControl
*iface
) {
1422 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1423 TRACE("(%p/%p)->()\n", This
, iface
);
1425 if (This
->state
== State_Running
) return S_OK
;
1427 EnterCriticalSection(&This
->cs
);
1428 SendFilterMessage(iface
, SendRun
);
1429 This
->state
= State_Running
;
1430 LeaveCriticalSection(&This
->cs
);
1434 static HRESULT WINAPI
MediaControl_Pause(IMediaControl
*iface
) {
1435 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1436 TRACE("(%p/%p)->()\n", This
, iface
);
1438 if (This
->state
== State_Paused
) return S_OK
;
1440 EnterCriticalSection(&This
->cs
);
1441 SendFilterMessage(iface
, SendPause
);
1442 This
->state
= State_Paused
;
1443 LeaveCriticalSection(&This
->cs
);
1447 static HRESULT WINAPI
MediaControl_Stop(IMediaControl
*iface
) {
1448 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1449 TRACE("(%p/%p)->()\n", This
, iface
);
1451 if (This
->state
== State_Stopped
) return S_OK
;
1453 EnterCriticalSection(&This
->cs
);
1454 if (This
->state
== State_Running
) SendFilterMessage(iface
, SendPause
);
1455 SendFilterMessage(iface
, SendStop
);
1456 This
->state
= State_Stopped
;
1457 LeaveCriticalSection(&This
->cs
);
1461 static HRESULT WINAPI
MediaControl_GetState(IMediaControl
*iface
,
1463 OAFilterState
*pfs
) {
1464 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1466 TRACE("(%p/%p)->(%d, %p): semi-stub !!!\n", This
, iface
, msTimeout
, pfs
);
1468 EnterCriticalSection(&This
->cs
);
1472 LeaveCriticalSection(&This
->cs
);
1477 static HRESULT WINAPI
MediaControl_RenderFile(IMediaControl
*iface
,
1479 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1481 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
);
1486 static HRESULT WINAPI
MediaControl_AddSourceFilter(IMediaControl
*iface
,
1488 IDispatch
**ppUnk
) {
1489 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1491 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
, ppUnk
);
1496 static HRESULT WINAPI
MediaControl_get_FilterCollection(IMediaControl
*iface
,
1497 IDispatch
**ppUnk
) {
1498 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1500 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1505 static HRESULT WINAPI
MediaControl_get_RegFilterCollection(IMediaControl
*iface
,
1506 IDispatch
**ppUnk
) {
1507 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1509 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1514 static HRESULT WINAPI
MediaControl_StopWhenReady(IMediaControl
*iface
) {
1515 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1517 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1523 static const IMediaControlVtbl IMediaControl_VTable
=
1525 MediaControl_QueryInterface
,
1526 MediaControl_AddRef
,
1527 MediaControl_Release
,
1528 MediaControl_GetTypeInfoCount
,
1529 MediaControl_GetTypeInfo
,
1530 MediaControl_GetIDsOfNames
,
1531 MediaControl_Invoke
,
1535 MediaControl_GetState
,
1536 MediaControl_RenderFile
,
1537 MediaControl_AddSourceFilter
,
1538 MediaControl_get_FilterCollection
,
1539 MediaControl_get_RegFilterCollection
,
1540 MediaControl_StopWhenReady
1544 /*** IUnknown methods ***/
1545 static HRESULT WINAPI
MediaSeeking_QueryInterface(IMediaSeeking
*iface
,
1548 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1550 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1552 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1555 static ULONG WINAPI
MediaSeeking_AddRef(IMediaSeeking
*iface
) {
1556 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1558 TRACE("(%p/%p)->()\n", This
, iface
);
1560 return Filtergraph_AddRef(This
);
1563 static ULONG WINAPI
MediaSeeking_Release(IMediaSeeking
*iface
) {
1564 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1566 TRACE("(%p/%p)->()\n", This
, iface
);
1568 return Filtergraph_Release(This
);
1571 /*** IMediaSeeking methods ***/
1572 static HRESULT WINAPI
MediaSeeking_GetCapabilities(IMediaSeeking
*iface
,
1573 DWORD
*pCapabilities
) {
1574 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1576 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1581 static HRESULT WINAPI
MediaSeeking_CheckCapabilities(IMediaSeeking
*iface
,
1582 DWORD
*pCapabilities
) {
1583 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1585 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1590 static HRESULT WINAPI
MediaSeeking_IsFormatSupported(IMediaSeeking
*iface
,
1591 const GUID
*pFormat
) {
1592 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1594 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1599 static HRESULT WINAPI
MediaSeeking_QueryPreferredFormat(IMediaSeeking
*iface
,
1601 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1603 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1608 static HRESULT WINAPI
MediaSeeking_GetTimeFormat(IMediaSeeking
*iface
,
1610 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1612 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1617 static HRESULT WINAPI
MediaSeeking_IsUsingTimeFormat(IMediaSeeking
*iface
,
1618 const GUID
*pFormat
) {
1619 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1621 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1626 static HRESULT WINAPI
MediaSeeking_SetTimeFormat(IMediaSeeking
*iface
,
1627 const GUID
*pFormat
) {
1628 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1630 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1635 static HRESULT WINAPI
MediaSeeking_GetDuration(IMediaSeeking
*iface
,
1636 LONGLONG
*pDuration
) {
1637 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1639 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDuration
);
1644 static HRESULT WINAPI
MediaSeeking_GetStopPosition(IMediaSeeking
*iface
,
1646 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1648 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pStop
);
1653 static HRESULT WINAPI
MediaSeeking_GetCurrentPosition(IMediaSeeking
*iface
,
1654 LONGLONG
*pCurrent
) {
1655 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1657 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCurrent
);
1662 static HRESULT WINAPI
MediaSeeking_ConvertTimeFormat(IMediaSeeking
*iface
,
1664 const GUID
*pTargetFormat
,
1666 const GUID
*pSourceFormat
) {
1667 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1669 TRACE("(%p/%p)->(%p, %p, 0x%s, %p): stub !!!\n", This
, iface
, pTarget
,
1670 pTargetFormat
, wine_dbgstr_longlong(Source
), pSourceFormat
);
1675 static HRESULT WINAPI
MediaSeeking_SetPositions(IMediaSeeking
*iface
,
1677 DWORD dwCurrentFlags
,
1679 DWORD dwStopFlags
) {
1680 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1682 TRACE("(%p/%p)->(%p, %08x, %p, %08x): stub !!!\n", This
, iface
, pCurrent
, dwCurrentFlags
, pStop
, dwStopFlags
);
1687 static HRESULT WINAPI
MediaSeeking_GetPositions(IMediaSeeking
*iface
,
1690 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1692 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pCurrent
, pStop
);
1697 static HRESULT WINAPI
MediaSeeking_GetAvailable(IMediaSeeking
*iface
,
1698 LONGLONG
*pEarliest
,
1699 LONGLONG
*pLatest
) {
1700 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1702 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pEarliest
, pLatest
);
1707 static HRESULT WINAPI
MediaSeeking_SetRate(IMediaSeeking
*iface
,
1709 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1711 TRACE("(%p/%p)->(%f): stub !!!\n", This
, iface
, dRate
);
1716 static HRESULT WINAPI
MediaSeeking_GetRate(IMediaSeeking
*iface
,
1718 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1720 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pdRate
);
1725 static HRESULT WINAPI
MediaSeeking_GetPreroll(IMediaSeeking
*iface
,
1726 LONGLONG
*pllPreroll
) {
1727 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1729 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pllPreroll
);
1735 static const IMediaSeekingVtbl IMediaSeeking_VTable
=
1737 MediaSeeking_QueryInterface
,
1738 MediaSeeking_AddRef
,
1739 MediaSeeking_Release
,
1740 MediaSeeking_GetCapabilities
,
1741 MediaSeeking_CheckCapabilities
,
1742 MediaSeeking_IsFormatSupported
,
1743 MediaSeeking_QueryPreferredFormat
,
1744 MediaSeeking_GetTimeFormat
,
1745 MediaSeeking_IsUsingTimeFormat
,
1746 MediaSeeking_SetTimeFormat
,
1747 MediaSeeking_GetDuration
,
1748 MediaSeeking_GetStopPosition
,
1749 MediaSeeking_GetCurrentPosition
,
1750 MediaSeeking_ConvertTimeFormat
,
1751 MediaSeeking_SetPositions
,
1752 MediaSeeking_GetPositions
,
1753 MediaSeeking_GetAvailable
,
1754 MediaSeeking_SetRate
,
1755 MediaSeeking_GetRate
,
1756 MediaSeeking_GetPreroll
1759 /*** IUnknown methods ***/
1760 static HRESULT WINAPI
MediaPosition_QueryInterface(IMediaPosition
* iface
, REFIID riid
, void** ppvObj
){
1761 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1763 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1765 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1768 static ULONG WINAPI
MediaPosition_AddRef(IMediaPosition
*iface
){
1769 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1771 TRACE("(%p/%p)->()\n", This
, iface
);
1773 return Filtergraph_AddRef(This
);
1776 static ULONG WINAPI
MediaPosition_Release(IMediaPosition
*iface
){
1777 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaPosition_vtbl
, iface
);
1779 TRACE("(%p/%p)->()\n", This
, iface
);
1781 return Filtergraph_Release(This
);
1784 /*** IDispatch methods ***/
1785 static HRESULT WINAPI
MediaPosition_GetTypeInfoCount(IMediaPosition
*iface
, UINT
* pctinfo
){
1786 FIXME("(%p) stub!\n", iface
);
1790 static HRESULT WINAPI
MediaPosition_GetTypeInfo(IMediaPosition
*iface
, UINT iTInfo
, LCID lcid
, ITypeInfo
** ppTInfo
){
1791 FIXME("(%p) stub!\n", iface
);
1795 static HRESULT WINAPI
MediaPosition_GetIDsOfNames(IMediaPosition
* iface
, REFIID riid
, LPOLESTR
* rgszNames
, UINT cNames
, LCID lcid
, DISPID
* rgDispId
){
1796 FIXME("(%p) stub!\n", iface
);
1800 static HRESULT WINAPI
MediaPosition_Invoke(IMediaPosition
* iface
, DISPID dispIdMember
, REFIID riid
, LCID lcid
, WORD wFlags
, DISPPARAMS
* pDispParams
, VARIANT
* pVarResult
, EXCEPINFO
* pExcepInfo
, UINT
* puArgErr
){
1801 FIXME("(%p) stub!\n", iface
);
1805 /*** IMediaPosition methods ***/
1806 static HRESULT WINAPI
MediaPosition_get_Duration(IMediaPosition
* iface
, REFTIME
*plength
){
1807 FIXME("(%p)->(%p) stub!\n", iface
, plength
);
1811 static HRESULT WINAPI
MediaPosition_put_CurrentPosition(IMediaPosition
* iface
, REFTIME llTime
){
1812 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1816 static HRESULT WINAPI
MediaPosition_get_CurrentPosition(IMediaPosition
* iface
, REFTIME
*pllTime
){
1817 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1821 static HRESULT WINAPI
MediaPosition_get_StopTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1822 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1826 static HRESULT WINAPI
MediaPosition_put_StopTime(IMediaPosition
* iface
, REFTIME llTime
){
1827 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1831 static HRESULT WINAPI
MediaPosition_get_PrerollTime(IMediaPosition
* iface
, REFTIME
*pllTime
){
1832 FIXME("(%p)->(%p) stub!\n", iface
, pllTime
);
1836 static HRESULT WINAPI
MediaPosition_put_PrerollTime(IMediaPosition
* iface
, REFTIME llTime
){
1837 FIXME("(%p)->(%f) stub!\n", iface
, llTime
);
1841 static HRESULT WINAPI
MediaPosition_put_Rate(IMediaPosition
* iface
, double dRate
){
1842 FIXME("(%p)->(%f) stub!\n", iface
, dRate
);
1846 static HRESULT WINAPI
MediaPosition_get_Rate(IMediaPosition
* iface
, double *pdRate
){
1847 FIXME("(%p)->(%p) stub!\n", iface
, pdRate
);
1851 static HRESULT WINAPI
MediaPosition_CanSeekForward(IMediaPosition
* iface
, LONG
*pCanSeekForward
){
1852 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekForward
);
1856 static HRESULT WINAPI
MediaPosition_CanSeekBackward(IMediaPosition
* iface
, LONG
*pCanSeekBackward
){
1857 FIXME("(%p)->(%p) stub!\n", iface
, pCanSeekBackward
);
1862 static const IMediaPositionVtbl IMediaPosition_VTable
=
1864 MediaPosition_QueryInterface
,
1865 MediaPosition_AddRef
,
1866 MediaPosition_Release
,
1867 MediaPosition_GetTypeInfoCount
,
1868 MediaPosition_GetTypeInfo
,
1869 MediaPosition_GetIDsOfNames
,
1870 MediaPosition_Invoke
,
1871 MediaPosition_get_Duration
,
1872 MediaPosition_put_CurrentPosition
,
1873 MediaPosition_get_CurrentPosition
,
1874 MediaPosition_get_StopTime
,
1875 MediaPosition_put_StopTime
,
1876 MediaPosition_get_PrerollTime
,
1877 MediaPosition_put_PrerollTime
,
1878 MediaPosition_put_Rate
,
1879 MediaPosition_get_Rate
,
1880 MediaPosition_CanSeekForward
,
1881 MediaPosition_CanSeekBackward
1884 static HRESULT
GetTargetInterface(IFilterGraphImpl
* pGraph
, REFIID riid
, LPVOID
* ppvObj
)
1886 HRESULT hr
= E_NOINTERFACE
;
1890 /* Check if the interface type is already registered */
1891 for (entry
= 0; entry
< pGraph
->nItfCacheEntries
; entry
++)
1892 if (riid
== pGraph
->ItfCacheEntries
[entry
].riid
)
1894 if (pGraph
->ItfCacheEntries
[entry
].iface
)
1896 /* Return the interface if available */
1897 *ppvObj
= pGraph
->ItfCacheEntries
[entry
].iface
;
1903 if (entry
>= MAX_ITF_CACHE_ENTRIES
)
1905 FIXME("Not enough space to store interface in the cache\n");
1906 return E_OUTOFMEMORY
;
1909 /* Find a filter supporting the requested interface */
1910 for (i
= 0; i
< pGraph
->nFilters
; i
++)
1912 hr
= IBaseFilter_QueryInterface(pGraph
->ppFiltersInGraph
[i
], riid
, ppvObj
);
1915 pGraph
->ItfCacheEntries
[entry
].riid
= riid
;
1916 pGraph
->ItfCacheEntries
[entry
].filter
= pGraph
->ppFiltersInGraph
[i
];
1917 pGraph
->ItfCacheEntries
[entry
].iface
= (IUnknown
*)*ppvObj
;
1918 if (entry
>= pGraph
->nItfCacheEntries
)
1919 pGraph
->nItfCacheEntries
++;
1922 if (hr
!= E_NOINTERFACE
)
1929 /*** IUnknown methods ***/
1930 static HRESULT WINAPI
BasicAudio_QueryInterface(IBasicAudio
*iface
,
1933 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1935 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1937 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1940 static ULONG WINAPI
BasicAudio_AddRef(IBasicAudio
*iface
) {
1941 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1943 TRACE("(%p/%p)->()\n", This
, iface
);
1945 return Filtergraph_AddRef(This
);
1948 static ULONG WINAPI
BasicAudio_Release(IBasicAudio
*iface
) {
1949 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1951 TRACE("(%p/%p)->()\n", This
, iface
);
1953 return Filtergraph_Release(This
);
1956 /*** IDispatch methods ***/
1957 static HRESULT WINAPI
BasicAudio_GetTypeInfoCount(IBasicAudio
*iface
,
1959 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1960 IBasicAudio
* pBasicAudio
;
1963 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
1965 EnterCriticalSection(&This
->cs
);
1967 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
1970 hr
= IBasicAudio_GetTypeInfoCount(pBasicAudio
, pctinfo
);
1972 LeaveCriticalSection(&This
->cs
);
1977 static HRESULT WINAPI
BasicAudio_GetTypeInfo(IBasicAudio
*iface
,
1980 ITypeInfo
**ppTInfo
) {
1981 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1982 IBasicAudio
* pBasicAudio
;
1985 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1987 EnterCriticalSection(&This
->cs
);
1989 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
1992 hr
= IBasicAudio_GetTypeInfo(pBasicAudio
, iTInfo
, lcid
, ppTInfo
);
1994 LeaveCriticalSection(&This
->cs
);
1999 static HRESULT WINAPI
BasicAudio_GetIDsOfNames(IBasicAudio
*iface
,
2005 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2006 IBasicAudio
* pBasicAudio
;
2009 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2011 EnterCriticalSection(&This
->cs
);
2013 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2016 hr
= IBasicAudio_GetIDsOfNames(pBasicAudio
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2018 LeaveCriticalSection(&This
->cs
);
2023 static HRESULT WINAPI
BasicAudio_Invoke(IBasicAudio
*iface
,
2024 DISPID dispIdMember
,
2028 DISPPARAMS
*pDispParams
,
2030 EXCEPINFO
*pExepInfo
,
2032 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2033 IBasicAudio
* pBasicAudio
;
2036 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
);
2038 EnterCriticalSection(&This
->cs
);
2040 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2043 hr
= IBasicAudio_Invoke(pBasicAudio
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2045 LeaveCriticalSection(&This
->cs
);
2050 /*** IBasicAudio methods ***/
2051 static HRESULT WINAPI
BasicAudio_put_Volume(IBasicAudio
*iface
,
2053 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2054 IBasicAudio
* pBasicAudio
;
2057 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lVolume
);
2059 EnterCriticalSection(&This
->cs
);
2061 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2064 hr
= IBasicAudio_put_Volume(pBasicAudio
, lVolume
);
2066 LeaveCriticalSection(&This
->cs
);
2071 static HRESULT WINAPI
BasicAudio_get_Volume(IBasicAudio
*iface
,
2073 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2074 IBasicAudio
* pBasicAudio
;
2077 TRACE("(%p/%p)->(%p)\n", This
, iface
, plVolume
);
2079 EnterCriticalSection(&This
->cs
);
2081 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2084 hr
= IBasicAudio_get_Volume(pBasicAudio
, plVolume
);
2086 LeaveCriticalSection(&This
->cs
);
2091 static HRESULT WINAPI
BasicAudio_put_Balance(IBasicAudio
*iface
,
2093 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2094 IBasicAudio
* pBasicAudio
;
2097 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lBalance
);
2099 EnterCriticalSection(&This
->cs
);
2101 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2104 hr
= IBasicAudio_put_Balance(pBasicAudio
, lBalance
);
2106 LeaveCriticalSection(&This
->cs
);
2111 static HRESULT WINAPI
BasicAudio_get_Balance(IBasicAudio
*iface
,
2113 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
2114 IBasicAudio
* pBasicAudio
;
2117 TRACE("(%p/%p)->(%p)\n", This
, iface
, plBalance
);
2119 EnterCriticalSection(&This
->cs
);
2121 hr
= GetTargetInterface(This
, &IID_IBasicAudio
, (LPVOID
*)&pBasicAudio
);
2124 hr
= IBasicAudio_get_Balance(pBasicAudio
, plBalance
);
2126 LeaveCriticalSection(&This
->cs
);
2131 static const IBasicAudioVtbl IBasicAudio_VTable
=
2133 BasicAudio_QueryInterface
,
2136 BasicAudio_GetTypeInfoCount
,
2137 BasicAudio_GetTypeInfo
,
2138 BasicAudio_GetIDsOfNames
,
2140 BasicAudio_put_Volume
,
2141 BasicAudio_get_Volume
,
2142 BasicAudio_put_Balance
,
2143 BasicAudio_get_Balance
2146 /*** IUnknown methods ***/
2147 static HRESULT WINAPI
BasicVideo_QueryInterface(IBasicVideo
*iface
,
2150 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2152 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2154 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2157 static ULONG WINAPI
BasicVideo_AddRef(IBasicVideo
*iface
) {
2158 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2160 TRACE("(%p/%p)->()\n", This
, iface
);
2162 return Filtergraph_AddRef(This
);
2165 static ULONG WINAPI
BasicVideo_Release(IBasicVideo
*iface
) {
2166 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2168 TRACE("(%p/%p)->()\n", This
, iface
);
2170 return Filtergraph_Release(This
);
2173 /*** IDispatch methods ***/
2174 static HRESULT WINAPI
BasicVideo_GetTypeInfoCount(IBasicVideo
*iface
,
2176 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2177 IBasicVideo
* pBasicVideo
;
2180 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
2182 EnterCriticalSection(&This
->cs
);
2184 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2187 hr
= IBasicVideo_GetTypeInfoCount(pBasicVideo
, pctinfo
);
2189 LeaveCriticalSection(&This
->cs
);
2194 static HRESULT WINAPI
BasicVideo_GetTypeInfo(IBasicVideo
*iface
,
2197 ITypeInfo
**ppTInfo
) {
2198 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2199 IBasicVideo
* pBasicVideo
;
2202 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2204 EnterCriticalSection(&This
->cs
);
2206 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2209 hr
= IBasicVideo_GetTypeInfo(pBasicVideo
, iTInfo
, lcid
, ppTInfo
);
2211 LeaveCriticalSection(&This
->cs
);
2216 static HRESULT WINAPI
BasicVideo_GetIDsOfNames(IBasicVideo
*iface
,
2222 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2223 IBasicVideo
* pBasicVideo
;
2226 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2228 EnterCriticalSection(&This
->cs
);
2230 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2233 hr
= IBasicVideo_GetIDsOfNames(pBasicVideo
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2235 LeaveCriticalSection(&This
->cs
);
2240 static HRESULT WINAPI
BasicVideo_Invoke(IBasicVideo
*iface
,
2241 DISPID dispIdMember
,
2245 DISPPARAMS
*pDispParams
,
2247 EXCEPINFO
*pExepInfo
,
2249 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2250 IBasicVideo
* pBasicVideo
;
2253 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
);
2255 EnterCriticalSection(&This
->cs
);
2257 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2260 hr
= IBasicVideo_Invoke(pBasicVideo
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2262 LeaveCriticalSection(&This
->cs
);
2267 /*** IBasicVideo methods ***/
2268 static HRESULT WINAPI
BasicVideo_get_AvgTimePerFrame(IBasicVideo
*iface
,
2269 REFTIME
*pAvgTimePerFrame
) {
2270 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2271 IBasicVideo
* pBasicVideo
;
2274 TRACE("(%p/%p)->(%p)\n", This
, iface
, pAvgTimePerFrame
);
2276 EnterCriticalSection(&This
->cs
);
2278 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2281 hr
= IBasicVideo_get_AvgTimePerFrame(pBasicVideo
, pAvgTimePerFrame
);
2283 LeaveCriticalSection(&This
->cs
);
2288 static HRESULT WINAPI
BasicVideo_get_BitRate(IBasicVideo
*iface
,
2290 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2291 IBasicVideo
* pBasicVideo
;
2294 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitRate
);
2296 EnterCriticalSection(&This
->cs
);
2298 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2301 hr
= IBasicVideo_get_BitRate(pBasicVideo
, pBitRate
);
2303 LeaveCriticalSection(&This
->cs
);
2308 static HRESULT WINAPI
BasicVideo_get_BitErrorRate(IBasicVideo
*iface
,
2309 long *pBitErrorRate
) {
2310 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2311 IBasicVideo
* pBasicVideo
;
2314 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBitErrorRate
);
2316 EnterCriticalSection(&This
->cs
);
2318 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2321 hr
= IBasicVideo_get_BitErrorRate(pBasicVideo
, pBitErrorRate
);
2323 LeaveCriticalSection(&This
->cs
);
2328 static HRESULT WINAPI
BasicVideo_get_VideoWidth(IBasicVideo
*iface
,
2329 long *pVideoWidth
) {
2330 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2331 IBasicVideo
* pBasicVideo
;
2334 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoWidth
);
2336 EnterCriticalSection(&This
->cs
);
2338 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2341 hr
= IBasicVideo_get_VideoWidth(pBasicVideo
, pVideoWidth
);
2343 LeaveCriticalSection(&This
->cs
);
2348 static HRESULT WINAPI
BasicVideo_get_VideoHeight(IBasicVideo
*iface
,
2349 long *pVideoHeight
) {
2350 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2351 IBasicVideo
* pBasicVideo
;
2354 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoHeight
);
2356 EnterCriticalSection(&This
->cs
);
2358 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2361 hr
= IBasicVideo_get_VideoHeight(pBasicVideo
, pVideoHeight
);
2363 LeaveCriticalSection(&This
->cs
);
2368 static HRESULT WINAPI
BasicVideo_put_SourceLeft(IBasicVideo
*iface
,
2370 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2371 IBasicVideo
* pBasicVideo
;
2374 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceLeft
);
2376 EnterCriticalSection(&This
->cs
);
2378 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2381 hr
= IBasicVideo_put_SourceLeft(pBasicVideo
, SourceLeft
);
2383 LeaveCriticalSection(&This
->cs
);
2388 static HRESULT WINAPI
BasicVideo_get_SourceLeft(IBasicVideo
*iface
,
2389 long *pSourceLeft
) {
2390 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2391 IBasicVideo
* pBasicVideo
;
2394 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceLeft
);
2396 EnterCriticalSection(&This
->cs
);
2398 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2401 hr
= IBasicVideo_get_SourceLeft(pBasicVideo
, pSourceLeft
);
2403 LeaveCriticalSection(&This
->cs
);
2408 static HRESULT WINAPI
BasicVideo_put_SourceWidth(IBasicVideo
*iface
,
2410 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2411 IBasicVideo
* pBasicVideo
;
2414 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceWidth
);
2416 EnterCriticalSection(&This
->cs
);
2418 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2421 hr
= IBasicVideo_put_SourceWidth(pBasicVideo
, SourceWidth
);
2423 LeaveCriticalSection(&This
->cs
);
2428 static HRESULT WINAPI
BasicVideo_get_SourceWidth(IBasicVideo
*iface
,
2429 long *pSourceWidth
) {
2430 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2431 IBasicVideo
* pBasicVideo
;
2434 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceWidth
);
2436 EnterCriticalSection(&This
->cs
);
2438 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2441 hr
= IBasicVideo_get_SourceWidth(pBasicVideo
, pSourceWidth
);
2443 LeaveCriticalSection(&This
->cs
);
2448 static HRESULT WINAPI
BasicVideo_put_SourceTop(IBasicVideo
*iface
,
2450 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2451 IBasicVideo
* pBasicVideo
;
2454 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceTop
);
2456 EnterCriticalSection(&This
->cs
);
2458 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2461 hr
= IBasicVideo_put_SourceTop(pBasicVideo
, SourceTop
);
2463 LeaveCriticalSection(&This
->cs
);
2468 static HRESULT WINAPI
BasicVideo_get_SourceTop(IBasicVideo
*iface
,
2470 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2471 IBasicVideo
* pBasicVideo
;
2474 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceTop
);
2476 EnterCriticalSection(&This
->cs
);
2478 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2481 hr
= IBasicVideo_get_SourceTop(pBasicVideo
, pSourceTop
);
2483 LeaveCriticalSection(&This
->cs
);
2488 static HRESULT WINAPI
BasicVideo_put_SourceHeight(IBasicVideo
*iface
,
2489 long SourceHeight
) {
2490 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2491 IBasicVideo
* pBasicVideo
;
2494 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceHeight
);
2496 EnterCriticalSection(&This
->cs
);
2498 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2501 hr
= IBasicVideo_put_SourceHeight(pBasicVideo
, SourceHeight
);
2503 LeaveCriticalSection(&This
->cs
);
2508 static HRESULT WINAPI
BasicVideo_get_SourceHeight(IBasicVideo
*iface
,
2509 long *pSourceHeight
) {
2510 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2511 IBasicVideo
* pBasicVideo
;
2514 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceHeight
);
2516 EnterCriticalSection(&This
->cs
);
2518 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2521 hr
= IBasicVideo_get_SourceHeight(pBasicVideo
, pSourceHeight
);
2523 LeaveCriticalSection(&This
->cs
);
2528 static HRESULT WINAPI
BasicVideo_put_DestinationLeft(IBasicVideo
*iface
,
2529 long DestinationLeft
) {
2530 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2531 IBasicVideo
* pBasicVideo
;
2534 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationLeft
);
2536 EnterCriticalSection(&This
->cs
);
2538 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2541 hr
= IBasicVideo_put_DestinationLeft(pBasicVideo
, DestinationLeft
);
2543 LeaveCriticalSection(&This
->cs
);
2548 static HRESULT WINAPI
BasicVideo_get_DestinationLeft(IBasicVideo
*iface
,
2549 long *pDestinationLeft
) {
2550 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2551 IBasicVideo
* pBasicVideo
;
2554 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationLeft
);
2556 EnterCriticalSection(&This
->cs
);
2558 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2561 hr
= IBasicVideo_get_DestinationLeft(pBasicVideo
, pDestinationLeft
);
2563 LeaveCriticalSection(&This
->cs
);
2568 static HRESULT WINAPI
BasicVideo_put_DestinationWidth(IBasicVideo
*iface
,
2569 long DestinationWidth
) {
2570 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2571 IBasicVideo
* pBasicVideo
;
2574 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationWidth
);
2576 EnterCriticalSection(&This
->cs
);
2578 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2581 hr
= IBasicVideo_put_DestinationWidth(pBasicVideo
, DestinationWidth
);
2583 LeaveCriticalSection(&This
->cs
);
2588 static HRESULT WINAPI
BasicVideo_get_DestinationWidth(IBasicVideo
*iface
,
2589 long *pDestinationWidth
) {
2590 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2591 IBasicVideo
* pBasicVideo
;
2594 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationWidth
);
2596 EnterCriticalSection(&This
->cs
);
2598 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2601 hr
= IBasicVideo_get_DestinationWidth(pBasicVideo
, pDestinationWidth
);
2603 LeaveCriticalSection(&This
->cs
);
2608 static HRESULT WINAPI
BasicVideo_put_DestinationTop(IBasicVideo
*iface
,
2609 long DestinationTop
) {
2610 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2611 IBasicVideo
* pBasicVideo
;
2614 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationTop
);
2616 EnterCriticalSection(&This
->cs
);
2618 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2621 hr
= IBasicVideo_put_DestinationTop(pBasicVideo
, DestinationTop
);
2623 LeaveCriticalSection(&This
->cs
);
2628 static HRESULT WINAPI
BasicVideo_get_DestinationTop(IBasicVideo
*iface
,
2629 long *pDestinationTop
) {
2630 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2631 IBasicVideo
* pBasicVideo
;
2634 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationTop
);
2636 EnterCriticalSection(&This
->cs
);
2638 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2641 hr
= IBasicVideo_get_DestinationTop(pBasicVideo
, pDestinationTop
);
2643 LeaveCriticalSection(&This
->cs
);
2648 static HRESULT WINAPI
BasicVideo_put_DestinationHeight(IBasicVideo
*iface
,
2649 long DestinationHeight
) {
2650 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2651 IBasicVideo
* pBasicVideo
;
2654 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationHeight
);
2656 EnterCriticalSection(&This
->cs
);
2658 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2661 hr
= IBasicVideo_put_DestinationHeight(pBasicVideo
, DestinationHeight
);
2663 LeaveCriticalSection(&This
->cs
);
2668 static HRESULT WINAPI
BasicVideo_get_DestinationHeight(IBasicVideo
*iface
,
2669 long *pDestinationHeight
) {
2670 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2671 IBasicVideo
* pBasicVideo
;
2674 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationHeight
);
2676 EnterCriticalSection(&This
->cs
);
2678 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2681 hr
= IBasicVideo_get_DestinationHeight(pBasicVideo
, pDestinationHeight
);
2683 LeaveCriticalSection(&This
->cs
);
2688 static HRESULT WINAPI
BasicVideo_SetSourcePosition(IBasicVideo
*iface
,
2693 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2694 IBasicVideo
* pBasicVideo
;
2697 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2699 EnterCriticalSection(&This
->cs
);
2701 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2704 hr
= IBasicVideo_SetSourcePosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2706 LeaveCriticalSection(&This
->cs
);
2711 static HRESULT WINAPI
BasicVideo_GetSourcePosition(IBasicVideo
*iface
,
2716 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2717 IBasicVideo
* pBasicVideo
;
2720 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2722 EnterCriticalSection(&This
->cs
);
2724 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2727 hr
= IBasicVideo_GetSourcePosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2729 LeaveCriticalSection(&This
->cs
);
2734 static HRESULT WINAPI
BasicVideo_SetDefaultSourcePosition(IBasicVideo
*iface
) {
2735 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2736 IBasicVideo
* pBasicVideo
;
2739 TRACE("(%p/%p)->()\n", This
, iface
);
2741 EnterCriticalSection(&This
->cs
);
2743 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2746 hr
= IBasicVideo_SetDefaultSourcePosition(pBasicVideo
);
2748 LeaveCriticalSection(&This
->cs
);
2753 static HRESULT WINAPI
BasicVideo_SetDestinationPosition(IBasicVideo
*iface
,
2758 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2759 IBasicVideo
* pBasicVideo
;
2762 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
2764 EnterCriticalSection(&This
->cs
);
2766 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2769 hr
= IBasicVideo_SetDestinationPosition(pBasicVideo
, Left
, Top
, Width
, Height
);
2771 LeaveCriticalSection(&This
->cs
);
2776 static HRESULT WINAPI
BasicVideo_GetDestinationPosition(IBasicVideo
*iface
,
2781 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2782 IBasicVideo
* pBasicVideo
;
2785 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2787 EnterCriticalSection(&This
->cs
);
2789 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2792 hr
= IBasicVideo_GetDestinationPosition(pBasicVideo
, pLeft
, pTop
, pWidth
, pHeight
);
2794 LeaveCriticalSection(&This
->cs
);
2799 static HRESULT WINAPI
BasicVideo_SetDefaultDestinationPosition(IBasicVideo
*iface
) {
2800 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2801 IBasicVideo
* pBasicVideo
;
2804 TRACE("(%p/%p)->()\n", This
, iface
);
2806 EnterCriticalSection(&This
->cs
);
2808 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2811 hr
= IBasicVideo_SetDefaultDestinationPosition(pBasicVideo
);
2813 LeaveCriticalSection(&This
->cs
);
2818 static HRESULT WINAPI
BasicVideo_GetVideoSize(IBasicVideo
*iface
,
2821 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2822 IBasicVideo
* pBasicVideo
;
2825 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
2827 EnterCriticalSection(&This
->cs
);
2829 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2832 hr
= IBasicVideo_GetVideoSize(pBasicVideo
, pWidth
, pHeight
);
2834 LeaveCriticalSection(&This
->cs
);
2839 static HRESULT WINAPI
BasicVideo_GetVideoPaletteEntries(IBasicVideo
*iface
,
2844 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2845 IBasicVideo
* pBasicVideo
;
2848 TRACE("(%p/%p)->(%ld, %ld, %p, %p)\n", This
, iface
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2850 EnterCriticalSection(&This
->cs
);
2852 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2855 hr
= IBasicVideo_GetVideoPaletteEntries(pBasicVideo
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2857 LeaveCriticalSection(&This
->cs
);
2862 static HRESULT WINAPI
BasicVideo_GetCurrentImage(IBasicVideo
*iface
,
2865 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2866 IBasicVideo
* pBasicVideo
;
2869 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pBufferSize
, pDIBImage
);
2871 EnterCriticalSection(&This
->cs
);
2873 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2876 hr
= IBasicVideo_GetCurrentImage(pBasicVideo
, pBufferSize
, pDIBImage
);
2878 LeaveCriticalSection(&This
->cs
);
2883 static HRESULT WINAPI
BasicVideo_IsUsingDefaultSource(IBasicVideo
*iface
) {
2884 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2885 IBasicVideo
* pBasicVideo
;
2888 TRACE("(%p/%p)->()\n", This
, iface
);
2890 EnterCriticalSection(&This
->cs
);
2892 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2895 hr
= IBasicVideo_IsUsingDefaultSource(pBasicVideo
);
2897 LeaveCriticalSection(&This
->cs
);
2902 static HRESULT WINAPI
BasicVideo_IsUsingDefaultDestination(IBasicVideo
*iface
) {
2903 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2904 IBasicVideo
* pBasicVideo
;
2907 TRACE("(%p/%p)->()\n", This
, iface
);
2909 EnterCriticalSection(&This
->cs
);
2911 hr
= GetTargetInterface(This
, &IID_IBasicVideo
, (LPVOID
*)&pBasicVideo
);
2914 hr
= IBasicVideo_IsUsingDefaultDestination(pBasicVideo
);
2916 LeaveCriticalSection(&This
->cs
);
2922 static const IBasicVideoVtbl IBasicVideo_VTable
=
2924 BasicVideo_QueryInterface
,
2927 BasicVideo_GetTypeInfoCount
,
2928 BasicVideo_GetTypeInfo
,
2929 BasicVideo_GetIDsOfNames
,
2931 BasicVideo_get_AvgTimePerFrame
,
2932 BasicVideo_get_BitRate
,
2933 BasicVideo_get_BitErrorRate
,
2934 BasicVideo_get_VideoWidth
,
2935 BasicVideo_get_VideoHeight
,
2936 BasicVideo_put_SourceLeft
,
2937 BasicVideo_get_SourceLeft
,
2938 BasicVideo_put_SourceWidth
,
2939 BasicVideo_get_SourceWidth
,
2940 BasicVideo_put_SourceTop
,
2941 BasicVideo_get_SourceTop
,
2942 BasicVideo_put_SourceHeight
,
2943 BasicVideo_get_SourceHeight
,
2944 BasicVideo_put_DestinationLeft
,
2945 BasicVideo_get_DestinationLeft
,
2946 BasicVideo_put_DestinationWidth
,
2947 BasicVideo_get_DestinationWidth
,
2948 BasicVideo_put_DestinationTop
,
2949 BasicVideo_get_DestinationTop
,
2950 BasicVideo_put_DestinationHeight
,
2951 BasicVideo_get_DestinationHeight
,
2952 BasicVideo_SetSourcePosition
,
2953 BasicVideo_GetSourcePosition
,
2954 BasicVideo_SetDefaultSourcePosition
,
2955 BasicVideo_SetDestinationPosition
,
2956 BasicVideo_GetDestinationPosition
,
2957 BasicVideo_SetDefaultDestinationPosition
,
2958 BasicVideo_GetVideoSize
,
2959 BasicVideo_GetVideoPaletteEntries
,
2960 BasicVideo_GetCurrentImage
,
2961 BasicVideo_IsUsingDefaultSource
,
2962 BasicVideo_IsUsingDefaultDestination
2966 /*** IUnknown methods ***/
2967 static HRESULT WINAPI
VideoWindow_QueryInterface(IVideoWindow
*iface
,
2970 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2972 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2974 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2977 static ULONG WINAPI
VideoWindow_AddRef(IVideoWindow
*iface
) {
2978 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2980 TRACE("(%p/%p)->()\n", This
, iface
);
2982 return Filtergraph_AddRef(This
);
2985 static ULONG WINAPI
VideoWindow_Release(IVideoWindow
*iface
) {
2986 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2988 TRACE("(%p/%p)->()\n", This
, iface
);
2990 return Filtergraph_Release(This
);
2993 /*** IDispatch methods ***/
2994 static HRESULT WINAPI
VideoWindow_GetTypeInfoCount(IVideoWindow
*iface
,
2996 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2997 IVideoWindow
* pVideoWindow
;
3000 TRACE("(%p/%p)->(%p)\n", This
, iface
, pctinfo
);
3002 EnterCriticalSection(&This
->cs
);
3004 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3007 hr
= IVideoWindow_GetTypeInfoCount(pVideoWindow
, pctinfo
);
3009 LeaveCriticalSection(&This
->cs
);
3014 static HRESULT WINAPI
VideoWindow_GetTypeInfo(IVideoWindow
*iface
,
3017 ITypeInfo
**ppTInfo
) {
3018 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3019 IVideoWindow
* pVideoWindow
;
3022 TRACE("(%p/%p)->(%d, %d, %p)\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
3024 EnterCriticalSection(&This
->cs
);
3026 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3029 hr
= IVideoWindow_GetTypeInfo(pVideoWindow
, iTInfo
, lcid
, ppTInfo
);
3031 LeaveCriticalSection(&This
->cs
);
3036 static HRESULT WINAPI
VideoWindow_GetIDsOfNames(IVideoWindow
*iface
,
3042 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3043 IVideoWindow
* pVideoWindow
;
3046 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p)\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3048 EnterCriticalSection(&This
->cs
);
3050 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3053 hr
= IVideoWindow_GetIDsOfNames(pVideoWindow
, riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3055 LeaveCriticalSection(&This
->cs
);
3060 static HRESULT WINAPI
VideoWindow_Invoke(IVideoWindow
*iface
,
3061 DISPID dispIdMember
,
3065 DISPPARAMS
*pDispParams
,
3067 EXCEPINFO
*pExepInfo
,
3069 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3070 IVideoWindow
* pVideoWindow
;
3073 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
);
3075 EnterCriticalSection(&This
->cs
);
3077 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3080 hr
= IVideoWindow_Invoke(pVideoWindow
, dispIdMember
, riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
3082 LeaveCriticalSection(&This
->cs
);
3088 /*** IVideoWindow methods ***/
3089 static HRESULT WINAPI
VideoWindow_put_Caption(IVideoWindow
*iface
,
3091 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3092 IVideoWindow
* pVideoWindow
;
3095 TRACE("(%p/%p)->(%s (%p))\n", This
, iface
, debugstr_w(strCaption
), strCaption
);
3097 EnterCriticalSection(&This
->cs
);
3099 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3102 hr
= IVideoWindow_put_Caption(pVideoWindow
, strCaption
);
3104 LeaveCriticalSection(&This
->cs
);
3109 static HRESULT WINAPI
VideoWindow_get_Caption(IVideoWindow
*iface
,
3111 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3112 IVideoWindow
* pVideoWindow
;
3115 TRACE("(%p/%p)->(%p)\n", This
, iface
, strCaption
);
3117 EnterCriticalSection(&This
->cs
);
3119 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3122 hr
= IVideoWindow_get_Caption(pVideoWindow
, strCaption
);
3124 LeaveCriticalSection(&This
->cs
);
3129 static HRESULT WINAPI
VideoWindow_put_WindowStyle(IVideoWindow
*iface
,
3131 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3132 IVideoWindow
* pVideoWindow
;
3135 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyle
);
3137 EnterCriticalSection(&This
->cs
);
3139 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3142 hr
= IVideoWindow_put_WindowStyle(pVideoWindow
, WindowStyle
);
3144 LeaveCriticalSection(&This
->cs
);
3149 static HRESULT WINAPI
VideoWindow_get_WindowStyle(IVideoWindow
*iface
,
3150 long *WindowStyle
) {
3151 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3152 IVideoWindow
* pVideoWindow
;
3155 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyle
);
3157 EnterCriticalSection(&This
->cs
);
3159 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3162 hr
= IVideoWindow_get_WindowStyle(pVideoWindow
, WindowStyle
);
3164 LeaveCriticalSection(&This
->cs
);
3169 static HRESULT WINAPI
VideoWindow_put_WindowStyleEx(IVideoWindow
*iface
,
3170 long WindowStyleEx
) {
3171 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3172 IVideoWindow
* pVideoWindow
;
3175 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyleEx
);
3177 EnterCriticalSection(&This
->cs
);
3179 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3182 hr
= IVideoWindow_put_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3184 LeaveCriticalSection(&This
->cs
);
3189 static HRESULT WINAPI
VideoWindow_get_WindowStyleEx(IVideoWindow
*iface
,
3190 long *WindowStyleEx
) {
3191 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3192 IVideoWindow
* pVideoWindow
;
3195 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyleEx
);
3197 EnterCriticalSection(&This
->cs
);
3199 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3202 hr
= IVideoWindow_get_WindowStyleEx(pVideoWindow
, WindowStyleEx
);
3204 LeaveCriticalSection(&This
->cs
);
3209 static HRESULT WINAPI
VideoWindow_put_AutoShow(IVideoWindow
*iface
,
3211 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3212 IVideoWindow
* pVideoWindow
;
3215 TRACE("(%p/%p)->(%ld)\n", This
, iface
, AutoShow
);
3217 EnterCriticalSection(&This
->cs
);
3219 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3222 hr
= IVideoWindow_put_AutoShow(pVideoWindow
, AutoShow
);
3224 LeaveCriticalSection(&This
->cs
);
3229 static HRESULT WINAPI
VideoWindow_get_AutoShow(IVideoWindow
*iface
,
3231 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3232 IVideoWindow
* pVideoWindow
;
3235 TRACE("(%p/%p)->(%p)\n", This
, iface
, AutoShow
);
3237 EnterCriticalSection(&This
->cs
);
3239 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3242 hr
= IVideoWindow_get_AutoShow(pVideoWindow
, AutoShow
);
3244 LeaveCriticalSection(&This
->cs
);
3249 static HRESULT WINAPI
VideoWindow_put_WindowState(IVideoWindow
*iface
,
3251 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3252 IVideoWindow
* pVideoWindow
;
3255 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowState
);
3257 EnterCriticalSection(&This
->cs
);
3259 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3262 hr
= IVideoWindow_put_WindowState(pVideoWindow
, WindowState
);
3264 LeaveCriticalSection(&This
->cs
);
3269 static HRESULT WINAPI
VideoWindow_get_WindowState(IVideoWindow
*iface
,
3270 long *WindowState
) {
3271 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3272 IVideoWindow
* pVideoWindow
;
3275 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowState
);
3277 EnterCriticalSection(&This
->cs
);
3279 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3282 hr
= IVideoWindow_get_WindowState(pVideoWindow
, WindowState
);
3284 LeaveCriticalSection(&This
->cs
);
3289 static HRESULT WINAPI
VideoWindow_put_BackgroundPalette(IVideoWindow
*iface
,
3290 long BackgroundPalette
) {
3291 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3292 IVideoWindow
* pVideoWindow
;
3295 TRACE("(%p/%p)->(%ld)\n", This
, iface
, BackgroundPalette
);
3297 EnterCriticalSection(&This
->cs
);
3299 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3302 hr
= IVideoWindow_put_BackgroundPalette(pVideoWindow
, BackgroundPalette
);
3304 LeaveCriticalSection(&This
->cs
);
3309 static HRESULT WINAPI
VideoWindow_get_BackgroundPalette(IVideoWindow
*iface
,
3310 long *pBackgroundPalette
) {
3311 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3312 IVideoWindow
* pVideoWindow
;
3315 TRACE("(%p/%p)->(%p)\n", This
, iface
, pBackgroundPalette
);
3317 EnterCriticalSection(&This
->cs
);
3319 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3322 hr
= IVideoWindow_get_BackgroundPalette(pVideoWindow
, pBackgroundPalette
);
3324 LeaveCriticalSection(&This
->cs
);
3329 static HRESULT WINAPI
VideoWindow_put_Visible(IVideoWindow
*iface
,
3331 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3332 IVideoWindow
* pVideoWindow
;
3335 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Visible
);
3337 EnterCriticalSection(&This
->cs
);
3339 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3342 hr
= IVideoWindow_put_Visible(pVideoWindow
, Visible
);
3344 LeaveCriticalSection(&This
->cs
);
3349 static HRESULT WINAPI
VideoWindow_get_Visible(IVideoWindow
*iface
,
3351 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3352 IVideoWindow
* pVideoWindow
;
3355 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVisible
);
3357 EnterCriticalSection(&This
->cs
);
3359 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3362 hr
= IVideoWindow_get_Visible(pVideoWindow
, pVisible
);
3364 LeaveCriticalSection(&This
->cs
);
3369 static HRESULT WINAPI
VideoWindow_put_Left(IVideoWindow
*iface
,
3371 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3372 IVideoWindow
* pVideoWindow
;
3375 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Left
);
3377 EnterCriticalSection(&This
->cs
);
3379 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3382 hr
= IVideoWindow_put_Left(pVideoWindow
, Left
);
3384 LeaveCriticalSection(&This
->cs
);
3389 static HRESULT WINAPI
VideoWindow_get_Left(IVideoWindow
*iface
,
3391 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3392 IVideoWindow
* pVideoWindow
;
3395 TRACE("(%p/%p)->(%p)\n", This
, iface
, pLeft
);
3397 EnterCriticalSection(&This
->cs
);
3399 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3402 hr
= IVideoWindow_get_Left(pVideoWindow
, pLeft
);
3404 LeaveCriticalSection(&This
->cs
);
3409 static HRESULT WINAPI
VideoWindow_put_Width(IVideoWindow
*iface
,
3411 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3412 IVideoWindow
* pVideoWindow
;
3415 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Width
);
3417 EnterCriticalSection(&This
->cs
);
3419 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3422 hr
= IVideoWindow_put_Width(pVideoWindow
, Width
);
3424 LeaveCriticalSection(&This
->cs
);
3429 static HRESULT WINAPI
VideoWindow_get_Width(IVideoWindow
*iface
,
3431 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3432 IVideoWindow
* pVideoWindow
;
3435 TRACE("(%p/%p)->(%p)\n", This
, iface
, pWidth
);
3437 EnterCriticalSection(&This
->cs
);
3439 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3442 hr
= IVideoWindow_get_Width(pVideoWindow
, pWidth
);
3444 LeaveCriticalSection(&This
->cs
);
3449 static HRESULT WINAPI
VideoWindow_put_Top(IVideoWindow
*iface
,
3451 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3452 IVideoWindow
* pVideoWindow
;
3455 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Top
);
3457 EnterCriticalSection(&This
->cs
);
3459 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3462 hr
= IVideoWindow_put_Top(pVideoWindow
, Top
);
3464 LeaveCriticalSection(&This
->cs
);
3469 static HRESULT WINAPI
VideoWindow_get_Top(IVideoWindow
*iface
,
3471 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3472 IVideoWindow
* pVideoWindow
;
3475 TRACE("(%p/%p)->(%p)\n", This
, iface
, pTop
);
3477 EnterCriticalSection(&This
->cs
);
3479 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3482 hr
= IVideoWindow_get_Top(pVideoWindow
, pTop
);
3484 LeaveCriticalSection(&This
->cs
);
3489 static HRESULT WINAPI
VideoWindow_put_Height(IVideoWindow
*iface
,
3491 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3492 IVideoWindow
* pVideoWindow
;
3495 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Height
);
3497 EnterCriticalSection(&This
->cs
);
3499 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3502 hr
= IVideoWindow_put_Height(pVideoWindow
, Height
);
3504 LeaveCriticalSection(&This
->cs
);
3509 static HRESULT WINAPI
VideoWindow_get_Height(IVideoWindow
*iface
,
3511 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3512 IVideoWindow
* pVideoWindow
;
3515 TRACE("(%p/%p)->(%p)\n", This
, iface
, pHeight
);
3517 EnterCriticalSection(&This
->cs
);
3519 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3522 hr
= IVideoWindow_get_Height(pVideoWindow
, pHeight
);
3524 LeaveCriticalSection(&This
->cs
);
3529 static HRESULT WINAPI
VideoWindow_put_Owner(IVideoWindow
*iface
,
3531 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3532 IVideoWindow
* pVideoWindow
;
3535 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Owner
);
3537 EnterCriticalSection(&This
->cs
);
3539 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3542 hr
= IVideoWindow_put_Owner(pVideoWindow
, Owner
);
3544 LeaveCriticalSection(&This
->cs
);
3549 static HRESULT WINAPI
VideoWindow_get_Owner(IVideoWindow
*iface
,
3551 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3552 IVideoWindow
* pVideoWindow
;
3555 TRACE("(%p/%p)->(%p)\n", This
, iface
, Owner
);
3557 EnterCriticalSection(&This
->cs
);
3559 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3562 hr
= IVideoWindow_get_Owner(pVideoWindow
, Owner
);
3564 LeaveCriticalSection(&This
->cs
);
3569 static HRESULT WINAPI
VideoWindow_put_MessageDrain(IVideoWindow
*iface
,
3571 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3572 IVideoWindow
* pVideoWindow
;
3575 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Drain
);
3577 EnterCriticalSection(&This
->cs
);
3579 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3582 hr
= IVideoWindow_put_MessageDrain(pVideoWindow
, Drain
);
3584 LeaveCriticalSection(&This
->cs
);
3589 static HRESULT WINAPI
VideoWindow_get_MessageDrain(IVideoWindow
*iface
,
3591 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3592 IVideoWindow
* pVideoWindow
;
3595 TRACE("(%p/%p)->(%p)\n", This
, iface
, Drain
);
3597 EnterCriticalSection(&This
->cs
);
3599 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3602 hr
= IVideoWindow_get_MessageDrain(pVideoWindow
, Drain
);
3604 LeaveCriticalSection(&This
->cs
);
3609 static HRESULT WINAPI
VideoWindow_get_BorderColor(IVideoWindow
*iface
,
3611 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3612 IVideoWindow
* pVideoWindow
;
3615 TRACE("(%p/%p)->(%p)\n", This
, iface
, Color
);
3617 EnterCriticalSection(&This
->cs
);
3619 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3622 hr
= IVideoWindow_get_BorderColor(pVideoWindow
, Color
);
3624 LeaveCriticalSection(&This
->cs
);
3629 static HRESULT WINAPI
VideoWindow_put_BorderColor(IVideoWindow
*iface
,
3631 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3632 IVideoWindow
* pVideoWindow
;
3635 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Color
);
3637 EnterCriticalSection(&This
->cs
);
3639 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3642 hr
= IVideoWindow_put_BorderColor(pVideoWindow
, Color
);
3644 LeaveCriticalSection(&This
->cs
);
3649 static HRESULT WINAPI
VideoWindow_get_FullScreenMode(IVideoWindow
*iface
,
3650 long *FullScreenMode
) {
3651 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3652 IVideoWindow
* pVideoWindow
;
3655 TRACE("(%p/%p)->(%p)\n", This
, iface
, FullScreenMode
);
3657 EnterCriticalSection(&This
->cs
);
3659 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3662 hr
= IVideoWindow_get_FullScreenMode(pVideoWindow
, FullScreenMode
);
3664 LeaveCriticalSection(&This
->cs
);
3669 static HRESULT WINAPI
VideoWindow_put_FullScreenMode(IVideoWindow
*iface
,
3670 long FullScreenMode
) {
3671 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3672 IVideoWindow
* pVideoWindow
;
3675 TRACE("(%p/%p)->(%ld)\n", This
, iface
, FullScreenMode
);
3677 EnterCriticalSection(&This
->cs
);
3679 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3682 hr
= IVideoWindow_put_FullScreenMode(pVideoWindow
, FullScreenMode
);
3684 LeaveCriticalSection(&This
->cs
);
3689 static HRESULT WINAPI
VideoWindow_SetWindowForeground(IVideoWindow
*iface
,
3691 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3692 IVideoWindow
* pVideoWindow
;
3695 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Focus
);
3697 EnterCriticalSection(&This
->cs
);
3699 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3702 hr
= IVideoWindow_SetWindowForeground(pVideoWindow
, Focus
);
3704 LeaveCriticalSection(&This
->cs
);
3709 static HRESULT WINAPI
VideoWindow_NotifyOwnerMessage(IVideoWindow
*iface
,
3714 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3715 IVideoWindow
* pVideoWindow
;
3718 TRACE("(%p/%p)->(%08x, %ld, %08lx, %08lx)\n", This
, iface
, (DWORD
) hwnd
, uMsg
, wParam
, lParam
);
3720 EnterCriticalSection(&This
->cs
);
3722 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3725 hr
= IVideoWindow_NotifyOwnerMessage(pVideoWindow
, hwnd
, uMsg
, wParam
, lParam
);
3727 LeaveCriticalSection(&This
->cs
);
3732 static HRESULT WINAPI
VideoWindow_SetWindowPosition(IVideoWindow
*iface
,
3737 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3738 IVideoWindow
* pVideoWindow
;
3741 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
3743 EnterCriticalSection(&This
->cs
);
3745 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3748 hr
= IVideoWindow_SetWindowPosition(pVideoWindow
, Left
, Top
, Width
, Height
);
3750 LeaveCriticalSection(&This
->cs
);
3755 static HRESULT WINAPI
VideoWindow_GetWindowPosition(IVideoWindow
*iface
,
3760 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3761 IVideoWindow
* pVideoWindow
;
3764 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3766 EnterCriticalSection(&This
->cs
);
3768 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3771 hr
= IVideoWindow_GetWindowPosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3773 LeaveCriticalSection(&This
->cs
);
3778 static HRESULT WINAPI
VideoWindow_GetMinIdealImageSize(IVideoWindow
*iface
,
3781 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3782 IVideoWindow
* pVideoWindow
;
3785 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3787 EnterCriticalSection(&This
->cs
);
3789 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3792 hr
= IVideoWindow_GetMinIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3794 LeaveCriticalSection(&This
->cs
);
3799 static HRESULT WINAPI
VideoWindow_GetMaxIdealImageSize(IVideoWindow
*iface
,
3802 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3803 IVideoWindow
* pVideoWindow
;
3806 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
3808 EnterCriticalSection(&This
->cs
);
3810 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3813 hr
= IVideoWindow_GetMaxIdealImageSize(pVideoWindow
, pWidth
, pHeight
);
3815 LeaveCriticalSection(&This
->cs
);
3820 static HRESULT WINAPI
VideoWindow_GetRestorePosition(IVideoWindow
*iface
,
3825 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3826 IVideoWindow
* pVideoWindow
;
3829 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
3831 EnterCriticalSection(&This
->cs
);
3833 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3836 hr
= IVideoWindow_GetRestorePosition(pVideoWindow
, pLeft
, pTop
, pWidth
, pHeight
);
3838 LeaveCriticalSection(&This
->cs
);
3843 static HRESULT WINAPI
VideoWindow_HideCursor(IVideoWindow
*iface
,
3845 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3846 IVideoWindow
* pVideoWindow
;
3849 TRACE("(%p/%p)->(%ld)\n", This
, iface
, HideCursor
);
3851 EnterCriticalSection(&This
->cs
);
3853 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3856 hr
= IVideoWindow_HideCursor(pVideoWindow
, HideCursor
);
3858 LeaveCriticalSection(&This
->cs
);
3863 static HRESULT WINAPI
VideoWindow_IsCursorHidden(IVideoWindow
*iface
,
3864 long *CursorHidden
) {
3865 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
3866 IVideoWindow
* pVideoWindow
;
3869 TRACE("(%p/%p)->(%p)\n", This
, iface
, CursorHidden
);
3871 EnterCriticalSection(&This
->cs
);
3873 hr
= GetTargetInterface(This
, &IID_IVideoWindow
, (LPVOID
*)&pVideoWindow
);
3876 hr
= IVideoWindow_IsCursorHidden(pVideoWindow
, CursorHidden
);
3878 LeaveCriticalSection(&This
->cs
);
3884 static const IVideoWindowVtbl IVideoWindow_VTable
=
3886 VideoWindow_QueryInterface
,
3888 VideoWindow_Release
,
3889 VideoWindow_GetTypeInfoCount
,
3890 VideoWindow_GetTypeInfo
,
3891 VideoWindow_GetIDsOfNames
,
3893 VideoWindow_put_Caption
,
3894 VideoWindow_get_Caption
,
3895 VideoWindow_put_WindowStyle
,
3896 VideoWindow_get_WindowStyle
,
3897 VideoWindow_put_WindowStyleEx
,
3898 VideoWindow_get_WindowStyleEx
,
3899 VideoWindow_put_AutoShow
,
3900 VideoWindow_get_AutoShow
,
3901 VideoWindow_put_WindowState
,
3902 VideoWindow_get_WindowState
,
3903 VideoWindow_put_BackgroundPalette
,
3904 VideoWindow_get_BackgroundPalette
,
3905 VideoWindow_put_Visible
,
3906 VideoWindow_get_Visible
,
3907 VideoWindow_put_Left
,
3908 VideoWindow_get_Left
,
3909 VideoWindow_put_Width
,
3910 VideoWindow_get_Width
,
3911 VideoWindow_put_Top
,
3912 VideoWindow_get_Top
,
3913 VideoWindow_put_Height
,
3914 VideoWindow_get_Height
,
3915 VideoWindow_put_Owner
,
3916 VideoWindow_get_Owner
,
3917 VideoWindow_put_MessageDrain
,
3918 VideoWindow_get_MessageDrain
,
3919 VideoWindow_get_BorderColor
,
3920 VideoWindow_put_BorderColor
,
3921 VideoWindow_get_FullScreenMode
,
3922 VideoWindow_put_FullScreenMode
,
3923 VideoWindow_SetWindowForeground
,
3924 VideoWindow_NotifyOwnerMessage
,
3925 VideoWindow_SetWindowPosition
,
3926 VideoWindow_GetWindowPosition
,
3927 VideoWindow_GetMinIdealImageSize
,
3928 VideoWindow_GetMaxIdealImageSize
,
3929 VideoWindow_GetRestorePosition
,
3930 VideoWindow_HideCursor
,
3931 VideoWindow_IsCursorHidden
3935 /*** IUnknown methods ***/
3936 static HRESULT WINAPI
MediaEvent_QueryInterface(IMediaEventEx
*iface
,
3939 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3941 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
3943 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
3946 static ULONG WINAPI
MediaEvent_AddRef(IMediaEventEx
*iface
) {
3947 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3949 TRACE("(%p/%p)->()\n", This
, iface
);
3951 return Filtergraph_AddRef(This
);
3954 static ULONG WINAPI
MediaEvent_Release(IMediaEventEx
*iface
) {
3955 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3957 TRACE("(%p/%p)->()\n", This
, iface
);
3959 return Filtergraph_Release(This
);
3962 /*** IDispatch methods ***/
3963 static HRESULT WINAPI
MediaEvent_GetTypeInfoCount(IMediaEventEx
*iface
,
3965 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3967 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
3972 static HRESULT WINAPI
MediaEvent_GetTypeInfo(IMediaEventEx
*iface
,
3975 ITypeInfo
**ppTInfo
) {
3976 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3978 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
3983 static HRESULT WINAPI
MediaEvent_GetIDsOfNames(IMediaEventEx
*iface
,
3989 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
3991 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
3996 static HRESULT WINAPI
MediaEvent_Invoke(IMediaEventEx
*iface
,
3997 DISPID dispIdMember
,
4001 DISPPARAMS
*pDispParams
,
4003 EXCEPINFO
*pExepInfo
,
4005 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4007 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
);
4012 /*** IMediaEvent methods ***/
4013 static HRESULT WINAPI
MediaEvent_GetEventHandle(IMediaEventEx
*iface
,
4015 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4017 TRACE("(%p/%p)->(%p)\n", This
, iface
, hEvent
);
4019 *hEvent
= (OAEVENT
)This
->evqueue
.msg_event
;
4024 static HRESULT WINAPI
MediaEvent_GetEvent(IMediaEventEx
*iface
,
4029 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4032 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This
, iface
, lEventCode
, lParam1
, lParam2
, msTimeout
);
4034 if (EventsQueue_GetEvent(&This
->evqueue
, &evt
, msTimeout
))
4036 *lEventCode
= evt
.lEventCode
;
4037 *lParam1
= evt
.lParam1
;
4038 *lParam2
= evt
.lParam2
;
4046 static HRESULT WINAPI
MediaEvent_WaitForCompletion(IMediaEventEx
*iface
,
4049 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4051 TRACE("(%p/%p)->(%ld, %p)\n", This
, iface
, msTimeout
, pEvCode
);
4053 if (WaitForSingleObject(This
->hEventCompletion
, msTimeout
) == WAIT_OBJECT_0
)
4055 *pEvCode
= This
->CompletionStatus
;
4063 static HRESULT WINAPI
MediaEvent_CancelDefaultHandling(IMediaEventEx
*iface
,
4065 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4067 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4069 if (lEvCode
== EC_COMPLETE
)
4070 This
->HandleEcComplete
= FALSE
;
4071 else if (lEvCode
== EC_REPAINT
)
4072 This
->HandleEcRepaint
= FALSE
;
4079 static HRESULT WINAPI
MediaEvent_RestoreDefaultHandling(IMediaEventEx
*iface
,
4081 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4083 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
4085 if (lEvCode
== EC_COMPLETE
)
4086 This
->HandleEcComplete
= TRUE
;
4087 else if (lEvCode
== EC_REPAINT
)
4088 This
->HandleEcRepaint
= TRUE
;
4095 static HRESULT WINAPI
MediaEvent_FreeEventParams(IMediaEventEx
*iface
,
4099 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4101 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This
, iface
, lEvCode
, lParam1
, lParam2
);
4106 /*** IMediaEventEx methods ***/
4107 static HRESULT WINAPI
MediaEvent_SetNotifyWindow(IMediaEventEx
*iface
,
4110 LONG_PTR lInstanceData
) {
4111 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4113 TRACE("(%p/%p)->(%08x, %ld, %08lx)\n", This
, iface
, (DWORD
) hwnd
, lMsg
, lInstanceData
);
4115 This
->notif
.hWnd
= (HWND
)hwnd
;
4116 This
->notif
.msg
= lMsg
;
4117 This
->notif
.instance
= (long) lInstanceData
;
4122 static HRESULT WINAPI
MediaEvent_SetNotifyFlags(IMediaEventEx
*iface
,
4123 long lNoNotifyFlags
) {
4124 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4126 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lNoNotifyFlags
);
4128 if ((lNoNotifyFlags
!= 0) && (lNoNotifyFlags
!= 1))
4129 return E_INVALIDARG
;
4131 This
->notif
.disabled
= lNoNotifyFlags
;
4136 static HRESULT WINAPI
MediaEvent_GetNotifyFlags(IMediaEventEx
*iface
,
4137 long *lplNoNotifyFlags
) {
4138 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
4140 TRACE("(%p/%p)->(%p)\n", This
, iface
, lplNoNotifyFlags
);
4142 if (!lplNoNotifyFlags
)
4145 *lplNoNotifyFlags
= This
->notif
.disabled
;
4151 static const IMediaEventExVtbl IMediaEventEx_VTable
=
4153 MediaEvent_QueryInterface
,
4156 MediaEvent_GetTypeInfoCount
,
4157 MediaEvent_GetTypeInfo
,
4158 MediaEvent_GetIDsOfNames
,
4160 MediaEvent_GetEventHandle
,
4161 MediaEvent_GetEvent
,
4162 MediaEvent_WaitForCompletion
,
4163 MediaEvent_CancelDefaultHandling
,
4164 MediaEvent_RestoreDefaultHandling
,
4165 MediaEvent_FreeEventParams
,
4166 MediaEvent_SetNotifyWindow
,
4167 MediaEvent_SetNotifyFlags
,
4168 MediaEvent_GetNotifyFlags
4172 static HRESULT WINAPI
MediaFilter_QueryInterface(IMediaFilter
*iface
, REFIID riid
, LPVOID
*ppv
)
4174 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4176 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4179 static ULONG WINAPI
MediaFilter_AddRef(IMediaFilter
*iface
)
4181 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4183 return Filtergraph_AddRef(This
);
4186 static ULONG WINAPI
MediaFilter_Release(IMediaFilter
*iface
)
4188 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaFilter_vtbl
, iface
);
4190 return Filtergraph_Release(This
);
4193 static HRESULT WINAPI
MediaFilter_GetClassID(IMediaFilter
*iface
, CLSID
* pClassID
)
4195 FIXME("(%p): stub\n", pClassID
);
4200 static HRESULT WINAPI
MediaFilter_Stop(IMediaFilter
*iface
)
4202 FIXME("(): stub\n");
4207 static HRESULT WINAPI
MediaFilter_Pause(IMediaFilter
*iface
)
4209 FIXME("(): stub\n");
4214 static HRESULT WINAPI
MediaFilter_Run(IMediaFilter
*iface
, REFERENCE_TIME tStart
)
4216 FIXME("(0x%s): stub\n", wine_dbgstr_longlong(tStart
));
4221 static HRESULT WINAPI
MediaFilter_GetState(IMediaFilter
*iface
, DWORD dwMsTimeout
, FILTER_STATE
* pState
)
4223 FIXME("(%d, %p): stub\n", dwMsTimeout
, pState
);
4228 static HRESULT WINAPI
MediaFilter_SetSyncSource(IMediaFilter
*iface
, IReferenceClock
*pClock
)
4230 FIXME("(%p): stub\n", pClock
);
4235 static HRESULT WINAPI
MediaFilter_GetSyncSource(IMediaFilter
*iface
, IReferenceClock
**ppClock
)
4237 FIXME("(%p): stub\n", ppClock
);
4242 static const IMediaFilterVtbl IMediaFilter_VTable
=
4244 MediaFilter_QueryInterface
,
4246 MediaFilter_Release
,
4247 MediaFilter_GetClassID
,
4251 MediaFilter_GetState
,
4252 MediaFilter_SetSyncSource
,
4253 MediaFilter_GetSyncSource
4256 static HRESULT WINAPI
MediaEventSink_QueryInterface(IMediaEventSink
*iface
, REFIID riid
, LPVOID
*ppv
)
4258 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4260 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4263 static ULONG WINAPI
MediaEventSink_AddRef(IMediaEventSink
*iface
)
4265 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4267 return Filtergraph_AddRef(This
);
4270 static ULONG WINAPI
MediaEventSink_Release(IMediaEventSink
*iface
)
4272 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4274 return Filtergraph_Release(This
);
4277 static HRESULT WINAPI
MediaEventSink_Notify(IMediaEventSink
*iface
, long EventCode
, LONG_PTR EventParam1
, LONG_PTR EventParam2
)
4279 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4282 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This
, iface
, EventCode
, EventParam1
, EventParam2
);
4284 /* We need thread safety here, let's use the events queue's one */
4285 EnterCriticalSection(&This
->evqueue
.msg_crst
);
4287 if ((EventCode
== EC_COMPLETE
) && This
->HandleEcComplete
)
4289 TRACE("Process EC_COMPLETE notification\n");
4290 if (++This
->EcCompleteCount
== This
->nRenderers
)
4292 evt
.lEventCode
= EC_COMPLETE
;
4295 TRACE("Send EC_COMPLETE to app\n");
4296 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4297 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4299 TRACE("Send Window message\n");
4300 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4302 This
->CompletionStatus
= EC_COMPLETE
;
4303 SetEvent(This
->hEventCompletion
);
4306 else if ((EventCode
== EC_REPAINT
) && This
->HandleEcRepaint
)
4308 /* FIXME: Not handled yet */
4312 evt
.lEventCode
= EventCode
;
4313 evt
.lParam1
= EventParam1
;
4314 evt
.lParam2
= EventParam2
;
4315 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
4316 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
4317 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
4320 LeaveCriticalSection(&This
->evqueue
.msg_crst
);
4324 static const IMediaEventSinkVtbl IMediaEventSink_VTable
=
4326 MediaEventSink_QueryInterface
,
4327 MediaEventSink_AddRef
,
4328 MediaEventSink_Release
,
4329 MediaEventSink_Notify
4332 static HRESULT WINAPI
GraphConfig_QueryInterface(IGraphConfig
*iface
, REFIID riid
, LPVOID
*ppv
)
4334 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4336 return Filtergraph_QueryInterface(This
, riid
, ppv
);
4339 static ULONG WINAPI
GraphConfig_AddRef(IGraphConfig
*iface
)
4341 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
4343 return Filtergraph_AddRef(This
);
4346 static ULONG WINAPI
GraphConfig_Release(IGraphConfig
*iface
)
4348 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4350 return Filtergraph_Release(This
);
4353 static HRESULT WINAPI
GraphConfig_Reconnect(IGraphConfig
*iface
,
4356 const AM_MEDIA_TYPE
* pmtFirstConnection
,
4357 IBaseFilter
* pUsingFilter
,
4361 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4363 FIXME("(%p)->(%p, %p, %p, %p, %p, %x): stub!\n", This
, pOutputPin
, pInputPin
, pmtFirstConnection
, pUsingFilter
, hAbortEvent
, dwFlags
);
4368 static HRESULT WINAPI
GraphConfig_Reconfigure(IGraphConfig
*iface
,
4369 IGraphConfigCallback
* pCallback
,
4374 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4376 FIXME("(%p)->(%p, %p, %x, %p): stub!\n", This
, pCallback
, pvContext
, dwFlags
, hAbortEvent
);
4381 static HRESULT WINAPI
GraphConfig_AddFilterToCache(IGraphConfig
*iface
,
4382 IBaseFilter
* pFilter
)
4384 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4386 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4391 static HRESULT WINAPI
GraphConfig_EnumCacheFilter(IGraphConfig
*iface
,
4392 IEnumFilters
** pEnum
)
4394 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4396 FIXME("(%p)->(%p): stub!\n", This
, pEnum
);
4401 static HRESULT WINAPI
GraphConfig_RemoveFilterFromCache(IGraphConfig
*iface
,
4402 IBaseFilter
* pFilter
)
4404 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4406 FIXME("(%p)->(%p): stub!\n", This
, pFilter
);
4411 static HRESULT WINAPI
GraphConfig_GetStartTime(IGraphConfig
*iface
,
4412 REFERENCE_TIME
* prtStart
)
4414 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4416 FIXME("(%p)->(%p): stub!\n", This
, prtStart
);
4421 static HRESULT WINAPI
GraphConfig_PushThroughData(IGraphConfig
*iface
,
4423 IPinConnection
* pConnection
,
4426 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4428 FIXME("(%p)->(%p, %p, %p): stub!\n", This
, pOutputPin
, pConnection
, hEventAbort
);
4433 static HRESULT WINAPI
GraphConfig_SetFilterFlags(IGraphConfig
*iface
,
4434 IBaseFilter
* pFilter
,
4437 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4439 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4444 static HRESULT WINAPI
GraphConfig_GetFilterFlags(IGraphConfig
*iface
,
4445 IBaseFilter
* pFilter
,
4448 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4450 FIXME("(%p)->(%p, %p): stub!\n", This
, pFilter
, dwFlags
);
4455 static HRESULT WINAPI
GraphConfig_RemoveFilterEx(IGraphConfig
*iface
,
4456 IBaseFilter
* pFilter
,
4459 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphConfig_vtbl
, iface
);
4461 FIXME("(%p)->(%p, %x): stub!\n", This
, pFilter
, dwFlags
);
4466 static const IGraphConfigVtbl IGraphConfig_VTable
=
4468 GraphConfig_QueryInterface
,
4470 GraphConfig_Release
,
4471 GraphConfig_Reconnect
,
4472 GraphConfig_Reconfigure
,
4473 GraphConfig_AddFilterToCache
,
4474 GraphConfig_EnumCacheFilter
,
4475 GraphConfig_RemoveFilterFromCache
,
4476 GraphConfig_GetStartTime
,
4477 GraphConfig_PushThroughData
,
4478 GraphConfig_SetFilterFlags
,
4479 GraphConfig_GetFilterFlags
,
4480 GraphConfig_RemoveFilterEx
4483 /* This is the only function that actually creates a FilterGraph class... */
4484 HRESULT
FilterGraph_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4486 IFilterGraphImpl
*fimpl
;
4489 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
4492 return CLASS_E_NOAGGREGATION
;
4494 fimpl
= CoTaskMemAlloc(sizeof(*fimpl
));
4495 fimpl
->IGraphBuilder_vtbl
= &IGraphBuilder_VTable
;
4496 fimpl
->IMediaControl_vtbl
= &IMediaControl_VTable
;
4497 fimpl
->IMediaSeeking_vtbl
= &IMediaSeeking_VTable
;
4498 fimpl
->IBasicAudio_vtbl
= &IBasicAudio_VTable
;
4499 fimpl
->IBasicVideo_vtbl
= &IBasicVideo_VTable
;
4500 fimpl
->IVideoWindow_vtbl
= &IVideoWindow_VTable
;
4501 fimpl
->IMediaEventEx_vtbl
= &IMediaEventEx_VTable
;
4502 fimpl
->IMediaFilter_vtbl
= &IMediaFilter_VTable
;
4503 fimpl
->IMediaEventSink_vtbl
= &IMediaEventSink_VTable
;
4504 fimpl
->IGraphConfig_vtbl
= &IGraphConfig_VTable
;
4505 fimpl
->IMediaPosition_vtbl
= &IMediaPosition_VTable
;
4507 fimpl
->ppFiltersInGraph
= NULL
;
4508 fimpl
->pFilterNames
= NULL
;
4509 fimpl
->nFilters
= 0;
4510 fimpl
->filterCapacity
= 0;
4511 fimpl
->nameIndex
= 1;
4512 fimpl
->hEventCompletion
= CreateEventW(0, TRUE
, FALSE
, 0);
4513 fimpl
->HandleEcComplete
= TRUE
;
4514 fimpl
->HandleEcRepaint
= TRUE
;
4515 fimpl
->notif
.hWnd
= 0;
4516 fimpl
->notif
.disabled
= FALSE
;
4517 fimpl
->nRenderers
= 0;
4518 fimpl
->EcCompleteCount
= 0;
4519 fimpl
->state
= State_Stopped
;
4520 EventsQueue_Init(&fimpl
->evqueue
);
4521 InitializeCriticalSection(&fimpl
->cs
);
4522 fimpl
->cs
.DebugInfo
->Spare
[0] = (DWORD_PTR
)(__FILE__
": IFilterGraphImpl.cs");
4523 fimpl
->nItfCacheEntries
= 0;
4525 hr
= CoCreateInstance(&CLSID_FilterMapper2
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IFilterMapper2
, (LPVOID
*)&fimpl
->pFilterMapper2
);
4527 ERR("Unable to create filter mapper (%x)\n", hr
);
4535 HRESULT
FilterGraphNoThread_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
)
4537 FIXME("CLSID_FilterGraphNoThread partially implemented - Forwarding to CLSID_FilterGraph\n");
4538 return FilterGraph_create(pUnkOuter
, ppObj
);