ReactOS 0.4.15-dev-7788-g1ad9096
videorenderer.c File Reference
#include "config.h"
#include "quartz_private.h"
#include "pin.h"
#include "uuids.h"
#include "vfwmsgs.h"
#include "amvideo.h"
#include "windef.h"
#include "winbase.h"
#include "dshow.h"
#include "evcode.h"
#include "strmif.h"
#include "ddraw.h"
#include "dvdmedia.h"
#include <assert.h>
#include "wine/unicode.h"
#include "wine/debug.h"
Include dependency graph for videorenderer.c:

Go to the source code of this file.

Classes

struct  VideoRendererImpl
 

Typedefs

typedef struct VideoRendererImpl VideoRendererImpl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (quartz)
 
static VideoRendererImplimpl_from_BaseWindow (BaseWindow *iface)
 
static VideoRendererImplimpl_from_BaseRenderer (BaseRenderer *iface)
 
static VideoRendererImplimpl_from_IBaseFilter (IBaseFilter *iface)
 
static VideoRendererImplimpl_from_IVideoWindow (IVideoWindow *iface)
 
static VideoRendererImplimpl_from_BaseControlVideo (BaseControlVideo *iface)
 
static VideoRendererImplimpl_from_IBasicVideo (IBasicVideo *iface)
 
static DWORD WINAPI MessageLoop (LPVOID lpParameter)
 
static BOOL CreateRenderingSubsystem (VideoRendererImpl *This)
 
static void VideoRenderer_AutoShowWindow (VideoRendererImpl *This)
 
static DWORD VideoRenderer_SendSampleData (VideoRendererImpl *This, LPBYTE data, DWORD size)
 
static HRESULT WINAPI VideoRenderer_ShouldDrawSampleNow (BaseRenderer *This, IMediaSample *pSample, REFERENCE_TIME *pStartTime, REFERENCE_TIME *pEndTime)
 
static HRESULT WINAPI VideoRenderer_DoRenderSample (BaseRenderer *iface, IMediaSample *pSample)
 
static HRESULT WINAPI VideoRenderer_CheckMediaType (BaseRenderer *iface, const AM_MEDIA_TYPE *pmt)
 
static HRESULT WINAPI VideoRenderer_EndFlush (BaseRenderer *iface)
 
static VOID WINAPI VideoRenderer_OnStopStreaming (BaseRenderer *iface)
 
static VOID WINAPI VideoRenderer_OnStartStreaming (BaseRenderer *iface)
 
static LPWSTR WINAPI VideoRenderer_GetClassWindowStyles (BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx)
 
static RECT WINAPI VideoRenderer_GetDefaultRect (BaseWindow *iface)
 
static BOOL WINAPI VideoRenderer_OnSize (BaseWindow *iface, LONG Width, LONG Height)
 
static HRESULT WINAPI VideoRenderer_GetSourceRect (BaseControlVideo *iface, RECT *pSourceRect)
 
static HRESULT WINAPI VideoRenderer_GetStaticImage (BaseControlVideo *iface, LONG *pBufferSize, LONG *pDIBImage)
 
static HRESULT WINAPI VideoRenderer_GetTargetRect (BaseControlVideo *iface, RECT *pTargetRect)
 
static VIDEOINFOHEADER *WINAPI VideoRenderer_GetVideoFormat (BaseControlVideo *iface)
 
static HRESULT WINAPI VideoRenderer_IsDefaultSourceRect (BaseControlVideo *iface)
 
static HRESULT WINAPI VideoRenderer_IsDefaultTargetRect (BaseControlVideo *iface)
 
static HRESULT WINAPI VideoRenderer_SetDefaultSourceRect (BaseControlVideo *iface)
 
static HRESULT WINAPI VideoRenderer_SetDefaultTargetRect (BaseControlVideo *iface)
 
static HRESULT WINAPI VideoRenderer_SetSourceRect (BaseControlVideo *iface, RECT *pSourceRect)
 
static HRESULT WINAPI VideoRenderer_SetTargetRect (BaseControlVideo *iface, RECT *pTargetRect)
 
static VideoRendererImplimpl_from_IUnknown (IUnknown *iface)
 
static HRESULT WINAPI VideoRendererInner_QueryInterface (IUnknown *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI VideoRendererInner_AddRef (IUnknown *iface)
 
static ULONG WINAPI VideoRendererInner_Release (IUnknown *iface)
 
static HRESULT WINAPI VideoRenderer_QueryInterface (IBaseFilter *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI VideoRenderer_AddRef (IBaseFilter *iface)
 
static ULONG WINAPI VideoRenderer_Release (IBaseFilter *iface)
 
static HRESULT WINAPI VideoRenderer_Pause (IBaseFilter *iface)
 
static HRESULT WINAPI BasicVideo_QueryInterface (IBasicVideo *iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI BasicVideo_AddRef (IBasicVideo *iface)
 
static ULONG WINAPI BasicVideo_Release (IBasicVideo *iface)
 
static HRESULT WINAPI VideoWindow_QueryInterface (IVideoWindow *iface, REFIID riid, LPVOID *ppvObj)
 
static ULONG WINAPI VideoWindow_AddRef (IVideoWindow *iface)
 
static ULONG WINAPI VideoWindow_Release (IVideoWindow *iface)
 
static HRESULT WINAPI VideoWindow_get_FullScreenMode (IVideoWindow *iface, LONG *FullScreenMode)
 
static HRESULT WINAPI VideoWindow_put_FullScreenMode (IVideoWindow *iface, LONG FullScreenMode)
 
static VideoRendererImplimpl_from_IAMFilterMiscFlags (IAMFilterMiscFlags *iface)
 
static HRESULT WINAPI AMFilterMiscFlags_QueryInterface (IAMFilterMiscFlags *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI AMFilterMiscFlags_AddRef (IAMFilterMiscFlags *iface)
 
static ULONG WINAPI AMFilterMiscFlags_Release (IAMFilterMiscFlags *iface)
 
static ULONG WINAPI AMFilterMiscFlags_GetMiscFlags (IAMFilterMiscFlags *iface)
 
HRESULT VideoRenderer_create (IUnknown *pUnkOuter, void **ppv)
 
HRESULT VideoRendererDefault_create (IUnknown *pUnkOuter, LPVOID *ppv)
 

Variables

static const BaseRendererFuncTable BaseFuncTable
 
static const BaseWindowFuncTable renderer_BaseWindowFuncTable
 
static const BaseControlVideoFuncTable renderer_BaseControlVideoFuncTable
 
static const IUnknownVtbl IInner_VTable
 
static const IBaseFilterVtbl VideoRenderer_Vtbl
 
static const IBasicVideoVtbl IBasicVideo_VTable
 
static const IVideoWindowVtbl IVideoWindow_VTable
 
static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl
 

Typedef Documentation

◆ VideoRendererImpl

Function Documentation

◆ AMFilterMiscFlags_AddRef()

static ULONG WINAPI AMFilterMiscFlags_AddRef ( IAMFilterMiscFlags iface)
static

Definition at line 994 of file videorenderer.c.

995{
997 return IUnknown_AddRef(This->outer_unk);
998}
static VideoRendererImpl * impl_from_IAMFilterMiscFlags(IAMFilterMiscFlags *iface)

◆ AMFilterMiscFlags_GetMiscFlags()

static ULONG WINAPI AMFilterMiscFlags_GetMiscFlags ( IAMFilterMiscFlags iface)
static

Definition at line 1006 of file videorenderer.c.

1007{
1009}
@ AM_FILTER_MISC_FLAGS_IS_RENDERER
Definition: axextend.idl:1239

◆ AMFilterMiscFlags_QueryInterface()

static HRESULT WINAPI AMFilterMiscFlags_QueryInterface ( IAMFilterMiscFlags iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 987 of file videorenderer.c.

989{
991 return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
992}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39

◆ AMFilterMiscFlags_Release()

static ULONG WINAPI AMFilterMiscFlags_Release ( IAMFilterMiscFlags iface)
static

Definition at line 1000 of file videorenderer.c.

1001{
1003 return IUnknown_Release(This->outer_unk);
1004}

◆ BasicVideo_AddRef()

static ULONG WINAPI BasicVideo_AddRef ( IBasicVideo *  iface)
static

Definition at line 799 of file videorenderer.c.

800{
802
803 TRACE("(%p/%p)->()\n", This, iface);
804
805 return IUnknown_AddRef(This->outer_unk);
806}
static VideoRendererImpl * impl_from_IBasicVideo(IBasicVideo *iface)
Definition: videorenderer.c:93
#define TRACE(s)
Definition: solgame.cpp:4

◆ BasicVideo_QueryInterface()

static HRESULT WINAPI BasicVideo_QueryInterface ( IBasicVideo *  iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 790 of file videorenderer.c.

791{
793
794 TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj);
795
796 return IUnknown_QueryInterface(This->outer_unk, riid, ppvObj);
797}
#define debugstr_guid
Definition: kernel32.h:35

◆ BasicVideo_Release()

static ULONG WINAPI BasicVideo_Release ( IBasicVideo *  iface)
static

Definition at line 808 of file videorenderer.c.

809{
811
812 TRACE("(%p/%p)->()\n", This, iface);
813
814 return IUnknown_Release(This->outer_unk);
815}

◆ CreateRenderingSubsystem()

static BOOL CreateRenderingSubsystem ( VideoRendererImpl This)
static

Definition at line 127 of file videorenderer.c.

128{
129 This->hEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
130 if (!This->hEvent)
131 return FALSE;
132
133 This->hThread = CreateThread(NULL, 0, MessageLoop, This, 0, &This->ThreadID);
134 if (!This->hThread)
135 {
136 CloseHandle(This->hEvent);
137 return FALSE;
138 }
139
141
142 if (!This->ThreadResult)
143 {
144 CloseHandle(This->hEvent);
145 CloseHandle(This->hThread);
146 return FALSE;
147 }
148
149 return TRUE;
150}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static DWORD WINAPI MessageLoop(LPVOID lpParameter)
Definition: videorenderer.c:98
#define CloseHandle
Definition: compat.h:739
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition: thread.c:137
#define INFINITE
Definition: serial.h:102
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651

Referenced by VideoRenderer_create().

◆ impl_from_BaseControlVideo()

◆ impl_from_BaseRenderer()

static VideoRendererImpl * impl_from_BaseRenderer ( BaseRenderer iface)
inlinestatic

◆ impl_from_BaseWindow()

static VideoRendererImpl * impl_from_BaseWindow ( BaseWindow iface)
inlinestatic

Definition at line 68 of file videorenderer.c.

69{
70 return CONTAINING_RECORD(iface, VideoRendererImpl, baseControlWindow.baseWindow);
71}

Referenced by VideoRenderer_GetDefaultRect(), and VideoRenderer_OnSize().

◆ impl_from_IAMFilterMiscFlags()

static VideoRendererImpl * impl_from_IAMFilterMiscFlags ( IAMFilterMiscFlags iface)
static

Definition at line 982 of file videorenderer.c.

983{
984 return CONTAINING_RECORD(iface, VideoRendererImpl, IAMFilterMiscFlags_iface);
985}

Referenced by AMFilterMiscFlags_AddRef(), AMFilterMiscFlags_QueryInterface(), and AMFilterMiscFlags_Release().

◆ impl_from_IBaseFilter()

static VideoRendererImpl * impl_from_IBaseFilter ( IBaseFilter iface)
inlinestatic

Definition at line 78 of file videorenderer.c.

79{
80 return CONTAINING_RECORD(iface, VideoRendererImpl, renderer.filter.IBaseFilter_iface);
81}

Referenced by VideoRenderer_AddRef(), VideoRenderer_Pause(), VideoRenderer_QueryInterface(), and VideoRenderer_Release().

◆ impl_from_IBasicVideo()

static VideoRendererImpl * impl_from_IBasicVideo ( IBasicVideo *  iface)
inlinestatic

Definition at line 93 of file videorenderer.c.

94{
95 return CONTAINING_RECORD(iface, VideoRendererImpl, baseControlVideo.IBasicVideo_iface);
96}

Referenced by BasicVideo_AddRef(), BasicVideo_QueryInterface(), and BasicVideo_Release().

◆ impl_from_IUnknown()

static VideoRendererImpl * impl_from_IUnknown ( IUnknown iface)
inlinestatic

Definition at line 643 of file videorenderer.c.

644{
645 return CONTAINING_RECORD(iface, VideoRendererImpl, IUnknown_inner);
646}

Referenced by VideoRendererInner_AddRef(), VideoRendererInner_QueryInterface(), and VideoRendererInner_Release().

◆ impl_from_IVideoWindow()

static VideoRendererImpl * impl_from_IVideoWindow ( IVideoWindow *  iface)
inlinestatic

Definition at line 83 of file videorenderer.c.

84{
85 return CONTAINING_RECORD(iface, VideoRendererImpl, baseControlWindow.IVideoWindow_iface);
86}

Referenced by VideoWindow_AddRef(), VideoWindow_get_FullScreenMode(), VideoWindow_put_FullScreenMode(), VideoWindow_QueryInterface(), and VideoWindow_Release().

◆ MessageLoop()

static DWORD WINAPI MessageLoop ( LPVOID  lpParameter)
static

Definition at line 98 of file videorenderer.c.

99{
100 VideoRendererImpl* This = lpParameter;
101 MSG msg;
102 BOOL fGotMessage;
103
104 TRACE("Starting message loop\n");
105
106 if (FAILED(BaseWindowImpl_PrepareWindow(&This->baseControlWindow.baseWindow)))
107 {
108 This->ThreadResult = FALSE;
109 SetEvent(This->hEvent);
110 return 0;
111 }
112
113 This->ThreadResult = TRUE;
114 SetEvent(This->hEvent);
115
116 while ((fGotMessage = GetMessageW(&msg, NULL, 0, 0)) != 0 && fGotMessage != -1)
117 {
120 }
121
122 TRACE("End of message loop\n");
123
124 return msg.wParam;
125}
#define msg(x)
Definition: auth_time.c:54
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FAILED(hr)
Definition: intsafe.h:51
HRESULT WINAPI BaseWindowImpl_PrepareWindow(BaseWindow *This)
Definition: window.c:100
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition: synch.c:733
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)

Referenced by CreateRenderingSubsystem().

◆ VideoRenderer_AddRef()

static ULONG WINAPI VideoRenderer_AddRef ( IBaseFilter iface)
static

Definition at line 732 of file videorenderer.c.

733{
735 return IUnknown_AddRef(This->outer_unk);
736}
static VideoRendererImpl * impl_from_IBaseFilter(IBaseFilter *iface)
Definition: videorenderer.c:78

◆ VideoRenderer_AutoShowWindow()

static void VideoRenderer_AutoShowWindow ( VideoRendererImpl This)
static

Definition at line 152 of file videorenderer.c.

153{
154 if (!This->init && (!This->WindowPos.right || !This->WindowPos.top))
155 {
156 DWORD style = GetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE);
157 DWORD style_ex = GetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_EXSTYLE);
158
159 if (!This->WindowPos.right)
160 {
161 if (This->DestRect.right)
162 {
163 This->WindowPos.left = This->DestRect.left;
164 This->WindowPos.right = This->DestRect.right;
165 }
166 else
167 {
168 This->WindowPos.left = This->SourceRect.left;
169 This->WindowPos.right = This->SourceRect.right;
170 }
171 }
172 if (!This->WindowPos.bottom)
173 {
174 if (This->DestRect.bottom)
175 {
176 This->WindowPos.top = This->DestRect.top;
177 This->WindowPos.bottom = This->DestRect.bottom;
178 }
179 else
180 {
181 This->WindowPos.top = This->SourceRect.top;
182 This->WindowPos.bottom = This->SourceRect.bottom;
183 }
184 }
185
186 AdjustWindowRectEx(&This->WindowPos, style, FALSE, style_ex);
187
188 TRACE("WindowPos: %s\n", wine_dbgstr_rect(&This->WindowPos));
189 SetWindowPos(This->baseControlWindow.baseWindow.hWnd, NULL,
190 This->WindowPos.left,
191 This->WindowPos.top,
192 This->WindowPos.right - This->WindowPos.left,
193 This->WindowPos.bottom - This->WindowPos.top,
195
196 GetClientRect(This->baseControlWindow.baseWindow.hWnd, &This->DestRect);
197 }
198 else if (!This->init)
199 This->DestRect = This->WindowPos;
200 This->init = TRUE;
201 if (This->baseControlWindow.AutoShow)
202 ShowWindow(This->baseControlWindow.baseWindow.hWnd, SW_SHOW);
203}
Arabic default style
Definition: afstyles.h:94
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
unsigned long DWORD
Definition: ntddk_ex.h:95
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define SWP_NOMOVE
Definition: winuser.h:1244
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
#define SWP_DEFERERASE
Definition: winuser.h:1252
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SW_SHOW
Definition: winuser.h:775
#define SWP_NOZORDER
Definition: winuser.h:1247
#define GWL_STYLE
Definition: winuser.h:852
#define GWL_EXSTYLE
Definition: winuser.h:851

Referenced by VideoRenderer_OnStartStreaming(), and VideoRenderer_Pause().

◆ VideoRenderer_CheckMediaType()

static HRESULT WINAPI VideoRenderer_CheckMediaType ( BaseRenderer iface,
const AM_MEDIA_TYPE pmt 
)
static

Definition at line 318 of file videorenderer.c.

319{
321
322 if (!IsEqualIID(&pmt->majortype, &MEDIATYPE_Video))
323 return S_FALSE;
324
325 if (IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB32) ||
326 IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB24) ||
327 IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB565) ||
328 IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_RGB8))
329 {
330 LONG height;
331
332 if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo))
333 {
334 VIDEOINFOHEADER *format = (VIDEOINFOHEADER *)pmt->pbFormat;
335 This->SourceRect.left = 0;
336 This->SourceRect.top = 0;
337 This->SourceRect.right = This->VideoWidth = format->bmiHeader.biWidth;
338 height = format->bmiHeader.biHeight;
339 if (height < 0)
340 This->SourceRect.bottom = This->VideoHeight = -height;
341 else
342 This->SourceRect.bottom = This->VideoHeight = height;
343 }
344 else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2))
345 {
346 VIDEOINFOHEADER2 *format2 = (VIDEOINFOHEADER2 *)pmt->pbFormat;
347
348 This->SourceRect.left = 0;
349 This->SourceRect.top = 0;
350 This->SourceRect.right = This->VideoWidth = format2->bmiHeader.biWidth;
351 height = format2->bmiHeader.biHeight;
352 if (height < 0)
353 This->SourceRect.bottom = This->VideoHeight = -height;
354 else
355 This->SourceRect.bottom = This->VideoHeight = height;
356 }
357 else
358 {
359 WARN("Format type %s not supported\n", debugstr_guid(&pmt->formattype));
360 return S_FALSE;
361 }
362 return S_OK;
363 }
364 return S_FALSE;
365}
#define WARN(fmt,...)
Definition: debug.h:112
static VideoRendererImpl * impl_from_BaseRenderer(BaseRenderer *iface)
Definition: videorenderer.c:73
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
#define S_OK
Definition: intsafe.h:52
if(dx< 0)
Definition: linetemp.h:194
long LONG
Definition: pedump.c:60
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
BITMAPINFOHEADER bmiHeader
Definition: dvdmedia.h:41
#define S_FALSE
Definition: winerror.h:2357

◆ VideoRenderer_create()

HRESULT VideoRenderer_create ( IUnknown pUnkOuter,
void **  ppv 
)

Definition at line 1018 of file videorenderer.c.

1019{
1020 HRESULT hr;
1022
1023 TRACE("(%p, %p)\n", pUnkOuter, ppv);
1024
1025 *ppv = NULL;
1026
1028 pVideoRenderer->IUnknown_inner.lpVtbl = &IInner_VTable;
1029 pVideoRenderer->IAMFilterMiscFlags_iface.lpVtbl = &IAMFilterMiscFlags_Vtbl;
1030
1031 pVideoRenderer->init = FALSE;
1032 ZeroMemory(&pVideoRenderer->SourceRect, sizeof(RECT));
1033 ZeroMemory(&pVideoRenderer->DestRect, sizeof(RECT));
1034 ZeroMemory(&pVideoRenderer->WindowPos, sizeof(RECT));
1035 pVideoRenderer->FullScreenMode = OAFALSE;
1036
1037 if (pUnkOuter)
1038 pVideoRenderer->outer_unk = pUnkOuter;
1039 else
1040 pVideoRenderer->outer_unk = &pVideoRenderer->IUnknown_inner;
1041
1042 hr = BaseRenderer_Init(&pVideoRenderer->renderer, &VideoRenderer_Vtbl, pUnkOuter,
1043 &CLSID_VideoRenderer, (DWORD_PTR)(__FILE__ ": VideoRendererImpl.csFilter"),
1044 &BaseFuncTable);
1045
1046 if (FAILED(hr))
1047 goto fail;
1048
1050 &pVideoRenderer->renderer.filter, &pVideoRenderer->renderer.filter.csFilter,
1051 &pVideoRenderer->renderer.pInputPin->pin, &renderer_BaseWindowFuncTable);
1052 if (FAILED(hr))
1053 goto fail;
1054
1056 &pVideoRenderer->renderer.filter, &pVideoRenderer->renderer.filter.csFilter,
1057 &pVideoRenderer->renderer.pInputPin->pin, &renderer_BaseControlVideoFuncTable);
1058 if (FAILED(hr))
1059 goto fail;
1060
1062 hr = E_FAIL;
1063 goto fail;
1064 }
1065
1066 *ppv = &pVideoRenderer->IUnknown_inner;
1067 return S_OK;
1068
1069fail:
1070 BaseRendererImpl_Release(&pVideoRenderer->renderer.filter.IBaseFilter_iface);
1072 return hr;
1073}
#define E_FAIL
Definition: ddrawi.h:102
static const BaseControlVideoFuncTable renderer_BaseControlVideoFuncTable
static const BaseWindowFuncTable renderer_BaseWindowFuncTable
static const IBaseFilterVtbl VideoRenderer_Vtbl
static const BaseRendererFuncTable BaseFuncTable
static const IBasicVideoVtbl IBasicVideo_VTable
static BOOL CreateRenderingSubsystem(VideoRendererImpl *This)
static const IVideoWindowVtbl IVideoWindow_VTable
static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl
static const IUnknownVtbl IInner_VTable
#define OAFALSE
Definition: dshow.h:53
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
static IUnknown * pVideoRenderer
Definition: videorenderer.c:35
HRESULT WINAPI BaseControlVideo_Init(BaseControlVideo *pControlVideo, const IBasicVideoVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin *pPin, const BaseControlVideoFuncTable *pFuncsTable)
Definition: video.c:38
HRESULT WINAPI BaseControlWindow_Init(BaseControlWindow *pControlWindow, const IVideoWindowVtbl *lpVtbl, BaseFilter *owner, CRITICAL_SECTION *lock, BasePin *pPin, const BaseWindowFuncTable *pFuncsTable)
Definition: window.c:204
HRESULT hr
Definition: shlfolder.c:183
ULONG WINAPI BaseRendererImpl_Release(IBaseFilter *iface)
Definition: renderer.c:296
HRESULT WINAPI BaseRenderer_Init(BaseRenderer *This, const IBaseFilterVtbl *Vtbl, IUnknown *pUnkOuter, const CLSID *pClsid, DWORD_PTR DebugInfo, const BaseRendererFuncTable *pBaseFuncsTable)
Definition: renderer.c:241
uint32_t DWORD_PTR
Definition: typedefs.h:65
#define ZeroMemory
Definition: winbase.h:1712

Referenced by VideoRendererDefault_create().

◆ VideoRenderer_DoRenderSample()

static HRESULT WINAPI VideoRenderer_DoRenderSample ( BaseRenderer iface,
IMediaSample pSample 
)
static

Definition at line 265 of file videorenderer.c.

266{
268 LPBYTE pbSrcStream = NULL;
269 LONG cbSrcStream = 0;
270 HRESULT hr;
271
272 TRACE("(%p)->(%p)\n", This, pSample);
273
274 hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
275 if (FAILED(hr))
276 {
277 ERR("Cannot get pointer to sample data (%x)\n", hr);
278 return hr;
279 }
280
281 cbSrcStream = IMediaSample_GetActualDataLength(pSample);
282
283 TRACE("val %p %d\n", pbSrcStream, cbSrcStream);
284
285#if 0 /* For debugging purpose */
286 {
287 int i;
288 for(i = 0; i < cbSrcStream; i++)
289 {
290 if ((i!=0) && !(i%16))
291 TRACE("\n");
292 TRACE("%02x ", pbSrcStream[i]);
293 }
294 TRACE("\n");
295 }
296#endif
297
298 SetEvent(This->hEvent);
299 if (This->renderer.filter.state == State_Paused)
300 {
301 VideoRenderer_SendSampleData(This, pbSrcStream, cbSrcStream);
302 SetEvent(This->hEvent);
303 if (This->renderer.filter.state == State_Paused)
304 {
305 /* Flushing */
306 return S_OK;
307 }
308 if (This->renderer.filter.state == State_Stopped)
309 {
310 return VFW_E_WRONG_STATE;
311 }
312 } else {
313 VideoRenderer_SendSampleData(This, pbSrcStream, cbSrcStream);
314 }
315 return S_OK;
316}
#define ERR(fmt,...)
Definition: debug.h:110
static DWORD VideoRenderer_SendSampleData(VideoRendererImpl *This, LPBYTE data, DWORD size)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned char * LPBYTE
Definition: typedefs.h:53
#define VFW_E_WRONG_STATE
Definition: vfwmsgs.h:78

◆ VideoRenderer_EndFlush()

static HRESULT WINAPI VideoRenderer_EndFlush ( BaseRenderer iface)
static

Definition at line 367 of file videorenderer.c.

368{
370
371 TRACE("(%p)->()\n", iface);
372
373 if (This->renderer.pMediaSample) {
374 ResetEvent(This->hEvent);
382 }
383 if (This->renderer.filter.state == State_Paused) {
384 ResetEvent(This->hEvent);
385 }
386
387 return BaseRendererImpl_EndFlush(iface);
388}
HRESULT WINAPI BaseRendererImpl_EndFlush(BaseRenderer *iface)
Definition: renderer.c:599
CRITICAL_SECTION csFilter
Definition: strmbase.h:165
BasePin pin
Definition: strmbase.h:90
LPCRITICAL_SECTION pCritSec
Definition: strmbase.h:37
CRITICAL_SECTION csRenderLock
Definition: strmbase.h:584
BaseInputPin * pInputPin
Definition: strmbase.h:582
BaseFilter filter
Definition: strmbase.h:580
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition: synch.c:714
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)

◆ VideoRenderer_GetClassWindowStyles()

static LPWSTR WINAPI VideoRenderer_GetClassWindowStyles ( BaseWindow This,
DWORD pClassStyles,
DWORD pWindowStyles,
DWORD pWindowStylesEx 
)
static

Definition at line 418 of file videorenderer.c.

419{
420 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 };
421
422 *pClassStyles = 0;
423 *pWindowStyles = WS_SIZEBOX;
424 *pWindowStylesEx = 0;
425
426 return (LPWSTR)classnameW;
427}
#define WS_SIZEBOX
Definition: pedump.c:642
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ VideoRenderer_GetDefaultRect()

static RECT WINAPI VideoRenderer_GetDefaultRect ( BaseWindow iface)
static

Definition at line 429 of file videorenderer.c.

430{
432 static RECT defRect;
433
434 SetRect(&defRect, 0, 0, This->VideoWidth, This->VideoHeight);
435
436 return defRect;
437}
static VideoRendererImpl * impl_from_BaseWindow(BaseWindow *iface)
Definition: videorenderer.c:68
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

◆ VideoRenderer_GetSourceRect()

static HRESULT WINAPI VideoRenderer_GetSourceRect ( BaseControlVideo *  iface,
RECT pSourceRect 
)
static

Definition at line 483 of file videorenderer.c.

484{
486 CopyRect(pSourceRect,&This->SourceRect);
487 return S_OK;
488}
static VideoRendererImpl * impl_from_BaseControlVideo(BaseControlVideo *iface)
Definition: videorenderer.c:88
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)

◆ VideoRenderer_GetStaticImage()

static HRESULT WINAPI VideoRenderer_GetStaticImage ( BaseControlVideo *  iface,
LONG pBufferSize,
LONG pDIBImage 
)
static

Definition at line 490 of file videorenderer.c.

491{
493 BITMAPINFOHEADER *bmiHeader;
494 LONG needed_size;
495 AM_MEDIA_TYPE *amt = &This->renderer.pInputPin->pin.mtCurrent;
496 char *ptr;
497
498 FIXME("(%p/%p)->(%p, %p): partial stub\n", This, iface, pBufferSize, pDIBImage);
499
500 EnterCriticalSection(&This->renderer.filter.csFilter);
501
502 if (!This->renderer.pMediaSample)
503 {
504 LeaveCriticalSection(&This->renderer.filter.csFilter);
505 return (This->renderer.filter.state == State_Paused ? E_UNEXPECTED : VFW_E_NOT_PAUSED);
506 }
507
508 if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo))
509 {
510 bmiHeader = &((VIDEOINFOHEADER *)amt->pbFormat)->bmiHeader;
511 }
512 else if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo2))
513 {
514 bmiHeader = &((VIDEOINFOHEADER2 *)amt->pbFormat)->bmiHeader;
515 }
516 else
517 {
518 FIXME("Unknown type %s\n", debugstr_guid(&amt->subtype));
519 LeaveCriticalSection(&This->renderer.filter.csFilter);
520 return VFW_E_RUNTIME_ERROR;
521 }
522
523 needed_size = bmiHeader->biSize;
524 needed_size += IMediaSample_GetActualDataLength(This->renderer.pMediaSample);
525
526 if (!pDIBImage)
527 {
528 *pBufferSize = needed_size;
529 LeaveCriticalSection(&This->renderer.filter.csFilter);
530 return S_OK;
531 }
532
533 if (needed_size < *pBufferSize)
534 {
535 ERR("Buffer too small %u/%u\n", needed_size, *pBufferSize);
536 LeaveCriticalSection(&This->renderer.filter.csFilter);
537 return E_FAIL;
538 }
539 *pBufferSize = needed_size;
540
541 memcpy(pDIBImage, bmiHeader, bmiHeader->biSize);
542 IMediaSample_GetPointer(This->renderer.pMediaSample, (BYTE **)&ptr);
543 memcpy((char *)pDIBImage + bmiHeader->biSize, ptr, IMediaSample_GetActualDataLength(This->renderer.pMediaSample));
544
545 LeaveCriticalSection(&This->renderer.filter.csFilter);
546 return S_OK;
547}
#define FIXME(fmt,...)
Definition: debug.h:111
_Must_inspect_result_ _In_ ULONG _Out_writes_bytes_ pBufferSize PVOID _Inout_ PULONG pBufferSize
Definition: fsrtlfuncs.h:1165
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static PVOID ptr
Definition: dispmode.c:27
#define VFW_E_NOT_PAUSED
Definition: vfwmsgs.h:76
#define VFW_E_RUNTIME_ERROR
Definition: vfwmsgs.h:50
#define E_UNEXPECTED
Definition: winerror.h:2456
unsigned char BYTE
Definition: xxhash.c:193

◆ VideoRenderer_GetTargetRect()

static HRESULT WINAPI VideoRenderer_GetTargetRect ( BaseControlVideo *  iface,
RECT pTargetRect 
)
static

Definition at line 549 of file videorenderer.c.

550{
552 CopyRect(pTargetRect,&This->DestRect);
553 return S_OK;
554}

◆ VideoRenderer_GetVideoFormat()

static VIDEOINFOHEADER *WINAPI VideoRenderer_GetVideoFormat ( BaseControlVideo *  iface)
static

Definition at line 556 of file videorenderer.c.

557{
559 AM_MEDIA_TYPE *pmt;
560
561 TRACE("(%p/%p)\n", This, iface);
562
563 pmt = &This->renderer.pInputPin->pin.mtCurrent;
564 if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) {
565 return (VIDEOINFOHEADER*)pmt->pbFormat;
566 } else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2)) {
567 static VIDEOINFOHEADER vih;
568 VIDEOINFOHEADER2 *vih2 = (VIDEOINFOHEADER2*)pmt->pbFormat;
569 memcpy(&vih,vih2,sizeof(VIDEOINFOHEADER));
570 memcpy(&vih.bmiHeader, &vih2->bmiHeader, sizeof(BITMAPINFOHEADER));
571 return &vih;
572 } else {
573 ERR("Unknown format type %s\n", qzdebugstr_guid(&pmt->formattype));
574 return NULL;
575 }
576}
const char * qzdebugstr_guid(const GUID *id)
Definition: main.c:279
BITMAPINFOHEADER bmiHeader
Definition: amvideo.idl:189

◆ VideoRenderer_IsDefaultSourceRect()

static HRESULT WINAPI VideoRenderer_IsDefaultSourceRect ( BaseControlVideo *  iface)
static

Definition at line 578 of file videorenderer.c.

579{
581 FIXME("(%p/%p)->(): stub !!!\n", This, iface);
582
583 return S_OK;
584}

◆ VideoRenderer_IsDefaultTargetRect()

static HRESULT WINAPI VideoRenderer_IsDefaultTargetRect ( BaseControlVideo *  iface)
static

Definition at line 586 of file videorenderer.c.

587{
589 FIXME("(%p/%p)->(): stub !!!\n", This, iface);
590
591 return S_OK;
592}

◆ VideoRenderer_OnSize()

static BOOL WINAPI VideoRenderer_OnSize ( BaseWindow iface,
LONG  Width,
LONG  Height 
)
static

Definition at line 439 of file videorenderer.c.

440{
442
443 TRACE("WM_SIZE %d %d\n", Width, Height);
444 GetClientRect(iface->hWnd, &This->DestRect);
445 TRACE("WM_SIZING: DestRect=(%d,%d),(%d,%d)\n",
446 This->DestRect.left,
447 This->DestRect.top,
448 This->DestRect.right - This->DestRect.left,
449 This->DestRect.bottom - This->DestRect.top);
450 return BaseWindowImpl_OnSize(iface, Width, Height);
451}
BOOL WINAPI BaseWindowImpl_OnSize(BaseWindow *This, LONG Height, LONG Width)
Definition: window.c:73
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88

◆ VideoRenderer_OnStartStreaming()

static VOID WINAPI VideoRenderer_OnStartStreaming ( BaseRenderer iface)
static

Definition at line 402 of file videorenderer.c.

403{
405
406 TRACE("(%p)\n", This);
407
408 if (This->renderer.pInputPin->pin.pConnectedTo && (This->renderer.filter.state == State_Stopped || !This->renderer.pInputPin->end_of_stream))
409 {
410 if (This->renderer.filter.state == State_Stopped)
411 {
412 ResetEvent(This->hEvent);
414 }
415 }
416}
static void VideoRenderer_AutoShowWindow(VideoRendererImpl *This)

◆ VideoRenderer_OnStopStreaming()

static VOID WINAPI VideoRenderer_OnStopStreaming ( BaseRenderer iface)
static

Definition at line 390 of file videorenderer.c.

391{
393
394 TRACE("(%p)->()\n", This);
395
396 SetEvent(This->hEvent);
397 if (This->baseControlWindow.AutoShow)
398 /* Black it out */
399 RedrawWindow(This->baseControlWindow.baseWindow.hWnd, NULL, NULL, RDW_INVALIDATE|RDW_ERASE);
400}
BOOL WINAPI RedrawWindow(_In_opt_ HWND, _In_opt_ LPCRECT, _In_opt_ HRGN, _In_ UINT)
#define RDW_ERASE
Definition: winuser.h:1211
#define RDW_INVALIDATE
Definition: winuser.h:1214

◆ VideoRenderer_Pause()

static HRESULT WINAPI VideoRenderer_Pause ( IBaseFilter iface)
static

IMediaFilter methods

Definition at line 746 of file videorenderer.c.

747{
749
750 TRACE("(%p/%p)->()\n", This, iface);
751
752 EnterCriticalSection(&This->renderer.csRenderLock);
753 if (This->renderer.filter.state != State_Paused)
754 {
755 if (This->renderer.filter.state == State_Stopped)
756 {
757 This->renderer.pInputPin->end_of_stream = 0;
758 ResetEvent(This->hEvent);
760 }
761
762 ResetEvent(This->renderer.RenderEvent);
763 This->renderer.filter.state = State_Paused;
764 }
765 LeaveCriticalSection(&This->renderer.csRenderLock);
766
767 return S_OK;
768}

◆ VideoRenderer_QueryInterface()

static HRESULT WINAPI VideoRenderer_QueryInterface ( IBaseFilter iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 726 of file videorenderer.c.

727{
729 return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
730}

◆ VideoRenderer_Release()

static ULONG WINAPI VideoRenderer_Release ( IBaseFilter iface)
static

Definition at line 738 of file videorenderer.c.

739{
741 return IUnknown_Release(This->outer_unk);
742}

◆ VideoRenderer_SendSampleData()

static DWORD VideoRenderer_SendSampleData ( VideoRendererImpl This,
LPBYTE  data,
DWORD  size 
)
static

Definition at line 205 of file videorenderer.c.

206{
207 AM_MEDIA_TYPE amt;
208 HRESULT hr = S_OK;
209 BITMAPINFOHEADER *bmiHeader;
210
211 TRACE("(%p)->(%p, %d)\n", This, data, size);
212
213 hr = IPin_ConnectionMediaType(&This->renderer.pInputPin->pin.IPin_iface, &amt);
214 if (FAILED(hr)) {
215 ERR("Unable to retrieve media type\n");
216 return hr;
217 }
218
219 if (IsEqualIID(&amt.formattype, &FORMAT_VideoInfo))
220 {
221 bmiHeader = &((VIDEOINFOHEADER *)amt.pbFormat)->bmiHeader;
222 }
223 else if (IsEqualIID(&amt.formattype, &FORMAT_VideoInfo2))
224 {
225 bmiHeader = &((VIDEOINFOHEADER2 *)amt.pbFormat)->bmiHeader;
226 }
227 else
228 {
229 FIXME("Unknown type %s\n", debugstr_guid(&amt.subtype));
230 return VFW_E_RUNTIME_ERROR;
231 }
232
233 TRACE("biSize = %d\n", bmiHeader->biSize);
234 TRACE("biWidth = %d\n", bmiHeader->biWidth);
235 TRACE("biHeight = %d\n", bmiHeader->biHeight);
236 TRACE("biPlanes = %d\n", bmiHeader->biPlanes);
237 TRACE("biBitCount = %d\n", bmiHeader->biBitCount);
238 TRACE("biCompression = %s\n", debugstr_an((LPSTR)&(bmiHeader->biCompression), 4));
239 TRACE("biSizeImage = %d\n", bmiHeader->biSizeImage);
240
241 if (!This->baseControlWindow.baseWindow.hDC) {
242 ERR("Cannot get DC from window!\n");
243 return E_FAIL;
244 }
245
246 TRACE("Src Rect: %s\n", wine_dbgstr_rect(&This->SourceRect));
247 TRACE("Dst Rect: %s\n", wine_dbgstr_rect(&This->DestRect));
248
249 StretchDIBits(This->baseControlWindow.baseWindow.hDC, This->DestRect.left, This->DestRect.top, This->DestRect.right -This->DestRect.left,
250 This->DestRect.bottom - This->DestRect.top, This->SourceRect.left, This->SourceRect.top,
251 This->SourceRect.right - This->SourceRect.left, This->SourceRect.bottom - This->SourceRect.top,
252 data, (BITMAPINFO *)bmiHeader, DIB_RGB_COLORS, SRCCOPY);
253
254 return S_OK;
255}
static __inline const char * debugstr_an(const char *s, int n)
Definition: compat.h:55
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLsizeiptr size
Definition: glext.h:5919
DWORD biCompression
Definition: amvideo.idl:35
DWORD biSizeImage
Definition: amvideo.idl:36
#define DIB_RGB_COLORS
Definition: wingdi.h:367
#define SRCCOPY
Definition: wingdi.h:333
int WINAPI StretchDIBits(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ const VOID *, _In_ const BITMAPINFO *, _In_ UINT, _In_ DWORD)
char * LPSTR
Definition: xmlstorage.h:182

Referenced by VideoRenderer_DoRenderSample().

◆ VideoRenderer_SetDefaultSourceRect()

static HRESULT WINAPI VideoRenderer_SetDefaultSourceRect ( BaseControlVideo *  iface)
static

Definition at line 594 of file videorenderer.c.

595{
597
598 SetRect(&This->SourceRect, 0, 0, This->VideoWidth, This->VideoHeight);
599
600 return S_OK;
601}

◆ VideoRenderer_SetDefaultTargetRect()

static HRESULT WINAPI VideoRenderer_SetDefaultTargetRect ( BaseControlVideo *  iface)
static

Definition at line 603 of file videorenderer.c.

604{
606 RECT rect;
607
608 if (!GetClientRect(This->baseControlWindow.baseWindow.hWnd, &rect))
609 return E_FAIL;
610
611 SetRect(&This->DestRect, 0, 0, rect.right, rect.bottom);
612
613 return S_OK;
614}
& rect
Definition: startmenu.cpp:1413

◆ VideoRenderer_SetSourceRect()

static HRESULT WINAPI VideoRenderer_SetSourceRect ( BaseControlVideo *  iface,
RECT pSourceRect 
)
static

Definition at line 616 of file videorenderer.c.

617{
619 CopyRect(&This->SourceRect,pSourceRect);
620 return S_OK;
621}

◆ VideoRenderer_SetTargetRect()

static HRESULT WINAPI VideoRenderer_SetTargetRect ( BaseControlVideo *  iface,
RECT pTargetRect 
)
static

Definition at line 623 of file videorenderer.c.

624{
626 CopyRect(&This->DestRect,pTargetRect);
627 return S_OK;
628}

◆ VideoRenderer_ShouldDrawSampleNow()

static HRESULT WINAPI VideoRenderer_ShouldDrawSampleNow ( BaseRenderer This,
IMediaSample pSample,
REFERENCE_TIME pStartTime,
REFERENCE_TIME pEndTime 
)
static

Definition at line 257 of file videorenderer.c.

258{
259 /* Preroll means the sample isn't shown, this is used for key frames and things like that */
260 if (IMediaSample_IsPreroll(pSample) == S_OK)
261 return E_FAIL;
262 return S_FALSE;
263}

◆ VideoRendererDefault_create()

HRESULT VideoRendererDefault_create ( IUnknown pUnkOuter,
LPVOID ppv 
)

Definition at line 1075 of file videorenderer.c.

1076{
1077 /* TODO: Attempt to use the VMR-7 renderer instead when possible */
1078 return VideoRenderer_create(pUnkOuter, ppv);
1079}
HRESULT VideoRenderer_create(IUnknown *pUnkOuter, void **ppv)

◆ VideoRendererInner_AddRef()

static ULONG WINAPI VideoRendererInner_AddRef ( IUnknown iface)
static

Definition at line 684 of file videorenderer.c.

685{
687 ULONG refCount = BaseFilterImpl_AddRef(&This->renderer.filter.IBaseFilter_iface);
688
689 TRACE("(%p)->(): new ref = %d\n", This, refCount);
690
691 return refCount;
692}
static VideoRendererImpl * impl_from_IUnknown(IUnknown *iface)
ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter *iface)
Definition: filter.c:54
uint32_t ULONG
Definition: typedefs.h:59

◆ VideoRendererInner_QueryInterface()

static HRESULT WINAPI VideoRendererInner_QueryInterface ( IUnknown iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 648 of file videorenderer.c.

649{
651
652 TRACE("(%p/%p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv);
653
654 *ppv = NULL;
655
657 *ppv = &This->IUnknown_inner;
658 else if (IsEqualIID(riid, &IID_IBasicVideo))
659 *ppv = &This->baseControlVideo.IBasicVideo_iface;
660 else if (IsEqualIID(riid, &IID_IVideoWindow))
661 *ppv = &This->baseControlWindow.IVideoWindow_iface;
662 else if (IsEqualIID(riid, &IID_IAMFilterMiscFlags))
663 *ppv = &This->IAMFilterMiscFlags_iface;
664 else
665 {
666 HRESULT hr;
667 hr = BaseRendererImpl_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
668 if (SUCCEEDED(hr))
669 return hr;
670 }
671
672 if (*ppv)
673 {
674 IUnknown_AddRef((IUnknown *)*ppv);
675 return S_OK;
676 }
677
678 if (!IsEqualIID(riid, &IID_IPin))
679 FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
680
681 return E_NOINTERFACE;
682}
const GUID IID_IUnknown
#define SUCCEEDED(hr)
Definition: intsafe.h:50
const GUID IID_IPin
Definition: pincontrol.cpp:15
HRESULT WINAPI BaseRendererImpl_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
Definition: renderer.c:280
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ VideoRendererInner_Release()

static ULONG WINAPI VideoRendererInner_Release ( IUnknown iface)
static

Definition at line 694 of file videorenderer.c.

695{
697 ULONG refCount = BaseRendererImpl_Release(&This->renderer.filter.IBaseFilter_iface);
698
699 TRACE("(%p)->(): new ref = %d\n", This, refCount);
700
701 if (!refCount)
702 {
703 BaseControlWindow_Destroy(&This->baseControlWindow);
704 BaseControlVideo_Destroy(&This->baseControlVideo);
705 PostThreadMessageW(This->ThreadID, WM_QUIT, 0, 0);
707 CloseHandle(This->hThread);
708 CloseHandle(This->hEvent);
709
710 TRACE("Destroying Video Renderer\n");
712
713 return 0;
714 }
715 else
716 return refCount;
717}
HRESULT WINAPI BaseControlVideo_Destroy(BaseControlVideo *pControlVideo)
Definition: video.c:51
HRESULT WINAPI BaseControlWindow_Destroy(BaseControlWindow *pControlWindow)
Definition: window.c:223
#define WM_QUIT
Definition: winuser.h:1623
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ VideoWindow_AddRef()

static ULONG WINAPI VideoWindow_AddRef ( IVideoWindow *  iface)
static

Definition at line 871 of file videorenderer.c.

872{
874
875 TRACE("(%p/%p)->()\n", This, iface);
876
877 return IUnknown_AddRef(This->outer_unk);
878}
static VideoRendererImpl * impl_from_IVideoWindow(IVideoWindow *iface)
Definition: videorenderer.c:83

◆ VideoWindow_get_FullScreenMode()

static HRESULT WINAPI VideoWindow_get_FullScreenMode ( IVideoWindow *  iface,
LONG FullScreenMode 
)
static

Definition at line 889 of file videorenderer.c.

891{
893
894 TRACE("(%p/%p)->(%p): %d\n", This, iface, FullScreenMode, This->FullScreenMode);
895
896 if (!FullScreenMode)
897 return E_POINTER;
898
899 *FullScreenMode = This->FullScreenMode;
900
901 return S_OK;
902}
#define E_POINTER
Definition: winerror.h:2365

◆ VideoWindow_put_FullScreenMode()

static HRESULT WINAPI VideoWindow_put_FullScreenMode ( IVideoWindow *  iface,
LONG  FullScreenMode 
)
static

Definition at line 904 of file videorenderer.c.

906{
908
909 FIXME("(%p/%p)->(%d): stub !!!\n", This, iface, FullScreenMode);
910
911 if (FullScreenMode) {
912 This->baseControlWindow.baseWindow.WindowStyles = GetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE);
913 ShowWindow(This->baseControlWindow.baseWindow.hWnd, SW_HIDE);
914 SetParent(This->baseControlWindow.baseWindow.hWnd, 0);
915 SetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE, WS_POPUP);
917 GetWindowRect(This->baseControlWindow.baseWindow.hWnd, &This->DestRect);
918 This->WindowPos = This->DestRect;
919 } else {
920 ShowWindow(This->baseControlWindow.baseWindow.hWnd, SW_HIDE);
921 SetParent(This->baseControlWindow.baseWindow.hWnd, This->baseControlWindow.hwndOwner);
922 SetWindowLongW(This->baseControlWindow.baseWindow.hWnd, GWL_STYLE, This->baseControlWindow.baseWindow.WindowStyles);
923 GetClientRect(This->baseControlWindow.baseWindow.hWnd, &This->DestRect);
924 SetWindowPos(This->baseControlWindow.baseWindow.hWnd,0,This->DestRect.left,This->DestRect.top,This->DestRect.right,This->DestRect.bottom,SWP_NOZORDER|SWP_SHOWWINDOW);
925 This->WindowPos = This->DestRect;
926 }
927 This->FullScreenMode = FullScreenMode;
928
929 return S_OK;
930}
#define WS_POPUP
Definition: pedump.c:616
#define SW_HIDE
Definition: winuser.h:768
#define SM_CYSCREEN
Definition: winuser.h:960
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)
#define HWND_TOP
Definition: winuser.h:1207
#define SWP_SHOWWINDOW
Definition: winuser.h:1248
#define SM_CXSCREEN
Definition: winuser.h:959
int WINAPI GetSystemMetrics(_In_ int)

◆ VideoWindow_QueryInterface()

static HRESULT WINAPI VideoWindow_QueryInterface ( IVideoWindow *  iface,
REFIID  riid,
LPVOID ppvObj 
)
static

Definition at line 862 of file videorenderer.c.

863{
865
866 TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj);
867
868 return IUnknown_QueryInterface(This->outer_unk, riid, ppvObj);
869}

◆ VideoWindow_Release()

static ULONG WINAPI VideoWindow_Release ( IVideoWindow *  iface)
static

Definition at line 880 of file videorenderer.c.

881{
883
884 TRACE("(%p/%p)->()\n", This, iface);
885
886 return IUnknown_Release(This->outer_unk);
887}

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( quartz  )

Variable Documentation

◆ BaseFuncTable

const BaseRendererFuncTable BaseFuncTable
static
Initial value:
= {
}
static HRESULT WINAPI VideoRenderer_ShouldDrawSampleNow(BaseRenderer *This, IMediaSample *pSample, REFERENCE_TIME *pStartTime, REFERENCE_TIME *pEndTime)
static VOID WINAPI VideoRenderer_OnStartStreaming(BaseRenderer *iface)
static VOID WINAPI VideoRenderer_OnStopStreaming(BaseRenderer *iface)
static HRESULT WINAPI VideoRenderer_EndFlush(BaseRenderer *iface)
static HRESULT WINAPI VideoRenderer_CheckMediaType(BaseRenderer *iface, const AM_MEDIA_TYPE *pmt)
static HRESULT WINAPI VideoRenderer_DoRenderSample(BaseRenderer *iface, IMediaSample *pSample)

Definition at line 453 of file videorenderer.c.

Referenced by VideoRenderer_create().

◆ IAMFilterMiscFlags_Vtbl

const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl
static
Initial value:
= {
}
static ULONG WINAPI AMFilterMiscFlags_Release(IAMFilterMiscFlags *iface)
static HRESULT WINAPI AMFilterMiscFlags_QueryInterface(IAMFilterMiscFlags *iface, REFIID riid, void **ppv)
static ULONG WINAPI AMFilterMiscFlags_GetMiscFlags(IAMFilterMiscFlags *iface)
static ULONG WINAPI AMFilterMiscFlags_AddRef(IAMFilterMiscFlags *iface)

Definition at line 1011 of file videorenderer.c.

Referenced by VideoRenderer_create().

◆ IBasicVideo_VTable

const IBasicVideoVtbl IBasicVideo_VTable
static

Definition at line 817 of file videorenderer.c.

Referenced by VideoRenderer_create().

◆ IInner_VTable

const IUnknownVtbl IInner_VTable
static
Initial value:
=
{
}
static ULONG WINAPI VideoRendererInner_Release(IUnknown *iface)
static HRESULT WINAPI VideoRendererInner_QueryInterface(IUnknown *iface, REFIID riid, void **ppv)
static ULONG WINAPI VideoRendererInner_AddRef(IUnknown *iface)

Definition at line 719 of file videorenderer.c.

Referenced by VideoRenderer_create().

◆ IVideoWindow_VTable

const IVideoWindowVtbl IVideoWindow_VTable
static

Definition at line 932 of file videorenderer.c.

Referenced by VideoRenderer_create().

◆ renderer_BaseControlVideoFuncTable

const BaseControlVideoFuncTable renderer_BaseControlVideoFuncTable
static
Initial value:
= {
}
static HRESULT WINAPI VideoRenderer_SetSourceRect(BaseControlVideo *iface, RECT *pSourceRect)
static HRESULT WINAPI VideoRenderer_GetStaticImage(BaseControlVideo *iface, LONG *pBufferSize, LONG *pDIBImage)
static VIDEOINFOHEADER *WINAPI VideoRenderer_GetVideoFormat(BaseControlVideo *iface)
static HRESULT WINAPI VideoRenderer_IsDefaultTargetRect(BaseControlVideo *iface)
static HRESULT WINAPI VideoRenderer_SetDefaultSourceRect(BaseControlVideo *iface)
static HRESULT WINAPI VideoRenderer_IsDefaultSourceRect(BaseControlVideo *iface)
static HRESULT WINAPI VideoRenderer_GetSourceRect(BaseControlVideo *iface, RECT *pSourceRect)
static HRESULT WINAPI VideoRenderer_SetTargetRect(BaseControlVideo *iface, RECT *pTargetRect)
static HRESULT WINAPI VideoRenderer_GetTargetRect(BaseControlVideo *iface, RECT *pTargetRect)
static HRESULT WINAPI VideoRenderer_SetDefaultTargetRect(BaseControlVideo *iface)

Definition at line 630 of file videorenderer.c.

Referenced by VideoRenderer_create().

◆ renderer_BaseWindowFuncTable

const BaseWindowFuncTable renderer_BaseWindowFuncTable
static
Initial value:
= {
}
static RECT WINAPI VideoRenderer_GetDefaultRect(BaseWindow *iface)
static BOOL WINAPI VideoRenderer_OnSize(BaseWindow *iface, LONG Width, LONG Height)
static LPWSTR WINAPI VideoRenderer_GetClassWindowStyles(BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx)
BOOL WINAPI BaseControlWindowImpl_PossiblyEatMessage(BaseWindow *This, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: window.c:164

Definition at line 475 of file videorenderer.c.

Referenced by VideoRenderer_create().

◆ VideoRenderer_Vtbl

const IBaseFilterVtbl VideoRenderer_Vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI VideoRenderer_Pause(IBaseFilter *iface)
static HRESULT WINAPI VideoRenderer_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
static ULONG WINAPI VideoRenderer_AddRef(IBaseFilter *iface)
static ULONG WINAPI VideoRenderer_Release(IBaseFilter *iface)
HRESULT WINAPI BaseRendererImpl_SetSyncSource(IBaseFilter *iface, IReferenceClock *clock)
Definition: renderer.c:537
HRESULT WINAPI BaseFilterImpl_GetClassID(IBaseFilter *iface, CLSID *pClsid)
Definition: filter.c:77
HRESULT WINAPI BaseFilterImpl_QueryFilterInfo(IBaseFilter *iface, FILTER_INFO *pInfo)
Definition: filter.c:145
HRESULT WINAPI BaseRendererImpl_Stop(IBaseFilter *iface)
Definition: renderer.c:440
HRESULT WINAPI BaseRendererImpl_FindPin(IBaseFilter *iface, LPCWSTR Id, IPin **ppPin)
Definition: renderer.c:421
HRESULT WINAPI BaseRendererImpl_Run(IBaseFilter *iface, REFERENCE_TIME tStart)
Definition: renderer.c:461
HRESULT WINAPI BaseFilterImpl_JoinFilterGraph(IBaseFilter *iface, IFilterGraph *pGraph, LPCWSTR pName)
Definition: filter.c:159
HRESULT WINAPI BaseFilterImpl_QueryVendorInfo(IBaseFilter *iface, LPWSTR *pVendorInfo)
Definition: filter.c:178
HRESULT WINAPI BaseFilterImpl_GetSyncSource(IBaseFilter *iface, IReferenceClock **ppClock)
Definition: filter.c:119
HRESULT WINAPI BaseRendererImpl_GetState(IBaseFilter *iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
Definition: renderer.c:550
HRESULT WINAPI BaseFilterImpl_EnumPins(IBaseFilter *iface, IEnumPins **ppEnum)
Definition: filter.c:135

Definition at line 770 of file videorenderer.c.

Referenced by VideoRenderer_create().