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);
525 This
->csFilter
.DebugInfo
->Spare
[0] = 0;
526 DeleteCriticalSection(&This
->csFilter
);
528 DestroyWindow(This
->hWnd
);
529 PostThreadMessageA(This
->ThreadID
, WM_QUIT
, 0, 0);
530 WaitForSingleObject(This
->hThread
, INFINITE
);
531 CloseHandle(This
->hThread
);
534 IReferenceClock_Release(This
->pClock
);
536 IPin_Release(This
->ppPins
[0]);
538 CoTaskMemFree(This
->ppPins
);
541 TRACE("Destroying Video Renderer\n");
550 /** IPersist methods **/
552 static HRESULT WINAPI
VideoRenderer_GetClassID(IBaseFilter
* iface
, CLSID
* pClsid
)
554 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
556 TRACE("(%p/%p)->(%p)\n", This
, iface
, pClsid
);
558 *pClsid
= CLSID_VideoRenderer
;
563 /** IMediaFilter methods **/
565 static HRESULT WINAPI
VideoRenderer_Stop(IBaseFilter
* iface
)
567 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
569 TRACE("(%p/%p)->()\n", This
, iface
);
571 EnterCriticalSection(&This
->csFilter
);
573 This
->state
= State_Stopped
;
575 LeaveCriticalSection(&This
->csFilter
);
580 static HRESULT WINAPI
VideoRenderer_Pause(IBaseFilter
* iface
)
582 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
584 TRACE("(%p/%p)->()\n", This
, iface
);
586 EnterCriticalSection(&This
->csFilter
);
588 This
->state
= State_Paused
;
590 LeaveCriticalSection(&This
->csFilter
);
595 static HRESULT WINAPI
VideoRenderer_Run(IBaseFilter
* iface
, REFERENCE_TIME tStart
)
597 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
599 TRACE("(%p/%p)->(%s)\n", This
, iface
, wine_dbgstr_longlong(tStart
));
601 EnterCriticalSection(&This
->csFilter
);
603 This
->rtStreamStart
= tStart
;
604 This
->state
= State_Running
;
606 LeaveCriticalSection(&This
->csFilter
);
611 static HRESULT WINAPI
VideoRenderer_GetState(IBaseFilter
* iface
, DWORD dwMilliSecsTimeout
, FILTER_STATE
*pState
)
613 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
615 TRACE("(%p/%p)->(%d, %p)\n", This
, iface
, dwMilliSecsTimeout
, pState
);
617 EnterCriticalSection(&This
->csFilter
);
619 *pState
= This
->state
;
621 LeaveCriticalSection(&This
->csFilter
);
626 static HRESULT WINAPI
VideoRenderer_SetSyncSource(IBaseFilter
* iface
, IReferenceClock
*pClock
)
628 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
630 TRACE("(%p/%p)->(%p)\n", This
, iface
, pClock
);
632 EnterCriticalSection(&This
->csFilter
);
635 IReferenceClock_Release(This
->pClock
);
636 This
->pClock
= pClock
;
638 IReferenceClock_AddRef(This
->pClock
);
640 LeaveCriticalSection(&This
->csFilter
);
645 static HRESULT WINAPI
VideoRenderer_GetSyncSource(IBaseFilter
* iface
, IReferenceClock
**ppClock
)
647 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
649 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppClock
);
651 EnterCriticalSection(&This
->csFilter
);
653 *ppClock
= This
->pClock
;
654 IReferenceClock_AddRef(This
->pClock
);
656 LeaveCriticalSection(&This
->csFilter
);
661 /** IBaseFilter implementation **/
663 static HRESULT WINAPI
VideoRenderer_EnumPins(IBaseFilter
* iface
, IEnumPins
**ppEnum
)
666 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
668 TRACE("(%p/%p)->(%p)\n", This
, iface
, ppEnum
);
670 epd
.cPins
= 1; /* input pin */
671 epd
.ppPins
= This
->ppPins
;
672 return IEnumPinsImpl_Construct(&epd
, ppEnum
);
675 static HRESULT WINAPI
VideoRenderer_FindPin(IBaseFilter
* iface
, LPCWSTR Id
, IPin
**ppPin
)
677 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
679 TRACE("(%p/%p)->(%p,%p)\n", This
, iface
, debugstr_w(Id
), ppPin
);
681 FIXME("VideoRenderer::FindPin(...)\n");
683 /* FIXME: critical section */
688 static HRESULT WINAPI
VideoRenderer_QueryFilterInfo(IBaseFilter
* iface
, FILTER_INFO
*pInfo
)
690 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
692 TRACE("(%p/%p)->(%p)\n", This
, iface
, pInfo
);
694 strcpyW(pInfo
->achName
, This
->filterInfo
.achName
);
695 pInfo
->pGraph
= This
->filterInfo
.pGraph
;
698 IFilterGraph_AddRef(pInfo
->pGraph
);
703 static HRESULT WINAPI
VideoRenderer_JoinFilterGraph(IBaseFilter
* iface
, IFilterGraph
*pGraph
, LPCWSTR pName
)
705 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
707 TRACE("(%p/%p)->(%p, %s)\n", This
, iface
, pGraph
, debugstr_w(pName
));
709 EnterCriticalSection(&This
->csFilter
);
712 strcpyW(This
->filterInfo
.achName
, pName
);
714 *This
->filterInfo
.achName
= '\0';
715 This
->filterInfo
.pGraph
= pGraph
; /* NOTE: do NOT increase ref. count */
717 LeaveCriticalSection(&This
->csFilter
);
722 static HRESULT WINAPI
VideoRenderer_QueryVendorInfo(IBaseFilter
* iface
, LPWSTR
*pVendorInfo
)
724 VideoRendererImpl
*This
= (VideoRendererImpl
*)iface
;
725 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVendorInfo
);
729 static const IBaseFilterVtbl VideoRenderer_Vtbl
=
731 VideoRenderer_QueryInterface
,
732 VideoRenderer_AddRef
,
733 VideoRenderer_Release
,
734 VideoRenderer_GetClassID
,
738 VideoRenderer_GetState
,
739 VideoRenderer_SetSyncSource
,
740 VideoRenderer_GetSyncSource
,
741 VideoRenderer_EnumPins
,
742 VideoRenderer_FindPin
,
743 VideoRenderer_QueryFilterInfo
,
744 VideoRenderer_JoinFilterGraph
,
745 VideoRenderer_QueryVendorInfo
748 static HRESULT WINAPI
VideoRenderer_InputPin_EndOfStream(IPin
* iface
)
750 InputPin
* This
= (InputPin
*)iface
;
751 IMediaEventSink
* pEventSink
;
754 TRACE("(%p/%p)->()\n", This
, iface
);
756 hr
= IFilterGraph_QueryInterface(((VideoRendererImpl
*)This
->pin
.pinInfo
.pFilter
)->filterInfo
.pGraph
, &IID_IMediaEventSink
, (LPVOID
*)&pEventSink
);
759 hr
= IMediaEventSink_Notify(pEventSink
, EC_COMPLETE
, S_OK
, 0);
760 IMediaEventSink_Release(pEventSink
);
766 static const IPinVtbl VideoRenderer_InputPin_Vtbl
=
768 InputPin_QueryInterface
,
772 InputPin_ReceiveConnection
,
774 IPinImpl_ConnectedTo
,
775 IPinImpl_ConnectionMediaType
,
776 IPinImpl_QueryPinInfo
,
777 IPinImpl_QueryDirection
,
779 IPinImpl_QueryAccept
,
780 IPinImpl_EnumMediaTypes
,
781 IPinImpl_QueryInternalConnections
,
782 VideoRenderer_InputPin_EndOfStream
,
788 /*** IUnknown methods ***/
789 static HRESULT WINAPI
Basicvideo_QueryInterface(IBasicVideo
*iface
,
792 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
794 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
796 return VideoRenderer_QueryInterface((IBaseFilter
*)This
, riid
, ppvObj
);
799 static ULONG WINAPI
Basicvideo_AddRef(IBasicVideo
*iface
) {
800 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
802 TRACE("(%p/%p)->()\n", This
, iface
);
804 return VideoRenderer_AddRef((IBaseFilter
*)This
);
807 static ULONG WINAPI
Basicvideo_Release(IBasicVideo
*iface
) {
808 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
810 TRACE("(%p/%p)->()\n", This
, iface
);
812 return VideoRenderer_Release((IBaseFilter
*)This
);
815 /*** IDispatch methods ***/
816 static HRESULT WINAPI
Basicvideo_GetTypeInfoCount(IBasicVideo
*iface
,
818 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
820 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
825 static HRESULT WINAPI
Basicvideo_GetTypeInfo(IBasicVideo
*iface
,
828 ITypeInfo
**ppTInfo
) {
829 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
831 FIXME("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
836 static HRESULT WINAPI
Basicvideo_GetIDsOfNames(IBasicVideo
*iface
,
842 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
844 FIXME("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
849 static HRESULT WINAPI
Basicvideo_Invoke(IBasicVideo
*iface
,
854 DISPPARAMS
*pDispParams
,
858 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
860 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
);
865 /*** IBasicVideo methods ***/
866 static HRESULT WINAPI
Basicvideo_get_AvgTimePerFrame(IBasicVideo
*iface
,
867 REFTIME
*pAvgTimePerFrame
) {
868 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
870 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pAvgTimePerFrame
);
875 static HRESULT WINAPI
Basicvideo_get_BitRate(IBasicVideo
*iface
,
877 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
879 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pBitRate
);
884 static HRESULT WINAPI
Basicvideo_get_BitErrorRate(IBasicVideo
*iface
,
885 long *pBitErrorRate
) {
886 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
888 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pBitErrorRate
);
893 static HRESULT WINAPI
Basicvideo_get_VideoWidth(IBasicVideo
*iface
,
895 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
897 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoWidth
);
899 *pVideoWidth
= This
->VideoWidth
;
904 static HRESULT WINAPI
Basicvideo_get_VideoHeight(IBasicVideo
*iface
,
905 long *pVideoHeight
) {
906 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
908 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoHeight
);
910 *pVideoHeight
= This
->VideoHeight
;
915 static HRESULT WINAPI
Basicvideo_put_SourceLeft(IBasicVideo
*iface
,
917 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
919 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceLeft
);
921 This
->SourceRect
.left
= SourceLeft
;
926 static HRESULT WINAPI
Basicvideo_get_SourceLeft(IBasicVideo
*iface
,
928 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
930 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceLeft
);
932 *pSourceLeft
= This
->SourceRect
.left
;
937 static HRESULT WINAPI
Basicvideo_put_SourceWidth(IBasicVideo
*iface
,
939 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
941 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceWidth
);
943 This
->SourceRect
.right
= This
->SourceRect
.left
+ SourceWidth
;
948 static HRESULT WINAPI
Basicvideo_get_SourceWidth(IBasicVideo
*iface
,
949 long *pSourceWidth
) {
950 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
952 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceWidth
);
954 *pSourceWidth
= This
->SourceRect
.right
- This
->SourceRect
.left
;
959 static HRESULT WINAPI
Basicvideo_put_SourceTop(IBasicVideo
*iface
,
961 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
963 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceTop
);
965 This
->SourceRect
.top
= SourceTop
;
970 static HRESULT WINAPI
Basicvideo_get_SourceTop(IBasicVideo
*iface
,
972 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
974 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceTop
);
976 *pSourceTop
= This
->SourceRect
.top
;
981 static HRESULT WINAPI
Basicvideo_put_SourceHeight(IBasicVideo
*iface
,
983 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
985 TRACE("(%p/%p)->(%ld)\n", This
, iface
, SourceHeight
);
987 This
->SourceRect
.bottom
= This
->SourceRect
.top
+ SourceHeight
;
992 static HRESULT WINAPI
Basicvideo_get_SourceHeight(IBasicVideo
*iface
,
993 long *pSourceHeight
) {
994 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
996 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceHeight
);
998 *pSourceHeight
= This
->SourceRect
.bottom
- This
->SourceRect
.top
;
1003 static HRESULT WINAPI
Basicvideo_put_DestinationLeft(IBasicVideo
*iface
,
1004 long DestinationLeft
) {
1005 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1007 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationLeft
);
1009 This
->DestRect
.left
= DestinationLeft
;
1014 static HRESULT WINAPI
Basicvideo_get_DestinationLeft(IBasicVideo
*iface
,
1015 long *pDestinationLeft
) {
1016 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1018 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationLeft
);
1020 *pDestinationLeft
= This
->DestRect
.left
;
1025 static HRESULT WINAPI
Basicvideo_put_DestinationWidth(IBasicVideo
*iface
,
1026 long DestinationWidth
) {
1027 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1029 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationWidth
);
1031 This
->DestRect
.right
= This
->DestRect
.left
+ DestinationWidth
;
1036 static HRESULT WINAPI
Basicvideo_get_DestinationWidth(IBasicVideo
*iface
,
1037 long *pDestinationWidth
) {
1038 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1040 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationWidth
);
1042 *pDestinationWidth
= This
->DestRect
.right
- This
->DestRect
.left
;
1047 static HRESULT WINAPI
Basicvideo_put_DestinationTop(IBasicVideo
*iface
,
1048 long DestinationTop
) {
1049 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1051 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationTop
);
1053 This
->DestRect
.top
= DestinationTop
;
1058 static HRESULT WINAPI
Basicvideo_get_DestinationTop(IBasicVideo
*iface
,
1059 long *pDestinationTop
) {
1060 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1062 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationTop
);
1064 *pDestinationTop
= This
->DestRect
.top
;
1069 static HRESULT WINAPI
Basicvideo_put_DestinationHeight(IBasicVideo
*iface
,
1070 long DestinationHeight
) {
1071 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1073 TRACE("(%p/%p)->(%ld)\n", This
, iface
, DestinationHeight
);
1075 This
->DestRect
.right
= This
->DestRect
.left
+ DestinationHeight
;
1080 static HRESULT WINAPI
Basicvideo_get_DestinationHeight(IBasicVideo
*iface
,
1081 long *pDestinationHeight
) {
1082 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1084 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationHeight
);
1086 *pDestinationHeight
= This
->DestRect
.right
- This
->DestRect
.left
;
1091 static HRESULT WINAPI
Basicvideo_SetSourcePosition(IBasicVideo
*iface
,
1096 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1098 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
1100 This
->SourceRect
.left
= Left
;
1101 This
->SourceRect
.top
= Top
;
1102 This
->SourceRect
.right
= Left
+ Width
;
1103 This
->SourceRect
.bottom
= Top
+ Height
;
1108 static HRESULT WINAPI
Basicvideo_GetSourcePosition(IBasicVideo
*iface
,
1113 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1115 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
1117 *pLeft
= This
->SourceRect
.left
;
1118 *pTop
= This
->SourceRect
.top
;
1119 *pWidth
= This
->SourceRect
.right
- This
->SourceRect
.left
;
1120 *pHeight
= This
->SourceRect
.bottom
- This
->SourceRect
.top
;
1125 static HRESULT WINAPI
Basicvideo_SetDefaultSourcePosition(IBasicVideo
*iface
) {
1126 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1128 TRACE("(%p/%p)->()\n", This
, iface
);
1130 This
->SourceRect
.left
= 0;
1131 This
->SourceRect
.top
= 0;
1132 This
->SourceRect
.right
= This
->VideoWidth
;
1133 This
->SourceRect
.bottom
= This
->VideoHeight
;
1138 static HRESULT WINAPI
Basicvideo_SetDestinationPosition(IBasicVideo
*iface
,
1143 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1145 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
1147 This
->DestRect
.left
= Left
;
1148 This
->DestRect
.top
= Top
;
1149 This
->DestRect
.right
= Left
+ Width
;
1150 This
->DestRect
.bottom
= Top
+ Height
;
1155 static HRESULT WINAPI
Basicvideo_GetDestinationPosition(IBasicVideo
*iface
,
1160 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1162 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
1164 *pLeft
= This
->DestRect
.left
;
1165 *pTop
= This
->DestRect
.top
;
1166 *pWidth
= This
->DestRect
.right
- This
->DestRect
.left
;
1167 *pHeight
= This
->DestRect
.bottom
- This
->DestRect
.top
;
1172 static HRESULT WINAPI
Basicvideo_SetDefaultDestinationPosition(IBasicVideo
*iface
) {
1173 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1176 TRACE("(%p/%p)->()\n", This
, iface
);
1178 if (!GetClientRect(This
->hWnd
, &rect
))
1181 This
->SourceRect
.left
= 0;
1182 This
->SourceRect
.top
= 0;
1183 This
->SourceRect
.right
= rect
.right
;
1184 This
->SourceRect
.bottom
= rect
.bottom
;
1189 static HRESULT WINAPI
Basicvideo_GetVideoSize(IBasicVideo
*iface
,
1192 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1194 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
1196 *pWidth
= This
->VideoWidth
;
1197 *pHeight
= This
->VideoHeight
;
1202 static HRESULT WINAPI
Basicvideo_GetVideoPaletteEntries(IBasicVideo
*iface
,
1207 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1209 FIXME("(%p/%p)->(%ld, %ld, %p, %p): stub !!!\n", This
, iface
, StartIndex
, Entries
, pRetrieved
, pPalette
);
1214 static HRESULT WINAPI
Basicvideo_GetCurrentImage(IBasicVideo
*iface
,
1217 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1219 FIXME("(%p/%p)->(%p, %p): stub !!!\n", This
, iface
, pBufferSize
, pDIBImage
);
1224 static HRESULT WINAPI
Basicvideo_IsUsingDefaultSource(IBasicVideo
*iface
) {
1225 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1227 FIXME("(%p/%p)->(): stub !!!\n", This
, iface
);
1232 static HRESULT WINAPI
Basicvideo_IsUsingDefaultDestination(IBasicVideo
*iface
) {
1233 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1235 FIXME("(%p/%p)->(): stub !!!\n", This
, iface
);
1241 static const IBasicVideoVtbl IBasicVideo_VTable
=
1243 Basicvideo_QueryInterface
,
1246 Basicvideo_GetTypeInfoCount
,
1247 Basicvideo_GetTypeInfo
,
1248 Basicvideo_GetIDsOfNames
,
1250 Basicvideo_get_AvgTimePerFrame
,
1251 Basicvideo_get_BitRate
,
1252 Basicvideo_get_BitErrorRate
,
1253 Basicvideo_get_VideoWidth
,
1254 Basicvideo_get_VideoHeight
,
1255 Basicvideo_put_SourceLeft
,
1256 Basicvideo_get_SourceLeft
,
1257 Basicvideo_put_SourceWidth
,
1258 Basicvideo_get_SourceWidth
,
1259 Basicvideo_put_SourceTop
,
1260 Basicvideo_get_SourceTop
,
1261 Basicvideo_put_SourceHeight
,
1262 Basicvideo_get_SourceHeight
,
1263 Basicvideo_put_DestinationLeft
,
1264 Basicvideo_get_DestinationLeft
,
1265 Basicvideo_put_DestinationWidth
,
1266 Basicvideo_get_DestinationWidth
,
1267 Basicvideo_put_DestinationTop
,
1268 Basicvideo_get_DestinationTop
,
1269 Basicvideo_put_DestinationHeight
,
1270 Basicvideo_get_DestinationHeight
,
1271 Basicvideo_SetSourcePosition
,
1272 Basicvideo_GetSourcePosition
,
1273 Basicvideo_SetDefaultSourcePosition
,
1274 Basicvideo_SetDestinationPosition
,
1275 Basicvideo_GetDestinationPosition
,
1276 Basicvideo_SetDefaultDestinationPosition
,
1277 Basicvideo_GetVideoSize
,
1278 Basicvideo_GetVideoPaletteEntries
,
1279 Basicvideo_GetCurrentImage
,
1280 Basicvideo_IsUsingDefaultSource
,
1281 Basicvideo_IsUsingDefaultDestination
1285 /*** IUnknown methods ***/
1286 static HRESULT WINAPI
Videowindow_QueryInterface(IVideoWindow
*iface
,
1289 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1291 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1293 return VideoRenderer_QueryInterface((IBaseFilter
*)This
, riid
, ppvObj
);
1296 static ULONG WINAPI
Videowindow_AddRef(IVideoWindow
*iface
) {
1297 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1299 TRACE("(%p/%p)->()\n", This
, iface
);
1301 return VideoRenderer_AddRef((IBaseFilter
*)This
);
1304 static ULONG WINAPI
Videowindow_Release(IVideoWindow
*iface
) {
1305 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1307 TRACE("(%p/%p)->()\n", This
, iface
);
1309 return VideoRenderer_Release((IBaseFilter
*)This
);
1312 /*** IDispatch methods ***/
1313 static HRESULT WINAPI
Videowindow_GetTypeInfoCount(IVideoWindow
*iface
,
1315 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1317 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1322 static HRESULT WINAPI
Videowindow_GetTypeInfo(IVideoWindow
*iface
,
1325 ITypeInfo
**ppTInfo
) {
1326 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1328 FIXME("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1333 static HRESULT WINAPI
Videowindow_GetIDsOfNames(IVideoWindow
*iface
,
1339 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1341 FIXME("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1346 static HRESULT WINAPI
Videowindow_Invoke(IVideoWindow
*iface
,
1347 DISPID dispIdMember
,
1351 DISPPARAMS
*pDispParams
,
1353 EXCEPINFO
*pExepInfo
,
1355 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1357 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
);
1362 /*** IVideoWindow methods ***/
1363 static HRESULT WINAPI
Videowindow_put_Caption(IVideoWindow
*iface
,
1365 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1367 TRACE("(%p/%p)->(%s (%p))\n", This
, iface
, debugstr_w(strCaption
), strCaption
);
1369 if (!SetWindowTextW(This
->hWnd
, strCaption
))
1375 static HRESULT WINAPI
Videowindow_get_Caption(IVideoWindow
*iface
,
1377 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1379 TRACE("(%p/%p)->(%p)\n", This
, iface
, strCaption
);
1381 GetWindowTextW(This
->hWnd
, (LPWSTR
)strCaption
, 100);
1386 static HRESULT WINAPI
Videowindow_put_WindowStyle(IVideoWindow
*iface
,
1388 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1391 old
= GetWindowLongA(This
->hWnd
, GWL_STYLE
);
1393 TRACE("(%p/%p)->(%x -> %lx)\n", This
, iface
, old
, WindowStyle
);
1395 if (WindowStyle
& (WS_DISABLED
|WS_HSCROLL
|WS_ICONIC
|WS_MAXIMIZE
|WS_MINIMIZE
|WS_VSCROLL
))
1396 return E_INVALIDARG
;
1398 SetWindowLongA(This
->hWnd
, GWL_STYLE
, WindowStyle
);
1403 static HRESULT WINAPI
Videowindow_get_WindowStyle(IVideoWindow
*iface
,
1404 long *WindowStyle
) {
1405 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1407 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyle
);
1409 *WindowStyle
= GetWindowLongA(This
->hWnd
, GWL_STYLE
);
1414 static HRESULT WINAPI
Videowindow_put_WindowStyleEx(IVideoWindow
*iface
,
1415 long WindowStyleEx
) {
1416 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1418 TRACE("(%p/%p)->(%ld)\n", This
, iface
, WindowStyleEx
);
1420 if (WindowStyleEx
& (WS_DISABLED
|WS_HSCROLL
|WS_ICONIC
|WS_MAXIMIZE
|WS_MINIMIZE
|WS_VSCROLL
))
1421 return E_INVALIDARG
;
1423 if (!SetWindowLongA(This
->hWnd
, GWL_EXSTYLE
, WindowStyleEx
))
1429 static HRESULT WINAPI
Videowindow_get_WindowStyleEx(IVideoWindow
*iface
,
1430 long *WindowStyleEx
) {
1431 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1433 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyleEx
);
1435 *WindowStyleEx
= GetWindowLongA(This
->hWnd
, GWL_EXSTYLE
);
1440 static HRESULT WINAPI
Videowindow_put_AutoShow(IVideoWindow
*iface
,
1442 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1444 TRACE("(%p/%p)->(%ld)\n", This
, iface
, AutoShow
);
1446 This
->AutoShow
= 1; /* FXIME: Should be AutoShow */;
1451 static HRESULT WINAPI
Videowindow_get_AutoShow(IVideoWindow
*iface
,
1453 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1455 TRACE("(%p/%p)->(%p)\n", This
, iface
, AutoShow
);
1457 *AutoShow
= This
->AutoShow
;
1462 static HRESULT WINAPI
Videowindow_put_WindowState(IVideoWindow
*iface
,
1464 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1466 FIXME("(%p/%p)->(%ld): stub !!!\n", This
, iface
, WindowState
);
1471 static HRESULT WINAPI
Videowindow_get_WindowState(IVideoWindow
*iface
,
1472 long *WindowState
) {
1473 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1475 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, WindowState
);
1480 static HRESULT WINAPI
Videowindow_put_BackgroundPalette(IVideoWindow
*iface
,
1481 long BackgroundPalette
) {
1482 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1484 FIXME("(%p/%p)->(%ld): stub !!!\n", This
, iface
, BackgroundPalette
);
1489 static HRESULT WINAPI
Videowindow_get_BackgroundPalette(IVideoWindow
*iface
,
1490 long *pBackgroundPalette
) {
1491 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1493 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pBackgroundPalette
);
1498 static HRESULT WINAPI
Videowindow_put_Visible(IVideoWindow
*iface
,
1500 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1502 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Visible
);
1504 ShowWindow(This
->hWnd
, Visible
? SW_SHOW
: SW_HIDE
);
1509 static HRESULT WINAPI
Videowindow_get_Visible(IVideoWindow
*iface
,
1511 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1513 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVisible
);
1515 *pVisible
= IsWindowVisible(This
->hWnd
);
1520 static HRESULT WINAPI
Videowindow_put_Left(IVideoWindow
*iface
,
1522 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1524 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Left
);
1526 if (!SetWindowPos(This
->hWnd
, NULL
, Left
, This
->WindowPos
.top
, 0, 0, SWP_NOZORDER
|SWP_NOSIZE
))
1529 This
->WindowPos
.left
= Left
;
1534 static HRESULT WINAPI
Videowindow_get_Left(IVideoWindow
*iface
,
1536 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1538 TRACE("(%p/%p)->(%p)\n", This
, iface
, pLeft
);
1540 *pLeft
= This
->WindowPos
.left
;
1545 static HRESULT WINAPI
Videowindow_put_Width(IVideoWindow
*iface
,
1547 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1549 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Width
);
1551 if (!SetWindowPos(This
->hWnd
, NULL
, 0, 0, Width
, This
->WindowPos
.bottom
-This
->WindowPos
.top
, SWP_NOZORDER
|SWP_NOMOVE
))
1554 This
->WindowPos
.right
= This
->WindowPos
.left
+ Width
;
1559 static HRESULT WINAPI
Videowindow_get_Width(IVideoWindow
*iface
,
1561 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1563 TRACE("(%p/%p)->(%p)\n", This
, iface
, pWidth
);
1565 *pWidth
= This
->WindowPos
.right
- This
->WindowPos
.left
;
1570 static HRESULT WINAPI
Videowindow_put_Top(IVideoWindow
*iface
,
1572 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1574 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Top
);
1576 if (!SetWindowPos(This
->hWnd
, NULL
, This
->WindowPos
.left
, Top
, 0, 0, SWP_NOZORDER
|SWP_NOSIZE
))
1579 This
->WindowPos
.top
= Top
;
1584 static HRESULT WINAPI
Videowindow_get_Top(IVideoWindow
*iface
,
1586 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1588 TRACE("(%p/%p)->(%p)\n", This
, iface
, pTop
);
1590 *pTop
= This
->WindowPos
.top
;
1595 static HRESULT WINAPI
Videowindow_put_Height(IVideoWindow
*iface
,
1597 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1599 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Height
);
1601 if (!SetWindowPos(This
->hWnd
, NULL
, 0, 0, This
->WindowPos
.right
-This
->WindowPos
.left
, Height
, SWP_NOZORDER
|SWP_NOMOVE
))
1604 This
->WindowPos
.bottom
= This
->WindowPos
.top
+ Height
;
1609 static HRESULT WINAPI
Videowindow_get_Height(IVideoWindow
*iface
,
1611 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1613 TRACE("(%p/%p)->(%p)\n", This
, iface
, pHeight
);
1615 *pHeight
= This
->WindowPos
.bottom
- This
->WindowPos
.top
;
1620 static HRESULT WINAPI
Videowindow_put_Owner(IVideoWindow
*iface
,
1622 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1624 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Owner
);
1626 SetParent(This
->hWnd
, (HWND
)Owner
);
1631 static HRESULT WINAPI
Videowindow_get_Owner(IVideoWindow
*iface
,
1633 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1635 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Owner
);
1637 *(HWND
*)Owner
= GetParent(This
->hWnd
);
1642 static HRESULT WINAPI
Videowindow_put_MessageDrain(IVideoWindow
*iface
,
1644 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1646 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Drain
);
1648 This
->hWndMsgDrain
= (HWND
)Drain
;
1653 static HRESULT WINAPI
Videowindow_get_MessageDrain(IVideoWindow
*iface
,
1655 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1657 TRACE("(%p/%p)->(%p)\n", This
, iface
, Drain
);
1659 *Drain
= (OAHWND
)This
->hWndMsgDrain
;
1664 static HRESULT WINAPI
Videowindow_get_BorderColor(IVideoWindow
*iface
,
1666 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1668 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, Color
);
1673 static HRESULT WINAPI
Videowindow_put_BorderColor(IVideoWindow
*iface
,
1675 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1677 FIXME("(%p/%p)->(%ld): stub !!!\n", This
, iface
, Color
);
1682 static HRESULT WINAPI
Videowindow_get_FullScreenMode(IVideoWindow
*iface
,
1683 long *FullScreenMode
) {
1684 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1686 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, FullScreenMode
);
1691 static HRESULT WINAPI
Videowindow_put_FullScreenMode(IVideoWindow
*iface
,
1692 long FullScreenMode
) {
1693 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1695 FIXME("(%p/%p)->(%ld): stub !!!\n", This
, iface
, FullScreenMode
);
1700 static HRESULT WINAPI
Videowindow_SetWindowForeground(IVideoWindow
*iface
,
1702 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1707 TRACE("(%p/%p)->(%ld)\n", This
, iface
, Focus
);
1709 if ((Focus
!= FALSE
) && (Focus
!= TRUE
))
1710 return E_INVALIDARG
;
1712 hr
= IPin_ConnectedTo(This
->ppPins
[0], &pPin
);
1713 if ((hr
!= S_OK
) || !pPin
)
1714 return VFW_E_NOT_CONNECTED
;
1717 ret
= SetForegroundWindow(This
->hWnd
);
1719 ret
= SetWindowPos(This
->hWnd
, HWND_TOP
, 0, 0, 0, 0, SWP_NOMOVE
|SWP_NOSIZE
);
1727 static HRESULT WINAPI
Videowindow_NotifyOwnerMessage(IVideoWindow
*iface
,
1732 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1734 TRACE("(%p/%p)->(%08x, %ld, %08lx, %08lx)\n", This
, iface
, (DWORD
) hwnd
, uMsg
, wParam
, lParam
);
1736 if (!PostMessageA(This
->hWnd
, uMsg
, wParam
, lParam
))
1742 static HRESULT WINAPI
Videowindow_SetWindowPosition(IVideoWindow
*iface
,
1747 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1749 TRACE("(%p/%p)->(%ld, %ld, %ld, %ld)\n", This
, iface
, Left
, Top
, Width
, Height
);
1751 if (!SetWindowPos(This
->hWnd
, NULL
, Left
, Top
, Width
, Height
, SWP_NOZORDER
))
1754 This
->WindowPos
.left
= Left
;
1755 This
->WindowPos
.top
= Top
;
1756 This
->WindowPos
.right
= Left
+ Width
;
1757 This
->WindowPos
.bottom
= Top
+ Height
;
1762 static HRESULT WINAPI
Videowindow_GetWindowPosition(IVideoWindow
*iface
,
1767 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1769 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
1771 *pLeft
= This
->WindowPos
.left
;
1772 *pTop
= This
->WindowPos
.top
;
1773 *pWidth
= This
->WindowPos
.right
- This
->WindowPos
.left
;
1774 *pHeight
= This
->WindowPos
.bottom
- This
->WindowPos
.top
;
1779 static HRESULT WINAPI
Videowindow_GetMinIdealImageSize(IVideoWindow
*iface
,
1782 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1784 FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This
, iface
, pWidth
, pHeight
);
1786 *pWidth
= This
->VideoWidth
;
1787 *pHeight
= This
->VideoHeight
;
1792 static HRESULT WINAPI
Videowindow_GetMaxIdealImageSize(IVideoWindow
*iface
,
1795 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1797 FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This
, iface
, pWidth
, pHeight
);
1799 *pWidth
= This
->VideoWidth
;
1800 *pHeight
= This
->VideoHeight
;
1805 static HRESULT WINAPI
Videowindow_GetRestorePosition(IVideoWindow
*iface
,
1810 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1812 FIXME("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
1817 static HRESULT WINAPI
Videowindow_HideCursor(IVideoWindow
*iface
,
1819 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1821 FIXME("(%p/%p)->(%ld): stub !!!\n", This
, iface
, HideCursor
);
1826 static HRESULT WINAPI
Videowindow_IsCursorHidden(IVideoWindow
*iface
,
1827 long *CursorHidden
) {
1828 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1830 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, CursorHidden
);
1835 static const IVideoWindowVtbl IVideoWindow_VTable
=
1837 Videowindow_QueryInterface
,
1839 Videowindow_Release
,
1840 Videowindow_GetTypeInfoCount
,
1841 Videowindow_GetTypeInfo
,
1842 Videowindow_GetIDsOfNames
,
1844 Videowindow_put_Caption
,
1845 Videowindow_get_Caption
,
1846 Videowindow_put_WindowStyle
,
1847 Videowindow_get_WindowStyle
,
1848 Videowindow_put_WindowStyleEx
,
1849 Videowindow_get_WindowStyleEx
,
1850 Videowindow_put_AutoShow
,
1851 Videowindow_get_AutoShow
,
1852 Videowindow_put_WindowState
,
1853 Videowindow_get_WindowState
,
1854 Videowindow_put_BackgroundPalette
,
1855 Videowindow_get_BackgroundPalette
,
1856 Videowindow_put_Visible
,
1857 Videowindow_get_Visible
,
1858 Videowindow_put_Left
,
1859 Videowindow_get_Left
,
1860 Videowindow_put_Width
,
1861 Videowindow_get_Width
,
1862 Videowindow_put_Top
,
1863 Videowindow_get_Top
,
1864 Videowindow_put_Height
,
1865 Videowindow_get_Height
,
1866 Videowindow_put_Owner
,
1867 Videowindow_get_Owner
,
1868 Videowindow_put_MessageDrain
,
1869 Videowindow_get_MessageDrain
,
1870 Videowindow_get_BorderColor
,
1871 Videowindow_put_BorderColor
,
1872 Videowindow_get_FullScreenMode
,
1873 Videowindow_put_FullScreenMode
,
1874 Videowindow_SetWindowForeground
,
1875 Videowindow_NotifyOwnerMessage
,
1876 Videowindow_SetWindowPosition
,
1877 Videowindow_GetWindowPosition
,
1878 Videowindow_GetMinIdealImageSize
,
1879 Videowindow_GetMaxIdealImageSize
,
1880 Videowindow_GetRestorePosition
,
1881 Videowindow_HideCursor
,
1882 Videowindow_IsCursorHidden