2 * Implements CLSID_VideoRenderer.
4 * Copyright (C) Hidenori TAKESHIMA <hidenori@a2.ctktv.ne.jp>
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
39 #include "wine/debug.h"
40 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
42 #include "quartz_private.h"
47 static const WCHAR QUARTZ_VideoRenderer_Name[] =
48 { 'V','i','d','e','o',' ','R','e','n','d','e','r','e','r',0 };
49 static const WCHAR QUARTZ_VideoRendererPin_Name[] =
52 #define VIDRENMSG_UPDATE (WM_APP+0)
53 #define VIDRENMSG_ENDTHREAD (WM_APP+1)
55 static const CHAR VIDREN_szWndClass[] = "Wine_VideoRenderer";
56 static const CHAR VIDREN_szWndName[] = "Wine Video Renderer";
61 static void VIDREN_OnPaint( CVideoRendererImpl* This, HWND hwnd )
64 const VIDEOINFOHEADER* pinfo;
65 const AM_MEDIA_TYPE* pmt;
67 TRACE("(%p,%08x)\n",This,hwnd);
69 if ( !BeginPaint( hwnd, &ps ) )
72 pmt = This->pPin->pin.pmtConn;
73 if ( (!This->m_bSampleIsValid) || pmt == NULL )
76 pinfo = (const VIDEOINFOHEADER*)pmt->pbFormat;
81 abs(pinfo->bmiHeader.biWidth), abs(pinfo->bmiHeader.biHeight),
83 abs(pinfo->bmiHeader.biWidth), abs(pinfo->bmiHeader.biHeight),
84 This->m_pSampleData, (BITMAPINFO*)(&pinfo->bmiHeader),
85 DIB_RGB_COLORS, SRCCOPY );
88 EndPaint( hwnd, &ps );
91 static void VIDREN_OnQueryNewPalette( CVideoRendererImpl* This, HWND hwnd )
93 FIXME("(%p,%08x)\n",This,hwnd);
96 static void VIDREN_OnUpdate( CVideoRendererImpl* This, HWND hwnd )
100 TRACE("(%p,%08x)\n",This,hwnd);
102 InvalidateRect(hwnd,NULL,FALSE);
106 while ( PeekMessageA(&msg,hwnd,
107 VIDRENMSG_UPDATE,VIDRENMSG_UPDATE,
108 PM_REMOVE) != FALSE )
110 /* discard this message. */
115 static LRESULT CALLBACK
117 HWND hwnd, UINT message,
118 WPARAM wParam, LPARAM lParam )
120 CVideoRendererImpl* This = (CVideoRendererImpl*)
121 GetWindowLongA( hwnd, 0L );
123 TRACE("(%p) - %u/%u/%ld\n",This,message,wParam,lParam);
125 if ( message == WM_NCCREATE )
127 This = (CVideoRendererImpl*)(((CREATESTRUCTA*)lParam)->lpCreateParams);
128 SetWindowLongA( hwnd, 0L, (LONG)This );
132 if ( message == WM_NCDESTROY )
135 This->m_hwnd = (HWND)NULL;
136 SetWindowLongA( hwnd, 0L, (LONG)NULL );
145 TRACE("WM_PAINT begin\n");
146 EnterCriticalSection( &This->m_csReceive );
147 VIDREN_OnPaint( This, hwnd );
148 LeaveCriticalSection( &This->m_csReceive );
149 TRACE("WM_PAINT end\n");
152 ShowWindow( hwnd, SW_HIDE );
154 case WM_PALETTECHANGED:
155 if ( hwnd == (HWND)wParam )
158 case WM_QUERYNEWPALETTE:
159 VIDREN_OnQueryNewPalette( This, hwnd );
161 case VIDRENMSG_UPDATE:
162 VIDREN_OnUpdate( This, hwnd );
164 case VIDRENMSG_ENDTHREAD:
172 return DefWindowProcA( hwnd, message, wParam, lParam );
175 static BOOL VIDREN_Register( HINSTANCE hInst )
181 wc.lpfnWndProc = VIDREN_WndProc;
183 wc.cbWndExtra = sizeof(LONG);
184 wc.hInstance = hInst;
185 wc.hIcon = LoadIconA((HINSTANCE)NULL,IDI_WINLOGOA);
186 wc.hCursor = LoadCursorA((HINSTANCE)NULL,IDC_ARROWA);
187 wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
188 wc.lpszMenuName = NULL;
189 wc.lpszClassName = VIDREN_szWndClass;
191 atom = RegisterClassA( &wc );
192 if ( atom != (ATOM)0 )
199 static HWND VIDREN_Create( HWND hwndOwner, CVideoRendererImpl* This )
201 HINSTANCE hInst = (HINSTANCE)GetModuleHandleA(NULL);
202 const VIDEOINFOHEADER* pinfo;
204 DWORD dwStyle = WS_POPUP|WS_CAPTION|WS_CLIPCHILDREN;
208 if ( !VIDREN_Register( hInst ) )
211 pinfo = (const VIDEOINFOHEADER*)This->pPin->pin.pmtConn->pbFormat;
213 TRACE("width %ld, height %ld\n", pinfo->bmiHeader.biWidth, pinfo->bmiHeader.biHeight);
217 rcWnd.right = pinfo->bmiHeader.biWidth;
218 rcWnd.bottom = abs(pinfo->bmiHeader.biHeight);
219 AdjustWindowRectEx( &rcWnd, dwStyle, FALSE, dwExStyle );
221 TRACE("window width %d,height %d\n",
222 rcWnd.right-rcWnd.left,rcWnd.bottom-rcWnd.top);
224 hwnd = CreateWindowExA(
226 VIDREN_szWndClass, VIDREN_szWndName,
229 rcWnd.right-rcWnd.left, rcWnd.bottom-rcWnd.top,
230 hwndOwner, (HMENU)NULL,
231 hInst, (LPVOID)This );
232 if ( hwnd != (HWND)NULL )
233 ShowWindow(hwnd,SW_SHOW);
238 static DWORD WINAPI VIDREN_ThreadEntry( LPVOID pv )
240 CVideoRendererImpl* This = (CVideoRendererImpl*)pv;
243 TRACE("(%p)\n",This);
244 if ( !VIDREN_Create( (HWND)NULL, This ) )
246 TRACE("VIDREN_Create succeeded\n");
248 SetEvent( This->m_hEventInit );
249 TRACE("Enter message loop\n");
251 while ( GetMessageA(&msg,(HWND)NULL,0,0) )
253 TranslateMessage(&msg);
254 DispatchMessageA(&msg);
260 static HRESULT VIDREN_StartThread( CVideoRendererImpl* This )
266 if ( This->m_hEventInit != (HANDLE)NULL ||
267 This->m_hwnd != (HWND)NULL ||
268 This->m_hThread != (HANDLE)NULL ||
269 This->pPin->pin.pmtConn == NULL )
272 This->m_hEventInit = CreateEventA(NULL,TRUE,FALSE,NULL);
273 if ( This->m_hEventInit == (HANDLE)NULL )
274 return E_OUTOFMEMORY;
276 This->m_hThread = CreateThread(
281 if ( This->m_hThread == (HANDLE)NULL )
284 hEvents[0] = This->m_hEventInit;
285 hEvents[1] = This->m_hThread;
287 dwRes = WaitForMultipleObjects(2,hEvents,FALSE,INFINITE);
288 if ( dwRes != WAIT_OBJECT_0 )
294 static void VIDREN_EndThread( CVideoRendererImpl* This )
296 if ( This->m_hwnd != (HWND)NULL )
297 PostMessageA( This->m_hwnd, VIDRENMSG_ENDTHREAD, 0, 0 );
299 if ( This->m_hThread != (HANDLE)NULL )
301 WaitForSingleObject( This->m_hThread, INFINITE );
302 CloseHandle( This->m_hThread );
303 This->m_hThread = (HANDLE)NULL;
305 if ( This->m_hEventInit != (HANDLE)NULL )
307 CloseHandle( This->m_hEventInit );
308 This->m_hEventInit = (HANDLE)NULL;
314 /***************************************************************************
316 * CVideoRendererImpl methods
320 static HRESULT CVideoRendererImpl_OnActive( CBaseFilterImpl* pImpl )
322 CVideoRendererImpl_THIS(pImpl,basefilter);
324 FIXME( "(%p)\n", This );
326 This->m_bSampleIsValid = FALSE;
331 static HRESULT CVideoRendererImpl_OnInactive( CBaseFilterImpl* pImpl )
333 CVideoRendererImpl_THIS(pImpl,basefilter);
335 FIXME( "(%p)\n", This );
337 EnterCriticalSection( &This->m_csReceive );
338 This->m_bSampleIsValid = FALSE;
339 LeaveCriticalSection( &This->m_csReceive );
344 static const CBaseFilterHandlers filterhandlers =
346 CVideoRendererImpl_OnActive, /* pOnActive */
347 CVideoRendererImpl_OnInactive, /* pOnInactive */
351 /***************************************************************************
353 * CVideoRendererPinImpl methods
357 static HRESULT CVideoRendererPinImpl_OnPreConnect( CPinBaseImpl* pImpl, IPin* pPin )
359 CVideoRendererPinImpl_THIS(pImpl,pin);
361 TRACE("(%p,%p)\n",This,pPin);
366 static HRESULT CVideoRendererPinImpl_OnPostConnect( CPinBaseImpl* pImpl, IPin* pPin )
368 CVideoRendererPinImpl_THIS(pImpl,pin);
369 const VIDEOINFOHEADER* pinfo;
372 TRACE("(%p,%p)\n",This,pPin);
374 if ( This->pRender->m_pSampleData != NULL )
376 QUARTZ_FreeMem(This->pRender->m_pSampleData);
377 This->pRender->m_pSampleData = NULL;
379 This->pRender->m_cbSampleData = 0;
380 This->pRender->m_bSampleIsValid = FALSE;
382 pinfo = (const VIDEOINFOHEADER*)This->pin.pmtConn->pbFormat;
386 This->pRender->m_bSampleIsValid = FALSE;
387 This->pRender->m_cbSampleData = DIBSIZE(pinfo->bmiHeader);
388 This->pRender->m_pSampleData = (BYTE*)QUARTZ_AllocMem(This->pRender->m_cbSampleData);
389 if ( This->pRender->m_pSampleData == NULL )
390 return E_OUTOFMEMORY;
392 hr = VIDREN_StartThread(This->pRender);
399 static HRESULT CVideoRendererPinImpl_OnDisconnect( CPinBaseImpl* pImpl )
401 CVideoRendererPinImpl_THIS(pImpl,pin);
403 TRACE("(%p)\n",This);
405 VIDREN_EndThread(This->pRender);
407 if ( This->pRender->m_pSampleData != NULL )
409 QUARTZ_FreeMem(This->pRender->m_pSampleData);
410 This->pRender->m_pSampleData = NULL;
412 This->pRender->m_cbSampleData = 0;
413 This->pRender->m_bSampleIsValid = FALSE;
415 if ( This->meminput.pAllocator != NULL )
417 IMemAllocator_Decommit(This->meminput.pAllocator);
418 IMemAllocator_Release(This->meminput.pAllocator);
419 This->meminput.pAllocator = NULL;
425 static HRESULT CVideoRendererPinImpl_CheckMediaType( CPinBaseImpl* pImpl, const AM_MEDIA_TYPE* pmt )
427 CVideoRendererPinImpl_THIS(pImpl,pin);
428 const VIDEOINFOHEADER* pinfo;
430 TRACE("(%p,%p)\n",This,pmt);
432 if ( !IsEqualGUID( &pmt->majortype, &MEDIATYPE_Video ) )
434 if ( !IsEqualGUID( &pmt->formattype, &FORMAT_VideoInfo ) )
439 if ( !IsEqualGUID( &pmt->subtype, &MEDIASUBTYPE_RGB555 ) &&
440 !IsEqualGUID( &pmt->subtype, &MEDIASUBTYPE_RGB565 ) &&
441 !IsEqualGUID( &pmt->subtype, &MEDIASUBTYPE_RGB24 ) &&
442 !IsEqualGUID( &pmt->subtype, &MEDIASUBTYPE_RGB32 ) )
448 if ( !IsEqualGUID( &pmt->subtype, &MEDIASUBTYPE_RGB8 ) &&
449 !IsEqualGUID( &pmt->subtype, &MEDIASUBTYPE_RGB555 ) &&
450 !IsEqualGUID( &pmt->subtype, &MEDIASUBTYPE_RGB565 ) &&
451 !IsEqualGUID( &pmt->subtype, &MEDIASUBTYPE_RGB24 ) &&
452 !IsEqualGUID( &pmt->subtype, &MEDIASUBTYPE_RGB32 ) )
457 pinfo = (const VIDEOINFOHEADER*)pmt->pbFormat;
458 if ( pinfo == NULL ||
459 pinfo->bmiHeader.biSize < sizeof(BITMAPINFOHEADER) ||
460 pinfo->bmiHeader.biWidth <= 0 ||
461 pinfo->bmiHeader.biHeight == 0 ||
462 pinfo->bmiHeader.biPlanes != 1 ||
463 pinfo->bmiHeader.biCompression != 0 )
469 static HRESULT CVideoRendererPinImpl_Receive( CPinBaseImpl* pImpl, IMediaSample* pSample )
471 CVideoRendererPinImpl_THIS(pImpl,pin);
477 TRACE( "(%p,%p)\n",This,pSample );
479 hwnd = This->pRender->m_hwnd;
480 if ( hwnd == (HWND)NULL ||
481 This->pRender->m_hThread == (HWND)NULL )
483 if ( This->pRender->m_fInFlush )
485 if ( pSample == NULL )
488 /* FIXME - wait/skip/qualitycontrol */
491 /* duplicate this sample. */
492 hr = IMediaSample_GetPointer(pSample,&pData);
495 lLength = (LONG)IMediaSample_GetActualDataLength(pSample);
496 if ( lLength <= 0 || (lLength < (LONG)This->pRender->m_cbSampleData) )
498 ERR( "invalid length: %ld\n", lLength );
502 memcpy(This->pRender->m_pSampleData,pData,lLength);
503 This->pRender->m_bSampleIsValid = TRUE;
504 PostMessageA( hwnd, VIDRENMSG_UPDATE, 0, 0 );
509 static HRESULT CVideoRendererPinImpl_ReceiveCanBlock( CPinBaseImpl* pImpl )
511 CVideoRendererPinImpl_THIS(pImpl,pin);
513 TRACE( "(%p)\n", This );
519 static HRESULT CVideoRendererPinImpl_EndOfStream( CPinBaseImpl* pImpl )
521 CVideoRendererPinImpl_THIS(pImpl,pin);
523 FIXME( "(%p)\n", This );
525 This->pRender->m_fInFlush = FALSE;
527 /* FIXME - don't notify twice until stopped or seeked. */
528 return CBaseFilterImpl_MediaEventNotify(
529 &This->pRender->basefilter, EC_COMPLETE,
530 (LONG_PTR)S_OK, (LONG_PTR)(IBaseFilter*)(This->pRender) );
533 static HRESULT CVideoRendererPinImpl_BeginFlush( CPinBaseImpl* pImpl )
535 CVideoRendererPinImpl_THIS(pImpl,pin);
537 FIXME( "(%p)\n", This );
539 This->pRender->m_fInFlush = TRUE;
540 EnterCriticalSection( &This->pRender->m_csReceive );
541 This->pRender->m_bSampleIsValid = FALSE;
542 LeaveCriticalSection( &This->pRender->m_csReceive );
547 static HRESULT CVideoRendererPinImpl_EndFlush( CPinBaseImpl* pImpl )
549 CVideoRendererPinImpl_THIS(pImpl,pin);
551 FIXME( "(%p)\n", This );
553 This->pRender->m_fInFlush = FALSE;
558 static HRESULT CVideoRendererPinImpl_NewSegment( CPinBaseImpl* pImpl, REFERENCE_TIME rtStart, REFERENCE_TIME rtStop, double rate )
560 CVideoRendererPinImpl_THIS(pImpl,pin);
562 FIXME( "(%p)\n", This );
564 This->pRender->m_fInFlush = FALSE;
572 static const CBasePinHandlers pinhandlers =
574 CVideoRendererPinImpl_OnPreConnect, /* pOnPreConnect */
575 CVideoRendererPinImpl_OnPostConnect, /* pOnPostConnect */
576 CVideoRendererPinImpl_OnDisconnect, /* pOnDisconnect */
577 CVideoRendererPinImpl_CheckMediaType, /* pCheckMediaType */
578 NULL, /* pQualityNotify */
579 CVideoRendererPinImpl_Receive, /* pReceive */
580 CVideoRendererPinImpl_ReceiveCanBlock, /* pReceiveCanBlock */
581 CVideoRendererPinImpl_EndOfStream, /* pEndOfStream */
582 CVideoRendererPinImpl_BeginFlush, /* pBeginFlush */
583 CVideoRendererPinImpl_EndFlush, /* pEndFlush */
584 CVideoRendererPinImpl_NewSegment, /* pNewSegment */
588 /***************************************************************************
590 * new/delete CVideoRendererImpl
594 /* can I use offsetof safely? - FIXME? */
595 static QUARTZ_IFEntry FilterIFEntries[] =
597 { &IID_IPersist, offsetof(CVideoRendererImpl,basefilter)-offsetof(CVideoRendererImpl,unk) },
598 { &IID_IMediaFilter, offsetof(CVideoRendererImpl,basefilter)-offsetof(CVideoRendererImpl,unk) },
599 { &IID_IBaseFilter, offsetof(CVideoRendererImpl,basefilter)-offsetof(CVideoRendererImpl,unk) },
600 { &IID_IBasicVideo, offsetof(CVideoRendererImpl,basvid)-offsetof(CVideoRendererImpl,unk) },
601 { &IID_IBasicVideo2, offsetof(CVideoRendererImpl,basvid)-offsetof(CVideoRendererImpl,unk) },
602 { &IID_IVideoWindow, offsetof(CVideoRendererImpl,vidwin)-offsetof(CVideoRendererImpl,unk) },
605 static HRESULT CVideoRendererImpl_OnQueryInterface(
606 IUnknown* punk, const IID* piid, void** ppobj )
608 CVideoRendererImpl_THIS(punk,unk);
610 if ( This->pSeekPass == NULL )
611 return E_NOINTERFACE;
613 if ( IsEqualGUID( &IID_IMediaPosition, piid ) ||
614 IsEqualGUID( &IID_IMediaSeeking, piid ) )
616 TRACE( "IMediaSeeking(or IMediaPosition) is queried\n" );
617 return IUnknown_QueryInterface( (IUnknown*)(&This->pSeekPass->unk), piid, ppobj );
620 return E_NOINTERFACE;
623 static void QUARTZ_DestroyVideoRenderer(IUnknown* punk)
625 CVideoRendererImpl_THIS(punk,unk);
627 TRACE( "(%p)\n", This );
628 CVideoRendererImpl_OnInactive(&This->basefilter);
629 VIDREN_EndThread(This);
631 if ( This->pPin != NULL )
633 IUnknown_Release(This->pPin->unk.punkControl);
636 if ( This->pSeekPass != NULL )
638 IUnknown_Release((IUnknown*)&This->pSeekPass->unk);
639 This->pSeekPass = NULL;
642 CVideoRendererImpl_UninitIBasicVideo2(This);
643 CVideoRendererImpl_UninitIVideoWindow(This);
644 CBaseFilterImpl_UninitIBaseFilter(&This->basefilter);
646 DeleteCriticalSection( &This->m_csReceive );
649 HRESULT QUARTZ_CreateVideoRenderer(IUnknown* punkOuter,void** ppobj)
651 CVideoRendererImpl* This = NULL;
654 TRACE("(%p,%p)\n",punkOuter,ppobj);
656 This = (CVideoRendererImpl*)
657 QUARTZ_AllocObj( sizeof(CVideoRendererImpl) );
659 return E_OUTOFMEMORY;
660 This->pSeekPass = NULL;
662 This->m_fInFlush = FALSE;
664 This->m_hEventInit = (HANDLE)NULL;
665 This->m_hThread = (HANDLE)NULL;
666 This->m_hwnd = (HWND)NULL;
667 This->m_bSampleIsValid = FALSE;
668 This->m_pSampleData = NULL;
669 This->m_cbSampleData = 0;
671 QUARTZ_IUnkInit( &This->unk, punkOuter );
672 This->qiext.pNext = NULL;
673 This->qiext.pOnQueryInterface = &CVideoRendererImpl_OnQueryInterface;
674 QUARTZ_IUnkAddDelegation( &This->unk, &This->qiext );
676 hr = CBaseFilterImpl_InitIBaseFilter(
678 This->unk.punkControl,
679 &CLSID_VideoRenderer,
680 QUARTZ_VideoRenderer_Name,
684 hr = CVideoRendererImpl_InitIBasicVideo2(This);
687 hr = CVideoRendererImpl_InitIVideoWindow(This);
690 CVideoRendererImpl_UninitIBasicVideo2(This);
695 CBaseFilterImpl_UninitIBaseFilter(&This->basefilter);
701 QUARTZ_FreeObj(This);
705 This->unk.pEntries = FilterIFEntries;
706 This->unk.dwEntries = sizeof(FilterIFEntries)/sizeof(FilterIFEntries[0]);
707 This->unk.pOnFinalRelease = QUARTZ_DestroyVideoRenderer;
709 InitializeCriticalSection( &This->m_csReceive );
711 hr = QUARTZ_CreateVideoRendererPin(
713 &This->basefilter.csFilter,
717 hr = QUARTZ_CompList_AddComp(
718 This->basefilter.pInPins,
719 (IUnknown*)&This->pPin->pin,
722 hr = QUARTZ_CreateSeekingPassThruInternal(
723 (IUnknown*)&(This->unk), &This->pSeekPass,
724 TRUE, (IPin*)&(This->pPin->pin) );
728 IUnknown_Release( This->unk.punkControl );
732 *ppobj = (void*)&(This->unk);
737 /***************************************************************************
739 * new/delete CVideoRendererPinImpl
743 /* can I use offsetof safely? - FIXME? */
744 static QUARTZ_IFEntry PinIFEntries[] =
746 { &IID_IPin, offsetof(CVideoRendererPinImpl,pin)-offsetof(CVideoRendererPinImpl,unk) },
747 { &IID_IMemInputPin, offsetof(CVideoRendererPinImpl,meminput)-offsetof(CVideoRendererPinImpl,unk) },
750 static void QUARTZ_DestroyVideoRendererPin(IUnknown* punk)
752 CVideoRendererPinImpl_THIS(punk,unk);
754 TRACE( "(%p)\n", This );
756 CPinBaseImpl_UninitIPin( &This->pin );
757 CMemInputPinBaseImpl_UninitIMemInputPin( &This->meminput );
760 HRESULT QUARTZ_CreateVideoRendererPin(
761 CVideoRendererImpl* pFilter,
762 CRITICAL_SECTION* pcsPin,
763 CRITICAL_SECTION* pcsPinReceive,
764 CVideoRendererPinImpl** ppPin)
766 CVideoRendererPinImpl* This = NULL;
769 TRACE("(%p,%p,%p,%p)\n",pFilter,pcsPin,pcsPinReceive,ppPin);
771 This = (CVideoRendererPinImpl*)
772 QUARTZ_AllocObj( sizeof(CVideoRendererPinImpl) );
774 return E_OUTOFMEMORY;
776 QUARTZ_IUnkInit( &This->unk, NULL );
777 This->pRender = pFilter;
779 hr = CPinBaseImpl_InitIPin(
781 This->unk.punkControl,
782 pcsPin, pcsPinReceive,
783 &pFilter->basefilter,
784 QUARTZ_VideoRendererPin_Name,
790 hr = CMemInputPinBaseImpl_InitIMemInputPin(
792 This->unk.punkControl,
796 CPinBaseImpl_UninitIPin( &This->pin );
802 QUARTZ_FreeObj(This);
806 This->unk.pEntries = PinIFEntries;
807 This->unk.dwEntries = sizeof(PinIFEntries)/sizeof(PinIFEntries[0]);
808 This->unk.pOnFinalRelease = QUARTZ_DestroyVideoRendererPin;
812 TRACE("returned successfully.\n");
817 /***************************************************************************
819 * CVideoRendererImpl::IBasicVideo2
824 static HRESULT WINAPI
825 IBasicVideo2_fnQueryInterface(IBasicVideo2* iface,REFIID riid,void** ppobj)
827 CVideoRendererImpl_THIS(iface,basvid);
829 TRACE("(%p)->()\n",This);
831 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
835 IBasicVideo2_fnAddRef(IBasicVideo2* iface)
837 CVideoRendererImpl_THIS(iface,basvid);
839 TRACE("(%p)->()\n",This);
841 return IUnknown_AddRef(This->unk.punkControl);
845 IBasicVideo2_fnRelease(IBasicVideo2* iface)
847 CVideoRendererImpl_THIS(iface,basvid);
849 TRACE("(%p)->()\n",This);
851 return IUnknown_Release(This->unk.punkControl);
854 static HRESULT WINAPI
855 IBasicVideo2_fnGetTypeInfoCount(IBasicVideo2* iface,UINT* pcTypeInfo)
857 CVideoRendererImpl_THIS(iface,basvid);
859 FIXME("(%p)->()\n",This);
864 static HRESULT WINAPI
865 IBasicVideo2_fnGetTypeInfo(IBasicVideo2* iface,UINT iTypeInfo, LCID lcid, ITypeInfo** ppobj)
867 CVideoRendererImpl_THIS(iface,basvid);
869 FIXME("(%p)->()\n",This);
874 static HRESULT WINAPI
875 IBasicVideo2_fnGetIDsOfNames(IBasicVideo2* iface,REFIID riid, LPOLESTR* ppwszName, UINT cNames, LCID lcid, DISPID* pDispId)
877 CVideoRendererImpl_THIS(iface,basvid);
879 FIXME("(%p)->()\n",This);
884 static HRESULT WINAPI
885 IBasicVideo2_fnInvoke(IBasicVideo2* iface,DISPID DispId, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarRes, EXCEPINFO* pExcepInfo, UINT* puArgErr)
887 CVideoRendererImpl_THIS(iface,basvid);
889 FIXME("(%p)->()\n",This);
895 static HRESULT WINAPI
896 IBasicVideo2_fnget_AvgTimePerFrame(IBasicVideo2* iface,REFTIME* prefTime)
898 CVideoRendererImpl_THIS(iface,basvid);
900 FIXME("(%p)->()\n",This);
905 static HRESULT WINAPI
906 IBasicVideo2_fnget_BitRate(IBasicVideo2* iface,long* plRate)
908 CVideoRendererImpl_THIS(iface,basvid);
910 FIXME("(%p)->()\n",This);
915 static HRESULT WINAPI
916 IBasicVideo2_fnget_BitErrorRate(IBasicVideo2* iface,long* plRate)
918 CVideoRendererImpl_THIS(iface,basvid);
920 FIXME("(%p)->()\n",This);
925 static HRESULT WINAPI
926 IBasicVideo2_fnget_VideoWidth(IBasicVideo2* iface,long* plWidth)
928 CVideoRendererImpl_THIS(iface,basvid);
930 FIXME("(%p)->()\n",This);
935 static HRESULT WINAPI
936 IBasicVideo2_fnget_VideoHeight(IBasicVideo2* iface,long* plHeight)
938 CVideoRendererImpl_THIS(iface,basvid);
940 FIXME("(%p)->()\n",This);
945 static HRESULT WINAPI
946 IBasicVideo2_fnput_SourceLeft(IBasicVideo2* iface,long lLeft)
948 CVideoRendererImpl_THIS(iface,basvid);
950 FIXME("(%p)->()\n",This);
955 static HRESULT WINAPI
956 IBasicVideo2_fnget_SourceLeft(IBasicVideo2* iface,long* plLeft)
958 CVideoRendererImpl_THIS(iface,basvid);
960 FIXME("(%p)->()\n",This);
965 static HRESULT WINAPI
966 IBasicVideo2_fnput_SourceWidth(IBasicVideo2* iface,long lWidth)
968 CVideoRendererImpl_THIS(iface,basvid);
970 FIXME("(%p)->()\n",This);
975 static HRESULT WINAPI
976 IBasicVideo2_fnget_SourceWidth(IBasicVideo2* iface,long* plWidth)
978 CVideoRendererImpl_THIS(iface,basvid);
980 FIXME("(%p)->()\n",This);
985 static HRESULT WINAPI
986 IBasicVideo2_fnput_SourceTop(IBasicVideo2* iface,long lTop)
988 CVideoRendererImpl_THIS(iface,basvid);
990 FIXME("(%p)->()\n",This);
995 static HRESULT WINAPI
996 IBasicVideo2_fnget_SourceTop(IBasicVideo2* iface,long* plTop)
998 CVideoRendererImpl_THIS(iface,basvid);
1000 FIXME("(%p)->()\n",This);
1005 static HRESULT WINAPI
1006 IBasicVideo2_fnput_SourceHeight(IBasicVideo2* iface,long lHeight)
1008 CVideoRendererImpl_THIS(iface,basvid);
1010 FIXME("(%p)->()\n",This);
1015 static HRESULT WINAPI
1016 IBasicVideo2_fnget_SourceHeight(IBasicVideo2* iface,long* plHeight)
1018 CVideoRendererImpl_THIS(iface,basvid);
1020 FIXME("(%p)->()\n",This);
1025 static HRESULT WINAPI
1026 IBasicVideo2_fnput_DestinationLeft(IBasicVideo2* iface,long lLeft)
1028 CVideoRendererImpl_THIS(iface,basvid);
1030 FIXME("(%p)->()\n",This);
1035 static HRESULT WINAPI
1036 IBasicVideo2_fnget_DestinationLeft(IBasicVideo2* iface,long* plLeft)
1038 CVideoRendererImpl_THIS(iface,basvid);
1040 FIXME("(%p)->()\n",This);
1045 static HRESULT WINAPI
1046 IBasicVideo2_fnput_DestinationWidth(IBasicVideo2* iface,long lWidth)
1048 CVideoRendererImpl_THIS(iface,basvid);
1050 FIXME("(%p)->()\n",This);
1055 static HRESULT WINAPI
1056 IBasicVideo2_fnget_DestinationWidth(IBasicVideo2* iface,long* plWidth)
1058 CVideoRendererImpl_THIS(iface,basvid);
1060 FIXME("(%p)->()\n",This);
1065 static HRESULT WINAPI
1066 IBasicVideo2_fnput_DestinationTop(IBasicVideo2* iface,long lTop)
1068 CVideoRendererImpl_THIS(iface,basvid);
1070 FIXME("(%p)->()\n",This);
1075 static HRESULT WINAPI
1076 IBasicVideo2_fnget_DestinationTop(IBasicVideo2* iface,long* plTop)
1078 CVideoRendererImpl_THIS(iface,basvid);
1080 FIXME("(%p)->()\n",This);
1085 static HRESULT WINAPI
1086 IBasicVideo2_fnput_DestinationHeight(IBasicVideo2* iface,long lHeight)
1088 CVideoRendererImpl_THIS(iface,basvid);
1090 FIXME("(%p)->()\n",This);
1095 static HRESULT WINAPI
1096 IBasicVideo2_fnget_DestinationHeight(IBasicVideo2* iface,long* plHeight)
1098 CVideoRendererImpl_THIS(iface,basvid);
1100 FIXME("(%p)->()\n",This);
1105 static HRESULT WINAPI
1106 IBasicVideo2_fnSetSourcePosition(IBasicVideo2* iface,long lLeft,long lTop,long lWidth,long lHeight)
1108 CVideoRendererImpl_THIS(iface,basvid);
1110 FIXME("(%p)->()\n",This);
1115 static HRESULT WINAPI
1116 IBasicVideo2_fnGetSourcePosition(IBasicVideo2* iface,long* plLeft,long* plTop,long* plWidth,long* plHeight)
1118 CVideoRendererImpl_THIS(iface,basvid);
1120 FIXME("(%p)->()\n",This);
1125 static HRESULT WINAPI
1126 IBasicVideo2_fnSetDefaultSourcePosition(IBasicVideo2* iface)
1128 CVideoRendererImpl_THIS(iface,basvid);
1130 FIXME("(%p)->()\n",This);
1135 static HRESULT WINAPI
1136 IBasicVideo2_fnSetDestinationPosition(IBasicVideo2* iface,long lLeft,long lTop,long lWidth,long lHeight)
1138 CVideoRendererImpl_THIS(iface,basvid);
1140 FIXME("(%p)->()\n",This);
1145 static HRESULT WINAPI
1146 IBasicVideo2_fnGetDestinationPosition(IBasicVideo2* iface,long* plLeft,long* plTop,long* plWidth,long* plHeight)
1148 CVideoRendererImpl_THIS(iface,basvid);
1150 FIXME("(%p)->()\n",This);
1155 static HRESULT WINAPI
1156 IBasicVideo2_fnSetDefaultDestinationPosition(IBasicVideo2* iface)
1158 CVideoRendererImpl_THIS(iface,basvid);
1160 FIXME("(%p)->()\n",This);
1165 static HRESULT WINAPI
1166 IBasicVideo2_fnGetVideoSize(IBasicVideo2* iface,long* plWidth,long* plHeight)
1168 CVideoRendererImpl_THIS(iface,basvid);
1170 FIXME("(%p)->()\n",This);
1175 static HRESULT WINAPI
1176 IBasicVideo2_fnGetVideoPaletteEntries(IBasicVideo2* iface,long lStart,long lCount,long* plRet,long* plPaletteEntry)
1178 CVideoRendererImpl_THIS(iface,basvid);
1180 FIXME("(%p)->()\n",This);
1185 static HRESULT WINAPI
1186 IBasicVideo2_fnGetCurrentImage(IBasicVideo2* iface,long* plBufferSize,long* plDIBBuffer)
1188 CVideoRendererImpl_THIS(iface,basvid);
1190 FIXME("(%p)->()\n",This);
1195 static HRESULT WINAPI
1196 IBasicVideo2_fnIsUsingDefaultSource(IBasicVideo2* iface)
1198 CVideoRendererImpl_THIS(iface,basvid);
1200 FIXME("(%p)->()\n",This);
1205 static HRESULT WINAPI
1206 IBasicVideo2_fnIsUsingDefaultDestination(IBasicVideo2* iface)
1208 CVideoRendererImpl_THIS(iface,basvid);
1210 FIXME("(%p)->()\n",This);
1215 static HRESULT WINAPI
1216 IBasicVideo2_fnGetPreferredAspectRatio(IBasicVideo2* iface,long* plRateX,long* plRateY)
1218 CVideoRendererImpl_THIS(iface,basvid);
1220 FIXME("(%p)->()\n",This);
1228 static ICOM_VTABLE(IBasicVideo2) ibasicvideo =
1230 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1231 /* IUnknown fields */
1232 IBasicVideo2_fnQueryInterface,
1233 IBasicVideo2_fnAddRef,
1234 IBasicVideo2_fnRelease,
1235 /* IDispatch fields */
1236 IBasicVideo2_fnGetTypeInfoCount,
1237 IBasicVideo2_fnGetTypeInfo,
1238 IBasicVideo2_fnGetIDsOfNames,
1239 IBasicVideo2_fnInvoke,
1240 /* IBasicVideo fields */
1241 IBasicVideo2_fnget_AvgTimePerFrame,
1242 IBasicVideo2_fnget_BitRate,
1243 IBasicVideo2_fnget_BitErrorRate,
1244 IBasicVideo2_fnget_VideoWidth,
1245 IBasicVideo2_fnget_VideoHeight,
1246 IBasicVideo2_fnput_SourceLeft,
1247 IBasicVideo2_fnget_SourceLeft,
1248 IBasicVideo2_fnput_SourceWidth,
1249 IBasicVideo2_fnget_SourceWidth,
1250 IBasicVideo2_fnput_SourceTop,
1251 IBasicVideo2_fnget_SourceTop,
1252 IBasicVideo2_fnput_SourceHeight,
1253 IBasicVideo2_fnget_SourceHeight,
1254 IBasicVideo2_fnput_DestinationLeft,
1255 IBasicVideo2_fnget_DestinationLeft,
1256 IBasicVideo2_fnput_DestinationWidth,
1257 IBasicVideo2_fnget_DestinationWidth,
1258 IBasicVideo2_fnput_DestinationTop,
1259 IBasicVideo2_fnget_DestinationTop,
1260 IBasicVideo2_fnput_DestinationHeight,
1261 IBasicVideo2_fnget_DestinationHeight,
1262 IBasicVideo2_fnSetSourcePosition,
1263 IBasicVideo2_fnGetSourcePosition,
1264 IBasicVideo2_fnSetDefaultSourcePosition,
1265 IBasicVideo2_fnSetDestinationPosition,
1266 IBasicVideo2_fnGetDestinationPosition,
1267 IBasicVideo2_fnSetDefaultDestinationPosition,
1268 IBasicVideo2_fnGetVideoSize,
1269 IBasicVideo2_fnGetVideoPaletteEntries,
1270 IBasicVideo2_fnGetCurrentImage,
1271 IBasicVideo2_fnIsUsingDefaultSource,
1272 IBasicVideo2_fnIsUsingDefaultDestination,
1273 /* IBasicVideo2 fields */
1274 IBasicVideo2_fnGetPreferredAspectRatio,
1278 HRESULT CVideoRendererImpl_InitIBasicVideo2( CVideoRendererImpl* This )
1280 TRACE("(%p)\n",This);
1281 ICOM_VTBL(&This->basvid) = &ibasicvideo;
1286 void CVideoRendererImpl_UninitIBasicVideo2( CVideoRendererImpl* This )
1288 TRACE("(%p)\n",This);
1291 /***************************************************************************
1293 * CVideoRendererImpl::IVideoWindow
1298 static HRESULT WINAPI
1299 IVideoWindow_fnQueryInterface(IVideoWindow* iface,REFIID riid,void** ppobj)
1301 CVideoRendererImpl_THIS(iface,vidwin);
1303 TRACE("(%p)->()\n",This);
1305 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
1309 IVideoWindow_fnAddRef(IVideoWindow* iface)
1311 CVideoRendererImpl_THIS(iface,vidwin);
1313 TRACE("(%p)->()\n",This);
1315 return IUnknown_AddRef(This->unk.punkControl);
1319 IVideoWindow_fnRelease(IVideoWindow* iface)
1321 CVideoRendererImpl_THIS(iface,vidwin);
1323 TRACE("(%p)->()\n",This);
1325 return IUnknown_Release(This->unk.punkControl);
1328 static HRESULT WINAPI
1329 IVideoWindow_fnGetTypeInfoCount(IVideoWindow* iface,UINT* pcTypeInfo)
1331 CVideoRendererImpl_THIS(iface,vidwin);
1333 FIXME("(%p)->()\n",This);
1338 static HRESULT WINAPI
1339 IVideoWindow_fnGetTypeInfo(IVideoWindow* iface,UINT iTypeInfo, LCID lcid, ITypeInfo** ppobj)
1341 CVideoRendererImpl_THIS(iface,vidwin);
1343 FIXME("(%p)->()\n",This);
1348 static HRESULT WINAPI
1349 IVideoWindow_fnGetIDsOfNames(IVideoWindow* iface,REFIID riid, LPOLESTR* ppwszName, UINT cNames, LCID lcid, DISPID* pDispId)
1351 CVideoRendererImpl_THIS(iface,vidwin);
1353 FIXME("(%p)->()\n",This);
1358 static HRESULT WINAPI
1359 IVideoWindow_fnInvoke(IVideoWindow* iface,DISPID DispId, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarRes, EXCEPINFO* pExcepInfo, UINT* puArgErr)
1361 CVideoRendererImpl_THIS(iface,vidwin);
1363 FIXME("(%p)->()\n",This);
1370 static HRESULT WINAPI
1371 IVideoWindow_fnput_Caption(IVideoWindow* iface,BSTR strCaption)
1373 CVideoRendererImpl_THIS(iface,vidwin);
1374 HRESULT hr = E_NOTIMPL;
1376 FIXME("(%p)->()\n",This);
1378 EnterCriticalSection ( &This->basefilter.csFilter );
1379 if ( This->m_hwnd == (HWND)NULL )
1381 hr = VFW_E_NOT_CONNECTED;
1387 LeaveCriticalSection ( &This->basefilter.csFilter );
1392 static HRESULT WINAPI
1393 IVideoWindow_fnget_Caption(IVideoWindow* iface,BSTR* pstrCaption)
1395 CVideoRendererImpl_THIS(iface,vidwin);
1396 HRESULT hr = E_NOTIMPL;
1398 FIXME("(%p)->()\n",This);
1400 EnterCriticalSection ( &This->basefilter.csFilter );
1401 if ( This->m_hwnd == (HWND)NULL )
1403 hr = VFW_E_NOT_CONNECTED;
1409 LeaveCriticalSection ( &This->basefilter.csFilter );
1414 static HRESULT WINAPI
1415 IVideoWindow_fnput_WindowStyle(IVideoWindow* iface,long lStyle)
1417 CVideoRendererImpl_THIS(iface,vidwin);
1418 HRESULT hr = E_NOTIMPL;
1420 FIXME("(%p)->()\n",This);
1422 EnterCriticalSection ( &This->basefilter.csFilter );
1423 if ( This->m_hwnd == (HWND)NULL )
1425 hr = VFW_E_NOT_CONNECTED;
1430 if ( SetWindowLongA( This->m_hwnd, GWL_STYLE, (DWORD)lStyle ) == 0 &&
1431 GetLastError() != 0 )
1439 LeaveCriticalSection ( &This->basefilter.csFilter );
1444 static HRESULT WINAPI
1445 IVideoWindow_fnget_WindowStyle(IVideoWindow* iface,long* plStyle)
1447 CVideoRendererImpl_THIS(iface,vidwin);
1448 HRESULT hr = E_NOTIMPL;
1450 FIXME("(%p)->()\n",This);
1452 EnterCriticalSection ( &This->basefilter.csFilter );
1453 if ( This->m_hwnd == (HWND)NULL )
1455 hr = VFW_E_NOT_CONNECTED;
1459 *plStyle = (LONG)GetWindowLongA( This->m_hwnd, GWL_STYLE );
1462 LeaveCriticalSection ( &This->basefilter.csFilter );
1467 static HRESULT WINAPI
1468 IVideoWindow_fnput_WindowStyleEx(IVideoWindow* iface,long lExStyle)
1470 CVideoRendererImpl_THIS(iface,vidwin);
1471 HRESULT hr = E_NOTIMPL;
1473 FIXME("(%p)->()\n",This);
1475 EnterCriticalSection ( &This->basefilter.csFilter );
1476 if ( This->m_hwnd == (HWND)NULL )
1478 hr = VFW_E_NOT_CONNECTED;
1483 if ( SetWindowLongA( This->m_hwnd, GWL_EXSTYLE, (DWORD)lExStyle ) == 0 &&
1484 GetLastError() != 0 )
1492 LeaveCriticalSection ( &This->basefilter.csFilter );
1497 static HRESULT WINAPI
1498 IVideoWindow_fnget_WindowStyleEx(IVideoWindow* iface,long* plExStyle)
1500 CVideoRendererImpl_THIS(iface,vidwin);
1501 HRESULT hr = E_NOTIMPL;
1503 FIXME("(%p)->()\n",This);
1505 if ( plExStyle == NULL )
1508 EnterCriticalSection ( &This->basefilter.csFilter );
1509 if ( This->m_hwnd == (HWND)NULL )
1511 hr = VFW_E_NOT_CONNECTED;
1515 *plExStyle = (LONG)GetWindowLongA( This->m_hwnd, GWL_EXSTYLE );
1518 LeaveCriticalSection ( &This->basefilter.csFilter );
1523 static HRESULT WINAPI
1524 IVideoWindow_fnput_AutoShow(IVideoWindow* iface,long lAutoShow)
1526 CVideoRendererImpl_THIS(iface,vidwin);
1527 HRESULT hr = E_NOTIMPL;
1529 FIXME("(%p)->()\n",This);
1531 EnterCriticalSection ( &This->basefilter.csFilter );
1532 if ( This->m_hwnd == (HWND)NULL )
1534 hr = VFW_E_NOT_CONNECTED;
1540 LeaveCriticalSection ( &This->basefilter.csFilter );
1545 static HRESULT WINAPI
1546 IVideoWindow_fnget_AutoShow(IVideoWindow* iface,long* plAutoShow)
1548 CVideoRendererImpl_THIS(iface,vidwin);
1549 HRESULT hr = E_NOTIMPL;
1551 FIXME("(%p)->()\n",This);
1553 EnterCriticalSection ( &This->basefilter.csFilter );
1554 if ( This->m_hwnd == (HWND)NULL )
1556 hr = VFW_E_NOT_CONNECTED;
1562 LeaveCriticalSection ( &This->basefilter.csFilter );
1567 static HRESULT WINAPI
1568 IVideoWindow_fnput_WindowState(IVideoWindow* iface,long lState)
1570 CVideoRendererImpl_THIS(iface,vidwin);
1571 HRESULT hr = E_NOTIMPL;
1573 FIXME("(%p)->()\n",This);
1575 EnterCriticalSection ( &This->basefilter.csFilter );
1576 if ( This->m_hwnd == (HWND)NULL )
1578 hr = VFW_E_NOT_CONNECTED;
1584 LeaveCriticalSection ( &This->basefilter.csFilter );
1589 static HRESULT WINAPI
1590 IVideoWindow_fnget_WindowState(IVideoWindow* iface,long* plState)
1592 CVideoRendererImpl_THIS(iface,vidwin);
1593 HRESULT hr = E_NOTIMPL;
1595 FIXME("(%p)->()\n",This);
1597 EnterCriticalSection ( &This->basefilter.csFilter );
1598 if ( This->m_hwnd == (HWND)NULL )
1600 hr = VFW_E_NOT_CONNECTED;
1606 LeaveCriticalSection ( &This->basefilter.csFilter );
1611 static HRESULT WINAPI
1612 IVideoWindow_fnput_BackgroundPalette(IVideoWindow* iface,long lBackPal)
1614 CVideoRendererImpl_THIS(iface,vidwin);
1615 HRESULT hr = E_NOTIMPL;
1617 FIXME("(%p)->()\n",This);
1619 EnterCriticalSection ( &This->basefilter.csFilter );
1620 if ( This->m_hwnd == (HWND)NULL )
1622 hr = VFW_E_NOT_CONNECTED;
1628 LeaveCriticalSection ( &This->basefilter.csFilter );
1633 static HRESULT WINAPI
1634 IVideoWindow_fnget_BackgroundPalette(IVideoWindow* iface,long* plBackPal)
1636 CVideoRendererImpl_THIS(iface,vidwin);
1637 HRESULT hr = E_NOTIMPL;
1639 FIXME("(%p)->()\n",This);
1641 EnterCriticalSection ( &This->basefilter.csFilter );
1642 if ( This->m_hwnd == (HWND)NULL )
1644 hr = VFW_E_NOT_CONNECTED;
1650 LeaveCriticalSection ( &This->basefilter.csFilter );
1655 static HRESULT WINAPI
1656 IVideoWindow_fnput_Visible(IVideoWindow* iface,long lVisible)
1658 CVideoRendererImpl_THIS(iface,vidwin);
1659 HRESULT hr = E_NOTIMPL;
1661 FIXME("(%p)->()\n",This);
1663 EnterCriticalSection ( &This->basefilter.csFilter );
1664 if ( This->m_hwnd == (HWND)NULL )
1666 hr = VFW_E_NOT_CONNECTED;
1672 LeaveCriticalSection ( &This->basefilter.csFilter );
1677 static HRESULT WINAPI
1678 IVideoWindow_fnget_Visible(IVideoWindow* iface,long* plVisible)
1680 CVideoRendererImpl_THIS(iface,vidwin);
1681 HRESULT hr = E_NOTIMPL;
1683 FIXME("(%p)->()\n",This);
1685 EnterCriticalSection ( &This->basefilter.csFilter );
1686 if ( This->m_hwnd == (HWND)NULL )
1688 hr = VFW_E_NOT_CONNECTED;
1694 LeaveCriticalSection ( &This->basefilter.csFilter );
1699 static HRESULT WINAPI
1700 IVideoWindow_fnput_Left(IVideoWindow* iface,long lLeft)
1702 CVideoRendererImpl_THIS(iface,vidwin);
1703 HRESULT hr = E_NOTIMPL;
1706 FIXME("(%p)->()\n",This);
1708 EnterCriticalSection ( &This->basefilter.csFilter );
1709 if ( This->m_hwnd == (HWND)NULL )
1711 hr = VFW_E_NOT_CONNECTED;
1715 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1720 if ( ! MoveWindow( This->m_hwnd, lLeft, rc.top, rc.right-rc.left, rc.bottom-rc.top, TRUE ) )
1727 LeaveCriticalSection ( &This->basefilter.csFilter );
1732 static HRESULT WINAPI
1733 IVideoWindow_fnget_Left(IVideoWindow* iface,long* plLeft)
1735 CVideoRendererImpl_THIS(iface,vidwin);
1736 HRESULT hr = E_NOTIMPL;
1739 FIXME("(%p)->()\n",This);
1741 if ( plLeft == NULL )
1744 EnterCriticalSection ( &This->basefilter.csFilter );
1745 if ( This->m_hwnd == (HWND)NULL )
1747 hr = VFW_E_NOT_CONNECTED;
1751 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1759 LeaveCriticalSection ( &This->basefilter.csFilter );
1764 static HRESULT WINAPI
1765 IVideoWindow_fnput_Width(IVideoWindow* iface,long lWidth)
1767 CVideoRendererImpl_THIS(iface,vidwin);
1768 HRESULT hr = E_NOTIMPL;
1771 FIXME("(%p)->()\n",This);
1774 return E_INVALIDARG;
1776 EnterCriticalSection ( &This->basefilter.csFilter );
1777 if ( This->m_hwnd == (HWND)NULL )
1779 hr = VFW_E_NOT_CONNECTED;
1783 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1788 if ( ! MoveWindow( This->m_hwnd, rc.left, rc.top, lWidth, rc.bottom-rc.top, TRUE ) )
1795 LeaveCriticalSection ( &This->basefilter.csFilter );
1800 static HRESULT WINAPI
1801 IVideoWindow_fnget_Width(IVideoWindow* iface,long* plWidth)
1803 CVideoRendererImpl_THIS(iface,vidwin);
1804 HRESULT hr = E_NOTIMPL;
1807 FIXME("(%p)->()\n",This);
1809 if ( plWidth == NULL )
1812 EnterCriticalSection ( &This->basefilter.csFilter );
1813 if ( This->m_hwnd == (HWND)NULL )
1815 hr = VFW_E_NOT_CONNECTED;
1819 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1824 *plWidth = rc.right-rc.left;
1827 LeaveCriticalSection ( &This->basefilter.csFilter );
1832 static HRESULT WINAPI
1833 IVideoWindow_fnput_Top(IVideoWindow* iface,long lTop)
1835 CVideoRendererImpl_THIS(iface,vidwin);
1836 HRESULT hr = E_NOTIMPL;
1839 FIXME("(%p)->()\n",This);
1841 EnterCriticalSection ( &This->basefilter.csFilter );
1842 if ( This->m_hwnd == (HWND)NULL )
1844 hr = VFW_E_NOT_CONNECTED;
1848 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1853 if ( ! MoveWindow( This->m_hwnd, rc.left, lTop, rc.right-rc.left, rc.bottom-rc.top, TRUE ) )
1860 LeaveCriticalSection ( &This->basefilter.csFilter );
1865 static HRESULT WINAPI
1866 IVideoWindow_fnget_Top(IVideoWindow* iface,long* plTop)
1868 CVideoRendererImpl_THIS(iface,vidwin);
1869 HRESULT hr = E_NOTIMPL;
1872 FIXME("(%p)->()\n",This);
1874 if ( plTop == NULL )
1877 EnterCriticalSection ( &This->basefilter.csFilter );
1878 if ( This->m_hwnd == (HWND)NULL )
1880 hr = VFW_E_NOT_CONNECTED;
1884 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1892 LeaveCriticalSection ( &This->basefilter.csFilter );
1897 static HRESULT WINAPI
1898 IVideoWindow_fnput_Height(IVideoWindow* iface,long lHeight)
1900 CVideoRendererImpl_THIS(iface,vidwin);
1901 HRESULT hr = E_NOTIMPL;
1904 FIXME("(%p)->()\n",This);
1907 return E_INVALIDARG;
1909 EnterCriticalSection ( &This->basefilter.csFilter );
1910 if ( This->m_hwnd == (HWND)NULL )
1912 hr = VFW_E_NOT_CONNECTED;
1916 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1921 if ( ! MoveWindow( This->m_hwnd, rc.left, rc.top, rc.right-rc.left, lHeight, TRUE ) )
1928 LeaveCriticalSection ( &This->basefilter.csFilter );
1933 static HRESULT WINAPI
1934 IVideoWindow_fnget_Height(IVideoWindow* iface,long* plHeight)
1936 CVideoRendererImpl_THIS(iface,vidwin);
1937 HRESULT hr = E_NOTIMPL;
1940 FIXME("(%p)->()\n",This);
1942 if ( plHeight == NULL )
1945 EnterCriticalSection ( &This->basefilter.csFilter );
1946 if ( This->m_hwnd == (HWND)NULL )
1948 hr = VFW_E_NOT_CONNECTED;
1952 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1957 *plHeight = rc.bottom-rc.top;
1960 LeaveCriticalSection ( &This->basefilter.csFilter );
1965 static HRESULT WINAPI
1966 IVideoWindow_fnput_Owner(IVideoWindow* iface,OAHWND hwnd)
1968 CVideoRendererImpl_THIS(iface,vidwin);
1969 HRESULT hr = E_NOTIMPL;
1973 FIXME("(%p)->()\n",This);
1975 EnterCriticalSection ( &This->basefilter.csFilter );
1976 if ( This->m_hwnd == (HWND)NULL )
1978 hr = VFW_E_NOT_CONNECTED;
1981 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1987 dwStyle = (DWORD)GetWindowLongA( This->m_hwnd, GWL_STYLE );
1988 if ( hwnd == (HWND)NULL )
1989 SetWindowLongA( This->m_hwnd, GWL_STYLE, dwStyle & (~WS_CHILD) );
1990 SetParent( This->m_hwnd, (HWND)hwnd );
1991 if ( (HWND)hwnd != (HWND)NULL )
1993 SetWindowLongA( This->m_hwnd, GWL_STYLE, dwStyle | WS_CHILD );
1994 MoveWindow( This->m_hwnd, 0, 0, rc.right-rc.left, rc.bottom-rc.top, TRUE );
1999 LeaveCriticalSection ( &This->basefilter.csFilter );
2004 static HRESULT WINAPI
2005 IVideoWindow_fnget_Owner(IVideoWindow* iface,OAHWND* phwnd)
2007 CVideoRendererImpl_THIS(iface,vidwin);
2008 HRESULT hr = E_NOTIMPL;
2010 FIXME("(%p)->()\n",This);
2012 if ( phwnd == NULL )
2015 EnterCriticalSection ( &This->basefilter.csFilter );
2016 if ( This->m_hwnd == (HWND)NULL )
2018 hr = VFW_E_NOT_CONNECTED;
2022 *phwnd = (OAHWND)GetParent( This->m_hwnd );
2025 LeaveCriticalSection ( &This->basefilter.csFilter );
2030 static HRESULT WINAPI
2031 IVideoWindow_fnput_MessageDrain(IVideoWindow* iface,OAHWND hwnd)
2033 CVideoRendererImpl_THIS(iface,vidwin);
2034 HRESULT hr = E_NOTIMPL;
2036 FIXME("(%p)->()\n",This);
2038 EnterCriticalSection ( &This->basefilter.csFilter );
2039 if ( This->m_hwnd == (HWND)NULL )
2041 hr = VFW_E_NOT_CONNECTED;
2047 LeaveCriticalSection ( &This->basefilter.csFilter );
2052 static HRESULT WINAPI
2053 IVideoWindow_fnget_MessageDrain(IVideoWindow* iface,OAHWND* phwnd)
2055 CVideoRendererImpl_THIS(iface,vidwin);
2056 HRESULT hr = E_NOTIMPL;
2058 FIXME("(%p)->()\n",This);
2060 EnterCriticalSection ( &This->basefilter.csFilter );
2061 if ( This->m_hwnd == (HWND)NULL )
2063 hr = VFW_E_NOT_CONNECTED;
2069 LeaveCriticalSection ( &This->basefilter.csFilter );
2074 static HRESULT WINAPI
2075 IVideoWindow_fnget_BorderColor(IVideoWindow* iface,long* plColor)
2077 CVideoRendererImpl_THIS(iface,vidwin);
2078 HRESULT hr = E_NOTIMPL;
2080 FIXME("(%p)->()\n",This);
2082 EnterCriticalSection ( &This->basefilter.csFilter );
2083 if ( This->m_hwnd == (HWND)NULL )
2085 hr = VFW_E_NOT_CONNECTED;
2091 LeaveCriticalSection ( &This->basefilter.csFilter );
2096 static HRESULT WINAPI
2097 IVideoWindow_fnput_BorderColor(IVideoWindow* iface,long lColor)
2099 CVideoRendererImpl_THIS(iface,vidwin);
2100 HRESULT hr = E_NOTIMPL;
2102 FIXME("(%p)->()\n",This);
2104 EnterCriticalSection ( &This->basefilter.csFilter );
2105 if ( This->m_hwnd == (HWND)NULL )
2107 hr = VFW_E_NOT_CONNECTED;
2113 LeaveCriticalSection ( &This->basefilter.csFilter );
2118 static HRESULT WINAPI
2119 IVideoWindow_fnget_FullScreenMode(IVideoWindow* iface,long* plMode)
2121 CVideoRendererImpl_THIS(iface,vidwin);
2122 HRESULT hr = E_NOTIMPL;
2124 FIXME("(%p)->()\n",This);
2126 EnterCriticalSection ( &This->basefilter.csFilter );
2127 if ( This->m_hwnd == (HWND)NULL )
2129 hr = VFW_E_NOT_CONNECTED;
2135 LeaveCriticalSection ( &This->basefilter.csFilter );
2140 static HRESULT WINAPI
2141 IVideoWindow_fnput_FullScreenMode(IVideoWindow* iface,long lMode)
2143 CVideoRendererImpl_THIS(iface,vidwin);
2144 HRESULT hr = E_NOTIMPL;
2146 FIXME("(%p)->()\n",This);
2148 EnterCriticalSection ( &This->basefilter.csFilter );
2149 if ( This->m_hwnd == (HWND)NULL )
2151 hr = VFW_E_NOT_CONNECTED;
2157 LeaveCriticalSection ( &This->basefilter.csFilter );
2162 static HRESULT WINAPI
2163 IVideoWindow_fnSetWindowForeground(IVideoWindow* iface,long lFocus)
2165 CVideoRendererImpl_THIS(iface,vidwin);
2166 HRESULT hr = E_NOTIMPL;
2168 FIXME("(%p)->()\n",This);
2170 EnterCriticalSection ( &This->basefilter.csFilter );
2171 if ( This->m_hwnd == (HWND)NULL )
2173 hr = VFW_E_NOT_CONNECTED;
2179 LeaveCriticalSection ( &This->basefilter.csFilter );
2184 static HRESULT WINAPI
2185 IVideoWindow_fnNotifyOwnerMessage(IVideoWindow* iface,OAHWND hwnd,long message,LONG_PTR wParam,LONG_PTR lParam)
2187 CVideoRendererImpl_THIS(iface,vidwin);
2188 HRESULT hr = E_NOTIMPL;
2190 FIXME("(%p)->()\n",This);
2192 EnterCriticalSection ( &This->basefilter.csFilter );
2193 if ( This->m_hwnd == (HWND)NULL )
2195 hr = VFW_E_NOT_CONNECTED;
2201 LeaveCriticalSection ( &This->basefilter.csFilter );
2206 static HRESULT WINAPI
2207 IVideoWindow_fnSetWindowPosition(IVideoWindow* iface,long lLeft,long lTop,long lWidth,long lHeight)
2209 CVideoRendererImpl_THIS(iface,vidwin);
2210 HRESULT hr = E_NOTIMPL;
2212 FIXME("(%p)->()\n",This);
2214 EnterCriticalSection ( &This->basefilter.csFilter );
2215 if ( This->m_hwnd == (HWND)NULL )
2217 hr = VFW_E_NOT_CONNECTED;
2221 if ( ! MoveWindow( This->m_hwnd, lLeft, lTop, lWidth, lHeight, TRUE ) )
2228 LeaveCriticalSection ( &This->basefilter.csFilter );
2233 static HRESULT WINAPI
2234 IVideoWindow_fnGetWindowPosition(IVideoWindow* iface,long* plLeft,long* plTop,long* plWidth,long* plHeight)
2236 CVideoRendererImpl_THIS(iface,vidwin);
2237 HRESULT hr = E_NOTIMPL;
2240 FIXME("(%p)->()\n",This);
2242 if ( plLeft == NULL || plTop == NULL ||
2243 plWidth == NULL || plHeight == NULL )
2246 EnterCriticalSection ( &This->basefilter.csFilter );
2247 if ( This->m_hwnd == (HWND)NULL )
2249 hr = VFW_E_NOT_CONNECTED;
2254 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
2262 *plWidth = rc.right-rc.left;
2263 *plHeight = rc.bottom-rc.top;
2267 LeaveCriticalSection ( &This->basefilter.csFilter );
2272 static HRESULT WINAPI
2273 IVideoWindow_fnGetMinIdealImageSize(IVideoWindow* iface,long* plWidth,long* plHeight)
2275 CVideoRendererImpl_THIS(iface,vidwin);
2276 HRESULT hr = E_NOTIMPL;
2278 FIXME("(%p)->()\n",This);
2280 EnterCriticalSection ( &This->basefilter.csFilter );
2281 if ( This->m_hwnd == (HWND)NULL )
2283 hr = VFW_E_NOT_CONNECTED;
2289 LeaveCriticalSection ( &This->basefilter.csFilter );
2294 static HRESULT WINAPI
2295 IVideoWindow_fnGetMaxIdealImageSize(IVideoWindow* iface,long* plWidth,long* plHeight)
2297 CVideoRendererImpl_THIS(iface,vidwin);
2298 HRESULT hr = E_NOTIMPL;
2300 FIXME("(%p)->()\n",This);
2302 EnterCriticalSection ( &This->basefilter.csFilter );
2303 if ( This->m_hwnd == (HWND)NULL )
2305 hr = VFW_E_NOT_CONNECTED;
2311 LeaveCriticalSection ( &This->basefilter.csFilter );
2316 static HRESULT WINAPI
2317 IVideoWindow_fnGetRestorePosition(IVideoWindow* iface,long* plLeft,long* plTop,long* plWidth,long* plHeight)
2319 CVideoRendererImpl_THIS(iface,vidwin);
2320 HRESULT hr = E_NOTIMPL;
2322 FIXME("(%p)->()\n",This);
2324 EnterCriticalSection ( &This->basefilter.csFilter );
2325 if ( This->m_hwnd == (HWND)NULL )
2327 hr = VFW_E_NOT_CONNECTED;
2333 LeaveCriticalSection ( &This->basefilter.csFilter );
2338 static HRESULT WINAPI
2339 IVideoWindow_fnHideCursor(IVideoWindow* iface,long lHide)
2341 CVideoRendererImpl_THIS(iface,vidwin);
2342 HRESULT hr = E_NOTIMPL;
2344 FIXME("(%p)->()\n",This);
2346 EnterCriticalSection ( &This->basefilter.csFilter );
2347 if ( This->m_hwnd == (HWND)NULL )
2349 hr = VFW_E_NOT_CONNECTED;
2355 LeaveCriticalSection ( &This->basefilter.csFilter );
2360 static HRESULT WINAPI
2361 IVideoWindow_fnIsCursorHidden(IVideoWindow* iface,long* plHide)
2363 CVideoRendererImpl_THIS(iface,vidwin);
2364 HRESULT hr = E_NOTIMPL;
2366 FIXME("(%p)->()\n",This);
2368 EnterCriticalSection ( &This->basefilter.csFilter );
2369 if ( This->m_hwnd == (HWND)NULL )
2371 hr = VFW_E_NOT_CONNECTED;
2377 LeaveCriticalSection ( &This->basefilter.csFilter );
2385 static ICOM_VTABLE(IVideoWindow) ivideowindow =
2387 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
2388 /* IUnknown fields */
2389 IVideoWindow_fnQueryInterface,
2390 IVideoWindow_fnAddRef,
2391 IVideoWindow_fnRelease,
2392 /* IDispatch fields */
2393 IVideoWindow_fnGetTypeInfoCount,
2394 IVideoWindow_fnGetTypeInfo,
2395 IVideoWindow_fnGetIDsOfNames,
2396 IVideoWindow_fnInvoke,
2397 /* IVideoWindow fields */
2398 IVideoWindow_fnput_Caption,
2399 IVideoWindow_fnget_Caption,
2400 IVideoWindow_fnput_WindowStyle,
2401 IVideoWindow_fnget_WindowStyle,
2402 IVideoWindow_fnput_WindowStyleEx,
2403 IVideoWindow_fnget_WindowStyleEx,
2404 IVideoWindow_fnput_AutoShow,
2405 IVideoWindow_fnget_AutoShow,
2406 IVideoWindow_fnput_WindowState,
2407 IVideoWindow_fnget_WindowState,
2408 IVideoWindow_fnput_BackgroundPalette,
2409 IVideoWindow_fnget_BackgroundPalette,
2410 IVideoWindow_fnput_Visible,
2411 IVideoWindow_fnget_Visible,
2412 IVideoWindow_fnput_Left,
2413 IVideoWindow_fnget_Left,
2414 IVideoWindow_fnput_Width,
2415 IVideoWindow_fnget_Width,
2416 IVideoWindow_fnput_Top,
2417 IVideoWindow_fnget_Top,
2418 IVideoWindow_fnput_Height,
2419 IVideoWindow_fnget_Height,
2420 IVideoWindow_fnput_Owner,
2421 IVideoWindow_fnget_Owner,
2422 IVideoWindow_fnput_MessageDrain,
2423 IVideoWindow_fnget_MessageDrain,
2424 IVideoWindow_fnget_BorderColor,
2425 IVideoWindow_fnput_BorderColor,
2426 IVideoWindow_fnget_FullScreenMode,
2427 IVideoWindow_fnput_FullScreenMode,
2428 IVideoWindow_fnSetWindowForeground,
2429 IVideoWindow_fnNotifyOwnerMessage,
2430 IVideoWindow_fnSetWindowPosition,
2431 IVideoWindow_fnGetWindowPosition,
2432 IVideoWindow_fnGetMinIdealImageSize,
2433 IVideoWindow_fnGetMaxIdealImageSize,
2434 IVideoWindow_fnGetRestorePosition,
2435 IVideoWindow_fnHideCursor,
2436 IVideoWindow_fnIsCursorHidden,
2441 HRESULT CVideoRendererImpl_InitIVideoWindow( CVideoRendererImpl* This )
2443 TRACE("(%p)\n",This);
2444 ICOM_VTBL(&This->vidwin) = &ivideowindow;
2449 void CVideoRendererImpl_UninitIVideoWindow( CVideoRendererImpl* This )
2451 TRACE("(%p)\n",This);