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"
39 #include "wine/unicode.h"
40 #include "wine/debug.h"
42 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
44 static BOOL wnd_class_registered = FALSE;
46 static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0};
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;
53 typedef struct VideoRendererImpl
55 const IBaseFilterVtbl * lpVtbl;
56 const IBasicVideoVtbl * IBasicVideo_vtbl;
57 const IVideoWindowVtbl * IVideoWindow_vtbl;
60 CRITICAL_SECTION csFilter;
62 REFERENCE_TIME rtStreamStart;
63 IReferenceClock * pClock;
64 FILTER_INFO filterInfo;
84 static LRESULT CALLBACK VideoWndProcA(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
86 VideoRendererImpl* pVideoRenderer = (VideoRendererImpl*)GetWindowLongA(hwnd, 0);
87 LPRECT lprect = (LPRECT)lParam;
89 if (pVideoRenderer && pVideoRenderer->hWndMsgDrain)
95 case WM_LBUTTONDBLCLK:
98 case WM_MBUTTONDBLCLK:
101 case WM_MOUSEACTIVATE:
103 case WM_NCLBUTTONDBLCLK:
104 case WM_NCLBUTTONDOWN:
106 case WM_NCMBUTTONDBLCLK:
107 case WM_NCMBUTTONDOWN:
110 case WM_NCRBUTTONDBLCLK:
111 case WM_NCRBUTTONDOWN:
113 case WM_RBUTTONDBLCLK:
116 PostMessageA(pVideoRenderer->hWndMsgDrain, uMsg, wParam, lParam);
126 /* TRACE("WM_SIZING %d %d %d %d\n", lprect->left, lprect->top, lprect->right, lprect->bottom); */
127 SetWindowPos(hwnd, NULL, lprect->left, lprect->top, lprect->right - lprect->left, lprect->bottom - lprect->top, SWP_NOZORDER);
128 GetClientRect(hwnd, &pVideoRenderer->DestRect);
129 TRACE("WM_SIZING: DestRect=(%d,%d),(%d,%d)\n",
130 pVideoRenderer->DestRect.left,
131 pVideoRenderer->DestRect.top,
132 pVideoRenderer->DestRect.right - pVideoRenderer->DestRect.left,
133 pVideoRenderer->DestRect.bottom - pVideoRenderer->DestRect.top);
136 TRACE("WM_SIZE %d %d\n", LOWORD(lParam), HIWORD(lParam));
137 GetClientRect(hwnd, &pVideoRenderer->DestRect);
138 TRACE("WM_SIZING: DestRect=(%d,%d),(%d,%d)\n",
139 pVideoRenderer->DestRect.left,
140 pVideoRenderer->DestRect.top,
141 pVideoRenderer->DestRect.right - pVideoRenderer->DestRect.left,
142 pVideoRenderer->DestRect.bottom - pVideoRenderer->DestRect.top);
145 return DefWindowProcA(hwnd, uMsg, wParam, lParam);
150 static BOOL CreateRenderingWindow(VideoRendererImpl* This)
154 TRACE("(%p)->()\n", This);
157 winclass.lpfnWndProc = VideoWndProcA;
158 winclass.cbClsExtra = 0;
159 winclass.cbWndExtra = sizeof(VideoRendererImpl*);
160 winclass.hInstance = NULL;
161 winclass.hIcon = NULL;
162 winclass.hCursor = NULL;
163 winclass.hbrBackground = GetStockObject(BLACK_BRUSH);
164 winclass.lpszMenuName = NULL;
165 winclass.lpszClassName = "Wine ActiveMovie Class";
167 if (!wnd_class_registered)
169 if (!RegisterClassA(&winclass))
171 ERR("Unable to register window %u\n", GetLastError());
174 wnd_class_registered = TRUE;
177 This->hWnd = CreateWindowExA(0, "Wine ActiveMovie Class", "Wine ActiveMovie Window", WS_SIZEBOX,
178 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL,
183 ERR("Unable to create window\n");
187 SetWindowLongA(This->hWnd, 0, (LONG)This);
192 static DWORD WINAPI MessageLoop(LPVOID lpParameter)
194 VideoRendererImpl* This = (VideoRendererImpl*) lpParameter;
198 TRACE("Starting message loop\n");
200 if (!CreateRenderingWindow(This))
202 This->ThreadResult = FALSE;
203 SetEvent(This->hEvent);
207 This->ThreadResult = TRUE;
208 SetEvent(This->hEvent);
210 while ((fGotMessage = GetMessageA(&msg, NULL, 0, 0)) != 0 && fGotMessage != -1)
212 TranslateMessage(&msg);
213 DispatchMessageA(&msg);
216 TRACE("End of message loop\n");
221 static BOOL CreateRenderingSubsystem(VideoRendererImpl* This)
223 This->hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
227 This->hThread = CreateThread(NULL, 0, MessageLoop, (LPVOID)This, 0, &This->ThreadID);
230 CloseHandle(This->hEvent);
234 WaitForSingleObject(This->hEvent, INFINITE);
235 CloseHandle(This->hEvent);
237 if (!This->ThreadResult)
239 CloseHandle(This->hThread);
246 static const IMemInputPinVtbl MemInputPin_Vtbl =
248 MemInputPin_QueryInterface,
251 MemInputPin_GetAllocator,
252 MemInputPin_NotifyAllocator,
253 MemInputPin_GetAllocatorRequirements,
255 MemInputPin_ReceiveMultiple,
256 MemInputPin_ReceiveCanBlock
259 static HRESULT VideoRenderer_InputPin_Construct(const PIN_INFO * pPinInfo, SAMPLEPROC pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin)
265 if (pPinInfo->dir != PINDIR_INPUT)
267 ERR("Pin direction(%x) != PINDIR_INPUT\n", pPinInfo->dir);
271 pPinImpl = CoTaskMemAlloc(sizeof(*pPinImpl));
274 return E_OUTOFMEMORY;
276 if (SUCCEEDED(InputPin_Init(pPinInfo, pSampleProc, pUserData, pQueryAccept, pCritSec, pPinImpl)))
278 pPinImpl->pin.lpVtbl = &VideoRenderer_InputPin_Vtbl;
279 pPinImpl->lpVtblMemInput = &MemInputPin_Vtbl;
281 *ppPin = (IPin *)(&pPinImpl->pin.lpVtbl);
285 CoTaskMemFree(pPinImpl);
289 static DWORD VideoRenderer_SendSampleData(VideoRendererImpl* This, LPBYTE data, DWORD size)
291 VIDEOINFOHEADER* format;
297 LPBYTE palette = NULL;
300 TRACE("%p %p %d\n", This, data, size);
302 sdesc.dwSize = sizeof(sdesc);
303 hr = IPin_ConnectionMediaType(This->ppPins[0], &amt);
305 ERR("Unable to retrieve media type\n");
308 format = (VIDEOINFOHEADER*)amt.pbFormat;
310 TRACE("biSize = %d\n", format->bmiHeader.biSize);
311 TRACE("biWidth = %d\n", format->bmiHeader.biWidth);
312 TRACE("biHeight = %d\n", format->bmiHeader.biHeight);
313 TRACE("biPlanes = %d\n", format->bmiHeader.biPlanes);
314 TRACE("biBitCount = %d\n", format->bmiHeader.biBitCount);
315 TRACE("biCompression = %s\n", debugstr_an((LPSTR)&(format->bmiHeader.biCompression), 4));
316 TRACE("biSizeImage = %d\n", format->bmiHeader.biSizeImage);
318 width = format->bmiHeader.biWidth;
319 height = format->bmiHeader.biHeight;
320 palette = ((LPBYTE)&format->bmiHeader) + format->bmiHeader.biSize;
324 /* Honor previously set WindowPos */
325 TRACE("WindowPos: %d %d %d %d\n", This->WindowPos.left, This->WindowPos.top, This->WindowPos.right, This->WindowPos.bottom);
326 SetWindowPos(This->hWnd, NULL,
327 This->WindowPos.left,
329 This->WindowPos.right - This->WindowPos.left,
330 This->WindowPos.bottom - This->WindowPos.top,
331 SWP_NOZORDER|SWP_NOMOVE);
332 GetClientRect(This->hWnd, &This->DestRect);
336 hDC = GetDC(This->hWnd);
339 ERR("Cannot get DC from window!\n");
343 TRACE("Src Rect: %d %d %d %d\n", This->SourceRect.left, This->SourceRect.top, This->SourceRect.right, This->SourceRect.bottom);
344 TRACE("Dst Rect: %d %d %d %d\n", This->DestRect.left, This->DestRect.top, This->DestRect.right, This->DestRect.bottom);
346 StretchDIBits(hDC, This->DestRect.left, This->DestRect.top, This->DestRect.right -This->DestRect.left,
347 This->DestRect.bottom - This->DestRect.top, This->SourceRect.left, This->SourceRect.top,
348 This->SourceRect.right - This->SourceRect.left, This->SourceRect.bottom - This->SourceRect.top,
349 data, (BITMAPINFO*)&format->bmiHeader, DIB_RGB_COLORS, SRCCOPY);
351 ReleaseDC(This->hWnd, hDC);
354 ShowWindow(This->hWnd, SW_SHOW);
359 static HRESULT VideoRenderer_Sample(LPVOID iface, IMediaSample * pSample)
361 VideoRendererImpl *This = (VideoRendererImpl *)iface;
362 LPBYTE pbSrcStream = NULL;
363 long cbSrcStream = 0;
364 REFERENCE_TIME tStart, tStop;
367 TRACE("%p %p\n", iface, pSample);
369 hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
372 ERR("Cannot get pointer to sample data (%x)\n", hr);
376 hr = IMediaSample_GetTime(pSample, &tStart, &tStop);
378 ERR("Cannot get sample time (%x)\n", hr);
380 cbSrcStream = IMediaSample_GetActualDataLength(pSample);
382 TRACE("val %p %ld\n", pbSrcStream, cbSrcStream);
384 #if 0 /* For debugging purpose */
387 for(i = 0; i < cbSrcStream; i++)
389 if ((i!=0) && !(i%16))
391 TRACE("%02x ", pbSrcStream[i]);
397 VideoRenderer_SendSampleData(This, pbSrcStream, cbSrcStream);
402 static HRESULT VideoRenderer_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt)
404 if (!IsEqualIID(&pmt->majortype, &MEDIATYPE_Video))
407 if (IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB32) ||
408 IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB24) ||
409 IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB565) ||
410 IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB8))
412 VideoRendererImpl* This = (VideoRendererImpl*) iface;
413 VIDEOINFOHEADER* format = (VIDEOINFOHEADER*)pmt->pbFormat;
415 if (!IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo))
417 WARN("Format type %s not supported\n", debugstr_guid(&pmt->formattype));
420 This->SourceRect.left = 0;
421 This->SourceRect.top = 0;
422 This->SourceRect.right = This->VideoWidth = format->bmiHeader.biWidth;
423 This->SourceRect.bottom = This->VideoHeight = format->bmiHeader.biHeight;
429 HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv)
433 VideoRendererImpl * pVideoRenderer;
435 TRACE("(%p, %p)\n", pUnkOuter, ppv);
440 return CLASS_E_NOAGGREGATION;
442 pVideoRenderer = CoTaskMemAlloc(sizeof(VideoRendererImpl));
444 pVideoRenderer->lpVtbl = &VideoRenderer_Vtbl;
445 pVideoRenderer->IBasicVideo_vtbl = &IBasicVideo_VTable;
446 pVideoRenderer->IVideoWindow_vtbl = &IVideoWindow_VTable;
448 pVideoRenderer->refCount = 1;
449 InitializeCriticalSection(&pVideoRenderer->csFilter);
450 pVideoRenderer->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": VideoRendererImpl.csFilter");
451 pVideoRenderer->state = State_Stopped;
452 pVideoRenderer->pClock = NULL;
453 pVideoRenderer->init = 0;
454 pVideoRenderer->AutoShow = 1;
455 ZeroMemory(&pVideoRenderer->filterInfo, sizeof(FILTER_INFO));
457 pVideoRenderer->ppPins = CoTaskMemAlloc(1 * sizeof(IPin *));
459 /* construct input pin */
460 piInput.dir = PINDIR_INPUT;
461 piInput.pFilter = (IBaseFilter *)pVideoRenderer;
462 lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0]));
464 hr = VideoRenderer_InputPin_Construct(&piInput, VideoRenderer_Sample, (LPVOID)pVideoRenderer, VideoRenderer_QueryAccept, &pVideoRenderer->csFilter, (IPin **)&pVideoRenderer->pInputPin);
468 pVideoRenderer->ppPins[0] = (IPin *)pVideoRenderer->pInputPin;
469 *ppv = (LPVOID)pVideoRenderer;
473 CoTaskMemFree(pVideoRenderer->ppPins);
474 pVideoRenderer->csFilter.DebugInfo->Spare[0] = 0;
475 DeleteCriticalSection(&pVideoRenderer->csFilter);
476 CoTaskMemFree(pVideoRenderer);
479 if (!CreateRenderingSubsystem(pVideoRenderer))
485 static HRESULT WINAPI VideoRenderer_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv)
487 VideoRendererImpl *This = (VideoRendererImpl *)iface;
488 TRACE("(%p/%p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv);
492 if (IsEqualIID(riid, &IID_IUnknown))
494 else if (IsEqualIID(riid, &IID_IPersist))
496 else if (IsEqualIID(riid, &IID_IMediaFilter))
498 else if (IsEqualIID(riid, &IID_IBaseFilter))
500 else if (IsEqualIID(riid, &IID_IBasicVideo))
501 *ppv = (LPVOID)&(This->IBasicVideo_vtbl);
502 else if (IsEqualIID(riid, &IID_IVideoWindow))
503 *ppv = (LPVOID)&(This->IVideoWindow_vtbl);
507 IUnknown_AddRef((IUnknown *)(*ppv));
511 FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
513 return E_NOINTERFACE;
516 static ULONG WINAPI VideoRenderer_AddRef(IBaseFilter * iface)
518 VideoRendererImpl *This = (VideoRendererImpl *)iface;
519 ULONG refCount = InterlockedIncrement(&This->refCount);
521 TRACE("(%p/%p)->() AddRef from %d\n", This, iface, refCount - 1);
526 static ULONG WINAPI VideoRenderer_Release(IBaseFilter * iface)
528 VideoRendererImpl *This = (VideoRendererImpl *)iface;
529 ULONG refCount = InterlockedDecrement(&This->refCount);
531 TRACE("(%p/%p)->() Release from %d\n", This, iface, refCount + 1);
537 DestroyWindow(This->hWnd);
538 PostThreadMessageA(This->ThreadID, WM_QUIT, 0, 0);
539 WaitForSingleObject(This->hThread, INFINITE);
540 CloseHandle(This->hThread);
543 IReferenceClock_Release(This->pClock);
545 if (SUCCEEDED(IPin_ConnectedTo(This->ppPins[0], &pConnectedTo)))
547 IPin_Disconnect(pConnectedTo);
548 IPin_Release(pConnectedTo);
550 IPin_Disconnect(This->ppPins[0]);
552 IPin_Release(This->ppPins[0]);
554 CoTaskMemFree(This->ppPins);
557 This->csFilter.DebugInfo->Spare[0] = 0;
558 DeleteCriticalSection(&This->csFilter);
560 TRACE("Destroying Video Renderer\n");
569 /** IPersist methods **/
571 static HRESULT WINAPI VideoRenderer_GetClassID(IBaseFilter * iface, CLSID * pClsid)
573 VideoRendererImpl *This = (VideoRendererImpl *)iface;
575 TRACE("(%p/%p)->(%p)\n", This, iface, pClsid);
577 *pClsid = CLSID_VideoRenderer;
582 /** IMediaFilter methods **/
584 static HRESULT WINAPI VideoRenderer_Stop(IBaseFilter * iface)
586 VideoRendererImpl *This = (VideoRendererImpl *)iface;
588 TRACE("(%p/%p)->()\n", This, iface);
590 EnterCriticalSection(&This->csFilter);
592 This->state = State_Stopped;
594 LeaveCriticalSection(&This->csFilter);
599 static HRESULT WINAPI VideoRenderer_Pause(IBaseFilter * iface)
601 VideoRendererImpl *This = (VideoRendererImpl *)iface;
603 TRACE("(%p/%p)->()\n", This, iface);
605 EnterCriticalSection(&This->csFilter);
607 This->state = State_Paused;
609 LeaveCriticalSection(&This->csFilter);
614 static HRESULT WINAPI VideoRenderer_Run(IBaseFilter * iface, REFERENCE_TIME tStart)
616 VideoRendererImpl *This = (VideoRendererImpl *)iface;
618 TRACE("(%p/%p)->(%s)\n", This, iface, wine_dbgstr_longlong(tStart));
620 EnterCriticalSection(&This->csFilter);
622 This->rtStreamStart = tStart;
623 This->state = State_Running;
625 LeaveCriticalSection(&This->csFilter);
630 static HRESULT WINAPI VideoRenderer_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
632 VideoRendererImpl *This = (VideoRendererImpl *)iface;
634 TRACE("(%p/%p)->(%d, %p)\n", This, iface, dwMilliSecsTimeout, pState);
636 EnterCriticalSection(&This->csFilter);
638 *pState = This->state;
640 LeaveCriticalSection(&This->csFilter);
645 static HRESULT WINAPI VideoRenderer_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock)
647 VideoRendererImpl *This = (VideoRendererImpl *)iface;
649 TRACE("(%p/%p)->(%p)\n", This, iface, pClock);
651 EnterCriticalSection(&This->csFilter);
654 IReferenceClock_Release(This->pClock);
655 This->pClock = pClock;
657 IReferenceClock_AddRef(This->pClock);
659 LeaveCriticalSection(&This->csFilter);
664 static HRESULT WINAPI VideoRenderer_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock)
666 VideoRendererImpl *This = (VideoRendererImpl *)iface;
668 TRACE("(%p/%p)->(%p)\n", This, iface, ppClock);
670 EnterCriticalSection(&This->csFilter);
672 *ppClock = This->pClock;
673 IReferenceClock_AddRef(This->pClock);
675 LeaveCriticalSection(&This->csFilter);
680 /** IBaseFilter implementation **/
682 static HRESULT WINAPI VideoRenderer_EnumPins(IBaseFilter * iface, IEnumPins **ppEnum)
685 VideoRendererImpl *This = (VideoRendererImpl *)iface;
687 TRACE("(%p/%p)->(%p)\n", This, iface, ppEnum);
689 epd.cPins = 1; /* input pin */
690 epd.ppPins = This->ppPins;
691 return IEnumPinsImpl_Construct(&epd, ppEnum);
694 static HRESULT WINAPI VideoRenderer_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin)
696 VideoRendererImpl *This = (VideoRendererImpl *)iface;
698 TRACE("(%p/%p)->(%p,%p)\n", This, iface, debugstr_w(Id), ppPin);
700 FIXME("VideoRenderer::FindPin(...)\n");
702 /* FIXME: critical section */
707 static HRESULT WINAPI VideoRenderer_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo)
709 VideoRendererImpl *This = (VideoRendererImpl *)iface;
711 TRACE("(%p/%p)->(%p)\n", This, iface, pInfo);
713 strcpyW(pInfo->achName, This->filterInfo.achName);
714 pInfo->pGraph = This->filterInfo.pGraph;
717 IFilterGraph_AddRef(pInfo->pGraph);
722 static HRESULT WINAPI VideoRenderer_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName)
724 VideoRendererImpl *This = (VideoRendererImpl *)iface;
726 TRACE("(%p/%p)->(%p, %s)\n", This, iface, pGraph, debugstr_w(pName));
728 EnterCriticalSection(&This->csFilter);
731 strcpyW(This->filterInfo.achName, pName);
733 *This->filterInfo.achName = '\0';
734 This->filterInfo.pGraph = pGraph; /* NOTE: do NOT increase ref. count */
736 LeaveCriticalSection(&This->csFilter);
741 static HRESULT WINAPI VideoRenderer_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo)
743 VideoRendererImpl *This = (VideoRendererImpl *)iface;
744 TRACE("(%p/%p)->(%p)\n", This, iface, pVendorInfo);
748 static const IBaseFilterVtbl VideoRenderer_Vtbl =
750 VideoRenderer_QueryInterface,
751 VideoRenderer_AddRef,
752 VideoRenderer_Release,
753 VideoRenderer_GetClassID,
757 VideoRenderer_GetState,
758 VideoRenderer_SetSyncSource,
759 VideoRenderer_GetSyncSource,
760 VideoRenderer_EnumPins,
761 VideoRenderer_FindPin,
762 VideoRenderer_QueryFilterInfo,
763 VideoRenderer_JoinFilterGraph,
764 VideoRenderer_QueryVendorInfo
767 static HRESULT WINAPI VideoRenderer_InputPin_EndOfStream(IPin * iface)
769 InputPin* This = (InputPin*)iface;
770 IMediaEventSink* pEventSink;
773 TRACE("(%p/%p)->()\n", This, iface);
775 hr = IFilterGraph_QueryInterface(((VideoRendererImpl*)This->pin.pinInfo.pFilter)->filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink);
778 hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, 0);
779 IMediaEventSink_Release(pEventSink);
785 static const IPinVtbl VideoRenderer_InputPin_Vtbl =
787 InputPin_QueryInterface,
791 InputPin_ReceiveConnection,
793 IPinImpl_ConnectedTo,
794 IPinImpl_ConnectionMediaType,
795 IPinImpl_QueryPinInfo,
796 IPinImpl_QueryDirection,
798 IPinImpl_QueryAccept,
799 IPinImpl_EnumMediaTypes,
800 IPinImpl_QueryInternalConnections,
801 VideoRenderer_InputPin_EndOfStream,
807 /*** IUnknown methods ***/
808 static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface,
811 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
813 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
815 return VideoRenderer_QueryInterface((IBaseFilter*)This, riid, ppvObj);
818 static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface) {
819 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
821 TRACE("(%p/%p)->()\n", This, iface);
823 return VideoRenderer_AddRef((IBaseFilter*)This);
826 static ULONG WINAPI Basicvideo_Release(IBasicVideo *iface) {
827 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
829 TRACE("(%p/%p)->()\n", This, iface);
831 return VideoRenderer_Release((IBaseFilter*)This);
834 /*** IDispatch methods ***/
835 static HRESULT WINAPI Basicvideo_GetTypeInfoCount(IBasicVideo *iface,
837 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
839 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
844 static HRESULT WINAPI Basicvideo_GetTypeInfo(IBasicVideo *iface,
847 ITypeInfo**ppTInfo) {
848 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
850 FIXME("(%p/%p)->(%d, %d, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
855 static HRESULT WINAPI Basicvideo_GetIDsOfNames(IBasicVideo *iface,
861 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
863 FIXME("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
868 static HRESULT WINAPI Basicvideo_Invoke(IBasicVideo *iface,
873 DISPPARAMS*pDispParams,
877 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
879 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);
884 /*** IBasicVideo methods ***/
885 static HRESULT WINAPI Basicvideo_get_AvgTimePerFrame(IBasicVideo *iface,
886 REFTIME *pAvgTimePerFrame) {
887 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
889 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pAvgTimePerFrame);
894 static HRESULT WINAPI Basicvideo_get_BitRate(IBasicVideo *iface,
896 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
898 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pBitRate);
903 static HRESULT WINAPI Basicvideo_get_BitErrorRate(IBasicVideo *iface,
904 long *pBitErrorRate) {
905 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
907 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pBitErrorRate);
912 static HRESULT WINAPI Basicvideo_get_VideoWidth(IBasicVideo *iface,
914 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
916 TRACE("(%p/%p)->(%p)\n", This, iface, pVideoWidth);
918 *pVideoWidth = This->VideoWidth;
923 static HRESULT WINAPI Basicvideo_get_VideoHeight(IBasicVideo *iface,
924 long *pVideoHeight) {
925 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
927 TRACE("(%p/%p)->(%p)\n", This, iface, pVideoHeight);
929 *pVideoHeight = This->VideoHeight;
934 static HRESULT WINAPI Basicvideo_put_SourceLeft(IBasicVideo *iface,
936 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
938 TRACE("(%p/%p)->(%ld)\n", This, iface, SourceLeft);
940 This->SourceRect.left = SourceLeft;
945 static HRESULT WINAPI Basicvideo_get_SourceLeft(IBasicVideo *iface,
947 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
949 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceLeft);
951 *pSourceLeft = This->SourceRect.left;
956 static HRESULT WINAPI Basicvideo_put_SourceWidth(IBasicVideo *iface,
958 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
960 TRACE("(%p/%p)->(%ld)\n", This, iface, SourceWidth);
962 This->SourceRect.right = This->SourceRect.left + SourceWidth;
967 static HRESULT WINAPI Basicvideo_get_SourceWidth(IBasicVideo *iface,
968 long *pSourceWidth) {
969 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
971 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceWidth);
973 *pSourceWidth = This->SourceRect.right - This->SourceRect.left;
978 static HRESULT WINAPI Basicvideo_put_SourceTop(IBasicVideo *iface,
980 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
982 TRACE("(%p/%p)->(%ld)\n", This, iface, SourceTop);
984 This->SourceRect.top = SourceTop;
989 static HRESULT WINAPI Basicvideo_get_SourceTop(IBasicVideo *iface,
991 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
993 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceTop);
995 *pSourceTop = This->SourceRect.top;
1000 static HRESULT WINAPI Basicvideo_put_SourceHeight(IBasicVideo *iface,
1001 long SourceHeight) {
1002 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1004 TRACE("(%p/%p)->(%ld)\n", This, iface, SourceHeight);
1006 This->SourceRect.bottom = This->SourceRect.top + SourceHeight;
1011 static HRESULT WINAPI Basicvideo_get_SourceHeight(IBasicVideo *iface,
1012 long *pSourceHeight) {
1013 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1015 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceHeight);
1017 *pSourceHeight = This->SourceRect.bottom - This->SourceRect.top;
1022 static HRESULT WINAPI Basicvideo_put_DestinationLeft(IBasicVideo *iface,
1023 long DestinationLeft) {
1024 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1026 TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationLeft);
1028 This->DestRect.left = DestinationLeft;
1033 static HRESULT WINAPI Basicvideo_get_DestinationLeft(IBasicVideo *iface,
1034 long *pDestinationLeft) {
1035 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1037 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationLeft);
1039 *pDestinationLeft = This->DestRect.left;
1044 static HRESULT WINAPI Basicvideo_put_DestinationWidth(IBasicVideo *iface,
1045 long DestinationWidth) {
1046 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1048 TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationWidth);
1050 This->DestRect.right = This->DestRect.left + DestinationWidth;
1055 static HRESULT WINAPI Basicvideo_get_DestinationWidth(IBasicVideo *iface,
1056 long *pDestinationWidth) {
1057 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1059 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationWidth);
1061 *pDestinationWidth = This->DestRect.right - This->DestRect.left;
1066 static HRESULT WINAPI Basicvideo_put_DestinationTop(IBasicVideo *iface,
1067 long DestinationTop) {
1068 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1070 TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationTop);
1072 This->DestRect.top = DestinationTop;
1077 static HRESULT WINAPI Basicvideo_get_DestinationTop(IBasicVideo *iface,
1078 long *pDestinationTop) {
1079 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1081 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationTop);
1083 *pDestinationTop = This->DestRect.top;
1088 static HRESULT WINAPI Basicvideo_put_DestinationHeight(IBasicVideo *iface,
1089 long DestinationHeight) {
1090 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1092 TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationHeight);
1094 This->DestRect.right = This->DestRect.left + DestinationHeight;
1099 static HRESULT WINAPI Basicvideo_get_DestinationHeight(IBasicVideo *iface,
1100 long *pDestinationHeight) {
1101 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1103 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationHeight);
1105 *pDestinationHeight = This->DestRect.right - This->DestRect.left;
1110 static HRESULT WINAPI Basicvideo_SetSourcePosition(IBasicVideo *iface,
1115 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1117 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This, iface, Left, Top, Width, Height);
1119 This->SourceRect.left = Left;
1120 This->SourceRect.top = Top;
1121 This->SourceRect.right = Left + Width;
1122 This->SourceRect.bottom = Top + Height;
1127 static HRESULT WINAPI Basicvideo_GetSourcePosition(IBasicVideo *iface,
1132 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1134 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
1136 *pLeft = This->SourceRect.left;
1137 *pTop = This->SourceRect.top;
1138 *pWidth = This->SourceRect.right - This->SourceRect.left;
1139 *pHeight = This->SourceRect.bottom - This->SourceRect.top;
1144 static HRESULT WINAPI Basicvideo_SetDefaultSourcePosition(IBasicVideo *iface) {
1145 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1147 TRACE("(%p/%p)->()\n", This, iface);
1149 This->SourceRect.left = 0;
1150 This->SourceRect.top = 0;
1151 This->SourceRect.right = This->VideoWidth;
1152 This->SourceRect.bottom = This->VideoHeight;
1157 static HRESULT WINAPI Basicvideo_SetDestinationPosition(IBasicVideo *iface,
1162 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1164 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This, iface, Left, Top, Width, Height);
1166 This->DestRect.left = Left;
1167 This->DestRect.top = Top;
1168 This->DestRect.right = Left + Width;
1169 This->DestRect.bottom = Top + Height;
1174 static HRESULT WINAPI Basicvideo_GetDestinationPosition(IBasicVideo *iface,
1179 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1181 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
1183 *pLeft = This->DestRect.left;
1184 *pTop = This->DestRect.top;
1185 *pWidth = This->DestRect.right - This->DestRect.left;
1186 *pHeight = This->DestRect.bottom - This->DestRect.top;
1191 static HRESULT WINAPI Basicvideo_SetDefaultDestinationPosition(IBasicVideo *iface) {
1192 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1195 TRACE("(%p/%p)->()\n", This, iface);
1197 if (!GetClientRect(This->hWnd, &rect))
1200 This->SourceRect.left = 0;
1201 This->SourceRect.top = 0;
1202 This->SourceRect.right = rect.right;
1203 This->SourceRect.bottom = rect.bottom;
1208 static HRESULT WINAPI Basicvideo_GetVideoSize(IBasicVideo *iface,
1211 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1213 TRACE("(%p/%p)->(%p, %p)\n", This, iface, pWidth, pHeight);
1215 *pWidth = This->VideoWidth;
1216 *pHeight = This->VideoHeight;
1221 static HRESULT WINAPI Basicvideo_GetVideoPaletteEntries(IBasicVideo *iface,
1226 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1228 FIXME("(%p/%p)->(%ld, %ld, %p, %p): stub !!!\n", This, iface, StartIndex, Entries, pRetrieved, pPalette);
1233 static HRESULT WINAPI Basicvideo_GetCurrentImage(IBasicVideo *iface,
1236 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1238 FIXME("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pBufferSize, pDIBImage);
1243 static HRESULT WINAPI Basicvideo_IsUsingDefaultSource(IBasicVideo *iface) {
1244 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1246 FIXME("(%p/%p)->(): stub !!!\n", This, iface);
1251 static HRESULT WINAPI Basicvideo_IsUsingDefaultDestination(IBasicVideo *iface) {
1252 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1254 FIXME("(%p/%p)->(): stub !!!\n", This, iface);
1260 static const IBasicVideoVtbl IBasicVideo_VTable =
1262 Basicvideo_QueryInterface,
1265 Basicvideo_GetTypeInfoCount,
1266 Basicvideo_GetTypeInfo,
1267 Basicvideo_GetIDsOfNames,
1269 Basicvideo_get_AvgTimePerFrame,
1270 Basicvideo_get_BitRate,
1271 Basicvideo_get_BitErrorRate,
1272 Basicvideo_get_VideoWidth,
1273 Basicvideo_get_VideoHeight,
1274 Basicvideo_put_SourceLeft,
1275 Basicvideo_get_SourceLeft,
1276 Basicvideo_put_SourceWidth,
1277 Basicvideo_get_SourceWidth,
1278 Basicvideo_put_SourceTop,
1279 Basicvideo_get_SourceTop,
1280 Basicvideo_put_SourceHeight,
1281 Basicvideo_get_SourceHeight,
1282 Basicvideo_put_DestinationLeft,
1283 Basicvideo_get_DestinationLeft,
1284 Basicvideo_put_DestinationWidth,
1285 Basicvideo_get_DestinationWidth,
1286 Basicvideo_put_DestinationTop,
1287 Basicvideo_get_DestinationTop,
1288 Basicvideo_put_DestinationHeight,
1289 Basicvideo_get_DestinationHeight,
1290 Basicvideo_SetSourcePosition,
1291 Basicvideo_GetSourcePosition,
1292 Basicvideo_SetDefaultSourcePosition,
1293 Basicvideo_SetDestinationPosition,
1294 Basicvideo_GetDestinationPosition,
1295 Basicvideo_SetDefaultDestinationPosition,
1296 Basicvideo_GetVideoSize,
1297 Basicvideo_GetVideoPaletteEntries,
1298 Basicvideo_GetCurrentImage,
1299 Basicvideo_IsUsingDefaultSource,
1300 Basicvideo_IsUsingDefaultDestination
1304 /*** IUnknown methods ***/
1305 static HRESULT WINAPI Videowindow_QueryInterface(IVideoWindow *iface,
1308 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1310 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1312 return VideoRenderer_QueryInterface((IBaseFilter*)This, riid, ppvObj);
1315 static ULONG WINAPI Videowindow_AddRef(IVideoWindow *iface) {
1316 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1318 TRACE("(%p/%p)->()\n", This, iface);
1320 return VideoRenderer_AddRef((IBaseFilter*)This);
1323 static ULONG WINAPI Videowindow_Release(IVideoWindow *iface) {
1324 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1326 TRACE("(%p/%p)->()\n", This, iface);
1328 return VideoRenderer_Release((IBaseFilter*)This);
1331 /*** IDispatch methods ***/
1332 static HRESULT WINAPI Videowindow_GetTypeInfoCount(IVideoWindow *iface,
1334 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1336 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1341 static HRESULT WINAPI Videowindow_GetTypeInfo(IVideoWindow *iface,
1344 ITypeInfo**ppTInfo) {
1345 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1347 FIXME("(%p/%p)->(%d, %d, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1352 static HRESULT WINAPI Videowindow_GetIDsOfNames(IVideoWindow *iface,
1358 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1360 FIXME("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1365 static HRESULT WINAPI Videowindow_Invoke(IVideoWindow *iface,
1366 DISPID dispIdMember,
1370 DISPPARAMS*pDispParams,
1372 EXCEPINFO*pExepInfo,
1374 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1376 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);
1381 /*** IVideoWindow methods ***/
1382 static HRESULT WINAPI Videowindow_put_Caption(IVideoWindow *iface,
1384 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1386 TRACE("(%p/%p)->(%s (%p))\n", This, iface, debugstr_w(strCaption), strCaption);
1388 if (!SetWindowTextW(This->hWnd, strCaption))
1394 static HRESULT WINAPI Videowindow_get_Caption(IVideoWindow *iface,
1396 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1398 TRACE("(%p/%p)->(%p)\n", This, iface, strCaption);
1400 GetWindowTextW(This->hWnd, (LPWSTR)strCaption, 100);
1405 static HRESULT WINAPI Videowindow_put_WindowStyle(IVideoWindow *iface,
1407 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1410 old = GetWindowLongA(This->hWnd, GWL_STYLE);
1412 TRACE("(%p/%p)->(%x -> %lx)\n", This, iface, old, WindowStyle);
1414 if (WindowStyle & (WS_DISABLED|WS_HSCROLL|WS_ICONIC|WS_MAXIMIZE|WS_MINIMIZE|WS_VSCROLL))
1415 return E_INVALIDARG;
1417 SetWindowLongA(This->hWnd, GWL_STYLE, WindowStyle);
1422 static HRESULT WINAPI Videowindow_get_WindowStyle(IVideoWindow *iface,
1423 long *WindowStyle) {
1424 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1426 TRACE("(%p/%p)->(%p)\n", This, iface, WindowStyle);
1428 *WindowStyle = GetWindowLongA(This->hWnd, GWL_STYLE);
1433 static HRESULT WINAPI Videowindow_put_WindowStyleEx(IVideoWindow *iface,
1434 long WindowStyleEx) {
1435 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1437 TRACE("(%p/%p)->(%ld)\n", This, iface, WindowStyleEx);
1439 if (WindowStyleEx & (WS_DISABLED|WS_HSCROLL|WS_ICONIC|WS_MAXIMIZE|WS_MINIMIZE|WS_VSCROLL))
1440 return E_INVALIDARG;
1442 if (!SetWindowLongA(This->hWnd, GWL_EXSTYLE, WindowStyleEx))
1448 static HRESULT WINAPI Videowindow_get_WindowStyleEx(IVideoWindow *iface,
1449 long *WindowStyleEx) {
1450 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1452 TRACE("(%p/%p)->(%p)\n", This, iface, WindowStyleEx);
1454 *WindowStyleEx = GetWindowLongA(This->hWnd, GWL_EXSTYLE);
1459 static HRESULT WINAPI Videowindow_put_AutoShow(IVideoWindow *iface,
1461 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1463 TRACE("(%p/%p)->(%ld)\n", This, iface, AutoShow);
1465 This->AutoShow = 1; /* FXIME: Should be AutoShow */;
1470 static HRESULT WINAPI Videowindow_get_AutoShow(IVideoWindow *iface,
1472 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1474 TRACE("(%p/%p)->(%p)\n", This, iface, AutoShow);
1476 *AutoShow = This->AutoShow;
1481 static HRESULT WINAPI Videowindow_put_WindowState(IVideoWindow *iface,
1483 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1485 FIXME("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowState);
1490 static HRESULT WINAPI Videowindow_get_WindowState(IVideoWindow *iface,
1491 long *WindowState) {
1492 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1494 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, WindowState);
1499 static HRESULT WINAPI Videowindow_put_BackgroundPalette(IVideoWindow *iface,
1500 long BackgroundPalette) {
1501 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1503 FIXME("(%p/%p)->(%ld): stub !!!\n", This, iface, BackgroundPalette);
1508 static HRESULT WINAPI Videowindow_get_BackgroundPalette(IVideoWindow *iface,
1509 long *pBackgroundPalette) {
1510 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1512 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pBackgroundPalette);
1517 static HRESULT WINAPI Videowindow_put_Visible(IVideoWindow *iface,
1519 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1521 TRACE("(%p/%p)->(%ld)\n", This, iface, Visible);
1523 ShowWindow(This->hWnd, Visible ? SW_SHOW : SW_HIDE);
1528 static HRESULT WINAPI Videowindow_get_Visible(IVideoWindow *iface,
1530 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1532 TRACE("(%p/%p)->(%p)\n", This, iface, pVisible);
1534 *pVisible = IsWindowVisible(This->hWnd);
1539 static HRESULT WINAPI Videowindow_put_Left(IVideoWindow *iface,
1541 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1543 TRACE("(%p/%p)->(%ld)\n", This, iface, Left);
1545 if (!SetWindowPos(This->hWnd, NULL, Left, This->WindowPos.top, 0, 0, SWP_NOZORDER|SWP_NOSIZE))
1548 This->WindowPos.left = Left;
1553 static HRESULT WINAPI Videowindow_get_Left(IVideoWindow *iface,
1555 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1557 TRACE("(%p/%p)->(%p)\n", This, iface, pLeft);
1559 *pLeft = This->WindowPos.left;
1564 static HRESULT WINAPI Videowindow_put_Width(IVideoWindow *iface,
1566 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1568 TRACE("(%p/%p)->(%ld)\n", This, iface, Width);
1570 if (!SetWindowPos(This->hWnd, NULL, 0, 0, Width, This->WindowPos.bottom-This->WindowPos.top, SWP_NOZORDER|SWP_NOMOVE))
1573 This->WindowPos.right = This->WindowPos.left + Width;
1578 static HRESULT WINAPI Videowindow_get_Width(IVideoWindow *iface,
1580 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1582 TRACE("(%p/%p)->(%p)\n", This, iface, pWidth);
1584 *pWidth = This->WindowPos.right - This->WindowPos.left;
1589 static HRESULT WINAPI Videowindow_put_Top(IVideoWindow *iface,
1591 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1593 TRACE("(%p/%p)->(%ld)\n", This, iface, Top);
1595 if (!SetWindowPos(This->hWnd, NULL, This->WindowPos.left, Top, 0, 0, SWP_NOZORDER|SWP_NOSIZE))
1598 This->WindowPos.top = Top;
1603 static HRESULT WINAPI Videowindow_get_Top(IVideoWindow *iface,
1605 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1607 TRACE("(%p/%p)->(%p)\n", This, iface, pTop);
1609 *pTop = This->WindowPos.top;
1614 static HRESULT WINAPI Videowindow_put_Height(IVideoWindow *iface,
1616 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1618 TRACE("(%p/%p)->(%ld)\n", This, iface, Height);
1620 if (!SetWindowPos(This->hWnd, NULL, 0, 0, This->WindowPos.right-This->WindowPos.left, Height, SWP_NOZORDER|SWP_NOMOVE))
1623 This->WindowPos.bottom = This->WindowPos.top + Height;
1628 static HRESULT WINAPI Videowindow_get_Height(IVideoWindow *iface,
1630 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1632 TRACE("(%p/%p)->(%p)\n", This, iface, pHeight);
1634 *pHeight = This->WindowPos.bottom - This->WindowPos.top;
1639 static HRESULT WINAPI Videowindow_put_Owner(IVideoWindow *iface,
1641 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1643 TRACE("(%p/%p)->(%08x)\n", This, iface, (DWORD) Owner);
1645 SetParent(This->hWnd, (HWND)Owner);
1650 static HRESULT WINAPI Videowindow_get_Owner(IVideoWindow *iface,
1652 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1654 TRACE("(%p/%p)->(%08x)\n", This, iface, (DWORD) Owner);
1656 *(HWND*)Owner = GetParent(This->hWnd);
1661 static HRESULT WINAPI Videowindow_put_MessageDrain(IVideoWindow *iface,
1663 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1665 TRACE("(%p/%p)->(%08x)\n", This, iface, (DWORD) Drain);
1667 This->hWndMsgDrain = (HWND)Drain;
1672 static HRESULT WINAPI Videowindow_get_MessageDrain(IVideoWindow *iface,
1674 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1676 TRACE("(%p/%p)->(%p)\n", This, iface, Drain);
1678 *Drain = (OAHWND)This->hWndMsgDrain;
1683 static HRESULT WINAPI Videowindow_get_BorderColor(IVideoWindow *iface,
1685 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1687 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, Color);
1692 static HRESULT WINAPI Videowindow_put_BorderColor(IVideoWindow *iface,
1694 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1696 FIXME("(%p/%p)->(%ld): stub !!!\n", This, iface, Color);
1701 static HRESULT WINAPI Videowindow_get_FullScreenMode(IVideoWindow *iface,
1702 long *FullScreenMode) {
1703 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1705 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, FullScreenMode);
1710 static HRESULT WINAPI Videowindow_put_FullScreenMode(IVideoWindow *iface,
1711 long FullScreenMode) {
1712 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1714 FIXME("(%p/%p)->(%ld): stub !!!\n", This, iface, FullScreenMode);
1719 static HRESULT WINAPI Videowindow_SetWindowForeground(IVideoWindow *iface,
1721 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1726 TRACE("(%p/%p)->(%ld)\n", This, iface, Focus);
1728 if ((Focus != FALSE) && (Focus != TRUE))
1729 return E_INVALIDARG;
1731 hr = IPin_ConnectedTo(This->ppPins[0], &pPin);
1732 if ((hr != S_OK) || !pPin)
1733 return VFW_E_NOT_CONNECTED;
1736 ret = SetForegroundWindow(This->hWnd);
1738 ret = SetWindowPos(This->hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
1746 static HRESULT WINAPI Videowindow_NotifyOwnerMessage(IVideoWindow *iface,
1751 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1753 TRACE("(%p/%p)->(%08x, %ld, %08lx, %08lx)\n", This, iface, (DWORD) hwnd, uMsg, wParam, lParam);
1755 if (!PostMessageA(This->hWnd, uMsg, wParam, lParam))
1761 static HRESULT WINAPI Videowindow_SetWindowPosition(IVideoWindow *iface,
1766 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1768 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This, iface, Left, Top, Width, Height);
1770 if (!SetWindowPos(This->hWnd, NULL, Left, Top, Width, Height, SWP_NOZORDER))
1773 This->WindowPos.left = Left;
1774 This->WindowPos.top = Top;
1775 This->WindowPos.right = Left + Width;
1776 This->WindowPos.bottom = Top + Height;
1781 static HRESULT WINAPI Videowindow_GetWindowPosition(IVideoWindow *iface,
1786 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1788 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
1790 *pLeft = This->WindowPos.left;
1791 *pTop = This->WindowPos.top;
1792 *pWidth = This->WindowPos.right - This->WindowPos.left;
1793 *pHeight = This->WindowPos.bottom - This->WindowPos.top;
1798 static HRESULT WINAPI Videowindow_GetMinIdealImageSize(IVideoWindow *iface,
1801 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1803 FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This, iface, pWidth, pHeight);
1805 *pWidth = This->VideoWidth;
1806 *pHeight = This->VideoHeight;
1811 static HRESULT WINAPI Videowindow_GetMaxIdealImageSize(IVideoWindow *iface,
1814 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1816 FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This, iface, pWidth, pHeight);
1818 *pWidth = This->VideoWidth;
1819 *pHeight = This->VideoHeight;
1824 static HRESULT WINAPI Videowindow_GetRestorePosition(IVideoWindow *iface,
1829 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1831 FIXME("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
1836 static HRESULT WINAPI Videowindow_HideCursor(IVideoWindow *iface,
1838 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1840 FIXME("(%p/%p)->(%ld): stub !!!\n", This, iface, HideCursor);
1845 static HRESULT WINAPI Videowindow_IsCursorHidden(IVideoWindow *iface,
1846 long *CursorHidden) {
1847 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1849 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, CursorHidden);
1854 static const IVideoWindowVtbl IVideoWindow_VTable =
1856 Videowindow_QueryInterface,
1858 Videowindow_Release,
1859 Videowindow_GetTypeInfoCount,
1860 Videowindow_GetTypeInfo,
1861 Videowindow_GetIDsOfNames,
1863 Videowindow_put_Caption,
1864 Videowindow_get_Caption,
1865 Videowindow_put_WindowStyle,
1866 Videowindow_get_WindowStyle,
1867 Videowindow_put_WindowStyleEx,
1868 Videowindow_get_WindowStyleEx,
1869 Videowindow_put_AutoShow,
1870 Videowindow_get_AutoShow,
1871 Videowindow_put_WindowState,
1872 Videowindow_get_WindowState,
1873 Videowindow_put_BackgroundPalette,
1874 Videowindow_get_BackgroundPalette,
1875 Videowindow_put_Visible,
1876 Videowindow_get_Visible,
1877 Videowindow_put_Left,
1878 Videowindow_get_Left,
1879 Videowindow_put_Width,
1880 Videowindow_get_Width,
1881 Videowindow_put_Top,
1882 Videowindow_get_Top,
1883 Videowindow_put_Height,
1884 Videowindow_get_Height,
1885 Videowindow_put_Owner,
1886 Videowindow_get_Owner,
1887 Videowindow_put_MessageDrain,
1888 Videowindow_get_MessageDrain,
1889 Videowindow_get_BorderColor,
1890 Videowindow_put_BorderColor,
1891 Videowindow_get_FullScreenMode,
1892 Videowindow_put_FullScreenMode,
1893 Videowindow_SetWindowForeground,
1894 Videowindow_NotifyOwnerMessage,
1895 Videowindow_SetWindowPosition,
1896 Videowindow_GetWindowPosition,
1897 Videowindow_GetMinIdealImageSize,
1898 Videowindow_GetMaxIdealImageSize,
1899 Videowindow_GetRestorePosition,
1900 Videowindow_HideCursor,
1901 Videowindow_IsCursorHidden