2 * Video Renderer (Fullscreen and Windowed using Direct Draw)
4 * Copyright 2004 Christian Costa
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #define NONAMELESSSTRUCT
24 #define NONAMELESSUNION
25 #include "quartz_private.h"
26 #include "control_private.h"
41 #include "wine/unicode.h"
42 #include "wine/debug.h"
44 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
46 static BOOL wnd_class_registered = FALSE;
48 static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0};
50 static const IBaseFilterVtbl VideoRenderer_Vtbl;
51 static const IUnknownVtbl IInner_VTable;
52 static const IBasicVideoVtbl IBasicVideo_VTable;
53 static const IVideoWindowVtbl IVideoWindow_VTable;
54 static const IPinVtbl VideoRenderer_InputPin_Vtbl;
55 static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl;
57 typedef struct VideoRendererImpl
60 const IBasicVideoVtbl * IBasicVideo_vtbl;
61 const IVideoWindowVtbl * IVideoWindow_vtbl;
62 const IUnknownVtbl * IInner_vtbl;
63 const IAMFilterMiscFlagsVtbl *IAMFilterMiscFlags_vtbl;
64 IUnknown *seekthru_unk;
66 BaseInputPin *pInputPin;
86 REFERENCE_TIME rtLastStop;
89 /* During pause we can hold a single sample, for use in GetCurrentImage */
90 IMediaSample *sample_held;
93 static LRESULT CALLBACK VideoWndProcA(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
95 VideoRendererImpl* pVideoRenderer = (VideoRendererImpl*)GetWindowLongPtrW(hwnd, 0);
96 LPRECT lprect = (LPRECT)lParam;
98 if (pVideoRenderer && pVideoRenderer->hWndMsgDrain)
104 case WM_LBUTTONDBLCLK:
107 case WM_MBUTTONDBLCLK:
110 case WM_MOUSEACTIVATE:
112 case WM_NCLBUTTONDBLCLK:
113 case WM_NCLBUTTONDOWN:
115 case WM_NCMBUTTONDBLCLK:
116 case WM_NCMBUTTONDOWN:
119 case WM_NCRBUTTONDBLCLK:
120 case WM_NCRBUTTONDOWN:
122 case WM_RBUTTONDBLCLK:
125 PostMessageA(pVideoRenderer->hWndMsgDrain, uMsg, wParam, lParam);
135 /* TRACE("WM_SIZING %d %d %d %d\n", lprect->left, lprect->top, lprect->right, lprect->bottom); */
136 SetWindowPos(hwnd, NULL, lprect->left, lprect->top, lprect->right - lprect->left, lprect->bottom - lprect->top, SWP_NOZORDER);
137 GetClientRect(hwnd, &pVideoRenderer->DestRect);
138 TRACE("WM_SIZING: DestRect=(%d,%d),(%d,%d)\n",
139 pVideoRenderer->DestRect.left,
140 pVideoRenderer->DestRect.top,
141 pVideoRenderer->DestRect.right - pVideoRenderer->DestRect.left,
142 pVideoRenderer->DestRect.bottom - pVideoRenderer->DestRect.top);
145 TRACE("WM_SIZE %d %d\n", LOWORD(lParam), HIWORD(lParam));
146 GetClientRect(hwnd, &pVideoRenderer->DestRect);
147 TRACE("WM_SIZING: DestRect=(%d,%d),(%d,%d)\n",
148 pVideoRenderer->DestRect.left,
149 pVideoRenderer->DestRect.top,
150 pVideoRenderer->DestRect.right - pVideoRenderer->DestRect.left,
151 pVideoRenderer->DestRect.bottom - pVideoRenderer->DestRect.top);
154 return DefWindowProcA(hwnd, uMsg, wParam, lParam);
159 static BOOL CreateRenderingWindow(VideoRendererImpl* This)
163 TRACE("(%p)->()\n", This);
166 winclass.lpfnWndProc = VideoWndProcA;
167 winclass.cbClsExtra = 0;
168 winclass.cbWndExtra = sizeof(VideoRendererImpl*);
169 winclass.hInstance = NULL;
170 winclass.hIcon = NULL;
171 winclass.hCursor = NULL;
172 winclass.hbrBackground = GetStockObject(BLACK_BRUSH);
173 winclass.lpszMenuName = NULL;
174 winclass.lpszClassName = "Wine ActiveMovie Class";
176 if (!wnd_class_registered)
178 if (!RegisterClassA(&winclass))
180 ERR("Unable to register window %u\n", GetLastError());
183 wnd_class_registered = TRUE;
186 This->hWnd = CreateWindowExA(0, "Wine ActiveMovie Class", "Wine ActiveMovie Window", WS_SIZEBOX,
187 CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL,
192 ERR("Unable to create window\n");
196 SetWindowLongPtrW(This->hWnd, 0, (LONG_PTR)This);
201 static DWORD WINAPI MessageLoop(LPVOID lpParameter)
203 VideoRendererImpl* This = lpParameter;
207 TRACE("Starting message loop\n");
209 if (!CreateRenderingWindow(This))
211 This->ThreadResult = FALSE;
212 SetEvent(This->hEvent);
216 This->ThreadResult = TRUE;
217 SetEvent(This->hEvent);
219 while ((fGotMessage = GetMessageA(&msg, NULL, 0, 0)) != 0 && fGotMessage != -1)
221 TranslateMessage(&msg);
222 DispatchMessageA(&msg);
225 TRACE("End of message loop\n");
230 static BOOL CreateRenderingSubsystem(VideoRendererImpl* This)
232 This->hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
236 This->hThread = CreateThread(NULL, 0, MessageLoop, This, 0, &This->ThreadID);
239 CloseHandle(This->hEvent);
243 WaitForSingleObject(This->hEvent, INFINITE);
245 if (!This->ThreadResult)
247 CloseHandle(This->hEvent);
248 CloseHandle(This->hThread);
255 static DWORD VideoRenderer_SendSampleData(VideoRendererImpl* This, LPBYTE data, DWORD size)
261 BITMAPINFOHEADER *bmiHeader;
263 TRACE("(%p)->(%p, %d)\n", This, data, size);
265 sdesc.dwSize = sizeof(sdesc);
266 hr = IPin_ConnectionMediaType((IPin *)This->pInputPin, &amt);
268 ERR("Unable to retrieve media type\n");
272 if (IsEqualIID(&amt.formattype, &FORMAT_VideoInfo))
274 bmiHeader = &((VIDEOINFOHEADER *)amt.pbFormat)->bmiHeader;
276 else if (IsEqualIID(&amt.formattype, &FORMAT_VideoInfo2))
278 bmiHeader = &((VIDEOINFOHEADER2 *)amt.pbFormat)->bmiHeader;
282 FIXME("Unknown type %s\n", debugstr_guid(&amt.subtype));
283 return VFW_E_RUNTIME_ERROR;
286 TRACE("biSize = %d\n", bmiHeader->biSize);
287 TRACE("biWidth = %d\n", bmiHeader->biWidth);
288 TRACE("biHeight = %d\n", bmiHeader->biHeight);
289 TRACE("biPlanes = %d\n", bmiHeader->biPlanes);
290 TRACE("biBitCount = %d\n", bmiHeader->biBitCount);
291 TRACE("biCompression = %s\n", debugstr_an((LPSTR)&(bmiHeader->biCompression), 4));
292 TRACE("biSizeImage = %d\n", bmiHeader->biSizeImage);
296 if (!This->WindowPos.right || !This->WindowPos.top)
298 DWORD style = GetWindowLongW(This->hWnd, GWL_STYLE);
299 DWORD style_ex = GetWindowLongW(This->hWnd, GWL_EXSTYLE);
301 if (!This->WindowPos.right)
303 This->WindowPos.left = This->SourceRect.left;
304 This->WindowPos.right = This->SourceRect.right;
306 if (!This->WindowPos.bottom)
308 This->WindowPos.top = This->SourceRect.top;
309 This->WindowPos.bottom = This->SourceRect.bottom;
312 AdjustWindowRectEx(&This->WindowPos, style, TRUE, style_ex);
314 TRACE("WindowPos: %d %d %d %d\n", This->WindowPos.left, This->WindowPos.top, This->WindowPos.right, This->WindowPos.bottom);
315 SetWindowPos(This->hWnd, NULL,
316 This->WindowPos.left,
318 This->WindowPos.right - This->WindowPos.left,
319 This->WindowPos.bottom - This->WindowPos.top,
320 SWP_NOZORDER|SWP_NOMOVE|SWP_DEFERERASE);
322 GetClientRect(This->hWnd, &This->DestRect);
325 This->DestRect = This->WindowPos;
329 hDC = GetDC(This->hWnd);
332 ERR("Cannot get DC from window!\n");
336 TRACE("Src Rect: %d %d %d %d\n", This->SourceRect.left, This->SourceRect.top, This->SourceRect.right, This->SourceRect.bottom);
337 TRACE("Dst Rect: %d %d %d %d\n", This->DestRect.left, This->DestRect.top, This->DestRect.right, This->DestRect.bottom);
339 StretchDIBits(hDC, This->DestRect.left, This->DestRect.top, This->DestRect.right -This->DestRect.left,
340 This->DestRect.bottom - This->DestRect.top, This->SourceRect.left, This->SourceRect.top,
341 This->SourceRect.right - This->SourceRect.left, This->SourceRect.bottom - This->SourceRect.top,
342 data, (BITMAPINFO *)bmiHeader, DIB_RGB_COLORS, SRCCOPY);
344 ReleaseDC(This->hWnd, hDC);
346 ShowWindow(This->hWnd, SW_SHOW);
351 static HRESULT WINAPI VideoRenderer_Receive(BaseInputPin* pin, IMediaSample * pSample)
353 VideoRendererImpl *This = (VideoRendererImpl *)pin->pin.pinInfo.pFilter;
354 LPBYTE pbSrcStream = NULL;
355 LONG cbSrcStream = 0;
356 REFERENCE_TIME tStart, tStop;
359 TRACE("(%p)->(%p)\n", pin, pSample);
361 EnterCriticalSection(&This->filter.csFilter);
363 if (This->pInputPin->flushing || This->pInputPin->end_of_stream)
365 LeaveCriticalSection(&This->filter.csFilter);
369 if (This->filter.state == State_Stopped)
371 LeaveCriticalSection(&This->filter.csFilter);
372 return VFW_E_WRONG_STATE;
375 hr = IMediaSample_GetTime(pSample, &tStart, &tStop);
377 ERR("Cannot get sample time (%x)\n", hr);
379 MediaSeekingPassThru_RegisterMediaTime(This->seekthru_unk, tStart);
381 if (This->rtLastStop != tStart && This->filter.state == State_Running)
384 delta = tStart - This->rtLastStop;
385 if ((delta < -100000 || delta > 100000) &&
386 IMediaSample_IsDiscontinuity(pSample) == S_FALSE)
387 ERR("Unexpected discontinuity: Last: %u.%03u, tStart: %u.%03u\n",
388 (DWORD)(This->rtLastStop / 10000000),
389 (DWORD)((This->rtLastStop / 10000)%1000),
390 (DWORD)(tStart / 10000000), (DWORD)((tStart / 10000)%1000));
391 This->rtLastStop = tStart;
394 /* Preroll means the sample isn't shown, this is used for key frames and things like that */
395 if (IMediaSample_IsPreroll(pSample) == S_OK)
397 This->rtLastStop = tStop;
398 LeaveCriticalSection(&This->filter.csFilter);
402 hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
405 ERR("Cannot get pointer to sample data (%x)\n", hr);
406 LeaveCriticalSection(&This->filter.csFilter);
410 cbSrcStream = IMediaSample_GetActualDataLength(pSample);
412 TRACE("val %p %d\n", pbSrcStream, cbSrcStream);
414 #if 0 /* For debugging purpose */
417 for(i = 0; i < cbSrcStream; i++)
419 if ((i!=0) && !(i%16))
421 TRACE("%02x ", pbSrcStream[i]);
427 SetEvent(This->hEvent);
428 if (This->filter.state == State_Paused)
430 This->sample_held = pSample;
431 LeaveCriticalSection(&This->filter.csFilter);
432 WaitForSingleObject(This->blocked, INFINITE);
433 EnterCriticalSection(&This->filter.csFilter);
434 This->sample_held = NULL;
435 if (This->filter.state == State_Paused)
438 LeaveCriticalSection(&This->filter.csFilter);
441 if (This->filter.state == State_Stopped)
443 LeaveCriticalSection(&This->filter.csFilter);
444 return VFW_E_WRONG_STATE;
448 if (This->filter.pClock && This->filter.state == State_Running)
450 REFERENCE_TIME time, trefstart, trefstop;
453 /* Perhaps I <SHOULD> use the reference clock AdviseTime function here
454 * I'm not going to! When I tried, it seemed to generate lag and
455 * it caused instability.
457 IReferenceClock_GetTime(This->filter.pClock, &time);
459 trefstart = This->filter.rtStreamStart;
460 trefstop = (REFERENCE_TIME)((double)(tStop - tStart) / This->pInputPin->pin.dRate) + This->filter.rtStreamStart;
461 delta = (LONG)((trefstart-time)/10000);
462 This->filter.rtStreamStart = trefstop;
463 This->rtLastStop = tStop;
467 TRACE("Sleeping for %u ms\n", delta);
470 else if (time > trefstop)
472 TRACE("Dropping sample: Time: %u.%03u ms trefstop: %u.%03u ms!\n",
473 (DWORD)(time / 10000000), (DWORD)((time / 10000)%1000),
474 (DWORD)(trefstop / 10000000), (DWORD)((trefstop / 10000)%1000) );
475 This->rtLastStop = tStop;
476 LeaveCriticalSection(&This->filter.csFilter);
480 This->rtLastStop = tStop;
482 VideoRenderer_SendSampleData(This, pbSrcStream, cbSrcStream);
484 LeaveCriticalSection(&This->filter.csFilter);
488 static HRESULT WINAPI VideoRenderer_CheckMediaType(BasePin *iface, const AM_MEDIA_TYPE * pmt)
490 BaseInputPin* pin = (BaseInputPin*)iface;
491 VideoRendererImpl *This = (VideoRendererImpl *)pin->pin.pinInfo.pFilter;
493 if (!IsEqualIID(&pmt->majortype, &MEDIATYPE_Video))
496 if (IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB32) ||
497 IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB24) ||
498 IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB565) ||
499 IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB8))
503 if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo))
505 VIDEOINFOHEADER *format = (VIDEOINFOHEADER *)pmt->pbFormat;
506 This->SourceRect.left = 0;
507 This->SourceRect.top = 0;
508 This->SourceRect.right = This->VideoWidth = format->bmiHeader.biWidth;
509 height = format->bmiHeader.biHeight;
511 This->SourceRect.bottom = This->VideoHeight = -height;
513 This->SourceRect.bottom = This->VideoHeight = height;
515 else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2))
517 VIDEOINFOHEADER2 *format2 = (VIDEOINFOHEADER2 *)pmt->pbFormat;
519 This->SourceRect.left = 0;
520 This->SourceRect.top = 0;
521 This->SourceRect.right = This->VideoWidth = format2->bmiHeader.biWidth;
522 height = format2->bmiHeader.biHeight;
524 This->SourceRect.bottom = This->VideoHeight = -height;
526 This->SourceRect.bottom = This->VideoHeight = height;
530 WARN("Format type %s not supported\n", debugstr_guid(&pmt->formattype));
538 static IPin* WINAPI VideoRenderer_GetPin(BaseFilter *iface, int pos)
540 VideoRendererImpl *This = (VideoRendererImpl *)iface;
542 if (pos >= 1 || pos < 0)
545 IPin_AddRef((IPin *)This->pInputPin);
546 return (IPin *)This->pInputPin;
549 static LONG WINAPI VideoRenderer_GetPinCount(BaseFilter *iface)
554 static const BaseFilterFuncTable BaseFuncTable = {
555 VideoRenderer_GetPin,
556 VideoRenderer_GetPinCount
559 static const BasePinFuncTable input_BaseFuncTable = {
560 VideoRenderer_CheckMediaType,
562 BasePinImpl_GetMediaTypeVersion,
563 BasePinImpl_GetMediaType
566 static const BaseInputPinFuncTable input_BaseInputFuncTable = {
567 VideoRenderer_Receive
570 HRESULT VideoRenderer_create(IUnknown * pUnkOuter, LPVOID * ppv)
574 VideoRendererImpl * pVideoRenderer;
575 ISeekingPassThru *passthru;
577 TRACE("(%p, %p)\n", pUnkOuter, ppv);
581 pVideoRenderer = CoTaskMemAlloc(sizeof(VideoRendererImpl));
582 pVideoRenderer->pUnkOuter = pUnkOuter;
583 pVideoRenderer->bUnkOuterValid = FALSE;
584 pVideoRenderer->bAggregatable = FALSE;
585 pVideoRenderer->IInner_vtbl = &IInner_VTable;
586 pVideoRenderer->IAMFilterMiscFlags_vtbl = &IAMFilterMiscFlags_Vtbl;
588 BaseFilter_Init(&pVideoRenderer->filter, &VideoRenderer_Vtbl, &CLSID_VideoRenderer, (DWORD_PTR)(__FILE__ ": VideoRendererImpl.csFilter"), &BaseFuncTable);
590 pVideoRenderer->IBasicVideo_vtbl = &IBasicVideo_VTable;
591 pVideoRenderer->IVideoWindow_vtbl = &IVideoWindow_VTable;
593 pVideoRenderer->init = 0;
594 pVideoRenderer->AutoShow = 1;
595 pVideoRenderer->rtLastStop = -1;
596 ZeroMemory(&pVideoRenderer->SourceRect, sizeof(RECT));
597 ZeroMemory(&pVideoRenderer->DestRect, sizeof(RECT));
598 ZeroMemory(&pVideoRenderer->WindowPos, sizeof(RECT));
599 pVideoRenderer->hWndMsgDrain = NULL;
600 pVideoRenderer->WindowStyle = WS_OVERLAPPED;
602 /* construct input pin */
603 piInput.dir = PINDIR_INPUT;
604 piInput.pFilter = (IBaseFilter *)pVideoRenderer;
605 lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0]));
607 hr = BaseInputPin_Construct(&VideoRenderer_InputPin_Vtbl, &piInput, &input_BaseFuncTable, &input_BaseInputFuncTable, &pVideoRenderer->filter.csFilter, NULL, (IPin **)&pVideoRenderer->pInputPin);
611 hr = CoCreateInstance(&CLSID_SeekingPassThru, pUnkOuter ? pUnkOuter : (IUnknown*)&pVideoRenderer->IInner_vtbl, CLSCTX_INPROC_SERVER, &IID_IUnknown, (void**)&pVideoRenderer->seekthru_unk);
613 IPin_Release((IPin*)pVideoRenderer->pInputPin);
616 IUnknown_QueryInterface(pVideoRenderer->seekthru_unk, &IID_ISeekingPassThru, (void**)&passthru);
617 ISeekingPassThru_Init(passthru, TRUE, (IPin*)pVideoRenderer->pInputPin);
618 ISeekingPassThru_Release(passthru);
619 pVideoRenderer->sample_held = NULL;
620 *ppv = pVideoRenderer;
625 if (!CreateRenderingSubsystem(pVideoRenderer))
628 pVideoRenderer->blocked = CreateEventW(NULL, FALSE, FALSE, NULL);
629 if (!pVideoRenderer->blocked)
631 hr = HRESULT_FROM_WIN32(GetLastError());
632 IUnknown_Release((IUnknown *)pVideoRenderer);
637 BaseFilterImpl_Release((IBaseFilter*)pVideoRenderer);
638 CoTaskMemFree(pVideoRenderer);
642 HRESULT VideoRendererDefault_create(IUnknown * pUnkOuter, LPVOID * ppv)
644 /* TODO: Attempt to use the VMR-7 renderer instead when possible */
645 return VideoRenderer_create(pUnkOuter, ppv);
648 static HRESULT WINAPI VideoRendererInner_QueryInterface(IUnknown * iface, REFIID riid, LPVOID * ppv)
650 ICOM_THIS_MULTI(VideoRendererImpl, IInner_vtbl, iface);
651 TRACE("(%p/%p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv);
653 if (This->bAggregatable)
654 This->bUnkOuterValid = TRUE;
658 if (IsEqualIID(riid, &IID_IUnknown))
659 *ppv = &This->IInner_vtbl;
660 else if (IsEqualIID(riid, &IID_IPersist))
662 else if (IsEqualIID(riid, &IID_IMediaFilter))
664 else if (IsEqualIID(riid, &IID_IBaseFilter))
666 else if (IsEqualIID(riid, &IID_IBasicVideo))
667 *ppv = &This->IBasicVideo_vtbl;
668 else if (IsEqualIID(riid, &IID_IVideoWindow))
669 *ppv = &This->IVideoWindow_vtbl;
670 else if (IsEqualIID(riid, &IID_IMediaSeeking))
671 return IUnknown_QueryInterface(This->seekthru_unk, riid, ppv);
672 else if (IsEqualIID(riid, &IID_IAMFilterMiscFlags))
673 *ppv = &This->IAMFilterMiscFlags_vtbl;
677 IUnknown_AddRef((IUnknown *)(*ppv));
681 if (!IsEqualIID(riid, &IID_IPin))
682 FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
684 return E_NOINTERFACE;
687 static ULONG WINAPI VideoRendererInner_AddRef(IUnknown * iface)
689 ICOM_THIS_MULTI(VideoRendererImpl, IInner_vtbl, iface);
690 ULONG refCount = InterlockedIncrement(&This->filter.refCount);
692 TRACE("(%p/%p)->() AddRef from %d\n", This, iface, refCount - 1);
697 static ULONG WINAPI VideoRendererInner_Release(IUnknown * iface)
699 ICOM_THIS_MULTI(VideoRendererImpl, IInner_vtbl, iface);
700 ULONG refCount = InterlockedDecrement(&This->filter.refCount);
702 TRACE("(%p/%p)->() Release from %d\n", This, iface, refCount + 1);
708 DestroyWindow(This->hWnd);
709 PostThreadMessageA(This->ThreadID, WM_QUIT, 0, 0);
710 WaitForSingleObject(This->hThread, INFINITE);
711 CloseHandle(This->hThread);
712 CloseHandle(This->hEvent);
714 if (SUCCEEDED(IPin_ConnectedTo((IPin *)This->pInputPin, &pConnectedTo)))
716 IPin_Disconnect(pConnectedTo);
717 IPin_Release(pConnectedTo);
719 IPin_Disconnect((IPin *)This->pInputPin);
721 IPin_Release((IPin *)This->pInputPin);
723 This->filter.lpVtbl = NULL;
724 IUnknown_Release(This->seekthru_unk);
725 This->filter.csFilter.DebugInfo->Spare[0] = 0;
726 DeleteCriticalSection(&This->filter.csFilter);
728 TRACE("Destroying Video Renderer\n");
737 static const IUnknownVtbl IInner_VTable =
739 VideoRendererInner_QueryInterface,
740 VideoRendererInner_AddRef,
741 VideoRendererInner_Release
744 static HRESULT WINAPI VideoRenderer_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv)
746 VideoRendererImpl *This = (VideoRendererImpl *)iface;
748 if (This->bAggregatable)
749 This->bUnkOuterValid = TRUE;
753 if (This->bAggregatable)
754 return IUnknown_QueryInterface(This->pUnkOuter, riid, ppv);
756 if (IsEqualIID(riid, &IID_IUnknown))
760 IUnknown_AddRef((IUnknown *)&(This->IInner_vtbl));
761 hr = IUnknown_QueryInterface((IUnknown *)&(This->IInner_vtbl), riid, ppv);
762 IUnknown_Release((IUnknown *)&(This->IInner_vtbl));
763 This->bAggregatable = TRUE;
768 return E_NOINTERFACE;
771 return IUnknown_QueryInterface((IUnknown *)&(This->IInner_vtbl), riid, ppv);
774 static ULONG WINAPI VideoRenderer_AddRef(IBaseFilter * iface)
776 VideoRendererImpl *This = (VideoRendererImpl *)iface;
778 if (This->pUnkOuter && This->bUnkOuterValid)
779 return IUnknown_AddRef(This->pUnkOuter);
780 return IUnknown_AddRef((IUnknown *)&(This->IInner_vtbl));
783 static ULONG WINAPI VideoRenderer_Release(IBaseFilter * iface)
785 VideoRendererImpl *This = (VideoRendererImpl *)iface;
787 if (This->pUnkOuter && This->bUnkOuterValid)
788 return IUnknown_Release(This->pUnkOuter);
789 return IUnknown_Release((IUnknown *)&(This->IInner_vtbl));
792 /** IMediaFilter methods **/
794 static HRESULT WINAPI VideoRenderer_Stop(IBaseFilter * iface)
796 VideoRendererImpl *This = (VideoRendererImpl *)iface;
798 TRACE("(%p/%p)->()\n", This, iface);
800 EnterCriticalSection(&This->filter.csFilter);
802 This->filter.state = State_Stopped;
803 SetEvent(This->hEvent);
804 SetEvent(This->blocked);
805 MediaSeekingPassThru_ResetMediaTime(This->seekthru_unk);
807 LeaveCriticalSection(&This->filter.csFilter);
812 static HRESULT WINAPI VideoRenderer_Pause(IBaseFilter * iface)
814 VideoRendererImpl *This = (VideoRendererImpl *)iface;
816 TRACE("(%p/%p)->()\n", This, iface);
818 EnterCriticalSection(&This->filter.csFilter);
819 if (This->filter.state != State_Paused)
821 if (This->filter.state == State_Stopped)
823 This->pInputPin->end_of_stream = 0;
824 ResetEvent(This->hEvent);
827 This->filter.state = State_Paused;
828 ResetEvent(This->blocked);
830 LeaveCriticalSection(&This->filter.csFilter);
835 static HRESULT WINAPI VideoRenderer_Run(IBaseFilter * iface, REFERENCE_TIME tStart)
838 VideoRendererImpl *This = (VideoRendererImpl *)iface;
840 TRACE("(%p/%p)->(%s)\n", This, iface, wine_dbgstr_longlong(tStart));
842 EnterCriticalSection(&This->filter.csFilter);
843 if (This->filter.state == State_Running)
845 if (This->pInputPin->pin.pConnectedTo)
847 if (This->filter.state == State_Stopped)
849 This->pInputPin->end_of_stream = 0;
850 ResetEvent(This->hEvent);
852 SetEvent(This->blocked);
854 This->filter.rtStreamStart = tStart;
855 This->filter.state = State_Running;
856 } else if (This->filter.filterInfo.pGraph) {
857 IMediaEventSink *pEventSink;
858 hr = IFilterGraph_QueryInterface(This->filter.filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink);
861 hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, (LONG_PTR)This);
862 IMediaEventSink_Release(pEventSink);
867 This->filter.state = State_Running;
869 LeaveCriticalSection(&This->filter.csFilter);
874 static HRESULT WINAPI VideoRenderer_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
876 VideoRendererImpl *This = (VideoRendererImpl *)iface;
879 TRACE("(%p/%p)->(%d, %p)\n", This, iface, dwMilliSecsTimeout, pState);
881 if (WaitForSingleObject(This->hEvent, dwMilliSecsTimeout) == WAIT_TIMEOUT)
882 hr = VFW_S_STATE_INTERMEDIATE;
886 BaseFilterImpl_GetState(iface, dwMilliSecsTimeout, pState);
891 /** IBaseFilter implementation **/
893 static HRESULT WINAPI VideoRenderer_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin)
895 VideoRendererImpl *This = (VideoRendererImpl *)iface;
897 FIXME("(%p/%p)->(%p,%p): stub !!!\n", This, iface, debugstr_w(Id), ppPin);
899 /* FIXME: critical section */
904 static const IBaseFilterVtbl VideoRenderer_Vtbl =
906 VideoRenderer_QueryInterface,
907 VideoRenderer_AddRef,
908 VideoRenderer_Release,
909 BaseFilterImpl_GetClassID,
913 VideoRenderer_GetState,
914 BaseFilterImpl_SetSyncSource,
915 BaseFilterImpl_GetSyncSource,
916 BaseFilterImpl_EnumPins,
917 VideoRenderer_FindPin,
918 BaseFilterImpl_QueryFilterInfo,
919 BaseFilterImpl_JoinFilterGraph,
920 BaseFilterImpl_QueryVendorInfo
923 static HRESULT WINAPI VideoRenderer_InputPin_EndOfStream(IPin * iface)
925 BaseInputPin* This = (BaseInputPin*)iface;
926 VideoRendererImpl *pFilter;
927 IMediaEventSink* pEventSink;
930 TRACE("(%p/%p)->()\n", This, iface);
932 pFilter = (VideoRendererImpl*)This->pin.pinInfo.pFilter;
933 hr = IFilterGraph_QueryInterface(pFilter->filter.filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink);
936 hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, (LONG_PTR)pFilter);
937 IMediaEventSink_Release(pEventSink);
939 MediaSeekingPassThru_EOS(pFilter->seekthru_unk);
944 static HRESULT WINAPI VideoRenderer_InputPin_BeginFlush(IPin * iface)
946 BaseInputPin* This = (BaseInputPin*)iface;
947 VideoRendererImpl *pVideoRenderer = (VideoRendererImpl *)This->pin.pinInfo.pFilter;
950 TRACE("(%p/%p)->()\n", This, iface);
952 EnterCriticalSection(This->pin.pCritSec);
953 if (pVideoRenderer->filter.state == State_Paused)
954 SetEvent(pVideoRenderer->blocked);
956 hr = BaseInputPinImpl_BeginFlush(iface);
957 LeaveCriticalSection(This->pin.pCritSec);
962 static HRESULT WINAPI VideoRenderer_InputPin_EndFlush(IPin * iface)
964 BaseInputPin* This = (BaseInputPin*)iface;
965 VideoRendererImpl *pVideoRenderer = (VideoRendererImpl *)This->pin.pinInfo.pFilter;
968 TRACE("(%p/%p)->()\n", This, iface);
970 EnterCriticalSection(This->pin.pCritSec);
971 if (pVideoRenderer->filter.state == State_Paused)
972 ResetEvent(pVideoRenderer->blocked);
974 hr = BaseInputPinImpl_EndFlush(iface);
975 LeaveCriticalSection(This->pin.pCritSec);
976 MediaSeekingPassThru_ResetMediaTime(pVideoRenderer->seekthru_unk);
981 static const IPinVtbl VideoRenderer_InputPin_Vtbl =
983 BaseInputPinImpl_QueryInterface,
985 BaseInputPinImpl_Release,
986 BaseInputPinImpl_Connect,
987 BaseInputPinImpl_ReceiveConnection,
988 BasePinImpl_Disconnect,
989 BasePinImpl_ConnectedTo,
990 BasePinImpl_ConnectionMediaType,
991 BasePinImpl_QueryPinInfo,
992 BasePinImpl_QueryDirection,
994 BaseInputPinImpl_QueryAccept,
995 BasePinImpl_EnumMediaTypes,
996 BasePinImpl_QueryInternalConnections,
997 VideoRenderer_InputPin_EndOfStream,
998 VideoRenderer_InputPin_BeginFlush,
999 VideoRenderer_InputPin_EndFlush,
1000 BaseInputPinImpl_NewSegment
1003 /*** IUnknown methods ***/
1004 static HRESULT WINAPI Basicvideo_QueryInterface(IBasicVideo *iface,
1007 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1009 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1011 return VideoRenderer_QueryInterface((IBaseFilter*)This, riid, ppvObj);
1014 static ULONG WINAPI Basicvideo_AddRef(IBasicVideo *iface) {
1015 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1017 TRACE("(%p/%p)->()\n", This, iface);
1019 return VideoRenderer_AddRef((IBaseFilter*)This);
1022 static ULONG WINAPI Basicvideo_Release(IBasicVideo *iface) {
1023 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1025 TRACE("(%p/%p)->()\n", This, iface);
1027 return VideoRenderer_Release((IBaseFilter*)This);
1030 /*** IDispatch methods ***/
1031 static HRESULT WINAPI Basicvideo_GetTypeInfoCount(IBasicVideo *iface,
1033 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1035 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1040 static HRESULT WINAPI Basicvideo_GetTypeInfo(IBasicVideo *iface,
1043 ITypeInfo**ppTInfo) {
1044 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1046 FIXME("(%p/%p)->(%d, %d, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1051 static HRESULT WINAPI Basicvideo_GetIDsOfNames(IBasicVideo *iface,
1057 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1059 FIXME("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1064 static HRESULT WINAPI Basicvideo_Invoke(IBasicVideo *iface,
1065 DISPID dispIdMember,
1069 DISPPARAMS*pDispParams,
1071 EXCEPINFO*pExepInfo,
1073 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1075 FIXME("(%p/%p)->(%d, %s (%p), %d, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
1080 /*** IBasicVideo methods ***/
1081 static HRESULT WINAPI Basicvideo_get_AvgTimePerFrame(IBasicVideo *iface,
1082 REFTIME *pAvgTimePerFrame) {
1084 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1086 if (!This->pInputPin->pin.pConnectedTo)
1087 return VFW_E_NOT_CONNECTED;
1089 TRACE("(%p/%p)->(%p)\n", This, iface, pAvgTimePerFrame);
1091 pmt = &This->pInputPin->pin.mtCurrent;
1092 if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) {
1093 VIDEOINFOHEADER *vih = (VIDEOINFOHEADER*)pmt->pbFormat;
1094 *pAvgTimePerFrame = vih->AvgTimePerFrame;
1095 } else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2)) {
1096 VIDEOINFOHEADER2 *vih = (VIDEOINFOHEADER2*)pmt->pbFormat;
1097 *pAvgTimePerFrame = vih->AvgTimePerFrame;
1099 ERR("Unknown format type %s\n", qzdebugstr_guid(&pmt->formattype));
1100 *pAvgTimePerFrame = 0;
1105 static HRESULT WINAPI Basicvideo_get_BitRate(IBasicVideo *iface,
1107 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1109 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pBitRate);
1114 static HRESULT WINAPI Basicvideo_get_BitErrorRate(IBasicVideo *iface,
1115 LONG *pBitErrorRate) {
1116 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1118 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pBitErrorRate);
1123 static HRESULT WINAPI Basicvideo_get_VideoWidth(IBasicVideo *iface,
1124 LONG *pVideoWidth) {
1125 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1127 TRACE("(%p/%p)->(%p)\n", This, iface, pVideoWidth);
1129 *pVideoWidth = This->VideoWidth;
1134 static HRESULT WINAPI Basicvideo_get_VideoHeight(IBasicVideo *iface,
1135 LONG *pVideoHeight) {
1136 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1138 TRACE("(%p/%p)->(%p)\n", This, iface, pVideoHeight);
1140 *pVideoHeight = This->VideoHeight;
1145 static HRESULT WINAPI Basicvideo_put_SourceLeft(IBasicVideo *iface,
1147 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1149 TRACE("(%p/%p)->(%d)\n", This, iface, SourceLeft);
1151 This->SourceRect.left = SourceLeft;
1156 static HRESULT WINAPI Basicvideo_get_SourceLeft(IBasicVideo *iface,
1157 LONG *pSourceLeft) {
1158 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1160 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceLeft);
1162 *pSourceLeft = This->SourceRect.left;
1167 static HRESULT WINAPI Basicvideo_put_SourceWidth(IBasicVideo *iface,
1169 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1171 TRACE("(%p/%p)->(%d)\n", This, iface, SourceWidth);
1173 This->SourceRect.right = This->SourceRect.left + SourceWidth;
1178 static HRESULT WINAPI Basicvideo_get_SourceWidth(IBasicVideo *iface,
1179 LONG *pSourceWidth) {
1180 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1182 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceWidth);
1184 *pSourceWidth = This->SourceRect.right - This->SourceRect.left;
1189 static HRESULT WINAPI Basicvideo_put_SourceTop(IBasicVideo *iface,
1191 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1193 TRACE("(%p/%p)->(%d)\n", This, iface, SourceTop);
1195 This->SourceRect.top = SourceTop;
1200 static HRESULT WINAPI Basicvideo_get_SourceTop(IBasicVideo *iface,
1202 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1204 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceTop);
1206 *pSourceTop = This->SourceRect.top;
1211 static HRESULT WINAPI Basicvideo_put_SourceHeight(IBasicVideo *iface,
1212 LONG SourceHeight) {
1213 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1215 TRACE("(%p/%p)->(%d)\n", This, iface, SourceHeight);
1217 This->SourceRect.bottom = This->SourceRect.top + SourceHeight;
1222 static HRESULT WINAPI Basicvideo_get_SourceHeight(IBasicVideo *iface,
1223 LONG *pSourceHeight) {
1224 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1226 TRACE("(%p/%p)->(%p)\n", This, iface, pSourceHeight);
1228 *pSourceHeight = This->SourceRect.bottom - This->SourceRect.top;
1233 static HRESULT WINAPI Basicvideo_put_DestinationLeft(IBasicVideo *iface,
1234 LONG DestinationLeft) {
1235 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1237 TRACE("(%p/%p)->(%d)\n", This, iface, DestinationLeft);
1239 This->DestRect.left = DestinationLeft;
1244 static HRESULT WINAPI Basicvideo_get_DestinationLeft(IBasicVideo *iface,
1245 LONG *pDestinationLeft) {
1246 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1248 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationLeft);
1250 *pDestinationLeft = This->DestRect.left;
1255 static HRESULT WINAPI Basicvideo_put_DestinationWidth(IBasicVideo *iface,
1256 LONG DestinationWidth) {
1257 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1259 TRACE("(%p/%p)->(%d)\n", This, iface, DestinationWidth);
1261 This->DestRect.right = This->DestRect.left + DestinationWidth;
1266 static HRESULT WINAPI Basicvideo_get_DestinationWidth(IBasicVideo *iface,
1267 LONG *pDestinationWidth) {
1268 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1270 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationWidth);
1272 *pDestinationWidth = This->DestRect.right - This->DestRect.left;
1277 static HRESULT WINAPI Basicvideo_put_DestinationTop(IBasicVideo *iface,
1278 LONG DestinationTop) {
1279 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1281 TRACE("(%p/%p)->(%d)\n", This, iface, DestinationTop);
1283 This->DestRect.top = DestinationTop;
1288 static HRESULT WINAPI Basicvideo_get_DestinationTop(IBasicVideo *iface,
1289 LONG *pDestinationTop) {
1290 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1292 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationTop);
1294 *pDestinationTop = This->DestRect.top;
1299 static HRESULT WINAPI Basicvideo_put_DestinationHeight(IBasicVideo *iface,
1300 LONG DestinationHeight) {
1301 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1303 TRACE("(%p/%p)->(%d)\n", This, iface, DestinationHeight);
1305 This->DestRect.right = This->DestRect.left + DestinationHeight;
1310 static HRESULT WINAPI Basicvideo_get_DestinationHeight(IBasicVideo *iface,
1311 LONG *pDestinationHeight) {
1312 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1314 TRACE("(%p/%p)->(%p)\n", This, iface, pDestinationHeight);
1316 *pDestinationHeight = This->DestRect.right - This->DestRect.left;
1321 static HRESULT WINAPI Basicvideo_SetSourcePosition(IBasicVideo *iface,
1326 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1328 TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height);
1330 This->SourceRect.left = Left;
1331 This->SourceRect.top = Top;
1332 This->SourceRect.right = Left + Width;
1333 This->SourceRect.bottom = Top + Height;
1338 static HRESULT WINAPI Basicvideo_GetSourcePosition(IBasicVideo *iface,
1343 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1345 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
1347 *pLeft = This->SourceRect.left;
1348 *pTop = This->SourceRect.top;
1349 *pWidth = This->SourceRect.right - This->SourceRect.left;
1350 *pHeight = This->SourceRect.bottom - This->SourceRect.top;
1355 static HRESULT WINAPI Basicvideo_SetDefaultSourcePosition(IBasicVideo *iface) {
1356 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1358 TRACE("(%p/%p)->()\n", This, iface);
1360 This->SourceRect.left = 0;
1361 This->SourceRect.top = 0;
1362 This->SourceRect.right = This->VideoWidth;
1363 This->SourceRect.bottom = This->VideoHeight;
1368 static HRESULT WINAPI Basicvideo_SetDestinationPosition(IBasicVideo *iface,
1373 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1375 TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height);
1377 This->DestRect.left = Left;
1378 This->DestRect.top = Top;
1379 This->DestRect.right = Left + Width;
1380 This->DestRect.bottom = Top + Height;
1385 static HRESULT WINAPI Basicvideo_GetDestinationPosition(IBasicVideo *iface,
1390 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1392 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
1394 *pLeft = This->DestRect.left;
1395 *pTop = This->DestRect.top;
1396 *pWidth = This->DestRect.right - This->DestRect.left;
1397 *pHeight = This->DestRect.bottom - This->DestRect.top;
1402 static HRESULT WINAPI Basicvideo_SetDefaultDestinationPosition(IBasicVideo *iface) {
1403 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1406 TRACE("(%p/%p)->()\n", This, iface);
1408 if (!GetClientRect(This->hWnd, &rect))
1411 This->SourceRect.left = 0;
1412 This->SourceRect.top = 0;
1413 This->SourceRect.right = rect.right;
1414 This->SourceRect.bottom = rect.bottom;
1419 static HRESULT WINAPI Basicvideo_GetVideoSize(IBasicVideo *iface,
1422 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1424 TRACE("(%p/%p)->(%p, %p)\n", This, iface, pWidth, pHeight);
1426 *pWidth = This->VideoWidth;
1427 *pHeight = This->VideoHeight;
1432 static HRESULT WINAPI Basicvideo_GetVideoPaletteEntries(IBasicVideo *iface,
1437 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1439 FIXME("(%p/%p)->(%d, %d, %p, %p): stub !!!\n", This, iface, StartIndex, Entries, pRetrieved, pPalette);
1444 static HRESULT WINAPI Basicvideo_GetCurrentImage(IBasicVideo *iface,
1447 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1448 BITMAPINFOHEADER *bmiHeader;
1450 AM_MEDIA_TYPE *amt = &This->pInputPin->pin.mtCurrent;
1453 FIXME("(%p/%p)->(%p, %p): partial stub\n", This, iface, pBufferSize, pDIBImage);
1455 EnterCriticalSection(&This->filter.csFilter);
1457 if (!This->sample_held)
1459 LeaveCriticalSection(&This->filter.csFilter);
1460 return (This->filter.state == State_Paused ? E_UNEXPECTED : VFW_E_NOT_PAUSED);
1463 if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo))
1465 bmiHeader = &((VIDEOINFOHEADER *)amt->pbFormat)->bmiHeader;
1467 else if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo2))
1469 bmiHeader = &((VIDEOINFOHEADER2 *)amt->pbFormat)->bmiHeader;
1473 FIXME("Unknown type %s\n", debugstr_guid(&amt->subtype));
1474 LeaveCriticalSection(&This->filter.csFilter);
1475 return VFW_E_RUNTIME_ERROR;
1478 needed_size = bmiHeader->biSize;
1479 needed_size += IMediaSample_GetActualDataLength(This->sample_held);
1483 *pBufferSize = needed_size;
1484 LeaveCriticalSection(&This->filter.csFilter);
1488 if (needed_size < *pBufferSize)
1490 ERR("Buffer too small %u/%u\n", needed_size, *pBufferSize);
1491 LeaveCriticalSection(&This->filter.csFilter);
1494 *pBufferSize = needed_size;
1496 memcpy(pDIBImage, bmiHeader, bmiHeader->biSize);
1497 IMediaSample_GetPointer(This->sample_held, (BYTE **)&ptr);
1498 memcpy((char *)pDIBImage + bmiHeader->biSize, ptr, IMediaSample_GetActualDataLength(This->sample_held));
1500 LeaveCriticalSection(&This->filter.csFilter);
1505 static HRESULT WINAPI Basicvideo_IsUsingDefaultSource(IBasicVideo *iface) {
1506 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1508 FIXME("(%p/%p)->(): stub !!!\n", This, iface);
1513 static HRESULT WINAPI Basicvideo_IsUsingDefaultDestination(IBasicVideo *iface) {
1514 ICOM_THIS_MULTI(VideoRendererImpl, IBasicVideo_vtbl, iface);
1516 FIXME("(%p/%p)->(): stub !!!\n", This, iface);
1522 static const IBasicVideoVtbl IBasicVideo_VTable =
1524 Basicvideo_QueryInterface,
1527 Basicvideo_GetTypeInfoCount,
1528 Basicvideo_GetTypeInfo,
1529 Basicvideo_GetIDsOfNames,
1531 Basicvideo_get_AvgTimePerFrame,
1532 Basicvideo_get_BitRate,
1533 Basicvideo_get_BitErrorRate,
1534 Basicvideo_get_VideoWidth,
1535 Basicvideo_get_VideoHeight,
1536 Basicvideo_put_SourceLeft,
1537 Basicvideo_get_SourceLeft,
1538 Basicvideo_put_SourceWidth,
1539 Basicvideo_get_SourceWidth,
1540 Basicvideo_put_SourceTop,
1541 Basicvideo_get_SourceTop,
1542 Basicvideo_put_SourceHeight,
1543 Basicvideo_get_SourceHeight,
1544 Basicvideo_put_DestinationLeft,
1545 Basicvideo_get_DestinationLeft,
1546 Basicvideo_put_DestinationWidth,
1547 Basicvideo_get_DestinationWidth,
1548 Basicvideo_put_DestinationTop,
1549 Basicvideo_get_DestinationTop,
1550 Basicvideo_put_DestinationHeight,
1551 Basicvideo_get_DestinationHeight,
1552 Basicvideo_SetSourcePosition,
1553 Basicvideo_GetSourcePosition,
1554 Basicvideo_SetDefaultSourcePosition,
1555 Basicvideo_SetDestinationPosition,
1556 Basicvideo_GetDestinationPosition,
1557 Basicvideo_SetDefaultDestinationPosition,
1558 Basicvideo_GetVideoSize,
1559 Basicvideo_GetVideoPaletteEntries,
1560 Basicvideo_GetCurrentImage,
1561 Basicvideo_IsUsingDefaultSource,
1562 Basicvideo_IsUsingDefaultDestination
1566 /*** IUnknown methods ***/
1567 static HRESULT WINAPI Videowindow_QueryInterface(IVideoWindow *iface,
1570 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1572 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
1574 return VideoRenderer_QueryInterface((IBaseFilter*)This, riid, ppvObj);
1577 static ULONG WINAPI Videowindow_AddRef(IVideoWindow *iface) {
1578 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1580 TRACE("(%p/%p)->()\n", This, iface);
1582 return VideoRenderer_AddRef((IBaseFilter*)This);
1585 static ULONG WINAPI Videowindow_Release(IVideoWindow *iface) {
1586 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1588 TRACE("(%p/%p)->()\n", This, iface);
1590 return VideoRenderer_Release((IBaseFilter*)This);
1593 /*** IDispatch methods ***/
1594 static HRESULT WINAPI Videowindow_GetTypeInfoCount(IVideoWindow *iface,
1596 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1598 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
1603 static HRESULT WINAPI Videowindow_GetTypeInfo(IVideoWindow *iface,
1606 ITypeInfo**ppTInfo) {
1607 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1609 FIXME("(%p/%p)->(%d, %d, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
1614 static HRESULT WINAPI Videowindow_GetIDsOfNames(IVideoWindow *iface,
1620 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1622 FIXME("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
1627 static HRESULT WINAPI Videowindow_Invoke(IVideoWindow *iface,
1628 DISPID dispIdMember,
1632 DISPPARAMS*pDispParams,
1634 EXCEPINFO*pExepInfo,
1636 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1638 FIXME("(%p/%p)->(%d, %s (%p), %d, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
1643 /*** IVideoWindow methods ***/
1644 static HRESULT WINAPI Videowindow_put_Caption(IVideoWindow *iface,
1646 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1648 TRACE("(%p/%p)->(%s (%p))\n", This, iface, debugstr_w(strCaption), strCaption);
1650 if (!SetWindowTextW(This->hWnd, strCaption))
1656 static HRESULT WINAPI Videowindow_get_Caption(IVideoWindow *iface,
1658 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1660 TRACE("(%p/%p)->(%p)\n", This, iface, strCaption);
1662 GetWindowTextW(This->hWnd, (LPWSTR)strCaption, 100);
1667 static HRESULT WINAPI Videowindow_put_WindowStyle(IVideoWindow *iface,
1669 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1672 old = GetWindowLongA(This->hWnd, GWL_STYLE);
1674 TRACE("(%p/%p)->(%x -> %x)\n", This, iface, old, WindowStyle);
1676 if (WindowStyle & (WS_DISABLED|WS_HSCROLL|WS_ICONIC|WS_MAXIMIZE|WS_MINIMIZE|WS_VSCROLL))
1677 return E_INVALIDARG;
1679 SetWindowLongA(This->hWnd, GWL_STYLE, WindowStyle);
1680 SetWindowPos(This->hWnd,0,0,0,0,0,SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOZORDER);
1681 This->WindowStyle = WindowStyle;
1686 static HRESULT WINAPI Videowindow_get_WindowStyle(IVideoWindow *iface,
1687 LONG *WindowStyle) {
1688 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1690 TRACE("(%p/%p)->(%p)\n", This, iface, WindowStyle);
1692 *WindowStyle = This->WindowStyle;
1697 static HRESULT WINAPI Videowindow_put_WindowStyleEx(IVideoWindow *iface,
1698 LONG WindowStyleEx) {
1699 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1701 TRACE("(%p/%p)->(%d)\n", This, iface, WindowStyleEx);
1703 if (!SetWindowLongA(This->hWnd, GWL_EXSTYLE, WindowStyleEx))
1709 static HRESULT WINAPI Videowindow_get_WindowStyleEx(IVideoWindow *iface,
1710 LONG *WindowStyleEx) {
1711 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1713 TRACE("(%p/%p)->(%p)\n", This, iface, WindowStyleEx);
1715 *WindowStyleEx = GetWindowLongA(This->hWnd, GWL_EXSTYLE);
1720 static HRESULT WINAPI Videowindow_put_AutoShow(IVideoWindow *iface,
1722 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1724 TRACE("(%p/%p)->(%d)\n", This, iface, AutoShow);
1726 This->AutoShow = AutoShow;
1731 static HRESULT WINAPI Videowindow_get_AutoShow(IVideoWindow *iface,
1733 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1735 TRACE("(%p/%p)->(%p)\n", This, iface, AutoShow);
1737 *AutoShow = This->AutoShow;
1742 static HRESULT WINAPI Videowindow_put_WindowState(IVideoWindow *iface,
1744 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1746 TRACE("(%p/%p)->(%d)\n", This, iface, WindowState);
1747 ShowWindow(This->hWnd, WindowState);
1751 static HRESULT WINAPI Videowindow_get_WindowState(IVideoWindow *iface,
1752 LONG *WindowState) {
1753 WINDOWPLACEMENT place;
1754 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1756 place.length = sizeof(place);
1757 GetWindowPlacement(This->hWnd, &place);
1758 TRACE("(%p/%p)->(%p)\n", This, iface, WindowState);
1759 *WindowState = place.showCmd;
1764 static HRESULT WINAPI Videowindow_put_BackgroundPalette(IVideoWindow *iface,
1765 LONG BackgroundPalette) {
1766 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1768 FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, BackgroundPalette);
1773 static HRESULT WINAPI Videowindow_get_BackgroundPalette(IVideoWindow *iface,
1774 LONG *pBackgroundPalette) {
1775 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1777 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, pBackgroundPalette);
1782 static HRESULT WINAPI Videowindow_put_Visible(IVideoWindow *iface,
1784 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1786 TRACE("(%p/%p)->(%d)\n", This, iface, Visible);
1788 ShowWindow(This->hWnd, Visible ? SW_SHOW : SW_HIDE);
1793 static HRESULT WINAPI Videowindow_get_Visible(IVideoWindow *iface,
1795 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1797 TRACE("(%p/%p)->(%p)\n", This, iface, pVisible);
1799 *pVisible = IsWindowVisible(This->hWnd);
1804 static HRESULT WINAPI Videowindow_put_Left(IVideoWindow *iface,
1806 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1808 TRACE("(%p/%p)->(%d)\n", This, iface, Left);
1810 if (!SetWindowPos(This->hWnd, NULL, Left, This->WindowPos.top, 0, 0, SWP_NOZORDER|SWP_NOSIZE))
1813 This->WindowPos.left = Left;
1818 static HRESULT WINAPI Videowindow_get_Left(IVideoWindow *iface,
1820 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1822 TRACE("(%p/%p)->(%p)\n", This, iface, pLeft);
1824 *pLeft = This->WindowPos.left;
1829 static HRESULT WINAPI Videowindow_put_Width(IVideoWindow *iface,
1831 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1833 TRACE("(%p/%p)->(%d)\n", This, iface, Width);
1835 if (!SetWindowPos(This->hWnd, NULL, 0, 0, Width, This->WindowPos.bottom-This->WindowPos.top, SWP_NOZORDER|SWP_NOMOVE))
1838 This->WindowPos.right = This->WindowPos.left + Width;
1843 static HRESULT WINAPI Videowindow_get_Width(IVideoWindow *iface,
1845 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1847 TRACE("(%p/%p)->(%p)\n", This, iface, pWidth);
1849 *pWidth = This->WindowPos.right - This->WindowPos.left;
1854 static HRESULT WINAPI Videowindow_put_Top(IVideoWindow *iface,
1856 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1858 TRACE("(%p/%p)->(%d)\n", This, iface, Top);
1860 if (!SetWindowPos(This->hWnd, NULL, This->WindowPos.left, Top, 0, 0, SWP_NOZORDER|SWP_NOSIZE))
1863 This->WindowPos.top = Top;
1868 static HRESULT WINAPI Videowindow_get_Top(IVideoWindow *iface,
1870 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1872 TRACE("(%p/%p)->(%p)\n", This, iface, pTop);
1874 *pTop = This->WindowPos.top;
1879 static HRESULT WINAPI Videowindow_put_Height(IVideoWindow *iface,
1881 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1883 TRACE("(%p/%p)->(%d)\n", This, iface, Height);
1885 if (!SetWindowPos(This->hWnd, NULL, 0, 0, This->WindowPos.right-This->WindowPos.left, Height, SWP_NOZORDER|SWP_NOMOVE))
1888 This->WindowPos.bottom = This->WindowPos.top + Height;
1893 static HRESULT WINAPI Videowindow_get_Height(IVideoWindow *iface,
1895 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1897 TRACE("(%p/%p)->(%p)\n", This, iface, pHeight);
1899 *pHeight = This->WindowPos.bottom - This->WindowPos.top;
1904 static HRESULT WINAPI Videowindow_put_Owner(IVideoWindow *iface,
1906 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1908 TRACE("(%p/%p)->(%08x)\n", This, iface, (DWORD) Owner);
1910 SetParent(This->hWnd, (HWND)Owner);
1911 if (This->WindowStyle & WS_CHILD)
1913 LONG old = GetWindowLongA(This->hWnd, GWL_STYLE);
1914 if (old != This->WindowStyle)
1916 SetWindowLongA(This->hWnd, GWL_STYLE, This->WindowStyle);
1917 SetWindowPos(This->hWnd,0,0,0,0,0,SWP_FRAMECHANGED|SWP_NOSIZE|SWP_NOZORDER);
1924 static HRESULT WINAPI Videowindow_get_Owner(IVideoWindow *iface,
1926 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1928 TRACE("(%p/%p)->(%p)\n", This, iface, Owner);
1930 *(HWND*)Owner = GetParent(This->hWnd);
1935 static HRESULT WINAPI Videowindow_put_MessageDrain(IVideoWindow *iface,
1937 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1939 TRACE("(%p/%p)->(%08x)\n", This, iface, (DWORD) Drain);
1941 This->hWndMsgDrain = (HWND)Drain;
1946 static HRESULT WINAPI Videowindow_get_MessageDrain(IVideoWindow *iface,
1948 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1950 TRACE("(%p/%p)->(%p)\n", This, iface, Drain);
1952 *Drain = (OAHWND)This->hWndMsgDrain;
1957 static HRESULT WINAPI Videowindow_get_BorderColor(IVideoWindow *iface,
1959 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1961 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, Color);
1966 static HRESULT WINAPI Videowindow_put_BorderColor(IVideoWindow *iface,
1968 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1970 FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, Color);
1975 static HRESULT WINAPI Videowindow_get_FullScreenMode(IVideoWindow *iface,
1976 LONG *FullScreenMode) {
1977 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1979 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, FullScreenMode);
1984 static HRESULT WINAPI Videowindow_put_FullScreenMode(IVideoWindow *iface,
1985 LONG FullScreenMode) {
1986 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
1988 FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, FullScreenMode);
1993 static HRESULT WINAPI Videowindow_SetWindowForeground(IVideoWindow *iface,
1995 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2000 TRACE("(%p/%p)->(%d)\n", This, iface, Focus);
2002 if ((Focus != FALSE) && (Focus != TRUE))
2003 return E_INVALIDARG;
2005 hr = IPin_ConnectedTo((IPin *)This->pInputPin, &pPin);
2006 if ((hr != S_OK) || !pPin)
2007 return VFW_E_NOT_CONNECTED;
2010 ret = SetForegroundWindow(This->hWnd);
2012 ret = SetWindowPos(This->hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
2020 static HRESULT WINAPI Videowindow_NotifyOwnerMessage(IVideoWindow *iface,
2025 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2027 TRACE("(%p/%p)->(%08lx, %d, %08lx, %08lx)\n", This, iface, hwnd, uMsg, wParam, lParam);
2029 if (!PostMessageA(This->hWnd, uMsg, wParam, lParam))
2035 static HRESULT WINAPI Videowindow_SetWindowPosition(IVideoWindow *iface,
2040 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2042 TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This, iface, Left, Top, Width, Height);
2044 if (!SetWindowPos(This->hWnd, NULL, Left, Top, Width, Height, SWP_NOZORDER))
2047 This->WindowPos.left = Left;
2048 This->WindowPos.top = Top;
2049 This->WindowPos.right = Left + Width;
2050 This->WindowPos.bottom = Top + Height;
2055 static HRESULT WINAPI Videowindow_GetWindowPosition(IVideoWindow *iface,
2060 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2062 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This, iface, pLeft, pTop, pWidth, pHeight);
2064 *pLeft = This->WindowPos.left;
2065 *pTop = This->WindowPos.top;
2066 *pWidth = This->WindowPos.right - This->WindowPos.left;
2067 *pHeight = This->WindowPos.bottom - This->WindowPos.top;
2072 static HRESULT WINAPI Videowindow_GetMinIdealImageSize(IVideoWindow *iface,
2075 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2077 FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This, iface, pWidth, pHeight);
2079 *pWidth = This->VideoWidth;
2080 *pHeight = This->VideoHeight;
2085 static HRESULT WINAPI Videowindow_GetMaxIdealImageSize(IVideoWindow *iface,
2088 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2090 FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This, iface, pWidth, pHeight);
2092 *pWidth = This->VideoWidth;
2093 *pHeight = This->VideoHeight;
2098 static HRESULT WINAPI Videowindow_GetRestorePosition(IVideoWindow *iface,
2103 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2105 FIXME("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This, iface, pLeft, pTop, pWidth, pHeight);
2110 static HRESULT WINAPI Videowindow_HideCursor(IVideoWindow *iface,
2112 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2114 FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, HideCursor);
2119 static HRESULT WINAPI Videowindow_IsCursorHidden(IVideoWindow *iface,
2120 LONG *CursorHidden) {
2121 ICOM_THIS_MULTI(VideoRendererImpl, IVideoWindow_vtbl, iface);
2123 FIXME("(%p/%p)->(%p): stub !!!\n", This, iface, CursorHidden);
2128 static const IVideoWindowVtbl IVideoWindow_VTable =
2130 Videowindow_QueryInterface,
2132 Videowindow_Release,
2133 Videowindow_GetTypeInfoCount,
2134 Videowindow_GetTypeInfo,
2135 Videowindow_GetIDsOfNames,
2137 Videowindow_put_Caption,
2138 Videowindow_get_Caption,
2139 Videowindow_put_WindowStyle,
2140 Videowindow_get_WindowStyle,
2141 Videowindow_put_WindowStyleEx,
2142 Videowindow_get_WindowStyleEx,
2143 Videowindow_put_AutoShow,
2144 Videowindow_get_AutoShow,
2145 Videowindow_put_WindowState,
2146 Videowindow_get_WindowState,
2147 Videowindow_put_BackgroundPalette,
2148 Videowindow_get_BackgroundPalette,
2149 Videowindow_put_Visible,
2150 Videowindow_get_Visible,
2151 Videowindow_put_Left,
2152 Videowindow_get_Left,
2153 Videowindow_put_Width,
2154 Videowindow_get_Width,
2155 Videowindow_put_Top,
2156 Videowindow_get_Top,
2157 Videowindow_put_Height,
2158 Videowindow_get_Height,
2159 Videowindow_put_Owner,
2160 Videowindow_get_Owner,
2161 Videowindow_put_MessageDrain,
2162 Videowindow_get_MessageDrain,
2163 Videowindow_get_BorderColor,
2164 Videowindow_put_BorderColor,
2165 Videowindow_get_FullScreenMode,
2166 Videowindow_put_FullScreenMode,
2167 Videowindow_SetWindowForeground,
2168 Videowindow_NotifyOwnerMessage,
2169 Videowindow_SetWindowPosition,
2170 Videowindow_GetWindowPosition,
2171 Videowindow_GetMinIdealImageSize,
2172 Videowindow_GetMaxIdealImageSize,
2173 Videowindow_GetRestorePosition,
2174 Videowindow_HideCursor,
2175 Videowindow_IsCursorHidden
2178 static VideoRendererImpl *from_IAMFilterMiscFlags(IAMFilterMiscFlags *iface) {
2179 return (VideoRendererImpl*)((char*)iface - offsetof(VideoRendererImpl, IAMFilterMiscFlags_vtbl));
2182 static HRESULT WINAPI AMFilterMiscFlags_QueryInterface(IAMFilterMiscFlags *iface, const REFIID riid, void **ppv) {
2183 VideoRendererImpl *This = from_IAMFilterMiscFlags(iface);
2184 return IUnknown_QueryInterface((IUnknown*)This, riid, ppv);
2187 static ULONG WINAPI AMFilterMiscFlags_AddRef(IAMFilterMiscFlags *iface) {
2188 VideoRendererImpl *This = from_IAMFilterMiscFlags(iface);
2189 return IUnknown_AddRef((IUnknown*)This);
2192 static ULONG WINAPI AMFilterMiscFlags_Release(IAMFilterMiscFlags *iface) {
2193 VideoRendererImpl *This = from_IAMFilterMiscFlags(iface);
2194 return IUnknown_Release((IUnknown*)This);
2197 static ULONG WINAPI AMFilterMiscFlags_GetMiscFlags(IAMFilterMiscFlags *iface) {
2198 return AM_FILTER_MISC_FLAGS_IS_RENDERER;
2201 static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl = {
2202 AMFilterMiscFlags_QueryInterface,
2203 AMFilterMiscFlags_AddRef,
2204 AMFilterMiscFlags_Release,
2205 AMFilterMiscFlags_GetMiscFlags