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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
33 #include "wine/debug.h"
34 #include "quartz_private.h"
35 #define COM_NO_WINDOWS_H
41 #include "wine/unicode.h"
44 WINE_DEFAULT_DEBUG_CHANNEL(quartz
);
47 HWND hWnd
; /* Target window */
48 long msg
; /* User window message */
49 long instance
; /* User data */
50 int disabled
; /* Disabled messages posting */
54 long lEventCode
; /* Event code */
55 LONG_PTR lParam1
; /* Param1 */
56 LONG_PTR lParam2
; /* Param2 */
59 /* messages ring implementation for queuing events (taken from winmm) */
60 #define EVENTS_RING_BUFFER_INCREMENT 64
66 CRITICAL_SECTION msg_crst
;
67 HANDLE msg_event
; /* Signaled for no empty queue */
70 static int EventsQueue_Init(EventsQueue
* omr
)
74 omr
->msg_event
= CreateEventW(NULL
, TRUE
, FALSE
, NULL
);
75 omr
->ring_buffer_size
= EVENTS_RING_BUFFER_INCREMENT
;
76 omr
->messages
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
,omr
->ring_buffer_size
* sizeof(Event
));
78 InitializeCriticalSection(&omr
->msg_crst
);
82 static int EventsQueue_Destroy(EventsQueue
* omr
)
84 CloseHandle(omr
->msg_event
);
85 HeapFree(GetProcessHeap(),0,omr
->messages
);
86 DeleteCriticalSection(&omr
->msg_crst
);
90 static int EventsQueue_PutEvent(EventsQueue
* omr
, Event
* evt
)
92 EnterCriticalSection(&omr
->msg_crst
);
93 if ((omr
->msg_toget
== ((omr
->msg_tosave
+ 1) % omr
->ring_buffer_size
)))
95 int old_ring_buffer_size
= omr
->ring_buffer_size
;
96 omr
->ring_buffer_size
+= EVENTS_RING_BUFFER_INCREMENT
;
97 TRACE("omr->ring_buffer_size=%d\n",omr
->ring_buffer_size
);
98 omr
->messages
= HeapReAlloc(GetProcessHeap(),0,omr
->messages
, omr
->ring_buffer_size
* sizeof(Event
));
99 /* Now we need to rearrange the ring buffer so that the new
100 buffers just allocated are in between omr->msg_tosave and
103 if (omr
->msg_tosave
< omr
->msg_toget
)
105 memmove(&(omr
->messages
[omr
->msg_toget
+ EVENTS_RING_BUFFER_INCREMENT
]),
106 &(omr
->messages
[omr
->msg_toget
]),
107 sizeof(Event
)*(old_ring_buffer_size
- omr
->msg_toget
)
109 omr
->msg_toget
+= EVENTS_RING_BUFFER_INCREMENT
;
112 omr
->messages
[omr
->msg_tosave
] = *evt
;
113 SetEvent(omr
->msg_event
);
114 omr
->msg_tosave
= (omr
->msg_tosave
+ 1) % omr
->ring_buffer_size
;
115 LeaveCriticalSection(&omr
->msg_crst
);
119 static int EventsQueue_GetEvent(EventsQueue
* omr
, Event
* evt
, long msTimeOut
)
121 if (WaitForSingleObject(omr
->msg_event
, msTimeOut
) != WAIT_OBJECT_0
)
124 EnterCriticalSection(&omr
->msg_crst
);
126 if (omr
->msg_toget
== omr
->msg_tosave
) /* buffer empty ? */
128 LeaveCriticalSection(&omr
->msg_crst
);
132 *evt
= omr
->messages
[omr
->msg_toget
];
133 omr
->msg_toget
= (omr
->msg_toget
+ 1) % omr
->ring_buffer_size
;
135 /* Mark the buffer as empty if needed */
136 if (omr
->msg_toget
== omr
->msg_tosave
) /* buffer empty ? */
137 ResetEvent(omr
->msg_event
);
139 LeaveCriticalSection(&omr
->msg_crst
);
143 typedef struct _IFilterGraphImpl
{
144 IGraphBuilderVtbl
*IGraphBuilder_vtbl
;
145 IMediaControlVtbl
*IMediaControl_vtbl
;
146 IMediaSeekingVtbl
*IMediaSeeking_vtbl
;
147 IBasicAudioVtbl
*IBasicAudio_vtbl
;
148 IBasicVideoVtbl
*IBasicVideo_vtbl
;
149 IVideoWindowVtbl
*IVideoWindow_vtbl
;
150 IMediaEventExVtbl
*IMediaEventEx_vtbl
;
151 IMediaFilterVtbl
*IMediaFilter_vtbl
;
152 IMediaEventSinkVtbl
*IMediaEventSink_vtbl
;
153 /* IAMGraphStreams */
163 /* IRegisterServiceProvider */
164 /* IResourceMananger */
165 /* IServiceProvider */
166 /* IVideoFrameStep */
169 IFilterMapper2
* pFilterMapper2
;
170 IBaseFilter
** ppFiltersInGraph
;
171 LPWSTR
* pFilterNames
;
176 HANDLE hEventCompletion
;
177 int CompletionStatus
;
181 int HandleEcComplete
;
188 static HRESULT
Filtergraph_QueryInterface(IFilterGraphImpl
*This
,
191 TRACE("(%p)->(%s (%p), %p)\n", This
, debugstr_guid(riid
), riid
, ppvObj
);
193 if (IsEqualGUID(&IID_IUnknown
, riid
) ||
194 IsEqualGUID(&IID_IFilterGraph
, riid
) ||
195 IsEqualGUID(&IID_IGraphBuilder
, riid
)) {
196 *ppvObj
= &(This
->IGraphBuilder_vtbl
);
197 TRACE(" returning IGraphBuilder interface (%p)\n", *ppvObj
);
198 } else if (IsEqualGUID(&IID_IMediaControl
, riid
)) {
199 *ppvObj
= &(This
->IMediaControl_vtbl
);
200 TRACE(" returning IMediaControl interface (%p)\n", *ppvObj
);
201 } else if (IsEqualGUID(&IID_IMediaSeeking
, riid
)) {
202 *ppvObj
= &(This
->IMediaSeeking_vtbl
);
203 TRACE(" returning IMediaSeeking interface (%p)\n", *ppvObj
);
204 } else if (IsEqualGUID(&IID_IBasicAudio
, riid
)) {
205 *ppvObj
= &(This
->IBasicAudio_vtbl
);
206 TRACE(" returning IBasicAudio interface (%p)\n", *ppvObj
);
207 } else if (IsEqualGUID(&IID_IBasicVideo
, riid
)) {
208 *ppvObj
= &(This
->IBasicVideo_vtbl
);
209 TRACE(" returning IBasicVideo interface (%p)\n", *ppvObj
);
210 } else if (IsEqualGUID(&IID_IVideoWindow
, riid
)) {
211 *ppvObj
= &(This
->IVideoWindow_vtbl
);
212 TRACE(" returning IVideoWindow interface (%p)\n", *ppvObj
);
213 } else if (IsEqualGUID(&IID_IMediaEvent
, riid
) ||
214 IsEqualGUID(&IID_IMediaEventEx
, riid
)) {
215 *ppvObj
= &(This
->IMediaEventEx_vtbl
);
216 TRACE(" returning IMediaEvent(Ex) interface (%p)\n", *ppvObj
);
217 } else if (IsEqualGUID(&IID_IMediaFilter
, riid
) ||
218 IsEqualGUID(&IID_IPersist
, riid
)) {
219 *ppvObj
= &(This
->IMediaFilter_vtbl
);
220 TRACE(" returning IMediaFilter interface (%p)\n", *ppvObj
);
221 } else if (IsEqualGUID(&IID_IMediaEventSink
, riid
)) {
222 *ppvObj
= &(This
->IMediaEventSink_vtbl
);
223 TRACE(" returning IMediaEventSink interface (%p)\n", *ppvObj
);
226 FIXME("unknown interface %s\n", debugstr_guid(riid
));
227 return E_NOINTERFACE
;
234 static ULONG
Filtergraph_AddRef(IFilterGraphImpl
*This
) {
235 TRACE("(%p)->(): new ref = %ld\n", This
, This
->ref
+ 1);
240 static ULONG
Filtergraph_Release(IFilterGraphImpl
*This
) {
243 TRACE("(%p)->(): new ref = %ld\n", This
, This
->ref
- 1);
247 IFilterMapper2_Release(This
->pFilterMapper2
);
248 CloseHandle(This
->hEventCompletion
);
249 EventsQueue_Destroy(&This
->evqueue
);
250 DeleteCriticalSection(&This
->cs
);
251 HeapFree(GetProcessHeap(), 0, This
->ppFiltersInGraph
);
252 HeapFree(GetProcessHeap(), 0, This
->pFilterNames
);
253 HeapFree(GetProcessHeap(), 0, This
);
259 /*** IUnknown methods ***/
260 static HRESULT WINAPI
Graphbuilder_QueryInterface(IGraphBuilder
*iface
,
263 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
265 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
266 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
269 static ULONG WINAPI
Graphbuilder_AddRef(IGraphBuilder
*iface
) {
270 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
272 TRACE("(%p/%p)->() calling FilterGraph AddRef\n", This
, iface
);
274 return Filtergraph_AddRef(This
);
277 static ULONG WINAPI
Graphbuilder_Release(IGraphBuilder
*iface
) {
278 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
280 TRACE("(%p/%p)->() calling FilterGraph Release\n", This
, iface
);
282 return Filtergraph_Release(This
);
285 /*** IFilterGraph methods ***/
286 static HRESULT WINAPI
Graphbuilder_AddFilter(IGraphBuilder
*iface
,
287 IBaseFilter
*pFilter
,
289 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
292 WCHAR
* wszFilterName
= NULL
;
293 int duplicate_name
= FALSE
;
295 TRACE("(%p/%p)->(%p, %s (%p))\n", This
, iface
, pFilter
, debugstr_w(pName
), pName
);
297 wszFilterName
= (WCHAR
*) CoTaskMemAlloc( (pName
? strlenW(pName
) + 6 : 5) * sizeof(WCHAR
) );
301 /* Check if name already exists */
302 for(i
= 0; i
< This
->nFilters
; i
++)
303 if (!strcmpW(This
->pFilterNames
[i
], pName
))
305 duplicate_name
= TRUE
;
310 /* If no name given or name already existing, generate one */
311 if (!pName
|| duplicate_name
)
313 static const WCHAR wszFmt1
[] = {'%','s',' ','%','0','4','d',0};
314 static const WCHAR wszFmt2
[] = {'%','0','4','d',0};
316 for (j
= 0; j
< 10000 ; j
++)
320 sprintfW(wszFilterName
, wszFmt1
, pName
, This
->nameIndex
);
322 sprintfW(wszFilterName
, wszFmt2
, This
->nameIndex
);
323 TRACE("Generated name %s\n", debugstr_w(wszFilterName
));
325 /* Check if the generated name already exists */
326 for(i
= 0; i
< This
->nFilters
; i
++)
327 if (!strcmpW(This
->pFilterNames
[i
], wszFilterName
))
330 /* Compute next index and exit if generated name is suitable */
331 if (This
->nameIndex
++ == 10000)
333 if (i
== This
->nFilters
)
336 /* Unable to find a suitable name */
339 CoTaskMemFree(wszFilterName
);
340 return VFW_E_DUPLICATE_NAME
;
344 memcpy(wszFilterName
, pName
, (strlenW(pName
) + 1) * sizeof(WCHAR
));
346 if (This
->nFilters
+ 1 > This
->filterCapacity
)
348 int newCapacity
= 2*This
->filterCapacity
;
349 IBaseFilter
** ppNewFilters
= CoTaskMemAlloc(newCapacity
* sizeof(IBaseFilter
*));
350 LPWSTR
* pNewNames
= CoTaskMemAlloc(newCapacity
* sizeof(LPWSTR
));
351 memcpy(ppNewFilters
, This
->ppFiltersInGraph
, This
->nFilters
* sizeof(IBaseFilter
*));
352 memcpy(pNewNames
, This
->pFilterNames
, This
->nFilters
* sizeof(LPWSTR
));
353 CoTaskMemFree(This
->ppFiltersInGraph
);
354 CoTaskMemFree(This
->pFilterNames
);
355 This
->ppFiltersInGraph
= ppNewFilters
;
356 This
->pFilterNames
= pNewNames
;
357 This
->filterCapacity
= newCapacity
;
360 hr
= IBaseFilter_JoinFilterGraph(pFilter
, (IFilterGraph
*)This
, wszFilterName
);
364 IBaseFilter_AddRef(pFilter
);
365 This
->ppFiltersInGraph
[This
->nFilters
] = pFilter
;
366 This
->pFilterNames
[This
->nFilters
] = wszFilterName
;
370 CoTaskMemFree(wszFilterName
);
372 if (SUCCEEDED(hr
) && duplicate_name
)
373 return VFW_S_DUPLICATE_NAME
;
378 static HRESULT WINAPI
Graphbuilder_RemoveFilter(IGraphBuilder
*iface
,
379 IBaseFilter
*pFilter
) {
380 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
384 TRACE("(%p/%p)->(%p)\n", This
, iface
, pFilter
);
386 /* FIXME: check graph is stopped */
388 for (i
= 0; i
< This
->nFilters
; i
++)
390 if (This
->ppFiltersInGraph
[i
] == pFilter
)
392 /* FIXME: disconnect pins */
393 hr
= IBaseFilter_JoinFilterGraph(pFilter
, NULL
, This
->pFilterNames
[i
]);
396 IPin_Release(pFilter
);
397 CoTaskMemFree(This
->pFilterNames
[i
]);
398 memmove(This
->ppFiltersInGraph
+i
, This
->ppFiltersInGraph
+i
+1, sizeof(IBaseFilter
*)*(This
->nFilters
- 1 - i
));
399 memmove(This
->pFilterNames
+i
, This
->pFilterNames
+i
+1, sizeof(LPWSTR
)*(This
->nFilters
- 1 - i
));
407 return hr
; /* FIXME: check this error code */
410 static HRESULT WINAPI
Graphbuilder_EnumFilters(IGraphBuilder
*iface
,
411 IEnumFilters
**ppEnum
) {
412 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
414 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppEnum
);
416 return IEnumFiltersImpl_Construct(This
->ppFiltersInGraph
, This
->nFilters
, ppEnum
);
419 static HRESULT WINAPI
Graphbuilder_FindFilterByName(IGraphBuilder
*iface
,
421 IBaseFilter
**ppFilter
) {
422 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
425 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_w(pName
), pName
, ppFilter
);
429 for (i
= 0; i
< This
->nFilters
; i
++)
431 if (!strcmpW(pName
, This
->pFilterNames
[i
]))
433 *ppFilter
= This
->ppFiltersInGraph
[i
];
434 IBaseFilter_AddRef(*ppFilter
);
439 return E_FAIL
; /* FIXME: check this error code */
442 /* NOTE: despite the implication, it doesn't matter which
443 * way round you put in the input and output pins */
444 static HRESULT WINAPI
Graphbuilder_ConnectDirect(IGraphBuilder
*iface
,
447 const AM_MEDIA_TYPE
*pmt
) {
451 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
453 TRACE("(%p/%p)->(%p, %p, %p)\n", This
, iface
, ppinIn
, ppinOut
, pmt
);
455 /* FIXME: check pins are in graph */
457 hr
= IPin_QueryDirection(ppinIn
, &dir
);
460 if (dir
== PINDIR_INPUT
)
461 hr
= IPin_Connect(ppinOut
, ppinIn
, pmt
);
463 hr
= IPin_Connect(ppinIn
, ppinOut
, pmt
);
469 static HRESULT WINAPI
Graphbuilder_Reconnect(IGraphBuilder
*iface
,
471 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
473 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppin
);
478 static HRESULT WINAPI
Graphbuilder_Disconnect(IGraphBuilder
*iface
,
480 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
482 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppin
);
484 return IPin_Disconnect(ppin
);
487 static HRESULT WINAPI
Graphbuilder_SetDefaultSyncSource(IGraphBuilder
*iface
) {
488 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
490 TRACE("(%p/%p)->(): stub !!!\n", iface
, This
);
495 static HRESULT
GetFilterInfo(IMoniker
* pMoniker
, GUID
* pclsid
, VARIANT
* pvar
)
497 static const WCHAR wszClsidName
[] = {'C','L','S','I','D',0};
498 static const WCHAR wszFriendlyName
[] = {'F','r','i','e','n','d','l','y','N','a','m','e',0};
499 IPropertyBag
* pPropBagCat
= NULL
;
503 V_VT(pvar
) = VT_BSTR
;
505 hr
= IMoniker_BindToStorage(pMoniker
, NULL
, NULL
, &IID_IPropertyBag
, (LPVOID
*)&pPropBagCat
);
508 hr
= IPropertyBag_Read(pPropBagCat
, wszClsidName
, pvar
, NULL
);
511 hr
= CLSIDFromString(V_UNION(pvar
, bstrVal
), pclsid
);
514 hr
= IPropertyBag_Read(pPropBagCat
, wszFriendlyName
, pvar
, NULL
);
517 TRACE("Moniker = %s - %s\n", debugstr_guid(pclsid
), debugstr_w(V_UNION(pvar
, bstrVal
)));
520 IPropertyBag_Release(pPropBagCat
);
525 static HRESULT
GetInternalConnections(IBaseFilter
* pfilter
, IPin
* pinputpin
, IPin
*** pppins
, ULONG
* pnb
)
530 TRACE("(%p, %p, %p, %p)\n", pfilter
, pinputpin
, pppins
, pnb
);
531 hr
= IPin_QueryInternalConnections(pinputpin
, NULL
, &nb
);
534 } else if (hr
== S_FALSE
) {
535 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*nb
);
536 hr
= IPin_QueryInternalConnections(pinputpin
, *pppins
, &nb
);
538 ERR("Error (%lx)\n", hr
);
540 } else if (hr
== E_NOTIMPL
) {
541 /* Input connected to all outputs */
542 IEnumPins
* penumpins
;
545 TRACE("E_NOTIMPL\n");
546 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
548 ERR("filter Enumpins failed (%lx)\n", hr
);
552 /* Count output pins */
553 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
554 PIN_DIRECTION pindir
;
555 IPin_QueryDirection(ppin
, &pindir
);
556 if (pindir
== PINDIR_OUTPUT
)
561 *pppins
= CoTaskMemAlloc(sizeof(IPin
*)*i
);
562 /* Retrieve output pins */
563 IEnumPins_Reset(penumpins
);
565 while(IEnumPins_Next(penumpins
, 1, &ppin
, &nb
) == S_OK
) {
566 PIN_DIRECTION pindir
;
567 IPin_QueryDirection(ppin
, &pindir
);
568 if (pindir
== PINDIR_OUTPUT
)
569 (*pppins
)[i
++] = ppin
;
575 ERR("Next failed (%lx)\n", hr
);
578 IEnumPins_Release(penumpins
);
579 } else if (FAILED(hr
)) {
580 ERR("Cannot get internal connection (%lx)\n", hr
);
588 /*** IGraphBuilder methods ***/
589 static HRESULT WINAPI
Graphbuilder_Connect(IGraphBuilder
*iface
,
592 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
595 IEnumMediaTypes
* penummt
;
597 IEnumPins
* penumpins
;
598 IEnumMoniker
* pEnumMoniker
;
604 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, ppinOut
, ppinIn
);
606 /* Try direct connection first */
607 TRACE("Try direct connection first\n");
608 hr
= IPin_Connect(ppinOut
, ppinIn
, NULL
);
610 TRACE("Direct connection successful\n");
613 TRACE("Direct connection failed, trying to insert other filters\n");
615 /* Find the appropriate transform filter than can transform the minor media type of output pin of the upstream
616 * filter to the minor mediatype of input pin of the renderer */
617 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
619 ERR("EnumMediaTypes (%lx)\n", hr
);
623 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
625 ERR("IEnumMediaTypes_Next (%lx)\n", hr
);
630 ERR("No media type found!\n");
633 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
634 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
636 /* Try to find a suitable filter that can connect to the pin to render */
637 tab
[0] = mt
->majortype
;
638 tab
[1] = mt
->subtype
;
639 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
641 ERR("Unable to enum filters (%lx)\n", hr
);
645 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
651 IBaseFilter
* pfilter
= NULL
;
653 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
654 IMoniker_Release(pMoniker
);
656 ERR("Unable to retrieve filter info (%lx)\n", hr
);
660 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
662 ERR("Unable to create filter (%lx), trying next one\n", hr
);
666 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, NULL
);
668 ERR("Unable to add filter (%lx)\n", hr
);
669 IBaseFilter_Release(pfilter
);
674 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
676 ERR("Enumpins (%lx)\n", hr
);
679 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
681 ERR("Next (%lx)\n", hr
);
688 IEnumPins_Release(penumpins
);
690 hr
= IPin_Connect(ppinOut
, ppinfilter
, NULL
);
692 TRACE("Cannot connect to filter (%lx), trying next one\n", hr
);
695 TRACE("Successfully connected to filter, follow chain...\n");
697 /* Render all output pins of the filter by calling IGraphBuilder_Render on each of them */
698 hr
= GetInternalConnections(pfilter
, ppinfilter
, &ppins
, &nb
);
702 TRACE("pins to consider: %ld\n", nb
);
703 for(i
= 0; i
< nb
; i
++) {
704 TRACE("Processing pin %d\n", i
);
705 hr
= IGraphBuilder_Connect(iface
, ppins
[0], ppinIn
);
707 TRACE("Cannot render pin %p (%lx)\n", ppinfilter
, hr
);
711 CoTaskMemFree(ppins
);
717 IGraphBuilder_RemoveFilter(iface
, pfilter
);
718 IBaseFilter_Release(pfilter
);
722 IEnumMediaTypes_Release(penummt
);
728 static HRESULT WINAPI
Graphbuilder_Render(IGraphBuilder
*iface
,
730 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
731 IEnumMediaTypes
* penummt
;
736 IEnumMoniker
* pEnumMoniker
;
741 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppinOut
);
743 hr
= IPin_EnumMediaTypes(ppinOut
, &penummt
);
745 ERR("EnumMediaTypes (%lx)\n", hr
);
751 hr
= IEnumMediaTypes_Next(penummt
, 1, &mt
, &nbmt
);
753 ERR("IEnumMediaTypes_Next (%lx)\n", hr
);
758 TRACE("MajorType %s\n", debugstr_guid(&mt
->majortype
));
759 TRACE("SubType %s\n", debugstr_guid(&mt
->subtype
));
761 /* Try to find a suitable renderer with the same media type */
762 tab
[0] = mt
->majortype
;
764 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, TRUE
, FALSE
, 0, NULL
, NULL
, NULL
);
766 ERR("Unable to enum filters (%lx)\n", hr
);
770 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
775 IBaseFilter
* pfilter
= NULL
;
776 IEnumPins
* penumpins
;
779 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
780 IMoniker_Release(pMoniker
);
782 ERR("Unable to retrieve filter info (%lx)\n", hr
);
786 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&pfilter
);
788 ERR("Unable to create filter (%lx), trying next one\n", hr
);
792 hr
= IGraphBuilder_AddFilter(iface
, pfilter
, NULL
);
794 ERR("Unable to add filter (%lx)\n", hr
);
795 IBaseFilter_Release(pfilter
);
800 hr
= IBaseFilter_EnumPins(pfilter
, &penumpins
);
802 ERR("Splitter Enumpins (%lx)\n", hr
);
805 hr
= IEnumPins_Next(penumpins
, 1, &ppinfilter
, &pin
);
807 ERR("Next (%lx)\n", hr
);
814 IEnumPins_Release(penumpins
);
816 /* Connect the pin to render to the renderer */
817 hr
= IGraphBuilder_Connect(iface
, ppinOut
, ppinfilter
);
819 TRACE("Unable to connect to renderer (%lx)\n", hr
);
826 IGraphBuilder_RemoveFilter(iface
, pfilter
);
827 IBaseFilter_Release(pfilter
);
835 IEnumMediaTypes_Release(penummt
);
840 static HRESULT WINAPI
Graphbuilder_RenderFile(IGraphBuilder
*iface
,
842 LPCWSTR lpcwstrPlayList
) {
843 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
844 static const WCHAR string
[] = {'R','e','a','d','e','r',0};
845 IBaseFilter
* preader
= NULL
;
846 IBaseFilter
* psplitter
;
849 IEnumPins
* penumpins
;
852 IEnumMoniker
* pEnumMoniker
;
857 IFileSourceFilter
* pfile
= NULL
;
861 TRACE("(%p/%p)->(%s, %s)\n", This
, iface
, debugstr_w(lpcwstrFile
), debugstr_w(lpcwstrPlayList
));
863 hr
= IGraphBuilder_AddSourceFilter(iface
, lpcwstrFile
, string
, &preader
);
865 /* Retrieve file media type */
867 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
869 hr
= IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
870 IFileSourceFilter_Release(pfile
);
874 tab
[0] = mt
.majortype
;
876 hr
= IFilterMapper2_EnumMatchingFilters(This
->pFilterMapper2
, &pEnumMoniker
, 0, FALSE
, 0, TRUE
, 1, tab
, NULL
, NULL
, FALSE
, FALSE
, 0, NULL
, NULL
, NULL
);
879 IGraphBuilder_RemoveFilter(iface
, preader
);
880 IBaseFilter_Release(preader
);
885 while(IEnumMoniker_Next(pEnumMoniker
, 1, &pMoniker
, &nb
) == S_OK
)
890 hr
= GetFilterInfo(pMoniker
, &clsid
, &var
);
891 IMoniker_Release(pMoniker
);
893 ERR("Unable to retrieve filter info (%lx)\n", hr
);
897 hr
= CoCreateInstance(&clsid
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&psplitter
);
899 ERR("Unable to create filter (%lx), trying next one\n", hr
);
903 hr
= IGraphBuilder_AddFilter(iface
, psplitter
, NULL
);
905 ERR("Unable add filter (%lx)\n", hr
);
909 /* Connect file source and splitter filters together */
910 /* Make the splitter analyze incoming data */
911 hr
= IBaseFilter_EnumPins(preader
, &penumpins
);
913 ERR("Enumpins (%lx)\n", hr
);
916 hr
= IEnumPins_Next(penumpins
, 1, &ppinreader
, &pin
);
918 ERR("Next (%lx)\n", hr
);
925 IEnumPins_Release(penumpins
);
927 hr
= IBaseFilter_EnumPins(psplitter
, &penumpins
);
929 ERR("Splitter Enumpins (%lx)\n", hr
);
932 hr
= IEnumPins_Next(penumpins
, 1, &ppinsplitter
, &pin
);
934 ERR("Next (%lx)\n", hr
);
941 IEnumPins_Release(penumpins
);
943 hr
= IPin_Connect(ppinreader
, ppinsplitter
, NULL
);
945 IBaseFilter_Release(ppinsplitter
);
947 TRACE("Cannot connect to filter (%lx), trying next one\n", hr
);
950 TRACE("Successfully connected to filter\n");
954 /* Render all output pin of the splitter by calling IGraphBuilder_Render on each of them */
956 hr
= GetInternalConnections(psplitter
, ppinsplitter
, &ppins
, &nb
);
960 TRACE("pins to consider: %ld\n", nb
);
961 for(i
= 0; i
< nb
; i
++) {
962 TRACE("Processing pin %d\n", i
);
963 hr
= IGraphBuilder_Render(iface
, ppins
[i
]);
965 ERR("Cannot render pin %p (%lx)\n", ppins
[i
], hr
);
966 /* FIXME: We should clean created things properly */
970 CoTaskMemFree(ppins
);
976 static HRESULT WINAPI
Graphbuilder_AddSourceFilter(IGraphBuilder
*iface
,
977 LPCWSTR lpcwstrFileName
,
978 LPCWSTR lpcwstrFilterName
,
979 IBaseFilter
**ppFilter
) {
980 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
982 IBaseFilter
* preader
;
983 IFileSourceFilter
* pfile
= NULL
;
987 TRACE("(%p/%p)->(%s, %s, %p)\n", This
, iface
, debugstr_w(lpcwstrFileName
), debugstr_w(lpcwstrFilterName
), ppFilter
);
989 /* Instantiate a file source filter */
990 hr
= CoCreateInstance(&CLSID_AsyncReader
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IBaseFilter
, (LPVOID
*)&preader
);
992 ERR("Unable to create file source filter (%lx)\n", hr
);
996 hr
= IGraphBuilder_AddFilter(iface
, preader
, lpcwstrFilterName
);
998 ERR("Unable add filter (%lx)\n", hr
);
999 IBaseFilter_Release(preader
);
1003 hr
= IBaseFilter_QueryInterface(preader
, &IID_IFileSourceFilter
, (LPVOID
*)&pfile
);
1005 ERR("Unable to get IFileSourceInterface (%lx)\n", hr
);
1009 /* Load the file in the file source filter */
1010 hr
= IFileSourceFilter_Load(pfile
, lpcwstrFileName
, NULL
);
1012 ERR("Load (%lx)\n", hr
);
1016 IFileSourceFilter_GetCurFile(pfile
, &filename
, &mt
);
1018 ERR("GetCurFile (%lx)\n", hr
);
1021 TRACE("File %s\n", debugstr_w(filename
));
1022 TRACE("MajorType %s\n", debugstr_guid(&mt
.majortype
));
1023 TRACE("SubType %s\n", debugstr_guid(&mt
.subtype
));
1026 *ppFilter
= preader
;
1032 IFileSourceFilter_Release(pfile
);
1033 IGraphBuilder_RemoveFilter(iface
, preader
);
1034 IBaseFilter_Release(preader
);
1039 static HRESULT WINAPI
Graphbuilder_SetLogFile(IGraphBuilder
*iface
,
1041 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1043 TRACE("(%p/%p)->(%08lx): stub !!!\n", This
, iface
, (DWORD
) hFile
);
1048 static HRESULT WINAPI
Graphbuilder_Abort(IGraphBuilder
*iface
) {
1049 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1051 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1056 static HRESULT WINAPI
Graphbuilder_ShouldOperationContinue(IGraphBuilder
*iface
) {
1057 ICOM_THIS_MULTI(IFilterGraphImpl
, IGraphBuilder_vtbl
, iface
);
1059 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1065 static IGraphBuilderVtbl IGraphBuilder_VTable
=
1067 Graphbuilder_QueryInterface
,
1068 Graphbuilder_AddRef
,
1069 Graphbuilder_Release
,
1070 Graphbuilder_AddFilter
,
1071 Graphbuilder_RemoveFilter
,
1072 Graphbuilder_EnumFilters
,
1073 Graphbuilder_FindFilterByName
,
1074 Graphbuilder_ConnectDirect
,
1075 Graphbuilder_Reconnect
,
1076 Graphbuilder_Disconnect
,
1077 Graphbuilder_SetDefaultSyncSource
,
1078 Graphbuilder_Connect
,
1079 Graphbuilder_Render
,
1080 Graphbuilder_RenderFile
,
1081 Graphbuilder_AddSourceFilter
,
1082 Graphbuilder_SetLogFile
,
1084 Graphbuilder_ShouldOperationContinue
1087 /*** IUnknown methods ***/
1088 static HRESULT WINAPI
Mediacontrol_QueryInterface(IMediaControl
*iface
,
1091 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1093 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1095 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1098 static ULONG WINAPI
Mediacontrol_AddRef(IMediaControl
*iface
) {
1099 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1101 TRACE("(%p/%p)->()\n", This
, iface
);
1103 return Filtergraph_AddRef(This
);
1106 static ULONG WINAPI
Mediacontrol_Release(IMediaControl
*iface
) {
1107 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1109 TRACE("(%p/%p)->()\n", This
, iface
);
1111 return Filtergraph_Release(This
);
1115 /*** IDispatch methods ***/
1116 static HRESULT WINAPI
Mediacontrol_GetTypeInfoCount(IMediaControl
*iface
,
1118 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1120 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1125 static HRESULT WINAPI
Mediacontrol_GetTypeInfo(IMediaControl
*iface
,
1128 ITypeInfo
**ppTInfo
) {
1129 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1131 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1136 static HRESULT WINAPI
Mediacontrol_GetIDsOfNames(IMediaControl
*iface
,
1142 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1144 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1149 static HRESULT WINAPI
Mediacontrol_Invoke(IMediaControl
*iface
,
1150 DISPID dispIdMember
,
1154 DISPPARAMS
*pDispParams
,
1156 EXCEPINFO
*pExepInfo
,
1158 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1160 TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p): stub !!!\n", This
, iface
, dispIdMember
, debugstr_guid(riid
), riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
1165 static HRESULT
ExploreGraph(IFilterGraphImpl
* pGraph
, IPin
* pOutputPin
, REFERENCE_TIME tStart
)
1174 TRACE("%p %p %lld\n", pGraph
, pOutputPin
, tStart
);
1176 hr
= IPin_ConnectedTo(pOutputPin
, &pInputPin
);
1179 hr
= IPin_QueryPinInfo(pInputPin
, &PinInfo
);
1182 hr
= GetInternalConnections(PinInfo
.pFilter
, pInputPin
, &ppPins
, &nb
);
1188 TRACE("Reached a renderer\n");
1189 /* Count renderers for end of stream notification */
1190 pGraph
->nRenderers
++;
1194 for(i
= 0; i
< nb
; i
++)
1196 /* Explore the graph downstream from this pin
1197 * FIXME: We should prevent exploring from a pin more than once. This can happens when
1198 * several input pins are connected to the same output (a MUX for instance). */
1199 ExploreGraph(pGraph
, ppPins
[i
], tStart
);
1202 CoTaskMemFree(ppPins
);
1204 TRACE("Run filter %p\n", PinInfo
.pFilter
);
1205 IBaseFilter_Run(PinInfo
.pFilter
, tStart
);
1211 /*** IMediaControl methods ***/
1212 static HRESULT WINAPI
Mediacontrol_Run(IMediaControl
*iface
) {
1213 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1215 IBaseFilter
* pfilter
;
1222 TRACE("(%p/%p)->()\n", This
, iface
);
1224 EnterCriticalSection(&This
->cs
);
1226 if (This
->state
== State_Running
)
1228 LeaveCriticalSection(&This
->cs
);
1232 /* Explorer the graph from source filters to renderers, determine renderers number and
1233 * run filters from renderers to source filters */
1234 This
->nRenderers
= 0;
1235 ResetEvent(This
->hEventCompletion
);
1237 for(i
= 0; i
< This
->nFilters
; i
++)
1240 pfilter
= This
->ppFiltersInGraph
[i
];
1241 hr
= IBaseFilter_EnumPins(pfilter
, &pEnum
);
1244 ERR("Enum pins failed %lx\n", hr
);
1247 /* Check if it is a source filter */
1248 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1250 IPin_QueryDirection(pPin
, &dir
);
1251 if (dir
== PINDIR_INPUT
)
1259 TRACE("Found a source filter\n");
1260 IEnumPins_Reset(pEnum
);
1261 while(IEnumPins_Next(pEnum
, 1, &pPin
, &dummy
) == S_OK
)
1263 /* Explore the graph downstream from this pin */
1264 ExploreGraph(This
, pPin
, 0);
1266 IBaseFilter_Run(pfilter
, 0);
1268 IEnumPins_Release(pEnum
);
1271 This
->state
= State_Running
;
1273 LeaveCriticalSection(&This
->cs
);
1278 static HRESULT WINAPI
Mediacontrol_Pause(IMediaControl
*iface
) {
1279 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1281 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1286 static HRESULT WINAPI
Mediacontrol_Stop(IMediaControl
*iface
) {
1287 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1289 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1294 static HRESULT WINAPI
Mediacontrol_GetState(IMediaControl
*iface
,
1296 OAFilterState
*pfs
) {
1297 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1299 TRACE("(%p/%p)->(%ld, %p): semi-stub !!!\n", This
, iface
, msTimeout
, pfs
);
1301 EnterCriticalSection(&This
->cs
);
1305 LeaveCriticalSection(&This
->cs
);
1310 static HRESULT WINAPI
Mediacontrol_RenderFile(IMediaControl
*iface
,
1312 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1314 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
);
1319 static HRESULT WINAPI
Mediacontrol_AddSourceFilter(IMediaControl
*iface
,
1321 IDispatch
**ppUnk
) {
1322 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1324 TRACE("(%p/%p)->(%s (%p), %p): stub !!!\n", This
, iface
, debugstr_w(strFilename
), strFilename
, ppUnk
);
1329 static HRESULT WINAPI
Mediacontrol_get_FilterCollection(IMediaControl
*iface
,
1330 IDispatch
**ppUnk
) {
1331 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1333 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1338 static HRESULT WINAPI
Mediacontrol_get_RegFilterCollection(IMediaControl
*iface
,
1339 IDispatch
**ppUnk
) {
1340 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1342 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, ppUnk
);
1347 static HRESULT WINAPI
Mediacontrol_StopWhenReady(IMediaControl
*iface
) {
1348 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaControl_vtbl
, iface
);
1350 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
1356 static IMediaControlVtbl IMediaControl_VTable
=
1358 Mediacontrol_QueryInterface
,
1359 Mediacontrol_AddRef
,
1360 Mediacontrol_Release
,
1361 Mediacontrol_GetTypeInfoCount
,
1362 Mediacontrol_GetTypeInfo
,
1363 Mediacontrol_GetIDsOfNames
,
1364 Mediacontrol_Invoke
,
1368 Mediacontrol_GetState
,
1369 Mediacontrol_RenderFile
,
1370 Mediacontrol_AddSourceFilter
,
1371 Mediacontrol_get_FilterCollection
,
1372 Mediacontrol_get_RegFilterCollection
,
1373 Mediacontrol_StopWhenReady
1377 /*** IUnknown methods ***/
1378 static HRESULT WINAPI
Mediaseeking_QueryInterface(IMediaSeeking
*iface
,
1381 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1383 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1385 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1388 static ULONG WINAPI
Mediaseeking_AddRef(IMediaSeeking
*iface
) {
1389 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1391 TRACE("(%p/%p)->()\n", This
, iface
);
1393 return Filtergraph_AddRef(This
);
1396 static ULONG WINAPI
Mediaseeking_Release(IMediaSeeking
*iface
) {
1397 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1399 TRACE("(%p/%p)->()\n", This
, iface
);
1401 return Filtergraph_Release(This
);
1404 /*** IMediaSeeking methods ***/
1405 static HRESULT WINAPI
Mediaseeking_GetCapabilities(IMediaSeeking
*iface
,
1406 DWORD
*pCapabilities
) {
1407 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1409 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1414 static HRESULT WINAPI
Mediaseeking_CheckCapabilities(IMediaSeeking
*iface
,
1415 DWORD
*pCapabilities
) {
1416 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1418 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCapabilities
);
1423 static HRESULT WINAPI
Mediaseeking_IsFormatSupported(IMediaSeeking
*iface
,
1424 const GUID
*pFormat
) {
1425 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1427 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1432 static HRESULT WINAPI
Mediaseeking_QueryPreferredFormat(IMediaSeeking
*iface
,
1434 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1436 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1441 static HRESULT WINAPI
Mediaseeking_GetTimeFormat(IMediaSeeking
*iface
,
1443 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1445 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1450 static HRESULT WINAPI
Mediaseeking_IsUsingTimeFormat(IMediaSeeking
*iface
,
1451 const GUID
*pFormat
) {
1452 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1454 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1459 static HRESULT WINAPI
Mediaseeking_SetTimeFormat(IMediaSeeking
*iface
,
1460 const GUID
*pFormat
) {
1461 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1463 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pFormat
);
1468 static HRESULT WINAPI
Mediaseeking_GetDuration(IMediaSeeking
*iface
,
1469 LONGLONG
*pDuration
) {
1470 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1472 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDuration
);
1477 static HRESULT WINAPI
Mediaseeking_GetStopPosition(IMediaSeeking
*iface
,
1479 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1481 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pStop
);
1486 static HRESULT WINAPI
Mediaseeking_GetCurrentPosition(IMediaSeeking
*iface
,
1487 LONGLONG
*pCurrent
) {
1488 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1490 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pCurrent
);
1495 static HRESULT WINAPI
Mediaseeking_ConvertTimeFormat(IMediaSeeking
*iface
,
1497 const GUID
*pTargetFormat
,
1499 const GUID
*pSourceFormat
) {
1500 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1502 TRACE("(%p/%p)->(%p, %p, %lld, %p): stub !!!\n", This
, iface
, pTarget
, pTargetFormat
, Source
, pSourceFormat
);
1507 static HRESULT WINAPI
Mediaseeking_SetPositions(IMediaSeeking
*iface
,
1509 DWORD dwCurrentFlags
,
1511 DWORD dwStopFlags
) {
1512 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1514 TRACE("(%p/%p)->(%p, %08lx, %p, %08lx): stub !!!\n", This
, iface
, pCurrent
, dwCurrentFlags
, pStop
, dwStopFlags
);
1519 static HRESULT WINAPI
Mediaseeking_GetPositions(IMediaSeeking
*iface
,
1522 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1524 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pCurrent
, pStop
);
1529 static HRESULT WINAPI
Mediaseeking_GetAvailable(IMediaSeeking
*iface
,
1530 LONGLONG
*pEarliest
,
1531 LONGLONG
*pLatest
) {
1532 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1534 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pEarliest
, pLatest
);
1539 static HRESULT WINAPI
Mediaseeking_SetRate(IMediaSeeking
*iface
,
1541 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1543 TRACE("(%p/%p)->(%f): stub !!!\n", This
, iface
, dRate
);
1548 static HRESULT WINAPI
Mediaseeking_GetRate(IMediaSeeking
*iface
,
1550 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1552 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pdRate
);
1557 static HRESULT WINAPI
Mediaseeking_GetPreroll(IMediaSeeking
*iface
,
1558 LONGLONG
*pllPreroll
) {
1559 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaSeeking_vtbl
, iface
);
1561 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pllPreroll
);
1567 static IMediaSeekingVtbl IMediaSeeking_VTable
=
1569 Mediaseeking_QueryInterface
,
1570 Mediaseeking_AddRef
,
1571 Mediaseeking_Release
,
1572 Mediaseeking_GetCapabilities
,
1573 Mediaseeking_CheckCapabilities
,
1574 Mediaseeking_IsFormatSupported
,
1575 Mediaseeking_QueryPreferredFormat
,
1576 Mediaseeking_GetTimeFormat
,
1577 Mediaseeking_IsUsingTimeFormat
,
1578 Mediaseeking_SetTimeFormat
,
1579 Mediaseeking_GetDuration
,
1580 Mediaseeking_GetStopPosition
,
1581 Mediaseeking_GetCurrentPosition
,
1582 Mediaseeking_ConvertTimeFormat
,
1583 Mediaseeking_SetPositions
,
1584 Mediaseeking_GetPositions
,
1585 Mediaseeking_GetAvailable
,
1586 Mediaseeking_SetRate
,
1587 Mediaseeking_GetRate
,
1588 Mediaseeking_GetPreroll
1591 /*** IUnknown methods ***/
1592 static HRESULT WINAPI
Basicaudio_QueryInterface(IBasicAudio
*iface
,
1595 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1597 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1599 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1602 static ULONG WINAPI
Basicaudio_AddRef(IBasicAudio
*iface
) {
1603 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1605 TRACE("(%p/%p)->()\n", This
, iface
);
1607 return Filtergraph_AddRef(This
);
1610 static ULONG WINAPI
Basicaudio_Release(IBasicAudio
*iface
) {
1611 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1613 TRACE("(%p/%p)->()\n", This
, iface
);
1615 return Filtergraph_Release(This
);
1618 /*** IDispatch methods ***/
1619 static HRESULT WINAPI
Basicaudio_GetTypeInfoCount(IBasicAudio
*iface
,
1621 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1623 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1628 static HRESULT WINAPI
Basicaudio_GetTypeInfo(IBasicAudio
*iface
,
1631 ITypeInfo
**ppTInfo
) {
1632 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1634 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1639 static HRESULT WINAPI
Basicaudio_GetIDsOfNames(IBasicAudio
*iface
,
1645 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1647 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1652 static HRESULT WINAPI
Basicaudio_Invoke(IBasicAudio
*iface
,
1653 DISPID dispIdMember
,
1657 DISPPARAMS
*pDispParams
,
1659 EXCEPINFO
*pExepInfo
,
1661 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1663 TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p): stub !!!\n", This
, iface
, dispIdMember
, debugstr_guid(riid
), riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
1668 /*** IBasicAudio methods ***/
1669 static HRESULT WINAPI
Basicaudio_put_Volume(IBasicAudio
*iface
,
1671 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1673 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, lVolume
);
1678 static HRESULT WINAPI
Basicaudio_get_Volume(IBasicAudio
*iface
,
1680 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1682 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, plVolume
);
1687 static HRESULT WINAPI
Basicaudio_put_Balance(IBasicAudio
*iface
,
1689 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1691 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, lBalance
);
1696 static HRESULT WINAPI
Basicaudio_get_Balance(IBasicAudio
*iface
,
1698 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicAudio_vtbl
, iface
);
1700 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, plBalance
);
1705 static IBasicAudioVtbl IBasicAudio_VTable
=
1707 Basicaudio_QueryInterface
,
1710 Basicaudio_GetTypeInfoCount
,
1711 Basicaudio_GetTypeInfo
,
1712 Basicaudio_GetIDsOfNames
,
1714 Basicaudio_put_Volume
,
1715 Basicaudio_get_Volume
,
1716 Basicaudio_put_Balance
,
1717 Basicaudio_get_Balance
1720 /*** IUnknown methods ***/
1721 static HRESULT WINAPI
Basicvideo_QueryInterface(IBasicVideo
*iface
,
1724 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1726 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1728 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
1731 static ULONG WINAPI
Basicvideo_AddRef(IBasicVideo
*iface
) {
1732 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1734 TRACE("(%p/%p)->()\n", This
, iface
);
1736 return Filtergraph_AddRef(This
);
1739 static ULONG WINAPI
Basicvideo_Release(IBasicVideo
*iface
) {
1740 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1742 TRACE("(%p/%p)->()\n", This
, iface
);
1744 return Filtergraph_Release(This
);
1747 /*** IDispatch methods ***/
1748 static HRESULT WINAPI
Basicvideo_GetTypeInfoCount(IBasicVideo
*iface
,
1750 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1752 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1757 static HRESULT WINAPI
Basicvideo_GetTypeInfo(IBasicVideo
*iface
,
1760 ITypeInfo
**ppTInfo
) {
1761 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1763 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1768 static HRESULT WINAPI
Basicvideo_GetIDsOfNames(IBasicVideo
*iface
,
1774 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1776 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1781 static HRESULT WINAPI
Basicvideo_Invoke(IBasicVideo
*iface
,
1782 DISPID dispIdMember
,
1786 DISPPARAMS
*pDispParams
,
1788 EXCEPINFO
*pExepInfo
,
1790 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1792 TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p): stub !!!\n", This
, iface
, dispIdMember
, debugstr_guid(riid
), riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
1797 /*** IBasicVideo methods ***/
1798 static HRESULT WINAPI
Basicvideo_get_AvgTimePerFrame(IBasicVideo
*iface
,
1799 REFTIME
*pAvgTimePerFrame
) {
1800 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1802 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pAvgTimePerFrame
);
1807 static HRESULT WINAPI
Basicvideo_get_BitRate(IBasicVideo
*iface
,
1809 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1811 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pBitRate
);
1816 static HRESULT WINAPI
Basicvideo_get_BitErrorRate(IBasicVideo
*iface
,
1817 long *pBitErrorRate
) {
1818 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1820 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pBitErrorRate
);
1825 static HRESULT WINAPI
Basicvideo_get_VideoWidth(IBasicVideo
*iface
,
1826 long *pVideoWidth
) {
1827 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1829 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pVideoWidth
);
1834 static HRESULT WINAPI
Basicvideo_get_VideoHeight(IBasicVideo
*iface
,
1835 long *pVideoHeight
) {
1836 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1838 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pVideoHeight
);
1843 static HRESULT WINAPI
Basicvideo_put_SourceLeft(IBasicVideo
*iface
,
1845 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1847 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, SourceLeft
);
1852 static HRESULT WINAPI
Basicvideo_get_SourceLeft(IBasicVideo
*iface
,
1853 long *pSourceLeft
) {
1854 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1856 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pSourceLeft
);
1861 static HRESULT WINAPI
Basicvideo_put_SourceWidth(IBasicVideo
*iface
,
1863 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1865 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, SourceWidth
);
1870 static HRESULT WINAPI
Basicvideo_get_SourceWidth(IBasicVideo
*iface
,
1871 long *pSourceWidth
) {
1872 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1874 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pSourceWidth
);
1879 static HRESULT WINAPI
Basicvideo_put_SourceTop(IBasicVideo
*iface
,
1881 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1883 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, SourceTop
);
1888 static HRESULT WINAPI
Basicvideo_get_SourceTop(IBasicVideo
*iface
,
1890 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1892 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pSourceTop
);
1897 static HRESULT WINAPI
Basicvideo_put_SourceHeight(IBasicVideo
*iface
,
1898 long SourceHeight
) {
1899 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1901 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, SourceHeight
);
1906 static HRESULT WINAPI
Basicvideo_get_SourceHeight(IBasicVideo
*iface
,
1907 long *pSourceHeight
) {
1908 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1910 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pSourceHeight
);
1915 static HRESULT WINAPI
Basicvideo_put_DestinationLeft(IBasicVideo
*iface
,
1916 long DestinationLeft
) {
1917 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1919 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, DestinationLeft
);
1924 static HRESULT WINAPI
Basicvideo_get_DestinationLeft(IBasicVideo
*iface
,
1925 long *pDestinationLeft
) {
1926 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1928 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDestinationLeft
);
1933 static HRESULT WINAPI
Basicvideo_put_DestinationWidth(IBasicVideo
*iface
,
1934 long DestinationWidth
) {
1935 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1937 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, DestinationWidth
);
1942 static HRESULT WINAPI
Basicvideo_get_DestinationWidth(IBasicVideo
*iface
,
1943 long *pDestinationWidth
) {
1944 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1946 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDestinationWidth
);
1951 static HRESULT WINAPI
Basicvideo_put_DestinationTop(IBasicVideo
*iface
,
1952 long DestinationTop
) {
1953 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1955 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, DestinationTop
);
1960 static HRESULT WINAPI
Basicvideo_get_DestinationTop(IBasicVideo
*iface
,
1961 long *pDestinationTop
) {
1962 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1964 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDestinationTop
);
1969 static HRESULT WINAPI
Basicvideo_put_DestinationHeight(IBasicVideo
*iface
,
1970 long DestinationHeight
) {
1971 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1973 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, DestinationHeight
);
1978 static HRESULT WINAPI
Basicvideo_get_DestinationHeight(IBasicVideo
*iface
,
1979 long *pDestinationHeight
) {
1980 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1982 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pDestinationHeight
);
1987 static HRESULT WINAPI
Basicvideo_SetSourcePosition(IBasicVideo
*iface
,
1992 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
1994 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This
, iface
, Left
, Top
, Width
, Height
);
1999 static HRESULT WINAPI
Basicvideo_GetSourcePosition(IBasicVideo
*iface
,
2004 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2006 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2011 static HRESULT WINAPI
Basicvideo_SetDefaultSourcePosition(IBasicVideo
*iface
) {
2012 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2014 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
2019 static HRESULT WINAPI
Basicvideo_SetDestinationPosition(IBasicVideo
*iface
,
2024 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2026 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This
, iface
, Left
, Top
, Width
, Height
);
2031 static HRESULT WINAPI
Basicvideo_GetDestinationPosition(IBasicVideo
*iface
,
2036 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2038 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2043 static HRESULT WINAPI
Basicvideo_SetDefaultDestinationPosition(IBasicVideo
*iface
) {
2044 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2046 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
2051 static HRESULT WINAPI
Basicvideo_GetVideoSize(IBasicVideo
*iface
,
2054 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2056 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pWidth
, pHeight
);
2061 static HRESULT WINAPI
Basicvideo_GetVideoPaletteEntries(IBasicVideo
*iface
,
2066 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2068 TRACE("(%p/%p)->(%ld, %ld, %p, %p): stub !!!\n", This
, iface
, StartIndex
, Entries
, pRetrieved
, pPalette
);
2073 static HRESULT WINAPI
Basicvideo_GetCurrentImage(IBasicVideo
*iface
,
2076 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2078 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pBufferSize
, pDIBImage
);
2083 static HRESULT WINAPI
Basicvideo_IsUsingDefaultSource(IBasicVideo
*iface
) {
2084 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2086 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
2091 static HRESULT WINAPI
Basicvideo_IsUsingDefaultDestination(IBasicVideo
*iface
) {
2092 ICOM_THIS_MULTI(IFilterGraphImpl
, IBasicVideo_vtbl
, iface
);
2094 TRACE("(%p/%p)->(): stub !!!\n", This
, iface
);
2100 static IBasicVideoVtbl IBasicVideo_VTable
=
2102 Basicvideo_QueryInterface
,
2105 Basicvideo_GetTypeInfoCount
,
2106 Basicvideo_GetTypeInfo
,
2107 Basicvideo_GetIDsOfNames
,
2109 Basicvideo_get_AvgTimePerFrame
,
2110 Basicvideo_get_BitRate
,
2111 Basicvideo_get_BitErrorRate
,
2112 Basicvideo_get_VideoWidth
,
2113 Basicvideo_get_VideoHeight
,
2114 Basicvideo_put_SourceLeft
,
2115 Basicvideo_get_SourceLeft
,
2116 Basicvideo_put_SourceWidth
,
2117 Basicvideo_get_SourceWidth
,
2118 Basicvideo_put_SourceTop
,
2119 Basicvideo_get_SourceTop
,
2120 Basicvideo_put_SourceHeight
,
2121 Basicvideo_get_SourceHeight
,
2122 Basicvideo_put_DestinationLeft
,
2123 Basicvideo_get_DestinationLeft
,
2124 Basicvideo_put_DestinationWidth
,
2125 Basicvideo_get_DestinationWidth
,
2126 Basicvideo_put_DestinationTop
,
2127 Basicvideo_get_DestinationTop
,
2128 Basicvideo_put_DestinationHeight
,
2129 Basicvideo_get_DestinationHeight
,
2130 Basicvideo_SetSourcePosition
,
2131 Basicvideo_GetSourcePosition
,
2132 Basicvideo_SetDefaultSourcePosition
,
2133 Basicvideo_SetDestinationPosition
,
2134 Basicvideo_GetDestinationPosition
,
2135 Basicvideo_SetDefaultDestinationPosition
,
2136 Basicvideo_GetVideoSize
,
2137 Basicvideo_GetVideoPaletteEntries
,
2138 Basicvideo_GetCurrentImage
,
2139 Basicvideo_IsUsingDefaultSource
,
2140 Basicvideo_IsUsingDefaultDestination
2144 /*** IUnknown methods ***/
2145 static HRESULT WINAPI
Videowindow_QueryInterface(IVideoWindow
*iface
,
2148 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2150 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2152 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2155 static ULONG WINAPI
Videowindow_AddRef(IVideoWindow
*iface
) {
2156 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2158 TRACE("(%p/%p)->()\n", This
, iface
);
2160 return Filtergraph_AddRef(This
);
2163 static ULONG WINAPI
Videowindow_Release(IVideoWindow
*iface
) {
2164 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2166 TRACE("(%p/%p)->()\n", This
, iface
);
2168 return Filtergraph_Release(This
);
2171 /*** IDispatch methods ***/
2172 static HRESULT WINAPI
Videowindow_GetTypeInfoCount(IVideoWindow
*iface
,
2174 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2176 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
2181 static HRESULT WINAPI
Videowindow_GetTypeInfo(IVideoWindow
*iface
,
2184 ITypeInfo
**ppTInfo
) {
2185 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2187 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2192 static HRESULT WINAPI
Videowindow_GetIDsOfNames(IVideoWindow
*iface
,
2198 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2200 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2205 static HRESULT WINAPI
Videowindow_Invoke(IVideoWindow
*iface
,
2206 DISPID dispIdMember
,
2210 DISPPARAMS
*pDispParams
,
2212 EXCEPINFO
*pExepInfo
,
2214 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2216 TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p): stub !!!\n", This
, iface
, dispIdMember
, debugstr_guid(riid
), riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2221 /*** IVideoWindow methods ***/
2222 static HRESULT WINAPI
Videowindow_put_Caption(IVideoWindow
*iface
,
2224 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2226 TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This
, iface
, debugstr_w(strCaption
), strCaption
);
2231 static HRESULT WINAPI
Videowindow_get_Caption(IVideoWindow
*iface
,
2233 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2235 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, strCaption
);
2240 static HRESULT WINAPI
Videowindow_put_WindowStyle(IVideoWindow
*iface
,
2242 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2244 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, WindowStyle
);
2249 static HRESULT WINAPI
Videowindow_get_WindowStyle(IVideoWindow
*iface
,
2250 long *WindowStyle
) {
2251 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2253 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, WindowStyle
);
2258 static HRESULT WINAPI
Videowindow_put_WindowStyleEx(IVideoWindow
*iface
,
2259 long WindowStyleEx
) {
2260 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2262 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, WindowStyleEx
);
2267 static HRESULT WINAPI
Videowindow_get_WindowStyleEx(IVideoWindow
*iface
,
2268 long *WindowStyleEx
) {
2269 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2271 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, WindowStyleEx
);
2276 static HRESULT WINAPI
Videowindow_put_AutoShow(IVideoWindow
*iface
,
2278 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2280 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, AutoShow
);
2285 static HRESULT WINAPI
Videowindow_get_AutoShow(IVideoWindow
*iface
,
2287 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2289 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, AutoShow
);
2294 static HRESULT WINAPI
Videowindow_put_WindowState(IVideoWindow
*iface
,
2296 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2298 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, WindowState
);
2303 static HRESULT WINAPI
Videowindow_get_WindowState(IVideoWindow
*iface
,
2304 long *WindowState
) {
2305 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2307 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, WindowState
);
2312 static HRESULT WINAPI
Videowindow_put_BackgroundPalette(IVideoWindow
*iface
,
2313 long BackgroundPalette
) {
2314 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2316 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, BackgroundPalette
);
2321 static HRESULT WINAPI
Videowindow_get_BackgroundPalette(IVideoWindow
*iface
,
2322 long *pBackgroundPalette
) {
2323 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2325 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pBackgroundPalette
);
2330 static HRESULT WINAPI
Videowindow_put_Visible(IVideoWindow
*iface
,
2332 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2334 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Visible
);
2339 static HRESULT WINAPI
Videowindow_get_Visible(IVideoWindow
*iface
,
2341 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2343 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pVisible
);
2348 static HRESULT WINAPI
Videowindow_put_Left(IVideoWindow
*iface
,
2350 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2352 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Left
);
2357 static HRESULT WINAPI
Videowindow_get_Left(IVideoWindow
*iface
,
2359 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2361 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pLeft
);
2366 static HRESULT WINAPI
Videowindow_put_Width(IVideoWindow
*iface
,
2368 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2370 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Width
);
2375 static HRESULT WINAPI
Videowindow_get_Width(IVideoWindow
*iface
,
2377 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2379 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pWidth
);
2384 static HRESULT WINAPI
Videowindow_put_Top(IVideoWindow
*iface
,
2386 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2388 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Top
);
2393 static HRESULT WINAPI
Videowindow_get_Top(IVideoWindow
*iface
,
2395 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2397 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pTop
);
2402 static HRESULT WINAPI
Videowindow_put_Height(IVideoWindow
*iface
,
2404 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2406 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Height
);
2411 static HRESULT WINAPI
Videowindow_get_Height(IVideoWindow
*iface
,
2413 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2415 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pHeight
);
2420 static HRESULT WINAPI
Videowindow_put_Owner(IVideoWindow
*iface
,
2422 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2424 TRACE("(%p/%p)->(%08lx): stub !!!\n", This
, iface
, (DWORD
) Owner
);
2429 static HRESULT WINAPI
Videowindow_get_Owner(IVideoWindow
*iface
,
2431 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2433 TRACE("(%p/%p)->(%08lx): stub !!!\n", This
, iface
, (DWORD
) Owner
);
2438 static HRESULT WINAPI
Videowindow_put_MessageDrain(IVideoWindow
*iface
,
2440 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2442 TRACE("(%p/%p)->(%08lx): stub !!!\n", This
, iface
, (DWORD
) Drain
);
2447 static HRESULT WINAPI
Videowindow_get_MessageDrain(IVideoWindow
*iface
,
2449 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2451 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, Drain
);
2456 static HRESULT WINAPI
Videowindow_get_BorderColor(IVideoWindow
*iface
,
2458 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2460 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, Color
);
2465 static HRESULT WINAPI
Videowindow_put_BorderColor(IVideoWindow
*iface
,
2467 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2469 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Color
);
2474 static HRESULT WINAPI
Videowindow_get_FullScreenMode(IVideoWindow
*iface
,
2475 long *FullScreenMode
) {
2476 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2478 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, FullScreenMode
);
2483 static HRESULT WINAPI
Videowindow_put_FullScreenMode(IVideoWindow
*iface
,
2484 long FullScreenMode
) {
2485 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2487 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, FullScreenMode
);
2492 static HRESULT WINAPI
Videowindow_SetWindowForeground(IVideoWindow
*iface
,
2494 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2496 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Focus
);
2501 static HRESULT WINAPI
Videowindow_NotifyOwnerMessage(IVideoWindow
*iface
,
2506 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2508 TRACE("(%p/%p)->(%08lx, %ld, %08lx, %08lx): stub !!!\n", This
, iface
, (DWORD
) hwnd
, uMsg
, wParam
, lParam
);
2513 static HRESULT WINAPI
Videowindow_SetWindowPosition(IVideoWindow
*iface
,
2518 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2520 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This
, iface
, Left
, Top
, Width
, Height
);
2525 static HRESULT WINAPI
Videowindow_GetWindowPosition(IVideoWindow
*iface
,
2530 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2532 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2537 static HRESULT WINAPI
Videowindow_GetMinIdealImageSize(IVideoWindow
*iface
,
2540 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2542 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pWidth
, pHeight
);
2547 static HRESULT WINAPI
Videowindow_GetMaxIdealImageSize(IVideoWindow
*iface
,
2550 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2552 TRACE("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pWidth
, pHeight
);
2557 static HRESULT WINAPI
Videowindow_GetRestorePosition(IVideoWindow
*iface
,
2562 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2564 TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
2569 static HRESULT WINAPI
Videowindow_HideCursor(IVideoWindow
*iface
,
2571 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2573 TRACE("(%p/%p)->(%ld): stub !!!\n", This
, iface
, HideCursor
);
2578 static HRESULT WINAPI
Videowindow_IsCursorHidden(IVideoWindow
*iface
,
2579 long *CursorHidden
) {
2580 ICOM_THIS_MULTI(IFilterGraphImpl
, IVideoWindow_vtbl
, iface
);
2582 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, CursorHidden
);
2588 static IVideoWindowVtbl IVideoWindow_VTable
=
2590 Videowindow_QueryInterface
,
2592 Videowindow_Release
,
2593 Videowindow_GetTypeInfoCount
,
2594 Videowindow_GetTypeInfo
,
2595 Videowindow_GetIDsOfNames
,
2597 Videowindow_put_Caption
,
2598 Videowindow_get_Caption
,
2599 Videowindow_put_WindowStyle
,
2600 Videowindow_get_WindowStyle
,
2601 Videowindow_put_WindowStyleEx
,
2602 Videowindow_get_WindowStyleEx
,
2603 Videowindow_put_AutoShow
,
2604 Videowindow_get_AutoShow
,
2605 Videowindow_put_WindowState
,
2606 Videowindow_get_WindowState
,
2607 Videowindow_put_BackgroundPalette
,
2608 Videowindow_get_BackgroundPalette
,
2609 Videowindow_put_Visible
,
2610 Videowindow_get_Visible
,
2611 Videowindow_put_Left
,
2612 Videowindow_get_Left
,
2613 Videowindow_put_Width
,
2614 Videowindow_get_Width
,
2615 Videowindow_put_Top
,
2616 Videowindow_get_Top
,
2617 Videowindow_put_Height
,
2618 Videowindow_get_Height
,
2619 Videowindow_put_Owner
,
2620 Videowindow_get_Owner
,
2621 Videowindow_put_MessageDrain
,
2622 Videowindow_get_MessageDrain
,
2623 Videowindow_get_BorderColor
,
2624 Videowindow_put_BorderColor
,
2625 Videowindow_get_FullScreenMode
,
2626 Videowindow_put_FullScreenMode
,
2627 Videowindow_SetWindowForeground
,
2628 Videowindow_NotifyOwnerMessage
,
2629 Videowindow_SetWindowPosition
,
2630 Videowindow_GetWindowPosition
,
2631 Videowindow_GetMinIdealImageSize
,
2632 Videowindow_GetMaxIdealImageSize
,
2633 Videowindow_GetRestorePosition
,
2634 Videowindow_HideCursor
,
2635 Videowindow_IsCursorHidden
2639 /*** IUnknown methods ***/
2640 static HRESULT WINAPI
Mediaevent_QueryInterface(IMediaEventEx
*iface
,
2643 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2645 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
2647 return Filtergraph_QueryInterface(This
, riid
, ppvObj
);
2650 static ULONG WINAPI
Mediaevent_AddRef(IMediaEventEx
*iface
) {
2651 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2653 TRACE("(%p/%p)->()\n", This
, iface
);
2655 return Filtergraph_AddRef(This
);
2658 static ULONG WINAPI
Mediaevent_Release(IMediaEventEx
*iface
) {
2659 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2661 TRACE("(%p/%p)->()\n", This
, iface
);
2663 return Filtergraph_Release(This
);
2666 /*** IDispatch methods ***/
2667 static HRESULT WINAPI
Mediaevent_GetTypeInfoCount(IMediaEventEx
*iface
,
2669 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2671 TRACE("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
2676 static HRESULT WINAPI
Mediaevent_GetTypeInfo(IMediaEventEx
*iface
,
2679 ITypeInfo
**ppTInfo
) {
2680 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2682 TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
2687 static HRESULT WINAPI
Mediaevent_GetIDsOfNames(IMediaEventEx
*iface
,
2693 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2695 TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
2700 static HRESULT WINAPI
Mediaevent_Invoke(IMediaEventEx
*iface
,
2701 DISPID dispIdMember
,
2705 DISPPARAMS
*pDispParams
,
2707 EXCEPINFO
*pExepInfo
,
2709 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2711 TRACE("(%p/%p)->(%ld, %s (%p), %ld, %04x, %p, %p, %p, %p): stub !!!\n", This
, iface
, dispIdMember
, debugstr_guid(riid
), riid
, lcid
, wFlags
, pDispParams
, pVarResult
, pExepInfo
, puArgErr
);
2716 /*** IMediaEvent methods ***/
2717 static HRESULT WINAPI
Mediaevent_GetEventHandle(IMediaEventEx
*iface
,
2719 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2721 TRACE("(%p/%p)->(%p)\n", This
, iface
, hEvent
);
2723 *hEvent
= (OAEVENT
)This
->evqueue
.msg_event
;
2728 static HRESULT WINAPI
Mediaevent_GetEvent(IMediaEventEx
*iface
,
2733 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2736 TRACE("(%p/%p)->(%p, %p, %p, %ld)\n", This
, iface
, lEventCode
, lParam1
, lParam2
, msTimeout
);
2738 if (EventsQueue_GetEvent(&This
->evqueue
, &evt
, msTimeout
))
2740 *lEventCode
= evt
.lEventCode
;
2741 *lParam1
= evt
.lParam1
;
2742 *lParam2
= evt
.lParam2
;
2750 static HRESULT WINAPI
Mediaevent_WaitForCompletion(IMediaEventEx
*iface
,
2753 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2755 TRACE("(%p/%p)->(%ld, %p)\n", This
, iface
, msTimeout
, pEvCode
);
2757 if (WaitForSingleObject(This
->hEventCompletion
, msTimeout
) == WAIT_OBJECT_0
)
2759 *pEvCode
= This
->CompletionStatus
;
2767 static HRESULT WINAPI
Mediaevent_CancelDefaultHandling(IMediaEventEx
*iface
,
2769 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2771 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
2773 if (lEvCode
== EC_COMPLETE
)
2774 This
->HandleEcComplete
= FALSE
;
2775 else if (lEvCode
== EC_REPAINT
)
2776 This
->HandleEcRepaint
= FALSE
;
2783 static HRESULT WINAPI
Mediaevent_RestoreDefaultHandling(IMediaEventEx
*iface
,
2785 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2787 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lEvCode
);
2789 if (lEvCode
== EC_COMPLETE
)
2790 This
->HandleEcComplete
= TRUE
;
2791 else if (lEvCode
== EC_REPAINT
)
2792 This
->HandleEcRepaint
= TRUE
;
2799 static HRESULT WINAPI
Mediaevent_FreeEventParams(IMediaEventEx
*iface
,
2803 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2805 TRACE("(%p/%p)->(%ld, %08lx, %08lx): stub !!!\n", This
, iface
, lEvCode
, lParam1
, lParam2
);
2810 /*** IMediaEventEx methods ***/
2811 static HRESULT WINAPI
Mediaevent_SetNotifyWindow(IMediaEventEx
*iface
,
2814 LONG_PTR lInstanceData
) {
2815 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2817 TRACE("(%p/%p)->(%08lx, %ld, %08lx)\n", This
, iface
, (DWORD
) hwnd
, lMsg
, lInstanceData
);
2819 This
->notif
.hWnd
= (HWND
)hwnd
;
2820 This
->notif
.msg
= lMsg
;
2821 This
->notif
.instance
= (long) lInstanceData
;
2826 static HRESULT WINAPI
Mediaevent_SetNotifyFlags(IMediaEventEx
*iface
,
2827 long lNoNotifyFlags
) {
2828 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2830 TRACE("(%p/%p)->(%ld)\n", This
, iface
, lNoNotifyFlags
);
2832 if ((lNoNotifyFlags
!= 0) || (lNoNotifyFlags
!= 1))
2833 return E_INVALIDARG
;
2835 This
->notif
.disabled
= lNoNotifyFlags
;
2840 static HRESULT WINAPI
Mediaevent_GetNotifyFlags(IMediaEventEx
*iface
,
2841 long *lplNoNotifyFlags
) {
2842 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2844 TRACE("(%p/%p)->(%p)\n", This
, iface
, lplNoNotifyFlags
);
2846 if (!lplNoNotifyFlags
)
2849 *lplNoNotifyFlags
= This
->notif
.disabled
;
2855 static IMediaEventExVtbl IMediaEventEx_VTable
=
2857 Mediaevent_QueryInterface
,
2860 Mediaevent_GetTypeInfoCount
,
2861 Mediaevent_GetTypeInfo
,
2862 Mediaevent_GetIDsOfNames
,
2864 Mediaevent_GetEventHandle
,
2865 Mediaevent_GetEvent
,
2866 Mediaevent_WaitForCompletion
,
2867 Mediaevent_CancelDefaultHandling
,
2868 Mediaevent_RestoreDefaultHandling
,
2869 Mediaevent_FreeEventParams
,
2870 Mediaevent_SetNotifyWindow
,
2871 Mediaevent_SetNotifyFlags
,
2872 Mediaevent_GetNotifyFlags
2876 static HRESULT WINAPI
MediaFilter_QueryInterface(IMediaFilter
*iface
, REFIID riid
, LPVOID
*ppv
)
2878 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2880 return Filtergraph_QueryInterface(This
, riid
, ppv
);
2883 static ULONG WINAPI
MediaFilter_AddRef(IMediaFilter
*iface
)
2885 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2887 return Filtergraph_AddRef(This
);
2890 static ULONG WINAPI
MediaFilter_Release(IMediaFilter
*iface
)
2892 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventEx_vtbl
, iface
);
2894 return Filtergraph_Release(This
);
2897 static HRESULT WINAPI
MediaFilter_GetClassID(IMediaFilter
*iface
, CLSID
* pClassID
)
2899 FIXME("(%p): stub\n", pClassID
);
2904 static HRESULT WINAPI
MediaFilter_Stop(IMediaFilter
*iface
)
2906 FIXME("(): stub\n");
2911 static HRESULT WINAPI
MediaFilter_Pause(IMediaFilter
*iface
)
2913 FIXME("(): stub\n");
2918 static HRESULT WINAPI
MediaFilter_Run(IMediaFilter
*iface
, REFERENCE_TIME tStart
)
2920 FIXME("(%lld): stub\n", tStart
);
2925 static HRESULT WINAPI
MediaFilter_GetState(IMediaFilter
*iface
, DWORD dwMsTimeout
, FILTER_STATE
* pState
)
2927 FIXME("(%ld, %p): stub\n", dwMsTimeout
, pState
);
2932 static HRESULT WINAPI
MediaFilter_SetSyncSource(IMediaFilter
*iface
, IReferenceClock
*pClock
)
2934 FIXME("(%p): stub\n", pClock
);
2939 static HRESULT WINAPI
MediaFilter_GetSyncSource(IMediaFilter
*iface
, IReferenceClock
**ppClock
)
2941 FIXME("(%p): stub\n", ppClock
);
2946 static IMediaFilterVtbl IMediaFilter_VTable
=
2948 MediaFilter_QueryInterface
,
2950 MediaFilter_Release
,
2951 MediaFilter_GetClassID
,
2955 MediaFilter_GetState
,
2956 MediaFilter_SetSyncSource
,
2957 MediaFilter_GetSyncSource
2960 static HRESULT WINAPI
MediaEventSink_QueryInterface(IMediaEventSink
*iface
, REFIID riid
, LPVOID
*ppv
)
2962 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
2964 return Filtergraph_QueryInterface(This
, riid
, ppv
);
2967 static ULONG WINAPI
MediaEventSink_AddRef(IMediaEventSink
*iface
)
2969 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
2971 return Filtergraph_AddRef(This
);
2974 static ULONG WINAPI
MediaEventSink_Release(IMediaEventSink
*iface
)
2976 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
2978 return Filtergraph_Release(This
);
2981 static HRESULT WINAPI
MediaEventSink_Notify(IMediaEventSink
*iface
, long EventCode
, LONG_PTR EventParam1
, LONG_PTR EventParam2
)
2983 ICOM_THIS_MULTI(IFilterGraphImpl
, IMediaEventSink_vtbl
, iface
);
2986 TRACE("(%p/%p)->(%ld, %ld, %ld)\n", This
, iface
, EventCode
, EventParam1
, EventParam2
);
2988 /* We need thread safety here, let's use the events queue's one */
2989 EnterCriticalSection(&This
->evqueue
.msg_crst
);
2991 if ((EventCode
== EC_COMPLETE
) && This
->HandleEcComplete
)
2993 if (++This
->EcCompleteCount
== This
->nRenderers
)
2995 evt
.lEventCode
= EC_COMPLETE
;
2998 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
2999 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
3000 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
3001 This
->CompletionStatus
= EC_COMPLETE
;
3002 SetEvent(This
->hEventCompletion
);
3005 else if ((EventCode
== EC_REPAINT
) && This
->HandleEcRepaint
)
3007 /* FIXME: Not handled yet */
3011 evt
.lEventCode
= EventCode
;
3012 evt
.lParam1
= EventParam1
;
3013 evt
.lParam2
= EventParam2
;
3014 EventsQueue_PutEvent(&This
->evqueue
, &evt
);
3015 if (!This
->notif
.disabled
&& This
->notif
.hWnd
)
3016 PostMessageW(This
->notif
.hWnd
, This
->notif
.msg
, 0, This
->notif
.instance
);
3019 LeaveCriticalSection(&This
->evqueue
.msg_crst
);
3023 static IMediaEventSinkVtbl IMediaEventSink_VTable
=
3025 MediaEventSink_QueryInterface
,
3026 MediaEventSink_AddRef
,
3027 MediaEventSink_Release
,
3028 MediaEventSink_Notify
3031 /* This is the only function that actually creates a FilterGraph class... */
3032 HRESULT
FILTERGRAPH_create(IUnknown
*pUnkOuter
, LPVOID
*ppObj
) {
3033 IFilterGraphImpl
*fimpl
;
3036 TRACE("(%p,%p)\n", pUnkOuter
, ppObj
);
3039 return CLASS_E_NOAGGREGATION
;
3041 fimpl
= (IFilterGraphImpl
*) HeapAlloc(GetProcessHeap(), 0, sizeof(*fimpl
));
3042 fimpl
->IGraphBuilder_vtbl
= &IGraphBuilder_VTable
;
3043 fimpl
->IMediaControl_vtbl
= &IMediaControl_VTable
;
3044 fimpl
->IMediaSeeking_vtbl
= &IMediaSeeking_VTable
;
3045 fimpl
->IBasicAudio_vtbl
= &IBasicAudio_VTable
;
3046 fimpl
->IBasicVideo_vtbl
= &IBasicVideo_VTable
;
3047 fimpl
->IVideoWindow_vtbl
= &IVideoWindow_VTable
;
3048 fimpl
->IMediaEventEx_vtbl
= &IMediaEventEx_VTable
;
3049 fimpl
->IMediaFilter_vtbl
= &IMediaFilter_VTable
;
3050 fimpl
->IMediaEventSink_vtbl
= &IMediaEventSink_VTable
;
3052 fimpl
->ppFiltersInGraph
= NULL
;
3053 fimpl
->pFilterNames
= NULL
;
3054 fimpl
->nFilters
= 0;
3055 fimpl
->filterCapacity
= 0;
3056 fimpl
->nameIndex
= 1;
3057 fimpl
->hEventCompletion
= CreateEventW(0, TRUE
, FALSE
,0);
3058 fimpl
->HandleEcComplete
= TRUE
;
3059 fimpl
->HandleEcRepaint
= TRUE
;
3060 fimpl
->notif
.hWnd
= 0;
3061 fimpl
->notif
.disabled
= TRUE
;
3062 fimpl
->nRenderers
= 0;
3063 fimpl
->EcCompleteCount
= 0;
3064 fimpl
->state
= State_Stopped
;
3065 EventsQueue_Init(&fimpl
->evqueue
);
3066 InitializeCriticalSection(&fimpl
->cs
);
3068 hr
= CoCreateInstance(&CLSID_FilterMapper
, NULL
, CLSCTX_INPROC_SERVER
, &IID_IFilterMapper2
, (LPVOID
*)&fimpl
->pFilterMapper2
);
3070 ERR("Unable to create filter mapper (%lx)\n", hr
);