Use shell icon cache instead of an own IExtractIcon implementation.
[wine] / dlls / quartz / videorenderer.c
1 /*
2  * Video Renderer (Fullscreen and Windowed using Direct Draw)
3  *
4  * Copyright 2004 Christian Costa
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #include "config.h"
22
23 #define NONAMELESSSTRUCT
24 #define NONAMELESSUNION
25 #include "quartz_private.h"
26 #include "control_private.h"
27 #include "pin.h"
28
29 #include "uuids.h"
30 #include "mmreg.h"
31 #include "vfwmsgs.h"
32 #include "amvideo.h"
33 #include "fourcc.h"
34 #include "windef.h"
35 #include "winbase.h"
36 #include "dshow.h"
37 #include "evcode.h"
38 #include "strmif.h"
39 #include "ddraw.h"
40
41 #include "wine/unicode.h"
42 #include "wine/debug.h"
43
44 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
45
46 static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0};
47
48 static const IBaseFilterVtbl VideoRenderer_Vtbl;
49 static const IBasicVideoVtbl IBasicVideo_VTable;
50 static const IVideoWindowVtbl IVideoWindow_VTable;
51 static const IPinVtbl VideoRenderer_InputPin_Vtbl;
52
53 typedef struct VideoRendererImpl
54 {
55     const IBaseFilterVtbl * lpVtbl;
56     const IBasicVideoVtbl * IBasicVideo_vtbl;
57     const IVideoWindowVtbl * IVideoWindow_vtbl;
58
59     ULONG refCount;
60     CRITICAL_SECTION csFilter;
61     FILTER_STATE state;
62     REFERENCE_TIME rtStreamStart;
63     IReferenceClock * pClock;
64     FILTER_INFO filterInfo;
65
66     InputPin * pInputPin;
67     IPin ** ppPins;
68
69     LPDIRECTDRAW ddraw;
70     LPDIRECTDRAWSURFACE surface;
71     LPDIRECTDRAWSURFACE backbuffer;
72     int init;
73 } VideoRendererImpl;
74
75 static const IMemInputPinVtbl MemInputPin_Vtbl = 
76 {
77     MemInputPin_QueryInterface,
78     MemInputPin_AddRef,
79     MemInputPin_Release,
80     MemInputPin_GetAllocator,
81     MemInputPin_NotifyAllocator,
82     MemInputPin_GetAllocatorRequirements,
83     MemInputPin_Receive,
84     MemInputPin_ReceiveMultiple,
85     MemInputPin_ReceiveCanBlock
86 };
87
88 static HRESULT VideoRenderer_InputPin_Construct(const PIN_INFO * pPinInfo, SAMPLEPROC pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin)
89 {
90     InputPin * pPinImpl;
91
92     *ppPin = NULL;
93
94     if (pPinInfo->dir != PINDIR_INPUT)
95     {
96         ERR("Pin direction(%x) != PINDIR_INPUT\n", pPinInfo->dir);
97         return E_INVALIDARG;
98     }
99
100     pPinImpl = CoTaskMemAlloc(sizeof(*pPinImpl));
101
102     if (!pPinImpl)
103         return E_OUTOFMEMORY;
104
105     if (SUCCEEDED(InputPin_Init(pPinInfo, pSampleProc, pUserData, pQueryAccept, pCritSec, pPinImpl)))
106     {
107         pPinImpl->pin.lpVtbl = &VideoRenderer_InputPin_Vtbl;
108         pPinImpl->lpVtblMemInput = &MemInputPin_Vtbl;
109       
110         *ppPin = (IPin *)(&pPinImpl->pin.lpVtbl);
111         return S_OK;
112     }
113     return E_FAIL;
114 }
115
116 static HRESULT VideoRenderer_CreatePrimarySurface(IBaseFilter * iface)
117 {
118     HRESULT hr;
119     DDSURFACEDESC sdesc;
120     DDSCAPS ddscaps;
121     VideoRendererImpl *This = (VideoRendererImpl *)iface;
122         
123     hr = DirectDrawCreate(NULL, &This->ddraw, NULL);
124
125     if (FAILED(hr)) {
126         ERR("Cannot create Direct Draw object\n");
127         return hr;
128     }
129
130     hr = IDirectDraw_SetCooperativeLevel(This->ddraw, GetDesktopWindow(), DDSCL_NORMAL);
131     if (FAILED(hr)) {
132         ERR("Cannot set fulscreen mode\n");
133         return hr;
134     }
135     
136     sdesc.dwSize = sizeof(sdesc);
137     sdesc.dwFlags = DDSD_CAPS | DDSD_BACKBUFFERCOUNT;
138     sdesc.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE | DDSCAPS_COMPLEX | DDSCAPS_FLIP;
139     sdesc.dwBackBufferCount = 1;
140
141     hr = IDirectDraw_CreateSurface(This->ddraw, &sdesc, &This->surface, NULL);
142     if (FAILED(hr)) {
143         ERR("Cannot create surface\n");
144         return hr;
145     }
146
147     hr = IDirectDrawSurface_GetSurfaceDesc(This->surface, &sdesc);
148     if (FAILED(hr)) {
149         ERR("Cannot get surface information\n");
150         return hr;
151     }
152     TRACE("Width = %ld\n", sdesc.dwWidth);
153     TRACE("Height = %ld\n", sdesc.dwHeight);
154     TRACE("Pitch = %ld\n", sdesc.u1.lPitch);
155     TRACE("Depth = %ld\n", sdesc.ddpfPixelFormat.u1.dwRGBBitCount);
156     
157     ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
158     hr = IDirectDrawSurface_GetAttachedSurface(This->surface, &ddscaps, &This->backbuffer);
159     if (FAILED(hr)) {
160         ERR("Cannot get backbuffer\n");
161         return hr;
162     }
163
164     return S_OK;
165 }
166
167 static DWORD VideoRenderer_SendSampleData(VideoRendererImpl* This, LPBYTE data, DWORD size)
168 {
169     VIDEOINFOHEADER* format;
170     AM_MEDIA_TYPE amt;
171     HRESULT hr = S_OK;
172     int i = 0;
173     int j = 0;
174     LPBYTE ptr;
175     DDSURFACEDESC sdesc;
176     int width;
177     int height;
178     LPBYTE palette = NULL;
179
180     TRACE("%p %p %ld\n", This, data, size);
181
182     sdesc.dwSize = sizeof(sdesc);
183     hr = IPin_ConnectionMediaType(This->ppPins[0], &amt);
184     if (FAILED(hr)) {
185         ERR("Unable to retrieve media type\n");
186         return hr;
187     }
188     format = (VIDEOINFOHEADER*)amt.pbFormat;
189
190     TRACE("biSize = %ld\n", format->bmiHeader.biSize);
191     TRACE("biWidth = %ld\n", format->bmiHeader.biWidth);
192     TRACE("biHeigth = %ld\n", format->bmiHeader.biHeight);
193     TRACE("biPlanes = %d\n", format->bmiHeader.biPlanes);
194     TRACE("biBitCount = %d\n", format->bmiHeader.biBitCount);
195     TRACE("biCompression = %s\n", debugstr_an((LPSTR)&(format->bmiHeader.biCompression), 4));
196     TRACE("biSizeImage = %ld\n", format->bmiHeader.biSizeImage);
197
198     width = format->bmiHeader.biWidth;
199     height = format->bmiHeader.biHeight;
200     palette = ((LPBYTE)&format->bmiHeader) + format->bmiHeader.biSize;
201  
202     hr = IDirectDrawSurface_Lock(This->backbuffer, NULL, &sdesc, DDLOCK_WRITEONLY, NULL);
203     if (FAILED(hr)) {
204         ERR("Cannot lock backbuffer\n");
205         return hr;
206     }
207
208     ptr = sdesc.lpSurface;
209
210     /* FIXME: We may use Direct Draw services to do the conversion for us */
211     if ((sdesc.ddpfPixelFormat.u1.dwRGBBitCount == 24) || (sdesc.ddpfPixelFormat.u1.dwRGBBitCount == 32))
212     {
213         if (format->bmiHeader.biBitCount == 8)
214         {
215             int psz = sdesc.ddpfPixelFormat.u1.dwRGBBitCount == 32 ? 4 : 3;
216             for (j = 0; j < height; j++)
217                 for (i = 0; i < width; i++)
218                 {
219                     *(ptr + i*psz + 0 + j * sdesc.u1.lPitch) = palette[*(data + i + 0 + (height-1-j) * width)*4 + 0];
220                     *(ptr + i*psz + 1 + j * sdesc.u1.lPitch) = palette[*(data + i + 0 + (height-1-j) * width)*4 + 1];
221                     *(ptr + i*psz + 2 + j * sdesc.u1.lPitch) = palette[*(data + i + 0 + (height-1-j) * width)*4 + 2];
222                     if (psz == 4)
223                         *(ptr + i*psz + 3 + j * sdesc.u1.lPitch) = 0xFF;
224                 }
225         }
226         else if ((format->bmiHeader.biBitCount == 24) || (format->bmiHeader.biBitCount == 32))
227         {
228             int dpsz = sdesc.ddpfPixelFormat.u1.dwRGBBitCount == 32 ? 4 : 3;
229             int spsz = format->bmiHeader.biBitCount == 32 ? 4 : 3;
230             for (j = 0; j < height; j++)
231                 for (i = 0; i < width; i++)
232                 {
233                     *(ptr + i*dpsz + 0 + j * sdesc.u1.lPitch) = *(data + (i + 0 + (height-1-j) * width)*spsz + 0);
234                     *(ptr + i*dpsz + 1 + j * sdesc.u1.lPitch) = *(data + (i + 0 + (height-1-j) * width)*spsz + 1);
235                     *(ptr + i*dpsz + 2 + j * sdesc.u1.lPitch) = *(data + (i + 0 + (height-1-j) * width)*spsz + 2);
236                     if (dpsz == 4)
237                         *(ptr + i*dpsz + 3 + j * sdesc.u1.lPitch) = 0xFF;
238                 }
239         }
240         else
241             FIXME("Source size with a depths other than 8 (paletted), 24 or 32 bits are not yet supported\n");
242     }
243     else
244         FIXME("Destination depths with a depth other than 24 or 32 bits are not yet supported\n");     
245
246     hr = IDirectDrawSurface_Unlock(This->backbuffer, NULL);
247     if (FAILED(hr)) {
248         ERR("Cannot unlock backbuffer\n");
249         return hr;
250     }
251
252     hr = IDirectDrawSurface_Flip(This->surface, NULL, DDFLIP_WAIT);
253     if (FAILED(hr)) {
254         ERR("Cannot unlock backbuffer\n");
255         return hr;
256     }
257     
258     return S_OK;
259 }
260
261 static HRESULT VideoRenderer_Sample(LPVOID iface, IMediaSample * pSample)
262 {
263     VideoRendererImpl *This = (VideoRendererImpl *)iface;
264     LPBYTE pbSrcStream = NULL;
265     long cbSrcStream = 0;
266     REFERENCE_TIME tStart, tStop;
267     HRESULT hr;
268
269     TRACE("%p %p\n", iface, pSample);
270     
271     hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
272     if (FAILED(hr))
273     {
274         ERR("Cannot get pointer to sample data (%lx)\n", hr);
275         return hr;
276     }
277
278     hr = IMediaSample_GetTime(pSample, &tStart, &tStop);
279     if (FAILED(hr))
280         ERR("Cannot get sample time (%lx)\n", hr);
281
282     cbSrcStream = IMediaSample_GetActualDataLength(pSample);
283
284     TRACE("val %p %ld\n", pbSrcStream, cbSrcStream);
285
286 #if 0 /* For debugging purpose */
287     {
288         int i;
289         for(i = 0; i < cbSrcStream; i++)
290         {
291             if ((i!=0) && !(i%16))
292                 DPRINTF("\n");
293             DPRINTF("%02x ", pbSrcStream[i]);
294         }
295         DPRINTF("\n");
296     }
297 #endif
298     
299     if (!This->init)
300     {
301         hr = VideoRenderer_CreatePrimarySurface(iface);
302         if (FAILED(hr))
303         {
304             ERR("Unable to create primary surface\n");
305             return hr;
306         }
307         This->init = 1;
308     }
309
310     VideoRenderer_SendSampleData(This, pbSrcStream, cbSrcStream);
311
312     return S_OK;
313 }
314
315 static HRESULT VideoRenderer_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt)
316 {
317     if ((IsEqualIID(&pmt->majortype, &MEDIATYPE_Video) && IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB32)) ||
318         (IsEqualIID(&pmt->majortype, &MEDIATYPE_Video) && IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB24)) ||
319         (IsEqualIID(&pmt->majortype, &MEDIATYPE_Video) && IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB565)) ||
320         (IsEqualIID(&pmt->majortype, &MEDIATYPE_Video) && IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB8)))
321         return S_OK;
322     return S_FALSE;
323 }
324
325 HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv)
326 {
327     HRESULT hr;
328     PIN_INFO piInput;
329     VideoRendererImpl * pVideoRenderer;
330
331     TRACE("(%p, %p)\n", pUnkOuter, ppv);
332
333     *ppv = NULL;
334
335     if (pUnkOuter)
336         return CLASS_E_NOAGGREGATION;
337     
338     pVideoRenderer = CoTaskMemAlloc(sizeof(VideoRendererImpl));
339
340     pVideoRenderer->lpVtbl = &VideoRenderer_Vtbl;
341     pVideoRenderer->IBasicVideo_vtbl = &IBasicVideo_VTable;
342     pVideoRenderer->IVideoWindow_vtbl = &IVideoWindow_VTable;
343     
344     pVideoRenderer->refCount = 1;
345     InitializeCriticalSection(&pVideoRenderer->csFilter);
346     pVideoRenderer->state = State_Stopped;
347     pVideoRenderer->pClock = NULL;
348     pVideoRenderer->init = 0;
349     ZeroMemory(&pVideoRenderer->filterInfo, sizeof(FILTER_INFO));
350
351     pVideoRenderer->ppPins = CoTaskMemAlloc(1 * sizeof(IPin *));
352
353     /* construct input pin */
354     piInput.dir = PINDIR_INPUT;
355     piInput.pFilter = (IBaseFilter *)pVideoRenderer;
356     lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0]));
357
358     hr = VideoRenderer_InputPin_Construct(&piInput, VideoRenderer_Sample, (LPVOID)pVideoRenderer, VideoRenderer_QueryAccept, &pVideoRenderer->csFilter, (IPin **)&pVideoRenderer->pInputPin);
359
360     if (SUCCEEDED(hr))
361     {
362         pVideoRenderer->ppPins[0] = (IPin *)pVideoRenderer->pInputPin;
363         *ppv = (LPVOID)pVideoRenderer;
364     }
365     else
366     {
367         CoTaskMemFree(pVideoRenderer->ppPins);
368         DeleteCriticalSection(&pVideoRenderer->csFilter);
369         CoTaskMemFree(pVideoRenderer);
370     }
371
372     return hr;
373 }
374
375 static HRESULT WINAPI VideoRenderer_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv)
376 {
377     VideoRendererImpl *This = (VideoRendererImpl *)iface;
378     TRACE("(%p/%p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv);
379
380     *ppv = NULL;
381
382     if (IsEqualIID(riid, &IID_IUnknown))
383         *ppv = (LPVOID)This;
384     else if (IsEqualIID(riid, &IID_IPersist))
385         *ppv = (LPVOID)This;
386     else if (IsEqualIID(riid, &IID_IMediaFilter))
387         *ppv = (LPVOID)This;
388     else if (IsEqualIID(riid, &IID_IBaseFilter))
389         *ppv = (LPVOID)This;
390     else if (IsEqualIID(riid, &IID_IBasicVideo))
391         *ppv = (LPVOID)&(This->IBasicVideo_vtbl);
392     else if (IsEqualIID(riid, &IID_IVideoWindow))
393         *ppv = (LPVOID)&(This->IVideoWindow_vtbl);
394
395     if (*ppv)
396     {
397         IUnknown_AddRef((IUnknown *)(*ppv));
398         return S_OK;
399     }
400
401     FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
402
403     return E_NOINTERFACE;
404 }
405
406 static ULONG WINAPI VideoRenderer_AddRef(IBaseFilter * iface)
407 {
408     VideoRendererImpl *This = (VideoRendererImpl *)iface;
409     ULONG refCount = InterlockedIncrement(&This->refCount);
410
411     TRACE("(%p/%p)->() AddRef from %ld\n", This, iface, refCount - 1);
412
413     return refCount;
414 }
415
416 static ULONG WINAPI VideoRenderer_Release(IBaseFilter * iface)
417 {
418     VideoRendererImpl *This = (VideoRendererImpl *)iface;
419     ULONG refCount = InterlockedDecrement(&This->refCount);
420
421     TRACE("(%p/%p)->() Release from %ld\n", This, iface, refCount + 1);
422
423     if (!refCount)
424     {
425         DeleteCriticalSection(&This->csFilter);
426
427         if (This->pClock)
428             IReferenceClock_Release(This->pClock);
429         
430         IPin_Release(This->ppPins[0]);
431         
432         HeapFree(GetProcessHeap(), 0, This->ppPins);
433         This->lpVtbl = NULL;
434         
435         TRACE("Destroying Video Renderer\n");
436         CoTaskMemFree(This);
437         
438         return 0;
439     }
440     else
441         return refCount;
442 }
443
444 /** IPersist methods **/
445
446 static HRESULT WINAPI VideoRenderer_GetClassID(IBaseFilter * iface, CLSID * pClsid)
447 {
448     VideoRendererImpl *This = (VideoRendererImpl *)iface;
449
450     TRACE("(%p/%p)->(%p)\n", This, iface, pClsid);
451
452     *pClsid = CLSID_VideoRenderer;
453
454     return S_OK;
455 }
456
457 /** IMediaFilter methods **/
458
459 static HRESULT WINAPI VideoRenderer_Stop(IBaseFilter * iface)
460 {
461     VideoRendererImpl *This = (VideoRendererImpl *)iface;
462
463     TRACE("(%p/%p)->()\n", This, iface);
464
465     EnterCriticalSection(&This->csFilter);
466     {
467         This->state = State_Stopped;
468     }
469     LeaveCriticalSection(&This->csFilter);
470     
471     return S_OK;
472 }
473
474 static HRESULT WINAPI VideoRenderer_Pause(IBaseFilter * iface)
475 {
476     VideoRendererImpl *This = (VideoRendererImpl *)iface;
477     
478     TRACE("(%p/%p)->()\n", This, iface);
479
480     EnterCriticalSection(&This->csFilter);
481     {
482         This->state = State_Paused;
483     }
484     LeaveCriticalSection(&This->csFilter);
485
486     return S_OK;
487 }
488
489 static HRESULT WINAPI VideoRenderer_Run(IBaseFilter * iface, REFERENCE_TIME tStart)
490 {
491     VideoRendererImpl *This = (VideoRendererImpl *)iface;
492
493     TRACE("(%p/%p)->(%s)\n", This, iface, wine_dbgstr_longlong(tStart));
494
495     EnterCriticalSection(&This->csFilter);
496     {
497         This->rtStreamStart = tStart;
498         This->state = State_Running;
499     }
500     LeaveCriticalSection(&This->csFilter);
501
502     return S_OK;
503 }
504
505 static HRESULT WINAPI VideoRenderer_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
506 {
507     VideoRendererImpl *This = (VideoRendererImpl *)iface;
508
509     TRACE("(%p/%p)->(%ld, %p)\n", This, iface, dwMilliSecsTimeout, pState);
510
511     EnterCriticalSection(&This->csFilter);
512     {
513         *pState = This->state;
514     }
515     LeaveCriticalSection(&This->csFilter);
516
517     return S_OK;
518 }
519
520 static HRESULT WINAPI VideoRenderer_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock)
521 {
522     VideoRendererImpl *This = (VideoRendererImpl *)iface;
523
524     TRACE("(%p/%p)->(%p)\n", This, iface, pClock);
525
526     EnterCriticalSection(&This->csFilter);
527     {
528         if (This->pClock)
529             IReferenceClock_Release(This->pClock);
530         This->pClock = pClock;
531         if (This->pClock)
532             IReferenceClock_AddRef(This->pClock);
533     }
534     LeaveCriticalSection(&This->csFilter);
535
536     return S_OK;
537 }
538
539 static HRESULT WINAPI VideoRenderer_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock)
540 {
541     VideoRendererImpl *This = (VideoRendererImpl *)iface;
542
543     TRACE("(%p/%p)->(%p)\n", This, iface, ppClock);
544
545     EnterCriticalSection(&This->csFilter);
546     {
547         *ppClock = This->pClock;
548         IReferenceClock_AddRef(This->pClock);
549     }
550     LeaveCriticalSection(&This->csFilter);
551     
552     return S_OK;
553 }
554
555 /** IBaseFilter implementation **/
556
557 static HRESULT WINAPI VideoRenderer_EnumPins(IBaseFilter * iface, IEnumPins **ppEnum)
558 {
559     ENUMPINDETAILS epd;
560     VideoRendererImpl *This = (VideoRendererImpl *)iface;
561
562     TRACE("(%p/%p)->(%p)\n", This, iface, ppEnum);
563
564     epd.cPins = 1; /* input pin */
565     epd.ppPins = This->ppPins;
566     return IEnumPinsImpl_Construct(&epd, ppEnum);
567 }
568
569 static HRESULT WINAPI VideoRenderer_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin)
570 {
571     VideoRendererImpl *This = (VideoRendererImpl *)iface;
572
573     TRACE("(%p/%p)->(%p,%p)\n", This, iface, debugstr_w(Id), ppPin);
574
575     FIXME("VideoRenderer::FindPin(...)\n");
576
577     /* FIXME: critical section */
578
579     return E_NOTIMPL;
580 }
581
582 static HRESULT WINAPI VideoRenderer_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo)
583 {
584     VideoRendererImpl *This = (VideoRendererImpl *)iface;
585
586     TRACE("(%p/%p)->(%p)\n", This, iface, pInfo);
587
588     strcpyW(pInfo->achName, This->filterInfo.achName);
589     pInfo->pGraph = This->filterInfo.pGraph;
590
591     if (pInfo->pGraph)
592         IFilterGraph_AddRef(pInfo->pGraph);
593     
594     return S_OK;
595 }
596
597 static HRESULT WINAPI VideoRenderer_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName)
598 {
599     VideoRendererImpl *This = (VideoRendererImpl *)iface;
600
601     TRACE("(%p/%p)->(%p, %s)\n", This, iface, pGraph, debugstr_w(pName));
602
603     EnterCriticalSection(&This->csFilter);
604     {
605         if (pName)
606             strcpyW(This->filterInfo.achName, pName);
607         else
608             *This->filterInfo.achName = '\0';
609         This->filterInfo.pGraph = pGraph; /* NOTE: do NOT increase ref. count */
610     }
611     LeaveCriticalSection(&This->csFilter);
612
613     return S_OK;
614 }
615
616 static HRESULT WINAPI VideoRenderer_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo)
617 {
618     VideoRendererImpl *This = (VideoRendererImpl *)iface;
619     TRACE("(%p/%p)->(%p)\n", This, iface, pVendorInfo);
620     return E_NOTIMPL;
621 }
622
623 static const IBaseFilterVtbl VideoRenderer_Vtbl =
624 {
625     VideoRenderer_QueryInterface,
626     VideoRenderer_AddRef,
627     VideoRenderer_Release,
628     VideoRenderer_GetClassID,
629     VideoRenderer_Stop,
630     VideoRenderer_Pause,
631     VideoRenderer_Run,
632     VideoRenderer_GetState,
633     VideoRenderer_SetSyncSource,
634     VideoRenderer_GetSyncSource,
635     VideoRenderer_EnumPins,
636     VideoRenderer_FindPin,
637     VideoRenderer_QueryFilterInfo,
638     VideoRenderer_JoinFilterGraph,
639     VideoRenderer_QueryVendorInfo
640 };
641
642 static HRESULT WINAPI VideoRenderer_InputPin_EndOfStream(IPin * iface)
643 {
644     InputPin* This = (InputPin*)iface;
645     IMediaEventSink* pEventSink;
646     HRESULT hr;
647
648     TRACE("(%p/%p)->()\n", This, iface);
649
650     hr = IFilterGraph_QueryInterface(((VideoRendererImpl*)This->pin.pinInfo.pFilter)->filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink);
651     if (SUCCEEDED(hr))
652     {
653         hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, 0);
654         IMediaEventSink_Release(pEventSink);
655     }
656
657     return hr;
658 }
659
660 static const IPinVtbl VideoRenderer_InputPin_Vtbl = 
661 {
662     InputPin_QueryInterface,
663     IPinImpl_AddRef,
664     InputPin_Release,
665     InputPin_Connect,
666     InputPin_ReceiveConnection,
667     IPinImpl_Disconnect,
668     IPinImpl_ConnectedTo,
669     IPinImpl_ConnectionMediaType,
670     IPinImpl_QueryPinInfo,
671     IPinImpl_QueryDirection,
672     IPinImpl_QueryId,
673     IPinImpl_QueryAccept,
674     IPinImpl_EnumMediaTypes,
675     IPinImpl_QueryInternalConnections,
676     VideoRenderer_InputPin_EndOfStream,
677     InputPin_BeginFlush,
678     InputPin_EndFlush,
679     InputPin_NewSegment
680 };
681
682 /*** IUnknown methods ***/
683 static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface,
684                                                 REFIID riid,
685                                                 LPVOID*ppvObj) {
686     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
687
688     TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
689
690     return VideoRenderer_QueryInterface((IBaseFilter*)This, riid, ppvObj);
691 }
692
693 static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface) {
694     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
695
696     TRACE("(%p/%p)->()\n", This, iface);
697
698     return VideoRenderer_AddRef((IBaseFilter*)This);
699 }
700
701 static ULONG WINAPI Basicvideo_Release(IBasicVideo *iface) {
702     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
703
704     TRACE("(%p/%p)->()\n", This, iface);
705
706     return VideoRenderer_Release((IBaseFilter*)This);
707 }
708
709 /*** IDispatch methods ***/
710 static HRESULT WINAPI Basicvideo_GetTypeInfoCount(IBasicVideo *iface,
711                                                   UINT*pctinfo) {
712     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
713
714     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
715
716     return S_OK;
717 }
718
719 static HRESULT WINAPI Basicvideo_GetTypeInfo(IBasicVideo *iface,
720                                              UINT iTInfo,
721                                              LCID lcid,
722                                              ITypeInfo**ppTInfo) {
723     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
724
725     TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
726
727     return S_OK;
728 }
729
730 static HRESULT WINAPI Basicvideo_GetIDsOfNames(IBasicVideo *iface,
731                                                REFIID riid,
732                                                LPOLESTR*rgszNames,
733                                                UINT cNames,
734                                                LCID lcid,
735                                                DISPID*rgDispId) {
736     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
737
738     TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
739
740     return S_OK;
741 }
742
743 static HRESULT WINAPI Basicvideo_Invoke(IBasicVideo *iface,
744                                         DISPID dispIdMember,
745                                         REFIID riid,
746                                         LCID lcid,
747                                         WORD wFlags,
748                                         DISPPARAMS*pDispParams,
749                                         VARIANT*pVarResult,
750                                         EXCEPINFO*pExepInfo,
751                                         UINT*puArgErr) {
752     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
753
754     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);
755
756     return S_OK;
757 }
758
759 /*** IBasicVideo methods ***/
760 static HRESULT WINAPI Basicvideo_get_AvgTimePerFrame(IBasicVideo *iface,
761                                                      REFTIME *pAvgTimePerFrame) {
762     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
763
764     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pAvgTimePerFrame);
765
766     return S_OK;
767 }
768
769 static HRESULT WINAPI Basicvideo_get_BitRate(IBasicVideo *iface,
770                                              long *pBitRate) {
771     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
772
773     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBitRate);
774
775     return S_OK;
776 }
777
778 static HRESULT WINAPI Basicvideo_get_BitErrorRate(IBasicVideo *iface,
779                                                   long *pBitErrorRate) {
780     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
781
782     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBitErrorRate);
783
784     return S_OK;
785 }
786
787 static HRESULT WINAPI Basicvideo_get_VideoWidth(IBasicVideo *iface,
788                                                 long *pVideoWidth) {
789     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
790
791     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVideoWidth);
792
793     return S_OK;
794 }
795
796 static HRESULT WINAPI Basicvideo_get_VideoHeight(IBasicVideo *iface,
797                                                  long *pVideoHeight) {
798     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
799
800     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVideoHeight);
801
802     return S_OK;
803 }
804
805 static HRESULT WINAPI Basicvideo_put_SourceLeft(IBasicVideo *iface,
806                                                 long SourceLeft) {
807     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
808
809     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceLeft);
810
811     return S_OK;
812 }
813
814 static HRESULT WINAPI Basicvideo_get_SourceLeft(IBasicVideo *iface,
815                                                 long *pSourceLeft) {
816     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
817
818     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceLeft);
819
820     return S_OK;
821 }
822
823 static HRESULT WINAPI Basicvideo_put_SourceWidth(IBasicVideo *iface,
824                                                  long SourceWidth) {
825     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
826
827     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceWidth);
828
829     return S_OK;
830 }
831
832 static HRESULT WINAPI Basicvideo_get_SourceWidth(IBasicVideo *iface,
833                                                  long *pSourceWidth) {
834     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
835
836     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceWidth);
837
838     return S_OK;
839 }
840
841 static HRESULT WINAPI Basicvideo_put_SourceTop(IBasicVideo *iface,
842                                                long SourceTop) {
843     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
844
845     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceTop);
846
847     return S_OK;
848 }
849
850 static HRESULT WINAPI Basicvideo_get_SourceTop(IBasicVideo *iface,
851                                                long *pSourceTop) {
852     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
853
854     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceTop);
855
856     return S_OK;
857 }
858
859 static HRESULT WINAPI Basicvideo_put_SourceHeight(IBasicVideo *iface,
860                                                   long SourceHeight) {
861     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
862
863     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, SourceHeight);
864
865     return S_OK;
866 }
867
868 static HRESULT WINAPI Basicvideo_get_SourceHeight(IBasicVideo *iface,
869                                                   long *pSourceHeight) {
870     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
871
872     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pSourceHeight);
873
874     return S_OK;
875 }
876
877 static HRESULT WINAPI Basicvideo_put_DestinationLeft(IBasicVideo *iface,
878                                                      long DestinationLeft) {
879     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
880
881     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationLeft);
882
883     return S_OK;
884 }
885
886 static HRESULT WINAPI Basicvideo_get_DestinationLeft(IBasicVideo *iface,
887                                                      long *pDestinationLeft) {
888     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
889
890     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationLeft);
891
892     return S_OK;
893 }
894
895 static HRESULT WINAPI Basicvideo_put_DestinationWidth(IBasicVideo *iface,
896                                                       long DestinationWidth) {
897     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
898
899     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationWidth);
900
901     return S_OK;
902 }
903
904 static HRESULT WINAPI Basicvideo_get_DestinationWidth(IBasicVideo *iface,
905                                                       long *pDestinationWidth) {
906     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
907
908     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationWidth);
909
910     return S_OK;
911 }
912
913 static HRESULT WINAPI Basicvideo_put_DestinationTop(IBasicVideo *iface,
914                                                     long DestinationTop) {
915     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
916
917     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationTop);
918
919     return S_OK;
920 }
921
922 static HRESULT WINAPI Basicvideo_get_DestinationTop(IBasicVideo *iface,
923                                                     long *pDestinationTop) {
924     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
925
926     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationTop);
927
928     return S_OK;
929 }
930
931 static HRESULT WINAPI Basicvideo_put_DestinationHeight(IBasicVideo *iface,
932                                                        long DestinationHeight) {
933     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
934
935     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, DestinationHeight);
936
937     return S_OK;
938 }
939
940 static HRESULT WINAPI Basicvideo_get_DestinationHeight(IBasicVideo *iface,
941                                                        long *pDestinationHeight) {
942     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
943
944     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pDestinationHeight);
945
946     return S_OK;
947 }
948
949 static HRESULT WINAPI Basicvideo_SetSourcePosition(IBasicVideo *iface,
950                                                    long Left,
951                                                    long Top,
952                                                    long Width,
953                                                    long Height) {
954     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
955
956     TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
957
958     return S_OK;
959 }
960
961 static HRESULT WINAPI Basicvideo_GetSourcePosition(IBasicVideo *iface,
962                                                    long *pLeft,
963                                                    long *pTop,
964                                                    long *pWidth,
965                                                    long *pHeight) {
966     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
967
968     TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
969
970     return S_OK;
971 }
972
973 static HRESULT WINAPI Basicvideo_SetDefaultSourcePosition(IBasicVideo *iface) {
974     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
975
976     TRACE("(%p/%p)->(): stub !!!\n", This, iface);
977
978     return S_OK;
979 }
980
981 static HRESULT WINAPI Basicvideo_SetDestinationPosition(IBasicVideo *iface,
982                                                         long Left,
983                                                         long Top,
984                                                         long Width,
985                                                         long Height) {
986     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
987
988     TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
989
990     return S_OK;
991 }
992
993 static HRESULT WINAPI Basicvideo_GetDestinationPosition(IBasicVideo *iface,
994                                                         long *pLeft,
995                                                         long *pTop,
996                                                         long *pWidth,
997                                                         long *pHeight) {
998     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
999
1000     TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
1001
1002     return S_OK;
1003 }
1004
1005 static HRESULT WINAPI Basicvideo_SetDefaultDestinationPosition(IBasicVideo *iface) {
1006     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1007
1008     TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1009
1010     return S_OK;
1011 }
1012
1013 static HRESULT WINAPI Basicvideo_GetVideoSize(IBasicVideo *iface,
1014                                               long *pWidth,
1015                                               long *pHeight) {
1016     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1017
1018     TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
1019
1020     return S_OK;
1021 }
1022
1023 static HRESULT WINAPI Basicvideo_GetVideoPaletteEntries(IBasicVideo *iface,
1024                                                         long StartIndex,
1025                                                         long Entries,
1026                                                         long *pRetrieved,
1027                                                         long *pPalette) {
1028     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1029
1030     TRACE("(%p/%p)->(%ld, %ld, %p, %p): stub !!!\n", This, iface, StartIndex, Entries, pRetrieved, pPalette);
1031
1032     return S_OK;
1033 }
1034
1035 static HRESULT WINAPI Basicvideo_GetCurrentImage(IBasicVideo *iface,
1036                                                  long *pBufferSize,
1037                                                  long *pDIBImage) {
1038     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1039
1040     TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pBufferSize, pDIBImage);
1041
1042     return S_OK;
1043 }
1044
1045 static HRESULT WINAPI Basicvideo_IsUsingDefaultSource(IBasicVideo *iface) {
1046     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1047
1048     TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1049
1050     return S_OK;
1051 }
1052
1053 static HRESULT WINAPI Basicvideo_IsUsingDefaultDestination(IBasicVideo *iface) {
1054     ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1055
1056     TRACE("(%p/%p)->(): stub !!!\n", This, iface);
1057
1058     return S_OK;
1059 }
1060
1061
1062 static const IBasicVideoVtbl IBasicVideo_VTable =
1063 {
1064     Basicvideo_QueryInterface,
1065     Basicvideo_AddRef,
1066     Basicvideo_Release,
1067     Basicvideo_GetTypeInfoCount,
1068     Basicvideo_GetTypeInfo,
1069     Basicvideo_GetIDsOfNames,
1070     Basicvideo_Invoke,
1071     Basicvideo_get_AvgTimePerFrame,
1072     Basicvideo_get_BitRate,
1073     Basicvideo_get_BitErrorRate,
1074     Basicvideo_get_VideoWidth,
1075     Basicvideo_get_VideoHeight,
1076     Basicvideo_put_SourceLeft,
1077     Basicvideo_get_SourceLeft,
1078     Basicvideo_put_SourceWidth,
1079     Basicvideo_get_SourceWidth,
1080     Basicvideo_put_SourceTop,
1081     Basicvideo_get_SourceTop,
1082     Basicvideo_put_SourceHeight,
1083     Basicvideo_get_SourceHeight,
1084     Basicvideo_put_DestinationLeft,
1085     Basicvideo_get_DestinationLeft,
1086     Basicvideo_put_DestinationWidth,
1087     Basicvideo_get_DestinationWidth,
1088     Basicvideo_put_DestinationTop,
1089     Basicvideo_get_DestinationTop,
1090     Basicvideo_put_DestinationHeight,
1091     Basicvideo_get_DestinationHeight,
1092     Basicvideo_SetSourcePosition,
1093     Basicvideo_GetSourcePosition,
1094     Basicvideo_SetDefaultSourcePosition,
1095     Basicvideo_SetDestinationPosition,
1096     Basicvideo_GetDestinationPosition,
1097     Basicvideo_SetDefaultDestinationPosition,
1098     Basicvideo_GetVideoSize,
1099     Basicvideo_GetVideoPaletteEntries,
1100     Basicvideo_GetCurrentImage,
1101     Basicvideo_IsUsingDefaultSource,
1102     Basicvideo_IsUsingDefaultDestination
1103 };
1104
1105
1106 /*** IUnknown methods ***/
1107 static HRESULT WINAPI Videowindow_QueryInterface(IVideoWindow *iface,
1108                                                  REFIID riid,
1109                                                  LPVOID*ppvObj) {
1110     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1111
1112     TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1113
1114     return VideoRenderer_QueryInterface((IBaseFilter*)This, riid, ppvObj);
1115 }
1116
1117 static ULONG WINAPI Videowindow_AddRef(IVideoWindow *iface) {
1118     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1119
1120     TRACE("(%p/%p)->()\n", This, iface);
1121
1122     return VideoRenderer_AddRef((IBaseFilter*)This);
1123 }
1124
1125 static ULONG WINAPI Videowindow_Release(IVideoWindow *iface) {
1126     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1127
1128     TRACE("(%p/%p)->()\n", This, iface);
1129
1130     return VideoRenderer_Release((IBaseFilter*)This);
1131 }
1132
1133 /*** IDispatch methods ***/
1134 static HRESULT WINAPI Videowindow_GetTypeInfoCount(IVideoWindow *iface,
1135                                                    UINT*pctinfo) {
1136     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1137
1138     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1139
1140     return S_OK;
1141 }
1142
1143 static HRESULT WINAPI Videowindow_GetTypeInfo(IVideoWindow *iface,
1144                                               UINT iTInfo,
1145                                               LCID lcid,
1146                                               ITypeInfo**ppTInfo) {
1147     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1148
1149     TRACE("(%p/%p)->(%d, %ld, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1150
1151     return S_OK;
1152 }
1153
1154 static HRESULT WINAPI Videowindow_GetIDsOfNames(IVideoWindow *iface,
1155                                                 REFIID riid,
1156                                                 LPOLESTR*rgszNames,
1157                                                 UINT cNames,
1158                                                 LCID lcid,
1159                                                 DISPID*rgDispId) {
1160     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1161
1162     TRACE("(%p/%p)->(%s (%p), %p, %d, %ld, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1163
1164     return S_OK;
1165 }
1166
1167 static HRESULT WINAPI Videowindow_Invoke(IVideoWindow *iface,
1168                                          DISPID dispIdMember,
1169                                          REFIID riid,
1170                                          LCID lcid,
1171                                          WORD wFlags,
1172                                          DISPPARAMS*pDispParams,
1173                                          VARIANT*pVarResult,
1174                                          EXCEPINFO*pExepInfo,
1175                                          UINT*puArgErr) {
1176     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1177
1178     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);
1179
1180     return S_OK;
1181 }
1182
1183 /*** IVideoWindow methods ***/
1184 static HRESULT WINAPI Videowindow_put_Caption(IVideoWindow *iface,
1185                                               BSTR strCaption) {
1186     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1187
1188     TRACE("(%p/%p)->(%s (%p)): stub !!!\n", This, iface, debugstr_w(strCaption), strCaption);
1189
1190     return S_OK;
1191 }
1192
1193 static HRESULT WINAPI Videowindow_get_Caption(IVideoWindow *iface,
1194                                               BSTR *strCaption) {
1195     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1196
1197     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, strCaption);
1198
1199     return S_OK;
1200 }
1201
1202 static HRESULT WINAPI Videowindow_put_WindowStyle(IVideoWindow *iface,
1203                                                   long WindowStyle) {
1204     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1205
1206     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowStyle);
1207
1208     return S_OK;
1209 }
1210
1211 static HRESULT WINAPI Videowindow_get_WindowStyle(IVideoWindow *iface,
1212                                                   long *WindowStyle) {
1213     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1214
1215     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowStyle);
1216
1217     return S_OK;
1218 }
1219
1220 static HRESULT WINAPI Videowindow_put_WindowStyleEx(IVideoWindow *iface,
1221                                                     long WindowStyleEx) {
1222     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1223
1224     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowStyleEx);
1225
1226     return S_OK;
1227 }
1228
1229 static HRESULT WINAPI Videowindow_get_WindowStyleEx(IVideoWindow *iface,
1230                                                     long *WindowStyleEx) {
1231     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1232
1233     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowStyleEx);
1234
1235     return S_OK;
1236 }
1237
1238 static HRESULT WINAPI Videowindow_put_AutoShow(IVideoWindow *iface,
1239                                                long AutoShow) {
1240     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1241
1242     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, AutoShow);
1243
1244     return S_OK;
1245 }
1246
1247 static HRESULT WINAPI Videowindow_get_AutoShow(IVideoWindow *iface,
1248                                                long *AutoShow) {
1249     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1250
1251     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, AutoShow);
1252
1253     return S_OK;
1254 }
1255
1256 static HRESULT WINAPI Videowindow_put_WindowState(IVideoWindow *iface,
1257                                                   long WindowState) {
1258     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1259
1260     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowState);
1261
1262     return S_OK;
1263 }
1264
1265 static HRESULT WINAPI Videowindow_get_WindowState(IVideoWindow *iface,
1266                                                   long *WindowState) {
1267     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1268
1269     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, WindowState);
1270
1271     return S_OK;
1272 }
1273
1274 static HRESULT WINAPI Videowindow_put_BackgroundPalette(IVideoWindow *iface,
1275                                                         long BackgroundPalette) {
1276     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1277
1278     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, BackgroundPalette);
1279
1280     return S_OK;
1281 }
1282
1283 static HRESULT WINAPI Videowindow_get_BackgroundPalette(IVideoWindow *iface,
1284                                                         long *pBackgroundPalette) {
1285     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1286
1287     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pBackgroundPalette);
1288
1289     return S_OK;
1290 }
1291
1292 static HRESULT WINAPI Videowindow_put_Visible(IVideoWindow *iface,
1293                                               long Visible) {
1294     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1295
1296     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Visible);
1297
1298     return S_OK;
1299 }
1300
1301 static HRESULT WINAPI Videowindow_get_Visible(IVideoWindow *iface,
1302                                               long *pVisible) {
1303     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1304
1305     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pVisible);
1306
1307     return S_OK;
1308 }
1309
1310 static HRESULT WINAPI Videowindow_put_Left(IVideoWindow *iface,
1311                                            long Left) {
1312     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1313
1314     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Left);
1315
1316     return S_OK;
1317 }
1318
1319 static HRESULT WINAPI Videowindow_get_Left(IVideoWindow *iface,
1320                                            long *pLeft) {
1321     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1322
1323     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pLeft);
1324
1325     return S_OK;
1326 }
1327
1328 static HRESULT WINAPI Videowindow_put_Width(IVideoWindow *iface,
1329                                             long Width) {
1330     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1331
1332     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Width);
1333
1334     return S_OK;
1335 }
1336
1337 static HRESULT WINAPI Videowindow_get_Width(IVideoWindow *iface,
1338                                             long *pWidth) {
1339     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1340
1341     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pWidth);
1342
1343     return S_OK;
1344 }
1345
1346 static HRESULT WINAPI Videowindow_put_Top(IVideoWindow *iface,
1347                                           long Top) {
1348     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1349
1350     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Top);
1351
1352     return S_OK;
1353 }
1354
1355 static HRESULT WINAPI Videowindow_get_Top(IVideoWindow *iface,
1356                                           long *pTop) {
1357     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1358
1359     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pTop);
1360
1361     return S_OK;
1362 }
1363
1364 static HRESULT WINAPI Videowindow_put_Height(IVideoWindow *iface,
1365                                              long Height) {
1366     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1367
1368     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Height);
1369
1370     return S_OK;
1371 }
1372
1373 static HRESULT WINAPI Videowindow_get_Height(IVideoWindow *iface,
1374                                              long *pHeight) {
1375     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1376
1377     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pHeight);
1378
1379     return S_OK;
1380 }
1381
1382 static HRESULT WINAPI Videowindow_put_Owner(IVideoWindow *iface,
1383                                             OAHWND Owner) {
1384     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1385
1386     TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Owner);
1387
1388     return S_OK;
1389 }
1390
1391 static HRESULT WINAPI Videowindow_get_Owner(IVideoWindow *iface,
1392                                             OAHWND *Owner) {
1393     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1394
1395     TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Owner);
1396
1397     return S_OK;
1398 }
1399
1400 static HRESULT WINAPI Videowindow_put_MessageDrain(IVideoWindow *iface,
1401                                                    OAHWND Drain) {
1402     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1403
1404     TRACE("(%p/%p)->(%08lx): stub !!!\n", This, iface, (DWORD) Drain);
1405
1406     return S_OK;
1407 }
1408
1409 static HRESULT WINAPI Videowindow_get_MessageDrain(IVideoWindow *iface,
1410                                                    OAHWND *Drain) {
1411     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1412
1413     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, Drain);
1414
1415     return S_OK;
1416 }
1417
1418 static HRESULT WINAPI Videowindow_get_BorderColor(IVideoWindow *iface,
1419                                                   long *Color) {
1420     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1421
1422     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, Color);
1423
1424     return S_OK;
1425 }
1426
1427 static HRESULT WINAPI Videowindow_put_BorderColor(IVideoWindow *iface,
1428                                                   long Color) {
1429     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1430
1431     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Color);
1432
1433     return S_OK;
1434 }
1435
1436 static HRESULT WINAPI Videowindow_get_FullScreenMode(IVideoWindow *iface,
1437                                                      long *FullScreenMode) {
1438     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1439
1440     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, FullScreenMode);
1441
1442     return S_OK;
1443 }
1444
1445 static HRESULT WINAPI Videowindow_put_FullScreenMode(IVideoWindow *iface,
1446                                                      long FullScreenMode) {
1447     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1448
1449     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, FullScreenMode);
1450
1451     return S_OK;
1452 }
1453
1454 static HRESULT WINAPI Videowindow_SetWindowForeground(IVideoWindow *iface,
1455                                                       long Focus) {
1456     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1457
1458     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, Focus);
1459
1460     return S_OK;
1461 }
1462
1463 static HRESULT WINAPI Videowindow_NotifyOwnerMessage(IVideoWindow *iface,
1464                                                      OAHWND hwnd,
1465                                                      long uMsg,
1466                                                      LONG_PTR wParam,
1467                                                      LONG_PTR lParam) {
1468     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1469
1470     TRACE("(%p/%p)->(%08lx, %ld, %08lx, %08lx): stub !!!\n", This, iface, (DWORD) hwnd, uMsg, wParam, lParam);
1471
1472     return S_OK;
1473 }
1474
1475 static HRESULT WINAPI Videowindow_SetWindowPosition(IVideoWindow *iface,
1476                                                     long Left,
1477                                                     long Top,
1478                                                     long Width,
1479                                                     long Height) {
1480     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1481     
1482     TRACE("(%p/%p)->(%ld, %ld, %ld, %ld): stub !!!\n", This, iface, Left, Top, Width, Height);
1483
1484     return S_OK;
1485 }
1486
1487 static HRESULT WINAPI Videowindow_GetWindowPosition(IVideoWindow *iface,
1488                                                     long *pLeft,
1489                                                     long *pTop,
1490                                                     long *pWidth,
1491                                                     long *pHeight) {
1492     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1493
1494     TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
1495
1496     return S_OK;
1497 }
1498
1499 static HRESULT WINAPI Videowindow_GetMinIdealImageSize(IVideoWindow *iface,
1500                                                        long *pWidth,
1501                                                        long *pHeight) {
1502     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1503
1504     TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
1505
1506     return S_OK;
1507 }
1508
1509 static HRESULT WINAPI Videowindow_GetMaxIdealImageSize(IVideoWindow *iface,
1510                                                        long *pWidth,
1511                                                        long *pHeight) {
1512     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1513
1514     TRACE("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pWidth, pHeight);
1515
1516     return S_OK;
1517 }
1518
1519 static HRESULT WINAPI Videowindow_GetRestorePosition(IVideoWindow *iface,
1520                                                      long *pLeft,
1521                                                      long *pTop,
1522                                                      long *pWidth,
1523                                                      long *pHeight) {
1524     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1525
1526     TRACE("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
1527
1528     return S_OK;
1529 }
1530
1531 static HRESULT WINAPI Videowindow_HideCursor(IVideoWindow *iface,
1532                                              long HideCursor) {
1533     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1534
1535     TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, HideCursor);
1536
1537     return S_OK;
1538 }
1539
1540 static HRESULT WINAPI Videowindow_IsCursorHidden(IVideoWindow *iface,
1541                                                  long *CursorHidden) {
1542     ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1543
1544     TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, CursorHidden);
1545
1546     return S_OK;
1547 }
1548
1549 static const IVideoWindowVtbl IVideoWindow_VTable =
1550 {
1551     Videowindow_QueryInterface,
1552     Videowindow_AddRef,
1553     Videowindow_Release,
1554     Videowindow_GetTypeInfoCount,
1555     Videowindow_GetTypeInfo,
1556     Videowindow_GetIDsOfNames,
1557     Videowindow_Invoke,
1558     Videowindow_put_Caption,
1559     Videowindow_get_Caption,
1560     Videowindow_put_WindowStyle,
1561     Videowindow_get_WindowStyle,
1562     Videowindow_put_WindowStyleEx,
1563     Videowindow_get_WindowStyleEx,
1564     Videowindow_put_AutoShow,
1565     Videowindow_get_AutoShow,
1566     Videowindow_put_WindowState,
1567     Videowindow_get_WindowState,
1568     Videowindow_put_BackgroundPalette,
1569     Videowindow_get_BackgroundPalette,
1570     Videowindow_put_Visible,
1571     Videowindow_get_Visible,
1572     Videowindow_put_Left,
1573     Videowindow_get_Left,
1574     Videowindow_put_Width,
1575     Videowindow_get_Width,
1576     Videowindow_put_Top,
1577     Videowindow_get_Top,
1578     Videowindow_put_Height,
1579     Videowindow_get_Height,
1580     Videowindow_put_Owner,
1581     Videowindow_get_Owner,
1582     Videowindow_put_MessageDrain,
1583     Videowindow_get_MessageDrain,
1584     Videowindow_get_BorderColor,
1585     Videowindow_put_BorderColor,
1586     Videowindow_get_FullScreenMode,
1587     Videowindow_put_FullScreenMode,
1588     Videowindow_SetWindowForeground,
1589     Videowindow_NotifyOwnerMessage,
1590     Videowindow_SetWindowPosition,
1591     Videowindow_GetWindowPosition,
1592     Videowindow_GetMinIdealImageSize,
1593     Videowindow_GetMaxIdealImageSize,
1594     Videowindow_GetRestorePosition,
1595     Videowindow_HideCursor,
1596     Videowindow_IsCursorHidden
1597 };