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 IBasicVideoVtbl IBasicVideo_VTable;
52 static const IVideoWindowVtbl IVideoWindow_VTable;
53 static const IPinVtbl VideoRenderer_InputPin_Vtbl;
55 typedef struct VideoRendererImpl
57 const IBaseFilterVtbl * lpVtbl;
58 const IBasicVideoVtbl * IBasicVideo_vtbl;
59 const IVideoWindowVtbl * IVideoWindow_vtbl;
62 CRITICAL_SECTION csFilter;
64 REFERENCE_TIME rtStreamStart;
65 IReferenceClock * pClock;
66 FILTER_INFO filterInfo;
86 static LRESULT CALLBACK VideoWndProcA(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
88 VideoRendererImpl* pVideoRenderer = (VideoRendererImpl*)GetWindowLongA(hwnd, 0);
89 LPRECT lprect = (LPRECT)lParam;
91 if (pVideoRenderer && pVideoRenderer->hWndMsgDrain)
97 case WM_LBUTTONDBLCLK:
100 case WM_MBUTTONDBLCLK:
103 case WM_MOUSEACTIVATE:
105 case WM_NCLBUTTONDBLCLK:
106 case WM_NCLBUTTONDOWN:
108 case WM_NCMBUTTONDBLCLK:
109 case WM_NCMBUTTONDOWN:
112 case WM_NCRBUTTONDBLCLK:
113 case WM_NCRBUTTONDOWN:
115 case WM_RBUTTONDBLCLK:
118 PostMessageA(pVideoRenderer->hWndMsgDrain, uMsg, wParam, lParam);
128 /* TRACE("WM_SIZING %d %d %d %d\n", lprect->left, lprect->top, lprect->right, lprect->bottom); */
129 SetWindowPos(hwnd, NULL, lprect->left, lprect->top, lprect->right - lprect->left, lprect->bottom - lprect->top, SWP_NOZORDER);
130 GetClientRect(hwnd, &pVideoRenderer->DestRect);
133 return DefWindowProcA(hwnd, uMsg, wParam, lParam);
138 static BOOL CreateRenderingWindow(VideoRendererImpl* This)
142 TRACE("(%p)->()\n", This);
145 winclass.lpfnWndProc = VideoWndProcA;
146 winclass.cbClsExtra = 0;
147 winclass.cbWndExtra = sizeof(VideoRendererImpl*);
148 winclass.hInstance = NULL;
149 winclass.hIcon = NULL;
150 winclass.hCursor = NULL;
151 winclass.hbrBackground = GetStockObject(BLACK_BRUSH);
152 winclass.lpszMenuName = NULL;
153 winclass.lpszClassName = "Wine ActiveMovie Class";
155 if (!wnd_class_registered)
157 if (!RegisterClassA(&winclass))
159 ERR("Unable to register window %u\n", GetLastError());
162 wnd_class_registered = TRUE;
165 This->hWnd = CreateWindowExA(0, "Wine ActiveMovie Class", "Wine ActiveMovie Window", WS_SIZEBOX,
166 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL,
171 ERR("Unable to create window\n");
175 SetWindowLongA(This->hWnd, 0, (LONG)This);
180 static DWORD WINAPI MessageLoop(LPVOID lpParameter)
182 VideoRendererImpl* This = (VideoRendererImpl*) lpParameter;
186 TRACE("Starting message loop\n");
188 if (!CreateRenderingWindow(This))
190 This->ThreadResult = FALSE;
191 SetEvent(This->hEvent);
195 This->ThreadResult = TRUE;
196 SetEvent(This->hEvent);
198 while ((fGotMessage = GetMessageA(&msg, NULL, 0, 0)) != 0 && fGotMessage != -1)
200 TranslateMessage(&msg);
201 DispatchMessageA(&msg);
204 TRACE("End of message loop\n");
209 static BOOL CreateRenderingSubsystem(VideoRendererImpl* This)
211 This->hEvent = CreateEventW(NULL, FALSE, FALSE, NULL);
215 This->hThread = CreateThread(NULL, 0, MessageLoop, (LPVOID)This, 0, &This->ThreadID);
218 CloseHandle(This->hEvent);
222 WaitForSingleObject(This->hEvent, INFINITE);
223 CloseHandle(This->hEvent);
225 if (!This->ThreadResult)
227 CloseHandle(This->hThread);
234 static const IMemInputPinVtbl MemInputPin_Vtbl =
236 MemInputPin_QueryInterface,
239 MemInputPin_GetAllocator,
240 MemInputPin_NotifyAllocator,
241 MemInputPin_GetAllocatorRequirements,
243 MemInputPin_ReceiveMultiple,
244 MemInputPin_ReceiveCanBlock
247 static HRESULT VideoRenderer_InputPin_Construct(const PIN_INFO * pPinInfo, SAMPLEPROC pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin)
253 if (pPinInfo->dir != PINDIR_INPUT)
255 ERR("Pin direction(%x) != PINDIR_INPUT\n", pPinInfo->dir);
259 pPinImpl = CoTaskMemAlloc(sizeof(*pPinImpl));
262 return E_OUTOFMEMORY;
264 if (SUCCEEDED(InputPin_Init(pPinInfo, pSampleProc, pUserData, pQueryAccept, pCritSec, pPinImpl)))
266 pPinImpl->pin.lpVtbl = &VideoRenderer_InputPin_Vtbl;
267 pPinImpl->lpVtblMemInput = &MemInputPin_Vtbl;
269 *ppPin = (IPin *)(&pPinImpl->pin.lpVtbl);
275 static DWORD VideoRenderer_SendSampleData(VideoRendererImpl* This, LPBYTE data, DWORD size)
277 VIDEOINFOHEADER* format;
283 LPBYTE palette = NULL;
286 TRACE("%p %p %d\n", This, data, size);
288 sdesc.dwSize = sizeof(sdesc);
289 hr = IPin_ConnectionMediaType(This->ppPins[0], &amt);
291 ERR("Unable to retrieve media type\n");
294 format = (VIDEOINFOHEADER*)amt.pbFormat;
296 TRACE("biSize = %d\n", format->bmiHeader.biSize);
297 TRACE("biWidth = %d\n", format->bmiHeader.biWidth);
298 TRACE("biHeight = %d\n", format->bmiHeader.biHeight);
299 TRACE("biPlanes = %d\n", format->bmiHeader.biPlanes);
300 TRACE("biBitCount = %d\n", format->bmiHeader.biBitCount);
301 TRACE("biCompression = %s\n", debugstr_an((LPSTR)&(format->bmiHeader.biCompression), 4));
302 TRACE("biSizeImage = %d\n", format->bmiHeader.biSizeImage);
304 width = format->bmiHeader.biWidth;
305 height = format->bmiHeader.biHeight;
306 palette = ((LPBYTE)&format->bmiHeader) + format->bmiHeader.biSize;
310 /* Compute the size of the whole window so the client area size matches video one */
313 GetWindowRect(This->hWnd, &wrect);
314 GetClientRect(This->hWnd, &crect);
315 h = (wrect.right - wrect.left) - (crect.right - crect.left);
316 v = (wrect.bottom - wrect.top) - (crect.bottom - crect.top);
317 SetWindowPos(This->hWnd, NULL, 0, 0, width + h +20, height + v+20, SWP_NOZORDER|SWP_NOMOVE);
318 This->WindowPos.left = 0;
319 This->WindowPos.top = 0;
320 This->WindowPos.right = width;
321 This->WindowPos.bottom = abs(height);
322 GetClientRect(This->hWnd, &This->DestRect);
326 hDC = GetDC(This->hWnd);
329 ERR("Cannot get DC from window!\n");
333 TRACE("Src Rect: %d %d %d %d\n", This->SourceRect.left, This->SourceRect.top, This->SourceRect.right, This->SourceRect.bottom);
334 TRACE("Dst Rect: %d %d %d %d\n", This->DestRect.left, This->DestRect.top, This->DestRect.right, This->DestRect.bottom);
336 StretchDIBits(hDC, This->DestRect.left, This->DestRect.top, This->DestRect.right -This->DestRect.left,
337 This->DestRect.bottom - This->DestRect.top, This->SourceRect.left, This->SourceRect.top,
338 This->SourceRect.right - This->SourceRect.left, This->SourceRect.bottom - This->SourceRect.top,
339 data, (BITMAPINFO*)&format->bmiHeader, DIB_RGB_COLORS, SRCCOPY);
341 ReleaseDC(This->hWnd, hDC);
344 ShowWindow(This->hWnd, SW_SHOW);
349 static HRESULT VideoRenderer_Sample(LPVOID iface, IMediaSample * pSample)
351 VideoRendererImpl *This = (VideoRendererImpl *)iface;
352 LPBYTE pbSrcStream = NULL;
353 long cbSrcStream = 0;
354 REFERENCE_TIME tStart, tStop;
357 TRACE("%p %p\n", iface, pSample);
359 hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
362 ERR("Cannot get pointer to sample data (%x)\n", hr);
366 hr = IMediaSample_GetTime(pSample, &tStart, &tStop);
368 ERR("Cannot get sample time (%x)\n", hr);
370 cbSrcStream = IMediaSample_GetActualDataLength(pSample);
372 TRACE("val %p %ld\n", pbSrcStream, cbSrcStream);
374 #if 0 /* For debugging purpose */
377 for(i = 0; i < cbSrcStream; i++)
379 if ((i!=0) && !(i%16))
381 TRACE("%02x ", pbSrcStream[i]);
387 VideoRenderer_SendSampleData(This, pbSrcStream, cbSrcStream);
392 static HRESULT VideoRenderer_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt)
394 if (!IsEqualIID(&pmt->majortype, &MEDIATYPE_Video))
397 if (IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB32) ||
398 IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB24) ||
399 IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB565) ||
400 IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB8))
402 VideoRendererImpl* This = (VideoRendererImpl*) iface;
403 VIDEOINFOHEADER* format = (VIDEOINFOHEADER*)pmt->pbFormat;
405 if (!IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo))
407 WARN("Format type %s not supported\n", debugstr_guid(&pmt->formattype));
410 This->SourceRect.left = 0;
411 This->SourceRect.top = 0;
412 This->SourceRect.right = This->VideoWidth = format->bmiHeader.biWidth;
413 This->SourceRect.bottom = This->VideoHeight = format->bmiHeader.biHeight;
419 HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv)
423 VideoRendererImpl * pVideoRenderer;
425 TRACE("(%p, %p)\n", pUnkOuter, ppv);
430 return CLASS_E_NOAGGREGATION;
432 pVideoRenderer = CoTaskMemAlloc(sizeof(VideoRendererImpl));
434 pVideoRenderer->lpVtbl = &VideoRenderer_Vtbl;
435 pVideoRenderer->IBasicVideo_vtbl = &IBasicVideo_VTable;
436 pVideoRenderer->IVideoWindow_vtbl = &IVideoWindow_VTable;
438 pVideoRenderer->refCount = 1;
439 InitializeCriticalSection(&pVideoRenderer->csFilter);
440 pVideoRenderer->csFilter.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": VideoRendererImpl.csFilter");
441 pVideoRenderer->state = State_Stopped;
442 pVideoRenderer->pClock = NULL;
443 pVideoRenderer->init = 0;
444 pVideoRenderer->AutoShow = 1;
445 ZeroMemory(&pVideoRenderer->filterInfo, sizeof(FILTER_INFO));
447 pVideoRenderer->ppPins = CoTaskMemAlloc(1 * sizeof(IPin *));
449 /* construct input pin */
450 piInput.dir = PINDIR_INPUT;
451 piInput.pFilter = (IBaseFilter *)pVideoRenderer;
452 lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0]));
454 hr = VideoRenderer_InputPin_Construct(&piInput, VideoRenderer_Sample, (LPVOID)pVideoRenderer, VideoRenderer_QueryAccept, &pVideoRenderer->csFilter, (IPin **)&pVideoRenderer->pInputPin);
458 pVideoRenderer->ppPins[0] = (IPin *)pVideoRenderer->pInputPin;
459 *ppv = (LPVOID)pVideoRenderer;
463 CoTaskMemFree(pVideoRenderer->ppPins);
464 pVideoRenderer->csFilter.DebugInfo->Spare[0] = 0;
465 DeleteCriticalSection(&pVideoRenderer->csFilter);
466 CoTaskMemFree(pVideoRenderer);
469 if (!CreateRenderingSubsystem(pVideoRenderer))
475 static HRESULT WINAPI VideoRenderer_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv)
477 VideoRendererImpl *This = (VideoRendererImpl *)iface;
478 TRACE("(%p/%p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv);
482 if (IsEqualIID(riid, &IID_IUnknown))
484 else if (IsEqualIID(riid, &IID_IPersist))
486 else if (IsEqualIID(riid, &IID_IMediaFilter))
488 else if (IsEqualIID(riid, &IID_IBaseFilter))
490 else if (IsEqualIID(riid, &IID_IBasicVideo))
491 *ppv = (LPVOID)&(This->IBasicVideo_vtbl);
492 else if (IsEqualIID(riid, &IID_IVideoWindow))
493 *ppv = (LPVOID)&(This->IVideoWindow_vtbl);
497 IUnknown_AddRef((IUnknown *)(*ppv));
501 FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
503 return E_NOINTERFACE;
506 static ULONG WINAPI VideoRenderer_AddRef(IBaseFilter * iface)
508 VideoRendererImpl *This = (VideoRendererImpl *)iface;
509 ULONG refCount = InterlockedIncrement(&This->refCount);
511 TRACE("(%p/%p)->() AddRef from %d\n", This, iface, refCount - 1);
516 static ULONG WINAPI VideoRenderer_Release(IBaseFilter * iface)
518 VideoRendererImpl *This = (VideoRendererImpl *)iface;
519 ULONG refCount = InterlockedDecrement(&This->refCount);
521 TRACE("(%p/%p)->() Release from %d\n", This, iface, refCount + 1);
527 DestroyWindow(This->hWnd);
528 PostThreadMessageA(This->ThreadID, WM_QUIT, 0, 0);
529 WaitForSingleObject(This->hThread, INFINITE);
530 CloseHandle(This->hThread);
533 IReferenceClock_Release(This->pClock);
535 if (SUCCEEDED(IPin_ConnectedTo(This->ppPins[0], &pConnectedTo)))
537 IPin_Disconnect(pConnectedTo);
538 IPin_Release(pConnectedTo);
540 IPin_Disconnect(This->ppPins[0]);
542 IPin_Release(This->ppPins[0]);
544 CoTaskMemFree(This->ppPins);
547 This->csFilter.DebugInfo->Spare[0] = 0;
548 DeleteCriticalSection(&This->csFilter);
550 TRACE("Destroying Video Renderer\n");
559 /** IPersist methods **/
561 static HRESULT WINAPI VideoRenderer_GetClassID(IBaseFilter * iface, CLSID * pClsid)
563 VideoRendererImpl *This = (VideoRendererImpl *)iface;
565 TRACE("(%p/%p)->(%p)\n", This, iface, pClsid);
567 *pClsid = CLSID_VideoRenderer;
572 /** IMediaFilter methods **/
574 static HRESULT WINAPI VideoRenderer_Stop(IBaseFilter * iface)
576 VideoRendererImpl *This = (VideoRendererImpl *)iface;
578 TRACE("(%p/%p)->()\n", This, iface);
580 EnterCriticalSection(&This->csFilter);
582 This->state = State_Stopped;
584 LeaveCriticalSection(&This->csFilter);
589 static HRESULT WINAPI VideoRenderer_Pause(IBaseFilter * iface)
591 VideoRendererImpl *This = (VideoRendererImpl *)iface;
593 TRACE("(%p/%p)->()\n", This, iface);
595 EnterCriticalSection(&This->csFilter);
597 This->state = State_Paused;
599 LeaveCriticalSection(&This->csFilter);
604 static HRESULT WINAPI VideoRenderer_Run(IBaseFilter * iface, REFERENCE_TIME tStart)
606 VideoRendererImpl *This = (VideoRendererImpl *)iface;
608 TRACE("(%p/%p)->(%s)\n", This, iface, wine_dbgstr_longlong(tStart));
610 EnterCriticalSection(&This->csFilter);
612 This->rtStreamStart = tStart;
613 This->state = State_Running;
615 LeaveCriticalSection(&This->csFilter);
620 static HRESULT WINAPI VideoRenderer_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
622 VideoRendererImpl *This = (VideoRendererImpl *)iface;
624 TRACE("(%p/%p)->(%d, %p)\n", This, iface, dwMilliSecsTimeout, pState);
626 EnterCriticalSection(&This->csFilter);
628 *pState = This->state;
630 LeaveCriticalSection(&This->csFilter);
635 static HRESULT WINAPI VideoRenderer_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock)
637 VideoRendererImpl *This = (VideoRendererImpl *)iface;
639 TRACE("(%p/%p)->(%p)\n", This, iface, pClock);
641 EnterCriticalSection(&This->csFilter);
644 IReferenceClock_Release(This->pClock);
645 This->pClock = pClock;
647 IReferenceClock_AddRef(This->pClock);
649 LeaveCriticalSection(&This->csFilter);
654 static HRESULT WINAPI VideoRenderer_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock)
656 VideoRendererImpl *This = (VideoRendererImpl *)iface;
658 TRACE("(%p/%p)->(%p)\n", This, iface, ppClock);
660 EnterCriticalSection(&This->csFilter);
662 *ppClock = This->pClock;
663 IReferenceClock_AddRef(This->pClock);
665 LeaveCriticalSection(&This->csFilter);
670 /** IBaseFilter implementation **/
672 static HRESULT WINAPI VideoRenderer_EnumPins(IBaseFilter * iface, IEnumPins **ppEnum)
675 VideoRendererImpl *This = (VideoRendererImpl *)iface;
677 TRACE("(%p/%p)->(%p)\n", This, iface, ppEnum);
679 epd.cPins = 1; /* input pin */
680 epd.ppPins = This->ppPins;
681 return IEnumPinsImpl_Construct(&epd, ppEnum);
684 static HRESULT WINAPI VideoRenderer_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin)
686 VideoRendererImpl *This = (VideoRendererImpl *)iface;
688 TRACE("(%p/%p)->(%p,%p)\n", This, iface, debugstr_w(Id), ppPin);
690 FIXME("VideoRenderer::FindPin(...)\n");
692 /* FIXME: critical section */
697 static HRESULT WINAPI VideoRenderer_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo)
699 VideoRendererImpl *This = (VideoRendererImpl *)iface;
701 TRACE("(%p/%p)->(%p)\n", This, iface, pInfo);
703 strcpyW(pInfo->achName, This->filterInfo.achName);
704 pInfo->pGraph = This->filterInfo.pGraph;
707 IFilterGraph_AddRef(pInfo->pGraph);
712 static HRESULT WINAPI VideoRenderer_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName)
714 VideoRendererImpl *This = (VideoRendererImpl *)iface;
716 TRACE("(%p/%p)->(%p, %s)\n", This, iface, pGraph, debugstr_w(pName));
718 EnterCriticalSection(&This->csFilter);
721 strcpyW(This->filterInfo.achName, pName);
723 *This->filterInfo.achName = '\0';
724 This->filterInfo.pGraph = pGraph; /* NOTE: do NOT increase ref. count */
726 LeaveCriticalSection(&This->csFilter);
731 static HRESULT WINAPI VideoRenderer_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo)
733 VideoRendererImpl *This = (VideoRendererImpl *)iface;
734 TRACE("(%p/%p)->(%p)\n", This, iface, pVendorInfo);
738 static const IBaseFilterVtbl VideoRenderer_Vtbl =
740 VideoRenderer_QueryInterface,
741 VideoRenderer_AddRef,
742 VideoRenderer_Release,
743 VideoRenderer_GetClassID,
747 VideoRenderer_GetState,
748 VideoRenderer_SetSyncSource,
749 VideoRenderer_GetSyncSource,
750 VideoRenderer_EnumPins,
751 VideoRenderer_FindPin,
752 VideoRenderer_QueryFilterInfo,
753 VideoRenderer_JoinFilterGraph,
754 VideoRenderer_QueryVendorInfo
757 static HRESULT WINAPI VideoRenderer_InputPin_EndOfStream(IPin * iface)
759 InputPin* This = (InputPin*)iface;
760 IMediaEventSink* pEventSink;
763 TRACE("(%p/%p)->()\n", This, iface);
765 hr = IFilterGraph_QueryInterface(((VideoRendererImpl*)This->pin.pinInfo.pFilter)->filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink);
768 hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, 0);
769 IMediaEventSink_Release(pEventSink);
775 static const IPinVtbl VideoRenderer_InputPin_Vtbl =
777 InputPin_QueryInterface,
781 InputPin_ReceiveConnection,
783 IPinImpl_ConnectedTo,
784 IPinImpl_ConnectionMediaType,
785 IPinImpl_QueryPinInfo,
786 IPinImpl_QueryDirection,
788 IPinImpl_QueryAccept,
789 IPinImpl_EnumMediaTypes,
790 IPinImpl_QueryInternalConnections,
791 VideoRenderer_InputPin_EndOfStream,
797 /*** IUnknown methods ***/
798 static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface,
801 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
803 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
805 return VideoRenderer_QueryInterface((IBaseFilter*)This, riid, ppvObj);
808 static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface) {
809 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
811 TRACE("(%p/%p)->()\n", This, iface);
813 return VideoRenderer_AddRef((IBaseFilter*)This);
816 static ULONG WINAPI Basicvideo_Release(IBasicVideo *iface) {
817 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
819 TRACE("(%p/%p)->()\n", This, iface);
821 return VideoRenderer_Release((IBaseFilter*)This);
824 /*** IDispatch methods ***/
825 static HRESULT WINAPI Basicvideo_GetTypeInfoCount(IBasicVideo *iface,
827 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
829 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
834 static HRESULT WINAPI Basicvideo_GetTypeInfo(IBasicVideo *iface,
837 ITypeInfo**ppTInfo) {
838 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
840 FIXME("(%p/%p)->(%d, %d, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
845 static HRESULT WINAPI Basicvideo_GetIDsOfNames(IBasicVideo *iface,
851 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
853 FIXME("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
858 static HRESULT WINAPI Basicvideo_Invoke(IBasicVideo *iface,
863 DISPPARAMS*pDispParams,
867 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
869 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);
874 /*** IBasicVideo methods ***/
875 static HRESULT WINAPI Basicvideo_get_AvgTimePerFrame(IBasicVideo *iface,
876 REFTIME *pAvgTimePerFrame) {
877 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
879 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pAvgTimePerFrame);
884 static HRESULT WINAPI Basicvideo_get_BitRate(IBasicVideo *iface,
886 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
888 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pBitRate);
893 static HRESULT WINAPI Basicvideo_get_BitErrorRate(IBasicVideo *iface,
894 long *pBitErrorRate) {
895 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
897 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pBitErrorRate);
902 static HRESULT WINAPI Basicvideo_get_VideoWidth(IBasicVideo *iface,
904 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
906 TRACE("(%p/%p)->(%p)\n", This, iface, pVideoWidth);
908 *pVideoWidth = This->VideoWidth;
913 static HRESULT WINAPI Basicvideo_get_VideoHeight(IBasicVideo *iface,
914 long *pVideoHeight) {
915 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
917 TRACE("(%p/%p)->(%p)\n", This, iface, pVideoHeight);
919 *pVideoHeight = This->VideoHeight;
924 static HRESULT WINAPI Basicvideo_put_SourceLeft(IBasicVideo *iface,
926 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
928 TRACE("(%p/%p)->(%ld)\n", This, iface, SourceLeft);
930 This->SourceRect.left = SourceLeft;
935 static HRESULT WINAPI Basicvideo_get_SourceLeft(IBasicVideo *iface,
937 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
939 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceLeft);
941 *pSourceLeft = This->SourceRect.left;
946 static HRESULT WINAPI Basicvideo_put_SourceWidth(IBasicVideo *iface,
948 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
950 TRACE("(%p/%p)->(%ld)\n", This, iface, SourceWidth);
952 This->SourceRect.right = This->SourceRect.left + SourceWidth;
957 static HRESULT WINAPI Basicvideo_get_SourceWidth(IBasicVideo *iface,
958 long *pSourceWidth) {
959 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
961 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceWidth);
963 *pSourceWidth = This->SourceRect.right - This->SourceRect.left;
968 static HRESULT WINAPI Basicvideo_put_SourceTop(IBasicVideo *iface,
970 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
972 TRACE("(%p/%p)->(%ld)\n", This, iface, SourceTop);
974 This->SourceRect.top = SourceTop;
979 static HRESULT WINAPI Basicvideo_get_SourceTop(IBasicVideo *iface,
981 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
983 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceTop);
985 *pSourceTop = This->SourceRect.top;
990 static HRESULT WINAPI Basicvideo_put_SourceHeight(IBasicVideo *iface,
992 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
994 TRACE("(%p/%p)->(%ld)\n", This, iface, SourceHeight);
996 This->SourceRect.bottom = This->SourceRect.top + SourceHeight;
1001 static HRESULT WINAPI Basicvideo_get_SourceHeight(IBasicVideo *iface,
1002 long *pSourceHeight) {
1003 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1005 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceHeight);
1007 *pSourceHeight = This->SourceRect.bottom - This->SourceRect.top;
1012 static HRESULT WINAPI Basicvideo_put_DestinationLeft(IBasicVideo *iface,
1013 long DestinationLeft) {
1014 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1016 TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationLeft);
1018 This->DestRect.left = DestinationLeft;
1023 static HRESULT WINAPI Basicvideo_get_DestinationLeft(IBasicVideo *iface,
1024 long *pDestinationLeft) {
1025 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1027 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationLeft);
1029 *pDestinationLeft = This->DestRect.left;
1034 static HRESULT WINAPI Basicvideo_put_DestinationWidth(IBasicVideo *iface,
1035 long DestinationWidth) {
1036 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1038 TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationWidth);
1040 This->DestRect.right = This->DestRect.left + DestinationWidth;
1045 static HRESULT WINAPI Basicvideo_get_DestinationWidth(IBasicVideo *iface,
1046 long *pDestinationWidth) {
1047 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1049 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationWidth);
1051 *pDestinationWidth = This->DestRect.right - This->DestRect.left;
1056 static HRESULT WINAPI Basicvideo_put_DestinationTop(IBasicVideo *iface,
1057 long DestinationTop) {
1058 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1060 TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationTop);
1062 This->DestRect.top = DestinationTop;
1067 static HRESULT WINAPI Basicvideo_get_DestinationTop(IBasicVideo *iface,
1068 long *pDestinationTop) {
1069 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1071 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationTop);
1073 *pDestinationTop = This->DestRect.top;
1078 static HRESULT WINAPI Basicvideo_put_DestinationHeight(IBasicVideo *iface,
1079 long DestinationHeight) {
1080 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1082 TRACE("(%p/%p)->(%ld)\n", This, iface, DestinationHeight);
1084 This->DestRect.right = This->DestRect.left + DestinationHeight;
1089 static HRESULT WINAPI Basicvideo_get_DestinationHeight(IBasicVideo *iface,
1090 long *pDestinationHeight) {
1091 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1093 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationHeight);
1095 *pDestinationHeight = This->DestRect.right - This->DestRect.left;
1100 static HRESULT WINAPI Basicvideo_SetSourcePosition(IBasicVideo *iface,
1105 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1107 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This, iface, Left, Top, Width, Height);
1109 This->SourceRect.left = Left;
1110 This->SourceRect.top = Top;
1111 This->SourceRect.right = Left + Width;
1112 This->SourceRect.bottom = Top + Height;
1117 static HRESULT WINAPI Basicvideo_GetSourcePosition(IBasicVideo *iface,
1122 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1124 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
1126 *pLeft = This->SourceRect.left;
1127 *pTop = This->SourceRect.top;
1128 *pWidth = This->SourceRect.right - This->SourceRect.left;
1129 *pHeight = This->SourceRect.bottom - This->SourceRect.top;
1134 static HRESULT WINAPI Basicvideo_SetDefaultSourcePosition(IBasicVideo *iface) {
1135 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1137 TRACE("(%p/%p)->()\n", This, iface);
1139 This->SourceRect.left = 0;
1140 This->SourceRect.top = 0;
1141 This->SourceRect.right = This->VideoWidth;
1142 This->SourceRect.bottom = This->VideoHeight;
1147 static HRESULT WINAPI Basicvideo_SetDestinationPosition(IBasicVideo *iface,
1152 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1154 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This, iface, Left, Top, Width, Height);
1156 This->DestRect.left = Left;
1157 This->DestRect.top = Top;
1158 This->DestRect.right = Left + Width;
1159 This->DestRect.bottom = Top + Height;
1164 static HRESULT WINAPI Basicvideo_GetDestinationPosition(IBasicVideo *iface,
1169 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1171 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
1173 *pLeft = This->DestRect.left;
1174 *pTop = This->DestRect.top;
1175 *pWidth = This->DestRect.right - This->DestRect.left;
1176 *pHeight = This->DestRect.bottom - This->DestRect.top;
1181 static HRESULT WINAPI Basicvideo_SetDefaultDestinationPosition(IBasicVideo *iface) {
1182 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1185 TRACE("(%p/%p)->()\n", This, iface);
1187 if (!GetClientRect(This->hWnd, &rect))
1190 This->SourceRect.left = 0;
1191 This->SourceRect.top = 0;
1192 This->SourceRect.right = rect.right;
1193 This->SourceRect.bottom = rect.bottom;
1198 static HRESULT WINAPI Basicvideo_GetVideoSize(IBasicVideo *iface,
1201 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1203 TRACE("(%p/%p)->(%p, %p)\n", This, iface, pWidth, pHeight);
1205 *pWidth = This->VideoWidth;
1206 *pHeight = This->VideoHeight;
1211 static HRESULT WINAPI Basicvideo_GetVideoPaletteEntries(IBasicVideo *iface,
1216 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1218 FIXME("(%p/%p)->(%ld, %ld, %p, %p): stub !!!\n", This, iface, StartIndex, Entries, pRetrieved, pPalette);
1223 static HRESULT WINAPI Basicvideo_GetCurrentImage(IBasicVideo *iface,
1226 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1228 FIXME("(%p/%p)->(%p, %p): stub !!!\n", This, iface, pBufferSize, pDIBImage);
1233 static HRESULT WINAPI Basicvideo_IsUsingDefaultSource(IBasicVideo *iface) {
1234 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1236 FIXME("(%p/%p)->(): stub !!!\n", This, iface);
1241 static HRESULT WINAPI Basicvideo_IsUsingDefaultDestination(IBasicVideo *iface) {
1242 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1244 FIXME("(%p/%p)->(): stub !!!\n", This, iface);
1250 static const IBasicVideoVtbl IBasicVideo_VTable =
1252 Basicvideo_QueryInterface,
1255 Basicvideo_GetTypeInfoCount,
1256 Basicvideo_GetTypeInfo,
1257 Basicvideo_GetIDsOfNames,
1259 Basicvideo_get_AvgTimePerFrame,
1260 Basicvideo_get_BitRate,
1261 Basicvideo_get_BitErrorRate,
1262 Basicvideo_get_VideoWidth,
1263 Basicvideo_get_VideoHeight,
1264 Basicvideo_put_SourceLeft,
1265 Basicvideo_get_SourceLeft,
1266 Basicvideo_put_SourceWidth,
1267 Basicvideo_get_SourceWidth,
1268 Basicvideo_put_SourceTop,
1269 Basicvideo_get_SourceTop,
1270 Basicvideo_put_SourceHeight,
1271 Basicvideo_get_SourceHeight,
1272 Basicvideo_put_DestinationLeft,
1273 Basicvideo_get_DestinationLeft,
1274 Basicvideo_put_DestinationWidth,
1275 Basicvideo_get_DestinationWidth,
1276 Basicvideo_put_DestinationTop,
1277 Basicvideo_get_DestinationTop,
1278 Basicvideo_put_DestinationHeight,
1279 Basicvideo_get_DestinationHeight,
1280 Basicvideo_SetSourcePosition,
1281 Basicvideo_GetSourcePosition,
1282 Basicvideo_SetDefaultSourcePosition,
1283 Basicvideo_SetDestinationPosition,
1284 Basicvideo_GetDestinationPosition,
1285 Basicvideo_SetDefaultDestinationPosition,
1286 Basicvideo_GetVideoSize,
1287 Basicvideo_GetVideoPaletteEntries,
1288 Basicvideo_GetCurrentImage,
1289 Basicvideo_IsUsingDefaultSource,
1290 Basicvideo_IsUsingDefaultDestination
1294 /*** IUnknown methods ***/
1295 static HRESULT WINAPI Videowindow_QueryInterface(IVideoWindow *iface,
1298 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1300 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1302 return VideoRenderer_QueryInterface((IBaseFilter*)This, riid, ppvObj);
1305 static ULONG WINAPI Videowindow_AddRef(IVideoWindow *iface) {
1306 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1308 TRACE("(%p/%p)->()\n", This, iface);
1310 return VideoRenderer_AddRef((IBaseFilter*)This);
1313 static ULONG WINAPI Videowindow_Release(IVideoWindow *iface) {
1314 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1316 TRACE("(%p/%p)->()\n", This, iface);
1318 return VideoRenderer_Release((IBaseFilter*)This);
1321 /*** IDispatch methods ***/
1322 static HRESULT WINAPI Videowindow_GetTypeInfoCount(IVideoWindow *iface,
1324 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1326 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1331 static HRESULT WINAPI Videowindow_GetTypeInfo(IVideoWindow *iface,
1334 ITypeInfo**ppTInfo) {
1335 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1337 FIXME("(%p/%p)->(%d, %d, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1342 static HRESULT WINAPI Videowindow_GetIDsOfNames(IVideoWindow *iface,
1348 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1350 FIXME("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1355 static HRESULT WINAPI Videowindow_Invoke(IVideoWindow *iface,
1356 DISPID dispIdMember,
1360 DISPPARAMS*pDispParams,
1362 EXCEPINFO*pExepInfo,
1364 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1366 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);
1371 /*** IVideoWindow methods ***/
1372 static HRESULT WINAPI Videowindow_put_Caption(IVideoWindow *iface,
1374 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1376 TRACE("(%p/%p)->(%s (%p))\n", This, iface, debugstr_w(strCaption), strCaption);
1378 if (!SetWindowTextW(This->hWnd, strCaption))
1384 static HRESULT WINAPI Videowindow_get_Caption(IVideoWindow *iface,
1386 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1388 TRACE("(%p/%p)->(%p)\n", This, iface, strCaption);
1390 GetWindowTextW(This->hWnd, (LPWSTR)strCaption, 100);
1395 static HRESULT WINAPI Videowindow_put_WindowStyle(IVideoWindow *iface,
1397 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1400 old = GetWindowLongA(This->hWnd, GWL_STYLE);
1402 TRACE("(%p/%p)->(%x -> %lx)\n", This, iface, old, WindowStyle);
1404 if (WindowStyle & (WS_DISABLED|WS_HSCROLL|WS_ICONIC|WS_MAXIMIZE|WS_MINIMIZE|WS_VSCROLL))
1405 return E_INVALIDARG;
1407 SetWindowLongA(This->hWnd, GWL_STYLE, WindowStyle);
1412 static HRESULT WINAPI Videowindow_get_WindowStyle(IVideoWindow *iface,
1413 long *WindowStyle) {
1414 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1416 TRACE("(%p/%p)->(%p)\n", This, iface, WindowStyle);
1418 *WindowStyle = GetWindowLongA(This->hWnd, GWL_STYLE);
1423 static HRESULT WINAPI Videowindow_put_WindowStyleEx(IVideoWindow *iface,
1424 long WindowStyleEx) {
1425 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1427 TRACE("(%p/%p)->(%ld)\n", This, iface, WindowStyleEx);
1429 if (WindowStyleEx & (WS_DISABLED|WS_HSCROLL|WS_ICONIC|WS_MAXIMIZE|WS_MINIMIZE|WS_VSCROLL))
1430 return E_INVALIDARG;
1432 if (!SetWindowLongA(This->hWnd, GWL_EXSTYLE, WindowStyleEx))
1438 static HRESULT WINAPI Videowindow_get_WindowStyleEx(IVideoWindow *iface,
1439 long *WindowStyleEx) {
1440 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1442 TRACE("(%p/%p)->(%p)\n", This, iface, WindowStyleEx);
1444 *WindowStyleEx = GetWindowLongA(This->hWnd, GWL_EXSTYLE);
1449 static HRESULT WINAPI Videowindow_put_AutoShow(IVideoWindow *iface,
1451 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1453 TRACE("(%p/%p)->(%ld)\n", This, iface, AutoShow);
1455 This->AutoShow = 1; /* FXIME: Should be AutoShow */;
1460 static HRESULT WINAPI Videowindow_get_AutoShow(IVideoWindow *iface,
1462 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1464 TRACE("(%p/%p)->(%p)\n", This, iface, AutoShow);
1466 *AutoShow = This->AutoShow;
1471 static HRESULT WINAPI Videowindow_put_WindowState(IVideoWindow *iface,
1473 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1475 FIXME("(%p/%p)->(%ld): stub !!!\n", This, iface, WindowState);
1480 static HRESULT WINAPI Videowindow_get_WindowState(IVideoWindow *iface,
1481 long *WindowState) {
1482 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1484 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, WindowState);
1489 static HRESULT WINAPI Videowindow_put_BackgroundPalette(IVideoWindow *iface,
1490 long BackgroundPalette) {
1491 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1493 FIXME("(%p/%p)->(%ld): stub !!!\n", This, iface, BackgroundPalette);
1498 static HRESULT WINAPI Videowindow_get_BackgroundPalette(IVideoWindow *iface,
1499 long *pBackgroundPalette) {
1500 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1502 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pBackgroundPalette);
1507 static HRESULT WINAPI Videowindow_put_Visible(IVideoWindow *iface,
1509 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1511 TRACE("(%p/%p)->(%ld)\n", This, iface, Visible);
1513 ShowWindow(This->hWnd, Visible ? SW_SHOW : SW_HIDE);
1518 static HRESULT WINAPI Videowindow_get_Visible(IVideoWindow *iface,
1520 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1522 TRACE("(%p/%p)->(%p)\n", This, iface, pVisible);
1524 *pVisible = IsWindowVisible(This->hWnd);
1529 static HRESULT WINAPI Videowindow_put_Left(IVideoWindow *iface,
1531 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1533 TRACE("(%p/%p)->(%ld)\n", This, iface, Left);
1535 if (!SetWindowPos(This->hWnd, NULL, Left, This->WindowPos.top, 0, 0, SWP_NOZORDER|SWP_NOSIZE))
1538 This->WindowPos.left = Left;
1543 static HRESULT WINAPI Videowindow_get_Left(IVideoWindow *iface,
1545 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1547 TRACE("(%p/%p)->(%p)\n", This, iface, pLeft);
1549 *pLeft = This->WindowPos.left;
1554 static HRESULT WINAPI Videowindow_put_Width(IVideoWindow *iface,
1556 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1558 TRACE("(%p/%p)->(%ld)\n", This, iface, Width);
1560 if (!SetWindowPos(This->hWnd, NULL, 0, 0, Width, This->WindowPos.bottom-This->WindowPos.top, SWP_NOZORDER|SWP_NOMOVE))
1563 This->WindowPos.right = This->WindowPos.left + Width;
1568 static HRESULT WINAPI Videowindow_get_Width(IVideoWindow *iface,
1570 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1572 TRACE("(%p/%p)->(%p)\n", This, iface, pWidth);
1574 *pWidth = This->WindowPos.right - This->WindowPos.left;
1579 static HRESULT WINAPI Videowindow_put_Top(IVideoWindow *iface,
1581 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1583 TRACE("(%p/%p)->(%ld)\n", This, iface, Top);
1585 if (!SetWindowPos(This->hWnd, NULL, This->WindowPos.left, Top, 0, 0, SWP_NOZORDER|SWP_NOSIZE))
1588 This->WindowPos.top = Top;
1593 static HRESULT WINAPI Videowindow_get_Top(IVideoWindow *iface,
1595 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1597 TRACE("(%p/%p)->(%p)\n", This, iface, pTop);
1599 *pTop = This->WindowPos.top;
1604 static HRESULT WINAPI Videowindow_put_Height(IVideoWindow *iface,
1606 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1608 TRACE("(%p/%p)->(%ld)\n", This, iface, Height);
1610 if (!SetWindowPos(This->hWnd, NULL, 0, 0, This->WindowPos.right-This->WindowPos.left, Height, SWP_NOZORDER|SWP_NOMOVE))
1613 This->WindowPos.bottom = This->WindowPos.top + Height;
1618 static HRESULT WINAPI Videowindow_get_Height(IVideoWindow *iface,
1620 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1622 TRACE("(%p/%p)->(%p)\n", This, iface, pHeight);
1624 *pHeight = This->WindowPos.bottom - This->WindowPos.top;
1629 static HRESULT WINAPI Videowindow_put_Owner(IVideoWindow *iface,
1631 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1633 TRACE("(%p/%p)->(%08x)\n", This, iface, (DWORD) Owner);
1635 SetParent(This->hWnd, (HWND)Owner);
1640 static HRESULT WINAPI Videowindow_get_Owner(IVideoWindow *iface,
1642 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1644 TRACE("(%p/%p)->(%08x)\n", This, iface, (DWORD) Owner);
1646 *(HWND*)Owner = GetParent(This->hWnd);
1651 static HRESULT WINAPI Videowindow_put_MessageDrain(IVideoWindow *iface,
1653 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1655 TRACE("(%p/%p)->(%08x)\n", This, iface, (DWORD) Drain);
1657 This->hWndMsgDrain = (HWND)Drain;
1662 static HRESULT WINAPI Videowindow_get_MessageDrain(IVideoWindow *iface,
1664 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1666 TRACE("(%p/%p)->(%p)\n", This, iface, Drain);
1668 *Drain = (OAHWND)This->hWndMsgDrain;
1673 static HRESULT WINAPI Videowindow_get_BorderColor(IVideoWindow *iface,
1675 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1677 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, Color);
1682 static HRESULT WINAPI Videowindow_put_BorderColor(IVideoWindow *iface,
1684 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1686 FIXME("(%p/%p)->(%ld): stub !!!\n", This, iface, Color);
1691 static HRESULT WINAPI Videowindow_get_FullScreenMode(IVideoWindow *iface,
1692 long *FullScreenMode) {
1693 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1695 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, FullScreenMode);
1700 static HRESULT WINAPI Videowindow_put_FullScreenMode(IVideoWindow *iface,
1701 long FullScreenMode) {
1702 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1704 FIXME("(%p/%p)->(%ld): stub !!!\n", This, iface, FullScreenMode);
1709 static HRESULT WINAPI Videowindow_SetWindowForeground(IVideoWindow *iface,
1711 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1716 TRACE("(%p/%p)->(%ld)\n", This, iface, Focus);
1718 if ((Focus != FALSE) && (Focus != TRUE))
1719 return E_INVALIDARG;
1721 hr = IPin_ConnectedTo(This->ppPins[0], &pPin);
1722 if ((hr != S_OK) || !pPin)
1723 return VFW_E_NOT_CONNECTED;
1726 ret = SetForegroundWindow(This->hWnd);
1728 ret = SetWindowPos(This->hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
1736 static HRESULT WINAPI Videowindow_NotifyOwnerMessage(IVideoWindow *iface,
1741 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1743 TRACE("(%p/%p)->(%08x, %ld, %08lx, %08lx)\n", This, iface, (DWORD) hwnd, uMsg, wParam, lParam);
1745 if (!PostMessageA(This->hWnd, uMsg, wParam, lParam))
1751 static HRESULT WINAPI Videowindow_SetWindowPosition(IVideoWindow *iface,
1756 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1758 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This, iface, Left, Top, Width, Height);
1760 if (!SetWindowPos(This->hWnd, NULL, Left, Top, Width, Height, SWP_NOZORDER))
1763 This->WindowPos.left = Left;
1764 This->WindowPos.top = Top;
1765 This->WindowPos.right = Left + Width;
1766 This->WindowPos.bottom = Top + Height;
1771 static HRESULT WINAPI Videowindow_GetWindowPosition(IVideoWindow *iface,
1776 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1778 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
1780 *pLeft = This->WindowPos.left;
1781 *pTop = This->WindowPos.top;
1782 *pWidth = This->WindowPos.right - This->WindowPos.left;
1783 *pHeight = This->WindowPos.bottom - This->WindowPos.top;
1788 static HRESULT WINAPI Videowindow_GetMinIdealImageSize(IVideoWindow *iface,
1791 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1793 FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This, iface, pWidth, pHeight);
1795 *pWidth = This->VideoWidth;
1796 *pHeight = This->VideoHeight;
1801 static HRESULT WINAPI Videowindow_GetMaxIdealImageSize(IVideoWindow *iface,
1804 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1806 FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This, iface, pWidth, pHeight);
1808 *pWidth = This->VideoWidth;
1809 *pHeight = This->VideoHeight;
1814 static HRESULT WINAPI Videowindow_GetRestorePosition(IVideoWindow *iface,
1819 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1821 FIXME("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
1826 static HRESULT WINAPI Videowindow_HideCursor(IVideoWindow *iface,
1828 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1830 FIXME("(%p/%p)->(%ld): stub !!!\n", This, iface, HideCursor);
1835 static HRESULT WINAPI Videowindow_IsCursorHidden(IVideoWindow *iface,
1836 long *CursorHidden) {
1837 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1839 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, CursorHidden);
1844 static const IVideoWindowVtbl IVideoWindow_VTable =
1846 Videowindow_QueryInterface,
1848 Videowindow_Release,
1849 Videowindow_GetTypeInfoCount,
1850 Videowindow_GetTypeInfo,
1851 Videowindow_GetIDsOfNames,
1853 Videowindow_put_Caption,
1854 Videowindow_get_Caption,
1855 Videowindow_put_WindowStyle,
1856 Videowindow_get_WindowStyle,
1857 Videowindow_put_WindowStyleEx,
1858 Videowindow_get_WindowStyleEx,
1859 Videowindow_put_AutoShow,
1860 Videowindow_get_AutoShow,
1861 Videowindow_put_WindowState,
1862 Videowindow_get_WindowState,
1863 Videowindow_put_BackgroundPalette,
1864 Videowindow_get_BackgroundPalette,
1865 Videowindow_put_Visible,
1866 Videowindow_get_Visible,
1867 Videowindow_put_Left,
1868 Videowindow_get_Left,
1869 Videowindow_put_Width,
1870 Videowindow_get_Width,
1871 Videowindow_put_Top,
1872 Videowindow_get_Top,
1873 Videowindow_put_Height,
1874 Videowindow_get_Height,
1875 Videowindow_put_Owner,
1876 Videowindow_get_Owner,
1877 Videowindow_put_MessageDrain,
1878 Videowindow_get_MessageDrain,
1879 Videowindow_get_BorderColor,
1880 Videowindow_put_BorderColor,
1881 Videowindow_get_FullScreenMode,
1882 Videowindow_put_FullScreenMode,
1883 Videowindow_SetWindowForeground,
1884 Videowindow_NotifyOwnerMessage,
1885 Videowindow_SetWindowPosition,
1886 Videowindow_GetWindowPosition,
1887 Videowindow_GetMinIdealImageSize,
1888 Videowindow_GetMaxIdealImageSize,
1889 Videowindow_GetRestorePosition,
1890 Videowindow_HideCursor,
1891 Videowindow_IsCursorHidden