2 * Video Renderer (Fullscreen and Windowed using Direct Draw)
4 * Copyright 2004 Christian Costa
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.
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.
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #define NONAMELESSSTRUCT
24 #define NONAMELESSUNION
25 #include "quartz_private.h"
26 #include "control_private.h"
41 #include "wine/unicode.h"
42 #include "wine/debug.h"
44 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
46 static BOOL wnd_class_registered = FALSE;
48 static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0};
50 static const IBaseFilterVtbl VideoRenderer_Vtbl;
51 static const IUnknownVtbl IInner_VTable;
52 static const IBasicVideoVtbl IBasicVideo_VTable;
53 static const IVideoWindowVtbl IVideoWindow_VTable;
54 static const IPinVtbl VideoRenderer_InputPin_Vtbl;
56 typedef struct VideoRendererImpl
58 const IBaseFilterVtbl * lpVtbl;
59 const IBasicVideoVtbl * IBasicVideo_vtbl;
60 const IVideoWindowVtbl * IVideoWindow_vtbl;
61 const IUnknownVtbl * IInner_vtbl;
64 CRITICAL_SECTION csFilter;
66 REFERENCE_TIME rtStreamStart;
67 IReferenceClock * pClock;
68 FILTER_INFO filterInfo;
90 REFERENCE_TIME rtLastStop;
91 MediaSeekingImpl mediaSeeking;
93 /* During pause we can hold a single sample, for use in GetCurrentImage */
94 IMediaSample *sample_held;
97 static LRESULT CALLBACK VideoWndProcA(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
99 VideoRendererImpl* pVideoRenderer = (VideoRendererImpl*)GetWindowLongPtrW(hwnd, 0);
100 LPRECT lprect = (LPRECT)lParam;
102 if (pVideoRenderer && pVideoRenderer->hWndMsgDrain)
108 case WM_LBUTTONDBLCLK:
111 case WM_MBUTTONDBLCLK:
114 case WM_MOUSEACTIVATE:
116 case WM_NCLBUTTONDBLCLK:
117 case WM_NCLBUTTONDOWN:
119 case WM_NCMBUTTONDBLCLK:
120 case WM_NCMBUTTONDOWN:
123 case WM_NCRBUTTONDBLCLK:
124 case WM_NCRBUTTONDOWN:
126 case WM_RBUTTONDBLCLK:
129 PostMessageA(pVideoRenderer->hWndMsgDrain, uMsg, wParam, lParam);
139 /* TRACE("WM_SIZING %d %d %d %d\n", lprect->left, lprect->top, lprect->right, lprect->bottom); */
140 SetWindowPos(hwnd, NULL, lprect->left, lprect->top, lprect->right - lprect->left, lprect->bottom - lprect->top, SWP_NOZORDER);
141 GetClientRect(hwnd, &pVideoRenderer->DestRect);
142 TRACE("WM_SIZING: DestRect=(%d,%d),(%d,%d)\n",
143 pVideoRenderer->DestRect.left,
144 pVideoRenderer->DestRect.top,
145 pVideoRenderer->DestRect.right - pVideoRenderer->DestRect.left,
146 pVideoRenderer->DestRect.bottom - pVideoRenderer->DestRect.top);
149 TRACE("WM_SIZE %d %d\n", LOWORD(lParam), HIWORD(lParam));
150 GetClientRect(hwnd, &pVideoRenderer->DestRect);
151 TRACE("WM_SIZING: DestRect=(%d,%d),(%d,%d)\n",
152 pVideoRenderer->DestRect.left,
153 pVideoRenderer->DestRect.top,
154 pVideoRenderer->DestRect.right - pVideoRenderer->DestRect.left,
155 pVideoRenderer->DestRect.bottom - pVideoRenderer->DestRect.top);
158 return DefWindowProcA(hwnd, uMsg, wParam, lParam);
163 static BOOL CreateRenderingWindow(VideoRendererImpl* This)
167 TRACE("(%p)->()\n", This);
170 winclass.lpfnWndProc = VideoWndProcA;
171 winclass.cbClsExtra = 0;
172 winclass.cbWndExtra = sizeof(VideoRendererImpl*);
173 winclass.hInstance = NULL;
174 winclass.hIcon = NULL;
175 winclass.hCursor = NULL;
176 winclass.hbrBackground = GetStockObject(BLACK_BRUSH);
177 winclass.lpszMenuName = NULL;
178 winclass.lpszClassName = "Wine ActiveMovie Class";
180 if (!wnd_class_registered)
182 if (!RegisterClassA(&winclass))
184 ERR("Unable to register window %u\n", GetLastError());
187 wnd_class_registered = TRUE;
190 This->hWnd = CreateWindowExA(0, "Wine ActiveMovie Class", "Wine ActiveMovie Window", WS_SIZEBOX,
191 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL,
196 ERR("Unable to create window\n");
200 SetWindowLongPtrW(This->hWnd, 0, (LONG_PTR)This);
205 static DWORD WINAPI MessageLoop(LPVOID lpParameter)
207 VideoRendererImpl* This = lpParameter;
211 TRACE("Starting message loop\n");
213 if (!CreateRenderingWindow(This))
215 This->ThreadResult = FALSE;
216 SetEvent(This->hEvent);
220 This->ThreadResult = TRUE;
221 SetEvent(This->hEvent);
223 while ((fGotMessage = GetMessageA(&msg, NULL, 0, 0)) != 0 && fGotMessage != -1)
225 TranslateMessage(&msg);
226 DispatchMessageA(&msg);
229 TRACE("End of message loop\n");
234 static BOOL CreateRenderingSubsystem(VideoRendererImpl* This)
236 This->hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
240 This->hThread = CreateThread(NULL, 0, MessageLoop, This, 0, &This->ThreadID);
243 CloseHandle(This->hEvent);
247 WaitForSingleObject(This->hEvent, INFINITE);
249 if (!This->ThreadResult)
251 CloseHandle(This->hEvent);
252 CloseHandle(This->hThread);
259 static DWORD VideoRenderer_SendSampleData(VideoRendererImpl* This, LPBYTE data, DWORD size)
265 BITMAPINFOHEADER *bmiHeader;
267 TRACE("(%p)->(%p, %d)\n", This, data, size);
269 sdesc.dwSize = sizeof(sdesc);
270 hr = IPin_ConnectionMediaType((IPin *)This->pInputPin, &amt);
272 ERR("Unable to retrieve media type\n");
276 if (IsEqualIID(&amt.formattype, &FORMAT_VideoInfo))
278 bmiHeader = &((VIDEOINFOHEADER *)amt.pbFormat)->bmiHeader;
280 else if (IsEqualIID(&amt.formattype, &FORMAT_VideoInfo2))
282 bmiHeader = &((VIDEOINFOHEADER2 *)amt.pbFormat)->bmiHeader;
286 FIXME("Unknown type %s\n", debugstr_guid(&amt.subtype));
287 return VFW_E_RUNTIME_ERROR;
291 TRACE("biSize = %d\n", bmiHeader->biSize);
292 TRACE("biWidth = %d\n", bmiHeader->biWidth);
293 TRACE("biHeight = %d\n", bmiHeader->biHeight);
294 TRACE("biPlanes = %d\n", bmiHeader->biPlanes);
295 TRACE("biBitCount = %d\n", bmiHeader->biBitCount);
296 TRACE("biCompression = %s\n", debugstr_an((LPSTR)&(bmiHeader->biCompression), 4));
297 TRACE("biSizeImage = %d\n", bmiHeader->biSizeImage);
301 DWORD style = GetWindowLongW(This->hWnd, GWL_STYLE);
302 DWORD style_ex = GetWindowLongW(This->hWnd, GWL_EXSTYLE);
304 if (!This->WindowPos.right || !This->WindowPos.bottom)
305 This->WindowPos = This->SourceRect;
307 AdjustWindowRectEx(&This->WindowPos, style, TRUE, style_ex);
309 TRACE("WindowPos: %d %d %d %d\n", This->WindowPos.left, This->WindowPos.top, This->WindowPos.right, This->WindowPos.bottom);
310 SetWindowPos(This->hWnd, NULL,
311 This->WindowPos.left,
313 This->WindowPos.right - This->WindowPos.left,
314 This->WindowPos.bottom - This->WindowPos.top,
315 SWP_NOZORDER|SWP_NOMOVE);
317 GetClientRect(This->hWnd, &This->DestRect);
321 hDC = GetDC(This->hWnd);
324 ERR("Cannot get DC from window!\n");
328 TRACE("Src Rect: %d %d %d %d\n", This->SourceRect.left, This->SourceRect.top, This->SourceRect.right, This->SourceRect.bottom);
329 TRACE("Dst Rect: %d %d %d %d\n", This->DestRect.left, This->DestRect.top, This->DestRect.right, This->DestRect.bottom);
331 StretchDIBits(hDC, This->DestRect.left, This->DestRect.top, This->DestRect.right -This->DestRect.left,
332 This->DestRect.bottom - This->DestRect.top, This->SourceRect.left, This->SourceRect.top,
333 This->SourceRect.right - This->SourceRect.left, This->SourceRect.bottom - This->SourceRect.top,
334 data, (BITMAPINFO *)bmiHeader, DIB_RGB_COLORS, SRCCOPY);
336 ReleaseDC(This->hWnd, hDC);
338 ShowWindow(This->hWnd, SW_SHOW);
343 static HRESULT VideoRenderer_Sample(LPVOID iface, IMediaSample * pSample)
345 VideoRendererImpl *This = iface;
346 LPBYTE pbSrcStream = NULL;
347 long cbSrcStream = 0;
348 REFERENCE_TIME tStart, tStop;
351 TRACE("(%p)->(%p)\n", iface, pSample);
353 EnterCriticalSection(&This->csFilter);
355 if (This->pInputPin->flushing || This->pInputPin->end_of_stream)
357 LeaveCriticalSection(&This->csFilter);
361 if (This->state == State_Stopped)
363 LeaveCriticalSection(&This->csFilter);
364 return VFW_E_WRONG_STATE;
367 hr = IMediaSample_GetTime(pSample, &tStart, &tStop);
369 ERR("Cannot get sample time (%x)\n", hr);
371 if (This->rtLastStop != tStart)
373 if (IMediaSample_IsDiscontinuity(pSample) == S_FALSE)
374 ERR("Unexpected discontinuity: Last: %u.%03u, tStart: %u.%03u\n",
375 (DWORD)(This->rtLastStop / 10000000),
376 (DWORD)((This->rtLastStop / 10000)%1000),
377 (DWORD)(tStart / 10000000), (DWORD)((tStart / 10000)%1000));
378 This->rtLastStop = tStart;
381 /* Preroll means the sample isn't shown, this is used for key frames and things like that */
382 if (IMediaSample_IsPreroll(pSample) == S_OK)
384 This->rtLastStop = tStop;
385 LeaveCriticalSection(&This->csFilter);
389 hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
392 ERR("Cannot get pointer to sample data (%x)\n", hr);
393 LeaveCriticalSection(&This->csFilter);
397 cbSrcStream = IMediaSample_GetActualDataLength(pSample);
399 TRACE("val %p %ld\n", pbSrcStream, cbSrcStream);
401 #if 0 /* For debugging purpose */
404 for(i = 0; i < cbSrcStream; i++)
406 if ((i!=0) && !(i%16))
408 TRACE("%02x ", pbSrcStream[i]);
414 SetEvent(This->hEvent);
415 if (This->state == State_Paused)
417 This->sample_held = pSample;
418 LeaveCriticalSection(&This->csFilter);
419 WaitForSingleObject(This->blocked, INFINITE);
420 EnterCriticalSection(&This->csFilter);
421 This->sample_held = NULL;
422 if (This->state == State_Paused)
425 LeaveCriticalSection(&This->csFilter);
428 if (This->state == State_Stopped)
430 LeaveCriticalSection(&This->csFilter);
431 return VFW_E_WRONG_STATE;
435 if (This->pClock && This->state == State_Running)
437 REFERENCE_TIME time, trefstart, trefstop;
440 /* Perhaps I <SHOULD> use the reference clock AdviseTime function here
441 * I'm not going to! When I tried, it seemed to generate lag and
442 * it caused instability.
444 IReferenceClock_GetTime(This->pClock, &time);
446 trefstart = This->rtStreamStart;
447 trefstop = (REFERENCE_TIME)((double)(tStop - tStart) / This->pInputPin->dRate) + This->rtStreamStart;
448 delta = (LONG)((trefstart-time)/10000);
449 This->rtStreamStart = trefstop;
450 This->rtLastStop = tStop;
454 TRACE("Sleeping for %u ms\n", delta);
457 else if (time > trefstop)
459 TRACE("Dropping sample: Time: %u.%03u ms trefstop: %u.%03u ms!\n",
460 (DWORD)(time / 10000000), (DWORD)((time / 10000)%1000),
461 (DWORD)(trefstop / 10000000), (DWORD)((trefstop / 10000)%1000) );
462 This->rtLastStop = tStop;
463 LeaveCriticalSection(&This->csFilter);
467 This->rtLastStop = tStop;
469 VideoRenderer_SendSampleData(This, pbSrcStream, cbSrcStream);
471 LeaveCriticalSection(&This->csFilter);
475 static HRESULT VideoRenderer_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt)
477 if (!IsEqualIID(&pmt->majortype, &MEDIATYPE_Video))
480 if (IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB32) ||
481 IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB24) ||
482 IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB565) ||
483 IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB8))
485 VideoRendererImpl* This = iface;
487 if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo))
489 VIDEOINFOHEADER *format = (VIDEOINFOHEADER *)pmt->pbFormat;
490 This->SourceRect.left = 0;
491 This->SourceRect.top = 0;
492 This->SourceRect.right = This->VideoWidth = format->bmiHeader.biWidth;
493 This->SourceRect.bottom = This->VideoHeight = format->bmiHeader.biHeight;
495 else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2))
497 VIDEOINFOHEADER2 *format2 = (VIDEOINFOHEADER2 *)pmt->pbFormat;
499 This->SourceRect.left = 0;
500 This->SourceRect.top = 0;
501 This->SourceRect.right = This->VideoWidth = format2->bmiHeader.biWidth;
502 This->SourceRect.bottom = This->VideoHeight = format2->bmiHeader.biHeight;
506 WARN("Format type %s not supported\n", debugstr_guid(&pmt->formattype));
514 static inline VideoRendererImpl *impl_from_IMediaSeeking( IMediaSeeking *iface )
516 return (VideoRendererImpl *)((char*)iface - FIELD_OFFSET(VideoRendererImpl, mediaSeeking.lpVtbl));
519 static HRESULT WINAPI VideoRendererImpl_Seeking_QueryInterface(IMediaSeeking * iface, REFIID riid, LPVOID * ppv)
521 VideoRendererImpl *This = impl_from_IMediaSeeking(iface);
523 return IUnknown_QueryInterface((IUnknown *)This, riid, ppv);
526 static ULONG WINAPI VideoRendererImpl_Seeking_AddRef(IMediaSeeking * iface)
528 VideoRendererImpl *This = impl_from_IMediaSeeking(iface);
530 return IUnknown_AddRef((IUnknown *)This);
533 static ULONG WINAPI VideoRendererImpl_Seeking_Release(IMediaSeeking * iface)
535 VideoRendererImpl *This = impl_from_IMediaSeeking(iface);
537 return IUnknown_Release((IUnknown *)This);
540 static const IMediaSeekingVtbl VideoRendererImpl_Seeking_Vtbl =
542 VideoRendererImpl_Seeking_QueryInterface,
543 VideoRendererImpl_Seeking_AddRef,
544 VideoRendererImpl_Seeking_Release,
545 MediaSeekingImpl_GetCapabilities,
546 MediaSeekingImpl_CheckCapabilities,
547 MediaSeekingImpl_IsFormatSupported,
548 MediaSeekingImpl_QueryPreferredFormat,
549 MediaSeekingImpl_GetTimeFormat,
550 MediaSeekingImpl_IsUsingTimeFormat,
551 MediaSeekingImpl_SetTimeFormat,
552 MediaSeekingImpl_GetDuration,
553 MediaSeekingImpl_GetStopPosition,
554 MediaSeekingImpl_GetCurrentPosition,
555 MediaSeekingImpl_ConvertTimeFormat,
556 MediaSeekingImpl_SetPositions,
557 MediaSeekingImpl_GetPositions,
558 MediaSeekingImpl_GetAvailable,
559 MediaSeekingImpl_SetRate,
560 MediaSeekingImpl_GetRate,
561 MediaSeekingImpl_GetPreroll
564 static HRESULT VideoRendererImpl_Change(IBaseFilter *iface)
566 TRACE("(%p)->()\n", iface);
570 HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv)
574 VideoRendererImpl * pVideoRenderer;
576 TRACE("(%p, %p)\n", pUnkOuter, ppv);
580 pVideoRenderer = CoTaskMemAlloc(sizeof(VideoRendererImpl));
581 pVideoRenderer->pUnkOuter = pUnkOuter;
582 pVideoRenderer->bUnkOuterValid = FALSE;
583 pVideoRenderer->bAggregatable = FALSE;
584 pVideoRenderer->IInner_vtbl = &IInner_VTable;
586 pVideoRenderer->lpVtbl = &VideoRenderer_Vtbl;
587 pVideoRenderer->IBasicVideo_vtbl = &IBasicVideo_VTable;
588 pVideoRenderer->IVideoWindow_vtbl = &IVideoWindow_VTable;
590 pVideoRenderer->refCount = 1;
591 InitializeCriticalSection(&pVideoRenderer->csFilter);
592 pVideoRenderer->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": VideoRendererImpl.csFilter");
593 pVideoRenderer->state = State_Stopped;
594 pVideoRenderer->pClock = NULL;
595 pVideoRenderer->init = 0;
596 pVideoRenderer->AutoShow = 1;
597 pVideoRenderer->rtLastStop = -1;
598 ZeroMemory(&pVideoRenderer->filterInfo, sizeof(FILTER_INFO));
599 ZeroMemory(&pVideoRenderer->SourceRect, sizeof(RECT));
600 ZeroMemory(&pVideoRenderer->DestRect, sizeof(RECT));
601 ZeroMemory(&pVideoRenderer->WindowPos, sizeof(RECT));
602 pVideoRenderer->hWndMsgDrain = NULL;
604 /* construct input pin */
605 piInput.dir = PINDIR_INPUT;
606 piInput.pFilter = (IBaseFilter *)pVideoRenderer;
607 lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0]));
609 hr = InputPin_Construct(&VideoRenderer_InputPin_Vtbl, &piInput, VideoRenderer_Sample, (LPVOID)pVideoRenderer, VideoRenderer_QueryAccept, NULL, &pVideoRenderer->csFilter, NULL, (IPin **)&pVideoRenderer->pInputPin);
613 MediaSeekingImpl_Init((IBaseFilter*)pVideoRenderer, VideoRendererImpl_Change, VideoRendererImpl_Change, VideoRendererImpl_Change, &pVideoRenderer->mediaSeeking, &pVideoRenderer->csFilter);
614 pVideoRenderer->mediaSeeking.lpVtbl = &VideoRendererImpl_Seeking_Vtbl;
616 pVideoRenderer->sample_held = NULL;
617 *ppv = pVideoRenderer;
621 pVideoRenderer->csFilter.DebugInfo->Spare[0] = 0;
622 DeleteCriticalSection(&pVideoRenderer->csFilter);
623 CoTaskMemFree(pVideoRenderer);
626 if (!CreateRenderingSubsystem(pVideoRenderer))
629 pVideoRenderer->blocked = CreateEventW(NULL, FALSE, FALSE, NULL);
630 if (!pVideoRenderer->blocked)
632 hr = HRESULT_FROM_WIN32(GetLastError());
633 IUnknown_Release((IUnknown *)pVideoRenderer);
639 HRESULT VideoRendererDefault_create(IUnknown * pUnkOuter, LPVOID * ppv)
641 /* TODO: Attempt to use the VMR-7 renderer instead when possible */
642 return VideoRenderer_create(pUnkOuter, ppv);
645 static HRESULT WINAPI VideoRendererInner_QueryInterface(IUnknown * iface, REFIID riid, LPVOID * ppv)
647 ICOM_THIS_MULTI(VideoRendererImpl, IInner_vtbl, iface);
648 TRACE("(%p/%p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv);
650 if (This->bAggregatable)
651 This->bUnkOuterValid = TRUE;
655 if (IsEqualIID(riid, &IID_IUnknown))
656 *ppv = &This->IInner_vtbl;
657 else if (IsEqualIID(riid, &IID_IPersist))
659 else if (IsEqualIID(riid, &IID_IMediaFilter))
661 else if (IsEqualIID(riid, &IID_IBaseFilter))
663 else if (IsEqualIID(riid, &IID_IBasicVideo))
664 *ppv = &This->IBasicVideo_vtbl;
665 else if (IsEqualIID(riid, &IID_IVideoWindow))
666 *ppv = &This->IVideoWindow_vtbl;
667 else if (IsEqualIID(riid, &IID_IMediaSeeking))
668 *ppv = &This->mediaSeeking;
672 IUnknown_AddRef((IUnknown *)(*ppv));
676 if (!IsEqualIID(riid, &IID_IPin))
677 FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
679 return E_NOINTERFACE;
682 static ULONG WINAPI VideoRendererInner_AddRef(IUnknown * iface)
684 ICOM_THIS_MULTI(VideoRendererImpl, IInner_vtbl, iface);
685 ULONG refCount = InterlockedIncrement(&This->refCount);
687 TRACE("(%p/%p)->() AddRef from %d\n", This, iface, refCount - 1);
692 static ULONG WINAPI VideoRendererInner_Release(IUnknown * iface)
694 ICOM_THIS_MULTI(VideoRendererImpl, IInner_vtbl, iface);
695 ULONG refCount = InterlockedDecrement(&This->refCount);
697 TRACE("(%p/%p)->() Release from %d\n", This, iface, refCount + 1);
703 DestroyWindow(This->hWnd);
704 PostThreadMessageA(This->ThreadID, WM_QUIT, 0, 0);
705 WaitForSingleObject(This->hThread, INFINITE);
706 CloseHandle(This->hThread);
707 CloseHandle(This->hEvent);
710 IReferenceClock_Release(This->pClock);
712 if (SUCCEEDED(IPin_ConnectedTo((IPin *)This->pInputPin, &pConnectedTo)))
714 IPin_Disconnect(pConnectedTo);
715 IPin_Release(pConnectedTo);
717 IPin_Disconnect((IPin *)This->pInputPin);
719 IPin_Release((IPin *)This->pInputPin);
723 This->csFilter.DebugInfo->Spare[0] = 0;
724 DeleteCriticalSection(&This->csFilter);
726 TRACE("Destroying Video Renderer\n");
735 static const IUnknownVtbl IInner_VTable =
737 VideoRendererInner_QueryInterface,
738 VideoRendererInner_AddRef,
739 VideoRendererInner_Release
742 static HRESULT WINAPI VideoRenderer_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv)
744 VideoRendererImpl *This = (VideoRendererImpl *)iface;
746 if (This->bAggregatable)
747 This->bUnkOuterValid = TRUE;
751 if (This->bAggregatable)
752 return IUnknown_QueryInterface(This->pUnkOuter, riid, ppv);
754 if (IsEqualIID(riid, &IID_IUnknown))
758 IUnknown_AddRef((IUnknown *)&(This->IInner_vtbl));
759 hr = IUnknown_QueryInterface((IUnknown *)&(This->IInner_vtbl), riid, ppv);
760 IUnknown_Release((IUnknown *)&(This->IInner_vtbl));
761 This->bAggregatable = TRUE;
766 return E_NOINTERFACE;
769 return IUnknown_QueryInterface((IUnknown *)&(This->IInner_vtbl), riid, ppv);
772 static ULONG WINAPI VideoRenderer_AddRef(IBaseFilter * iface)
774 VideoRendererImpl *This = (VideoRendererImpl *)iface;
776 if (This->pUnkOuter && This->bUnkOuterValid)
777 return IUnknown_AddRef(This->pUnkOuter);
778 return IUnknown_AddRef((IUnknown *)&(This->IInner_vtbl));
781 static ULONG WINAPI VideoRenderer_Release(IBaseFilter * iface)
783 VideoRendererImpl *This = (VideoRendererImpl *)iface;
785 if (This->pUnkOuter && This->bUnkOuterValid)
786 return IUnknown_Release(This->pUnkOuter);
787 return IUnknown_Release((IUnknown *)&(This->IInner_vtbl));
790 /** IPersist methods **/
792 static HRESULT WINAPI VideoRenderer_GetClassID(IBaseFilter * iface, CLSID * pClsid)
794 VideoRendererImpl *This = (VideoRendererImpl *)iface;
796 TRACE("(%p/%p)->(%p)\n", This, iface, pClsid);
798 *pClsid = CLSID_VideoRenderer;
803 /** IMediaFilter methods **/
805 static HRESULT WINAPI VideoRenderer_Stop(IBaseFilter * iface)
807 VideoRendererImpl *This = (VideoRendererImpl *)iface;
809 TRACE("(%p/%p)->()\n", This, iface);
811 EnterCriticalSection(&This->csFilter);
813 This->state = State_Stopped;
814 SetEvent(This->hEvent);
815 SetEvent(This->blocked);
817 LeaveCriticalSection(&This->csFilter);
822 static HRESULT WINAPI VideoRenderer_Pause(IBaseFilter * iface)
824 VideoRendererImpl *This = (VideoRendererImpl *)iface;
826 TRACE("(%p/%p)->()\n", This, iface);
828 EnterCriticalSection(&This->csFilter);
829 if (This->state != State_Paused)
831 if (This->state == State_Stopped)
833 This->pInputPin->end_of_stream = 0;
834 ResetEvent(This->hEvent);
837 This->state = State_Paused;
838 ResetEvent(This->blocked);
840 LeaveCriticalSection(&This->csFilter);
845 static HRESULT WINAPI VideoRenderer_Run(IBaseFilter * iface, REFERENCE_TIME tStart)
847 VideoRendererImpl *This = (VideoRendererImpl *)iface;
849 TRACE("(%p/%p)->(%s)\n", This, iface, wine_dbgstr_longlong(tStart));
851 EnterCriticalSection(&This->csFilter);
852 if (This->state != State_Running)
854 if (This->state == State_Stopped)
856 This->pInputPin->end_of_stream = 0;
857 ResetEvent(This->hEvent);
859 SetEvent(This->blocked);
861 This->rtStreamStart = tStart;
862 This->state = State_Running;
864 LeaveCriticalSection(&This->csFilter);
869 static HRESULT WINAPI VideoRenderer_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
871 VideoRendererImpl *This = (VideoRendererImpl *)iface;
874 TRACE("(%p/%p)->(%d, %p)\n", This, iface, dwMilliSecsTimeout, pState);
876 if (WaitForSingleObject(This->hEvent, dwMilliSecsTimeout) == WAIT_TIMEOUT)
877 hr = VFW_S_STATE_INTERMEDIATE;
881 EnterCriticalSection(&This->csFilter);
883 *pState = This->state;
885 LeaveCriticalSection(&This->csFilter);
890 static HRESULT WINAPI VideoRenderer_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock)
892 VideoRendererImpl *This = (VideoRendererImpl *)iface;
894 TRACE("(%p/%p)->(%p)\n", This, iface, pClock);
896 EnterCriticalSection(&This->csFilter);
899 IReferenceClock_Release(This->pClock);
900 This->pClock = pClock;
902 IReferenceClock_AddRef(This->pClock);
904 LeaveCriticalSection(&This->csFilter);
909 static HRESULT WINAPI VideoRenderer_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock)
911 VideoRendererImpl *This = (VideoRendererImpl *)iface;
913 TRACE("(%p/%p)->(%p)\n", This, iface, ppClock);
915 EnterCriticalSection(&This->csFilter);
917 *ppClock = This->pClock;
919 IReferenceClock_AddRef(This->pClock);
921 LeaveCriticalSection(&This->csFilter);
926 /** IBaseFilter implementation **/
928 static HRESULT VideoRenderer_GetPin(IBaseFilter *iface, ULONG pos, IPin **pin, DWORD *lastsynctick)
930 VideoRendererImpl *This = (VideoRendererImpl *)iface;
932 /* Our pins are static, not changing so setting static tick count is ok */
938 *pin = (IPin *)This->pInputPin;
943 static HRESULT WINAPI VideoRenderer_EnumPins(IBaseFilter * iface, IEnumPins **ppEnum)
945 VideoRendererImpl *This = (VideoRendererImpl *)iface;
947 TRACE("(%p/%p)->(%p)\n", This, iface, ppEnum);
949 return IEnumPinsImpl_Construct(ppEnum, VideoRenderer_GetPin, iface);
952 static HRESULT WINAPI VideoRenderer_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin)
954 VideoRendererImpl *This = (VideoRendererImpl *)iface;
956 FIXME("(%p/%p)->(%p,%p): stub !!!\n", This, iface, debugstr_w(Id), ppPin);
958 /* FIXME: critical section */
963 static HRESULT WINAPI VideoRenderer_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo)
965 VideoRendererImpl *This = (VideoRendererImpl *)iface;
967 TRACE("(%p/%p)->(%p)\n", This, iface, pInfo);
969 strcpyW(pInfo->achName, This->filterInfo.achName);
970 pInfo->pGraph = This->filterInfo.pGraph;
973 IFilterGraph_AddRef(pInfo->pGraph);
978 static HRESULT WINAPI VideoRenderer_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName)
980 VideoRendererImpl *This = (VideoRendererImpl *)iface;
982 TRACE("(%p/%p)->(%p, %s)\n", This, iface, pGraph, debugstr_w(pName));
984 EnterCriticalSection(&This->csFilter);
987 strcpyW(This->filterInfo.achName, pName);
989 *This->filterInfo.achName = '\0';
990 This->filterInfo.pGraph = pGraph; /* NOTE: do NOT increase ref. count */
992 LeaveCriticalSection(&This->csFilter);
997 static HRESULT WINAPI VideoRenderer_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo)
999 VideoRendererImpl *This = (VideoRendererImpl *)iface;
1000 TRACE("(%p/%p)->(%p)\n", This, iface, pVendorInfo);
1004 static const IBaseFilterVtbl VideoRenderer_Vtbl =
1006 VideoRenderer_QueryInterface,
1007 VideoRenderer_AddRef,
1008 VideoRenderer_Release,
1009 VideoRenderer_GetClassID,
1011 VideoRenderer_Pause,
1013 VideoRenderer_GetState,
1014 VideoRenderer_SetSyncSource,
1015 VideoRenderer_GetSyncSource,
1016 VideoRenderer_EnumPins,
1017 VideoRenderer_FindPin,
1018 VideoRenderer_QueryFilterInfo,
1019 VideoRenderer_JoinFilterGraph,
1020 VideoRenderer_QueryVendorInfo
1023 static HRESULT WINAPI VideoRenderer_InputPin_EndOfStream(IPin * iface)
1025 InputPin* This = (InputPin*)iface;
1026 IMediaEventSink* pEventSink;
1029 TRACE("(%p/%p)->()\n", This, iface);
1031 hr = IFilterGraph_QueryInterface(((VideoRendererImpl*)This->pin.pinInfo.pFilter)->filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink);
1034 hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, 0);
1035 IMediaEventSink_Release(pEventSink);
1041 static HRESULT WINAPI VideoRenderer_InputPin_BeginFlush(IPin * iface)
1043 InputPin* This = (InputPin*)iface;
1044 VideoRendererImpl *pVideoRenderer = (VideoRendererImpl *)This->pin.pinInfo.pFilter;
1047 TRACE("(%p/%p)->()\n", This, iface);
1049 EnterCriticalSection(This->pin.pCritSec);
1050 if (pVideoRenderer->state == State_Paused)
1051 SetEvent(pVideoRenderer->blocked);
1053 hr = InputPin_BeginFlush(iface);
1054 LeaveCriticalSection(This->pin.pCritSec);
1059 static HRESULT WINAPI VideoRenderer_InputPin_EndFlush(IPin * iface)
1061 InputPin* This = (InputPin*)iface;
1062 VideoRendererImpl *pVideoRenderer = (VideoRendererImpl *)This->pin.pinInfo.pFilter;
1065 TRACE("(%p/%p)->()\n", This, iface);
1067 EnterCriticalSection(This->pin.pCritSec);
1068 if (pVideoRenderer->state == State_Paused)
1069 ResetEvent(pVideoRenderer->blocked);
1071 hr = InputPin_EndFlush(iface);
1072 LeaveCriticalSection(This->pin.pCritSec);
1077 static const IPinVtbl VideoRenderer_InputPin_Vtbl =
1079 InputPin_QueryInterface,
1083 InputPin_ReceiveConnection,
1084 IPinImpl_Disconnect,
1085 IPinImpl_ConnectedTo,
1086 IPinImpl_ConnectionMediaType,
1087 IPinImpl_QueryPinInfo,
1088 IPinImpl_QueryDirection,
1090 IPinImpl_QueryAccept,
1091 IPinImpl_EnumMediaTypes,
1092 IPinImpl_QueryInternalConnections,
1093 VideoRenderer_InputPin_EndOfStream,
1094 VideoRenderer_InputPin_BeginFlush,
1095 VideoRenderer_InputPin_EndFlush,
1099 /*** IUnknown methods ***/
1100 static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface,
1103 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1105 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1107 return VideoRenderer_QueryInterface((IBaseFilter*)This, riid, ppvObj);
1110 static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface) {
1111 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1113 TRACE("(%p/%p)->()\n", This, iface);
1115 return VideoRenderer_AddRef((IBaseFilter*)This);
1118 static ULONG WINAPI Basicvideo_Release(IBasicVideo *iface) {
1119 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1121 TRACE("(%p/%p)->()\n", This, iface);
1123 return VideoRenderer_Release((IBaseFilter*)This);
1126 /*** IDispatch methods ***/
1127 static HRESULT WINAPI Basicvideo_GetTypeInfoCount(IBasicVideo *iface,
1129 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1131 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1136 static HRESULT WINAPI Basicvideo_GetTypeInfo(IBasicVideo *iface,
1139 ITypeInfo**ppTInfo) {
1140 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1142 FIXME("(%p/%p)->(%d, %d, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1147 static HRESULT WINAPI Basicvideo_GetIDsOfNames(IBasicVideo *iface,
1153 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1155 FIXME("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1160 static HRESULT WINAPI Basicvideo_Invoke(IBasicVideo *iface,
1161 DISPID dispIdMember,
1165 DISPPARAMS*pDispParams,
1167 EXCEPINFO*pExepInfo,
1169 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1171 FIXME("(%p/%p)->(%d, %s (%p), %d, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
1176 /*** IBasicVideo methods ***/
1177 static HRESULT WINAPI Basicvideo_get_AvgTimePerFrame(IBasicVideo *iface,
1178 REFTIME *pAvgTimePerFrame) {
1180 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1182 if (!This->pInputPin->pin.pConnectedTo)
1183 return VFW_E_NOT_CONNECTED;
1185 TRACE("(%p/%p)->(%p)\n", This, iface, pAvgTimePerFrame);
1187 pmt = &This->pInputPin->pin.mtCurrent;
1188 if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) {
1189 VIDEOINFOHEADER *vih = (VIDEOINFOHEADER*)pmt->pbFormat;
1190 *pAvgTimePerFrame = vih->AvgTimePerFrame;
1191 } else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2)) {
1192 VIDEOINFOHEADER2 *vih = (VIDEOINFOHEADER2*)pmt->pbFormat;
1193 *pAvgTimePerFrame = vih->AvgTimePerFrame;
1195 ERR("Unknown format type %s\n", qzdebugstr_guid(&pmt->formattype));
1196 *pAvgTimePerFrame = 0;
1201 static HRESULT WINAPI Basicvideo_get_BitRate(IBasicVideo *iface,
1203 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1205 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pBitRate);
1210 static HRESULT WINAPI Basicvideo_get_BitErrorRate(IBasicVideo *iface,
1211 LONG *pBitErrorRate) {
1212 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1214 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pBitErrorRate);
1219 static HRESULT WINAPI Basicvideo_get_VideoWidth(IBasicVideo *iface,
1220 LONG *pVideoWidth) {
1221 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1223 TRACE("(%p/%p)->(%p)\n", This, iface, pVideoWidth);
1225 *pVideoWidth = This->VideoWidth;
1230 static HRESULT WINAPI Basicvideo_get_VideoHeight(IBasicVideo *iface,
1231 LONG *pVideoHeight) {
1232 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1234 TRACE("(%p/%p)->(%p)\n", This, iface, pVideoHeight);
1236 *pVideoHeight = This->VideoHeight;
1241 static HRESULT WINAPI Basicvideo_put_SourceLeft(IBasicVideo *iface,
1243 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1245 TRACE("(%p/%p)->(%d)\n", This, iface, SourceLeft);
1247 This->SourceRect.left = SourceLeft;
1252 static HRESULT WINAPI Basicvideo_get_SourceLeft(IBasicVideo *iface,
1253 LONG *pSourceLeft) {
1254 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1256 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceLeft);
1258 *pSourceLeft = This->SourceRect.left;
1263 static HRESULT WINAPI Basicvideo_put_SourceWidth(IBasicVideo *iface,
1265 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1267 TRACE("(%p/%p)->(%d)\n", This, iface, SourceWidth);
1269 This->SourceRect.right = This->SourceRect.left + SourceWidth;
1274 static HRESULT WINAPI Basicvideo_get_SourceWidth(IBasicVideo *iface,
1275 LONG *pSourceWidth) {
1276 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1278 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceWidth);
1280 *pSourceWidth = This->SourceRect.right - This->SourceRect.left;
1285 static HRESULT WINAPI Basicvideo_put_SourceTop(IBasicVideo *iface,
1287 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1289 TRACE("(%p/%p)->(%d)\n", This, iface, SourceTop);
1291 This->SourceRect.top = SourceTop;
1296 static HRESULT WINAPI Basicvideo_get_SourceTop(IBasicVideo *iface,
1298 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1300 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceTop);
1302 *pSourceTop = This->SourceRect.top;
1307 static HRESULT WINAPI Basicvideo_put_SourceHeight(IBasicVideo *iface,
1308 LONG SourceHeight) {
1309 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1311 TRACE("(%p/%p)->(%d)\n", This, iface, SourceHeight);
1313 This->SourceRect.bottom = This->SourceRect.top + SourceHeight;
1318 static HRESULT WINAPI Basicvideo_get_SourceHeight(IBasicVideo *iface,
1319 LONG *pSourceHeight) {
1320 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1322 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceHeight);
1324 *pSourceHeight = This->SourceRect.bottom - This->SourceRect.top;
1329 static HRESULT WINAPI Basicvideo_put_DestinationLeft(IBasicVideo *iface,
1330 LONG DestinationLeft) {
1331 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1333 TRACE("(%p/%p)->(%d)\n", This, iface, DestinationLeft);
1335 This->DestRect.left = DestinationLeft;
1340 static HRESULT WINAPI Basicvideo_get_DestinationLeft(IBasicVideo *iface,
1341 LONG *pDestinationLeft) {
1342 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1344 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationLeft);
1346 *pDestinationLeft = This->DestRect.left;
1351 static HRESULT WINAPI Basicvideo_put_DestinationWidth(IBasicVideo *iface,
1352 LONG DestinationWidth) {
1353 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1355 TRACE("(%p/%p)->(%d)\n", This, iface, DestinationWidth);
1357 This->DestRect.right = This->DestRect.left + DestinationWidth;
1362 static HRESULT WINAPI Basicvideo_get_DestinationWidth(IBasicVideo *iface,
1363 LONG *pDestinationWidth) {
1364 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1366 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationWidth);
1368 *pDestinationWidth = This->DestRect.right - This->DestRect.left;
1373 static HRESULT WINAPI Basicvideo_put_DestinationTop(IBasicVideo *iface,
1374 LONG DestinationTop) {
1375 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1377 TRACE("(%p/%p)->(%d)\n", This, iface, DestinationTop);
1379 This->DestRect.top = DestinationTop;
1384 static HRESULT WINAPI Basicvideo_get_DestinationTop(IBasicVideo *iface,
1385 LONG *pDestinationTop) {
1386 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1388 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationTop);
1390 *pDestinationTop = This->DestRect.top;
1395 static HRESULT WINAPI Basicvideo_put_DestinationHeight(IBasicVideo *iface,
1396 LONG DestinationHeight) {
1397 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1399 TRACE("(%p/%p)->(%d)\n", This, iface, DestinationHeight);
1401 This->DestRect.right = This->DestRect.left + DestinationHeight;
1406 static HRESULT WINAPI Basicvideo_get_DestinationHeight(IBasicVideo *iface,
1407 LONG *pDestinationHeight) {
1408 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1410 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationHeight);
1412 *pDestinationHeight = This->DestRect.right - This->DestRect.left;
1417 static HRESULT WINAPI Basicvideo_SetSourcePosition(IBasicVideo *iface,
1422 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1424 TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height);
1426 This->SourceRect.left = Left;
1427 This->SourceRect.top = Top;
1428 This->SourceRect.right = Left + Width;
1429 This->SourceRect.bottom = Top + Height;
1434 static HRESULT WINAPI Basicvideo_GetSourcePosition(IBasicVideo *iface,
1439 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1441 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
1443 *pLeft = This->SourceRect.left;
1444 *pTop = This->SourceRect.top;
1445 *pWidth = This->SourceRect.right - This->SourceRect.left;
1446 *pHeight = This->SourceRect.bottom - This->SourceRect.top;
1451 static HRESULT WINAPI Basicvideo_SetDefaultSourcePosition(IBasicVideo *iface) {
1452 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1454 TRACE("(%p/%p)->()\n", This, iface);
1456 This->SourceRect.left = 0;
1457 This->SourceRect.top = 0;
1458 This->SourceRect.right = This->VideoWidth;
1459 This->SourceRect.bottom = This->VideoHeight;
1464 static HRESULT WINAPI Basicvideo_SetDestinationPosition(IBasicVideo *iface,
1469 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1471 TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height);
1473 This->DestRect.left = Left;
1474 This->DestRect.top = Top;
1475 This->DestRect.right = Left + Width;
1476 This->DestRect.bottom = Top + Height;
1481 static HRESULT WINAPI Basicvideo_GetDestinationPosition(IBasicVideo *iface,
1486 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1488 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
1490 *pLeft = This->DestRect.left;
1491 *pTop = This->DestRect.top;
1492 *pWidth = This->DestRect.right - This->DestRect.left;
1493 *pHeight = This->DestRect.bottom - This->DestRect.top;
1498 static HRESULT WINAPI Basicvideo_SetDefaultDestinationPosition(IBasicVideo *iface) {
1499 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1502 TRACE("(%p/%p)->()\n", This, iface);
1504 if (!GetClientRect(This->hWnd, &rect))
1507 This->SourceRect.left = 0;
1508 This->SourceRect.top = 0;
1509 This->SourceRect.right = rect.right;
1510 This->SourceRect.bottom = rect.bottom;
1515 static HRESULT WINAPI Basicvideo_GetVideoSize(IBasicVideo *iface,
1518 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1520 TRACE("(%p/%p)->(%p, %p)\n", This, iface, pWidth, pHeight);
1522 *pWidth = This->VideoWidth;
1523 *pHeight = This->VideoHeight;
1528 static HRESULT WINAPI Basicvideo_GetVideoPaletteEntries(IBasicVideo *iface,
1533 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1535 FIXME("(%p/%p)->(%d, %d, %p, %p): stub !!!\n", This, iface, StartIndex, Entries, pRetrieved, pPalette);
1540 static HRESULT WINAPI Basicvideo_GetCurrentImage(IBasicVideo *iface,
1543 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1544 BITMAPINFOHEADER *bmiHeader;
1546 AM_MEDIA_TYPE *amt = &This->pInputPin->pin.mtCurrent;
1549 FIXME("(%p/%p)->(%p, %p): partial stub\n", This, iface, pBufferSize, pDIBImage);
1551 EnterCriticalSection(&This->csFilter);
1553 if (!This->sample_held)
1555 LeaveCriticalSection(&This->csFilter);
1556 return (This->state == State_Paused ? E_UNEXPECTED : VFW_E_NOT_PAUSED);
1559 if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo))
1561 bmiHeader = &((VIDEOINFOHEADER *)amt->pbFormat)->bmiHeader;
1563 else if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo2))
1565 bmiHeader = &((VIDEOINFOHEADER2 *)amt->pbFormat)->bmiHeader;
1569 FIXME("Unknown type %s\n", debugstr_guid(&amt->subtype));
1570 LeaveCriticalSection(&This->csFilter);
1571 return VFW_E_RUNTIME_ERROR;
1574 needed_size = bmiHeader->biSize;
1575 needed_size += IMediaSample_GetActualDataLength(This->sample_held);
1579 *pBufferSize = needed_size;
1580 LeaveCriticalSection(&This->csFilter);
1584 if (needed_size < *pBufferSize)
1586 ERR("Buffer too small %u/%u\n", needed_size, *pBufferSize);
1587 LeaveCriticalSection(&This->csFilter);
1590 *pBufferSize = needed_size;
1592 memcpy(pDIBImage, bmiHeader, bmiHeader->biSize);
1593 IMediaSample_GetPointer(This->sample_held, (BYTE **)&ptr);
1594 memcpy((char *)pDIBImage + bmiHeader->biSize, ptr, IMediaSample_GetActualDataLength(This->sample_held));
1596 LeaveCriticalSection(&This->csFilter);
1601 static HRESULT WINAPI Basicvideo_IsUsingDefaultSource(IBasicVideo *iface) {
1602 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1604 FIXME("(%p/%p)->(): stub !!!\n", This, iface);
1609 static HRESULT WINAPI Basicvideo_IsUsingDefaultDestination(IBasicVideo *iface) {
1610 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1612 FIXME("(%p/%p)->(): stub !!!\n", This, iface);
1618 static const IBasicVideoVtbl IBasicVideo_VTable =
1620 Basicvideo_QueryInterface,
1623 Basicvideo_GetTypeInfoCount,
1624 Basicvideo_GetTypeInfo,
1625 Basicvideo_GetIDsOfNames,
1627 Basicvideo_get_AvgTimePerFrame,
1628 Basicvideo_get_BitRate,
1629 Basicvideo_get_BitErrorRate,
1630 Basicvideo_get_VideoWidth,
1631 Basicvideo_get_VideoHeight,
1632 Basicvideo_put_SourceLeft,
1633 Basicvideo_get_SourceLeft,
1634 Basicvideo_put_SourceWidth,
1635 Basicvideo_get_SourceWidth,
1636 Basicvideo_put_SourceTop,
1637 Basicvideo_get_SourceTop,
1638 Basicvideo_put_SourceHeight,
1639 Basicvideo_get_SourceHeight,
1640 Basicvideo_put_DestinationLeft,
1641 Basicvideo_get_DestinationLeft,
1642 Basicvideo_put_DestinationWidth,
1643 Basicvideo_get_DestinationWidth,
1644 Basicvideo_put_DestinationTop,
1645 Basicvideo_get_DestinationTop,
1646 Basicvideo_put_DestinationHeight,
1647 Basicvideo_get_DestinationHeight,
1648 Basicvideo_SetSourcePosition,
1649 Basicvideo_GetSourcePosition,
1650 Basicvideo_SetDefaultSourcePosition,
1651 Basicvideo_SetDestinationPosition,
1652 Basicvideo_GetDestinationPosition,
1653 Basicvideo_SetDefaultDestinationPosition,
1654 Basicvideo_GetVideoSize,
1655 Basicvideo_GetVideoPaletteEntries,
1656 Basicvideo_GetCurrentImage,
1657 Basicvideo_IsUsingDefaultSource,
1658 Basicvideo_IsUsingDefaultDestination
1662 /*** IUnknown methods ***/
1663 static HRESULT WINAPI Videowindow_QueryInterface(IVideoWindow *iface,
1666 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1668 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1670 return VideoRenderer_QueryInterface((IBaseFilter*)This, riid, ppvObj);
1673 static ULONG WINAPI Videowindow_AddRef(IVideoWindow *iface) {
1674 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1676 TRACE("(%p/%p)->()\n", This, iface);
1678 return VideoRenderer_AddRef((IBaseFilter*)This);
1681 static ULONG WINAPI Videowindow_Release(IVideoWindow *iface) {
1682 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1684 TRACE("(%p/%p)->()\n", This, iface);
1686 return VideoRenderer_Release((IBaseFilter*)This);
1689 /*** IDispatch methods ***/
1690 static HRESULT WINAPI Videowindow_GetTypeInfoCount(IVideoWindow *iface,
1692 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1694 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1699 static HRESULT WINAPI Videowindow_GetTypeInfo(IVideoWindow *iface,
1702 ITypeInfo**ppTInfo) {
1703 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1705 FIXME("(%p/%p)->(%d, %d, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1710 static HRESULT WINAPI Videowindow_GetIDsOfNames(IVideoWindow *iface,
1716 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1718 FIXME("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1723 static HRESULT WINAPI Videowindow_Invoke(IVideoWindow *iface,
1724 DISPID dispIdMember,
1728 DISPPARAMS*pDispParams,
1730 EXCEPINFO*pExepInfo,
1732 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1734 FIXME("(%p/%p)->(%d, %s (%p), %d, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
1739 /*** IVideoWindow methods ***/
1740 static HRESULT WINAPI Videowindow_put_Caption(IVideoWindow *iface,
1742 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1744 TRACE("(%p/%p)->(%s (%p))\n", This, iface, debugstr_w(strCaption), strCaption);
1746 if (!SetWindowTextW(This->hWnd, strCaption))
1752 static HRESULT WINAPI Videowindow_get_Caption(IVideoWindow *iface,
1754 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1756 TRACE("(%p/%p)->(%p)\n", This, iface, strCaption);
1758 GetWindowTextW(This->hWnd, (LPWSTR)strCaption, 100);
1763 static HRESULT WINAPI Videowindow_put_WindowStyle(IVideoWindow *iface,
1765 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1768 old = GetWindowLongA(This->hWnd, GWL_STYLE);
1770 TRACE("(%p/%p)->(%x -> %x)\n", This, iface, old, WindowStyle);
1772 if (WindowStyle & (WS_DISABLED|WS_HSCROLL|WS_ICONIC|WS_MAXIMIZE|WS_MINIMIZE|WS_VSCROLL))
1773 return E_INVALIDARG;
1775 SetWindowLongA(This->hWnd, GWL_STYLE, WindowStyle);
1780 static HRESULT WINAPI Videowindow_get_WindowStyle(IVideoWindow *iface,
1781 LONG *WindowStyle) {
1782 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1784 TRACE("(%p/%p)->(%p)\n", This, iface, WindowStyle);
1786 *WindowStyle = GetWindowLongA(This->hWnd, GWL_STYLE);
1791 static HRESULT WINAPI Videowindow_put_WindowStyleEx(IVideoWindow *iface,
1792 LONG WindowStyleEx) {
1793 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1795 TRACE("(%p/%p)->(%d)\n", This, iface, WindowStyleEx);
1797 if (WindowStyleEx & (WS_DISABLED|WS_HSCROLL|WS_ICONIC|WS_MAXIMIZE|WS_MINIMIZE|WS_VSCROLL))
1798 return E_INVALIDARG;
1800 if (!SetWindowLongA(This->hWnd, GWL_EXSTYLE, WindowStyleEx))
1806 static HRESULT WINAPI Videowindow_get_WindowStyleEx(IVideoWindow *iface,
1807 LONG *WindowStyleEx) {
1808 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1810 TRACE("(%p/%p)->(%p)\n", This, iface, WindowStyleEx);
1812 *WindowStyleEx = GetWindowLongA(This->hWnd, GWL_EXSTYLE);
1817 static HRESULT WINAPI Videowindow_put_AutoShow(IVideoWindow *iface,
1819 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1821 TRACE("(%p/%p)->(%d)\n", This, iface, AutoShow);
1823 This->AutoShow = 1; /* FIXME: Should be AutoShow */;
1828 static HRESULT WINAPI Videowindow_get_AutoShow(IVideoWindow *iface,
1830 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1832 TRACE("(%p/%p)->(%p)\n", This, iface, AutoShow);
1834 *AutoShow = This->AutoShow;
1839 static HRESULT WINAPI Videowindow_put_WindowState(IVideoWindow *iface,
1841 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1843 TRACE("(%p/%p)->(%d)\n", This, iface, WindowState);
1844 ShowWindow(This->hWnd, WindowState);
1848 static HRESULT WINAPI Videowindow_get_WindowState(IVideoWindow *iface,
1849 LONG *WindowState) {
1850 WINDOWPLACEMENT place;
1851 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1853 place.length = sizeof(place);
1854 GetWindowPlacement(This->hWnd, &place);
1855 TRACE("(%p/%p)->(%p)\n", This, iface, WindowState);
1856 *WindowState = place.showCmd;
1861 static HRESULT WINAPI Videowindow_put_BackgroundPalette(IVideoWindow *iface,
1862 LONG BackgroundPalette) {
1863 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1865 FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, BackgroundPalette);
1870 static HRESULT WINAPI Videowindow_get_BackgroundPalette(IVideoWindow *iface,
1871 LONG *pBackgroundPalette) {
1872 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1874 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pBackgroundPalette);
1879 static HRESULT WINAPI Videowindow_put_Visible(IVideoWindow *iface,
1881 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1883 TRACE("(%p/%p)->(%d)\n", This, iface, Visible);
1885 ShowWindow(This->hWnd, Visible ? SW_SHOW : SW_HIDE);
1890 static HRESULT WINAPI Videowindow_get_Visible(IVideoWindow *iface,
1892 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1894 TRACE("(%p/%p)->(%p)\n", This, iface, pVisible);
1896 *pVisible = IsWindowVisible(This->hWnd);
1901 static HRESULT WINAPI Videowindow_put_Left(IVideoWindow *iface,
1903 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1905 TRACE("(%p/%p)->(%d)\n", This, iface, Left);
1907 if (!SetWindowPos(This->hWnd, NULL, Left, This->WindowPos.top, 0, 0, SWP_NOZORDER|SWP_NOSIZE))
1910 This->WindowPos.left = Left;
1915 static HRESULT WINAPI Videowindow_get_Left(IVideoWindow *iface,
1917 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1919 TRACE("(%p/%p)->(%p)\n", This, iface, pLeft);
1921 *pLeft = This->WindowPos.left;
1926 static HRESULT WINAPI Videowindow_put_Width(IVideoWindow *iface,
1928 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1930 TRACE("(%p/%p)->(%d)\n", This, iface, Width);
1932 if (!SetWindowPos(This->hWnd, NULL, 0, 0, Width, This->WindowPos.bottom-This->WindowPos.top, SWP_NOZORDER|SWP_NOMOVE))
1935 This->WindowPos.right = This->WindowPos.left + Width;
1940 static HRESULT WINAPI Videowindow_get_Width(IVideoWindow *iface,
1942 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1944 TRACE("(%p/%p)->(%p)\n", This, iface, pWidth);
1946 *pWidth = This->WindowPos.right - This->WindowPos.left;
1951 static HRESULT WINAPI Videowindow_put_Top(IVideoWindow *iface,
1953 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1955 TRACE("(%p/%p)->(%d)\n", This, iface, Top);
1957 if (!SetWindowPos(This->hWnd, NULL, This->WindowPos.left, Top, 0, 0, SWP_NOZORDER|SWP_NOSIZE))
1960 This->WindowPos.top = Top;
1965 static HRESULT WINAPI Videowindow_get_Top(IVideoWindow *iface,
1967 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1969 TRACE("(%p/%p)->(%p)\n", This, iface, pTop);
1971 *pTop = This->WindowPos.top;
1976 static HRESULT WINAPI Videowindow_put_Height(IVideoWindow *iface,
1978 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1980 TRACE("(%p/%p)->(%d)\n", This, iface, Height);
1982 if (!SetWindowPos(This->hWnd, NULL, 0, 0, This->WindowPos.right-This->WindowPos.left, Height, SWP_NOZORDER|SWP_NOMOVE))
1985 This->WindowPos.bottom = This->WindowPos.top + Height;
1990 static HRESULT WINAPI Videowindow_get_Height(IVideoWindow *iface,
1992 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1994 TRACE("(%p/%p)->(%p)\n", This, iface, pHeight);
1996 *pHeight = This->WindowPos.bottom - This->WindowPos.top;
2001 static HRESULT WINAPI Videowindow_put_Owner(IVideoWindow *iface,
2003 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2005 TRACE("(%p/%p)->(%08x)\n", This, iface, (DWORD) Owner);
2007 SetParent(This->hWnd, (HWND)Owner);
2012 static HRESULT WINAPI Videowindow_get_Owner(IVideoWindow *iface,
2014 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2016 TRACE("(%p/%p)->(%p)\n", This, iface, Owner);
2018 *(HWND*)Owner = GetParent(This->hWnd);
2023 static HRESULT WINAPI Videowindow_put_MessageDrain(IVideoWindow *iface,
2025 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2027 TRACE("(%p/%p)->(%08x)\n", This, iface, (DWORD) Drain);
2029 This->hWndMsgDrain = (HWND)Drain;
2034 static HRESULT WINAPI Videowindow_get_MessageDrain(IVideoWindow *iface,
2036 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2038 TRACE("(%p/%p)->(%p)\n", This, iface, Drain);
2040 *Drain = (OAHWND)This->hWndMsgDrain;
2045 static HRESULT WINAPI Videowindow_get_BorderColor(IVideoWindow *iface,
2047 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2049 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, Color);
2054 static HRESULT WINAPI Videowindow_put_BorderColor(IVideoWindow *iface,
2056 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2058 FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, Color);
2063 static HRESULT WINAPI Videowindow_get_FullScreenMode(IVideoWindow *iface,
2064 LONG *FullScreenMode) {
2065 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2067 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, FullScreenMode);
2072 static HRESULT WINAPI Videowindow_put_FullScreenMode(IVideoWindow *iface,
2073 LONG FullScreenMode) {
2074 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2076 FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, FullScreenMode);
2081 static HRESULT WINAPI Videowindow_SetWindowForeground(IVideoWindow *iface,
2083 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2088 TRACE("(%p/%p)->(%d)\n", This, iface, Focus);
2090 if ((Focus != FALSE) && (Focus != TRUE))
2091 return E_INVALIDARG;
2093 hr = IPin_ConnectedTo((IPin *)This->pInputPin, &pPin);
2094 if ((hr != S_OK) || !pPin)
2095 return VFW_E_NOT_CONNECTED;
2098 ret = SetForegroundWindow(This->hWnd);
2100 ret = SetWindowPos(This->hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
2108 static HRESULT WINAPI Videowindow_NotifyOwnerMessage(IVideoWindow *iface,
2113 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2115 TRACE("(%p/%p)->(%08lx, %d, %08lx, %08lx)\n", This, iface, hwnd, uMsg, wParam, lParam);
2117 if (!PostMessageA(This->hWnd, uMsg, wParam, lParam))
2123 static HRESULT WINAPI Videowindow_SetWindowPosition(IVideoWindow *iface,
2128 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2130 TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height);
2132 if (!SetWindowPos(This->hWnd, NULL, Left, Top, Width, Height, SWP_NOZORDER))
2135 This->WindowPos.left = Left;
2136 This->WindowPos.top = Top;
2137 This->WindowPos.right = Left + Width;
2138 This->WindowPos.bottom = Top + Height;
2143 static HRESULT WINAPI Videowindow_GetWindowPosition(IVideoWindow *iface,
2148 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2150 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
2152 *pLeft = This->WindowPos.left;
2153 *pTop = This->WindowPos.top;
2154 *pWidth = This->WindowPos.right - This->WindowPos.left;
2155 *pHeight = This->WindowPos.bottom - This->WindowPos.top;
2160 static HRESULT WINAPI Videowindow_GetMinIdealImageSize(IVideoWindow *iface,
2163 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2165 FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This, iface, pWidth, pHeight);
2167 *pWidth = This->VideoWidth;
2168 *pHeight = This->VideoHeight;
2173 static HRESULT WINAPI Videowindow_GetMaxIdealImageSize(IVideoWindow *iface,
2176 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2178 FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This, iface, pWidth, pHeight);
2180 *pWidth = This->VideoWidth;
2181 *pHeight = This->VideoHeight;
2186 static HRESULT WINAPI Videowindow_GetRestorePosition(IVideoWindow *iface,
2191 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2193 FIXME("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2198 static HRESULT WINAPI Videowindow_HideCursor(IVideoWindow *iface,
2200 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2202 FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, HideCursor);
2207 static HRESULT WINAPI Videowindow_IsCursorHidden(IVideoWindow *iface,
2208 LONG *CursorHidden) {
2209 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2211 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, CursorHidden);
2216 static const IVideoWindowVtbl IVideoWindow_VTable =
2218 Videowindow_QueryInterface,
2220 Videowindow_Release,
2221 Videowindow_GetTypeInfoCount,
2222 Videowindow_GetTypeInfo,
2223 Videowindow_GetIDsOfNames,
2225 Videowindow_put_Caption,
2226 Videowindow_get_Caption,
2227 Videowindow_put_WindowStyle,
2228 Videowindow_get_WindowStyle,
2229 Videowindow_put_WindowStyleEx,
2230 Videowindow_get_WindowStyleEx,
2231 Videowindow_put_AutoShow,
2232 Videowindow_get_AutoShow,
2233 Videowindow_put_WindowState,
2234 Videowindow_get_WindowState,
2235 Videowindow_put_BackgroundPalette,
2236 Videowindow_get_BackgroundPalette,
2237 Videowindow_put_Visible,
2238 Videowindow_get_Visible,
2239 Videowindow_put_Left,
2240 Videowindow_get_Left,
2241 Videowindow_put_Width,
2242 Videowindow_get_Width,
2243 Videowindow_put_Top,
2244 Videowindow_get_Top,
2245 Videowindow_put_Height,
2246 Videowindow_get_Height,
2247 Videowindow_put_Owner,
2248 Videowindow_get_Owner,
2249 Videowindow_put_MessageDrain,
2250 Videowindow_get_MessageDrain,
2251 Videowindow_get_BorderColor,
2252 Videowindow_put_BorderColor,
2253 Videowindow_get_FullScreenMode,
2254 Videowindow_put_FullScreenMode,
2255 Videowindow_SetWindowForeground,
2256 Videowindow_NotifyOwnerMessage,
2257 Videowindow_SetWindowPosition,
2258 Videowindow_GetWindowPosition,
2259 Videowindow_GetMinIdealImageSize,
2260 Videowindow_GetMaxIdealImageSize,
2261 Videowindow_GetRestorePosition,
2262 Videowindow_HideCursor,
2263 Videowindow_IsCursorHidden