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_IVideoWindow, offsetof(CVideoRendererImpl,vidwin)-offsetof(CVideoRendererImpl,unk) },
604 static HRESULT CVideoRendererImpl_OnQueryInterface(
605 IUnknown* punk, const IID* piid, void** ppobj )
607 CVideoRendererImpl_THIS(punk,unk);
609 if ( This->pSeekPass == NULL )
610 return E_NOINTERFACE;
612 if ( IsEqualGUID( &IID_IMediaPosition, piid ) ||
613 IsEqualGUID( &IID_IMediaSeeking, piid ) )
615 TRACE( "IMediaSeeking(or IMediaPosition) is queried\n" );
616 return IUnknown_QueryInterface( (IUnknown*)(&This->pSeekPass->unk), piid, ppobj );
619 return E_NOINTERFACE;
622 static void QUARTZ_DestroyVideoRenderer(IUnknown* punk)
624 CVideoRendererImpl_THIS(punk,unk);
626 TRACE( "(%p)\n", This );
627 CVideoRendererImpl_OnInactive(&This->basefilter);
628 VIDREN_EndThread(This);
630 if ( This->pPin != NULL )
632 IUnknown_Release(This->pPin->unk.punkControl);
635 if ( This->pSeekPass != NULL )
637 IUnknown_Release((IUnknown*)&This->pSeekPass->unk);
638 This->pSeekPass = NULL;
641 CVideoRendererImpl_UninitIBasicVideo(This);
642 CVideoRendererImpl_UninitIVideoWindow(This);
643 CBaseFilterImpl_UninitIBaseFilter(&This->basefilter);
645 DeleteCriticalSection( &This->m_csReceive );
648 HRESULT QUARTZ_CreateVideoRenderer(IUnknown* punkOuter,void** ppobj)
650 CVideoRendererImpl* This = NULL;
653 TRACE("(%p,%p)\n",punkOuter,ppobj);
655 This = (CVideoRendererImpl*)
656 QUARTZ_AllocObj( sizeof(CVideoRendererImpl) );
658 return E_OUTOFMEMORY;
659 This->pSeekPass = NULL;
661 This->m_fInFlush = FALSE;
663 This->m_hEventInit = (HANDLE)NULL;
664 This->m_hThread = (HANDLE)NULL;
665 This->m_hwnd = (HWND)NULL;
666 This->m_bSampleIsValid = FALSE;
667 This->m_pSampleData = NULL;
668 This->m_cbSampleData = 0;
670 QUARTZ_IUnkInit( &This->unk, punkOuter );
671 This->qiext.pNext = NULL;
672 This->qiext.pOnQueryInterface = &CVideoRendererImpl_OnQueryInterface;
673 QUARTZ_IUnkAddDelegation( &This->unk, &This->qiext );
675 hr = CBaseFilterImpl_InitIBaseFilter(
677 This->unk.punkControl,
678 &CLSID_VideoRenderer,
679 QUARTZ_VideoRenderer_Name,
683 hr = CVideoRendererImpl_InitIBasicVideo(This);
686 hr = CVideoRendererImpl_InitIVideoWindow(This);
689 CVideoRendererImpl_UninitIBasicVideo(This);
694 CBaseFilterImpl_UninitIBaseFilter(&This->basefilter);
700 QUARTZ_FreeObj(This);
704 This->unk.pEntries = FilterIFEntries;
705 This->unk.dwEntries = sizeof(FilterIFEntries)/sizeof(FilterIFEntries[0]);
706 This->unk.pOnFinalRelease = QUARTZ_DestroyVideoRenderer;
708 InitializeCriticalSection( &This->m_csReceive );
710 hr = QUARTZ_CreateVideoRendererPin(
712 &This->basefilter.csFilter,
716 hr = QUARTZ_CompList_AddComp(
717 This->basefilter.pInPins,
718 (IUnknown*)&This->pPin->pin,
721 hr = QUARTZ_CreateSeekingPassThruInternal(
722 (IUnknown*)&(This->unk), &This->pSeekPass,
723 TRUE, (IPin*)&(This->pPin->pin) );
727 IUnknown_Release( This->unk.punkControl );
731 *ppobj = (void*)&(This->unk);
736 /***************************************************************************
738 * new/delete CVideoRendererPinImpl
742 /* can I use offsetof safely? - FIXME? */
743 static QUARTZ_IFEntry PinIFEntries[] =
745 { &IID_IPin, offsetof(CVideoRendererPinImpl,pin)-offsetof(CVideoRendererPinImpl,unk) },
746 { &IID_IMemInputPin, offsetof(CVideoRendererPinImpl,meminput)-offsetof(CVideoRendererPinImpl,unk) },
749 static void QUARTZ_DestroyVideoRendererPin(IUnknown* punk)
751 CVideoRendererPinImpl_THIS(punk,unk);
753 TRACE( "(%p)\n", This );
755 CPinBaseImpl_UninitIPin( &This->pin );
756 CMemInputPinBaseImpl_UninitIMemInputPin( &This->meminput );
759 HRESULT QUARTZ_CreateVideoRendererPin(
760 CVideoRendererImpl* pFilter,
761 CRITICAL_SECTION* pcsPin,
762 CRITICAL_SECTION* pcsPinReceive,
763 CVideoRendererPinImpl** ppPin)
765 CVideoRendererPinImpl* This = NULL;
768 TRACE("(%p,%p,%p,%p)\n",pFilter,pcsPin,pcsPinReceive,ppPin);
770 This = (CVideoRendererPinImpl*)
771 QUARTZ_AllocObj( sizeof(CVideoRendererPinImpl) );
773 return E_OUTOFMEMORY;
775 QUARTZ_IUnkInit( &This->unk, NULL );
776 This->pRender = pFilter;
778 hr = CPinBaseImpl_InitIPin(
780 This->unk.punkControl,
781 pcsPin, pcsPinReceive,
782 &pFilter->basefilter,
783 QUARTZ_VideoRendererPin_Name,
789 hr = CMemInputPinBaseImpl_InitIMemInputPin(
791 This->unk.punkControl,
795 CPinBaseImpl_UninitIPin( &This->pin );
801 QUARTZ_FreeObj(This);
805 This->unk.pEntries = PinIFEntries;
806 This->unk.dwEntries = sizeof(PinIFEntries)/sizeof(PinIFEntries[0]);
807 This->unk.pOnFinalRelease = QUARTZ_DestroyVideoRendererPin;
811 TRACE("returned successfully.\n");
816 /***************************************************************************
818 * CVideoRendererImpl::IBasicVideo
823 static HRESULT WINAPI
824 IBasicVideo_fnQueryInterface(IBasicVideo* iface,REFIID riid,void** ppobj)
826 CVideoRendererImpl_THIS(iface,basvid);
828 TRACE("(%p)->()\n",This);
830 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
834 IBasicVideo_fnAddRef(IBasicVideo* iface)
836 CVideoRendererImpl_THIS(iface,basvid);
838 TRACE("(%p)->()\n",This);
840 return IUnknown_AddRef(This->unk.punkControl);
844 IBasicVideo_fnRelease(IBasicVideo* iface)
846 CVideoRendererImpl_THIS(iface,basvid);
848 TRACE("(%p)->()\n",This);
850 return IUnknown_Release(This->unk.punkControl);
853 static HRESULT WINAPI
854 IBasicVideo_fnGetTypeInfoCount(IBasicVideo* iface,UINT* pcTypeInfo)
856 CVideoRendererImpl_THIS(iface,basvid);
858 FIXME("(%p)->()\n",This);
863 static HRESULT WINAPI
864 IBasicVideo_fnGetTypeInfo(IBasicVideo* iface,UINT iTypeInfo, LCID lcid, ITypeInfo** ppobj)
866 CVideoRendererImpl_THIS(iface,basvid);
868 FIXME("(%p)->()\n",This);
873 static HRESULT WINAPI
874 IBasicVideo_fnGetIDsOfNames(IBasicVideo* iface,REFIID riid, LPOLESTR* ppwszName, UINT cNames, LCID lcid, DISPID* pDispId)
876 CVideoRendererImpl_THIS(iface,basvid);
878 FIXME("(%p)->()\n",This);
883 static HRESULT WINAPI
884 IBasicVideo_fnInvoke(IBasicVideo* iface,DISPID DispId, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarRes, EXCEPINFO* pExcepInfo, UINT* puArgErr)
886 CVideoRendererImpl_THIS(iface,basvid);
888 FIXME("(%p)->()\n",This);
894 static HRESULT WINAPI
895 IBasicVideo_fnget_AvgTimePerFrame(IBasicVideo* iface,REFTIME* prefTime)
897 CVideoRendererImpl_THIS(iface,basvid);
899 FIXME("(%p)->()\n",This);
904 static HRESULT WINAPI
905 IBasicVideo_fnget_BitRate(IBasicVideo* iface,long* plRate)
907 CVideoRendererImpl_THIS(iface,basvid);
909 FIXME("(%p)->()\n",This);
914 static HRESULT WINAPI
915 IBasicVideo_fnget_BitErrorRate(IBasicVideo* iface,long* plRate)
917 CVideoRendererImpl_THIS(iface,basvid);
919 FIXME("(%p)->()\n",This);
924 static HRESULT WINAPI
925 IBasicVideo_fnget_VideoWidth(IBasicVideo* iface,long* plWidth)
927 CVideoRendererImpl_THIS(iface,basvid);
929 FIXME("(%p)->()\n",This);
934 static HRESULT WINAPI
935 IBasicVideo_fnget_VideoHeight(IBasicVideo* iface,long* plHeight)
937 CVideoRendererImpl_THIS(iface,basvid);
939 FIXME("(%p)->()\n",This);
944 static HRESULT WINAPI
945 IBasicVideo_fnput_SourceLeft(IBasicVideo* iface,long lLeft)
947 CVideoRendererImpl_THIS(iface,basvid);
949 FIXME("(%p)->()\n",This);
954 static HRESULT WINAPI
955 IBasicVideo_fnget_SourceLeft(IBasicVideo* iface,long* plLeft)
957 CVideoRendererImpl_THIS(iface,basvid);
959 FIXME("(%p)->()\n",This);
964 static HRESULT WINAPI
965 IBasicVideo_fnput_SourceWidth(IBasicVideo* iface,long lWidth)
967 CVideoRendererImpl_THIS(iface,basvid);
969 FIXME("(%p)->()\n",This);
974 static HRESULT WINAPI
975 IBasicVideo_fnget_SourceWidth(IBasicVideo* iface,long* plWidth)
977 CVideoRendererImpl_THIS(iface,basvid);
979 FIXME("(%p)->()\n",This);
984 static HRESULT WINAPI
985 IBasicVideo_fnput_SourceTop(IBasicVideo* iface,long lTop)
987 CVideoRendererImpl_THIS(iface,basvid);
989 FIXME("(%p)->()\n",This);
994 static HRESULT WINAPI
995 IBasicVideo_fnget_SourceTop(IBasicVideo* iface,long* plTop)
997 CVideoRendererImpl_THIS(iface,basvid);
999 FIXME("(%p)->()\n",This);
1004 static HRESULT WINAPI
1005 IBasicVideo_fnput_SourceHeight(IBasicVideo* iface,long lHeight)
1007 CVideoRendererImpl_THIS(iface,basvid);
1009 FIXME("(%p)->()\n",This);
1014 static HRESULT WINAPI
1015 IBasicVideo_fnget_SourceHeight(IBasicVideo* iface,long* plHeight)
1017 CVideoRendererImpl_THIS(iface,basvid);
1019 FIXME("(%p)->()\n",This);
1024 static HRESULT WINAPI
1025 IBasicVideo_fnput_DestinationLeft(IBasicVideo* iface,long lLeft)
1027 CVideoRendererImpl_THIS(iface,basvid);
1029 FIXME("(%p)->()\n",This);
1034 static HRESULT WINAPI
1035 IBasicVideo_fnget_DestinationLeft(IBasicVideo* iface,long* plLeft)
1037 CVideoRendererImpl_THIS(iface,basvid);
1039 FIXME("(%p)->()\n",This);
1044 static HRESULT WINAPI
1045 IBasicVideo_fnput_DestinationWidth(IBasicVideo* iface,long lWidth)
1047 CVideoRendererImpl_THIS(iface,basvid);
1049 FIXME("(%p)->()\n",This);
1054 static HRESULT WINAPI
1055 IBasicVideo_fnget_DestinationWidth(IBasicVideo* iface,long* plWidth)
1057 CVideoRendererImpl_THIS(iface,basvid);
1059 FIXME("(%p)->()\n",This);
1064 static HRESULT WINAPI
1065 IBasicVideo_fnput_DestinationTop(IBasicVideo* iface,long lTop)
1067 CVideoRendererImpl_THIS(iface,basvid);
1069 FIXME("(%p)->()\n",This);
1074 static HRESULT WINAPI
1075 IBasicVideo_fnget_DestinationTop(IBasicVideo* iface,long* plTop)
1077 CVideoRendererImpl_THIS(iface,basvid);
1079 FIXME("(%p)->()\n",This);
1084 static HRESULT WINAPI
1085 IBasicVideo_fnput_DestinationHeight(IBasicVideo* iface,long lHeight)
1087 CVideoRendererImpl_THIS(iface,basvid);
1089 FIXME("(%p)->()\n",This);
1094 static HRESULT WINAPI
1095 IBasicVideo_fnget_DestinationHeight(IBasicVideo* iface,long* plHeight)
1097 CVideoRendererImpl_THIS(iface,basvid);
1099 FIXME("(%p)->()\n",This);
1104 static HRESULT WINAPI
1105 IBasicVideo_fnSetSourcePosition(IBasicVideo* iface,long lLeft,long lTop,long lWidth,long lHeight)
1107 CVideoRendererImpl_THIS(iface,basvid);
1109 FIXME("(%p)->()\n",This);
1114 static HRESULT WINAPI
1115 IBasicVideo_fnGetSourcePosition(IBasicVideo* iface,long* plLeft,long* plTop,long* plWidth,long* plHeight)
1117 CVideoRendererImpl_THIS(iface,basvid);
1119 FIXME("(%p)->()\n",This);
1124 static HRESULT WINAPI
1125 IBasicVideo_fnSetDefaultSourcePosition(IBasicVideo* iface)
1127 CVideoRendererImpl_THIS(iface,basvid);
1129 FIXME("(%p)->()\n",This);
1134 static HRESULT WINAPI
1135 IBasicVideo_fnSetDestinationPosition(IBasicVideo* iface,long lLeft,long lTop,long lWidth,long lHeight)
1137 CVideoRendererImpl_THIS(iface,basvid);
1139 FIXME("(%p)->()\n",This);
1144 static HRESULT WINAPI
1145 IBasicVideo_fnGetDestinationPosition(IBasicVideo* iface,long* plLeft,long* plTop,long* plWidth,long* plHeight)
1147 CVideoRendererImpl_THIS(iface,basvid);
1149 FIXME("(%p)->()\n",This);
1154 static HRESULT WINAPI
1155 IBasicVideo_fnSetDefaultDestinationPosition(IBasicVideo* iface)
1157 CVideoRendererImpl_THIS(iface,basvid);
1159 FIXME("(%p)->()\n",This);
1164 static HRESULT WINAPI
1165 IBasicVideo_fnGetVideoSize(IBasicVideo* iface,long* plWidth,long* plHeight)
1167 CVideoRendererImpl_THIS(iface,basvid);
1169 FIXME("(%p)->()\n",This);
1174 static HRESULT WINAPI
1175 IBasicVideo_fnGetVideoPaletteEntries(IBasicVideo* iface,long lStart,long lCount,long* plRet,long* plPaletteEntry)
1177 CVideoRendererImpl_THIS(iface,basvid);
1179 FIXME("(%p)->()\n",This);
1184 static HRESULT WINAPI
1185 IBasicVideo_fnGetCurrentImage(IBasicVideo* iface,long* plBufferSize,long* plDIBBuffer)
1187 CVideoRendererImpl_THIS(iface,basvid);
1189 FIXME("(%p)->()\n",This);
1194 static HRESULT WINAPI
1195 IBasicVideo_fnIsUsingDefaultSource(IBasicVideo* iface)
1197 CVideoRendererImpl_THIS(iface,basvid);
1199 FIXME("(%p)->()\n",This);
1204 static HRESULT WINAPI
1205 IBasicVideo_fnIsUsingDefaultDestination(IBasicVideo* iface)
1207 CVideoRendererImpl_THIS(iface,basvid);
1209 FIXME("(%p)->()\n",This);
1217 static ICOM_VTABLE(IBasicVideo) ibasicvideo =
1219 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
1220 /* IUnknown fields */
1221 IBasicVideo_fnQueryInterface,
1222 IBasicVideo_fnAddRef,
1223 IBasicVideo_fnRelease,
1224 /* IDispatch fields */
1225 IBasicVideo_fnGetTypeInfoCount,
1226 IBasicVideo_fnGetTypeInfo,
1227 IBasicVideo_fnGetIDsOfNames,
1228 IBasicVideo_fnInvoke,
1229 /* IBasicVideo fields */
1230 IBasicVideo_fnget_AvgTimePerFrame,
1231 IBasicVideo_fnget_BitRate,
1232 IBasicVideo_fnget_BitErrorRate,
1233 IBasicVideo_fnget_VideoWidth,
1234 IBasicVideo_fnget_VideoHeight,
1235 IBasicVideo_fnput_SourceLeft,
1236 IBasicVideo_fnget_SourceLeft,
1237 IBasicVideo_fnput_SourceWidth,
1238 IBasicVideo_fnget_SourceWidth,
1239 IBasicVideo_fnput_SourceTop,
1240 IBasicVideo_fnget_SourceTop,
1241 IBasicVideo_fnput_SourceHeight,
1242 IBasicVideo_fnget_SourceHeight,
1243 IBasicVideo_fnput_DestinationLeft,
1244 IBasicVideo_fnget_DestinationLeft,
1245 IBasicVideo_fnput_DestinationWidth,
1246 IBasicVideo_fnget_DestinationWidth,
1247 IBasicVideo_fnput_DestinationTop,
1248 IBasicVideo_fnget_DestinationTop,
1249 IBasicVideo_fnput_DestinationHeight,
1250 IBasicVideo_fnget_DestinationHeight,
1251 IBasicVideo_fnSetSourcePosition,
1252 IBasicVideo_fnGetSourcePosition,
1253 IBasicVideo_fnSetDefaultSourcePosition,
1254 IBasicVideo_fnSetDestinationPosition,
1255 IBasicVideo_fnGetDestinationPosition,
1256 IBasicVideo_fnSetDefaultDestinationPosition,
1257 IBasicVideo_fnGetVideoSize,
1258 IBasicVideo_fnGetVideoPaletteEntries,
1259 IBasicVideo_fnGetCurrentImage,
1260 IBasicVideo_fnIsUsingDefaultSource,
1261 IBasicVideo_fnIsUsingDefaultDestination,
1265 HRESULT CVideoRendererImpl_InitIBasicVideo( CVideoRendererImpl* This )
1267 TRACE("(%p)\n",This);
1268 ICOM_VTBL(&This->basvid) = &ibasicvideo;
1273 void CVideoRendererImpl_UninitIBasicVideo( CVideoRendererImpl* This )
1275 TRACE("(%p)\n",This);
1278 /***************************************************************************
1280 * CVideoRendererImpl::IVideoWindow
1285 static HRESULT WINAPI
1286 IVideoWindow_fnQueryInterface(IVideoWindow* iface,REFIID riid,void** ppobj)
1288 CVideoRendererImpl_THIS(iface,vidwin);
1290 TRACE("(%p)->()\n",This);
1292 return IUnknown_QueryInterface(This->unk.punkControl,riid,ppobj);
1296 IVideoWindow_fnAddRef(IVideoWindow* iface)
1298 CVideoRendererImpl_THIS(iface,vidwin);
1300 TRACE("(%p)->()\n",This);
1302 return IUnknown_AddRef(This->unk.punkControl);
1306 IVideoWindow_fnRelease(IVideoWindow* iface)
1308 CVideoRendererImpl_THIS(iface,vidwin);
1310 TRACE("(%p)->()\n",This);
1312 return IUnknown_Release(This->unk.punkControl);
1315 static HRESULT WINAPI
1316 IVideoWindow_fnGetTypeInfoCount(IVideoWindow* iface,UINT* pcTypeInfo)
1318 CVideoRendererImpl_THIS(iface,vidwin);
1320 FIXME("(%p)->()\n",This);
1325 static HRESULT WINAPI
1326 IVideoWindow_fnGetTypeInfo(IVideoWindow* iface,UINT iTypeInfo, LCID lcid, ITypeInfo** ppobj)
1328 CVideoRendererImpl_THIS(iface,vidwin);
1330 FIXME("(%p)->()\n",This);
1335 static HRESULT WINAPI
1336 IVideoWindow_fnGetIDsOfNames(IVideoWindow* iface,REFIID riid, LPOLESTR* ppwszName, UINT cNames, LCID lcid, DISPID* pDispId)
1338 CVideoRendererImpl_THIS(iface,vidwin);
1340 FIXME("(%p)->()\n",This);
1345 static HRESULT WINAPI
1346 IVideoWindow_fnInvoke(IVideoWindow* iface,DISPID DispId, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarRes, EXCEPINFO* pExcepInfo, UINT* puArgErr)
1348 CVideoRendererImpl_THIS(iface,vidwin);
1350 FIXME("(%p)->()\n",This);
1357 static HRESULT WINAPI
1358 IVideoWindow_fnput_Caption(IVideoWindow* iface,BSTR strCaption)
1360 CVideoRendererImpl_THIS(iface,vidwin);
1361 HRESULT hr = E_NOTIMPL;
1363 FIXME("(%p)->()\n",This);
1365 EnterCriticalSection ( &This->basefilter.csFilter );
1366 if ( This->m_hwnd == (HWND)NULL )
1368 hr = VFW_E_NOT_CONNECTED;
1374 LeaveCriticalSection ( &This->basefilter.csFilter );
1379 static HRESULT WINAPI
1380 IVideoWindow_fnget_Caption(IVideoWindow* iface,BSTR* pstrCaption)
1382 CVideoRendererImpl_THIS(iface,vidwin);
1383 HRESULT hr = E_NOTIMPL;
1385 FIXME("(%p)->()\n",This);
1387 EnterCriticalSection ( &This->basefilter.csFilter );
1388 if ( This->m_hwnd == (HWND)NULL )
1390 hr = VFW_E_NOT_CONNECTED;
1396 LeaveCriticalSection ( &This->basefilter.csFilter );
1401 static HRESULT WINAPI
1402 IVideoWindow_fnput_WindowStyle(IVideoWindow* iface,long lStyle)
1404 CVideoRendererImpl_THIS(iface,vidwin);
1405 HRESULT hr = E_NOTIMPL;
1407 FIXME("(%p)->()\n",This);
1409 EnterCriticalSection ( &This->basefilter.csFilter );
1410 if ( This->m_hwnd == (HWND)NULL )
1412 hr = VFW_E_NOT_CONNECTED;
1417 if ( SetWindowLongA( This->m_hwnd, GWL_STYLE, (DWORD)lStyle ) == 0 &&
1418 GetLastError() != 0 )
1426 LeaveCriticalSection ( &This->basefilter.csFilter );
1431 static HRESULT WINAPI
1432 IVideoWindow_fnget_WindowStyle(IVideoWindow* iface,long* plStyle)
1434 CVideoRendererImpl_THIS(iface,vidwin);
1435 HRESULT hr = E_NOTIMPL;
1437 FIXME("(%p)->()\n",This);
1439 EnterCriticalSection ( &This->basefilter.csFilter );
1440 if ( This->m_hwnd == (HWND)NULL )
1442 hr = VFW_E_NOT_CONNECTED;
1446 *plStyle = (LONG)GetWindowLongA( This->m_hwnd, GWL_STYLE );
1449 LeaveCriticalSection ( &This->basefilter.csFilter );
1454 static HRESULT WINAPI
1455 IVideoWindow_fnput_WindowStyleEx(IVideoWindow* iface,long lExStyle)
1457 CVideoRendererImpl_THIS(iface,vidwin);
1458 HRESULT hr = E_NOTIMPL;
1460 FIXME("(%p)->()\n",This);
1462 EnterCriticalSection ( &This->basefilter.csFilter );
1463 if ( This->m_hwnd == (HWND)NULL )
1465 hr = VFW_E_NOT_CONNECTED;
1470 if ( SetWindowLongA( This->m_hwnd, GWL_EXSTYLE, (DWORD)lExStyle ) == 0 &&
1471 GetLastError() != 0 )
1479 LeaveCriticalSection ( &This->basefilter.csFilter );
1484 static HRESULT WINAPI
1485 IVideoWindow_fnget_WindowStyleEx(IVideoWindow* iface,long* plExStyle)
1487 CVideoRendererImpl_THIS(iface,vidwin);
1488 HRESULT hr = E_NOTIMPL;
1490 FIXME("(%p)->()\n",This);
1492 if ( plExStyle == NULL )
1495 EnterCriticalSection ( &This->basefilter.csFilter );
1496 if ( This->m_hwnd == (HWND)NULL )
1498 hr = VFW_E_NOT_CONNECTED;
1502 *plExStyle = (LONG)GetWindowLongA( This->m_hwnd, GWL_EXSTYLE );
1505 LeaveCriticalSection ( &This->basefilter.csFilter );
1510 static HRESULT WINAPI
1511 IVideoWindow_fnput_AutoShow(IVideoWindow* iface,long lAutoShow)
1513 CVideoRendererImpl_THIS(iface,vidwin);
1514 HRESULT hr = E_NOTIMPL;
1516 FIXME("(%p)->()\n",This);
1518 EnterCriticalSection ( &This->basefilter.csFilter );
1519 if ( This->m_hwnd == (HWND)NULL )
1521 hr = VFW_E_NOT_CONNECTED;
1527 LeaveCriticalSection ( &This->basefilter.csFilter );
1532 static HRESULT WINAPI
1533 IVideoWindow_fnget_AutoShow(IVideoWindow* iface,long* plAutoShow)
1535 CVideoRendererImpl_THIS(iface,vidwin);
1536 HRESULT hr = E_NOTIMPL;
1538 FIXME("(%p)->()\n",This);
1540 EnterCriticalSection ( &This->basefilter.csFilter );
1541 if ( This->m_hwnd == (HWND)NULL )
1543 hr = VFW_E_NOT_CONNECTED;
1549 LeaveCriticalSection ( &This->basefilter.csFilter );
1554 static HRESULT WINAPI
1555 IVideoWindow_fnput_WindowState(IVideoWindow* iface,long lState)
1557 CVideoRendererImpl_THIS(iface,vidwin);
1558 HRESULT hr = E_NOTIMPL;
1560 FIXME("(%p)->()\n",This);
1562 EnterCriticalSection ( &This->basefilter.csFilter );
1563 if ( This->m_hwnd == (HWND)NULL )
1565 hr = VFW_E_NOT_CONNECTED;
1571 LeaveCriticalSection ( &This->basefilter.csFilter );
1576 static HRESULT WINAPI
1577 IVideoWindow_fnget_WindowState(IVideoWindow* iface,long* plState)
1579 CVideoRendererImpl_THIS(iface,vidwin);
1580 HRESULT hr = E_NOTIMPL;
1582 FIXME("(%p)->()\n",This);
1584 EnterCriticalSection ( &This->basefilter.csFilter );
1585 if ( This->m_hwnd == (HWND)NULL )
1587 hr = VFW_E_NOT_CONNECTED;
1593 LeaveCriticalSection ( &This->basefilter.csFilter );
1598 static HRESULT WINAPI
1599 IVideoWindow_fnput_BackgroundPalette(IVideoWindow* iface,long lBackPal)
1601 CVideoRendererImpl_THIS(iface,vidwin);
1602 HRESULT hr = E_NOTIMPL;
1604 FIXME("(%p)->()\n",This);
1606 EnterCriticalSection ( &This->basefilter.csFilter );
1607 if ( This->m_hwnd == (HWND)NULL )
1609 hr = VFW_E_NOT_CONNECTED;
1615 LeaveCriticalSection ( &This->basefilter.csFilter );
1620 static HRESULT WINAPI
1621 IVideoWindow_fnget_BackgroundPalette(IVideoWindow* iface,long* plBackPal)
1623 CVideoRendererImpl_THIS(iface,vidwin);
1624 HRESULT hr = E_NOTIMPL;
1626 FIXME("(%p)->()\n",This);
1628 EnterCriticalSection ( &This->basefilter.csFilter );
1629 if ( This->m_hwnd == (HWND)NULL )
1631 hr = VFW_E_NOT_CONNECTED;
1637 LeaveCriticalSection ( &This->basefilter.csFilter );
1642 static HRESULT WINAPI
1643 IVideoWindow_fnput_Visible(IVideoWindow* iface,long lVisible)
1645 CVideoRendererImpl_THIS(iface,vidwin);
1646 HRESULT hr = E_NOTIMPL;
1648 FIXME("(%p)->()\n",This);
1650 EnterCriticalSection ( &This->basefilter.csFilter );
1651 if ( This->m_hwnd == (HWND)NULL )
1653 hr = VFW_E_NOT_CONNECTED;
1659 LeaveCriticalSection ( &This->basefilter.csFilter );
1664 static HRESULT WINAPI
1665 IVideoWindow_fnget_Visible(IVideoWindow* iface,long* plVisible)
1667 CVideoRendererImpl_THIS(iface,vidwin);
1668 HRESULT hr = E_NOTIMPL;
1670 FIXME("(%p)->()\n",This);
1672 EnterCriticalSection ( &This->basefilter.csFilter );
1673 if ( This->m_hwnd == (HWND)NULL )
1675 hr = VFW_E_NOT_CONNECTED;
1681 LeaveCriticalSection ( &This->basefilter.csFilter );
1686 static HRESULT WINAPI
1687 IVideoWindow_fnput_Left(IVideoWindow* iface,long lLeft)
1689 CVideoRendererImpl_THIS(iface,vidwin);
1690 HRESULT hr = E_NOTIMPL;
1693 FIXME("(%p)->()\n",This);
1695 EnterCriticalSection ( &This->basefilter.csFilter );
1696 if ( This->m_hwnd == (HWND)NULL )
1698 hr = VFW_E_NOT_CONNECTED;
1702 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1707 if ( ! MoveWindow( This->m_hwnd, lLeft, rc.top, rc.right-rc.left, rc.bottom-rc.top, TRUE ) )
1714 LeaveCriticalSection ( &This->basefilter.csFilter );
1719 static HRESULT WINAPI
1720 IVideoWindow_fnget_Left(IVideoWindow* iface,long* plLeft)
1722 CVideoRendererImpl_THIS(iface,vidwin);
1723 HRESULT hr = E_NOTIMPL;
1726 FIXME("(%p)->()\n",This);
1728 if ( plLeft == NULL )
1731 EnterCriticalSection ( &This->basefilter.csFilter );
1732 if ( This->m_hwnd == (HWND)NULL )
1734 hr = VFW_E_NOT_CONNECTED;
1738 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1746 LeaveCriticalSection ( &This->basefilter.csFilter );
1751 static HRESULT WINAPI
1752 IVideoWindow_fnput_Width(IVideoWindow* iface,long lWidth)
1754 CVideoRendererImpl_THIS(iface,vidwin);
1755 HRESULT hr = E_NOTIMPL;
1758 FIXME("(%p)->()\n",This);
1761 return E_INVALIDARG;
1763 EnterCriticalSection ( &This->basefilter.csFilter );
1764 if ( This->m_hwnd == (HWND)NULL )
1766 hr = VFW_E_NOT_CONNECTED;
1770 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1775 if ( ! MoveWindow( This->m_hwnd, rc.left, rc.top, lWidth, rc.bottom-rc.top, TRUE ) )
1782 LeaveCriticalSection ( &This->basefilter.csFilter );
1787 static HRESULT WINAPI
1788 IVideoWindow_fnget_Width(IVideoWindow* iface,long* plWidth)
1790 CVideoRendererImpl_THIS(iface,vidwin);
1791 HRESULT hr = E_NOTIMPL;
1794 FIXME("(%p)->()\n",This);
1796 if ( plWidth == NULL )
1799 EnterCriticalSection ( &This->basefilter.csFilter );
1800 if ( This->m_hwnd == (HWND)NULL )
1802 hr = VFW_E_NOT_CONNECTED;
1806 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1811 *plWidth = rc.right-rc.left;
1814 LeaveCriticalSection ( &This->basefilter.csFilter );
1819 static HRESULT WINAPI
1820 IVideoWindow_fnput_Top(IVideoWindow* iface,long lTop)
1822 CVideoRendererImpl_THIS(iface,vidwin);
1823 HRESULT hr = E_NOTIMPL;
1826 FIXME("(%p)->()\n",This);
1828 EnterCriticalSection ( &This->basefilter.csFilter );
1829 if ( This->m_hwnd == (HWND)NULL )
1831 hr = VFW_E_NOT_CONNECTED;
1835 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1840 if ( ! MoveWindow( This->m_hwnd, rc.left, lTop, rc.right-rc.left, rc.bottom-rc.top, TRUE ) )
1847 LeaveCriticalSection ( &This->basefilter.csFilter );
1852 static HRESULT WINAPI
1853 IVideoWindow_fnget_Top(IVideoWindow* iface,long* plTop)
1855 CVideoRendererImpl_THIS(iface,vidwin);
1856 HRESULT hr = E_NOTIMPL;
1859 FIXME("(%p)->()\n",This);
1861 if ( plTop == NULL )
1864 EnterCriticalSection ( &This->basefilter.csFilter );
1865 if ( This->m_hwnd == (HWND)NULL )
1867 hr = VFW_E_NOT_CONNECTED;
1871 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1879 LeaveCriticalSection ( &This->basefilter.csFilter );
1884 static HRESULT WINAPI
1885 IVideoWindow_fnput_Height(IVideoWindow* iface,long lHeight)
1887 CVideoRendererImpl_THIS(iface,vidwin);
1888 HRESULT hr = E_NOTIMPL;
1891 FIXME("(%p)->()\n",This);
1894 return E_INVALIDARG;
1896 EnterCriticalSection ( &This->basefilter.csFilter );
1897 if ( This->m_hwnd == (HWND)NULL )
1899 hr = VFW_E_NOT_CONNECTED;
1903 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1908 if ( ! MoveWindow( This->m_hwnd, rc.left, rc.top, rc.right-rc.left, lHeight, TRUE ) )
1915 LeaveCriticalSection ( &This->basefilter.csFilter );
1920 static HRESULT WINAPI
1921 IVideoWindow_fnget_Height(IVideoWindow* iface,long* plHeight)
1923 CVideoRendererImpl_THIS(iface,vidwin);
1924 HRESULT hr = E_NOTIMPL;
1927 FIXME("(%p)->()\n",This);
1929 if ( plHeight == NULL )
1932 EnterCriticalSection ( &This->basefilter.csFilter );
1933 if ( This->m_hwnd == (HWND)NULL )
1935 hr = VFW_E_NOT_CONNECTED;
1939 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1944 *plHeight = rc.bottom-rc.top;
1947 LeaveCriticalSection ( &This->basefilter.csFilter );
1952 static HRESULT WINAPI
1953 IVideoWindow_fnput_Owner(IVideoWindow* iface,OAHWND hwnd)
1955 CVideoRendererImpl_THIS(iface,vidwin);
1956 HRESULT hr = E_NOTIMPL;
1960 FIXME("(%p)->()\n",This);
1962 EnterCriticalSection ( &This->basefilter.csFilter );
1963 if ( This->m_hwnd == (HWND)NULL )
1965 hr = VFW_E_NOT_CONNECTED;
1968 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
1974 dwStyle = (DWORD)GetWindowLongA( This->m_hwnd, GWL_STYLE );
1975 if ( hwnd == (HWND)NULL )
1976 SetWindowLongA( This->m_hwnd, GWL_STYLE, dwStyle & (~WS_CHILD) );
1977 SetParent( This->m_hwnd, (HWND)hwnd );
1978 if ( (HWND)hwnd != (HWND)NULL )
1980 SetWindowLongA( This->m_hwnd, GWL_STYLE, dwStyle | WS_CHILD );
1981 MoveWindow( This->m_hwnd, 0, 0, rc.right-rc.left, rc.bottom-rc.top, TRUE );
1986 LeaveCriticalSection ( &This->basefilter.csFilter );
1991 static HRESULT WINAPI
1992 IVideoWindow_fnget_Owner(IVideoWindow* iface,OAHWND* phwnd)
1994 CVideoRendererImpl_THIS(iface,vidwin);
1995 HRESULT hr = E_NOTIMPL;
1997 FIXME("(%p)->()\n",This);
1999 if ( phwnd == NULL )
2002 EnterCriticalSection ( &This->basefilter.csFilter );
2003 if ( This->m_hwnd == (HWND)NULL )
2005 hr = VFW_E_NOT_CONNECTED;
2009 *phwnd = (OAHWND)GetParent( This->m_hwnd );
2012 LeaveCriticalSection ( &This->basefilter.csFilter );
2017 static HRESULT WINAPI
2018 IVideoWindow_fnput_MessageDrain(IVideoWindow* iface,OAHWND hwnd)
2020 CVideoRendererImpl_THIS(iface,vidwin);
2021 HRESULT hr = E_NOTIMPL;
2023 FIXME("(%p)->()\n",This);
2025 EnterCriticalSection ( &This->basefilter.csFilter );
2026 if ( This->m_hwnd == (HWND)NULL )
2028 hr = VFW_E_NOT_CONNECTED;
2034 LeaveCriticalSection ( &This->basefilter.csFilter );
2039 static HRESULT WINAPI
2040 IVideoWindow_fnget_MessageDrain(IVideoWindow* iface,OAHWND* phwnd)
2042 CVideoRendererImpl_THIS(iface,vidwin);
2043 HRESULT hr = E_NOTIMPL;
2045 FIXME("(%p)->()\n",This);
2047 EnterCriticalSection ( &This->basefilter.csFilter );
2048 if ( This->m_hwnd == (HWND)NULL )
2050 hr = VFW_E_NOT_CONNECTED;
2056 LeaveCriticalSection ( &This->basefilter.csFilter );
2061 static HRESULT WINAPI
2062 IVideoWindow_fnget_BorderColor(IVideoWindow* iface,long* plColor)
2064 CVideoRendererImpl_THIS(iface,vidwin);
2065 HRESULT hr = E_NOTIMPL;
2067 FIXME("(%p)->()\n",This);
2069 EnterCriticalSection ( &This->basefilter.csFilter );
2070 if ( This->m_hwnd == (HWND)NULL )
2072 hr = VFW_E_NOT_CONNECTED;
2078 LeaveCriticalSection ( &This->basefilter.csFilter );
2083 static HRESULT WINAPI
2084 IVideoWindow_fnput_BorderColor(IVideoWindow* iface,long lColor)
2086 CVideoRendererImpl_THIS(iface,vidwin);
2087 HRESULT hr = E_NOTIMPL;
2089 FIXME("(%p)->()\n",This);
2091 EnterCriticalSection ( &This->basefilter.csFilter );
2092 if ( This->m_hwnd == (HWND)NULL )
2094 hr = VFW_E_NOT_CONNECTED;
2100 LeaveCriticalSection ( &This->basefilter.csFilter );
2105 static HRESULT WINAPI
2106 IVideoWindow_fnget_FullScreenMode(IVideoWindow* iface,long* plMode)
2108 CVideoRendererImpl_THIS(iface,vidwin);
2109 HRESULT hr = E_NOTIMPL;
2111 FIXME("(%p)->()\n",This);
2113 EnterCriticalSection ( &This->basefilter.csFilter );
2114 if ( This->m_hwnd == (HWND)NULL )
2116 hr = VFW_E_NOT_CONNECTED;
2122 LeaveCriticalSection ( &This->basefilter.csFilter );
2127 static HRESULT WINAPI
2128 IVideoWindow_fnput_FullScreenMode(IVideoWindow* iface,long lMode)
2130 CVideoRendererImpl_THIS(iface,vidwin);
2131 HRESULT hr = E_NOTIMPL;
2133 FIXME("(%p)->()\n",This);
2135 EnterCriticalSection ( &This->basefilter.csFilter );
2136 if ( This->m_hwnd == (HWND)NULL )
2138 hr = VFW_E_NOT_CONNECTED;
2144 LeaveCriticalSection ( &This->basefilter.csFilter );
2149 static HRESULT WINAPI
2150 IVideoWindow_fnSetWindowForeground(IVideoWindow* iface,long lFocus)
2152 CVideoRendererImpl_THIS(iface,vidwin);
2153 HRESULT hr = E_NOTIMPL;
2155 FIXME("(%p)->()\n",This);
2157 EnterCriticalSection ( &This->basefilter.csFilter );
2158 if ( This->m_hwnd == (HWND)NULL )
2160 hr = VFW_E_NOT_CONNECTED;
2166 LeaveCriticalSection ( &This->basefilter.csFilter );
2171 static HRESULT WINAPI
2172 IVideoWindow_fnNotifyOwnerMessage(IVideoWindow* iface,OAHWND hwnd,long message,LONG_PTR wParam,LONG_PTR lParam)
2174 CVideoRendererImpl_THIS(iface,vidwin);
2175 HRESULT hr = E_NOTIMPL;
2177 FIXME("(%p)->()\n",This);
2179 EnterCriticalSection ( &This->basefilter.csFilter );
2180 if ( This->m_hwnd == (HWND)NULL )
2182 hr = VFW_E_NOT_CONNECTED;
2188 LeaveCriticalSection ( &This->basefilter.csFilter );
2193 static HRESULT WINAPI
2194 IVideoWindow_fnSetWindowPosition(IVideoWindow* iface,long lLeft,long lTop,long lWidth,long lHeight)
2196 CVideoRendererImpl_THIS(iface,vidwin);
2197 HRESULT hr = E_NOTIMPL;
2199 FIXME("(%p)->()\n",This);
2201 EnterCriticalSection ( &This->basefilter.csFilter );
2202 if ( This->m_hwnd == (HWND)NULL )
2204 hr = VFW_E_NOT_CONNECTED;
2208 if ( ! MoveWindow( This->m_hwnd, lLeft, lTop, lWidth, lHeight, TRUE ) )
2215 LeaveCriticalSection ( &This->basefilter.csFilter );
2220 static HRESULT WINAPI
2221 IVideoWindow_fnGetWindowPosition(IVideoWindow* iface,long* plLeft,long* plTop,long* plWidth,long* plHeight)
2223 CVideoRendererImpl_THIS(iface,vidwin);
2224 HRESULT hr = E_NOTIMPL;
2227 FIXME("(%p)->()\n",This);
2229 if ( plLeft == NULL || plTop == NULL ||
2230 plWidth == NULL || plHeight == NULL )
2233 EnterCriticalSection ( &This->basefilter.csFilter );
2234 if ( This->m_hwnd == (HWND)NULL )
2236 hr = VFW_E_NOT_CONNECTED;
2241 if ( ! GetWindowRect( This->m_hwnd, &rc ) )
2249 *plWidth = rc.right-rc.left;
2250 *plHeight = rc.bottom-rc.top;
2254 LeaveCriticalSection ( &This->basefilter.csFilter );
2259 static HRESULT WINAPI
2260 IVideoWindow_fnGetMinIdealImageSize(IVideoWindow* iface,long* plWidth,long* plHeight)
2262 CVideoRendererImpl_THIS(iface,vidwin);
2263 HRESULT hr = E_NOTIMPL;
2265 FIXME("(%p)->()\n",This);
2267 EnterCriticalSection ( &This->basefilter.csFilter );
2268 if ( This->m_hwnd == (HWND)NULL )
2270 hr = VFW_E_NOT_CONNECTED;
2276 LeaveCriticalSection ( &This->basefilter.csFilter );
2281 static HRESULT WINAPI
2282 IVideoWindow_fnGetMaxIdealImageSize(IVideoWindow* iface,long* plWidth,long* plHeight)
2284 CVideoRendererImpl_THIS(iface,vidwin);
2285 HRESULT hr = E_NOTIMPL;
2287 FIXME("(%p)->()\n",This);
2289 EnterCriticalSection ( &This->basefilter.csFilter );
2290 if ( This->m_hwnd == (HWND)NULL )
2292 hr = VFW_E_NOT_CONNECTED;
2298 LeaveCriticalSection ( &This->basefilter.csFilter );
2303 static HRESULT WINAPI
2304 IVideoWindow_fnGetRestorePosition(IVideoWindow* iface,long* plLeft,long* plTop,long* plWidth,long* plHeight)
2306 CVideoRendererImpl_THIS(iface,vidwin);
2307 HRESULT hr = E_NOTIMPL;
2309 FIXME("(%p)->()\n",This);
2311 EnterCriticalSection ( &This->basefilter.csFilter );
2312 if ( This->m_hwnd == (HWND)NULL )
2314 hr = VFW_E_NOT_CONNECTED;
2320 LeaveCriticalSection ( &This->basefilter.csFilter );
2325 static HRESULT WINAPI
2326 IVideoWindow_fnHideCursor(IVideoWindow* iface,long lHide)
2328 CVideoRendererImpl_THIS(iface,vidwin);
2329 HRESULT hr = E_NOTIMPL;
2331 FIXME("(%p)->()\n",This);
2333 EnterCriticalSection ( &This->basefilter.csFilter );
2334 if ( This->m_hwnd == (HWND)NULL )
2336 hr = VFW_E_NOT_CONNECTED;
2342 LeaveCriticalSection ( &This->basefilter.csFilter );
2347 static HRESULT WINAPI
2348 IVideoWindow_fnIsCursorHidden(IVideoWindow* iface,long* plHide)
2350 CVideoRendererImpl_THIS(iface,vidwin);
2351 HRESULT hr = E_NOTIMPL;
2353 FIXME("(%p)->()\n",This);
2355 EnterCriticalSection ( &This->basefilter.csFilter );
2356 if ( This->m_hwnd == (HWND)NULL )
2358 hr = VFW_E_NOT_CONNECTED;
2364 LeaveCriticalSection ( &This->basefilter.csFilter );
2372 static ICOM_VTABLE(IVideoWindow) ivideowindow =
2374 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
2375 /* IUnknown fields */
2376 IVideoWindow_fnQueryInterface,
2377 IVideoWindow_fnAddRef,
2378 IVideoWindow_fnRelease,
2379 /* IDispatch fields */
2380 IVideoWindow_fnGetTypeInfoCount,
2381 IVideoWindow_fnGetTypeInfo,
2382 IVideoWindow_fnGetIDsOfNames,
2383 IVideoWindow_fnInvoke,
2384 /* IVideoWindow fields */
2385 IVideoWindow_fnput_Caption,
2386 IVideoWindow_fnget_Caption,
2387 IVideoWindow_fnput_WindowStyle,
2388 IVideoWindow_fnget_WindowStyle,
2389 IVideoWindow_fnput_WindowStyleEx,
2390 IVideoWindow_fnget_WindowStyleEx,
2391 IVideoWindow_fnput_AutoShow,
2392 IVideoWindow_fnget_AutoShow,
2393 IVideoWindow_fnput_WindowState,
2394 IVideoWindow_fnget_WindowState,
2395 IVideoWindow_fnput_BackgroundPalette,
2396 IVideoWindow_fnget_BackgroundPalette,
2397 IVideoWindow_fnput_Visible,
2398 IVideoWindow_fnget_Visible,
2399 IVideoWindow_fnput_Left,
2400 IVideoWindow_fnget_Left,
2401 IVideoWindow_fnput_Width,
2402 IVideoWindow_fnget_Width,
2403 IVideoWindow_fnput_Top,
2404 IVideoWindow_fnget_Top,
2405 IVideoWindow_fnput_Height,
2406 IVideoWindow_fnget_Height,
2407 IVideoWindow_fnput_Owner,
2408 IVideoWindow_fnget_Owner,
2409 IVideoWindow_fnput_MessageDrain,
2410 IVideoWindow_fnget_MessageDrain,
2411 IVideoWindow_fnget_BorderColor,
2412 IVideoWindow_fnput_BorderColor,
2413 IVideoWindow_fnget_FullScreenMode,
2414 IVideoWindow_fnput_FullScreenMode,
2415 IVideoWindow_fnSetWindowForeground,
2416 IVideoWindow_fnNotifyOwnerMessage,
2417 IVideoWindow_fnSetWindowPosition,
2418 IVideoWindow_fnGetWindowPosition,
2419 IVideoWindow_fnGetMinIdealImageSize,
2420 IVideoWindow_fnGetMaxIdealImageSize,
2421 IVideoWindow_fnGetRestorePosition,
2422 IVideoWindow_fnHideCursor,
2423 IVideoWindow_fnIsCursorHidden,
2428 HRESULT CVideoRendererImpl_InitIVideoWindow( CVideoRendererImpl* This )
2430 TRACE("(%p)\n",This);
2431 ICOM_VTBL(&This->vidwin) = &ivideowindow;
2436 void CVideoRendererImpl_UninitIVideoWindow( CVideoRendererImpl* This )
2438 TRACE("(%p)\n",This);