ReactOS 0.4.16-dev-340-g0540c21
vmr9.c File Reference
#include "config.h"
#include "quartz_private.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 "d3d9.h"
#include "vmr9.h"
#include "pin.h"
#include "wine/unicode.h"
#include "wine/debug.h"
Include dependency graph for vmr9.c:

Go to the source code of this file.

Classes

struct  quartz_vmr
 
struct  VMR9DefaultAllocatorPresenterImpl
 
struct  get_available_monitors_args
 
struct  VERTEX
 

Macros

#define USED_FVF   (D3DFVF_XYZRHW | D3DFVF_TEX1)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (quartz)
 
static struct quartz_vmrimpl_from_inner_IUnknown (IUnknown *iface)
 
static struct quartz_vmrimpl_from_BaseWindow (BaseWindow *wnd)
 
static struct quartz_vmrimpl_from_IVideoWindow (IVideoWindow *iface)
 
static struct quartz_vmrimpl_from_BaseControlVideo (BaseControlVideo *cvid)
 
static struct quartz_vmrimpl_from_IBasicVideo (IBasicVideo *iface)
 
static struct quartz_vmrimpl_from_IAMCertifiedOutputProtection (IAMCertifiedOutputProtection *iface)
 
static struct quartz_vmrimpl_from_IAMFilterMiscFlags (IAMFilterMiscFlags *iface)
 
static struct quartz_vmrimpl_from_IVMRFilterConfig (IVMRFilterConfig *iface)
 
static struct quartz_vmrimpl_from_IVMRFilterConfig9 (IVMRFilterConfig9 *iface)
 
static struct quartz_vmrimpl_from_IVMRMonitorConfig (IVMRMonitorConfig *iface)
 
static struct quartz_vmrimpl_from_IVMRMonitorConfig9 (IVMRMonitorConfig9 *iface)
 
static struct quartz_vmrimpl_from_IVMRSurfaceAllocatorNotify (IVMRSurfaceAllocatorNotify *iface)
 
static struct quartz_vmrimpl_from_IVMRSurfaceAllocatorNotify9 (IVMRSurfaceAllocatorNotify9 *iface)
 
static struct quartz_vmrimpl_from_IVMRWindowlessControl (IVMRWindowlessControl *iface)
 
static struct quartz_vmrimpl_from_IVMRWindowlessControl9 (IVMRWindowlessControl9 *iface)
 
static VMR9DefaultAllocatorPresenterImplimpl_from_IVMRImagePresenter9 (IVMRImagePresenter9 *iface)
 
static VMR9DefaultAllocatorPresenterImplimpl_from_IVMRSurfaceAllocatorEx9 (IVMRSurfaceAllocatorEx9 *iface)
 
static HRESULT VMR9DefaultAllocatorPresenterImpl_create (struct quartz_vmr *parent, LPVOID *ppv)
 
static DWORD VMR9_SendSampleData (struct quartz_vmr *This, VMR9PresentationInfo *info, LPBYTE data, DWORD size)
 
static HRESULT WINAPI VMR9_DoRenderSample (BaseRenderer *iface, IMediaSample *pSample)
 
static HRESULT WINAPI VMR9_CheckMediaType (BaseRenderer *iface, const AM_MEDIA_TYPE *pmt)
 
static HRESULT VMR9_maybe_init (struct quartz_vmr *This, BOOL force)
 
static VOID WINAPI VMR9_OnStartStreaming (BaseRenderer *iface)
 
static VOID WINAPI VMR9_OnStopStreaming (BaseRenderer *iface)
 
static HRESULT WINAPI VMR9_ShouldDrawSampleNow (BaseRenderer *This, IMediaSample *pSample, REFERENCE_TIME *pStartTime, REFERENCE_TIME *pEndTime)
 
static HRESULT WINAPI VMR9_CompleteConnect (BaseRenderer *This, IPin *pReceivePin)
 
static HRESULT WINAPI VMR9_BreakConnect (BaseRenderer *This)
 
static LPWSTR WINAPI VMR9_GetClassWindowStyles (BaseWindow *This, DWORD *pClassStyles, DWORD *pWindowStyles, DWORD *pWindowStylesEx)
 
static RECT WINAPI VMR9_GetDefaultRect (BaseWindow *This)
 
static BOOL WINAPI VMR9_OnSize (BaseWindow *This, LONG Width, LONG Height)
 
static HRESULT WINAPI VMR9_GetSourceRect (BaseControlVideo *This, RECT *pSourceRect)
 
static HRESULT WINAPI VMR9_GetStaticImage (BaseControlVideo *This, LONG *pBufferSize, LONG *pDIBImage)
 
static HRESULT WINAPI VMR9_GetTargetRect (BaseControlVideo *This, RECT *pTargetRect)
 
static VIDEOINFOHEADER *WINAPI VMR9_GetVideoFormat (BaseControlVideo *This)
 
static HRESULT WINAPI VMR9_IsDefaultSourceRect (BaseControlVideo *This)
 
static HRESULT WINAPI VMR9_IsDefaultTargetRect (BaseControlVideo *This)
 
static HRESULT WINAPI VMR9_SetDefaultSourceRect (BaseControlVideo *This)
 
static HRESULT WINAPI VMR9_SetDefaultTargetRect (BaseControlVideo *This)
 
static HRESULT WINAPI VMR9_SetSourceRect (BaseControlVideo *This, RECT *pSourceRect)
 
static HRESULT WINAPI VMR9_SetTargetRect (BaseControlVideo *This, RECT *pTargetRect)
 
static HRESULT WINAPI VMR9Inner_QueryInterface (IUnknown *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI VMR9Inner_AddRef (IUnknown *iface)
 
static ULONG WINAPI VMR9Inner_Release (IUnknown *iface)
 
static HRESULT WINAPI VMR9_QueryInterface (IBaseFilter *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI VMR9_AddRef (IBaseFilter *iface)
 
static ULONG WINAPI VMR9_Release (IBaseFilter *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 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 AMCertifiedOutputProtection_QueryInterface (IAMCertifiedOutputProtection *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI AMCertifiedOutputProtection_AddRef (IAMCertifiedOutputProtection *iface)
 
static ULONG WINAPI AMCertifiedOutputProtection_Release (IAMCertifiedOutputProtection *iface)
 
static HRESULT WINAPI AMCertifiedOutputProtection_KeyExchange (IAMCertifiedOutputProtection *iface, GUID *pRandom, BYTE **VarLenCertGH, DWORD *pdwLengthCertGH)
 
static HRESULT WINAPI AMCertifiedOutputProtection_SessionSequenceStart (IAMCertifiedOutputProtection *iface, AMCOPPSignature *pSig)
 
static HRESULT WINAPI AMCertifiedOutputProtection_ProtectionCommand (IAMCertifiedOutputProtection *iface, const AMCOPPCommand *cmd)
 
static HRESULT WINAPI AMCertifiedOutputProtection_ProtectionStatus (IAMCertifiedOutputProtection *iface, const AMCOPPStatusInput *pStatusInput, AMCOPPStatusOutput *pStatusOutput)
 
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)
 
static HRESULT WINAPI VMR7FilterConfig_QueryInterface (IVMRFilterConfig *iface, REFIID riid, void **ppv)
 
static ULONG WINAPI VMR7FilterConfig_AddRef (IVMRFilterConfig *iface)
 
static ULONG WINAPI VMR7FilterConfig_Release (IVMRFilterConfig *iface)
 
static HRESULT WINAPI VMR7FilterConfig_SetImageCompositor (IVMRFilterConfig *iface, IVMRImageCompositor *compositor)
 
static HRESULT WINAPI VMR7FilterConfig_SetNumberOfStreams (IVMRFilterConfig *iface, DWORD max)
 
static HRESULT WINAPI VMR7FilterConfig_GetNumberOfStreams (IVMRFilterConfig *iface, DWORD *max)
 
static HRESULT WINAPI VMR7FilterConfig_SetRenderingPrefs (IVMRFilterConfig *iface, DWORD renderflags)
 
static HRESULT WINAPI VMR7FilterConfig_GetRenderingPrefs (IVMRFilterConfig *iface, DWORD *renderflags)
 
static HRESULT WINAPI VMR7FilterConfig_SetRenderingMode (IVMRFilterConfig *iface, DWORD mode)
 
static HRESULT WINAPI VMR7FilterConfig_GetRenderingMode (IVMRFilterConfig *iface, DWORD *mode)
 
static BOOL CALLBACK get_available_monitors_proc (HMONITOR hmon, HDC hdc, LPRECT lprc, LPARAM lparam)
 
static HRESULT WINAPI VMR7MonitorConfig_QueryInterface (IVMRMonitorConfig *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI VMR7MonitorConfig_AddRef (IVMRMonitorConfig *iface)
 
static ULONG WINAPI VMR7MonitorConfig_Release (IVMRMonitorConfig *iface)
 
static HRESULT WINAPI VMR7MonitorConfig_SetMonitor (IVMRMonitorConfig *iface, const VMRGUID *pGUID)
 
static HRESULT WINAPI VMR7MonitorConfig_GetMonitor (IVMRMonitorConfig *iface, VMRGUID *pGUID)
 
static HRESULT WINAPI VMR7MonitorConfig_SetDefaultMonitor (IVMRMonitorConfig *iface, const VMRGUID *pGUID)
 
static HRESULT WINAPI VMR7MonitorConfig_GetDefaultMonitor (IVMRMonitorConfig *iface, VMRGUID *pGUID)
 
static HRESULT WINAPI VMR7MonitorConfig_GetAvailableMonitors (IVMRMonitorConfig *iface, VMRMONITORINFO *info, DWORD arraysize, DWORD *numdev)
 
static HRESULT WINAPI VMR9MonitorConfig_QueryInterface (IVMRMonitorConfig9 *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI VMR9MonitorConfig_AddRef (IVMRMonitorConfig9 *iface)
 
static ULONG WINAPI VMR9MonitorConfig_Release (IVMRMonitorConfig9 *iface)
 
static HRESULT WINAPI VMR9MonitorConfig_SetMonitor (IVMRMonitorConfig9 *iface, UINT uDev)
 
static HRESULT WINAPI VMR9MonitorConfig_GetMonitor (IVMRMonitorConfig9 *iface, UINT *uDev)
 
static HRESULT WINAPI VMR9MonitorConfig_SetDefaultMonitor (IVMRMonitorConfig9 *iface, UINT uDev)
 
static HRESULT WINAPI VMR9MonitorConfig_GetDefaultMonitor (IVMRMonitorConfig9 *iface, UINT *uDev)
 
static HRESULT WINAPI VMR9MonitorConfig_GetAvailableMonitors (IVMRMonitorConfig9 *iface, VMR9MonitorInfo *info, DWORD arraysize, DWORD *numdev)
 
static HRESULT WINAPI VMR9FilterConfig_QueryInterface (IVMRFilterConfig9 *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI VMR9FilterConfig_AddRef (IVMRFilterConfig9 *iface)
 
static ULONG WINAPI VMR9FilterConfig_Release (IVMRFilterConfig9 *iface)
 
static HRESULT WINAPI VMR9FilterConfig_SetImageCompositor (IVMRFilterConfig9 *iface, IVMRImageCompositor9 *compositor)
 
static HRESULT WINAPI VMR9FilterConfig_SetNumberOfStreams (IVMRFilterConfig9 *iface, DWORD max)
 
static HRESULT WINAPI VMR9FilterConfig_GetNumberOfStreams (IVMRFilterConfig9 *iface, DWORD *max)
 
static HRESULT WINAPI VMR9FilterConfig_SetRenderingPrefs (IVMRFilterConfig9 *iface, DWORD renderflags)
 
static HRESULT WINAPI VMR9FilterConfig_GetRenderingPrefs (IVMRFilterConfig9 *iface, DWORD *renderflags)
 
static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode (IVMRFilterConfig9 *iface, DWORD mode)
 
static HRESULT WINAPI VMR9FilterConfig_GetRenderingMode (IVMRFilterConfig9 *iface, DWORD *mode)
 
static HRESULT WINAPI VMR7WindowlessControl_QueryInterface (IVMRWindowlessControl *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI VMR7WindowlessControl_AddRef (IVMRWindowlessControl *iface)
 
static ULONG WINAPI VMR7WindowlessControl_Release (IVMRWindowlessControl *iface)
 
static HRESULT WINAPI VMR7WindowlessControl_GetNativeVideoSize (IVMRWindowlessControl *iface, LONG *width, LONG *height, LONG *arwidth, LONG *arheight)
 
static HRESULT WINAPI VMR7WindowlessControl_GetMinIdealVideoSize (IVMRWindowlessControl *iface, LONG *width, LONG *height)
 
static HRESULT WINAPI VMR7WindowlessControl_GetMaxIdealVideoSize (IVMRWindowlessControl *iface, LONG *width, LONG *height)
 
static HRESULT WINAPI VMR7WindowlessControl_SetVideoPosition (IVMRWindowlessControl *iface, const RECT *source, const RECT *dest)
 
static HRESULT WINAPI VMR7WindowlessControl_GetVideoPosition (IVMRWindowlessControl *iface, RECT *source, RECT *dest)
 
static HRESULT WINAPI VMR7WindowlessControl_GetAspectRatioMode (IVMRWindowlessControl *iface, DWORD *mode)
 
static HRESULT WINAPI VMR7WindowlessControl_SetAspectRatioMode (IVMRWindowlessControl *iface, DWORD mode)
 
static HRESULT WINAPI VMR7WindowlessControl_SetVideoClippingWindow (IVMRWindowlessControl *iface, HWND hwnd)
 
static HRESULT WINAPI VMR7WindowlessControl_RepaintVideo (IVMRWindowlessControl *iface, HWND hwnd, HDC hdc)
 
static HRESULT WINAPI VMR7WindowlessControl_DisplayModeChanged (IVMRWindowlessControl *iface)
 
static HRESULT WINAPI VMR7WindowlessControl_GetCurrentImage (IVMRWindowlessControl *iface, BYTE **dib)
 
static HRESULT WINAPI VMR7WindowlessControl_SetBorderColor (IVMRWindowlessControl *iface, COLORREF color)
 
static HRESULT WINAPI VMR7WindowlessControl_GetBorderColor (IVMRWindowlessControl *iface, COLORREF *color)
 
static HRESULT WINAPI VMR7WindowlessControl_SetColorKey (IVMRWindowlessControl *iface, COLORREF color)
 
static HRESULT WINAPI VMR7WindowlessControl_GetColorKey (IVMRWindowlessControl *iface, COLORREF *color)
 
static HRESULT WINAPI VMR9WindowlessControl_QueryInterface (IVMRWindowlessControl9 *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI VMR9WindowlessControl_AddRef (IVMRWindowlessControl9 *iface)
 
static ULONG WINAPI VMR9WindowlessControl_Release (IVMRWindowlessControl9 *iface)
 
static HRESULT WINAPI VMR9WindowlessControl_GetNativeVideoSize (IVMRWindowlessControl9 *iface, LONG *width, LONG *height, LONG *arwidth, LONG *arheight)
 
static HRESULT WINAPI VMR9WindowlessControl_GetMinIdealVideoSize (IVMRWindowlessControl9 *iface, LONG *width, LONG *height)
 
static HRESULT WINAPI VMR9WindowlessControl_GetMaxIdealVideoSize (IVMRWindowlessControl9 *iface, LONG *width, LONG *height)
 
static HRESULT WINAPI VMR9WindowlessControl_SetVideoPosition (IVMRWindowlessControl9 *iface, const RECT *source, const RECT *dest)
 
static HRESULT WINAPI VMR9WindowlessControl_GetVideoPosition (IVMRWindowlessControl9 *iface, RECT *source, RECT *dest)
 
static HRESULT WINAPI VMR9WindowlessControl_GetAspectRatioMode (IVMRWindowlessControl9 *iface, DWORD *mode)
 
static HRESULT WINAPI VMR9WindowlessControl_SetAspectRatioMode (IVMRWindowlessControl9 *iface, DWORD mode)
 
static HRESULT WINAPI VMR9WindowlessControl_SetVideoClippingWindow (IVMRWindowlessControl9 *iface, HWND hwnd)
 
static HRESULT WINAPI VMR9WindowlessControl_RepaintVideo (IVMRWindowlessControl9 *iface, HWND hwnd, HDC hdc)
 
static HRESULT WINAPI VMR9WindowlessControl_DisplayModeChanged (IVMRWindowlessControl9 *iface)
 
static HRESULT WINAPI VMR9WindowlessControl_GetCurrentImage (IVMRWindowlessControl9 *iface, BYTE **dib)
 
static HRESULT WINAPI VMR9WindowlessControl_SetBorderColor (IVMRWindowlessControl9 *iface, COLORREF color)
 
static HRESULT WINAPI VMR9WindowlessControl_GetBorderColor (IVMRWindowlessControl9 *iface, COLORREF *color)
 
static HRESULT WINAPI VMR7SurfaceAllocatorNotify_QueryInterface (IVMRSurfaceAllocatorNotify *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI VMR7SurfaceAllocatorNotify_AddRef (IVMRSurfaceAllocatorNotify *iface)
 
static ULONG WINAPI VMR7SurfaceAllocatorNotify_Release (IVMRSurfaceAllocatorNotify *iface)
 
static HRESULT WINAPI VMR7SurfaceAllocatorNotify_AdviseSurfaceAllocator (IVMRSurfaceAllocatorNotify *iface, DWORD_PTR id, IVMRSurfaceAllocator *alloc)
 
static HRESULT WINAPI VMR7SurfaceAllocatorNotify_SetDDrawDevice (IVMRSurfaceAllocatorNotify *iface, IDirectDraw7 *device, HMONITOR monitor)
 
static HRESULT WINAPI VMR7SurfaceAllocatorNotify_ChangeDDrawDevice (IVMRSurfaceAllocatorNotify *iface, IDirectDraw7 *device, HMONITOR monitor)
 
static HRESULT WINAPI VMR7SurfaceAllocatorNotify_RestoreDDrawSurfaces (IVMRSurfaceAllocatorNotify *iface)
 
static HRESULT WINAPI VMR7SurfaceAllocatorNotify_NotifyEvent (IVMRSurfaceAllocatorNotify *iface, LONG code, LONG_PTR param1, LONG_PTR param2)
 
static HRESULT WINAPI VMR7SurfaceAllocatorNotify_SetBorderColor (IVMRSurfaceAllocatorNotify *iface, COLORREF clrBorder)
 
static HRESULT WINAPI VMR9SurfaceAllocatorNotify_QueryInterface (IVMRSurfaceAllocatorNotify9 *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI VMR9SurfaceAllocatorNotify_AddRef (IVMRSurfaceAllocatorNotify9 *iface)
 
static ULONG WINAPI VMR9SurfaceAllocatorNotify_Release (IVMRSurfaceAllocatorNotify9 *iface)
 
static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AdviseSurfaceAllocator (IVMRSurfaceAllocatorNotify9 *iface, DWORD_PTR id, IVMRSurfaceAllocator9 *alloc)
 
static HRESULT WINAPI VMR9SurfaceAllocatorNotify_SetD3DDevice (IVMRSurfaceAllocatorNotify9 *iface, IDirect3DDevice9 *device, HMONITOR monitor)
 
static HRESULT WINAPI VMR9SurfaceAllocatorNotify_ChangeD3DDevice (IVMRSurfaceAllocatorNotify9 *iface, IDirect3DDevice9 *device, HMONITOR monitor)
 
static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AllocateSurfaceHelper (IVMRSurfaceAllocatorNotify9 *iface, VMR9AllocationInfo *allocinfo, DWORD *numbuffers, IDirect3DSurface9 **surface)
 
static HRESULT WINAPI VMR9SurfaceAllocatorNotify_NotifyEvent (IVMRSurfaceAllocatorNotify9 *iface, LONG code, LONG_PTR param1, LONG_PTR param2)
 
static HRESULT vmr_create (IUnknown *outer_unk, LPVOID *ppv, const CLSID *clsid)
 
HRESULT VMR7Impl_create (IUnknown *outer_unk, LPVOID *ppv)
 
HRESULT VMR9Impl_create (IUnknown *outer_unk, LPVOID *ppv)
 
static HRESULT WINAPI VMR9_ImagePresenter_QueryInterface (IVMRImagePresenter9 *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI VMR9_ImagePresenter_AddRef (IVMRImagePresenter9 *iface)
 
static ULONG WINAPI VMR9_ImagePresenter_Release (IVMRImagePresenter9 *iface)
 
static HRESULT WINAPI VMR9_ImagePresenter_StartPresenting (IVMRImagePresenter9 *iface, DWORD_PTR id)
 
static HRESULT WINAPI VMR9_ImagePresenter_StopPresenting (IVMRImagePresenter9 *iface, DWORD_PTR id)
 
static HRESULT VMR9_ImagePresenter_PresentTexture (VMR9DefaultAllocatorPresenterImpl *This, IDirect3DSurface9 *surface)
 
static HRESULT VMR9_ImagePresenter_PresentOffscreenSurface (VMR9DefaultAllocatorPresenterImpl *This, IDirect3DSurface9 *surface)
 
static HRESULT WINAPI VMR9_ImagePresenter_PresentImage (IVMRImagePresenter9 *iface, DWORD_PTR id, VMR9PresentationInfo *info)
 
static HRESULT WINAPI VMR9_SurfaceAllocator_QueryInterface (IVMRSurfaceAllocatorEx9 *iface, REFIID riid, LPVOID *ppv)
 
static ULONG WINAPI VMR9_SurfaceAllocator_AddRef (IVMRSurfaceAllocatorEx9 *iface)
 
static ULONG WINAPI VMR9_SurfaceAllocator_Release (IVMRSurfaceAllocatorEx9 *iface)
 
static HRESULT VMR9_SurfaceAllocator_SetAllocationSettings (VMR9DefaultAllocatorPresenterImpl *This, VMR9AllocationInfo *allocinfo)
 
static DWORD WINAPI MessageLoop (LPVOID lpParameter)
 
static UINT d3d9_adapter_from_hwnd (IDirect3D9 *d3d9, HWND hwnd, HMONITOR *mon_out)
 
static BOOL CreateRenderingWindow (VMR9DefaultAllocatorPresenterImpl *This, VMR9AllocationInfo *info, DWORD *numbuffers)
 
static HRESULT WINAPI VMR9_SurfaceAllocator_InitializeDevice (IVMRSurfaceAllocatorEx9 *iface, DWORD_PTR id, VMR9AllocationInfo *allocinfo, DWORD *numbuffers)
 
static HRESULT WINAPI VMR9_SurfaceAllocator_TerminateDevice (IVMRSurfaceAllocatorEx9 *iface, DWORD_PTR id)
 
static HRESULT VMR9_SurfaceAllocator_UpdateDeviceReset (VMR9DefaultAllocatorPresenterImpl *This)
 
static HRESULT WINAPI VMR9_SurfaceAllocator_GetSurface (IVMRSurfaceAllocatorEx9 *iface, DWORD_PTR id, DWORD surfaceindex, DWORD flags, IDirect3DSurface9 **surface)
 
static HRESULT WINAPI VMR9_SurfaceAllocator_AdviseNotify (IVMRSurfaceAllocatorEx9 *iface, IVMRSurfaceAllocatorNotify9 *allocnotify)
 
static IDirect3D9 * init_d3d9 (HMODULE d3d9_handle)
 

Variables

static const BaseRendererFuncTable BaseFuncTable
 
static const BaseWindowFuncTable renderer_BaseWindowFuncTable
 
static const BaseControlVideoFuncTable renderer_BaseControlVideoFuncTable
 
static const IUnknownVtbl IInner_VTable
 
static const IBaseFilterVtbl VMR_Vtbl
 
static const IVideoWindowVtbl IVideoWindow_VTable
 
static const IBasicVideoVtbl IBasicVideo_VTable
 
static const IAMCertifiedOutputProtectionVtbl IAMCertifiedOutputProtection_Vtbl
 
static const IAMFilterMiscFlagsVtbl IAMFilterMiscFlags_Vtbl
 
static const IVMRFilterConfigVtbl VMR7_FilterConfig_Vtbl
 
static const IVMRMonitorConfigVtbl VMR7_MonitorConfig_Vtbl
 
static const IVMRMonitorConfig9Vtbl VMR9_MonitorConfig_Vtbl
 
static const IVMRFilterConfig9Vtbl VMR9_FilterConfig_Vtbl
 
static const IVMRWindowlessControlVtbl VMR7_WindowlessControl_Vtbl
 
static const IVMRWindowlessControl9Vtbl VMR9_WindowlessControl_Vtbl
 
static const IVMRSurfaceAllocatorNotifyVtbl VMR7_SurfaceAllocatorNotify_Vtbl
 
static const IVMRSurfaceAllocatorNotify9Vtbl VMR9_SurfaceAllocatorNotify_Vtbl
 
static const IVMRImagePresenter9Vtbl VMR9_ImagePresenter
 
static const IVMRSurfaceAllocatorEx9Vtbl VMR9_SurfaceAllocator
 

Macro Definition Documentation

◆ USED_FVF

#define USED_FVF   (D3DFVF_XYZRHW | D3DFVF_TEX1)

Definition at line 2545 of file vmr9.c.

Function Documentation

◆ AMCertifiedOutputProtection_AddRef()

static ULONG WINAPI AMCertifiedOutputProtection_AddRef ( IAMCertifiedOutputProtection iface)
static

Definition at line 1100 of file vmr9.c.

1101{
1103 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1104}
static struct quartz_vmr * impl_from_IAMCertifiedOutputProtection(IAMCertifiedOutputProtection *iface)
Definition: vmr9.c:122
static ULONG WINAPI VMR9_AddRef(IBaseFilter *iface)
Definition: vmr9.c:893

◆ AMCertifiedOutputProtection_KeyExchange()

static HRESULT WINAPI AMCertifiedOutputProtection_KeyExchange ( IAMCertifiedOutputProtection iface,
GUID pRandom,
BYTE **  VarLenCertGH,
DWORD pdwLengthCertGH 
)
static

Definition at line 1112 of file vmr9.c.

1115{
1117
1118 FIXME("(%p/%p)->(%p, %p, %p) stub\n", iface, This, pRandom, VarLenCertGH, pdwLengthCertGH);
1119 return VFW_E_NO_COPP_HW;
1120}
#define FIXME(fmt,...)
Definition: precomp.h:53
#define VFW_E_NO_COPP_HW
Definition: vfwmsgs.h:160

◆ AMCertifiedOutputProtection_ProtectionCommand()

static HRESULT WINAPI AMCertifiedOutputProtection_ProtectionCommand ( IAMCertifiedOutputProtection iface,
const AMCOPPCommand cmd 
)
static

Definition at line 1131 of file vmr9.c.

1133{
1135
1136 FIXME("(%p/%p)->(%p) stub\n", iface, This, cmd);
1137 return VFW_E_NO_COPP_HW;
1138}
Definition: ftp_var.h:139

◆ AMCertifiedOutputProtection_ProtectionStatus()

static HRESULT WINAPI AMCertifiedOutputProtection_ProtectionStatus ( IAMCertifiedOutputProtection iface,
const AMCOPPStatusInput pStatusInput,
AMCOPPStatusOutput pStatusOutput 
)
static

Definition at line 1140 of file vmr9.c.

1143{
1145
1146 FIXME("(%p/%p)->(%p, %p) stub\n", iface, This, pStatusInput, pStatusOutput);
1147 return VFW_E_NO_COPP_HW;
1148}

◆ AMCertifiedOutputProtection_QueryInterface()

static HRESULT WINAPI AMCertifiedOutputProtection_QueryInterface ( IAMCertifiedOutputProtection iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1093 of file vmr9.c.

1095{
1097 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1098}
REFIID riid
Definition: atlbase.h:39
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HRESULT WINAPI VMR9_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
Definition: vmr9.c:863

◆ AMCertifiedOutputProtection_Release()

static ULONG WINAPI AMCertifiedOutputProtection_Release ( IAMCertifiedOutputProtection iface)
static

Definition at line 1106 of file vmr9.c.

1107{
1109 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1110}
static ULONG WINAPI VMR9_Release(IBaseFilter *iface)
Definition: vmr9.c:908

◆ AMCertifiedOutputProtection_SessionSequenceStart()

static HRESULT WINAPI AMCertifiedOutputProtection_SessionSequenceStart ( IAMCertifiedOutputProtection iface,
AMCOPPSignature pSig 
)
static

Definition at line 1122 of file vmr9.c.

1124{
1126
1127 FIXME("(%p/%p)->(%p) stub\n", iface, This, pSig);
1128 return VFW_E_NO_COPP_HW;
1129}

◆ AMFilterMiscFlags_AddRef()

static ULONG WINAPI AMFilterMiscFlags_AddRef ( IAMFilterMiscFlags iface)
static

Definition at line 1166 of file vmr9.c.

1166 {
1168 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1169}
static struct quartz_vmr * impl_from_IAMFilterMiscFlags(IAMFilterMiscFlags *iface)
Definition: vmr9.c:127

◆ AMFilterMiscFlags_GetMiscFlags()

static ULONG WINAPI AMFilterMiscFlags_GetMiscFlags ( IAMFilterMiscFlags iface)
static

Definition at line 1176 of file vmr9.c.

1176 {
1178}
@ 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 1161 of file vmr9.c.

1161 {
1163 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1164}

◆ AMFilterMiscFlags_Release()

static ULONG WINAPI AMFilterMiscFlags_Release ( IAMFilterMiscFlags iface)
static

Definition at line 1171 of file vmr9.c.

1171 {
1173 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1174}

◆ Basicvideo_AddRef()

static ULONG WINAPI Basicvideo_AddRef ( IBasicVideo *  iface)
static

Definition at line 1032 of file vmr9.c.

1033{
1034 struct quartz_vmr *This = impl_from_IBasicVideo(iface);
1035
1036 TRACE("(%p/%p)->()\n", This, iface);
1037
1038 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1039}
#define TRACE(s)
Definition: solgame.cpp:4
static struct quartz_vmr * impl_from_IBasicVideo(IBasicVideo *iface)
Definition: vmr9.c:117

◆ Basicvideo_QueryInterface()

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

Definition at line 1023 of file vmr9.c.

1024{
1025 struct quartz_vmr *This = impl_from_IBasicVideo(iface);
1026
1027 TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj);
1028
1029 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppvObj);
1030}
#define debugstr_guid
Definition: kernel32.h:35

◆ Basicvideo_Release()

static ULONG WINAPI Basicvideo_Release ( IBasicVideo *  iface)
static

Definition at line 1041 of file vmr9.c.

1042{
1043 struct quartz_vmr *This = impl_from_IBasicVideo(iface);
1044
1045 TRACE("(%p/%p)->()\n", This, iface);
1046
1047 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1048}

◆ CreateRenderingWindow()

static BOOL CreateRenderingWindow ( VMR9DefaultAllocatorPresenterImpl This,
VMR9AllocationInfo info,
DWORD numbuffers 
)
static

Definition at line 2790 of file vmr9.c.

2791{
2793 DWORD d3d9_adapter;
2794 HRESULT hr;
2795
2796 TRACE("(%p)->()\n", This);
2797
2798 This->hWndThread = CreateThread(NULL, 0, MessageLoop, This, 0, &This->tid);
2799 if (!This->hWndThread)
2800 return FALSE;
2801
2803
2804 if (!This->pVMR9->baseControlWindow.baseWindow.hWnd) return FALSE;
2805
2806 /* Obtain a monitor and d3d9 device */
2807 d3d9_adapter = d3d9_adapter_from_hwnd(This->d3d9_ptr, This->pVMR9->baseControlWindow.baseWindow.hWnd, &This->hMon);
2808
2809 /* Now try to create the d3d9 device */
2810 ZeroMemory(&d3dpp, sizeof(d3dpp));
2811 d3dpp.Windowed = TRUE;
2812 d3dpp.hDeviceWindow = This->pVMR9->baseControlWindow.baseWindow.hWnd;
2814 d3dpp.BackBufferHeight = This->pVMR9->target_rect.bottom - This->pVMR9->target_rect.top;
2815 d3dpp.BackBufferWidth = This->pVMR9->target_rect.right - This->pVMR9->target_rect.left;
2816
2817 hr = IDirect3D9_CreateDevice(This->d3d9_ptr, d3d9_adapter, D3DDEVTYPE_HAL, NULL, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &This->d3d9_dev);
2818 if (FAILED(hr))
2819 {
2820 ERR("Could not create device: %08x\n", hr);
2821 BaseWindowImpl_DoneWithWindow(&This->pVMR9->baseControlWindow.baseWindow);
2822 return FALSE;
2823 }
2824 IVMRSurfaceAllocatorNotify9_SetD3DDevice(This->SurfaceAllocatorNotify, This->d3d9_dev, This->hMon);
2825
2826 This->d3d9_surfaces = CoTaskMemAlloc(*numbuffers * sizeof(IDirect3DSurface9 *));
2827 ZeroMemory(This->d3d9_surfaces, *numbuffers * sizeof(IDirect3DSurface9 *));
2828
2830 if (FAILED(hr))
2831 ERR("Setting allocation settings failed: %08x\n", hr);
2832
2833 if (SUCCEEDED(hr))
2834 {
2835 hr = IVMRSurfaceAllocatorNotify9_AllocateSurfaceHelper(This->SurfaceAllocatorNotify, info, numbuffers, This->d3d9_surfaces);
2836 if (FAILED(hr))
2837 ERR("Allocating surfaces failed: %08x\n", hr);
2838 }
2839
2840 if (FAILED(hr))
2841 {
2842 IVMRSurfaceAllocatorEx9_TerminateDevice(This->pVMR9->allocator, This->pVMR9->cookie);
2843 BaseWindowImpl_DoneWithWindow(&This->pVMR9->baseControlWindow.baseWindow);
2844 return FALSE;
2845 }
2846
2847 This->num_surfaces = *numbuffers;
2848
2849 return TRUE;
2850}
#define ERR(fmt,...)
Definition: precomp.h:57
@ D3DSWAPEFFECT_DISCARD
Definition: d3d8types.h:851
@ D3DDEVTYPE_HAL
Definition: d3d8types.h:576
#define IDirect3D9_CreateDevice(p, a, b, c, d, e, f)
Definition: d3d9.h:235
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
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
unsigned long DWORD
Definition: ntddk_ex.h:95
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define D3DCREATE_MIXED_VERTEXPROCESSING
Definition: d3d8.h:46
HRESULT hr
Definition: shlfolder.c:183
HRESULT WINAPI BaseWindowImpl_DoneWithWindow(BaseWindow *This)
Definition: window.c:143
D3DSWAPEFFECT SwapEffect
Definition: d3d8types.h:1128
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition: synch.c:82
static HRESULT VMR9_SurfaceAllocator_SetAllocationSettings(VMR9DefaultAllocatorPresenterImpl *This, VMR9AllocationInfo *allocinfo)
Definition: vmr9.c:2688
static DWORD WINAPI MessageLoop(LPVOID lpParameter)
Definition: vmr9.c:2741
static UINT d3d9_adapter_from_hwnd(IDirect3D9 *d3d9, HWND hwnd, HMONITOR *mon_out)
Definition: vmr9.c:2767
#define ZeroMemory
Definition: winbase.h:1737

Referenced by VMR9_SurfaceAllocator_InitializeDevice().

◆ d3d9_adapter_from_hwnd()

static UINT d3d9_adapter_from_hwnd ( IDirect3D9 *  d3d9,
HWND  hwnd,
HMONITOR mon_out 
)
static

Definition at line 2767 of file vmr9.c.

2768{
2769 UINT d3d9_adapter;
2770 HMONITOR mon;
2771
2772 mon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONULL);
2773 if (!mon)
2774 d3d9_adapter = 0;
2775 else
2776 {
2777 for (d3d9_adapter = 0; d3d9_adapter < IDirect3D9_GetAdapterCount(d3d9); ++d3d9_adapter)
2778 {
2779 if (mon == IDirect3D9_GetAdapterMonitor(d3d9, d3d9_adapter))
2780 break;
2781 }
2782 if (d3d9_adapter >= IDirect3D9_GetAdapterCount(d3d9))
2783 d3d9_adapter = 0;
2784 }
2785 if (mon_out)
2786 *mon_out = mon;
2787 return d3d9_adapter;
2788}
#define IDirect3D9_GetAdapterMonitor(p, a)
Definition: d3d9.h:234
#define IDirect3D9_GetAdapterCount(p)
Definition: d3d9.h:223
HMONITOR WINAPI MonitorFromWindow(HWND, DWORD)
unsigned int UINT
Definition: ndis.h:50
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023

Referenced by CreateRenderingWindow(), and VMR9_SurfaceAllocator_UpdateDeviceReset().

◆ get_available_monitors_proc()

static BOOL CALLBACK get_available_monitors_proc ( HMONITOR  hmon,
HDC  hdc,
LPRECT  lprc,
LPARAM  lparam 
)
static

Definition at line 1292 of file vmr9.c.

1293{
1296
1297 if (args->info7 || args->info9)
1298 {
1299
1300 if (!args->arraysize)
1301 return FALSE;
1302
1303 mi.cbSize = sizeof(mi);
1305 return TRUE;
1306
1307 /* fill VMRMONITORINFO struct */
1308 if (args->info7)
1309 {
1310 VMRMONITORINFO *info = args->info7++;
1311 memset(info, 0, sizeof(*info));
1312
1313 if (args->numdev > 0)
1314 {
1315 info->guid.pGUID = &info->guid.GUID;
1316 info->guid.GUID.Data4[7] = args->numdev;
1317 }
1318 else
1319 info->guid.pGUID = NULL;
1320
1321 info->rcMonitor = mi.rcMonitor;
1322 info->hMon = hmon;
1323 info->dwFlags = mi.dwFlags;
1324
1325 lstrcpynW(info->szDevice, mi.szDevice, sizeof(info->szDevice)/sizeof(WCHAR));
1326
1327 /* FIXME: how to get these values? */
1328 info->szDescription[0] = 0;
1329 }
1330
1331 /* fill VMR9MonitorInfo struct */
1332 if (args->info9)
1333 {
1334 VMR9MonitorInfo *info = args->info9++;
1335 memset(info, 0, sizeof(*info));
1336
1337 info->uDevID = 0; /* FIXME */
1338 info->rcMonitor = mi.rcMonitor;
1339 info->hMon = hmon;
1340 info->dwFlags = mi.dwFlags;
1341
1342 lstrcpynW(info->szDevice, mi.szDevice, sizeof(info->szDevice)/sizeof(WCHAR));
1343
1344 /* FIXME: how to get these values? */
1345 info->szDescription[0] = 0;
1346 info->dwVendorId = 0;
1347 info->dwDeviceId = 0;
1348 info->dwSubSysId = 0;
1349 info->dwRevision = 0;
1350 }
1351
1352 args->arraysize--;
1353 }
1354
1355 args->numdev++;
1356 return TRUE;
1357}
@ lparam
Definition: SystemMenu.c:31
#define lstrcpynW
Definition: compat.h:738
static HANDLE hmon
Definition: localmon.c:41
#define memset(x, y, z)
Definition: compat.h:39
Definition: match.c:390
RECT rcMonitor
Definition: winuser.h:3788
DWORD dwFlags
Definition: winuser.h:3790
DWORD cbSize
Definition: winuser.h:3787
static MONITORINFO mi
Definition: win.c:7338
BOOL WINAPI GetMonitorInfoW(_In_ HMONITOR, _Inout_ LPMONITORINFO)
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by VMR7MonitorConfig_GetAvailableMonitors(), and VMR9MonitorConfig_GetAvailableMonitors().

◆ impl_from_BaseControlVideo()

static struct quartz_vmr * impl_from_BaseControlVideo ( BaseControlVideo *  cvid)
inlinestatic

◆ impl_from_BaseWindow()

static struct quartz_vmr * impl_from_BaseWindow ( BaseWindow wnd)
inlinestatic

Definition at line 102 of file vmr9.c.

103{
104 return CONTAINING_RECORD(wnd, struct quartz_vmr, baseControlWindow.baseWindow);
105}

Referenced by VMR9_GetDefaultRect(), and VMR9_OnSize().

◆ impl_from_IAMCertifiedOutputProtection()

◆ impl_from_IAMFilterMiscFlags()

static struct quartz_vmr * impl_from_IAMFilterMiscFlags ( IAMFilterMiscFlags iface)
inlinestatic

Definition at line 127 of file vmr9.c.

128{
129 return CONTAINING_RECORD(iface, struct quartz_vmr, IAMFilterMiscFlags_iface);
130}

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

◆ impl_from_IBasicVideo()

static struct quartz_vmr * impl_from_IBasicVideo ( IBasicVideo *  iface)
inlinestatic

Definition at line 117 of file vmr9.c.

118{
119 return CONTAINING_RECORD(iface, struct quartz_vmr, baseControlVideo.IBasicVideo_iface);
120}

Referenced by Basicvideo_AddRef(), Basicvideo_QueryInterface(), and Basicvideo_Release().

◆ impl_from_inner_IUnknown()

static struct quartz_vmr * impl_from_inner_IUnknown ( IUnknown iface)
inlinestatic

Definition at line 97 of file vmr9.c.

98{
99 return CONTAINING_RECORD(iface, struct quartz_vmr, IUnknown_inner);
100}

Referenced by VMR9Inner_AddRef(), VMR9Inner_QueryInterface(), and VMR9Inner_Release().

◆ impl_from_IVideoWindow()

static struct quartz_vmr * impl_from_IVideoWindow ( IVideoWindow *  iface)
inlinestatic

Definition at line 107 of file vmr9.c.

108{
109 return CONTAINING_RECORD(iface, struct quartz_vmr, baseControlWindow.IVideoWindow_iface);
110}

Referenced by Videowindow_AddRef(), Videowindow_QueryInterface(), and Videowindow_Release().

◆ impl_from_IVMRFilterConfig()

◆ impl_from_IVMRFilterConfig9()

◆ impl_from_IVMRImagePresenter9()

◆ impl_from_IVMRMonitorConfig()

◆ impl_from_IVMRMonitorConfig9()

◆ impl_from_IVMRSurfaceAllocatorEx9()

◆ impl_from_IVMRSurfaceAllocatorNotify()

◆ impl_from_IVMRSurfaceAllocatorNotify9()

◆ impl_from_IVMRWindowlessControl()

◆ impl_from_IVMRWindowlessControl9()

◆ init_d3d9()

static IDirect3D9 * init_d3d9 ( HMODULE  d3d9_handle)
static

Definition at line 3048 of file vmr9.c.

3049{
3050 IDirect3D9 * (__stdcall * d3d9_create)(UINT SDKVersion);
3051
3052 d3d9_create = (void *)GetProcAddress(d3d9_handle, "Direct3DCreate9");
3053 if (!d3d9_create) return NULL;
3054
3055 return d3d9_create(D3D_SDK_VERSION);
3056}
#define GetProcAddress(x, y)
Definition: compat.h:753
#define D3D_SDK_VERSION
Definition: d3d8.h:56
#define __stdcall
Definition: typedefs.h:25

Referenced by VMR9DefaultAllocatorPresenterImpl_create().

◆ MessageLoop()

static DWORD WINAPI MessageLoop ( LPVOID  lpParameter)
static

Definition at line 2741 of file vmr9.c.

2742{
2743 MSG msg;
2744 BOOL fGotMessage;
2746
2747 TRACE("Starting message loop\n");
2748
2749 if (FAILED(BaseWindowImpl_PrepareWindow(&This->pVMR9->baseControlWindow.baseWindow)))
2750 {
2751 FIXME("Failed to prepare window\n");
2752 return FALSE;
2753 }
2754
2755 SetEvent(This->ack);
2756 while ((fGotMessage = GetMessageW(&msg, NULL, 0, 0)) != 0 && fGotMessage != -1)
2757 {
2760 }
2761
2762 TRACE("End of message loop\n");
2763
2764 return 0;
2765}
#define msg(x)
Definition: auth_time.c:54
unsigned int BOOL
Definition: ntddk_ex.h:94
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 CreateRenderingWindow().

◆ Videowindow_AddRef()

static ULONG WINAPI Videowindow_AddRef ( IVideoWindow *  iface)
static

Definition at line 954 of file vmr9.c.

955{
956 struct quartz_vmr *This = impl_from_IVideoWindow(iface);
957
958 TRACE("(%p/%p)->()\n", This, iface);
959
960 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
961}
static struct quartz_vmr * impl_from_IVideoWindow(IVideoWindow *iface)
Definition: vmr9.c:107

◆ Videowindow_QueryInterface()

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

Definition at line 945 of file vmr9.c.

946{
947 struct quartz_vmr *This = impl_from_IVideoWindow(iface);
948
949 TRACE("(%p/%p)->(%s, %p)\n", This, iface, debugstr_guid(riid), ppvObj);
950
951 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppvObj);
952}

◆ Videowindow_Release()

static ULONG WINAPI Videowindow_Release ( IVideoWindow *  iface)
static

Definition at line 963 of file vmr9.c.

964{
965 struct quartz_vmr *This = impl_from_IVideoWindow(iface);
966
967 TRACE("(%p/%p)->()\n", This, iface);
968
969 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
970}

◆ VMR7FilterConfig_AddRef()

static ULONG WINAPI VMR7FilterConfig_AddRef ( IVMRFilterConfig iface)
static

Definition at line 1194 of file vmr9.c.

1195{
1197 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1198}
static struct quartz_vmr * impl_from_IVMRFilterConfig(IVMRFilterConfig *iface)
Definition: vmr9.c:132

◆ VMR7FilterConfig_GetNumberOfStreams()

static HRESULT WINAPI VMR7FilterConfig_GetNumberOfStreams ( IVMRFilterConfig iface,
DWORD max 
)
static

Definition at line 1223 of file vmr9.c.

1224{
1226
1227 FIXME("(%p/%p)->(%p) stub\n", iface, This, max);
1228 return E_NOTIMPL;
1229}
#define E_NOTIMPL
Definition: ddrawi.h:99
#define max(a, b)
Definition: svc.c:63

◆ VMR7FilterConfig_GetRenderingMode()

static HRESULT WINAPI VMR7FilterConfig_GetRenderingMode ( IVMRFilterConfig iface,
DWORD mode 
)
static

Definition at line 1255 of file vmr9.c.

1256{
1258
1259 TRACE("(%p/%p)->(%p)\n", iface, This, mode);
1260 if (!mode) return E_POINTER;
1261
1262 if (This->mode)
1263 *mode = This->mode;
1264 else
1266
1267 return S_OK;
1268}
@ VMRMode_Windowed
Definition: vmrender.idl:105
GLenum mode
Definition: glext.h:6217
#define S_OK
Definition: intsafe.h:52
#define E_POINTER
Definition: winerror.h:2365

◆ VMR7FilterConfig_GetRenderingPrefs()

static HRESULT WINAPI VMR7FilterConfig_GetRenderingPrefs ( IVMRFilterConfig iface,
DWORD renderflags 
)
static

Definition at line 1239 of file vmr9.c.

1240{
1242
1243 FIXME("(%p/%p)->(%p) stub\n", iface, This, renderflags);
1244 return E_NOTIMPL;
1245}

◆ VMR7FilterConfig_QueryInterface()

static HRESULT WINAPI VMR7FilterConfig_QueryInterface ( IVMRFilterConfig iface,
REFIID  riid,
void **  ppv 
)
static

Definition at line 1187 of file vmr9.c.

1189{
1191 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1192}

◆ VMR7FilterConfig_Release()

static ULONG WINAPI VMR7FilterConfig_Release ( IVMRFilterConfig iface)
static

Definition at line 1200 of file vmr9.c.

1201{
1203 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1204}

◆ VMR7FilterConfig_SetImageCompositor()

static HRESULT WINAPI VMR7FilterConfig_SetImageCompositor ( IVMRFilterConfig iface,
IVMRImageCompositor compositor 
)
static

Definition at line 1206 of file vmr9.c.

1208{
1210
1211 FIXME("(%p/%p)->(%p) stub\n", iface, This, compositor);
1212 return E_NOTIMPL;
1213}

◆ VMR7FilterConfig_SetNumberOfStreams()

static HRESULT WINAPI VMR7FilterConfig_SetNumberOfStreams ( IVMRFilterConfig iface,
DWORD  max 
)
static

Definition at line 1215 of file vmr9.c.

1216{
1218
1219 FIXME("(%p/%p)->(%u) stub\n", iface, This, max);
1220 return E_NOTIMPL;
1221}

◆ VMR7FilterConfig_SetRenderingMode()

static HRESULT WINAPI VMR7FilterConfig_SetRenderingMode ( IVMRFilterConfig iface,
DWORD  mode 
)
static

Definition at line 1247 of file vmr9.c.

1248{
1250
1251 FIXME("(%p/%p)->(%u) stub\n", iface, This, mode);
1252 return E_NOTIMPL;
1253}

◆ VMR7FilterConfig_SetRenderingPrefs()

static HRESULT WINAPI VMR7FilterConfig_SetRenderingPrefs ( IVMRFilterConfig iface,
DWORD  renderflags 
)
static

Definition at line 1231 of file vmr9.c.

1232{
1234
1235 FIXME("(%p/%p)->(%u) stub\n", iface, This, renderflags);
1236 return E_NOTIMPL;
1237}

◆ VMR7Impl_create()

HRESULT VMR7Impl_create ( IUnknown outer_unk,
LPVOID ppv 
)

Definition at line 2446 of file vmr9.c.

2447{
2448 return vmr_create(outer_unk, ppv, &CLSID_VideoMixingRenderer);
2449}
static HRESULT vmr_create(IUnknown *outer_unk, LPVOID *ppv, const CLSID *clsid)
Definition: vmr9.c:2369

◆ VMR7MonitorConfig_AddRef()

static ULONG WINAPI VMR7MonitorConfig_AddRef ( IVMRMonitorConfig iface)
static

Definition at line 1366 of file vmr9.c.

1367{
1369 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1370}
static struct quartz_vmr * impl_from_IVMRMonitorConfig(IVMRMonitorConfig *iface)
Definition: vmr9.c:142

◆ VMR7MonitorConfig_GetAvailableMonitors()

static HRESULT WINAPI VMR7MonitorConfig_GetAvailableMonitors ( IVMRMonitorConfig iface,
VMRMONITORINFO info,
DWORD  arraysize,
DWORD numdev 
)
static

Definition at line 1429 of file vmr9.c.

1432{
1435
1436 FIXME("(%p/%p)->(%p, %u, %p) semi-stub\n", iface, This, info, arraysize, numdev);
1437
1438 if (!numdev)
1439 return E_POINTER;
1440
1441 if (info && arraysize == 0)
1442 return E_INVALIDARG;
1443
1444 args.info7 = info;
1445 args.info9 = NULL;
1446 args.arraysize = arraysize;
1447 args.numdev = 0;
1449
1450 *numdev = args.numdev;
1451 return S_OK;
1452}
#define E_INVALIDARG
Definition: ddrawi.h:101
static BOOL CALLBACK get_available_monitors_proc(HMONITOR hmon, HDC hdc, LPRECT lprc, LPARAM lparam)
Definition: vmr9.c:1292
LONG_PTR LPARAM
Definition: windef.h:208
BOOL WINAPI EnumDisplayMonitors(_In_opt_ HDC, _In_opt_ LPCRECT, _In_ MONITORENUMPROC, _In_ LPARAM)

◆ VMR7MonitorConfig_GetDefaultMonitor()

static HRESULT WINAPI VMR7MonitorConfig_GetDefaultMonitor ( IVMRMonitorConfig iface,
VMRGUID pGUID 
)
static

Definition at line 1416 of file vmr9.c.

1417{
1419
1420 FIXME("(%p/%p)->(%p) stub\n", iface, This, pGUID);
1421
1422 if (!pGUID)
1423 return E_POINTER;
1424
1425 pGUID->pGUID = NULL; /* default DirectDraw device */
1426 return S_OK;
1427}
struct _GUID * pGUID
Definition: vmrender.idl:171

◆ VMR7MonitorConfig_GetMonitor()

static HRESULT WINAPI VMR7MonitorConfig_GetMonitor ( IVMRMonitorConfig iface,
VMRGUID pGUID 
)
static

Definition at line 1390 of file vmr9.c.

1391{
1393
1394 FIXME("(%p/%p)->(%p) stub\n", iface, This, pGUID);
1395
1396 if (!pGUID)
1397 return E_POINTER;
1398
1399 pGUID->pGUID = NULL; /* default DirectDraw device */
1400 return S_OK;
1401}

◆ VMR7MonitorConfig_QueryInterface()

static HRESULT WINAPI VMR7MonitorConfig_QueryInterface ( IVMRMonitorConfig iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 1359 of file vmr9.c.

1361{
1363 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1364}

◆ VMR7MonitorConfig_Release()

static ULONG WINAPI VMR7MonitorConfig_Release ( IVMRMonitorConfig iface)
static

Definition at line 1372 of file vmr9.c.

1373{
1375 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1376}

◆ VMR7MonitorConfig_SetDefaultMonitor()

static HRESULT WINAPI VMR7MonitorConfig_SetDefaultMonitor ( IVMRMonitorConfig iface,
const VMRGUID pGUID 
)
static

Definition at line 1403 of file vmr9.c.

1405{
1407
1408 FIXME("(%p/%p)->(%p) stub\n", iface, This, pGUID);
1409
1410 if (!pGUID)
1411 return E_POINTER;
1412
1413 return S_OK;
1414}

◆ VMR7MonitorConfig_SetMonitor()

static HRESULT WINAPI VMR7MonitorConfig_SetMonitor ( IVMRMonitorConfig iface,
const VMRGUID pGUID 
)
static

Definition at line 1378 of file vmr9.c.

1379{
1381
1382 FIXME("(%p/%p)->(%p) stub\n", iface, This, pGUID);
1383
1384 if (!pGUID)
1385 return E_POINTER;
1386
1387 return S_OK;
1388}

◆ VMR7SurfaceAllocatorNotify_AddRef()

static ULONG WINAPI VMR7SurfaceAllocatorNotify_AddRef ( IVMRSurfaceAllocatorNotify iface)
static

Definition at line 2130 of file vmr9.c.

2131{
2133 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
2134}
static struct quartz_vmr * impl_from_IVMRSurfaceAllocatorNotify(IVMRSurfaceAllocatorNotify *iface)
Definition: vmr9.c:152

◆ VMR7SurfaceAllocatorNotify_AdviseSurfaceAllocator()

static HRESULT WINAPI VMR7SurfaceAllocatorNotify_AdviseSurfaceAllocator ( IVMRSurfaceAllocatorNotify iface,
DWORD_PTR  id,
IVMRSurfaceAllocator alloc 
)
static

Definition at line 2142 of file vmr9.c.

2145{
2147
2148 FIXME("(%p/%p)->(...) stub\n", iface, This);
2149 return E_NOTIMPL;
2150}

◆ VMR7SurfaceAllocatorNotify_ChangeDDrawDevice()

static HRESULT WINAPI VMR7SurfaceAllocatorNotify_ChangeDDrawDevice ( IVMRSurfaceAllocatorNotify iface,
IDirectDraw7 device,
HMONITOR  monitor 
)
static

Definition at line 2161 of file vmr9.c.

2163{
2165
2166 FIXME("(%p/%p)->(...) stub\n", iface, This);
2167 return E_NOTIMPL;
2168}

◆ VMR7SurfaceAllocatorNotify_NotifyEvent()

static HRESULT WINAPI VMR7SurfaceAllocatorNotify_NotifyEvent ( IVMRSurfaceAllocatorNotify iface,
LONG  code,
LONG_PTR  param1,
LONG_PTR  param2 
)
static

Definition at line 2178 of file vmr9.c.

2180{
2182
2183 FIXME("(%p/%p)->(...) stub\n", iface, This);
2184 return E_NOTIMPL;
2185}

◆ VMR7SurfaceAllocatorNotify_QueryInterface()

static HRESULT WINAPI VMR7SurfaceAllocatorNotify_QueryInterface ( IVMRSurfaceAllocatorNotify iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 2123 of file vmr9.c.

2125{
2127 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
2128}

◆ VMR7SurfaceAllocatorNotify_Release()

static ULONG WINAPI VMR7SurfaceAllocatorNotify_Release ( IVMRSurfaceAllocatorNotify iface)
static

Definition at line 2136 of file vmr9.c.

2137{
2139 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
2140}

◆ VMR7SurfaceAllocatorNotify_RestoreDDrawSurfaces()

static HRESULT WINAPI VMR7SurfaceAllocatorNotify_RestoreDDrawSurfaces ( IVMRSurfaceAllocatorNotify iface)
static

Definition at line 2170 of file vmr9.c.

2171{
2173
2174 FIXME("(%p/%p)->(...) stub\n", iface, This);
2175 return E_NOTIMPL;
2176}

◆ VMR7SurfaceAllocatorNotify_SetBorderColor()

static HRESULT WINAPI VMR7SurfaceAllocatorNotify_SetBorderColor ( IVMRSurfaceAllocatorNotify iface,
COLORREF  clrBorder 
)
static

Definition at line 2187 of file vmr9.c.

2189{
2191
2192 FIXME("(%p/%p)->(...) stub\n", iface, This);
2193 return E_NOTIMPL;
2194}

◆ VMR7SurfaceAllocatorNotify_SetDDrawDevice()

static HRESULT WINAPI VMR7SurfaceAllocatorNotify_SetDDrawDevice ( IVMRSurfaceAllocatorNotify iface,
IDirectDraw7 device,
HMONITOR  monitor 
)
static

Definition at line 2152 of file vmr9.c.

2154{
2156
2157 FIXME("(%p/%p)->(...) stub\n", iface, This);
2158 return E_NOTIMPL;
2159}

◆ VMR7WindowlessControl_AddRef()

static ULONG WINAPI VMR7WindowlessControl_AddRef ( IVMRWindowlessControl iface)
static

Definition at line 1715 of file vmr9.c.

1716{
1718 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1719}
static struct quartz_vmr * impl_from_IVMRWindowlessControl(IVMRWindowlessControl *iface)
Definition: vmr9.c:162

◆ VMR7WindowlessControl_DisplayModeChanged()

static HRESULT WINAPI VMR7WindowlessControl_DisplayModeChanged ( IVMRWindowlessControl iface)
static

Definition at line 1845 of file vmr9.c.

1846{
1848
1849 FIXME("(%p/%p)->(...) stub\n", iface, This);
1850 return E_NOTIMPL;
1851}

◆ VMR7WindowlessControl_GetAspectRatioMode()

static HRESULT WINAPI VMR7WindowlessControl_GetAspectRatioMode ( IVMRWindowlessControl iface,
DWORD mode 
)
static

Definition at line 1809 of file vmr9.c.

1811{
1813
1814 FIXME("(%p/%p)->(...) stub\n", iface, This);
1815 return E_NOTIMPL;
1816}

◆ VMR7WindowlessControl_GetBorderColor()

static HRESULT WINAPI VMR7WindowlessControl_GetBorderColor ( IVMRWindowlessControl iface,
COLORREF color 
)
static

Definition at line 1871 of file vmr9.c.

1873{
1875
1876 FIXME("(%p/%p)->(...) stub\n", iface, This);
1877 return E_NOTIMPL;
1878}

◆ VMR7WindowlessControl_GetColorKey()

static HRESULT WINAPI VMR7WindowlessControl_GetColorKey ( IVMRWindowlessControl iface,
COLORREF color 
)
static

Definition at line 1888 of file vmr9.c.

1889{
1891
1892 FIXME("(%p/%p)->(...) stub\n", iface, This);
1893 return E_NOTIMPL;
1894}

◆ VMR7WindowlessControl_GetCurrentImage()

static HRESULT WINAPI VMR7WindowlessControl_GetCurrentImage ( IVMRWindowlessControl iface,
BYTE **  dib 
)
static

Definition at line 1853 of file vmr9.c.

1855{
1857
1858 FIXME("(%p/%p)->(...) stub\n", iface, This);
1859 return E_NOTIMPL;
1860}

◆ VMR7WindowlessControl_GetMaxIdealVideoSize()

static HRESULT WINAPI VMR7WindowlessControl_GetMaxIdealVideoSize ( IVMRWindowlessControl iface,
LONG width,
LONG height 
)
static

Definition at line 1757 of file vmr9.c.

1759{
1761
1762 FIXME("(%p/%p)->(...) stub\n", iface, This);
1763 return E_NOTIMPL;
1764}

◆ VMR7WindowlessControl_GetMinIdealVideoSize()

static HRESULT WINAPI VMR7WindowlessControl_GetMinIdealVideoSize ( IVMRWindowlessControl iface,
LONG width,
LONG height 
)
static

Definition at line 1748 of file vmr9.c.

1750{
1752
1753 FIXME("(%p/%p)->(...) stub\n", iface, This);
1754 return E_NOTIMPL;
1755}

◆ VMR7WindowlessControl_GetNativeVideoSize()

static HRESULT WINAPI VMR7WindowlessControl_GetNativeVideoSize ( IVMRWindowlessControl iface,
LONG width,
LONG height,
LONG arwidth,
LONG arheight 
)
static

Definition at line 1727 of file vmr9.c.

1730{
1732 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", iface, This, width, height, arwidth, arheight);
1733
1734 if (!width || !height || !arwidth || !arheight)
1735 {
1736 ERR("Got no pointer\n");
1737 return E_POINTER;
1738 }
1739
1740 *width = This->bmiheader.biWidth;
1741 *height = This->bmiheader.biHeight;
1742 *arwidth = This->bmiheader.biWidth;
1743 *arheight = This->bmiheader.biHeight;
1744
1745 return S_OK;
1746}
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546

◆ VMR7WindowlessControl_GetVideoPosition()

static HRESULT WINAPI VMR7WindowlessControl_GetVideoPosition ( IVMRWindowlessControl iface,
RECT source,
RECT dest 
)
static

Definition at line 1794 of file vmr9.c.

1796{
1798
1799 if (source)
1800 *source = This->source_rect;
1801
1802 if (dest)
1803 *dest = This->target_rect;
1804
1805 FIXME("(%p/%p)->(%p/%p) stub\n", iface, This, source, dest);
1806 return S_OK;
1807}
static char * dest
Definition: rtl.c:135

◆ VMR7WindowlessControl_QueryInterface()

static HRESULT WINAPI VMR7WindowlessControl_QueryInterface ( IVMRWindowlessControl iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 1708 of file vmr9.c.

1710{
1712 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1713}

◆ VMR7WindowlessControl_Release()

static ULONG WINAPI VMR7WindowlessControl_Release ( IVMRWindowlessControl iface)
static

Definition at line 1721 of file vmr9.c.

1722{
1724 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1725}

◆ VMR7WindowlessControl_RepaintVideo()

static HRESULT WINAPI VMR7WindowlessControl_RepaintVideo ( IVMRWindowlessControl iface,
HWND  hwnd,
HDC  hdc 
)
static

Definition at line 1836 of file vmr9.c.

1838{
1840
1841 FIXME("(%p/%p)->(...) stub\n", iface, This);
1842 return E_NOTIMPL;
1843}

◆ VMR7WindowlessControl_SetAspectRatioMode()

static HRESULT WINAPI VMR7WindowlessControl_SetAspectRatioMode ( IVMRWindowlessControl iface,
DWORD  mode 
)
static

Definition at line 1818 of file vmr9.c.

1820{
1822
1823 FIXME("(%p/%p)->(...) stub\n", iface, This);
1824 return E_NOTIMPL;
1825}

◆ VMR7WindowlessControl_SetBorderColor()

static HRESULT WINAPI VMR7WindowlessControl_SetBorderColor ( IVMRWindowlessControl iface,
COLORREF  color 
)
static

Definition at line 1862 of file vmr9.c.

1864{
1866
1867 FIXME("(%p/%p)->(...) stub\n", iface, This);
1868 return E_NOTIMPL;
1869}

◆ VMR7WindowlessControl_SetColorKey()

static HRESULT WINAPI VMR7WindowlessControl_SetColorKey ( IVMRWindowlessControl iface,
COLORREF  color 
)
static

Definition at line 1880 of file vmr9.c.

1881{
1883
1884 FIXME("(%p/%p)->(...) stub\n", iface, This);
1885 return E_NOTIMPL;
1886}

◆ VMR7WindowlessControl_SetVideoClippingWindow()

static HRESULT WINAPI VMR7WindowlessControl_SetVideoClippingWindow ( IVMRWindowlessControl iface,
HWND  hwnd 
)
static

Definition at line 1827 of file vmr9.c.

1829{
1831
1832 FIXME("(%p/%p)->(...) stub\n", iface, This);
1833 return E_NOTIMPL;
1834}

◆ VMR7WindowlessControl_SetVideoPosition()

static HRESULT WINAPI VMR7WindowlessControl_SetVideoPosition ( IVMRWindowlessControl iface,
const RECT source,
const RECT dest 
)
static

Definition at line 1766 of file vmr9.c.

1768{
1770
1771 TRACE("(%p/%p)->(%p, %p)\n", iface, This, source, dest);
1772
1773 EnterCriticalSection(&This->renderer.filter.csFilter);
1774
1775 if (source)
1776 This->source_rect = *source;
1777 if (dest)
1778 {
1779 This->target_rect = *dest;
1780 if (This->baseControlWindow.baseWindow.hWnd)
1781 {
1782 FIXME("Output rectangle: %s\n", wine_dbgstr_rect(dest));
1783 SetWindowPos(This->baseControlWindow.baseWindow.hWnd, NULL,
1784 dest->left, dest->top, dest->right - dest->left, dest->bottom-dest->top,
1786 }
1787 }
1788
1789 LeaveCriticalSection(&This->renderer.filter.csFilter);
1790
1791 return S_OK;
1792}
static const char * wine_dbgstr_rect(const RECT *prc)
Definition: atltest.h:160
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
#define SWP_NOACTIVATE
Definition: winuser.h:1245
#define SWP_NOREDRAW
Definition: winuser.h:1249
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define SWP_NOCOPYBITS
Definition: winuser.h:1246
#define SWP_NOOWNERZORDER
Definition: winuser.h:1252

◆ VMR9_AddRef()

static ULONG WINAPI VMR9_AddRef ( IBaseFilter iface)
static

Definition at line 893 of file vmr9.c.

894{
895 struct quartz_vmr *This = (struct quartz_vmr*)iface;
896 LONG ret;
897
898 if (This->outer_unk && This->bUnkOuterValid)
899 ret = IUnknown_AddRef(This->outer_unk);
900 else
901 ret = IUnknown_AddRef(&This->IUnknown_inner);
902
903 TRACE("(%p)->AddRef from %d\n", iface, ret - 1);
904
905 return ret;
906}
long LONG
Definition: pedump.c:60
int ret

Referenced by AMCertifiedOutputProtection_AddRef(), AMFilterMiscFlags_AddRef(), Basicvideo_AddRef(), Videowindow_AddRef(), VMR7FilterConfig_AddRef(), VMR7MonitorConfig_AddRef(), VMR7SurfaceAllocatorNotify_AddRef(), VMR7WindowlessControl_AddRef(), VMR9FilterConfig_AddRef(), VMR9MonitorConfig_AddRef(), VMR9SurfaceAllocatorNotify_AddRef(), and VMR9WindowlessControl_AddRef().

◆ VMR9_BreakConnect()

static HRESULT WINAPI VMR9_BreakConnect ( BaseRenderer This)
static

Definition at line 496 of file vmr9.c.

497{
498 struct quartz_vmr *pVMR9 = (struct quartz_vmr*)This;
499 HRESULT hr = S_OK;
500
501 if (!pVMR9->mode)
502 return S_FALSE;
503 if (This->pInputPin->pin.pConnectedTo && pVMR9->allocator && pVMR9->presenter)
504 {
505 if (pVMR9->renderer.filter.state != State_Stopped)
506 {
507 ERR("Disconnecting while not stopped! UNTESTED!!\n");
508 }
509 if (pVMR9->renderer.filter.state == State_Running)
510 hr = IVMRImagePresenter9_StopPresenting(pVMR9->presenter, pVMR9->cookie);
511 IVMRSurfaceAllocatorEx9_TerminateDevice(pVMR9->allocator, pVMR9->cookie);
512 pVMR9->num_surfaces = 0;
513 }
514 return hr;
515}
FILTER_STATE state
Definition: strmbase.h:167
BaseFilter filter
Definition: strmbase.h:580
IVMRImagePresenter9 * presenter
Definition: vmr9.c:65
IVMRSurfaceAllocatorEx9 * allocator
Definition: vmr9.c:64
VMR9Mode mode
Definition: vmr9.c:73
BaseRenderer renderer
Definition: vmr9.c:48
DWORD num_surfaces
Definition: vmr9.c:84
DWORD_PTR cookie
Definition: vmr9.c:86
#define S_FALSE
Definition: winerror.h:2357

◆ VMR9_CheckMediaType()

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

Definition at line 352 of file vmr9.c.

353{
354 struct quartz_vmr *This = (struct quartz_vmr*)iface;
355
356 if (!IsEqualIID(&pmt->majortype, &MEDIATYPE_Video) || !pmt->pbFormat)
357 return S_FALSE;
358
359 /* Ignore subtype, test for bicompression instead */
360 if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo))
361 {
362 VIDEOINFOHEADER *format = (VIDEOINFOHEADER *)pmt->pbFormat;
363
364 This->bmiheader = format->bmiHeader;
365 TRACE("Resolution: %dx%d\n", format->bmiHeader.biWidth, format->bmiHeader.biHeight);
366 This->VideoWidth = format->bmiHeader.biWidth;
367 This->VideoHeight = format->bmiHeader.biHeight;
368 SetRect(&This->source_rect, 0, 0, This->VideoWidth, This->VideoHeight);
369 }
370 else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2))
371 {
372 VIDEOINFOHEADER2 *format = (VIDEOINFOHEADER2 *)pmt->pbFormat;
373
374 This->bmiheader = format->bmiHeader;
375
376 TRACE("Resolution: %dx%d\n", format->bmiHeader.biWidth, format->bmiHeader.biHeight);
377 This->VideoWidth = format->bmiHeader.biWidth;
378 This->VideoHeight = format->bmiHeader.biHeight;
379 SetRect(&This->source_rect, 0, 0, This->VideoWidth, This->VideoHeight);
380 }
381 else
382 {
383 ERR("Format type %s not supported\n", debugstr_guid(&pmt->formattype));
384 return S_FALSE;
385 }
386 if (This->bmiheader.biCompression != BI_RGB)
387 return S_FALSE;
388 return S_OK;
389}
#define BI_RGB
Definition: precomp.h:56
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
Definition: format.c:58
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)

◆ VMR9_CompleteConnect()

static HRESULT WINAPI VMR9_CompleteConnect ( BaseRenderer This,
IPin pReceivePin 
)
static

Definition at line 482 of file vmr9.c.

483{
484 struct quartz_vmr *pVMR9 = (struct quartz_vmr*)This;
485 HRESULT hr;
486
487 TRACE("(%p)\n", This);
488
489 if (pVMR9->mode ||
490 SUCCEEDED(hr = IVMRFilterConfig9_SetRenderingMode(&pVMR9->IVMRFilterConfig9_iface, VMR9Mode_Windowed)))
491 hr = VMR9_maybe_init(pVMR9, FALSE);
492
493 return hr;
494}
IVMRFilterConfig9 IVMRFilterConfig9_iface
Definition: vmr9.c:56
static HRESULT VMR9_maybe_init(struct quartz_vmr *This, BOOL force)
Definition: vmr9.c:391
@ VMR9Mode_Windowed
Definition: vmr9.idl:354

◆ VMR9_DoRenderSample()

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

Definition at line 287 of file vmr9.c.

288{
289 struct quartz_vmr *This = (struct quartz_vmr*)iface;
290 LPBYTE pbSrcStream = NULL;
291 long cbSrcStream = 0;
292 REFERENCE_TIME tStart, tStop;
294 HRESULT hr;
295
296 TRACE("%p %p\n", iface, pSample);
297
298 /* It is possible that there is no device at this point */
299
300 if (!This->allocator || !This->presenter)
301 {
302 ERR("NO PRESENTER!!\n");
303 return S_FALSE;
304 }
305
306 hr = IMediaSample_GetTime(pSample, &tStart, &tStop);
307 if (FAILED(hr))
309 else
311
312 if (IMediaSample_IsDiscontinuity(pSample) == S_OK)
314
315 if (IMediaSample_IsPreroll(pSample) == S_OK)
316 info.dwFlags |= VMR9Sample_Preroll;
317
318 if (IMediaSample_IsSyncPoint(pSample) == S_OK)
319 info.dwFlags |= VMR9Sample_SyncPoint;
320
321 /* If we render ourselves, and this is a preroll sample, discard it */
322 if (This->baseControlWindow.baseWindow.hWnd && (info.dwFlags & VMR9Sample_Preroll))
323 {
324 return S_OK;
325 }
326
327 hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
328 if (FAILED(hr))
329 {
330 ERR("Cannot get pointer to sample data (%x)\n", hr);
331 return hr;
332 }
333
334 cbSrcStream = IMediaSample_GetActualDataLength(pSample);
335
336 info.rtStart = tStart;
337 info.rtEnd = tStop;
338 info.szAspectRatio.cx = This->bmiheader.biWidth;
339 info.szAspectRatio.cy = This->bmiheader.biHeight;
340
341 hr = IVMRSurfaceAllocatorEx9_GetSurface(This->allocator, This->cookie, (++This->cur_surface)%This->num_surfaces, 0, &info.lpSurf);
342
343 if (FAILED(hr))
344 return hr;
345
346 VMR9_SendSampleData(This, &info, pbSrcStream, cbSrcStream);
348
349 return hr;
350}
#define IDirect3DSurface9_Release(p)
Definition: d3d9.h:622
LONGLONG REFERENCE_TIME
Definition: dmusicks.h:9
unsigned char * LPBYTE
Definition: typedefs.h:53
static DWORD VMR9_SendSampleData(struct quartz_vmr *This, VMR9PresentationInfo *info, LPBYTE data, DWORD size)
Definition: vmr9.c:209
@ VMR9Sample_TimeValid
Definition: vmr9.idl:52
@ VMR9Sample_Preroll
Definition: vmr9.idl:50
@ VMR9Sample_Discontinuity
Definition: vmr9.idl:51
@ VMR9Sample_SyncPoint
Definition: vmr9.idl:49
@ VMR9Sample_SrcDstRectsValid
Definition: vmr9.idl:53

◆ VMR9_GetClassWindowStyles()

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

Definition at line 539 of file vmr9.c.

540{
541 static WCHAR classnameW[] = { 'I','V','M','R','9',' ','C','l','a','s','s', 0 };
542
543 *pClassStyles = 0;
544 *pWindowStyles = WS_SIZEBOX;
545 *pWindowStylesEx = 0;
546
547 return classnameW;
548}
#define WS_SIZEBOX
Definition: pedump.c:642

◆ VMR9_GetDefaultRect()

static RECT WINAPI VMR9_GetDefaultRect ( BaseWindow This)
static

Definition at line 550 of file vmr9.c.

551{
552 struct quartz_vmr* pVMR9 = impl_from_BaseWindow(This);
553 static RECT defRect;
554
555 SetRect(&defRect, 0, 0, pVMR9->VideoWidth, pVMR9->VideoHeight);
556
557 return defRect;
558}
LONG VideoHeight
Definition: vmr9.c:94
LONG VideoWidth
Definition: vmr9.c:93
static struct quartz_vmr * impl_from_BaseWindow(BaseWindow *wnd)
Definition: vmr9.c:102

◆ VMR9_GetSourceRect()

static HRESULT WINAPI VMR9_GetSourceRect ( BaseControlVideo *  This,
RECT pSourceRect 
)
static

Definition at line 582 of file vmr9.c.

583{
585 CopyRect(pSourceRect,&pVMR9->source_rect);
586 return S_OK;
587}
RECT source_rect
Definition: vmr9.c:91
static struct quartz_vmr * impl_from_BaseControlVideo(BaseControlVideo *cvid)
Definition: vmr9.c:112
BOOL WINAPI CopyRect(_Out_ LPRECT, _In_ LPCRECT)

◆ VMR9_GetStaticImage()

static HRESULT WINAPI VMR9_GetStaticImage ( BaseControlVideo *  This,
LONG pBufferSize,
LONG pDIBImage 
)
static

Definition at line 589 of file vmr9.c.

590{
592 BITMAPINFOHEADER *bmiHeader;
593 LONG needed_size;
595 char *ptr;
596
597 FIXME("(%p/%p)->(%p, %p): partial stub\n", pVMR9, This, pBufferSize, pDIBImage);
598
600
601 if (!pVMR9->renderer.pMediaSample)
602 {
604 return (pVMR9->renderer.filter.state == State_Paused ? E_UNEXPECTED : VFW_E_NOT_PAUSED);
605 }
606
607 if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo))
608 {
609 bmiHeader = &((VIDEOINFOHEADER *)amt->pbFormat)->bmiHeader;
610 }
611 else if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo2))
612 {
613 bmiHeader = &((VIDEOINFOHEADER2 *)amt->pbFormat)->bmiHeader;
614 }
615 else
616 {
617 FIXME("Unknown type %s\n", debugstr_guid(&amt->subtype));
619 return VFW_E_RUNTIME_ERROR;
620 }
621
622 needed_size = bmiHeader->biSize;
623 needed_size += IMediaSample_GetActualDataLength(pVMR9->renderer.pMediaSample);
624
625 if (!pDIBImage)
626 {
627 *pBufferSize = needed_size;
629 return S_OK;
630 }
631
632 if (needed_size < *pBufferSize)
633 {
634 ERR("Buffer too small %u/%u\n", needed_size, *pBufferSize);
636 return E_FAIL;
637 }
638 *pBufferSize = needed_size;
639
640 memcpy(pDIBImage, bmiHeader, bmiHeader->biSize);
641 IMediaSample_GetPointer(pVMR9->renderer.pMediaSample, (BYTE **)&ptr);
642 memcpy((char *)pDIBImage + bmiHeader->biSize, ptr, IMediaSample_GetActualDataLength(pVMR9->renderer.pMediaSample));
643
645 return S_OK;
646}
#define E_FAIL
Definition: ddrawi.h:102
_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
CRITICAL_SECTION csFilter
Definition: strmbase.h:165
BasePin pin
Definition: strmbase.h:90
AM_MEDIA_TYPE mtCurrent
Definition: strmbase.h:40
BaseInputPin * pInputPin
Definition: strmbase.h:582
IMediaSample * pMediaSample
Definition: strmbase.h:588
#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

◆ VMR9_GetTargetRect()

static HRESULT WINAPI VMR9_GetTargetRect ( BaseControlVideo *  This,
RECT pTargetRect 
)
static

Definition at line 648 of file vmr9.c.

649{
651 CopyRect(pTargetRect,&pVMR9->target_rect);
652 return S_OK;
653}
RECT target_rect
Definition: vmr9.c:92

◆ VMR9_GetVideoFormat()

static VIDEOINFOHEADER *WINAPI VMR9_GetVideoFormat ( BaseControlVideo *  This)
static

Definition at line 655 of file vmr9.c.

656{
658 AM_MEDIA_TYPE *pmt;
659
660 TRACE("(%p/%p)\n", pVMR9, This);
661
662 pmt = &pVMR9->renderer.pInputPin->pin.mtCurrent;
663 if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo)) {
664 return (VIDEOINFOHEADER*)pmt->pbFormat;
665 } else if (IsEqualIID(&pmt->formattype, &FORMAT_VideoInfo2)) {
666 static VIDEOINFOHEADER vih;
667 VIDEOINFOHEADER2 *vih2 = (VIDEOINFOHEADER2*)pmt->pbFormat;
668 memcpy(&vih,vih2,sizeof(VIDEOINFOHEADER));
669 memcpy(&vih.bmiHeader, &vih2->bmiHeader, sizeof(BITMAPINFOHEADER));
670 return &vih;
671 } else {
672 ERR("Unknown format type %s\n", qzdebugstr_guid(&pmt->formattype));
673 return NULL;
674 }
675}
const char * qzdebugstr_guid(const GUID *id)
Definition: main.c:279
BITMAPINFOHEADER bmiHeader
Definition: dvdmedia.h:41
BITMAPINFOHEADER bmiHeader
Definition: amvideo.idl:189

◆ VMR9_ImagePresenter_AddRef()

static ULONG WINAPI VMR9_ImagePresenter_AddRef ( IVMRImagePresenter9 iface)
static

Definition at line 2482 of file vmr9.c.

2483{
2485 ULONG refCount = InterlockedIncrement(&This->refCount);
2486
2487 TRACE("(%p)->() AddRef from %d\n", iface, refCount - 1);
2488
2489 return refCount;
2490}
#define InterlockedIncrement
Definition: armddk.h:53
uint32_t ULONG
Definition: typedefs.h:59
static VMR9DefaultAllocatorPresenterImpl * impl_from_IVMRImagePresenter9(IVMRImagePresenter9 *iface)
Definition: vmr9.c:197

Referenced by VMR9_SurfaceAllocator_AddRef().

◆ VMR9_ImagePresenter_PresentImage()

static HRESULT WINAPI VMR9_ImagePresenter_PresentImage ( IVMRImagePresenter9 iface,
DWORD_PTR  id,
VMR9PresentationInfo info 
)
static

Definition at line 2616 of file vmr9.c.

2617{
2619 HRESULT hr;
2620 RECT output;
2621 BOOL render = FALSE;
2622
2623 TRACE("(%p/%p/%p)->(...) stub\n", iface, This, This->pVMR9);
2624 GetWindowRect(This->pVMR9->baseControlWindow.baseWindow.hWnd, &output);
2625 TRACE("Output rectangle: %s\n", wine_dbgstr_rect(&output));
2626
2627 /* This might happen if we don't have active focus (eg on a different virtual desktop) */
2628 if (!This->d3d9_dev)
2629 return S_OK;
2630
2631 /* Display image here */
2632 hr = IDirect3DDevice9_Clear(This->d3d9_dev, 0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0);
2633 if (FAILED(hr))
2634 FIXME("hr: %08x\n", hr);
2635 hr = IDirect3DDevice9_BeginScene(This->d3d9_dev);
2636 if (SUCCEEDED(hr))
2637 {
2638 if (This->d3d9_vertex)
2640 else
2642 render = SUCCEEDED(hr);
2643 }
2644 else
2645 FIXME("BeginScene: %08x\n", hr);
2646 hr = IDirect3DDevice9_EndScene(This->d3d9_dev);
2647 if (render && SUCCEEDED(hr))
2648 {
2649 hr = IDirect3DDevice9_Present(This->d3d9_dev, NULL, NULL, This->pVMR9->baseControlWindow.baseWindow.hWnd, NULL);
2650 if (FAILED(hr))
2651 FIXME("Presenting image: %08x\n", hr);
2652 }
2653
2654 return S_OK;
2655}
#define D3DCOLOR_XRGB(r, g, b)
Definition: d3d8types.h:44
#define D3DCLEAR_TARGET
Definition: d3d8types.h:30
#define IDirect3DDevice9_EndScene(p)
Definition: d3d9.h:1549
#define IDirect3DDevice9_BeginScene(p)
Definition: d3d9.h:1548
#define IDirect3DDevice9_Present(p, a, b, c, d)
Definition: d3d9.h:1524
#define IDirect3DDevice9_Clear(p, a, b, c, d, e, f)
Definition: d3d9.h:1550
static void render(void)
Definition: ssstars.c:272
static HRESULT VMR9_ImagePresenter_PresentTexture(VMR9DefaultAllocatorPresenterImpl *This, IDirect3DSurface9 *surface)
Definition: vmr9.c:2548
static HRESULT VMR9_ImagePresenter_PresentOffscreenSurface(VMR9DefaultAllocatorPresenterImpl *This, IDirect3DSurface9 *surface)
Definition: vmr9.c:2591
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)

◆ VMR9_ImagePresenter_PresentOffscreenSurface()

static HRESULT VMR9_ImagePresenter_PresentOffscreenSurface ( VMR9DefaultAllocatorPresenterImpl This,
IDirect3DSurface9 *  surface 
)
static

Definition at line 2591 of file vmr9.c.

2592{
2593 HRESULT hr;
2594 IDirect3DSurface9 *target = NULL;
2595 RECT target_rect;
2596
2598 if (FAILED(hr))
2599 {
2600 ERR("IDirect3DDevice9_GetBackBuffer -- %08x\n", hr);
2601 return hr;
2602 }
2603
2604 /* Move rect to origin and flip it */
2605 SetRect(&target_rect, 0, This->pVMR9->target_rect.bottom - This->pVMR9->target_rect.top,
2606 This->pVMR9->target_rect.right - This->pVMR9->target_rect.left, 0);
2607
2608 hr = IDirect3DDevice9_StretchRect(This->d3d9_dev, surface, &This->pVMR9->source_rect, target, &target_rect, D3DTEXF_LINEAR);
2609 if (FAILED(hr))
2610 ERR("IDirect3DDevice9_StretchRect -- %08x\n", hr);
2612
2613 return hr;
2614}
@ D3DTEXF_LINEAR
Definition: d3d8types.h:872
@ D3DBACKBUFFER_TYPE_MONO
Definition: d3d8types.h:493
#define IDirect3DDevice9_GetBackBuffer(p, a, b, c, d)
Definition: d3d9.h:1525
#define IDirect3DDevice9_StretchRect(p, a, b, c, d, e)
Definition: d3d9.h:1541
GLenum target
Definition: glext.h:7315

Referenced by VMR9_ImagePresenter_PresentImage().

◆ VMR9_ImagePresenter_PresentTexture()

static HRESULT VMR9_ImagePresenter_PresentTexture ( VMR9DefaultAllocatorPresenterImpl This,
IDirect3DSurface9 *  surface 
)
static

Definition at line 2548 of file vmr9.c.

2549{
2550 IDirect3DTexture9 *texture = NULL;
2551 HRESULT hr;
2552
2554 if (FAILED(hr))
2555 {
2556 FIXME("SetFVF: %08x\n", hr);
2557 return hr;
2558 }
2559
2560 hr = IDirect3DDevice9_SetStreamSource(This->d3d9_dev, 0, This->d3d9_vertex, 0, sizeof(struct VERTEX));
2561 if (FAILED(hr))
2562 {
2563 FIXME("SetStreamSource: %08x\n", hr);
2564 return hr;
2565 }
2566
2567 hr = IDirect3DSurface9_GetContainer(surface, &IID_IDirect3DTexture9, (void **) &texture);
2568 if (FAILED(hr))
2569 {
2570 FIXME("IDirect3DSurface9_GetContainer failed\n");
2571 return hr;
2572 }
2573 hr = IDirect3DDevice9_SetTexture(This->d3d9_dev, 0, (IDirect3DBaseTexture9 *)texture);
2575 if (FAILED(hr))
2576 {
2577 FIXME("SetTexture: %08x\n", hr);
2578 return hr;
2579 }
2580
2582 if (FAILED(hr))
2583 {
2584 FIXME("DrawPrimitive: %08x\n", hr);
2585 return hr;
2586 }
2587
2588 return S_OK;
2589}
@ D3DPT_TRIANGLESTRIP
Definition: d3d8types.h:722
#define IDirect3DDevice9_SetFVF(p, a)
Definition: d3d9.h:1596
#define IDirect3DDevice9_SetStreamSource(p, a, b, c, d)
Definition: d3d9.h:1607
#define IDirect3DSurface9_GetContainer(p, a, b)
Definition: d3d9.h:633
#define IDirect3DDevice9_DrawPrimitive(p, a, b, c)
Definition: d3d9.h:1588
#define IDirect3DDevice9_SetTexture(p, a, b)
Definition: d3d9.h:1572
#define IDirect3DTexture9_Release(p)
Definition: d3d9.h:1014
GLenum GLuint texture
Definition: glext.h:6295
Definition: vmr9.c:2546
#define USED_FVF
Definition: vmr9.c:2545

Referenced by VMR9_ImagePresenter_PresentImage().

◆ VMR9_ImagePresenter_QueryInterface()

static HRESULT WINAPI VMR9_ImagePresenter_QueryInterface ( IVMRImagePresenter9 iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 2457 of file vmr9.c.

2458{
2460 TRACE("(%p/%p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv);
2461
2462 *ppv = NULL;
2463
2465 *ppv = (LPVOID)&(This->IVMRImagePresenter9_iface);
2466 else if (IsEqualIID(riid, &IID_IVMRImagePresenter9))
2467 *ppv = &This->IVMRImagePresenter9_iface;
2468 else if (IsEqualIID(riid, &IID_IVMRSurfaceAllocatorEx9))
2469 *ppv = &This->IVMRSurfaceAllocatorEx9_iface;
2470
2471 if (*ppv)
2472 {
2473 IUnknown_AddRef((IUnknown *)(*ppv));
2474 return S_OK;
2475 }
2476
2477 FIXME("No interface for %s\n", debugstr_guid(riid));
2478
2479 return E_NOINTERFACE;
2480}
const GUID IID_IUnknown
if(dx< 0)
Definition: linetemp.h:194
#define LPVOID
Definition: nt_native.h:45
#define E_NOINTERFACE
Definition: winerror.h:2364

Referenced by VMR9_SurfaceAllocator_QueryInterface().

◆ VMR9_ImagePresenter_Release()

static ULONG WINAPI VMR9_ImagePresenter_Release ( IVMRImagePresenter9 iface)
static

Definition at line 2492 of file vmr9.c.

2493{
2495 ULONG refCount = InterlockedDecrement(&This->refCount);
2496
2497 TRACE("(%p)->() Release from %d\n", iface, refCount + 1);
2498
2499 if (!refCount)
2500 {
2501 DWORD i;
2502 TRACE("Destroying\n");
2503 CloseHandle(This->ack);
2504 IDirect3D9_Release(This->d3d9_ptr);
2505
2506 TRACE("Number of surfaces: %u\n", This->num_surfaces);
2507 for (i = 0; i < This->num_surfaces; ++i)
2508 {
2509 IDirect3DSurface9 *surface = This->d3d9_surfaces[i];
2510 TRACE("Releasing surface %p\n", surface);
2511 if (surface)
2513 }
2514
2515 CoTaskMemFree(This->d3d9_surfaces);
2516 This->d3d9_surfaces = NULL;
2517 This->num_surfaces = 0;
2518 if (This->d3d9_vertex)
2519 {
2521 This->d3d9_vertex = NULL;
2522 }
2524 return 0;
2525 }
2526 return refCount;
2527}
#define InterlockedDecrement
Definition: armddk.h:52
#define IDirect3DVertexBuffer9_Release(p)
Definition: d3d9.h:696
#define IDirect3D9_Release(p)
Definition: d3d9.h:220
#define CloseHandle
Definition: compat.h:739
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
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442

Referenced by VMR9_SurfaceAllocator_Release().

◆ VMR9_ImagePresenter_StartPresenting()

static HRESULT WINAPI VMR9_ImagePresenter_StartPresenting ( IVMRImagePresenter9 iface,
DWORD_PTR  id 
)
static

Definition at line 2529 of file vmr9.c.

2530{
2532
2533 TRACE("(%p/%p/%p)->(...) stub\n", iface, This,This->pVMR9);
2534 return S_OK;
2535}

◆ VMR9_ImagePresenter_StopPresenting()

static HRESULT WINAPI VMR9_ImagePresenter_StopPresenting ( IVMRImagePresenter9 iface,
DWORD_PTR  id 
)
static

Definition at line 2537 of file vmr9.c.

2538{
2540
2541 TRACE("(%p/%p/%p)->(...) stub\n", iface, This,This->pVMR9);
2542 return S_OK;
2543}

◆ VMR9_IsDefaultSourceRect()

static HRESULT WINAPI VMR9_IsDefaultSourceRect ( BaseControlVideo *  This)
static

Definition at line 677 of file vmr9.c.

678{
680 FIXME("(%p/%p)->(): stub !!!\n", pVMR9, This);
681
682 return S_OK;
683}

◆ VMR9_IsDefaultTargetRect()

static HRESULT WINAPI VMR9_IsDefaultTargetRect ( BaseControlVideo *  This)
static

Definition at line 685 of file vmr9.c.

686{
688 FIXME("(%p/%p)->(): stub !!!\n", pVMR9, This);
689
690 return S_OK;
691}

◆ VMR9_maybe_init()

static HRESULT VMR9_maybe_init ( struct quartz_vmr This,
BOOL  force 
)
static

Definition at line 391 of file vmr9.c.

392{
395 HRESULT hr;
396
397 TRACE("my mode: %u, my window: %p, my last window: %p\n", This->mode, This->baseControlWindow.baseWindow.hWnd, This->hWndClippingWindow);
398 if (This->baseControlWindow.baseWindow.hWnd || !This->renderer.pInputPin->pin.pConnectedTo)
399 return S_OK;
400
401 if (This->mode == VMR9Mode_Windowless && !This->hWndClippingWindow)
402 return (force ? VFW_E_RUNTIME_ERROR : S_OK);
403
404 TRACE("Initializing\n");
406 info.dwHeight = This->source_rect.bottom;
407 info.dwWidth = This->source_rect.right;
408 info.Pool = D3DPOOL_DEFAULT;
409 info.MinBuffers = 2;
410 FIXME("Reduce ratio to least common denominator\n");
411 info.szAspectRatio.cx = info.dwWidth;
412 info.szAspectRatio.cy = info.dwHeight;
413 info.szNativeSize.cx = This->bmiheader.biWidth;
414 info.szNativeSize.cy = This->bmiheader.biHeight;
415 buffers = 2;
416
417 switch (This->bmiheader.biBitCount)
418 {
419 case 8: info.Format = D3DFMT_R3G3B2; break;
420 case 15: info.Format = D3DFMT_X1R5G5B5; break;
421 case 16: info.Format = D3DFMT_R5G6B5; break;
422 case 24: info.Format = D3DFMT_R8G8B8; break;
423 case 32: info.Format = D3DFMT_X8R8G8B8; break;
424 default:
425 FIXME("Unknown bpp %u\n", This->bmiheader.biBitCount);
427 }
428
429 This->cur_surface = 0;
430 if (This->num_surfaces)
431 {
432 ERR("num_surfaces or d3d9_surfaces not 0\n");
433 return E_FAIL;
434 }
435
436 hr = IVMRSurfaceAllocatorEx9_InitializeDevice(This->allocator, This->cookie, &info, &buffers);
437 if (SUCCEEDED(hr))
438 {
439 SetRect(&This->source_rect, 0, 0, This->bmiheader.biWidth, This->bmiheader.biHeight);
440
441 This->num_surfaces = buffers;
442 }
443 return hr;
444}
@ D3DFMT_X1R5G5B5
Definition: d3d8types.h:607
@ D3DFMT_R8G8B8
Definition: d3d8types.h:603
@ D3DFMT_R3G3B2
Definition: d3d8types.h:610
@ D3DFMT_R5G6B5
Definition: d3d8types.h:606
@ D3DFMT_X8R8G8B8
Definition: d3d8types.h:605
@ D3DPOOL_DEFAULT
Definition: d3d8types.h:709
const GLuint * buffers
Definition: glext.h:5916
@ VMR9AllocFlag_TextureSurface
Definition: vmr9.idl:87
@ VMR9Mode_Windowless
Definition: vmr9.idl:355

Referenced by VMR9_CompleteConnect(), VMR9_OnStartStreaming(), and VMR9WindowlessControl_SetVideoClippingWindow().

◆ VMR9_OnSize()

static BOOL WINAPI VMR9_OnSize ( BaseWindow This,
LONG  Width,
LONG  Height 
)
static

Definition at line 560 of file vmr9.c.

561{
562 struct quartz_vmr* pVMR9 = impl_from_BaseWindow(This);
563
564 TRACE("WM_SIZE %d %d\n", Width, Height);
565 GetClientRect(This->hWnd, &pVMR9->target_rect);
566 TRACE("WM_SIZING: DestRect=(%d,%d),(%d,%d)\n",
567 pVMR9->target_rect.left,
568 pVMR9->target_rect.top,
569 pVMR9->target_rect.right - pVMR9->target_rect.left,
570 pVMR9->target_rect.bottom - pVMR9->target_rect.top);
572}
BOOL WINAPI BaseWindowImpl_OnSize(BaseWindow *This, LONG Height, LONG Width)
Definition: window.c:73
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)

◆ VMR9_OnStartStreaming()

static VOID WINAPI VMR9_OnStartStreaming ( BaseRenderer iface)
static

Definition at line 446 of file vmr9.c.

447{
448 struct quartz_vmr *This = (struct quartz_vmr*)iface;
449
450 TRACE("(%p)\n", This);
451
453 IVMRImagePresenter9_StartPresenting(This->presenter, This->cookie);
454 SetWindowPos(This->baseControlWindow.baseWindow.hWnd, NULL,
455 This->source_rect.left,
456 This->source_rect.top,
457 This->source_rect.right - This->source_rect.left,
458 This->source_rect.bottom - This->source_rect.top,
460 ShowWindow(This->baseControlWindow.baseWindow.hWnd, SW_SHOW);
461 GetClientRect(This->baseControlWindow.baseWindow.hWnd, &This->target_rect);
462}
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
#define SWP_NOMOVE
Definition: winuser.h:1247
#define SWP_DEFERERASE
Definition: winuser.h:1255
#define SW_SHOW
Definition: winuser.h:778
#define SWP_NOZORDER
Definition: winuser.h:1250

◆ VMR9_OnStopStreaming()

static VOID WINAPI VMR9_OnStopStreaming ( BaseRenderer iface)
static

Definition at line 464 of file vmr9.c.

465{
466 struct quartz_vmr *This = (struct quartz_vmr*)iface;
467
468 TRACE("(%p)\n", This);
469
470 if (This->renderer.filter.state == State_Running)
471 IVMRImagePresenter9_StopPresenting(This->presenter, This->cookie);
472}

◆ VMR9_QueryInterface()

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

Definition at line 863 of file vmr9.c.

864{
865 struct quartz_vmr *This = (struct quartz_vmr*)iface;
866
867 if (This->bAggregatable)
868 This->bUnkOuterValid = TRUE;
869
870 if (This->outer_unk)
871 {
872 if (This->bAggregatable)
873 return IUnknown_QueryInterface(This->outer_unk, riid, ppv);
874
876 {
877 HRESULT hr;
878
879 IUnknown_AddRef(&This->IUnknown_inner);
880 hr = IUnknown_QueryInterface(&This->IUnknown_inner, riid, ppv);
881 IUnknown_Release(&This->IUnknown_inner);
882 This->bAggregatable = TRUE;
883 return hr;
884 }
885
886 *ppv = NULL;
887 return E_NOINTERFACE;
888 }
889
890 return IUnknown_QueryInterface(&This->IUnknown_inner, riid, ppv);
891}

Referenced by AMCertifiedOutputProtection_QueryInterface(), AMFilterMiscFlags_QueryInterface(), Basicvideo_QueryInterface(), Videowindow_QueryInterface(), VMR7FilterConfig_QueryInterface(), VMR7MonitorConfig_QueryInterface(), VMR7SurfaceAllocatorNotify_QueryInterface(), VMR7WindowlessControl_QueryInterface(), VMR9FilterConfig_QueryInterface(), VMR9MonitorConfig_QueryInterface(), VMR9SurfaceAllocatorNotify_QueryInterface(), and VMR9WindowlessControl_QueryInterface().

◆ VMR9_Release()

static ULONG WINAPI VMR9_Release ( IBaseFilter iface)
static

Definition at line 908 of file vmr9.c.

909{
910 struct quartz_vmr *This = (struct quartz_vmr*)iface;
911 LONG ret;
912
913 if (This->outer_unk && This->bUnkOuterValid)
914 ret = IUnknown_Release(This->outer_unk);
915 else
916 ret = IUnknown_Release(&This->IUnknown_inner);
917
918 TRACE("(%p)->Release from %d\n", iface, ret + 1);
919
920 if (ret)
921 return ret;
922 return 0;
923}

Referenced by AMCertifiedOutputProtection_Release(), AMFilterMiscFlags_Release(), Basicvideo_Release(), Videowindow_Release(), VMR7FilterConfig_Release(), VMR7MonitorConfig_Release(), VMR7SurfaceAllocatorNotify_Release(), VMR7WindowlessControl_Release(), VMR9FilterConfig_Release(), VMR9MonitorConfig_Release(), VMR9SurfaceAllocatorNotify_Release(), and VMR9WindowlessControl_Release().

◆ VMR9_SendSampleData()

static DWORD VMR9_SendSampleData ( struct quartz_vmr This,
VMR9PresentationInfo info,
LPBYTE  data,
DWORD  size 
)
static

Definition at line 209 of file vmr9.c.

211{
212 AM_MEDIA_TYPE *amt;
213 HRESULT hr = S_OK;
214 int width;
215 int height;
216 BITMAPINFOHEADER *bmiHeader;
218
219 TRACE("%p %p %d\n", This, data, size);
220
221 amt = &This->renderer.pInputPin->pin.mtCurrent;
222
223 if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo))
224 {
225 bmiHeader = &((VIDEOINFOHEADER *)amt->pbFormat)->bmiHeader;
226 }
227 else if (IsEqualIID(&amt->formattype, &FORMAT_VideoInfo2))
228 {
229 bmiHeader = &((VIDEOINFOHEADER2 *)amt->pbFormat)->bmiHeader;
230 }
231 else
232 {
233 FIXME("Unknown type %s\n", debugstr_guid(&amt->subtype));
234 return VFW_E_RUNTIME_ERROR;
235 }
236
237 TRACE("biSize = %d\n", bmiHeader->biSize);
238 TRACE("biWidth = %d\n", bmiHeader->biWidth);
239 TRACE("biHeight = %d\n", bmiHeader->biHeight);
240 TRACE("biPlanes = %d\n", bmiHeader->biPlanes);
241 TRACE("biBitCount = %d\n", bmiHeader->biBitCount);
242 TRACE("biCompression = %s\n", debugstr_an((LPSTR)&(bmiHeader->biCompression), 4));
243 TRACE("biSizeImage = %d\n", bmiHeader->biSizeImage);
244
245 width = bmiHeader->biWidth;
246 height = bmiHeader->biHeight;
247
248 TRACE("Src Rect: %s\n", wine_dbgstr_rect(&This->source_rect));
249 TRACE("Dst Rect: %s\n", wine_dbgstr_rect(&This->target_rect));
250
252 if (FAILED(hr))
253 {
254 ERR("IDirect3DSurface9_LockRect failed (%x)\n",hr);
255 return hr;
256 }
257
258 if (height > 0) {
259 /* Bottom up image needs inverting */
260 lock.pBits = (char *)lock.pBits + (height * lock.Pitch);
261 while (height--)
262 {
263 lock.pBits = (char *)lock.pBits - lock.Pitch;
264 memcpy(lock.pBits, data, width * bmiHeader->biBitCount / 8);
265 data = data + width * bmiHeader->biBitCount / 8;
266 }
267 }
268 else if (lock.Pitch != width * bmiHeader->biBitCount / 8)
269 {
270 WARN("Slow path! %u/%u\n", lock.Pitch, width * bmiHeader->biBitCount/8);
271
272 while (height--)
273 {
274 memcpy(lock.pBits, data, width * bmiHeader->biBitCount / 8);
275 data = data + width * bmiHeader->biBitCount / 8;
276 lock.pBits = (char *)lock.pBits + lock.Pitch;
277 }
278 }
279 else memcpy(lock.pBits, data, size);
280
282
283 hr = IVMRImagePresenter9_PresentImage(This->presenter, This->cookie, info);
284 return hr;
285}
#define WARN(fmt,...)
Definition: precomp.h:61
#define D3DLOCK_DISCARD
Definition: d3d8types.h:72
#define IDirect3DSurface9_LockRect(p, a, b, c)
Definition: d3d9.h:635
#define IDirect3DSurface9_UnlockRect(p)
Definition: d3d9.h:636
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
rwlock_t lock
Definition: tcpcore.h:0
char * LPSTR
Definition: xmlstorage.h:182

Referenced by VMR9_DoRenderSample().

◆ VMR9_SetDefaultSourceRect()

static HRESULT WINAPI VMR9_SetDefaultSourceRect ( BaseControlVideo *  This)
static

Definition at line 693 of file vmr9.c.

694{
696
697 SetRect(&pVMR9->source_rect, 0, 0, pVMR9->VideoWidth, pVMR9->VideoHeight);
698
699 return S_OK;
700}

◆ VMR9_SetDefaultTargetRect()

static HRESULT WINAPI VMR9_SetDefaultTargetRect ( BaseControlVideo *  This)
static

Definition at line 702 of file vmr9.c.

703{
704 RECT rect;
706
707 if (!GetClientRect(pVMR9->baseControlWindow.baseWindow.hWnd, &rect))
708 return E_FAIL;
709
710 SetRect(&pVMR9->target_rect, 0, 0, rect.right, rect.bottom);
711
712 return S_OK;
713}
& rect
Definition: startmenu.cpp:1413
BaseControlWindow baseControlWindow
Definition: vmr9.c:49

◆ VMR9_SetSourceRect()

static HRESULT WINAPI VMR9_SetSourceRect ( BaseControlVideo *  This,
RECT pSourceRect 
)
static

Definition at line 715 of file vmr9.c.

716{
718 CopyRect(&pVMR9->source_rect,pSourceRect);
719 return S_OK;
720}

◆ VMR9_SetTargetRect()

static HRESULT WINAPI VMR9_SetTargetRect ( BaseControlVideo *  This,
RECT pTargetRect 
)
static

Definition at line 722 of file vmr9.c.

723{
725 CopyRect(&pVMR9->target_rect,pTargetRect);
726 return S_OK;
727}

◆ VMR9_ShouldDrawSampleNow()

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

Definition at line 474 of file vmr9.c.

475{
476 /* Preroll means the sample isn't shown, this is used for key frames and things like that */
477 if (IMediaSample_IsPreroll(pSample) == S_OK)
478 return E_FAIL;
479 return S_FALSE;
480}

◆ VMR9_SurfaceAllocator_AddRef()

static ULONG WINAPI VMR9_SurfaceAllocator_AddRef ( IVMRSurfaceAllocatorEx9 iface)
static

Definition at line 2674 of file vmr9.c.

2675{
2677
2678 return VMR9_ImagePresenter_AddRef(&This->IVMRImagePresenter9_iface);
2679}
static VMR9DefaultAllocatorPresenterImpl * impl_from_IVMRSurfaceAllocatorEx9(IVMRSurfaceAllocatorEx9 *iface)
Definition: vmr9.c:202
static ULONG WINAPI VMR9_ImagePresenter_AddRef(IVMRImagePresenter9 *iface)
Definition: vmr9.c:2482

◆ VMR9_SurfaceAllocator_AdviseNotify()

static HRESULT WINAPI VMR9_SurfaceAllocator_AdviseNotify ( IVMRSurfaceAllocatorEx9 iface,
IVMRSurfaceAllocatorNotify9 allocnotify 
)
static

Definition at line 3025 of file vmr9.c.

3026{
3028
3029 TRACE("(%p/%p)->(...)\n", iface, This);
3030
3031 /* No AddRef taken here or the base VMR9 filter would never be destroyed */
3032 This->SurfaceAllocatorNotify = allocnotify;
3033 return S_OK;
3034}

◆ VMR9_SurfaceAllocator_GetSurface()

static HRESULT WINAPI VMR9_SurfaceAllocator_GetSurface ( IVMRSurfaceAllocatorEx9 iface,
DWORD_PTR  id,
DWORD  surfaceindex,
DWORD  flags,
IDirect3DSurface9 **  surface 
)
static

Definition at line 3001 of file vmr9.c.

3002{
3004
3005 /* Update everything first, this is needed because the surface might be destroyed in the reset */
3006 if (!This->d3d9_dev)
3007 {
3008 TRACE("Device has left me!\n");
3009 return E_FAIL;
3010 }
3011
3013
3014 if (surfaceindex >= This->num_surfaces)
3015 {
3016 ERR("surfaceindex is greater than num_surfaces\n");
3017 return E_FAIL;
3018 }
3019 *surface = This->d3d9_surfaces[surfaceindex];
3020 IDirect3DSurface9_AddRef(*surface);
3021
3022 return S_OK;
3023}
#define IDirect3DSurface9_AddRef(p)
Definition: d3d9.h:621
static HRESULT VMR9_SurfaceAllocator_UpdateDeviceReset(VMR9DefaultAllocatorPresenterImpl *This)
Definition: vmr9.c:2892

◆ VMR9_SurfaceAllocator_InitializeDevice()

static HRESULT WINAPI VMR9_SurfaceAllocator_InitializeDevice ( IVMRSurfaceAllocatorEx9 iface,
DWORD_PTR  id,
VMR9AllocationInfo allocinfo,
DWORD numbuffers 
)
static

Definition at line 2852 of file vmr9.c.

2853{
2855
2856 if (This->pVMR9->mode != VMR9Mode_Windowed && !This->pVMR9->hWndClippingWindow)
2857 {
2858 ERR("No window set\n");
2859 return VFW_E_WRONG_STATE;
2860 }
2861
2862 This->info = *allocinfo;
2863
2864 if (!CreateRenderingWindow(This, allocinfo, numbuffers))
2865 {
2866 ERR("Failed to create rendering window, expect no output!\n");
2867 return VFW_E_WRONG_STATE;
2868 }
2869
2870 return S_OK;
2871}
#define VFW_E_WRONG_STATE
Definition: vfwmsgs.h:78
static BOOL CreateRenderingWindow(VMR9DefaultAllocatorPresenterImpl *This, VMR9AllocationInfo *info, DWORD *numbuffers)
Definition: vmr9.c:2790

◆ VMR9_SurfaceAllocator_QueryInterface()

static HRESULT WINAPI VMR9_SurfaceAllocator_QueryInterface ( IVMRSurfaceAllocatorEx9 iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 2667 of file vmr9.c.

2668{
2670
2671 return VMR9_ImagePresenter_QueryInterface(&This->IVMRImagePresenter9_iface, riid, ppv);
2672}
static HRESULT WINAPI VMR9_ImagePresenter_QueryInterface(IVMRImagePresenter9 *iface, REFIID riid, LPVOID *ppv)
Definition: vmr9.c:2457

◆ VMR9_SurfaceAllocator_Release()

static ULONG WINAPI VMR9_SurfaceAllocator_Release ( IVMRSurfaceAllocatorEx9 iface)
static

Definition at line 2681 of file vmr9.c.

2682{
2684
2685 return VMR9_ImagePresenter_Release(&This->IVMRImagePresenter9_iface);
2686}
static ULONG WINAPI VMR9_ImagePresenter_Release(IVMRImagePresenter9 *iface)
Definition: vmr9.c:2492

◆ VMR9_SurfaceAllocator_SetAllocationSettings()

static HRESULT VMR9_SurfaceAllocator_SetAllocationSettings ( VMR9DefaultAllocatorPresenterImpl This,
VMR9AllocationInfo allocinfo 
)
static

Definition at line 2688 of file vmr9.c.

2689{
2690 D3DCAPS9 caps;
2691 UINT width, height;
2692 HRESULT hr;
2693
2694 if (!(allocinfo->dwFlags & VMR9AllocFlag_TextureSurface))
2695 /* Only needed for texture surfaces */
2696 return S_OK;
2697
2698 hr = IDirect3DDevice9_GetDeviceCaps(This->d3d9_dev, &caps);
2699 if (FAILED(hr))
2700 return hr;
2701
2703 {
2704 width = allocinfo->dwWidth;
2705 height = allocinfo->dwHeight;
2706 }
2707 else
2708 {
2709 width = height = 1;
2710 while (width < allocinfo->dwWidth)
2711 width *= 2;
2712
2713 while (height < allocinfo->dwHeight)
2714 height *= 2;
2715 FIXME("NPOW2 support missing, not using proper surfaces!\n");
2716 }
2717
2719 {
2720 if (height > width)
2721 width = height;
2722 else
2723 height = width;
2724 FIXME("Square texture support required..\n");
2725 }
2726
2727 hr = IDirect3DDevice9_CreateVertexBuffer(This->d3d9_dev, 4 * sizeof(struct VERTEX), D3DUSAGE_WRITEONLY, USED_FVF, allocinfo->Pool, &This->d3d9_vertex, NULL);
2728 if (FAILED(hr))
2729 {
2730 ERR("Couldn't create vertex buffer: %08x\n", hr);
2731 return hr;
2732 }
2733
2734 This->reset = TRUE;
2735 allocinfo->dwHeight = height;
2736 allocinfo->dwWidth = width;
2737
2738 return hr;
2739}
#define D3DPTEXTURECAPS_SQUAREONLY
Definition: d3d8caps.h:116
#define D3DPTEXTURECAPS_POW2
Definition: d3d8caps.h:114
#define D3DUSAGE_WRITEONLY
Definition: d3d8types.h:93
#define IDirect3DDevice9_GetDeviceCaps(p, a)
Definition: d3d9.h:1514
#define IDirect3DDevice9_CreateVertexBuffer(p, a, b, c, d, e, f)
Definition: d3d9.h:1533
static const WCHAR dwWidth[]
Definition: provider.c:62
static const WCHAR dwHeight[]
Definition: provider.c:63
DWORD TextureCaps
Definition: d3d9caps.h:279

Referenced by CreateRenderingWindow().

◆ VMR9_SurfaceAllocator_TerminateDevice()

static HRESULT WINAPI VMR9_SurfaceAllocator_TerminateDevice ( IVMRSurfaceAllocatorEx9 iface,
DWORD_PTR  id 
)
static

Definition at line 2873 of file vmr9.c.

2874{
2876
2877 if (!This->pVMR9->baseControlWindow.baseWindow.hWnd)
2878 {
2879 return S_OK;
2880 }
2881
2882 SendMessageW(This->pVMR9->baseControlWindow.baseWindow.hWnd, WM_CLOSE, 0, 0);
2883 PostThreadMessageW(This->tid, WM_QUIT, 0, 0);
2884 WaitForSingleObject(This->hWndThread, INFINITE);
2885 This->hWndThread = NULL;
2886 BaseWindowImpl_DoneWithWindow(&This->pVMR9->baseControlWindow.baseWindow);
2887
2888 return S_OK;
2889}
#define WM_CLOSE
Definition: winuser.h:1624
#define WM_QUIT
Definition: winuser.h:1626
BOOL WINAPI PostThreadMessageW(_In_ DWORD, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

◆ VMR9_SurfaceAllocator_UpdateDeviceReset()

static HRESULT VMR9_SurfaceAllocator_UpdateDeviceReset ( VMR9DefaultAllocatorPresenterImpl This)
static

Definition at line 2892 of file vmr9.c.

2893{
2894 struct VERTEX t_vert[4];
2895 UINT width, height;
2896 unsigned int i;
2897 void *bits = NULL;
2899 HRESULT hr;
2900
2901 if (!This->pVMR9->baseControlWindow.baseWindow.hWnd)
2902 {
2903 ERR("No window\n");
2904 return E_FAIL;
2905 }
2906
2907 if (!This->d3d9_surfaces || !This->reset)
2908 return S_OK;
2909
2910 This->reset = FALSE;
2911 TRACE("RESETTING\n");
2912 if (This->d3d9_vertex)
2913 {
2915 This->d3d9_vertex = NULL;
2916 }
2917
2918 for (i = 0; i < This->num_surfaces; ++i)
2919 {
2920 IDirect3DSurface9 *surface = This->d3d9_surfaces[i];
2921 TRACE("Releasing surface %p\n", surface);
2922 if (surface)
2924 }
2925 ZeroMemory(This->d3d9_surfaces, sizeof(IDirect3DSurface9 *) * This->num_surfaces);
2926
2927 /* Now try to create the d3d9 device */
2928 ZeroMemory(&d3dpp, sizeof(d3dpp));
2929 d3dpp.Windowed = TRUE;
2930 d3dpp.hDeviceWindow = This->pVMR9->baseControlWindow.baseWindow.hWnd;
2932
2933 if (This->d3d9_dev)
2934 IDirect3DDevice9_Release(This->d3d9_dev);
2935 This->d3d9_dev = NULL;
2936 hr = IDirect3D9_CreateDevice(This->d3d9_ptr, d3d9_adapter_from_hwnd(This->d3d9_ptr, This->pVMR9->baseControlWindow.baseWindow.hWnd, &This->hMon), D3DDEVTYPE_HAL, NULL, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &This->d3d9_dev);
2937 if (FAILED(hr))
2938 {
2939 hr = IDirect3D9_CreateDevice(This->d3d9_ptr, d3d9_adapter_from_hwnd(This->d3d9_ptr, This->pVMR9->baseControlWindow.baseWindow.hWnd, &This->hMon), D3DDEVTYPE_HAL, NULL, D3DCREATE_MIXED_VERTEXPROCESSING, &d3dpp, &This->d3d9_dev);
2940 if (FAILED(hr))
2941 {
2942 ERR("--> Creating device: %08x\n", hr);
2943 return S_OK;
2944 }
2945 }
2946 IVMRSurfaceAllocatorNotify9_ChangeD3DDevice(This->SurfaceAllocatorNotify, This->d3d9_dev, This->hMon);
2947
2948 IVMRSurfaceAllocatorNotify9_AllocateSurfaceHelper(This->SurfaceAllocatorNotify, &This->info, &This->num_surfaces, This->d3d9_surfaces);
2949
2950 This->reset = FALSE;
2951
2952 if (!(This->info.dwFlags & VMR9AllocFlag_TextureSurface))
2953 return S_OK;
2954
2956 This->info.Pool, &This->d3d9_vertex, NULL);
2957
2958 width = This->info.dwWidth;
2959 height = This->info.dwHeight;
2960
2961 for (i = 0; i < sizeof(t_vert) / sizeof(t_vert[0]); ++i)
2962 {
2963 if (i % 2)
2964 {
2965 t_vert[i].x = (float)This->pVMR9->target_rect.right - (float)This->pVMR9->target_rect.left - 0.5f;
2966 t_vert[i].u = (float)This->pVMR9->source_rect.right / (float)width;
2967 }
2968 else
2969 {
2970 t_vert[i].x = -0.5f;
2971 t_vert[i].u = (float)This->pVMR9->source_rect.left / (float)width;
2972 }
2973
2974 if (i % 4 < 2)
2975 {
2976 t_vert[i].y = -0.5f;
2977 t_vert[i].v = (float)This->pVMR9->source_rect.bottom / (float)height;
2978 }
2979 else
2980 {
2981 t_vert[i].y = (float)This->pVMR9->target_rect.bottom - (float)This->pVMR9->target_rect.top - 0.5f;
2982 t_vert[i].v = (float)This->pVMR9->source_rect.top / (float)height;
2983 }
2984 t_vert[i].z = 0.0f;
2985 t_vert[i].rhw = 1.0f;
2986 }
2987
2988 FIXME("Vertex rectangle:\n");
2989 FIXME("X, Y: %f, %f\n", t_vert[0].x, t_vert[0].y);
2990 FIXME("X, Y: %f, %f\n", t_vert[3].x, t_vert[3].y);
2991 FIXME("TOP, LEFT: %f, %f\n", t_vert[0].u, t_vert[0].v);
2992 FIXME("DOWN, BOTTOM: %f, %f\n", t_vert[3].u, t_vert[3].v);
2993
2994 IDirect3DVertexBuffer9_Lock(This->d3d9_vertex, 0, sizeof(t_vert), &bits, 0);
2995 memcpy(bits, t_vert, sizeof(t_vert));
2996 IDirect3DVertexBuffer9_Unlock(This->d3d9_vertex);
2997
2998 return S_OK;
2999}
#define IDirect3DVertexBuffer9_Unlock(p)
Definition: d3d9.h:708
#define IDirect3DVertexBuffer9_Lock(p, a, b, c, d)
Definition: d3d9.h:707
#define IDirect3DDevice9_Release(p)
Definition: d3d9.h:1508
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
const GLdouble * v
Definition: gl.h:2040
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
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 * u
Definition: glfuncs.h:240
static float(__cdecl *square_half_float)(float x
#define D3DCREATE_HARDWARE_VERTEXPROCESSING
Definition: d3d8.h:45

Referenced by VMR9_SurfaceAllocator_GetSurface().

◆ VMR9DefaultAllocatorPresenterImpl_create()

static HRESULT VMR9DefaultAllocatorPresenterImpl_create ( struct quartz_vmr parent,
LPVOID ppv 
)
static

Definition at line 3058 of file vmr9.c.

3059{
3060 HRESULT hr = S_OK;
3061 int i;
3063
3065 if (!This)
3066 return E_OUTOFMEMORY;
3067
3068 This->d3d9_ptr = init_d3d9(parent->hD3d9);
3069 if (!This->d3d9_ptr)
3070 {
3071 WARN("Could not initialize d3d9.dll\n");
3074 }
3075
3076 i = 0;
3077 do
3078 {
3080
3082 if (hr == D3DERR_INVALIDCALL) break; /* out of adapters */
3083 } while (FAILED(hr));
3084 if (FAILED(hr))
3085 ERR("HR: %08x\n", hr);
3086 if (hr == D3DERR_NOTAVAILABLE)
3087 {
3088 ERR("Format not supported\n");
3089 IDirect3D9_Release(This->d3d9_ptr);
3092 }
3093
3094 This->IVMRImagePresenter9_iface.lpVtbl = &VMR9_ImagePresenter;
3095 This->IVMRSurfaceAllocatorEx9_iface.lpVtbl = &VMR9_SurfaceAllocator;
3096
3097 This->refCount = 1;
3098 This->pVMR9 = parent;
3099 This->d3d9_surfaces = NULL;
3100 This->d3d9_dev = NULL;
3101 This->hMon = 0;
3102 This->d3d9_vertex = NULL;
3103 This->num_surfaces = 0;
3104 This->hWndThread = NULL;
3105 This->ack = CreateEventW(NULL, 0, 0, NULL);
3106 This->SurfaceAllocatorNotify = NULL;
3107 This->reset = FALSE;
3108
3109 *ppv = &This->IVMRImagePresenter9_iface;
3110 return S_OK;
3111}
#define IDirect3D9_EnumAdapterModes(p, a, b, c, d)
Definition: d3d9.h:226
#define D3DERR_INVALIDCALL
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
r parent
Definition: btrfs.c:3010
#define D3DERR_NOTAVAILABLE
Definition: d3d8.h:84
HANDLE WINAPI DECLSPEC_HOTPATCH CreateEventW(IN LPSECURITY_ATTRIBUTES lpEventAttributes OPTIONAL, IN BOOL bManualReset, IN BOOL bInitialState, IN LPCWSTR lpName OPTIONAL)
Definition: synch.c:651
#define VFW_E_DDRAW_CAPS_NOT_SUITABLE
Definition: vfwmsgs.h:124
static const IVMRSurfaceAllocatorEx9Vtbl VMR9_SurfaceAllocator
Definition: vmr9.c:3036
static const IVMRImagePresenter9Vtbl VMR9_ImagePresenter
Definition: vmr9.c:2657
static IDirect3D9 * init_d3d9(HMODULE d3d9_handle)
Definition: vmr9.c:3048

Referenced by VMR9FilterConfig_SetRenderingMode().

◆ VMR9FilterConfig_AddRef()

static ULONG WINAPI VMR9FilterConfig_AddRef ( IVMRFilterConfig9 iface)
static

Definition at line 1572 of file vmr9.c.

1573{
1575 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1576}
static struct quartz_vmr * impl_from_IVMRFilterConfig9(IVMRFilterConfig9 *iface)
Definition: vmr9.c:137

◆ VMR9FilterConfig_GetNumberOfStreams()

static HRESULT WINAPI VMR9FilterConfig_GetNumberOfStreams ( IVMRFilterConfig9 iface,
DWORD max 
)
static

Definition at line 1600 of file vmr9.c.

1601{
1603
1604 FIXME("(%p/%p)->(%p) stub\n", iface, This, max);
1605 return E_NOTIMPL;
1606}

◆ VMR9FilterConfig_GetRenderingMode()

static HRESULT WINAPI VMR9FilterConfig_GetRenderingMode ( IVMRFilterConfig9 iface,
DWORD mode 
)
static

Definition at line 1678 of file vmr9.c.

1679{
1681
1682 TRACE("(%p/%p)->(%p)\n", iface, This, mode);
1683 if (!mode)
1684 return E_POINTER;
1685
1686 if (This->mode)
1687 *mode = This->mode;
1688 else
1690
1691 return S_OK;
1692}

◆ VMR9FilterConfig_GetRenderingPrefs()

static HRESULT WINAPI VMR9FilterConfig_GetRenderingPrefs ( IVMRFilterConfig9 iface,
DWORD renderflags 
)
static

Definition at line 1616 of file vmr9.c.

1617{
1619
1620 FIXME("(%p/%p)->(%p) stub\n", iface, This, renderflags);
1621 return E_NOTIMPL;
1622}

◆ VMR9FilterConfig_QueryInterface()

static HRESULT WINAPI VMR9FilterConfig_QueryInterface ( IVMRFilterConfig9 iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 1566 of file vmr9.c.

1567{
1569 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1570}

◆ VMR9FilterConfig_Release()

static ULONG WINAPI VMR9FilterConfig_Release ( IVMRFilterConfig9 iface)
static

Definition at line 1578 of file vmr9.c.

1579{
1581 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1582}

◆ VMR9FilterConfig_SetImageCompositor()

static HRESULT WINAPI VMR9FilterConfig_SetImageCompositor ( IVMRFilterConfig9 iface,
IVMRImageCompositor9 compositor 
)
static

Definition at line 1584 of file vmr9.c.

1585{
1587
1588 FIXME("(%p/%p)->(%p) stub\n", iface, This, compositor);
1589 return E_NOTIMPL;
1590}

◆ VMR9FilterConfig_SetNumberOfStreams()

static HRESULT WINAPI VMR9FilterConfig_SetNumberOfStreams ( IVMRFilterConfig9 iface,
DWORD  max 
)
static

Definition at line 1592 of file vmr9.c.

1593{
1595
1596 FIXME("(%p/%p)->(%u) stub\n", iface, This, max);
1597 return E_NOTIMPL;
1598}

◆ VMR9FilterConfig_SetRenderingMode()

static HRESULT WINAPI VMR9FilterConfig_SetRenderingMode ( IVMRFilterConfig9 iface,
DWORD  mode 
)
static

Definition at line 1624 of file vmr9.c.

1625{
1626 HRESULT hr = S_OK;
1628
1629 TRACE("(%p/%p)->(%u)\n", iface, This, mode);
1630
1631 EnterCriticalSection(&This->renderer.filter.csFilter);
1632 if (This->mode)
1633 {
1634 LeaveCriticalSection(&This->renderer.filter.csFilter);
1635 return VFW_E_WRONG_STATE;
1636 }
1637
1638 if (This->allocator)
1639 IVMRSurfaceAllocatorEx9_Release(This->allocator);
1640 if (This->presenter)
1641 IVMRImagePresenter9_Release(This->presenter);
1642
1643 This->allocator = NULL;
1644 This->presenter = NULL;
1645
1646 switch (mode)
1647 {
1648 case VMR9Mode_Windowed:
1650 This->allocator_is_ex = 0;
1651 This->cookie = ~0;
1652
1654 if (SUCCEEDED(hr))
1655 hr = IVMRImagePresenter9_QueryInterface(This->presenter, &IID_IVMRSurfaceAllocatorEx9, (LPVOID*)&This->allocator);
1656 if (FAILED(hr))
1657 {
1658 ERR("Unable to find Presenter interface\n");
1659 IVMRImagePresenter9_Release(This->presenter);
1660 This->allocator = NULL;
1661 This->presenter = NULL;
1662 }
1663 else
1664 hr = IVMRSurfaceAllocatorEx9_AdviseNotify(This->allocator, &This->IVMRSurfaceAllocatorNotify9_iface);
1665 break;
1667 break;
1668 default:
1669 LeaveCriticalSection(&This->renderer.filter.csFilter);
1670 return E_INVALIDARG;
1671 }
1672
1673 This->mode = mode;
1674 LeaveCriticalSection(&This->renderer.filter.csFilter);
1675 return hr;
1676}
static HRESULT VMR9DefaultAllocatorPresenterImpl_create(struct quartz_vmr *parent, LPVOID *ppv)
Definition: vmr9.c:3058
@ VMR9Mode_Renderless
Definition: vmr9.idl:356

◆ VMR9FilterConfig_SetRenderingPrefs()

static HRESULT WINAPI VMR9FilterConfig_SetRenderingPrefs ( IVMRFilterConfig9 iface,
DWORD  renderflags 
)
static

Definition at line 1608 of file vmr9.c.

1609{
1611
1612 FIXME("(%p/%p)->(%u) stub\n", iface, This, renderflags);
1613 return E_NOTIMPL;
1614}

◆ VMR9Impl_create()

HRESULT VMR9Impl_create ( IUnknown outer_unk,
LPVOID ppv 
)

Definition at line 2451 of file vmr9.c.

2452{
2453 return vmr_create(outer_unk, ppv, &CLSID_VideoMixingRenderer9);
2454}

◆ VMR9Inner_AddRef()

static ULONG WINAPI VMR9Inner_AddRef ( IUnknown iface)
static

Definition at line 816 of file vmr9.c.

817{
819 ULONG refCount = BaseFilterImpl_AddRef(&This->renderer.filter.IBaseFilter_iface);
820
821 TRACE("(%p/%p)->() AddRef from %d\n", This, iface, refCount - 1);
822
823 return refCount;
824}
ULONG WINAPI BaseFilterImpl_AddRef(IBaseFilter *iface)
Definition: filter.c:54
static struct quartz_vmr * impl_from_inner_IUnknown(IUnknown *iface)
Definition: vmr9.c:97

◆ VMR9Inner_QueryInterface()

static HRESULT WINAPI VMR9Inner_QueryInterface ( IUnknown iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 742 of file vmr9.c.

743{
745 TRACE("(%p/%p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv);
746
747 if (This->bAggregatable)
748 This->bUnkOuterValid = TRUE;
749
750 *ppv = NULL;
751
753 *ppv = &This->IUnknown_inner;
754 else if (IsEqualIID(riid, &IID_IVideoWindow))
755 *ppv = &This->baseControlWindow.IVideoWindow_iface;
756 else if (IsEqualIID(riid, &IID_IBasicVideo))
757 *ppv = &This->baseControlVideo.IBasicVideo_iface;
758 else if (IsEqualIID(riid, &IID_IAMCertifiedOutputProtection))
759 *ppv = &This->IAMCertifiedOutputProtection_iface;
760 else if (IsEqualIID(riid, &IID_IAMFilterMiscFlags))
761 *ppv = &This->IAMFilterMiscFlags_iface;
762 else if (IsEqualIID(riid, &IID_IVMRFilterConfig))
763 *ppv = &This->IVMRFilterConfig_iface;
764 else if (IsEqualIID(riid, &IID_IVMRFilterConfig9))
765 *ppv = &This->IVMRFilterConfig9_iface;
766 else if (IsEqualIID(riid, &IID_IVMRMonitorConfig))
767 *ppv = &This->IVMRMonitorConfig_iface;
768 else if (IsEqualIID(riid, &IID_IVMRMonitorConfig9))
769 *ppv = &This->IVMRMonitorConfig9_iface;
770 else if (IsEqualIID(riid, &IID_IVMRSurfaceAllocatorNotify) && This->mode == (VMR9Mode)VMRMode_Renderless)
771 *ppv = &This->IVMRSurfaceAllocatorNotify_iface;
772 else if (IsEqualIID(riid, &IID_IVMRSurfaceAllocatorNotify9) && This->mode == VMR9Mode_Renderless)
773 *ppv = &This->IVMRSurfaceAllocatorNotify9_iface;
774 else if (IsEqualIID(riid, &IID_IVMRWindowlessControl) && This->mode == (VMR9Mode)VMRMode_Windowless)
775 *ppv = &This->IVMRWindowlessControl_iface;
776 else if (IsEqualIID(riid, &IID_IVMRWindowlessControl9) && This->mode == VMR9Mode_Windowless)
777 *ppv = &This->IVMRWindowlessControl9_iface;
778 else
779 {
780 HRESULT hr;
781 hr = BaseRendererImpl_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
782 if (SUCCEEDED(hr))
783 return hr;
784 }
785
786 if (*ppv)
787 {
788 IUnknown_AddRef((IUnknown *)(*ppv));
789 return S_OK;
790 }
791
792 else if (IsEqualIID(riid, &IID_IBasicVideo2))
793 FIXME("No interface for IID_IBasicVideo2\n");
794 else if (IsEqualIID(riid, &IID_IVMRWindowlessControl9))
795 ;
796 else if (IsEqualIID(riid, &IID_IVMRSurfaceAllocatorNotify9))
797 ;
798 else if (IsEqualIID(riid, &IID_IMediaPosition))
799 FIXME("No interface for IID_IMediaPosition\n");
800 else if (IsEqualIID(riid, &IID_IQualProp))
801 FIXME("No interface for IID_IQualProp\n");
802 else if (IsEqualIID(riid, &IID_IVMRAspectRatioControl9))
803 FIXME("No interface for IID_IVMRAspectRatioControl9\n");
804 else if (IsEqualIID(riid, &IID_IVMRDeinterlaceControl9))
805 FIXME("No interface for IID_IVMRDeinterlaceControl9\n");
806 else if (IsEqualIID(riid, &IID_IVMRMixerBitmap9))
807 FIXME("No interface for IID_IVMRMixerBitmap9\n");
808 else if (IsEqualIID(riid, &IID_IVMRMixerControl9))
809 FIXME("No interface for IID_IVMRMixerControl9\n");
810 else
811 FIXME("No interface for %s\n", debugstr_guid(riid));
812
813 return E_NOINTERFACE;
814}
@ VMRMode_Renderless
Definition: vmrender.idl:107
@ VMRMode_Windowless
Definition: vmrender.idl:106
HRESULT WINAPI BaseRendererImpl_QueryInterface(IBaseFilter *iface, REFIID riid, LPVOID *ppv)
Definition: renderer.c:280
enum _VMR9Mode VMR9Mode

◆ VMR9Inner_Release()

static ULONG WINAPI VMR9Inner_Release ( IUnknown iface)
static

Definition at line 826 of file vmr9.c.

827{
829 ULONG refCount = BaseRendererImpl_Release(&This->renderer.filter.IBaseFilter_iface);
830
831 TRACE("(%p/%p)->() Release from %d\n", This, iface, refCount + 1);
832
833 if (!refCount)
834 {
835 TRACE("Destroying\n");
836 BaseControlWindow_Destroy(&This->baseControlWindow);
837 FreeLibrary(This->hD3d9);
838
839 if (This->allocator)
840 IVMRSurfaceAllocatorEx9_Release(This->allocator);
841 if (This->presenter)
842 IVMRImagePresenter9_Release(This->presenter);
843
844 This->num_surfaces = 0;
845 if (This->allocator_d3d9_dev)
846 {
847 IDirect3DDevice9_Release(This->allocator_d3d9_dev);
848 This->allocator_d3d9_dev = NULL;
849 }
850
852 }
853 return refCount;
854}
#define FreeLibrary(x)
Definition: compat.h:748
HRESULT WINAPI BaseControlWindow_Destroy(BaseControlWindow *pControlWindow)
Definition: window.c:223
ULONG WINAPI BaseRendererImpl_Release(IBaseFilter *iface)
Definition: renderer.c:296

◆ VMR9MonitorConfig_AddRef()

static ULONG WINAPI VMR9MonitorConfig_AddRef ( IVMRMonitorConfig9 iface)
static

Definition at line 1473 of file vmr9.c.

1474{
1476 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1477}
static struct quartz_vmr * impl_from_IVMRMonitorConfig9(IVMRMonitorConfig9 *iface)
Definition: vmr9.c:147

◆ VMR9MonitorConfig_GetAvailableMonitors()

static HRESULT WINAPI VMR9MonitorConfig_GetAvailableMonitors ( IVMRMonitorConfig9 iface,
VMR9MonitorInfo info,
DWORD  arraysize,
DWORD numdev 
)
static

Definition at line 1529 of file vmr9.c.

1532{
1535
1536 FIXME("(%p/%p)->(%p, %u, %p) semi-stub\n", iface, This, info, arraysize, numdev);
1537
1538 if (!numdev)
1539 return E_POINTER;
1540
1541 if (info && arraysize == 0)
1542 return E_INVALIDARG;
1543
1544 args.info7 = NULL;
1545 args.info9 = info;
1546 args.arraysize = arraysize;
1547 args.numdev = 0;
1549
1550 *numdev = args.numdev;
1551 return S_OK;
1552}

◆ VMR9MonitorConfig_GetDefaultMonitor()

static HRESULT WINAPI VMR9MonitorConfig_GetDefaultMonitor ( IVMRMonitorConfig9 iface,
UINT uDev 
)
static

Definition at line 1516 of file vmr9.c.

1517{
1519
1520 FIXME("(%p/%p)->(%p) stub\n", iface, This, uDev);
1521
1522 if (!uDev)
1523 return E_POINTER;
1524
1525 *uDev = 0;
1526 return S_OK;
1527}

◆ VMR9MonitorConfig_GetMonitor()

static HRESULT WINAPI VMR9MonitorConfig_GetMonitor ( IVMRMonitorConfig9 iface,
UINT uDev 
)
static

Definition at line 1494 of file vmr9.c.

1495{
1497
1498 FIXME("(%p/%p)->(%p) stub\n", iface, This, uDev);
1499
1500 if (!uDev)
1501 return E_POINTER;
1502
1503 *uDev = 0;
1504 return S_OK;
1505}

◆ VMR9MonitorConfig_QueryInterface()

static HRESULT WINAPI VMR9MonitorConfig_QueryInterface ( IVMRMonitorConfig9 iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 1466 of file vmr9.c.

1468{
1470 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1471}

◆ VMR9MonitorConfig_Release()

static ULONG WINAPI VMR9MonitorConfig_Release ( IVMRMonitorConfig9 iface)
static

Definition at line 1479 of file vmr9.c.

1480{
1482 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1483}

◆ VMR9MonitorConfig_SetDefaultMonitor()

static HRESULT WINAPI VMR9MonitorConfig_SetDefaultMonitor ( IVMRMonitorConfig9 iface,
UINT  uDev 
)
static

Definition at line 1507 of file vmr9.c.

1508{
1510
1511 FIXME("(%p/%p)->(%u) stub\n", iface, This, uDev);
1512
1513 return S_OK;
1514}

◆ VMR9MonitorConfig_SetMonitor()

static HRESULT WINAPI VMR9MonitorConfig_SetMonitor ( IVMRMonitorConfig9 iface,
UINT  uDev 
)
static

Definition at line 1485 of file vmr9.c.

1486{
1488
1489 FIXME("(%p/%p)->(%u) stub\n", iface, This, uDev);
1490
1491 return S_OK;
1492}

◆ VMR9SurfaceAllocatorNotify_AddRef()

static ULONG WINAPI VMR9SurfaceAllocatorNotify_AddRef ( IVMRSurfaceAllocatorNotify9 iface)
static

Definition at line 2215 of file vmr9.c.

2216{
2218 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
2219}
static struct quartz_vmr * impl_from_IVMRSurfaceAllocatorNotify9(IVMRSurfaceAllocatorNotify9 *iface)
Definition: vmr9.c:157

◆ VMR9SurfaceAllocatorNotify_AdviseSurfaceAllocator()

static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AdviseSurfaceAllocator ( IVMRSurfaceAllocatorNotify9 iface,
DWORD_PTR  id,
IVMRSurfaceAllocator9 alloc 
)
static

Definition at line 2227 of file vmr9.c.

2228{
2230
2231 /* FIXME: This code is not tested!!! */
2232 FIXME("(%p/%p)->(...) stub\n", iface, This);
2233 This->cookie = id;
2234
2235 if (This->presenter)
2236 return VFW_E_WRONG_STATE;
2237
2238 if (FAILED(IVMRSurfaceAllocator9_QueryInterface(alloc, &IID_IVMRImagePresenter9, (void **)&This->presenter)))
2239 return E_NOINTERFACE;
2240
2241 if (SUCCEEDED(IVMRSurfaceAllocator9_QueryInterface(alloc, &IID_IVMRSurfaceAllocatorEx9, (void **)&This->allocator)))
2242 This->allocator_is_ex = 1;
2243 else
2244 {
2245 This->allocator = (IVMRSurfaceAllocatorEx9 *)alloc;
2246 IVMRSurfaceAllocator9_AddRef(alloc);
2247 This->allocator_is_ex = 0;
2248 }
2249
2250 return S_OK;
2251}
GLuint id
Definition: glext.h:5910
#define alloc
Definition: rosglue.h:13

◆ VMR9SurfaceAllocatorNotify_AllocateSurfaceHelper()

static HRESULT WINAPI VMR9SurfaceAllocatorNotify_AllocateSurfaceHelper ( IVMRSurfaceAllocatorNotify9 iface,
VMR9AllocationInfo allocinfo,
DWORD numbuffers,
IDirect3DSurface9 **  surface 
)
static

Definition at line 2281 of file vmr9.c.

2282{
2284 DWORD i;
2285 HRESULT hr = S_OK;
2286
2287 FIXME("(%p/%p)->(%p, %p => %u, %p) semi-stub\n", iface, This, allocinfo, numbuffers, (numbuffers ? *numbuffers : 0), surface);
2288
2289 if (!allocinfo || !numbuffers || !surface)
2290 return E_POINTER;
2291
2292 if (!*numbuffers || *numbuffers < allocinfo->MinBuffers)
2293 {
2294 ERR("Invalid number of buffers?\n");
2295 return E_INVALIDARG;
2296 }
2297
2298 if (!This->allocator_d3d9_dev)
2299 {
2300 ERR("No direct3d device when requested to allocate a surface!\n");
2301 return VFW_E_WRONG_STATE;
2302 }
2303
2304 if (allocinfo->dwFlags & VMR9AllocFlag_OffscreenSurface)
2305 {
2306 ERR("Creating offscreen surface\n");
2307 for (i = 0; i < *numbuffers; ++i)
2308 {
2309 hr = IDirect3DDevice9_CreateOffscreenPlainSurface(This->allocator_d3d9_dev, allocinfo->dwWidth, allocinfo->dwHeight,
2310 allocinfo->Format, allocinfo->Pool, &surface[i], NULL);
2311 if (FAILED(hr))
2312 break;
2313 }
2314 }
2315 else if (allocinfo->dwFlags & VMR9AllocFlag_TextureSurface)
2316 {
2317 TRACE("Creating texture surface\n");
2318 for (i = 0; i < *numbuffers; ++i)
2319 {
2320 IDirect3DTexture9 *texture;
2321
2322 hr = IDirect3DDevice9_CreateTexture(This->allocator_d3d9_dev, allocinfo->dwWidth, allocinfo->dwHeight, 1, 0,
2323 allocinfo->Format, allocinfo->Pool, &texture, NULL);
2324 if (FAILED(hr))
2325 break;
2328 }
2329 }
2330 else
2331 {
2332 FIXME("Could not allocate for type %08x\n", allocinfo->dwFlags);
2333 return E_NOTIMPL;
2334 }
2335
2336 if (i >= allocinfo->MinBuffers)
2337 {
2338 hr = S_OK;
2339 *numbuffers = i;
2340 }
2341 else
2342 {
2343 for ( ; i > 0; --i) IDirect3DSurface9_Release(surface[i - 1]);
2344 *numbuffers = 0;
2345 }
2346 return hr;
2347}
#define IDirect3DTexture9_GetSurfaceLevel(p, a, b)
Definition: d3d9.h:1033
#define IDirect3DDevice9_CreateTexture(p, a, b, c, d, e, f, g, h)
Definition: d3d9.h:1530
#define IDirect3DDevice9_CreateOffscreenPlainSurface(p, a, b, c, d, e, f)
Definition: d3d9.h:1543
D3DFORMAT Format
Definition: vmr9.idl:99
@ VMR9AllocFlag_OffscreenSurface
Definition: vmr9.idl:88

◆ VMR9SurfaceAllocatorNotify_ChangeD3DDevice()

static HRESULT WINAPI VMR9SurfaceAllocatorNotify_ChangeD3DDevice ( IVMRSurfaceAllocatorNotify9 iface,
IDirect3DDevice9 *  device,
HMONITOR  monitor 
)
static

Definition at line 2267 of file vmr9.c.

2268{
2270
2271 FIXME("(%p/%p)->(...) semi-stub\n", iface, This);
2272 if (This->allocator_d3d9_dev)
2273 IDirect3DDevice9_Release(This->allocator_d3d9_dev);
2274 This->allocator_d3d9_dev = device;
2275 IDirect3DDevice9_AddRef(This->allocator_d3d9_dev);
2276 This->allocator_mon = monitor;
2277
2278 return S_OK;
2279}
#define IDirect3DDevice9_AddRef(p)
Definition: d3d9.h:1507
Definition: devices.h:37

◆ VMR9SurfaceAllocatorNotify_NotifyEvent()

static HRESULT WINAPI VMR9SurfaceAllocatorNotify_NotifyEvent ( IVMRSurfaceAllocatorNotify9 iface,
LONG  code,
LONG_PTR  param1,
LONG_PTR  param2 
)
static

Definition at line 2349 of file vmr9.c.

2350{
2352
2353 FIXME("(%p/%p)->(...) stub\n", iface, This);
2354 return E_NOTIMPL;
2355}

◆ VMR9SurfaceAllocatorNotify_QueryInterface()

static HRESULT WINAPI VMR9SurfaceAllocatorNotify_QueryInterface ( IVMRSurfaceAllocatorNotify9 iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 2209 of file vmr9.c.

2210{
2212 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
2213}

◆ VMR9SurfaceAllocatorNotify_Release()

static ULONG WINAPI VMR9SurfaceAllocatorNotify_Release ( IVMRSurfaceAllocatorNotify9 iface)
static

Definition at line 2221 of file vmr9.c.

2222{
2224 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
2225}

◆ VMR9SurfaceAllocatorNotify_SetD3DDevice()

static HRESULT WINAPI VMR9SurfaceAllocatorNotify_SetD3DDevice ( IVMRSurfaceAllocatorNotify9 iface,
IDirect3DDevice9 *  device,
HMONITOR  monitor 
)
static

Definition at line 2253 of file vmr9.c.

2254{
2256
2257 FIXME("(%p/%p)->(...) semi-stub\n", iface, This);
2258 if (This->allocator_d3d9_dev)
2259 IDirect3DDevice9_Release(This->allocator_d3d9_dev);
2260 This->allocator_d3d9_dev = device;
2261 IDirect3DDevice9_AddRef(This->allocator_d3d9_dev);
2262 This->allocator_mon = monitor;
2263
2264 return S_OK;
2265}

◆ VMR9WindowlessControl_AddRef()

static ULONG WINAPI VMR9WindowlessControl_AddRef ( IVMRWindowlessControl9 iface)
static

Definition at line 1924 of file vmr9.c.

1925{
1927 return VMR9_AddRef(&This->renderer.filter.IBaseFilter_iface);
1928}
static struct quartz_vmr * impl_from_IVMRWindowlessControl9(IVMRWindowlessControl9 *iface)
Definition: vmr9.c:167

◆ VMR9WindowlessControl_DisplayModeChanged()

static HRESULT WINAPI VMR9WindowlessControl_DisplayModeChanged ( IVMRWindowlessControl9 iface)
static

Definition at line 2071 of file vmr9.c.

2072{
2074
2075 FIXME("(%p/%p)->(...) stub\n", iface, This);
2076 return E_NOTIMPL;
2077}

◆ VMR9WindowlessControl_GetAspectRatioMode()

static HRESULT WINAPI VMR9WindowlessControl_GetAspectRatioMode ( IVMRWindowlessControl9 iface,
DWORD mode 
)
static

Definition at line 2011 of file vmr9.c.

2012{
2014
2015 FIXME("(%p/%p)->(...) stub\n", iface, This);
2016 return E_NOTIMPL;
2017}

◆ VMR9WindowlessControl_GetBorderColor()

static HRESULT WINAPI VMR9WindowlessControl_GetBorderColor ( IVMRWindowlessControl9 iface,
COLORREF color 
)
static

Definition at line 2095 of file vmr9.c.

2096{
2098
2099 FIXME("(%p/%p)->(...) stub\n", iface, This);
2100 return E_NOTIMPL;
2101}

◆ VMR9WindowlessControl_GetCurrentImage()

static HRESULT WINAPI VMR9WindowlessControl_GetCurrentImage ( IVMRWindowlessControl9 iface,
BYTE **  dib 
)
static

Definition at line 2079 of file vmr9.c.

2080{
2082
2083 FIXME("(%p/%p)->(...) stub\n", iface, This);
2084 return E_NOTIMPL;
2085}

◆ VMR9WindowlessControl_GetMaxIdealVideoSize()

static HRESULT WINAPI VMR9WindowlessControl_GetMaxIdealVideoSize ( IVMRWindowlessControl9 iface,
LONG width,
LONG height 
)
static

Definition at line 1963 of file vmr9.c.

1964{
1966
1967 FIXME("(%p/%p)->(...) stub\n", iface, This);
1968 return E_NOTIMPL;
1969}

◆ VMR9WindowlessControl_GetMinIdealVideoSize()

static HRESULT WINAPI VMR9WindowlessControl_GetMinIdealVideoSize ( IVMRWindowlessControl9 iface,
LONG width,
LONG height 
)
static

Definition at line 1955 of file vmr9.c.

1956{
1958
1959 FIXME("(%p/%p)->(...) stub\n", iface, This);
1960 return E_NOTIMPL;
1961}

◆ VMR9WindowlessControl_GetNativeVideoSize()

static HRESULT WINAPI VMR9WindowlessControl_GetNativeVideoSize ( IVMRWindowlessControl9 iface,
LONG width,
LONG height,
LONG arwidth,
LONG arheight 
)
static

Definition at line 1936 of file vmr9.c.

1937{
1939 TRACE("(%p/%p)->(%p, %p, %p, %p)\n", iface, This, width, height, arwidth, arheight);
1940
1941 if (!width || !height || !arwidth || !arheight)
1942 {
1943 ERR("Got no pointer\n");
1944 return E_POINTER;
1945 }
1946
1947 *width = This->bmiheader.biWidth;
1948 *height = This->bmiheader.biHeight;
1949 *arwidth = This->bmiheader.biWidth;
1950 *arheight = This->bmiheader.biHeight;
1951
1952 return S_OK;
1953}

◆ VMR9WindowlessControl_GetVideoPosition()

static HRESULT WINAPI VMR9WindowlessControl_GetVideoPosition ( IVMRWindowlessControl9 iface,
RECT source,
RECT dest 
)
static

Definition at line 1997 of file vmr9.c.

1998{
2000
2001 if (source)
2002 *source = This->source_rect;
2003
2004 if (dest)
2005 *dest = This->target_rect;
2006
2007 FIXME("(%p/%p)->(%p/%p) stub\n", iface, This, source, dest);
2008 return S_OK;
2009}

◆ VMR9WindowlessControl_QueryInterface()

static HRESULT WINAPI VMR9WindowlessControl_QueryInterface ( IVMRWindowlessControl9 iface,
REFIID  riid,
LPVOID ppv 
)
static

Definition at line 1918 of file vmr9.c.

1919{
1921 return VMR9_QueryInterface(&This->renderer.filter.IBaseFilter_iface, riid, ppv);
1922}

◆ VMR9WindowlessControl_Release()

static ULONG WINAPI VMR9WindowlessControl_Release ( IVMRWindowlessControl9 iface)
static

Definition at line 1930 of file vmr9.c.

1931{
1933 return VMR9_Release(&This->renderer.filter.IBaseFilter_iface);
1934}

◆ VMR9WindowlessControl_RepaintVideo()

static HRESULT WINAPI VMR9WindowlessControl_RepaintVideo ( IVMRWindowlessControl9