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
);
131 return DefWindowProcA(hwnd
, uMsg
, wParam
, lParam
);
136 static BOOL
CreateRenderingWindow(VideoRendererImpl
* This
)
140 TRACE("(%p)->()\n", This
);
143 winclass
.lpfnWndProc
= VideoWndProcA
;
144 winclass
.cbClsExtra
= 0;
145 winclass
.cbWndExtra
= sizeof(VideoRendererImpl
*);
146 winclass
.hInstance
= NULL
;
147 winclass
.hIcon
= NULL
;
148 winclass
.hCursor
= NULL
;
149 winclass
.hbrBackground
= GetStockObject(BLACK_BRUSH
);
150 winclass
.lpszMenuName
= NULL
;
151 winclass
.lpszClassName
= "Wine ActiveMovie Class";
153 if (!wnd_class_registered
)
155 if (!RegisterClassA(&winclass
))
157 ERR("Unable to register window %u\n", GetLastError());
160 wnd_class_registered
= TRUE
;
163 This
->hWnd
= CreateWindowExA(0, "Wine ActiveMovie Class", "Wine ActiveMovie Window", WS_SIZEBOX
,
164 CW_USEDEFAULT
, CW_USEDEFAULT
, CW_USEDEFAULT
, CW_USEDEFAULT
, NULL
,
169 ERR("Unable to create window\n");
173 SetWindowLongA(This
->hWnd
, 0, (LONG
)This
);
178 static DWORD WINAPI
MessageLoop(LPVOID lpParameter
)
180 VideoRendererImpl
* This
= (VideoRendererImpl
*) lpParameter
;
184 TRACE("Starting message loop\n");
186 if (!CreateRenderingWindow(This
))
188 This
->ThreadResult
= FALSE
;
189 SetEvent(This
->hEvent
);
193 This
->ThreadResult
= TRUE
;
194 SetEvent(This
->hEvent
);
196 while ((fGotMessage
= GetMessageA(&msg
, NULL
, 0, 0)) != 0 && fGotMessage
!= -1)
198 TranslateMessage(&msg
);
199 DispatchMessageA(&msg
);
202 TRACE("End of message loop\n");
207 static BOOL
CreateRenderingSubsystem(VideoRendererImpl
* This
)
209 This
->hEvent
= CreateEventW(NULL
, FALSE
, FALSE
, NULL
);
213 This
->hThread
= CreateThread(NULL
, 0, MessageLoop
, (LPVOID
)This
, 0, &This
->ThreadID
);
216 CloseHandle(This
->hEvent
);
220 WaitForSingleObject(This
->hEvent
, INFINITE
);
221 CloseHandle(This
->hEvent
);
223 if (!This
->ThreadResult
)
225 CloseHandle(This
->hThread
);
232 static const IMemInputPinVtbl MemInputPin_Vtbl
=
234 MemInputPin_QueryInterface
,
237 MemInputPin_GetAllocator
,
238 MemInputPin_NotifyAllocator
,
239 MemInputPin_GetAllocatorRequirements
,
241 MemInputPin_ReceiveMultiple
,
242 MemInputPin_ReceiveCanBlock
245 static HRESULT
VideoRenderer_InputPin_Construct(const PIN_INFO
* pPinInfo
, SAMPLEPROC pSampleProc
, LPVOID pUserData
, QUERYACCEPTPROC pQueryAccept
, LPCRITICAL_SECTION pCritSec
, IPin
** ppPin
)
251 if (pPinInfo
->dir
!= PINDIR_INPUT
)
253 ERR("Pin direction(%x) != PINDIR_INPUT\n", pPinInfo
->dir
);
257 pPinImpl
= CoTaskMemAlloc(sizeof(*pPinImpl
));
260 return E_OUTOFMEMORY
;
262 if (SUCCEEDED(InputPin_Init(pPinInfo
, pSampleProc
, pUserData
, pQueryAccept
, pCritSec
, pPinImpl
)))
264 pPinImpl
->pin
.lpVtbl
= &VideoRenderer_InputPin_Vtbl
;
265 pPinImpl
->lpVtblMemInput
= &MemInputPin_Vtbl
;
267 *ppPin
= (IPin
*)(&pPinImpl
->pin
.lpVtbl
);
273 static DWORD
VideoRenderer_SendSampleData(VideoRendererImpl
* This
, LPBYTE data
, DWORD size
)
275 VIDEOINFOHEADER
* format
;
281 LPBYTE palette
= NULL
;
284 TRACE("%p %p %d\n", This
, data
, size
);
286 sdesc
.dwSize
= sizeof(sdesc
);
287 hr
= IPin_ConnectionMediaType(This
->ppPins
[0], &amt
);
289 ERR("Unable to retrieve media type\n");
292 format
= (VIDEOINFOHEADER
*)amt
.pbFormat
;
294 TRACE("biSize = %d\n", format
->bmiHeader
.biSize
);
295 TRACE("biWidth = %d\n", format
->bmiHeader
.biWidth
);
296 TRACE("biHeight = %d\n", format
->bmiHeader
.biHeight
);
297 TRACE("biPlanes = %d\n", format
->bmiHeader
.biPlanes
);
298 TRACE("biBitCount = %d\n", format
->bmiHeader
.biBitCount
);
299 TRACE("biCompression = %s\n", debugstr_an((LPSTR
)&(format
->bmiHeader
.biCompression
), 4));
300 TRACE("biSizeImage = %d\n", format
->bmiHeader
.biSizeImage
);
302 width
= format
->bmiHeader
.biWidth
;
303 height
= format
->bmiHeader
.biHeight
;
304 palette
= ((LPBYTE
)&format
->bmiHeader
) + format
->bmiHeader
.biSize
;
308 /* Compute the size of the whole window so the client area size matches video one */
311 GetWindowRect(This
->hWnd
, &wrect
);
312 GetClientRect(This
->hWnd
, &crect
);
313 h
= (wrect
.right
- wrect
.left
) - (crect
.right
- crect
.left
);
314 v
= (wrect
.bottom
- wrect
.top
) - (crect
.bottom
- crect
.top
);
315 SetWindowPos(This
->hWnd
, NULL
, 0, 0, width
+ h
+20, height
+ v
+20, SWP_NOZORDER
|SWP_NOMOVE
);
316 This
->WindowPos
.left
= 0;
317 This
->WindowPos
.top
= 0;
318 This
->WindowPos
.right
= width
;
319 This
->WindowPos
.bottom
= abs(height
);
320 GetClientRect(This
->hWnd
, &This
->DestRect
);
324 hDC
= GetDC(This
->hWnd
);
327 ERR("Cannot get DC from window!\n");
331 TRACE("Src Rect: %d %d %d %d\n", This
->SourceRect
.left
, This
->SourceRect
.top
, This
->SourceRect
.right
, This
->SourceRect
.bottom
);
332 TRACE("Dst Rect: %d %d %d %d\n", This
->DestRect
.left
, This
->DestRect
.top
, This
->DestRect
.right
, This
->DestRect
.bottom
);
334 StretchDIBits(hDC
, This
->DestRect
.left
, This
->DestRect
.top
, This
->DestRect
.right
-This
->DestRect
.left
,
335 This
->DestRect
.bottom
- This
->DestRect
.top
, This
->SourceRect
.left
, This
->SourceRect
.top
,
336 This
->SourceRect
.right
- This
->SourceRect
.left
, This
->SourceRect
.bottom
- This
->SourceRect
.top
,
337 data
, (BITMAPINFO
*)&format
->bmiHeader
, DIB_RGB_COLORS
, SRCCOPY
);
339 ReleaseDC(This
->hWnd
, hDC
);
342 ShowWindow(This
->hWnd
, SW_SHOW
);
347 static HRESULT
VideoRenderer_Sample(LPVOID iface
, IMediaSample
* pSample
)
349 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
350 LPBYTE pbSrcStream
= NULL
;
351 long cbSrcStream
= 0;
352 REFERENCE_TIME tStart
, tStop
;
355 TRACE("%p %p\n", iface
, pSample
);
357 hr
= IMediaSample_GetPointer(pSample
, &pbSrcStream
);
360 ERR("Cannot get pointer to sample data (%x)\n", hr
);
364 hr
= IMediaSample_GetTime(pSample
, &tStart
, &tStop
);
366 ERR("Cannot get sample time (%x)\n", hr
);
368 cbSrcStream
= IMediaSample_GetActualDataLength(pSample
);
370 TRACE("val %p %ld\n", pbSrcStream
, cbSrcStream
);
372 #if 0 /* For debugging purpose */
375 for(i
= 0; i
< cbSrcStream
; i
++)
377 if ((i
!=0) && !(i
%16))
379 TRACE("%02x ", pbSrcStream
[i
]);
385 VideoRenderer_SendSampleData(This
, pbSrcStream
, cbSrcStream
);
390 static HRESULT
VideoRenderer_QueryAccept(LPVOID iface
, const AM_MEDIA_TYPE
* pmt
)
392 if (!IsEqualIID(&pmt
->majortype
, &MEDIATYPE_Video
))
395 if (IsEqualIID(&pmt
->subtype
, &MEDIASUBTYPE_RGB32
) ||
396 IsEqualIID(&pmt
->subtype
, &MEDIASUBTYPE_RGB24
) ||
397 IsEqualIID(&pmt
->subtype
, &MEDIASUBTYPE_RGB565
) ||
398 IsEqualIID(&pmt
->subtype
, &MEDIASUBTYPE_RGB8
))
400 VideoRendererImpl
* This
= (VideoRendererImpl
*) iface
;
401 VIDEOINFOHEADER
* format
= (VIDEOINFOHEADER
*)pmt
->pbFormat
;
403 if (!IsEqualIID(&pmt
->formattype
, &FORMAT_VideoInfo
))
405 WARN("Format type %s not supported\n", debugstr_guid(&pmt
->formattype
));
408 This
->SourceRect
.left
= 0;
409 This
->SourceRect
.top
= 0;
410 This
->SourceRect
.right
= This
->VideoWidth
= format
->bmiHeader
.biWidth
;
411 This
->SourceRect
.bottom
= This
->VideoHeight
= format
->bmiHeader
.biHeight
;
417 HRESULT
VideoRenderer_create(IUnknown
* pUnkOuter
, LPVOID
* ppv
)
421 VideoRendererImpl
* pVideoRenderer
;
423 TRACE("(%p, %p)\n", pUnkOuter
, ppv
);
428 return CLASS_E_NOAGGREGATION
;
430 pVideoRenderer
= CoTaskMemAlloc(sizeof(VideoRendererImpl
));
432 pVideoRenderer
->lpVtbl
= &VideoRenderer_Vtbl
;
433 pVideoRenderer
->IBasicVideo_vtbl
= &IBasicVideo_VTable
;
434 pVideoRenderer
->IVideoWindow_vtbl
= &IVideoWindow_VTable
;
436 pVideoRenderer
->refCount
= 1;
437 InitializeCriticalSection(&pVideoRenderer
->csFilter
);
438 pVideoRenderer
->csFilter
.DebugInfo
->Spare
[0] = (DWORD_PTR
)(__FILE__
": VideoRendererImpl.csFilter");
439 pVideoRenderer
->state
= State_Stopped
;
440 pVideoRenderer
->pClock
= NULL
;
441 pVideoRenderer
->init
= 0;
442 pVideoRenderer
->AutoShow
= 1;
443 ZeroMemory(&pVideoRenderer
->filterInfo
, sizeof(FILTER_INFO
));
445 pVideoRenderer
->ppPins
= CoTaskMemAlloc(1 * sizeof(IPin
*));
447 /* construct input pin */
448 piInput
.dir
= PINDIR_INPUT
;
449 piInput
.pFilter
= (IBaseFilter
*)pVideoRenderer
;
450 lstrcpynW(piInput
.achName
, wcsInputPinName
, sizeof(piInput
.achName
) / sizeof(piInput
.achName
[0]));
452 hr
= VideoRenderer_InputPin_Construct(&piInput
, VideoRenderer_Sample
, (LPVOID
)pVideoRenderer
, VideoRenderer_QueryAccept
, &pVideoRenderer
->csFilter
, (IPin
**)&pVideoRenderer
->pInputPin
);
456 pVideoRenderer
->ppPins
[0] = (IPin
*)pVideoRenderer
->pInputPin
;
457 *ppv
= (LPVOID
)pVideoRenderer
;
461 CoTaskMemFree(pVideoRenderer
->ppPins
);
462 pVideoRenderer
->csFilter
.DebugInfo
->Spare
[0] = 0;
463 DeleteCriticalSection(&pVideoRenderer
->csFilter
);
464 CoTaskMemFree(pVideoRenderer
);
467 if (!CreateRenderingSubsystem(pVideoRenderer
))
473 static HRESULT WINAPI
VideoRenderer_QueryInterface(IBaseFilter
* iface
, REFIID riid
, LPVOID
* ppv
)
475 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
476 TRACE("(%p/%p)->(%s, %p)\n", This
, iface
, qzdebugstr_guid(riid
), ppv
);
480 if (IsEqualIID(riid
, &IID_IUnknown
))
482 else if (IsEqualIID(riid
, &IID_IPersist
))
484 else if (IsEqualIID(riid
, &IID_IMediaFilter
))
486 else if (IsEqualIID(riid
, &IID_IBaseFilter
))
488 else if (IsEqualIID(riid
, &IID_IBasicVideo
))
489 *ppv
= (LPVOID
)&(This
->IBasicVideo_vtbl
);
490 else if (IsEqualIID(riid
, &IID_IVideoWindow
))
491 *ppv
= (LPVOID
)&(This
->IVideoWindow_vtbl
);
495 IUnknown_AddRef((IUnknown
*)(*ppv
));
499 FIXME("No interface for %s!\n", qzdebugstr_guid(riid
));
501 return E_NOINTERFACE
;
504 static ULONG WINAPI
VideoRenderer_AddRef(IBaseFilter
* iface
)
506 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
507 ULONG refCount
= InterlockedIncrement(&This
->refCount
);
509 TRACE("(%p/%p)->() AddRef from %d\n", This
, iface
, refCount
- 1);
514 static ULONG WINAPI
VideoRenderer_Release(IBaseFilter
* iface
)
516 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
517 ULONG refCount
= InterlockedDecrement(&This
->refCount
);
519 TRACE("(%p/%p)->() Release from %d\n", This
, iface
, refCount
+ 1);
525 DestroyWindow(This
->hWnd
);
526 PostThreadMessageA(This
->ThreadID
, WM_QUIT
, 0, 0);
527 WaitForSingleObject(This
->hThread
, INFINITE
);
528 CloseHandle(This
->hThread
);
531 IReferenceClock_Release(This
->pClock
);
533 if (SUCCEEDED(IPin_ConnectedTo(This
->ppPins
[0], &pConnectedTo
)))
535 IPin_Disconnect(pConnectedTo
);
536 IPin_Release(pConnectedTo
);
538 IPin_Disconnect(This
->ppPins
[0]);
540 IPin_Release(This
->ppPins
[0]);
542 CoTaskMemFree(This
->ppPins
);
545 This
->csFilter
.DebugInfo
->Spare
[0] = 0;
546 DeleteCriticalSection(&This
->csFilter
);
548 TRACE("Destroying Video Renderer\n");
557 /** IPersist methods **/
559 static HRESULT WINAPI
VideoRenderer_GetClassID(IBaseFilter
* iface
, CLSID
* pClsid
)
561 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
563 TRACE("(%p/%p)->(%p)\n", This
, iface
, pClsid
);
565 *pClsid
= CLSID_VideoRenderer
;
570 /** IMediaFilter methods **/
572 static HRESULT WINAPI
VideoRenderer_Stop(IBaseFilter
* iface
)
574 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
576 TRACE("(%p/%p)->()\n", This
, iface
);
578 EnterCriticalSection(&This
->csFilter
);
580 This
->state
= State_Stopped
;
582 LeaveCriticalSection(&This
->csFilter
);
587 static HRESULT WINAPI
VideoRenderer_Pause(IBaseFilter
* iface
)
589 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
591 TRACE("(%p/%p)->()\n", This
, iface
);
593 EnterCriticalSection(&This
->csFilter
);
595 This
->state
= State_Paused
;
597 LeaveCriticalSection(&This
->csFilter
);
602 static HRESULT WINAPI
VideoRenderer_Run(IBaseFilter
* iface
, REFERENCE_TIME tStart
)
604 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
606 TRACE("(%p/%p)->(%s)\n", This
, iface
, wine_dbgstr_longlong(tStart
));
608 EnterCriticalSection(&This
->csFilter
);
610 This
->rtStreamStart
= tStart
;
611 This
->state
= State_Running
;
613 LeaveCriticalSection(&This
->csFilter
);
618 static HRESULT WINAPI
VideoRenderer_GetState(IBaseFilter
* iface
, DWORD dwMilliSecsTimeout
, FILTER_STATE
*pState
)
620 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
622 TRACE("(%p/%p)->(%d, %p)\n", This
, iface
, dwMilliSecsTimeout
, pState
);
624 EnterCriticalSection(&This
->csFilter
);
626 *pState
= This
->state
;
628 LeaveCriticalSection(&This
->csFilter
);
633 static HRESULT WINAPI
VideoRenderer_SetSyncSource(IBaseFilter
* iface
, IReferenceClock
*pClock
)
635 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
637 TRACE("(%p/%p)->(%p)\n", This
, iface
, pClock
);
639 EnterCriticalSection(&This
->csFilter
);
642 IReferenceClock_Release(This
->pClock
);
643 This
->pClock
= pClock
;
645 IReferenceClock_AddRef(This
->pClock
);
647 LeaveCriticalSection(&This
->csFilter
);
652 static HRESULT WINAPI
VideoRenderer_GetSyncSource(IBaseFilter
* iface
, IReferenceClock
**ppClock
)
654 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
656 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppClock
);
658 EnterCriticalSection(&This
->csFilter
);
660 *ppClock
= This
->pClock
;
661 IReferenceClock_AddRef(This
->pClock
);
663 LeaveCriticalSection(&This
->csFilter
);
668 /** IBaseFilter implementation **/
670 static HRESULT WINAPI
VideoRenderer_EnumPins(IBaseFilter
* iface
, IEnumPins
**ppEnum
)
673 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
675 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppEnum
);
677 epd
.cPins
= 1; /* input pin */
678 epd
.ppPins
= This
->ppPins
;
679 return IEnumPinsImpl_Construct(&epd
, ppEnum
);
682 static HRESULT WINAPI
VideoRenderer_FindPin(IBaseFilter
* iface
, LPCWSTR Id
, IPin
**ppPin
)
684 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
686 TRACE("(%p/%p)->(%p,%p)\n", This
, iface
, debugstr_w(Id
), ppPin
);
688 FIXME("VideoRenderer::FindPin(...)\n");
690 /* FIXME: critical section */
695 static HRESULT WINAPI
VideoRenderer_QueryFilterInfo(IBaseFilter
* iface
, FILTER_INFO
*pInfo
)
697 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
699 TRACE("(%p/%p)->(%p)\n", This
, iface
, pInfo
);
701 strcpyW(pInfo
->achName
, This
->filterInfo
.achName
);
702 pInfo
->pGraph
= This
->filterInfo
.pGraph
;
705 IFilterGraph_AddRef(pInfo
->pGraph
);
710 static HRESULT WINAPI
VideoRenderer_JoinFilterGraph(IBaseFilter
* iface
, IFilterGraph
*pGraph
, LPCWSTR pName
)
712 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
714 TRACE("(%p/%p)->(%p, %s)\n", This
, iface
, pGraph
, debugstr_w(pName
));
716 EnterCriticalSection(&This
->csFilter
);
719 strcpyW(This
->filterInfo
.achName
, pName
);
721 *This
->filterInfo
.achName
= '\0';
722 This
->filterInfo
.pGraph
= pGraph
; /* NOTE: do NOT increase ref. count */
724 LeaveCriticalSection(&This
->csFilter
);
729 static HRESULT WINAPI
VideoRenderer_QueryVendorInfo(IBaseFilter
* iface
, LPWSTR
*pVendorInfo
)
731 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
732 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVendorInfo
);
736 static const IBaseFilterVtbl VideoRenderer_Vtbl
=
738 VideoRenderer_QueryInterface
,
739 VideoRenderer_AddRef
,
740 VideoRenderer_Release
,
741 VideoRenderer_GetClassID
,
745 VideoRenderer_GetState
,
746 VideoRenderer_SetSyncSource
,
747 VideoRenderer_GetSyncSource
,
748 VideoRenderer_EnumPins
,
749 VideoRenderer_FindPin
,
750 VideoRenderer_QueryFilterInfo
,
751 VideoRenderer_JoinFilterGraph
,
752 VideoRenderer_QueryVendorInfo
755 static HRESULT WINAPI
VideoRenderer_InputPin_EndOfStream(IPin
* iface
)
757 InputPin
* This
= (InputPin
*)iface
;
758 IMediaEventSink
* pEventSink
;
761 TRACE("(%p/%p)->()\n", This
, iface
);
763 hr
= IFilterGraph_QueryInterface(((VideoRendererImpl
*)This
->pin
.pinInfo
.pFilter
)->filterInfo
.pGraph
, &IID_IMediaEventSink
, (LPVOID
*)&pEventSink
);
766 hr
= IMediaEventSink_Notify(pEventSink
, EC_COMPLETE
, S_OK
, 0);
767 IMediaEventSink_Release(pEventSink
);
773 static const IPinVtbl VideoRenderer_InputPin_Vtbl
=
775 InputPin_QueryInterface
,
779 InputPin_ReceiveConnection
,
781 IPinImpl_ConnectedTo
,
782 IPinImpl_ConnectionMediaType
,
783 IPinImpl_QueryPinInfo
,
784 IPinImpl_QueryDirection
,
786 IPinImpl_QueryAccept
,
787 IPinImpl_EnumMediaTypes
,
788 IPinImpl_QueryInternalConnections
,
789 VideoRenderer_InputPin_EndOfStream
,
795 /*** IUnknown methods ***/
796 static HRESULT WINAPI
Basicvideo_QueryInterface(IBasicVideo
*iface
,
799 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
801 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
803 return VideoRenderer_QueryInterface((IBaseFilter
*)This
, riid
, ppvObj
);
806 static ULONG WINAPI
Basicvideo_AddRef(IBasicVideo
*iface
) {
807 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
809 TRACE("(%p/%p)->()\n", This
, iface
);
811 return VideoRenderer_AddRef((IBaseFilter
*)This
);
814 static ULONG WINAPI
Basicvideo_Release(IBasicVideo
*iface
) {
815 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
817 TRACE("(%p/%p)->()\n", This
, iface
);
819 return VideoRenderer_Release((IBaseFilter
*)This
);
822 /*** IDispatch methods ***/
823 static HRESULT WINAPI
Basicvideo_GetTypeInfoCount(IBasicVideo
*iface
,
825 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
827 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
832 static HRESULT WINAPI
Basicvideo_GetTypeInfo(IBasicVideo
*iface
,
835 ITypeInfo
**ppTInfo
) {
836 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
838 FIXME("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
843 static HRESULT WINAPI
Basicvideo_GetIDsOfNames(IBasicVideo
*iface
,
849 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
851 FIXME("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
856 static HRESULT WINAPI
Basicvideo_Invoke(IBasicVideo
*iface
,
861 DISPPARAMS
*pDispParams
,
865 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
867 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
);
872 /*** IBasicVideo methods ***/
873 static HRESULT WINAPI
Basicvideo_get_AvgTimePerFrame(IBasicVideo
*iface
,
874 REFTIME
*pAvgTimePerFrame
) {
875 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
877 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pAvgTimePerFrame
);
882 static HRESULT WINAPI
Basicvideo_get_BitRate(IBasicVideo
*iface
,
884 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
886 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pBitRate
);
891 static HRESULT WINAPI
Basicvideo_get_BitErrorRate(IBasicVideo
*iface
,
892 long *pBitErrorRate
) {
893 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
895 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pBitErrorRate
);
900 static HRESULT WINAPI
Basicvideo_get_VideoWidth(IBasicVideo
*iface
,
902 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
904 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoWidth
);
906 *pVideoWidth
= This
->VideoWidth
;
911 static HRESULT WINAPI
Basicvideo_get_VideoHeight(IBasicVideo
*iface
,
912 long *pVideoHeight
) {
913 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
915 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoHeight
);
917 *pVideoHeight
= This
->VideoHeight
;
922 static HRESULT WINAPI
Basicvideo_put_SourceLeft(IBasicVideo
*iface
,
924 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
926 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceLeft
);
928 This
->SourceRect
.left
= SourceLeft
;
933 static HRESULT WINAPI
Basicvideo_get_SourceLeft(IBasicVideo
*iface
,
935 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
937 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceLeft
);
939 *pSourceLeft
= This
->SourceRect
.left
;
944 static HRESULT WINAPI
Basicvideo_put_SourceWidth(IBasicVideo
*iface
,
946 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
948 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceWidth
);
950 This
->SourceRect
.right
= This
->SourceRect
.left
+ SourceWidth
;
955 static HRESULT WINAPI
Basicvideo_get_SourceWidth(IBasicVideo
*iface
,
956 long *pSourceWidth
) {
957 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
959 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceWidth
);
961 *pSourceWidth
= This
->SourceRect
.right
- This
->SourceRect
.left
;
966 static HRESULT WINAPI
Basicvideo_put_SourceTop(IBasicVideo
*iface
,
968 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
970 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceTop
);
972 This
->SourceRect
.top
= SourceTop
;
977 static HRESULT WINAPI
Basicvideo_get_SourceTop(IBasicVideo
*iface
,
979 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
981 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceTop
);
983 *pSourceTop
= This
->SourceRect
.top
;
988 static HRESULT WINAPI
Basicvideo_put_SourceHeight(IBasicVideo
*iface
,
990 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
992 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceHeight
);
994 This
->SourceRect
.bottom
= This
->SourceRect
.top
+ SourceHeight
;
999 static HRESULT WINAPI
Basicvideo_get_SourceHeight(IBasicVideo
*iface
,
1000 long *pSourceHeight
) {
1001 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1003 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceHeight
);
1005 *pSourceHeight
= This
->SourceRect
.bottom
- This
->SourceRect
.top
;
1010 static HRESULT WINAPI
Basicvideo_put_DestinationLeft(IBasicVideo
*iface
,
1011 long DestinationLeft
) {
1012 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1014 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationLeft
);
1016 This
->DestRect
.left
= DestinationLeft
;
1021 static HRESULT WINAPI
Basicvideo_get_DestinationLeft(IBasicVideo
*iface
,
1022 long *pDestinationLeft
) {
1023 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1025 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationLeft
);
1027 *pDestinationLeft
= This
->DestRect
.left
;
1032 static HRESULT WINAPI
Basicvideo_put_DestinationWidth(IBasicVideo
*iface
,
1033 long DestinationWidth
) {
1034 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1036 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationWidth
);
1038 This
->DestRect
.right
= This
->DestRect
.left
+ DestinationWidth
;
1043 static HRESULT WINAPI
Basicvideo_get_DestinationWidth(IBasicVideo
*iface
,
1044 long *pDestinationWidth
) {
1045 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1047 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationWidth
);
1049 *pDestinationWidth
= This
->DestRect
.right
- This
->DestRect
.left
;
1054 static HRESULT WINAPI
Basicvideo_put_DestinationTop(IBasicVideo
*iface
,
1055 long DestinationTop
) {
1056 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1058 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationTop
);
1060 This
->DestRect
.top
= DestinationTop
;
1065 static HRESULT WINAPI
Basicvideo_get_DestinationTop(IBasicVideo
*iface
,
1066 long *pDestinationTop
) {
1067 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1069 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationTop
);
1071 *pDestinationTop
= This
->DestRect
.top
;
1076 static HRESULT WINAPI
Basicvideo_put_DestinationHeight(IBasicVideo
*iface
,
1077 long DestinationHeight
) {
1078 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1080 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationHeight
);
1082 This
->DestRect
.right
= This
->DestRect
.left
+ DestinationHeight
;
1087 static HRESULT WINAPI
Basicvideo_get_DestinationHeight(IBasicVideo
*iface
,
1088 long *pDestinationHeight
) {
1089 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1091 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationHeight
);
1093 *pDestinationHeight
= This
->DestRect
.right
- This
->DestRect
.left
;
1098 static HRESULT WINAPI
Basicvideo_SetSourcePosition(IBasicVideo
*iface
,
1103 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1105 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
1107 This
->SourceRect
.left
= Left
;
1108 This
->SourceRect
.top
= Top
;
1109 This
->SourceRect
.right
= Left
+ Width
;
1110 This
->SourceRect
.bottom
= Top
+ Height
;
1115 static HRESULT WINAPI
Basicvideo_GetSourcePosition(IBasicVideo
*iface
,
1120 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1122 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
1124 *pLeft
= This
->SourceRect
.left
;
1125 *pTop
= This
->SourceRect
.top
;
1126 *pWidth
= This
->SourceRect
.right
- This
->SourceRect
.left
;
1127 *pHeight
= This
->SourceRect
.bottom
- This
->SourceRect
.top
;
1132 static HRESULT WINAPI
Basicvideo_SetDefaultSourcePosition(IBasicVideo
*iface
) {
1133 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1135 TRACE("(%p/%p)->()\n", This
, iface
);
1137 This
->SourceRect
.left
= 0;
1138 This
->SourceRect
.top
= 0;
1139 This
->SourceRect
.right
= This
->VideoWidth
;
1140 This
->SourceRect
.bottom
= This
->VideoHeight
;
1145 static HRESULT WINAPI
Basicvideo_SetDestinationPosition(IBasicVideo
*iface
,
1150 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1152 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
1154 This
->DestRect
.left
= Left
;
1155 This
->DestRect
.top
= Top
;
1156 This
->DestRect
.right
= Left
+ Width
;
1157 This
->DestRect
.bottom
= Top
+ Height
;
1162 static HRESULT WINAPI
Basicvideo_GetDestinationPosition(IBasicVideo
*iface
,
1167 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1169 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
1171 *pLeft
= This
->DestRect
.left
;
1172 *pTop
= This
->DestRect
.top
;
1173 *pWidth
= This
->DestRect
.right
- This
->DestRect
.left
;
1174 *pHeight
= This
->DestRect
.bottom
- This
->DestRect
.top
;
1179 static HRESULT WINAPI
Basicvideo_SetDefaultDestinationPosition(IBasicVideo
*iface
) {
1180 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1183 TRACE("(%p/%p)->()\n", This
, iface
);
1185 if (!GetClientRect(This
->hWnd
, &rect
))
1188 This
->SourceRect
.left
= 0;
1189 This
->SourceRect
.top
= 0;
1190 This
->SourceRect
.right
= rect
.right
;
1191 This
->SourceRect
.bottom
= rect
.bottom
;
1196 static HRESULT WINAPI
Basicvideo_GetVideoSize(IBasicVideo
*iface
,
1199 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1201 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
1203 *pWidth
= This
->VideoWidth
;
1204 *pHeight
= This
->VideoHeight
;
1209 static HRESULT WINAPI
Basicvideo_GetVideoPaletteEntries(IBasicVideo
*iface
,
1214 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1216 FIXME("(%p/%p)->(%ld, %ld, %p, %p): stub !!!\n", This
, iface
, StartIndex
, Entries
, pRetrieved
, pPalette
);
1221 static HRESULT WINAPI
Basicvideo_GetCurrentImage(IBasicVideo
*iface
,
1224 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1226 FIXME("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pBufferSize
, pDIBImage
);
1231 static HRESULT WINAPI
Basicvideo_IsUsingDefaultSource(IBasicVideo
*iface
) {
1232 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1234 FIXME("(%p/%p)->(): stub !!!\n", This
, iface
);
1239 static HRESULT WINAPI
Basicvideo_IsUsingDefaultDestination(IBasicVideo
*iface
) {
1240 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1242 FIXME("(%p/%p)->(): stub !!!\n", This
, iface
);
1248 static const IBasicVideoVtbl IBasicVideo_VTable
=
1250 Basicvideo_QueryInterface
,
1253 Basicvideo_GetTypeInfoCount
,
1254 Basicvideo_GetTypeInfo
,
1255 Basicvideo_GetIDsOfNames
,
1257 Basicvideo_get_AvgTimePerFrame
,
1258 Basicvideo_get_BitRate
,
1259 Basicvideo_get_BitErrorRate
,
1260 Basicvideo_get_VideoWidth
,
1261 Basicvideo_get_VideoHeight
,
1262 Basicvideo_put_SourceLeft
,
1263 Basicvideo_get_SourceLeft
,
1264 Basicvideo_put_SourceWidth
,
1265 Basicvideo_get_SourceWidth
,
1266 Basicvideo_put_SourceTop
,
1267 Basicvideo_get_SourceTop
,
1268 Basicvideo_put_SourceHeight
,
1269 Basicvideo_get_SourceHeight
,
1270 Basicvideo_put_DestinationLeft
,
1271 Basicvideo_get_DestinationLeft
,
1272 Basicvideo_put_DestinationWidth
,
1273 Basicvideo_get_DestinationWidth
,
1274 Basicvideo_put_DestinationTop
,
1275 Basicvideo_get_DestinationTop
,
1276 Basicvideo_put_DestinationHeight
,
1277 Basicvideo_get_DestinationHeight
,
1278 Basicvideo_SetSourcePosition
,
1279 Basicvideo_GetSourcePosition
,
1280 Basicvideo_SetDefaultSourcePosition
,
1281 Basicvideo_SetDestinationPosition
,
1282 Basicvideo_GetDestinationPosition
,
1283 Basicvideo_SetDefaultDestinationPosition
,
1284 Basicvideo_GetVideoSize
,
1285 Basicvideo_GetVideoPaletteEntries
,
1286 Basicvideo_GetCurrentImage
,
1287 Basicvideo_IsUsingDefaultSource
,
1288 Basicvideo_IsUsingDefaultDestination
1292 /*** IUnknown methods ***/
1293 static HRESULT WINAPI
Videowindow_QueryInterface(IVideoWindow
*iface
,
1296 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1298 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1300 return VideoRenderer_QueryInterface((IBaseFilter
*)This
, riid
, ppvObj
);
1303 static ULONG WINAPI
Videowindow_AddRef(IVideoWindow
*iface
) {
1304 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1306 TRACE("(%p/%p)->()\n", This
, iface
);
1308 return VideoRenderer_AddRef((IBaseFilter
*)This
);
1311 static ULONG WINAPI
Videowindow_Release(IVideoWindow
*iface
) {
1312 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1314 TRACE("(%p/%p)->()\n", This
, iface
);
1316 return VideoRenderer_Release((IBaseFilter
*)This
);
1319 /*** IDispatch methods ***/
1320 static HRESULT WINAPI
Videowindow_GetTypeInfoCount(IVideoWindow
*iface
,
1322 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1324 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1329 static HRESULT WINAPI
Videowindow_GetTypeInfo(IVideoWindow
*iface
,
1332 ITypeInfo
**ppTInfo
) {
1333 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1335 FIXME("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1340 static HRESULT WINAPI
Videowindow_GetIDsOfNames(IVideoWindow
*iface
,
1346 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1348 FIXME("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1353 static HRESULT WINAPI
Videowindow_Invoke(IVideoWindow
*iface
,
1354 DISPID dispIdMember
,
1358 DISPPARAMS
*pDispParams
,
1360 EXCEPINFO
*pExepInfo
,
1362 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1364 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
);
1369 /*** IVideoWindow methods ***/
1370 static HRESULT WINAPI
Videowindow_put_Caption(IVideoWindow
*iface
,
1372 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1374 TRACE("(%p/%p)->(%s (%p))\n", This
, iface
, debugstr_w(strCaption
), strCaption
);
1376 if (!SetWindowTextW(This
->hWnd
, strCaption
))
1382 static HRESULT WINAPI
Videowindow_get_Caption(IVideoWindow
*iface
,
1384 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1386 TRACE("(%p/%p)->(%p)\n", This
, iface
, strCaption
);
1388 GetWindowTextW(This
->hWnd
, (LPWSTR
)strCaption
, 100);
1393 static HRESULT WINAPI
Videowindow_put_WindowStyle(IVideoWindow
*iface
,
1395 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1398 old
= GetWindowLongA(This
->hWnd
, GWL_STYLE
);
1400 TRACE("(%p/%p)->(%x -> %lx)\n", This
, iface
, old
, WindowStyle
);
1402 if (WindowStyle
& (WS_DISABLED
|WS_HSCROLL
|WS_ICONIC
|WS_MAXIMIZE
|WS_MINIMIZE
|WS_VSCROLL
))
1403 return E_INVALIDARG
;
1405 SetWindowLongA(This
->hWnd
, GWL_STYLE
, WindowStyle
);
1410 static HRESULT WINAPI
Videowindow_get_WindowStyle(IVideoWindow
*iface
,
1411 long *WindowStyle
) {
1412 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1414 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyle
);
1416 *WindowStyle
= GetWindowLongA(This
->hWnd
, GWL_STYLE
);
1421 static HRESULT WINAPI
Videowindow_put_WindowStyleEx(IVideoWindow
*iface
,
1422 long WindowStyleEx
) {
1423 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1425 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyleEx
);
1427 if (WindowStyleEx
& (WS_DISABLED
|WS_HSCROLL
|WS_ICONIC
|WS_MAXIMIZE
|WS_MINIMIZE
|WS_VSCROLL
))
1428 return E_INVALIDARG
;
1430 if (!SetWindowLongA(This
->hWnd
, GWL_EXSTYLE
, WindowStyleEx
))
1436 static HRESULT WINAPI
Videowindow_get_WindowStyleEx(IVideoWindow
*iface
,
1437 long *WindowStyleEx
) {
1438 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1440 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyleEx
);
1442 *WindowStyleEx
= GetWindowLongA(This
->hWnd
, GWL_EXSTYLE
);
1447 static HRESULT WINAPI
Videowindow_put_AutoShow(IVideoWindow
*iface
,
1449 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1451 TRACE("(%p/%p)->(%ld)\n", This
, iface
, AutoShow
);
1453 This
->AutoShow
= 1; /* FXIME: Should be AutoShow */;
1458 static HRESULT WINAPI
Videowindow_get_AutoShow(IVideoWindow
*iface
,
1460 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1462 TRACE("(%p/%p)->(%p)\n", This
, iface
, AutoShow
);
1464 *AutoShow
= This
->AutoShow
;
1469 static HRESULT WINAPI
Videowindow_put_WindowState(IVideoWindow
*iface
,
1471 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1473 FIXME("(%p/%p)->(%ld): stub !!!\n", This
, iface
, WindowState
);
1478 static HRESULT WINAPI
Videowindow_get_WindowState(IVideoWindow
*iface
,
1479 long *WindowState
) {
1480 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1482 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, WindowState
);
1487 static HRESULT WINAPI
Videowindow_put_BackgroundPalette(IVideoWindow
*iface
,
1488 long BackgroundPalette
) {
1489 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1491 FIXME("(%p/%p)->(%ld): stub !!!\n", This
, iface
, BackgroundPalette
);
1496 static HRESULT WINAPI
Videowindow_get_BackgroundPalette(IVideoWindow
*iface
,
1497 long *pBackgroundPalette
) {
1498 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1500 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pBackgroundPalette
);
1505 static HRESULT WINAPI
Videowindow_put_Visible(IVideoWindow
*iface
,
1507 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1509 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Visible
);
1511 ShowWindow(This
->hWnd
, Visible
? SW_SHOW
: SW_HIDE
);
1516 static HRESULT WINAPI
Videowindow_get_Visible(IVideoWindow
*iface
,
1518 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1520 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVisible
);
1522 *pVisible
= IsWindowVisible(This
->hWnd
);
1527 static HRESULT WINAPI
Videowindow_put_Left(IVideoWindow
*iface
,
1529 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1531 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Left
);
1533 if (!SetWindowPos(This
->hWnd
, NULL
, Left
, This
->WindowPos
.top
, 0, 0, SWP_NOZORDER
|SWP_NOSIZE
))
1536 This
->WindowPos
.left
= Left
;
1541 static HRESULT WINAPI
Videowindow_get_Left(IVideoWindow
*iface
,
1543 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1545 TRACE("(%p/%p)->(%p)\n", This
, iface
, pLeft
);
1547 *pLeft
= This
->WindowPos
.left
;
1552 static HRESULT WINAPI
Videowindow_put_Width(IVideoWindow
*iface
,
1554 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1556 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Width
);
1558 if (!SetWindowPos(This
->hWnd
, NULL
, 0, 0, Width
, This
->WindowPos
.bottom
-This
->WindowPos
.top
, SWP_NOZORDER
|SWP_NOMOVE
))
1561 This
->WindowPos
.right
= This
->WindowPos
.left
+ Width
;
1566 static HRESULT WINAPI
Videowindow_get_Width(IVideoWindow
*iface
,
1568 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1570 TRACE("(%p/%p)->(%p)\n", This
, iface
, pWidth
);
1572 *pWidth
= This
->WindowPos
.right
- This
->WindowPos
.left
;
1577 static HRESULT WINAPI
Videowindow_put_Top(IVideoWindow
*iface
,
1579 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1581 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Top
);
1583 if (!SetWindowPos(This
->hWnd
, NULL
, This
->WindowPos
.left
, Top
, 0, 0, SWP_NOZORDER
|SWP_NOSIZE
))
1586 This
->WindowPos
.top
= Top
;
1591 static HRESULT WINAPI
Videowindow_get_Top(IVideoWindow
*iface
,
1593 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1595 TRACE("(%p/%p)->(%p)\n", This
, iface
, pTop
);
1597 *pTop
= This
->WindowPos
.top
;
1602 static HRESULT WINAPI
Videowindow_put_Height(IVideoWindow
*iface
,
1604 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1606 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Height
);
1608 if (!SetWindowPos(This
->hWnd
, NULL
, 0, 0, This
->WindowPos
.right
-This
->WindowPos
.left
, Height
, SWP_NOZORDER
|SWP_NOMOVE
))
1611 This
->WindowPos
.bottom
= This
->WindowPos
.top
+ Height
;
1616 static HRESULT WINAPI
Videowindow_get_Height(IVideoWindow
*iface
,
1618 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1620 TRACE("(%p/%p)->(%p)\n", This
, iface
, pHeight
);
1622 *pHeight
= This
->WindowPos
.bottom
- This
->WindowPos
.top
;
1627 static HRESULT WINAPI
Videowindow_put_Owner(IVideoWindow
*iface
,
1629 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1631 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Owner
);
1633 SetParent(This
->hWnd
, (HWND
)Owner
);
1638 static HRESULT WINAPI
Videowindow_get_Owner(IVideoWindow
*iface
,
1640 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1642 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Owner
);
1644 *(HWND
*)Owner
= GetParent(This
->hWnd
);
1649 static HRESULT WINAPI
Videowindow_put_MessageDrain(IVideoWindow
*iface
,
1651 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1653 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Drain
);
1655 This
->hWndMsgDrain
= (HWND
)Drain
;
1660 static HRESULT WINAPI
Videowindow_get_MessageDrain(IVideoWindow
*iface
,
1662 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1664 TRACE("(%p/%p)->(%p)\n", This
, iface
, Drain
);
1666 *Drain
= (OAHWND
)This
->hWndMsgDrain
;
1671 static HRESULT WINAPI
Videowindow_get_BorderColor(IVideoWindow
*iface
,
1673 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1675 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, Color
);
1680 static HRESULT WINAPI
Videowindow_put_BorderColor(IVideoWindow
*iface
,
1682 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1684 FIXME("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Color
);
1689 static HRESULT WINAPI
Videowindow_get_FullScreenMode(IVideoWindow
*iface
,
1690 long *FullScreenMode
) {
1691 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1693 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, FullScreenMode
);
1698 static HRESULT WINAPI
Videowindow_put_FullScreenMode(IVideoWindow
*iface
,
1699 long FullScreenMode
) {
1700 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1702 FIXME("(%p/%p)->(%ld): stub !!!\n", This
, iface
, FullScreenMode
);
1707 static HRESULT WINAPI
Videowindow_SetWindowForeground(IVideoWindow
*iface
,
1709 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1714 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Focus
);
1716 if ((Focus
!= FALSE
) && (Focus
!= TRUE
))
1717 return E_INVALIDARG
;
1719 hr
= IPin_ConnectedTo(This
->ppPins
[0], &pPin
);
1720 if ((hr
!= S_OK
) || !pPin
)
1721 return VFW_E_NOT_CONNECTED
;
1724 ret
= SetForegroundWindow(This
->hWnd
);
1726 ret
= SetWindowPos(This
->hWnd
, HWND_TOP
, 0, 0, 0, 0, SWP_NOMOVE
|SWP_NOSIZE
);
1734 static HRESULT WINAPI
Videowindow_NotifyOwnerMessage(IVideoWindow
*iface
,
1739 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1741 TRACE("(%p/%p)->(%08x, %ld, %08lx, %08lx)\n", This
, iface
, (DWORD
) hwnd
, uMsg
, wParam
, lParam
);
1743 if (!PostMessageA(This
->hWnd
, uMsg
, wParam
, lParam
))
1749 static HRESULT WINAPI
Videowindow_SetWindowPosition(IVideoWindow
*iface
,
1754 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1756 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
1758 if (!SetWindowPos(This
->hWnd
, NULL
, Left
, Top
, Width
, Height
, SWP_NOZORDER
))
1761 This
->WindowPos
.left
= Left
;
1762 This
->WindowPos
.top
= Top
;
1763 This
->WindowPos
.right
= Left
+ Width
;
1764 This
->WindowPos
.bottom
= Top
+ Height
;
1769 static HRESULT WINAPI
Videowindow_GetWindowPosition(IVideoWindow
*iface
,
1774 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1776 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
1778 *pLeft
= This
->WindowPos
.left
;
1779 *pTop
= This
->WindowPos
.top
;
1780 *pWidth
= This
->WindowPos
.right
- This
->WindowPos
.left
;
1781 *pHeight
= This
->WindowPos
.bottom
- This
->WindowPos
.top
;
1786 static HRESULT WINAPI
Videowindow_GetMinIdealImageSize(IVideoWindow
*iface
,
1789 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1791 FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This
, iface
, pWidth
, pHeight
);
1793 *pWidth
= This
->VideoWidth
;
1794 *pHeight
= This
->VideoHeight
;
1799 static HRESULT WINAPI
Videowindow_GetMaxIdealImageSize(IVideoWindow
*iface
,
1802 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1804 FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This
, iface
, pWidth
, pHeight
);
1806 *pWidth
= This
->VideoWidth
;
1807 *pHeight
= This
->VideoHeight
;
1812 static HRESULT WINAPI
Videowindow_GetRestorePosition(IVideoWindow
*iface
,
1817 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1819 FIXME("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
1824 static HRESULT WINAPI
Videowindow_HideCursor(IVideoWindow
*iface
,
1826 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1828 FIXME("(%p/%p)->(%ld): stub !!!\n", This
, iface
, HideCursor
);
1833 static HRESULT WINAPI
Videowindow_IsCursorHidden(IVideoWindow
*iface
,
1834 long *CursorHidden
) {
1835 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1837 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, CursorHidden
);
1842 static const IVideoWindowVtbl IVideoWindow_VTable
=
1844 Videowindow_QueryInterface
,
1846 Videowindow_Release
,
1847 Videowindow_GetTypeInfoCount
,
1848 Videowindow_GetTypeInfo
,
1849 Videowindow_GetIDsOfNames
,
1851 Videowindow_put_Caption
,
1852 Videowindow_get_Caption
,
1853 Videowindow_put_WindowStyle
,
1854 Videowindow_get_WindowStyle
,
1855 Videowindow_put_WindowStyleEx
,
1856 Videowindow_get_WindowStyleEx
,
1857 Videowindow_put_AutoShow
,
1858 Videowindow_get_AutoShow
,
1859 Videowindow_put_WindowState
,
1860 Videowindow_get_WindowState
,
1861 Videowindow_put_BackgroundPalette
,
1862 Videowindow_get_BackgroundPalette
,
1863 Videowindow_put_Visible
,
1864 Videowindow_get_Visible
,
1865 Videowindow_put_Left
,
1866 Videowindow_get_Left
,
1867 Videowindow_put_Width
,
1868 Videowindow_get_Width
,
1869 Videowindow_put_Top
,
1870 Videowindow_get_Top
,
1871 Videowindow_put_Height
,
1872 Videowindow_get_Height
,
1873 Videowindow_put_Owner
,
1874 Videowindow_get_Owner
,
1875 Videowindow_put_MessageDrain
,
1876 Videowindow_get_MessageDrain
,
1877 Videowindow_get_BorderColor
,
1878 Videowindow_put_BorderColor
,
1879 Videowindow_get_FullScreenMode
,
1880 Videowindow_put_FullScreenMode
,
1881 Videowindow_SetWindowForeground
,
1882 Videowindow_NotifyOwnerMessage
,
1883 Videowindow_SetWindowPosition
,
1884 Videowindow_GetWindowPosition
,
1885 Videowindow_GetMinIdealImageSize
,
1886 Videowindow_GetMaxIdealImageSize
,
1887 Videowindow_GetRestorePosition
,
1888 Videowindow_HideCursor
,
1889 Videowindow_IsCursorHidden