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"
40 #include "wine/unicode.h"
41 #include "wine/debug.h"
43 WINE_DEFAULT_DEBUG_CHANNEL(quartz
);
45 static const IBaseFilterVtbl VideoRenderer_Vtbl
;
46 static const IUnknownVtbl IInner_VTable
;
47 static const IBasicVideoVtbl IBasicVideo_VTable
;
48 static const IVideoWindowVtbl IVideoWindow_VTable
;
49 static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl
;
51 typedef struct VideoRendererImpl
53 BaseRenderer renderer
;
54 const IBasicVideoVtbl
* IBasicVideo_vtbl
;
55 const IVideoWindowVtbl
* IVideoWindow_vtbl
;
56 const IUnknownVtbl
* IInner_vtbl
;
57 const IAMFilterMiscFlagsVtbl
*IAMFilterMiscFlags_vtbl
;
62 BaseWindow baseWindow
;
66 /* hEvent == evComplete? */
82 static inline VideoRendererImpl
*impl_from_BaseWindow(BaseWindow
*iface
)
84 return CONTAINING_RECORD(iface
, VideoRendererImpl
, baseWindow
);
87 static inline VideoRendererImpl
*impl_from_BaseRenderer(BaseRenderer
*iface
)
89 return CONTAINING_RECORD(iface
, VideoRendererImpl
, renderer
);
92 static inline VideoRendererImpl
*impl_from_IBaseFilter(IBaseFilter
*iface
)
94 return CONTAINING_RECORD(iface
, VideoRendererImpl
, renderer
.filter
.IBaseFilter_iface
);
97 static DWORD WINAPI
MessageLoop(LPVOID lpParameter
)
99 VideoRendererImpl
* This
= lpParameter
;
103 TRACE("Starting message loop\n");
105 if (FAILED(BaseWindowImpl_PrepareWindow(&This
->baseWindow
)))
107 This
->ThreadResult
= FALSE
;
108 SetEvent(This
->hEvent
);
112 This
->ThreadResult
= TRUE
;
113 SetEvent(This
->hEvent
);
115 while ((fGotMessage
= GetMessageW(&msg
, NULL
, 0, 0)) != 0 && fGotMessage
!= -1)
117 TranslateMessage(&msg
);
118 DispatchMessageW(&msg
);
121 TRACE("End of message loop\n");
126 static BOOL
CreateRenderingSubsystem(VideoRendererImpl
* This
)
128 This
->hEvent
= CreateEventW(NULL
, TRUE
, FALSE
, NULL
);
132 This
->hThread
= CreateThread(NULL
, 0, MessageLoop
, This
, 0, &This
->ThreadID
);
135 CloseHandle(This
->hEvent
);
139 WaitForSingleObject(This
->hEvent
, INFINITE
);
141 if (!This
->ThreadResult
)
143 CloseHandle(This
->hEvent
);
144 CloseHandle(This
->hThread
);
151 static void VideoRenderer_AutoShowWindow(VideoRendererImpl
*This
) {
152 if (!This
->init
&& (!This
->WindowPos
.right
|| !This
->WindowPos
.top
))
154 DWORD style
= GetWindowLongW(This
->baseWindow
.hWnd
, GWL_STYLE
);
155 DWORD style_ex
= GetWindowLongW(This
->baseWindow
.hWnd
, GWL_EXSTYLE
);
157 if (!This
->WindowPos
.right
)
159 This
->WindowPos
.left
= This
->SourceRect
.left
;
160 This
->WindowPos
.right
= This
->SourceRect
.right
;
162 if (!This
->WindowPos
.bottom
)
164 This
->WindowPos
.top
= This
->SourceRect
.top
;
165 This
->WindowPos
.bottom
= This
->SourceRect
.bottom
;
168 AdjustWindowRectEx(&This
->WindowPos
, style
, TRUE
, style_ex
);
170 TRACE("WindowPos: %d %d %d %d\n", This
->WindowPos
.left
, This
->WindowPos
.top
, This
->WindowPos
.right
, This
->WindowPos
.bottom
);
171 SetWindowPos(This
->baseWindow
.hWnd
, NULL
,
172 This
->WindowPos
.left
,
174 This
->WindowPos
.right
- This
->WindowPos
.left
,
175 This
->WindowPos
.bottom
- This
->WindowPos
.top
,
176 SWP_NOZORDER
|SWP_NOMOVE
|SWP_DEFERERASE
);
178 GetClientRect(This
->baseWindow
.hWnd
, &This
->DestRect
);
180 else if (!This
->init
)
181 This
->DestRect
= This
->WindowPos
;
184 ShowWindow(This
->baseWindow
.hWnd
, SW_SHOW
);
187 static DWORD
VideoRenderer_SendSampleData(VideoRendererImpl
* This
, LPBYTE data
, DWORD size
)
192 BITMAPINFOHEADER
*bmiHeader
;
194 TRACE("(%p)->(%p, %d)\n", This
, data
, size
);
196 sdesc
.dwSize
= sizeof(sdesc
);
197 hr
= IPin_ConnectionMediaType(&This
->renderer
.pInputPin
->pin
.IPin_iface
, &amt
);
199 ERR("Unable to retrieve media type\n");
203 if (IsEqualIID(&amt
.formattype
, &FORMAT_VideoInfo
))
205 bmiHeader
= &((VIDEOINFOHEADER
*)amt
.pbFormat
)->bmiHeader
;
207 else if (IsEqualIID(&amt
.formattype
, &FORMAT_VideoInfo2
))
209 bmiHeader
= &((VIDEOINFOHEADER2
*)amt
.pbFormat
)->bmiHeader
;
213 FIXME("Unknown type %s\n", debugstr_guid(&amt
.subtype
));
214 return VFW_E_RUNTIME_ERROR
;
217 TRACE("biSize = %d\n", bmiHeader
->biSize
);
218 TRACE("biWidth = %d\n", bmiHeader
->biWidth
);
219 TRACE("biHeight = %d\n", bmiHeader
->biHeight
);
220 TRACE("biPlanes = %d\n", bmiHeader
->biPlanes
);
221 TRACE("biBitCount = %d\n", bmiHeader
->biBitCount
);
222 TRACE("biCompression = %s\n", debugstr_an((LPSTR
)&(bmiHeader
->biCompression
), 4));
223 TRACE("biSizeImage = %d\n", bmiHeader
->biSizeImage
);
225 if (!This
->baseWindow
.hDC
) {
226 ERR("Cannot get DC from window!\n");
230 TRACE("Src Rect: %d %d %d %d\n", This
->SourceRect
.left
, This
->SourceRect
.top
, This
->SourceRect
.right
, This
->SourceRect
.bottom
);
231 TRACE("Dst Rect: %d %d %d %d\n", This
->DestRect
.left
, This
->DestRect
.top
, This
->DestRect
.right
, This
->DestRect
.bottom
);
233 StretchDIBits(This
->baseWindow
.hDC
, This
->DestRect
.left
, This
->DestRect
.top
, This
->DestRect
.right
-This
->DestRect
.left
,
234 This
->DestRect
.bottom
- This
->DestRect
.top
, This
->SourceRect
.left
, This
->SourceRect
.top
,
235 This
->SourceRect
.right
- This
->SourceRect
.left
, This
->SourceRect
.bottom
- This
->SourceRect
.top
,
236 data
, (BITMAPINFO
*)bmiHeader
, DIB_RGB_COLORS
, SRCCOPY
);
241 HRESULT WINAPI
VideoRenderer_ShouldDrawSampleNow(BaseRenderer
*This
, IMediaSample
*pSample
, REFERENCE_TIME
*pStartTime
, REFERENCE_TIME
*pEndTime
)
243 /* Preroll means the sample isn't shown, this is used for key frames and things like that */
244 if (IMediaSample_IsPreroll(pSample
) == S_OK
)
249 static HRESULT WINAPI
VideoRenderer_DoRenderSample(BaseRenderer
* iface
, IMediaSample
* pSample
)
251 VideoRendererImpl
*This
= impl_from_BaseRenderer(iface
);
252 LPBYTE pbSrcStream
= NULL
;
253 LONG cbSrcStream
= 0;
256 TRACE("(%p)->(%p)\n", This
, pSample
);
258 hr
= IMediaSample_GetPointer(pSample
, &pbSrcStream
);
261 ERR("Cannot get pointer to sample data (%x)\n", hr
);
265 cbSrcStream
= IMediaSample_GetActualDataLength(pSample
);
267 TRACE("val %p %d\n", pbSrcStream
, cbSrcStream
);
269 #if 0 /* For debugging purpose */
272 for(i
= 0; i
< cbSrcStream
; i
++)
274 if ((i
!=0) && !(i
%16))
276 TRACE("%02x ", pbSrcStream
[i
]);
282 SetEvent(This
->hEvent
);
283 if (This
->renderer
.filter
.state
== State_Paused
)
285 VideoRenderer_SendSampleData(This
, pbSrcStream
, cbSrcStream
);
286 SetEvent(This
->hEvent
);
287 if (This
->renderer
.filter
.state
== State_Paused
)
292 if (This
->renderer
.filter
.state
== State_Stopped
)
294 return VFW_E_WRONG_STATE
;
297 VideoRenderer_SendSampleData(This
, pbSrcStream
, cbSrcStream
);
302 static HRESULT WINAPI
VideoRenderer_CheckMediaType(BaseRenderer
*iface
, const AM_MEDIA_TYPE
* pmt
)
304 VideoRendererImpl
*This
= impl_from_BaseRenderer(iface
);
306 if (!IsEqualIID(&pmt
->majortype
, &MEDIATYPE_Video
))
309 if (IsEqualIID(&pmt
->subtype
, &MEDIASUBTYPE_RGB32
) ||
310 IsEqualIID(&pmt
->subtype
, &MEDIASUBTYPE_RGB24
) ||
311 IsEqualIID(&pmt
->subtype
, &MEDIASUBTYPE_RGB565
) ||
312 IsEqualIID(&pmt
->subtype
, &MEDIASUBTYPE_RGB8
))
316 if (IsEqualIID(&pmt
->formattype
, &FORMAT_VideoInfo
))
318 VIDEOINFOHEADER
*format
= (VIDEOINFOHEADER
*)pmt
->pbFormat
;
319 This
->SourceRect
.left
= 0;
320 This
->SourceRect
.top
= 0;
321 This
->SourceRect
.right
= This
->VideoWidth
= format
->bmiHeader
.biWidth
;
322 height
= format
->bmiHeader
.biHeight
;
324 This
->SourceRect
.bottom
= This
->VideoHeight
= -height
;
326 This
->SourceRect
.bottom
= This
->VideoHeight
= height
;
328 else if (IsEqualIID(&pmt
->formattype
, &FORMAT_VideoInfo2
))
330 VIDEOINFOHEADER2
*format2
= (VIDEOINFOHEADER2
*)pmt
->pbFormat
;
332 This
->SourceRect
.left
= 0;
333 This
->SourceRect
.top
= 0;
334 This
->SourceRect
.right
= This
->VideoWidth
= format2
->bmiHeader
.biWidth
;
335 height
= format2
->bmiHeader
.biHeight
;
337 This
->SourceRect
.bottom
= This
->VideoHeight
= -height
;
339 This
->SourceRect
.bottom
= This
->VideoHeight
= height
;
343 WARN("Format type %s not supported\n", debugstr_guid(&pmt
->formattype
));
351 static HRESULT WINAPI
VideoRenderer_EndFlush(BaseRenderer
* iface
)
353 VideoRendererImpl
*This
= impl_from_BaseRenderer(iface
);
355 TRACE("(%p)->()\n", iface
);
357 if (This
->renderer
.pMediaSample
) {
358 ResetEvent(This
->hEvent
);
359 LeaveCriticalSection(iface
->pInputPin
->pin
.pCritSec
);
360 LeaveCriticalSection(&iface
->filter
.csFilter
);
361 LeaveCriticalSection(&iface
->csRenderLock
);
362 WaitForSingleObject(This
->hEvent
, INFINITE
);
363 EnterCriticalSection(&iface
->csRenderLock
);
364 EnterCriticalSection(&iface
->filter
.csFilter
);
365 EnterCriticalSection(iface
->pInputPin
->pin
.pCritSec
);
367 if (This
->renderer
.filter
.state
== State_Paused
) {
368 ResetEvent(This
->hEvent
);
371 return BaseRendererImpl_EndFlush(iface
);
374 static VOID WINAPI
VideoRenderer_OnStopStreaming(BaseRenderer
* iface
)
376 VideoRendererImpl
*This
= impl_from_BaseRenderer(iface
);
378 TRACE("(%p)->()\n", This
);
380 SetEvent(This
->hEvent
);
383 RedrawWindow(This
->baseWindow
.hWnd
, NULL
, NULL
, RDW_INVALIDATE
|RDW_ERASE
);
386 static VOID WINAPI
VideoRenderer_OnStartStreaming(BaseRenderer
* iface
)
388 VideoRendererImpl
*This
= impl_from_BaseRenderer(iface
);
390 TRACE("(%p)\n", This
);
392 if (This
->renderer
.pInputPin
->pin
.pConnectedTo
&& (This
->renderer
.filter
.state
== State_Stopped
|| !This
->renderer
.pInputPin
->end_of_stream
))
394 if (This
->renderer
.filter
.state
== State_Stopped
)
396 ResetEvent(This
->hEvent
);
397 VideoRenderer_AutoShowWindow(This
);
403 static LPWSTR WINAPI
VideoRenderer_GetClassWindowStyles(BaseWindow
*This
, DWORD
*pClassStyles
, DWORD
*pWindowStyles
, DWORD
*pWindowStylesEx
)
405 static const WCHAR classnameW
[] = { 'W','i','n','e',' ','A','c','t','i','v','e','M','o','v','i','e',' ','C','l','a','s','s',0 };
408 *pWindowStyles
= WS_SIZEBOX
;
409 *pWindowStylesEx
= 0;
411 return (LPWSTR
)classnameW
;
414 static BOOL WINAPI
VideoRenderer_PossiblyEatMessage(BaseWindow
*iface
, UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
416 VideoRendererImpl
*This
= impl_from_BaseWindow(iface
);
418 if (This
->hWndMsgDrain
)
424 case WM_LBUTTONDBLCLK
:
427 case WM_MBUTTONDBLCLK
:
430 case WM_MOUSEACTIVATE
:
432 case WM_NCLBUTTONDBLCLK
:
433 case WM_NCLBUTTONDOWN
:
435 case WM_NCMBUTTONDBLCLK
:
436 case WM_NCMBUTTONDOWN
:
439 case WM_NCRBUTTONDBLCLK
:
440 case WM_NCRBUTTONDOWN
:
442 case WM_RBUTTONDBLCLK
:
445 PostMessageW(This
->hWndMsgDrain
, uMsg
, wParam
, lParam
);
455 static BOOL WINAPI
VideoRenderer_OnSize(BaseWindow
*iface
, LONG Width
, LONG Height
)
457 VideoRendererImpl
*This
= impl_from_BaseWindow(iface
);
459 TRACE("WM_SIZE %d %d\n", Width
, Height
);
460 GetClientRect(iface
->hWnd
, &This
->DestRect
);
461 TRACE("WM_SIZING: DestRect=(%d,%d),(%d,%d)\n",
464 This
->DestRect
.right
- This
->DestRect
.left
,
465 This
->DestRect
.bottom
- This
->DestRect
.top
);
469 static const BaseRendererFuncTable BaseFuncTable
= {
470 VideoRenderer_CheckMediaType
,
471 VideoRenderer_DoRenderSample
,
476 VideoRenderer_OnStartStreaming
,
477 VideoRenderer_OnStopStreaming
,
481 VideoRenderer_ShouldDrawSampleNow
,
488 VideoRenderer_EndFlush
,
491 static const BaseWindowFuncTable renderer_BaseWindowFuncTable
= {
492 VideoRenderer_GetClassWindowStyles
,
495 VideoRenderer_PossiblyEatMessage
,
499 HRESULT
VideoRenderer_create(IUnknown
* pUnkOuter
, LPVOID
* ppv
)
502 VideoRendererImpl
* pVideoRenderer
;
504 TRACE("(%p, %p)\n", pUnkOuter
, ppv
);
508 pVideoRenderer
= CoTaskMemAlloc(sizeof(VideoRendererImpl
));
509 pVideoRenderer
->pUnkOuter
= pUnkOuter
;
510 pVideoRenderer
->bUnkOuterValid
= FALSE
;
511 pVideoRenderer
->bAggregatable
= FALSE
;
512 pVideoRenderer
->IInner_vtbl
= &IInner_VTable
;
513 pVideoRenderer
->IAMFilterMiscFlags_vtbl
= &IAMFilterMiscFlags_Vtbl
;
514 pVideoRenderer
->IBasicVideo_vtbl
= &IBasicVideo_VTable
;
515 pVideoRenderer
->IVideoWindow_vtbl
= &IVideoWindow_VTable
;
517 pVideoRenderer
->init
= 0;
518 pVideoRenderer
->AutoShow
= 1;
519 ZeroMemory(&pVideoRenderer
->SourceRect
, sizeof(RECT
));
520 ZeroMemory(&pVideoRenderer
->DestRect
, sizeof(RECT
));
521 ZeroMemory(&pVideoRenderer
->WindowPos
, sizeof(RECT
));
522 pVideoRenderer
->hWndMsgDrain
= pVideoRenderer
->hWndOwner
= NULL
;
523 pVideoRenderer
->WindowStyle
= WS_OVERLAPPED
;
525 hr
= BaseRenderer_Init(&pVideoRenderer
->renderer
, &VideoRenderer_Vtbl
, pUnkOuter
, &CLSID_VideoRenderer
, (DWORD_PTR
)(__FILE__
": VideoRendererImpl.csFilter"), &BaseFuncTable
);
530 *ppv
= pVideoRenderer
;
531 hr
= BaseWindow_Init(&pVideoRenderer
->baseWindow
, &renderer_BaseWindowFuncTable
);
535 if (!CreateRenderingSubsystem(pVideoRenderer
))
540 BaseRendererImpl_Release(&pVideoRenderer
->renderer
.filter
.IBaseFilter_iface
);
541 CoTaskMemFree(pVideoRenderer
);
545 HRESULT
VideoRendererDefault_create(IUnknown
* pUnkOuter
, LPVOID
* ppv
)
547 /* TODO: Attempt to use the VMR-7 renderer instead when possible */
548 return VideoRenderer_create(pUnkOuter
, ppv
);
551 static HRESULT WINAPI
VideoRendererInner_QueryInterface(IUnknown
* iface
, REFIID riid
, LPVOID
* ppv
)
553 ICOM_THIS_MULTI(VideoRendererImpl
, IInner_vtbl
, iface
);
554 TRACE("(%p/%p)->(%s, %p)\n", This
, iface
, qzdebugstr_guid(riid
), ppv
);
556 if (This
->bAggregatable
)
557 This
->bUnkOuterValid
= TRUE
;
561 if (IsEqualIID(riid
, &IID_IUnknown
))
562 *ppv
= &This
->IInner_vtbl
;
563 else if (IsEqualIID(riid
, &IID_IBasicVideo
))
564 *ppv
= &This
->IBasicVideo_vtbl
;
565 else if (IsEqualIID(riid
, &IID_IVideoWindow
))
566 *ppv
= &This
->IVideoWindow_vtbl
;
567 else if (IsEqualIID(riid
, &IID_IAMFilterMiscFlags
))
568 *ppv
= &This
->IAMFilterMiscFlags_vtbl
;
572 hr
= BaseRendererImpl_QueryInterface(&This
->renderer
.filter
.IBaseFilter_iface
, riid
, ppv
);
579 IUnknown_AddRef((IUnknown
*)(*ppv
));
583 if (!IsEqualIID(riid
, &IID_IPin
))
584 FIXME("No interface for %s!\n", qzdebugstr_guid(riid
));
586 return E_NOINTERFACE
;
589 static ULONG WINAPI
VideoRendererInner_AddRef(IUnknown
* iface
)
591 ICOM_THIS_MULTI(VideoRendererImpl
, IInner_vtbl
, iface
);
592 ULONG refCount
= BaseFilterImpl_AddRef(&This
->renderer
.filter
.IBaseFilter_iface
);
594 TRACE("(%p/%p)->() AddRef from %d\n", This
, iface
, refCount
- 1);
599 static ULONG WINAPI
VideoRendererInner_Release(IUnknown
* iface
)
601 ICOM_THIS_MULTI(VideoRendererImpl
, IInner_vtbl
, iface
);
602 ULONG refCount
= BaseRendererImpl_Release(&This
->renderer
.filter
.IBaseFilter_iface
);
604 TRACE("(%p/%p)->() Release from %d\n", This
, iface
, refCount
+ 1);
608 BaseWindowImpl_DoneWithWindow(&This
->baseWindow
);
609 PostThreadMessageW(This
->ThreadID
, WM_QUIT
, 0, 0);
610 WaitForSingleObject(This
->hThread
, INFINITE
);
611 CloseHandle(This
->hThread
);
612 CloseHandle(This
->hEvent
);
614 TRACE("Destroying Video Renderer\n");
623 static const IUnknownVtbl IInner_VTable
=
625 VideoRendererInner_QueryInterface
,
626 VideoRendererInner_AddRef
,
627 VideoRendererInner_Release
630 static HRESULT WINAPI
VideoRenderer_QueryInterface(IBaseFilter
* iface
, REFIID riid
, LPVOID
* ppv
)
632 VideoRendererImpl
*This
= impl_from_IBaseFilter(iface
);
634 if (This
->bAggregatable
)
635 This
->bUnkOuterValid
= TRUE
;
639 if (This
->bAggregatable
)
640 return IUnknown_QueryInterface(This
->pUnkOuter
, riid
, ppv
);
642 if (IsEqualIID(riid
, &IID_IUnknown
))
646 IUnknown_AddRef((IUnknown
*)&(This
->IInner_vtbl
));
647 hr
= IUnknown_QueryInterface((IUnknown
*)&(This
->IInner_vtbl
), riid
, ppv
);
648 IUnknown_Release((IUnknown
*)&(This
->IInner_vtbl
));
649 This
->bAggregatable
= TRUE
;
654 return E_NOINTERFACE
;
657 return IUnknown_QueryInterface((IUnknown
*)&(This
->IInner_vtbl
), riid
, ppv
);
660 static ULONG WINAPI
VideoRenderer_AddRef(IBaseFilter
* iface
)
662 VideoRendererImpl
*This
= impl_from_IBaseFilter(iface
);
664 if (This
->pUnkOuter
&& This
->bUnkOuterValid
)
665 return IUnknown_AddRef(This
->pUnkOuter
);
666 return IUnknown_AddRef((IUnknown
*)&(This
->IInner_vtbl
));
669 static ULONG WINAPI
VideoRenderer_Release(IBaseFilter
* iface
)
671 VideoRendererImpl
*This
= impl_from_IBaseFilter(iface
);
673 if (This
->pUnkOuter
&& This
->bUnkOuterValid
)
674 return IUnknown_Release(This
->pUnkOuter
);
675 return IUnknown_Release((IUnknown
*)&(This
->IInner_vtbl
));
678 /** IMediaFilter methods **/
680 static HRESULT WINAPI
VideoRenderer_Pause(IBaseFilter
* iface
)
682 VideoRendererImpl
*This
= impl_from_IBaseFilter(iface
);
684 TRACE("(%p/%p)->()\n", This
, iface
);
686 EnterCriticalSection(&This
->renderer
.csRenderLock
);
687 if (This
->renderer
.filter
.state
!= State_Paused
)
689 if (This
->renderer
.filter
.state
== State_Stopped
)
691 This
->renderer
.pInputPin
->end_of_stream
= 0;
692 ResetEvent(This
->hEvent
);
693 VideoRenderer_AutoShowWindow(This
);
696 ResetEvent(This
->renderer
.RenderEvent
);
697 This
->renderer
.filter
.state
= State_Paused
;
699 LeaveCriticalSection(&This
->renderer
.csRenderLock
);
704 static const IBaseFilterVtbl VideoRenderer_Vtbl
=
706 VideoRenderer_QueryInterface
,
707 VideoRenderer_AddRef
,
708 VideoRenderer_Release
,
709 BaseFilterImpl_GetClassID
,
710 BaseRendererImpl_Stop
,
712 BaseRendererImpl_Run
,
713 BaseRendererImpl_GetState
,
714 BaseRendererImpl_SetSyncSource
,
715 BaseFilterImpl_GetSyncSource
,
716 BaseFilterImpl_EnumPins
,
717 BaseRendererImpl_FindPin
,
718 BaseFilterImpl_QueryFilterInfo
,
719 BaseFilterImpl_JoinFilterGraph
,
720 BaseFilterImpl_QueryVendorInfo
723 /*** IUnknown methods ***/
724 static HRESULT WINAPI
Basicvideo_QueryInterface(IBasicVideo
*iface
,
727 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
729 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
731 return VideoRenderer_QueryInterface(&This
->renderer
.filter
.IBaseFilter_iface
, riid
, ppvObj
);
734 static ULONG WINAPI
Basicvideo_AddRef(IBasicVideo
*iface
) {
735 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
737 TRACE("(%p/%p)->()\n", This
, iface
);
739 return VideoRenderer_AddRef(&This
->renderer
.filter
.IBaseFilter_iface
);
742 static ULONG WINAPI
Basicvideo_Release(IBasicVideo
*iface
) {
743 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
745 TRACE("(%p/%p)->()\n", This
, iface
);
747 return VideoRenderer_Release(&This
->renderer
.filter
.IBaseFilter_iface
);
750 /*** IDispatch methods ***/
751 static HRESULT WINAPI
Basicvideo_GetTypeInfoCount(IBasicVideo
*iface
,
753 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
755 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
760 static HRESULT WINAPI
Basicvideo_GetTypeInfo(IBasicVideo
*iface
,
763 ITypeInfo
**ppTInfo
) {
764 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
766 FIXME("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
771 static HRESULT WINAPI
Basicvideo_GetIDsOfNames(IBasicVideo
*iface
,
777 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
779 FIXME("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
784 static HRESULT WINAPI
Basicvideo_Invoke(IBasicVideo
*iface
,
789 DISPPARAMS
*pDispParams
,
793 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
795 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
);
800 /*** IBasicVideo methods ***/
801 static HRESULT WINAPI
Basicvideo_get_AvgTimePerFrame(IBasicVideo
*iface
,
802 REFTIME
*pAvgTimePerFrame
) {
804 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
806 if (!This
->renderer
.pInputPin
->pin
.pConnectedTo
)
807 return VFW_E_NOT_CONNECTED
;
809 TRACE("(%p/%p)->(%p)\n", This
, iface
, pAvgTimePerFrame
);
811 pmt
= &This
->renderer
.pInputPin
->pin
.mtCurrent
;
812 if (IsEqualIID(&pmt
->formattype
, &FORMAT_VideoInfo
)) {
813 VIDEOINFOHEADER
*vih
= (VIDEOINFOHEADER
*)pmt
->pbFormat
;
814 *pAvgTimePerFrame
= vih
->AvgTimePerFrame
;
815 } else if (IsEqualIID(&pmt
->formattype
, &FORMAT_VideoInfo2
)) {
816 VIDEOINFOHEADER2
*vih
= (VIDEOINFOHEADER2
*)pmt
->pbFormat
;
817 *pAvgTimePerFrame
= vih
->AvgTimePerFrame
;
819 ERR("Unknown format type %s\n", qzdebugstr_guid(&pmt
->formattype
));
820 *pAvgTimePerFrame
= 0;
825 static HRESULT WINAPI
Basicvideo_get_BitRate(IBasicVideo
*iface
,
827 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
829 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pBitRate
);
834 static HRESULT WINAPI
Basicvideo_get_BitErrorRate(IBasicVideo
*iface
,
835 LONG
*pBitErrorRate
) {
836 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
838 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pBitErrorRate
);
843 static HRESULT WINAPI
Basicvideo_get_VideoWidth(IBasicVideo
*iface
,
845 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
847 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoWidth
);
849 *pVideoWidth
= This
->VideoWidth
;
854 static HRESULT WINAPI
Basicvideo_get_VideoHeight(IBasicVideo
*iface
,
855 LONG
*pVideoHeight
) {
856 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
858 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVideoHeight
);
860 *pVideoHeight
= This
->VideoHeight
;
865 static HRESULT WINAPI
Basicvideo_put_SourceLeft(IBasicVideo
*iface
,
867 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
869 TRACE("(%p/%p)->(%d)\n", This
, iface
, SourceLeft
);
871 This
->SourceRect
.left
= SourceLeft
;
876 static HRESULT WINAPI
Basicvideo_get_SourceLeft(IBasicVideo
*iface
,
878 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
880 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceLeft
);
882 *pSourceLeft
= This
->SourceRect
.left
;
887 static HRESULT WINAPI
Basicvideo_put_SourceWidth(IBasicVideo
*iface
,
889 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
891 TRACE("(%p/%p)->(%d)\n", This
, iface
, SourceWidth
);
893 This
->SourceRect
.right
= This
->SourceRect
.left
+ SourceWidth
;
898 static HRESULT WINAPI
Basicvideo_get_SourceWidth(IBasicVideo
*iface
,
899 LONG
*pSourceWidth
) {
900 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
902 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceWidth
);
904 *pSourceWidth
= This
->SourceRect
.right
- This
->SourceRect
.left
;
909 static HRESULT WINAPI
Basicvideo_put_SourceTop(IBasicVideo
*iface
,
911 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
913 TRACE("(%p/%p)->(%d)\n", This
, iface
, SourceTop
);
915 This
->SourceRect
.top
= SourceTop
;
920 static HRESULT WINAPI
Basicvideo_get_SourceTop(IBasicVideo
*iface
,
922 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
924 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceTop
);
926 *pSourceTop
= This
->SourceRect
.top
;
931 static HRESULT WINAPI
Basicvideo_put_SourceHeight(IBasicVideo
*iface
,
933 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
935 TRACE("(%p/%p)->(%d)\n", This
, iface
, SourceHeight
);
937 This
->SourceRect
.bottom
= This
->SourceRect
.top
+ SourceHeight
;
942 static HRESULT WINAPI
Basicvideo_get_SourceHeight(IBasicVideo
*iface
,
943 LONG
*pSourceHeight
) {
944 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
946 TRACE("(%p/%p)->(%p)\n", This
, iface
, pSourceHeight
);
948 *pSourceHeight
= This
->SourceRect
.bottom
- This
->SourceRect
.top
;
953 static HRESULT WINAPI
Basicvideo_put_DestinationLeft(IBasicVideo
*iface
,
954 LONG DestinationLeft
) {
955 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
957 TRACE("(%p/%p)->(%d)\n", This
, iface
, DestinationLeft
);
959 This
->DestRect
.left
= DestinationLeft
;
964 static HRESULT WINAPI
Basicvideo_get_DestinationLeft(IBasicVideo
*iface
,
965 LONG
*pDestinationLeft
) {
966 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
968 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationLeft
);
970 *pDestinationLeft
= This
->DestRect
.left
;
975 static HRESULT WINAPI
Basicvideo_put_DestinationWidth(IBasicVideo
*iface
,
976 LONG DestinationWidth
) {
977 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
979 TRACE("(%p/%p)->(%d)\n", This
, iface
, DestinationWidth
);
981 This
->DestRect
.right
= This
->DestRect
.left
+ DestinationWidth
;
986 static HRESULT WINAPI
Basicvideo_get_DestinationWidth(IBasicVideo
*iface
,
987 LONG
*pDestinationWidth
) {
988 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
990 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationWidth
);
992 *pDestinationWidth
= This
->DestRect
.right
- This
->DestRect
.left
;
997 static HRESULT WINAPI
Basicvideo_put_DestinationTop(IBasicVideo
*iface
,
998 LONG DestinationTop
) {
999 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1001 TRACE("(%p/%p)->(%d)\n", This
, iface
, DestinationTop
);
1003 This
->DestRect
.top
= DestinationTop
;
1008 static HRESULT WINAPI
Basicvideo_get_DestinationTop(IBasicVideo
*iface
,
1009 LONG
*pDestinationTop
) {
1010 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1012 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationTop
);
1014 *pDestinationTop
= This
->DestRect
.top
;
1019 static HRESULT WINAPI
Basicvideo_put_DestinationHeight(IBasicVideo
*iface
,
1020 LONG DestinationHeight
) {
1021 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1023 TRACE("(%p/%p)->(%d)\n", This
, iface
, DestinationHeight
);
1025 This
->DestRect
.right
= This
->DestRect
.left
+ DestinationHeight
;
1030 static HRESULT WINAPI
Basicvideo_get_DestinationHeight(IBasicVideo
*iface
,
1031 LONG
*pDestinationHeight
) {
1032 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1034 TRACE("(%p/%p)->(%p)\n", This
, iface
, pDestinationHeight
);
1036 *pDestinationHeight
= This
->DestRect
.right
- This
->DestRect
.left
;
1041 static HRESULT WINAPI
Basicvideo_SetSourcePosition(IBasicVideo
*iface
,
1046 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1048 TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This
, iface
, Left
, Top
, Width
, Height
);
1050 This
->SourceRect
.left
= Left
;
1051 This
->SourceRect
.top
= Top
;
1052 This
->SourceRect
.right
= Left
+ Width
;
1053 This
->SourceRect
.bottom
= Top
+ Height
;
1058 static HRESULT WINAPI
Basicvideo_GetSourcePosition(IBasicVideo
*iface
,
1063 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1065 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
1067 *pLeft
= This
->SourceRect
.left
;
1068 *pTop
= This
->SourceRect
.top
;
1069 *pWidth
= This
->SourceRect
.right
- This
->SourceRect
.left
;
1070 *pHeight
= This
->SourceRect
.bottom
- This
->SourceRect
.top
;
1075 static HRESULT WINAPI
Basicvideo_SetDefaultSourcePosition(IBasicVideo
*iface
) {
1076 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1078 TRACE("(%p/%p)->()\n", This
, iface
);
1080 This
->SourceRect
.left
= 0;
1081 This
->SourceRect
.top
= 0;
1082 This
->SourceRect
.right
= This
->VideoWidth
;
1083 This
->SourceRect
.bottom
= This
->VideoHeight
;
1088 static HRESULT WINAPI
Basicvideo_SetDestinationPosition(IBasicVideo
*iface
,
1093 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1095 TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This
, iface
, Left
, Top
, Width
, Height
);
1097 This
->DestRect
.left
= Left
;
1098 This
->DestRect
.top
= Top
;
1099 This
->DestRect
.right
= Left
+ Width
;
1100 This
->DestRect
.bottom
= Top
+ Height
;
1105 static HRESULT WINAPI
Basicvideo_GetDestinationPosition(IBasicVideo
*iface
,
1110 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1112 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
1114 *pLeft
= This
->DestRect
.left
;
1115 *pTop
= This
->DestRect
.top
;
1116 *pWidth
= This
->DestRect
.right
- This
->DestRect
.left
;
1117 *pHeight
= This
->DestRect
.bottom
- This
->DestRect
.top
;
1122 static HRESULT WINAPI
Basicvideo_SetDefaultDestinationPosition(IBasicVideo
*iface
) {
1123 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1126 TRACE("(%p/%p)->()\n", This
, iface
);
1128 if (!GetClientRect(This
->baseWindow
.hWnd
, &rect
))
1131 This
->SourceRect
.left
= 0;
1132 This
->SourceRect
.top
= 0;
1133 This
->SourceRect
.right
= rect
.right
;
1134 This
->SourceRect
.bottom
= rect
.bottom
;
1139 static HRESULT WINAPI
Basicvideo_GetVideoSize(IBasicVideo
*iface
,
1142 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1144 TRACE("(%p/%p)->(%p, %p)\n", This
, iface
, pWidth
, pHeight
);
1146 *pWidth
= This
->VideoWidth
;
1147 *pHeight
= This
->VideoHeight
;
1152 static HRESULT WINAPI
Basicvideo_GetVideoPaletteEntries(IBasicVideo
*iface
,
1157 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1159 TRACE("(%p/%p)->(%d, %d, %p, %p)\n", This
, iface
, StartIndex
, Entries
, pRetrieved
, pPalette
);
1163 return VFW_E_NO_PALETTE_AVAILABLE
;
1166 static HRESULT WINAPI
Basicvideo_GetCurrentImage(IBasicVideo
*iface
,
1169 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1170 BITMAPINFOHEADER
*bmiHeader
;
1172 AM_MEDIA_TYPE
*amt
= &This
->renderer
.pInputPin
->pin
.mtCurrent
;
1175 FIXME("(%p/%p)->(%p, %p): partial stub\n", This
, iface
, pBufferSize
, pDIBImage
);
1177 EnterCriticalSection(&This
->renderer
.filter
.csFilter
);
1179 if (!This
->renderer
.pMediaSample
)
1181 LeaveCriticalSection(&This
->renderer
.filter
.csFilter
);
1182 return (This
->renderer
.filter
.state
== State_Paused
? E_UNEXPECTED
: VFW_E_NOT_PAUSED
);
1185 if (IsEqualIID(&amt
->formattype
, &FORMAT_VideoInfo
))
1187 bmiHeader
= &((VIDEOINFOHEADER
*)amt
->pbFormat
)->bmiHeader
;
1189 else if (IsEqualIID(&amt
->formattype
, &FORMAT_VideoInfo2
))
1191 bmiHeader
= &((VIDEOINFOHEADER2
*)amt
->pbFormat
)->bmiHeader
;
1195 FIXME("Unknown type %s\n", debugstr_guid(&amt
->subtype
));
1196 LeaveCriticalSection(&This
->renderer
.filter
.csFilter
);
1197 return VFW_E_RUNTIME_ERROR
;
1200 needed_size
= bmiHeader
->biSize
;
1201 needed_size
+= IMediaSample_GetActualDataLength(This
->renderer
.pMediaSample
);
1205 *pBufferSize
= needed_size
;
1206 LeaveCriticalSection(&This
->renderer
.filter
.csFilter
);
1210 if (needed_size
< *pBufferSize
)
1212 ERR("Buffer too small %u/%u\n", needed_size
, *pBufferSize
);
1213 LeaveCriticalSection(&This
->renderer
.filter
.csFilter
);
1216 *pBufferSize
= needed_size
;
1218 memcpy(pDIBImage
, bmiHeader
, bmiHeader
->biSize
);
1219 IMediaSample_GetPointer(This
->renderer
.pMediaSample
, (BYTE
**)&ptr
);
1220 memcpy((char *)pDIBImage
+ bmiHeader
->biSize
, ptr
, IMediaSample_GetActualDataLength(This
->renderer
.pMediaSample
));
1222 LeaveCriticalSection(&This
->renderer
.filter
.csFilter
);
1227 static HRESULT WINAPI
Basicvideo_IsUsingDefaultSource(IBasicVideo
*iface
) {
1228 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1230 FIXME("(%p/%p)->(): stub !!!\n", This
, iface
);
1235 static HRESULT WINAPI
Basicvideo_IsUsingDefaultDestination(IBasicVideo
*iface
) {
1236 ICOM_THIS_MULTI(VideoRendererImpl
, IBasicVideo_vtbl
, iface
);
1238 FIXME("(%p/%p)->(): stub !!!\n", This
, iface
);
1244 static const IBasicVideoVtbl IBasicVideo_VTable
=
1246 Basicvideo_QueryInterface
,
1249 Basicvideo_GetTypeInfoCount
,
1250 Basicvideo_GetTypeInfo
,
1251 Basicvideo_GetIDsOfNames
,
1253 Basicvideo_get_AvgTimePerFrame
,
1254 Basicvideo_get_BitRate
,
1255 Basicvideo_get_BitErrorRate
,
1256 Basicvideo_get_VideoWidth
,
1257 Basicvideo_get_VideoHeight
,
1258 Basicvideo_put_SourceLeft
,
1259 Basicvideo_get_SourceLeft
,
1260 Basicvideo_put_SourceWidth
,
1261 Basicvideo_get_SourceWidth
,
1262 Basicvideo_put_SourceTop
,
1263 Basicvideo_get_SourceTop
,
1264 Basicvideo_put_SourceHeight
,
1265 Basicvideo_get_SourceHeight
,
1266 Basicvideo_put_DestinationLeft
,
1267 Basicvideo_get_DestinationLeft
,
1268 Basicvideo_put_DestinationWidth
,
1269 Basicvideo_get_DestinationWidth
,
1270 Basicvideo_put_DestinationTop
,
1271 Basicvideo_get_DestinationTop
,
1272 Basicvideo_put_DestinationHeight
,
1273 Basicvideo_get_DestinationHeight
,
1274 Basicvideo_SetSourcePosition
,
1275 Basicvideo_GetSourcePosition
,
1276 Basicvideo_SetDefaultSourcePosition
,
1277 Basicvideo_SetDestinationPosition
,
1278 Basicvideo_GetDestinationPosition
,
1279 Basicvideo_SetDefaultDestinationPosition
,
1280 Basicvideo_GetVideoSize
,
1281 Basicvideo_GetVideoPaletteEntries
,
1282 Basicvideo_GetCurrentImage
,
1283 Basicvideo_IsUsingDefaultSource
,
1284 Basicvideo_IsUsingDefaultDestination
1288 /*** IUnknown methods ***/
1289 static HRESULT WINAPI
Videowindow_QueryInterface(IVideoWindow
*iface
,
1292 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1294 TRACE("(%p/%p)->(%s (%p), %p)\n", This
, iface
, debugstr_guid(riid
), riid
, ppvObj
);
1296 return VideoRenderer_QueryInterface(&This
->renderer
.filter
.IBaseFilter_iface
, riid
, ppvObj
);
1299 static ULONG WINAPI
Videowindow_AddRef(IVideoWindow
*iface
) {
1300 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1302 TRACE("(%p/%p)->()\n", This
, iface
);
1304 return VideoRenderer_AddRef(&This
->renderer
.filter
.IBaseFilter_iface
);
1307 static ULONG WINAPI
Videowindow_Release(IVideoWindow
*iface
) {
1308 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1310 TRACE("(%p/%p)->()\n", This
, iface
);
1312 return VideoRenderer_Release(&This
->renderer
.filter
.IBaseFilter_iface
);
1315 /*** IDispatch methods ***/
1316 static HRESULT WINAPI
Videowindow_GetTypeInfoCount(IVideoWindow
*iface
,
1318 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1320 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pctinfo
);
1325 static HRESULT WINAPI
Videowindow_GetTypeInfo(IVideoWindow
*iface
,
1328 ITypeInfo
**ppTInfo
) {
1329 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1331 FIXME("(%p/%p)->(%d, %d, %p): stub !!!\n", This
, iface
, iTInfo
, lcid
, ppTInfo
);
1336 static HRESULT WINAPI
Videowindow_GetIDsOfNames(IVideoWindow
*iface
,
1342 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1344 FIXME("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This
, iface
, debugstr_guid(riid
), riid
, rgszNames
, cNames
, lcid
, rgDispId
);
1349 static HRESULT WINAPI
Videowindow_Invoke(IVideoWindow
*iface
,
1350 DISPID dispIdMember
,
1354 DISPPARAMS
*pDispParams
,
1356 EXCEPINFO
*pExepInfo
,
1358 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1360 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
);
1365 /*** IVideoWindow methods ***/
1366 static HRESULT WINAPI
Videowindow_put_Caption(IVideoWindow
*iface
,
1368 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1370 TRACE("(%p/%p)->(%s (%p))\n", This
, iface
, debugstr_w(strCaption
), strCaption
);
1372 if (!SetWindowTextW(This
->baseWindow
.hWnd
, strCaption
))
1378 static HRESULT WINAPI
Videowindow_get_Caption(IVideoWindow
*iface
,
1380 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1382 TRACE("(%p/%p)->(%p)\n", This
, iface
, strCaption
);
1384 GetWindowTextW(This
->baseWindow
.hWnd
, (LPWSTR
)strCaption
, 100);
1389 static HRESULT WINAPI
Videowindow_put_WindowStyle(IVideoWindow
*iface
,
1391 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1394 old
= GetWindowLongW(This
->baseWindow
.hWnd
, GWL_STYLE
);
1396 TRACE("(%p/%p)->(%x -> %x)\n", This
, iface
, old
, WindowStyle
);
1398 if (WindowStyle
& (WS_DISABLED
|WS_HSCROLL
|WS_ICONIC
|WS_MAXIMIZE
|WS_MINIMIZE
|WS_VSCROLL
))
1399 return E_INVALIDARG
;
1401 SetWindowLongW(This
->baseWindow
.hWnd
, GWL_STYLE
, WindowStyle
);
1402 SetWindowPos(This
->baseWindow
.hWnd
,0,0,0,0,0,SWP_FRAMECHANGED
|SWP_NOSIZE
|SWP_NOZORDER
);
1403 This
->WindowStyle
= WindowStyle
;
1408 static HRESULT WINAPI
Videowindow_get_WindowStyle(IVideoWindow
*iface
,
1409 LONG
*WindowStyle
) {
1410 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1412 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyle
);
1414 *WindowStyle
= This
->WindowStyle
;
1419 static HRESULT WINAPI
Videowindow_put_WindowStyleEx(IVideoWindow
*iface
,
1420 LONG WindowStyleEx
) {
1421 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1423 TRACE("(%p/%p)->(%d)\n", This
, iface
, WindowStyleEx
);
1425 if (!SetWindowLongW(This
->baseWindow
.hWnd
, GWL_EXSTYLE
, WindowStyleEx
))
1431 static HRESULT WINAPI
Videowindow_get_WindowStyleEx(IVideoWindow
*iface
,
1432 LONG
*WindowStyleEx
) {
1433 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1435 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowStyleEx
);
1437 *WindowStyleEx
= GetWindowLongW(This
->baseWindow
.hWnd
, GWL_EXSTYLE
);
1442 static HRESULT WINAPI
Videowindow_put_AutoShow(IVideoWindow
*iface
,
1444 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1446 TRACE("(%p/%p)->(%d)\n", This
, iface
, AutoShow
);
1448 This
->AutoShow
= AutoShow
;
1453 static HRESULT WINAPI
Videowindow_get_AutoShow(IVideoWindow
*iface
,
1455 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1457 TRACE("(%p/%p)->(%p)\n", This
, iface
, AutoShow
);
1459 *AutoShow
= This
->AutoShow
;
1464 static HRESULT WINAPI
Videowindow_put_WindowState(IVideoWindow
*iface
,
1466 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1468 TRACE("(%p/%p)->(%d)\n", This
, iface
, WindowState
);
1469 ShowWindow(This
->baseWindow
.hWnd
, WindowState
);
1473 static HRESULT WINAPI
Videowindow_get_WindowState(IVideoWindow
*iface
,
1474 LONG
*WindowState
) {
1475 WINDOWPLACEMENT place
;
1476 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1478 place
.length
= sizeof(place
);
1479 GetWindowPlacement(This
->baseWindow
.hWnd
, &place
);
1480 TRACE("(%p/%p)->(%p)\n", This
, iface
, WindowState
);
1481 *WindowState
= place
.showCmd
;
1486 static HRESULT WINAPI
Videowindow_put_BackgroundPalette(IVideoWindow
*iface
,
1487 LONG BackgroundPalette
) {
1488 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1490 FIXME("(%p/%p)->(%d): stub !!!\n", This
, iface
, BackgroundPalette
);
1495 static HRESULT WINAPI
Videowindow_get_BackgroundPalette(IVideoWindow
*iface
,
1496 LONG
*pBackgroundPalette
) {
1497 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1499 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, pBackgroundPalette
);
1504 static HRESULT WINAPI
Videowindow_put_Visible(IVideoWindow
*iface
,
1506 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1508 TRACE("(%p/%p)->(%d)\n", This
, iface
, Visible
);
1510 ShowWindow(This
->baseWindow
.hWnd
, Visible
? SW_SHOW
: SW_HIDE
);
1515 static HRESULT WINAPI
Videowindow_get_Visible(IVideoWindow
*iface
,
1517 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1519 TRACE("(%p/%p)->(%p)\n", This
, iface
, pVisible
);
1521 *pVisible
= IsWindowVisible(This
->baseWindow
.hWnd
);
1526 static HRESULT WINAPI
Videowindow_put_Left(IVideoWindow
*iface
,
1528 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1530 TRACE("(%p/%p)->(%d)\n", This
, iface
, Left
);
1532 if (!SetWindowPos(This
->baseWindow
.hWnd
, NULL
, Left
, This
->WindowPos
.top
, 0, 0, SWP_NOZORDER
|SWP_NOSIZE
))
1535 This
->WindowPos
.left
= Left
;
1540 static HRESULT WINAPI
Videowindow_get_Left(IVideoWindow
*iface
,
1542 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1544 TRACE("(%p/%p)->(%p)\n", This
, iface
, pLeft
);
1546 *pLeft
= This
->WindowPos
.left
;
1551 static HRESULT WINAPI
Videowindow_put_Width(IVideoWindow
*iface
,
1553 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1555 TRACE("(%p/%p)->(%d)\n", This
, iface
, Width
);
1557 if (!SetWindowPos(This
->baseWindow
.hWnd
, NULL
, 0, 0, Width
, This
->WindowPos
.bottom
-This
->WindowPos
.top
, SWP_NOZORDER
|SWP_NOMOVE
))
1560 This
->WindowPos
.right
= This
->WindowPos
.left
+ Width
;
1565 static HRESULT WINAPI
Videowindow_get_Width(IVideoWindow
*iface
,
1567 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1569 TRACE("(%p/%p)->(%p)\n", This
, iface
, pWidth
);
1571 *pWidth
= This
->WindowPos
.right
- This
->WindowPos
.left
;
1576 static HRESULT WINAPI
Videowindow_put_Top(IVideoWindow
*iface
,
1578 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1580 TRACE("(%p/%p)->(%d)\n", This
, iface
, Top
);
1582 if (!SetWindowPos(This
->baseWindow
.hWnd
, NULL
, This
->WindowPos
.left
, Top
, 0, 0, SWP_NOZORDER
|SWP_NOSIZE
))
1585 This
->WindowPos
.top
= Top
;
1590 static HRESULT WINAPI
Videowindow_get_Top(IVideoWindow
*iface
,
1592 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1594 TRACE("(%p/%p)->(%p)\n", This
, iface
, pTop
);
1596 *pTop
= This
->WindowPos
.top
;
1601 static HRESULT WINAPI
Videowindow_put_Height(IVideoWindow
*iface
,
1603 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1605 TRACE("(%p/%p)->(%d)\n", This
, iface
, Height
);
1607 if (!SetWindowPos(This
->baseWindow
.hWnd
, NULL
, 0, 0, This
->WindowPos
.right
-This
->WindowPos
.left
, Height
, SWP_NOZORDER
|SWP_NOMOVE
))
1610 This
->WindowPos
.bottom
= This
->WindowPos
.top
+ Height
;
1615 static HRESULT WINAPI
Videowindow_get_Height(IVideoWindow
*iface
,
1617 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1619 TRACE("(%p/%p)->(%p)\n", This
, iface
, pHeight
);
1621 *pHeight
= This
->WindowPos
.bottom
- This
->WindowPos
.top
;
1626 static HRESULT WINAPI
Videowindow_put_Owner(IVideoWindow
*iface
,
1628 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1630 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Owner
);
1632 This
->hWndOwner
= (HWND
)Owner
;
1633 SetParent(This
->baseWindow
.hWnd
, This
->hWndOwner
);
1634 if (This
->WindowStyle
& WS_CHILD
)
1636 LONG old
= GetWindowLongW(This
->baseWindow
.hWnd
, GWL_STYLE
);
1637 if (old
!= This
->WindowStyle
)
1639 SetWindowLongW(This
->baseWindow
.hWnd
, GWL_STYLE
, This
->WindowStyle
);
1640 SetWindowPos(This
->baseWindow
.hWnd
,0,0,0,0,0,SWP_FRAMECHANGED
|SWP_NOSIZE
|SWP_NOZORDER
);
1647 static HRESULT WINAPI
Videowindow_get_Owner(IVideoWindow
*iface
,
1649 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1651 TRACE("(%p/%p)->(%p)\n", This
, iface
, Owner
);
1653 *(HWND
*)Owner
= This
->hWndOwner
;
1658 static HRESULT WINAPI
Videowindow_put_MessageDrain(IVideoWindow
*iface
,
1660 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1662 TRACE("(%p/%p)->(%08x)\n", This
, iface
, (DWORD
) Drain
);
1664 This
->hWndMsgDrain
= (HWND
)Drain
;
1669 static HRESULT WINAPI
Videowindow_get_MessageDrain(IVideoWindow
*iface
,
1671 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1673 TRACE("(%p/%p)->(%p)\n", This
, iface
, Drain
);
1675 *Drain
= (OAHWND
)This
->hWndMsgDrain
;
1680 static HRESULT WINAPI
Videowindow_get_BorderColor(IVideoWindow
*iface
,
1682 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1684 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, Color
);
1689 static HRESULT WINAPI
Videowindow_put_BorderColor(IVideoWindow
*iface
,
1691 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1693 FIXME("(%p/%p)->(%d): stub !!!\n", This
, iface
, Color
);
1698 static HRESULT WINAPI
Videowindow_get_FullScreenMode(IVideoWindow
*iface
,
1699 LONG
*FullScreenMode
) {
1700 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1702 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, FullScreenMode
);
1707 static HRESULT WINAPI
Videowindow_put_FullScreenMode(IVideoWindow
*iface
,
1708 LONG FullScreenMode
) {
1709 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1711 FIXME("(%p/%p)->(%d): stub !!!\n", This
, iface
, FullScreenMode
);
1713 if (FullScreenMode
) {
1714 ShowWindow(This
->baseWindow
.hWnd
, SW_HIDE
);
1715 SetParent(This
->baseWindow
.hWnd
, 0);
1716 SetWindowLongW(This
->baseWindow
.hWnd
, GWL_STYLE
, WS_POPUP
);
1717 SetWindowPos(This
->baseWindow
.hWnd
,HWND_TOP
,0,0,GetSystemMetrics(SM_CXSCREEN
),GetSystemMetrics(SM_CYSCREEN
),SWP_SHOWWINDOW
);
1718 GetWindowRect(This
->baseWindow
.hWnd
, &This
->DestRect
);
1719 This
->WindowPos
= This
->DestRect
;
1721 ShowWindow(This
->baseWindow
.hWnd
, SW_HIDE
);
1722 SetParent(This
->baseWindow
.hWnd
, This
->hWndOwner
);
1723 SetWindowLongW(This
->baseWindow
.hWnd
, GWL_STYLE
, This
->WindowStyle
);
1724 GetClientRect(This
->baseWindow
.hWnd
, &This
->DestRect
);
1725 SetWindowPos(This
->baseWindow
.hWnd
,0,This
->DestRect
.left
,This
->DestRect
.top
,This
->DestRect
.right
,This
->DestRect
.bottom
,SWP_NOZORDER
|SWP_SHOWWINDOW
);
1726 This
->WindowPos
= This
->DestRect
;
1732 static HRESULT WINAPI
Videowindow_SetWindowForeground(IVideoWindow
*iface
,
1734 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1739 TRACE("(%p/%p)->(%d)\n", This
, iface
, Focus
);
1741 if ((Focus
!= FALSE
) && (Focus
!= TRUE
))
1742 return E_INVALIDARG
;
1744 hr
= IPin_ConnectedTo(&This
->renderer
.pInputPin
->pin
.IPin_iface
, &pPin
);
1745 if ((hr
!= S_OK
) || !pPin
)
1746 return VFW_E_NOT_CONNECTED
;
1749 ret
= SetForegroundWindow(This
->baseWindow
.hWnd
);
1751 ret
= SetWindowPos(This
->baseWindow
.hWnd
, HWND_TOP
, 0, 0, 0, 0, SWP_NOMOVE
|SWP_NOSIZE
);
1759 static HRESULT WINAPI
Videowindow_NotifyOwnerMessage(IVideoWindow
*iface
,
1764 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1766 TRACE("(%p/%p)->(%08lx, %d, %08lx, %08lx)\n", This
, iface
, hwnd
, uMsg
, wParam
, lParam
);
1768 if (!PostMessageW(This
->baseWindow
.hWnd
, uMsg
, wParam
, lParam
))
1774 static HRESULT WINAPI
Videowindow_SetWindowPosition(IVideoWindow
*iface
,
1779 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1781 TRACE("(%p/%p)->(%d, %d, %d, %d)\n", This
, iface
, Left
, Top
, Width
, Height
);
1783 if (!SetWindowPos(This
->baseWindow
.hWnd
, NULL
, Left
, Top
, Width
, Height
, SWP_NOZORDER
))
1786 This
->WindowPos
.left
= Left
;
1787 This
->WindowPos
.top
= Top
;
1788 This
->WindowPos
.right
= Left
+ Width
;
1789 This
->WindowPos
.bottom
= Top
+ Height
;
1794 static HRESULT WINAPI
Videowindow_GetWindowPosition(IVideoWindow
*iface
,
1799 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1801 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
1803 *pLeft
= This
->WindowPos
.left
;
1804 *pTop
= This
->WindowPos
.top
;
1805 *pWidth
= This
->WindowPos
.right
- This
->WindowPos
.left
;
1806 *pHeight
= This
->WindowPos
.bottom
- This
->WindowPos
.top
;
1811 static HRESULT WINAPI
Videowindow_GetMinIdealImageSize(IVideoWindow
*iface
,
1814 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1816 FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This
, iface
, pWidth
, pHeight
);
1818 *pWidth
= This
->VideoWidth
;
1819 *pHeight
= This
->VideoHeight
;
1824 static HRESULT WINAPI
Videowindow_GetMaxIdealImageSize(IVideoWindow
*iface
,
1827 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1829 FIXME("(%p/%p)->(%p, %p): semi stub !!!\n", This
, iface
, pWidth
, pHeight
);
1831 *pWidth
= This
->VideoWidth
;
1832 *pHeight
= This
->VideoHeight
;
1837 static HRESULT WINAPI
Videowindow_GetRestorePosition(IVideoWindow
*iface
,
1842 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1844 FIXME("(%p/%p)->(%p, %p, %p, %p): stub !!!\n", This
, iface
, pLeft
, pTop
, pWidth
, pHeight
);
1849 static HRESULT WINAPI
Videowindow_HideCursor(IVideoWindow
*iface
,
1851 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1853 FIXME("(%p/%p)->(%d): stub !!!\n", This
, iface
, HideCursor
);
1858 static HRESULT WINAPI
Videowindow_IsCursorHidden(IVideoWindow
*iface
,
1859 LONG
*CursorHidden
) {
1860 ICOM_THIS_MULTI(VideoRendererImpl
, IVideoWindow_vtbl
, iface
);
1862 FIXME("(%p/%p)->(%p): stub !!!\n", This
, iface
, CursorHidden
);
1867 static const IVideoWindowVtbl IVideoWindow_VTable
=
1869 Videowindow_QueryInterface
,
1871 Videowindow_Release
,
1872 Videowindow_GetTypeInfoCount
,
1873 Videowindow_GetTypeInfo
,
1874 Videowindow_GetIDsOfNames
,
1876 Videowindow_put_Caption
,
1877 Videowindow_get_Caption
,
1878 Videowindow_put_WindowStyle
,
1879 Videowindow_get_WindowStyle
,
1880 Videowindow_put_WindowStyleEx
,
1881 Videowindow_get_WindowStyleEx
,
1882 Videowindow_put_AutoShow
,
1883 Videowindow_get_AutoShow
,
1884 Videowindow_put_WindowState
,
1885 Videowindow_get_WindowState
,
1886 Videowindow_put_BackgroundPalette
,
1887 Videowindow_get_BackgroundPalette
,
1888 Videowindow_put_Visible
,
1889 Videowindow_get_Visible
,
1890 Videowindow_put_Left
,
1891 Videowindow_get_Left
,
1892 Videowindow_put_Width
,
1893 Videowindow_get_Width
,
1894 Videowindow_put_Top
,
1895 Videowindow_get_Top
,
1896 Videowindow_put_Height
,
1897 Videowindow_get_Height
,
1898 Videowindow_put_Owner
,
1899 Videowindow_get_Owner
,
1900 Videowindow_put_MessageDrain
,
1901 Videowindow_get_MessageDrain
,
1902 Videowindow_get_BorderColor
,
1903 Videowindow_put_BorderColor
,
1904 Videowindow_get_FullScreenMode
,
1905 Videowindow_put_FullScreenMode
,
1906 Videowindow_SetWindowForeground
,
1907 Videowindow_NotifyOwnerMessage
,
1908 Videowindow_SetWindowPosition
,
1909 Videowindow_GetWindowPosition
,
1910 Videowindow_GetMinIdealImageSize
,
1911 Videowindow_GetMaxIdealImageSize
,
1912 Videowindow_GetRestorePosition
,
1913 Videowindow_HideCursor
,
1914 Videowindow_IsCursorHidden
1917 static VideoRendererImpl
*from_IAMFilterMiscFlags(IAMFilterMiscFlags
*iface
) {
1918 return (VideoRendererImpl
*)((char*)iface
- offsetof(VideoRendererImpl
, IAMFilterMiscFlags_vtbl
));
1921 static HRESULT WINAPI
AMFilterMiscFlags_QueryInterface(IAMFilterMiscFlags
*iface
, REFIID riid
, void **ppv
) {
1922 VideoRendererImpl
*This
= from_IAMFilterMiscFlags(iface
);
1923 return IUnknown_QueryInterface((IUnknown
*)This
, riid
, ppv
);
1926 static ULONG WINAPI
AMFilterMiscFlags_AddRef(IAMFilterMiscFlags
*iface
) {
1927 VideoRendererImpl
*This
= from_IAMFilterMiscFlags(iface
);
1928 return IUnknown_AddRef((IUnknown
*)This
);
1931 static ULONG WINAPI
AMFilterMiscFlags_Release(IAMFilterMiscFlags
*iface
) {
1932 VideoRendererImpl
*This
= from_IAMFilterMiscFlags(iface
);
1933 return IUnknown_Release((IUnknown
*)This
);
1936 static ULONG WINAPI
AMFilterMiscFlags_GetMiscFlags(IAMFilterMiscFlags
*iface
) {
1937 return AM_FILTER_MISC_FLAGS_IS_RENDERER
;
1940 static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl
= {
1941 AMFilterMiscFlags_QueryInterface
,
1942 AMFilterMiscFlags_AddRef
,
1943 AMFilterMiscFlags_Release
,
1944 AMFilterMiscFlags_GetMiscFlags