' ########################################################################################
' Microsoft Windows
' File: vmr9.inc
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_vmr9_PBI)
#DEFINE PBX_vmr9_PBI
%EQUATE `VMR9_INC = 1
'/* header files for imported files */
#INCLUDE ONCE "Legacy/System/strmif.inc"
#INCLUDE ONCE "Legacy/Graphics/d3d9.inc"
' enum VMR9PresentationFlags
%EQUATE `VMR9Sample_SyncPoint = &H1
%EQUATE `VMR9Sample_Preroll = &H2
%EQUATE `VMR9Sample_Discontinuity = &H4
%EQUATE `VMR9Sample_TimeValid = &H8
%EQUATE `VMR9Sample_SrcDstRectsValid = &H10
' // Size = 72 bytes
TYPE VMR9PresentationInfo ' Must be 8 byte aligned
 dwFlags AS DWORD ' DWORD dwFlags
 lpSurf AS DWORD PTR ' IDirect3DSurface9 *lpSurf
 rtStart AS QUAD ' REFERENCE_TIME rtStart
 rtEnd AS QUAD ' REFERENCE_TIME rtEnd
 szAspectRatio AS SIZE ' SIZE szAspectRatio
 rcSrc AS RECT ' RECT rcSrc
 rcDst AS RECT ' RECT rcDst
 dwReserved1 AS DWORD ' DWORD dwReserved1
 dwReserved2 AS DWORD ' DWORD dwReserved2
END TYPE
' ########################################################################################
' Interface name = IVMRImagePresenter9
' IID = {69188C61-12A3-40F0-8FFC-342E7B433FD7}
' Inherited interface = IUnknown
' ########################################################################################
$IID_IVMRImagePresenter9 = GUID$("{69188C61-12A3-40F0-8FFC-342E7B433FD7}")
INTERFACE IVMRImagePresenter9 $IID_IVMRImagePresenter9
 INHERIT IUnknown
 ' =====================================================================================
 METHOD StartPresenting ( ' VTable offset = 12
 BYVAL dwUserID AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD StopPresenting ( ' VTable offset = 16
 BYVAL dwUserID AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD PresentImage ( ' VTable offset = 29
 BYVAL dwUserID AS DWORD
 , BYREF lpPresInfo AS VMR9PresentationInfo
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' enum VMR9SurfaceAllocationFlags
%EQUATE `VMR9AllocFlag_3DRenderTarget = &H1
%EQUATE `VMR9AllocFlag_DXVATarget = &H2
%EQUATE `VMR9AllocFlag_TextureSurface = &H4
%EQUATE `VMR9AllocFlag_OffscreenSurface = &H8
%EQUATE `VMR9AllocFlag_RGBDynamicSwitch = &H10
%EQUATE `VMR9AllocFlag_UsageReserved = &HE0
%EQUATE `VMR9AllocFlag_UsageMask = &HFF
' // Size = 40 bytes
TYPE VMR9AllocationInfo DWORD
 dwFlags AS DWORD ' DWORD dwFlags
 dwWidth AS DWORD ' DWORD dwWidth
 dwHeight AS DWORD ' DWORD dwHeight
 Format AS DWORD ' D3DFORMAT Format
 Pool AS DWORD ' D3DPOOL Pool
 MinBuffers AS DWORD ' DWORD MinBuffers
 szAspectRatio AS SIZE ' SIZE szAspectRatio
 szNativeSize AS SIZE ' SIZE szNativeSize
END TYPE
' ########################################################################################
' Interface name = IVMRSurfaceAllocator9
' IID = {8D5148EA-3F5D-46CF-9DF1-D1B896EEDB1F}
' Inherited interface = IUnknown
' ########################################################################################
$IID_IVMRSurfaceAllocator9 = GUID$("{8D5148EA-3F5D-46CF-9DF1-D1B896EEDB1F}")
INTERFACE IVMRSurfaceAllocator9 $IID_IVMRSurfaceAllocator9
 INHERIT IUnknown
 ' =====================================================================================
 METHOD InitializeDevice ( ' VTable offset = 12
 BYVAL dwUserID AS DWORD
 , BYREF lpAllocInfo AS VMR9AllocationInfo
 , BYREF lpNumBuffers AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD TerminateDevice ( ' VTable offset = 16
 BYVAL dwID AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetSurface ( ' VTable offset = 20
 BYVAL dwUserID AS DWORD
 , BYVAL SurfaceIndex AS DWORD
 , BYVAL SurfaceFlags AS DWORD
 , BYREF lplpSurface AS IDirect3DSurface9
 ) AS LONG
 ' =====================================================================================
 METHOD AdviseNotify ( ' VTable offset = 24
 BYVAL lpIVMRSurfAllocNotify AS IVMRSurfaceAllocatorNotify9
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' Interface name = IVMRSurfaceAllocatorEx9
' IID = {8D5148EA-3F5D-46CF-9DF1-D1B896EEDB1F}
' Inherited interface = IVMRSurfaceAllocator9
' ########################################################################################
$IID_IVMRSurfaceAllocatorEx9 = GUID$("{6DE9A68A-A928-4522-BF57-655AE3866456}")
INTERFACE IVMRSurfaceAllocatorEx9 $IID_IVMRSurfaceAllocatorEx9
 INHERIT IUnknown
 ' =====================================================================================
 METHOD InitializeDevice ( ' VTable offset = 12
 BYVAL dwUserID AS DWORD
 , BYREF lpAllocInfo AS VMR9AllocationInfo
 , BYREF lpNumBuffers AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD TerminateDevice ( ' VTable offset = 16
 BYVAL dwID AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetSurface ( ' VTable offset = 20
 BYVAL dwUserID AS DWORD
 , BYVAL SurfaceIndex AS DWORD
 , BYVAL SurfaceFlags AS DWORD
 , BYREF lplpSurface AS IDirect3DSurface9
 ) AS LONG
 ' =====================================================================================
 METHOD AdviseNotify ( ' VTable offset = 24
 BYVAL lpIVMRSurfAllocNotify AS IVMRSurfaceAllocatorNotify9
 ) AS LONG
 ' =====================================================================================
 METHOD GetSurfaceEx ( ' VTable offset = 28
 BYVAL dwUserID AS DWORD
 , BYVAL SurfaceIndex AS DWORD
 , BYVAL SurfaceFlags AS DWORD
 , BYREF lplpSurface AS IDirect3DSurface9
 , BYREF lprcDst AS RECT
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' Interface name = IVMRSurfaceAllocatorNotify9
' IID = {DCA3F5DF-BB3A-4D03-BD81-84614BFBFA0C}
' Inherited interface = IUnknown
' ########################################################################################
$IID_IVMRSurfaceAllocatorNotify9 = GUID$("{DCA3F5DF-BB3A-4D03-BD81-84614BFBFA0C}")
INTERFACE IVMRSurfaceAllocatorNotify9 $IID_IVMRSurfaceAllocatorNotify9
 INHERIT IUnknown
 ' =====================================================================================
 METHOD AdviseSurfaceAllocator ( ' VTable offset = 12
 BYVAL dwUserID AS DWORD
 , BYVAL lpIVRMSurfaceAllocator AS IVMRSurfaceAllocator9
 ) AS LONG
 ' =====================================================================================
 METHOD SetD3DDevice ( ' VTable offset = 16
 BYVAL lpD3DDevice AS IDirect3DDevice9
 , BYVAL hMonitor AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD ChangeD3DDevice ( ' VTable offset = 20
 BYVAL lpD3DDevice AS IDirect3DDevice9
 , BYVAL hMonitor AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD AllocateSurfaceHelper ( ' VTable offset = 24
 BYVAL lpAllocInfo AS VMR9AllocationInfo
 , BYREF lpNumBuffers AS DWORD
 , BYREF lplpSurface AS IDirect3DSurface9
 ) AS LONG
 ' =====================================================================================
 METHOD NotifyEvent ( ' VTable offset = 28
 BYVAL EventCode AS LONG
 , BYVAL Param1 AS LONG
 , BYVAL Param2 AS LONG
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' enum VMR9AspectRatioMode
%EQUATE `VMR9ARMode_None = 0
%EQUATE `VMR9ARMode_LetterBox = %VMR9ARMode_None + 1
' ########################################################################################
' Interface name = IVMRWindowlessControl9
' IID = {8F537D09-F85E-4414-B23B-502E54C79927}
' Inherited interface = IUnknown
' ########################################################################################
$IID_IVMRWindowlessControl9 = GUID$("{8F537D09-F85E-4414-B23B-502E54C79927}")
INTERFACE IVMRWindowlessControl9 $IID_IVMRWindowlessControl9
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetNativeVideoSize ( ' VTable offset = 12
 BYREF lpWidth AS LONG
 , BYREF lpHeight AS LONG
 , BYREF lpARWidth AS LONG
 , BYREF lpARHeight AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetMinIdealVideoSize ( ' VTable offset = 16
 BYREF lpWidth AS LONG
 , BYREF lpHeight AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetMaxIdealVideoSize ( ' VTable offset = 20
 BYREF lpWidth AS LONG
 , BYREF lpHeight AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD SetVideoPosition ( ' VTable offset = 24
 BYREF lpSRCRect AS RECT
 , BYREF lpDSTRect AS RECT
 ) AS LONG
 ' =====================================================================================
 METHOD GetVideoPosition ( ' VTable offset = 28
 BYREF lpSRCRect AS RECT
 , BYREF lpDSTRect AS RECT
 ) AS LONG
 ' =====================================================================================
 METHOD GetAspectRatioMode ( ' VTable offset = 32
 BYREF lpAspectRatioMode AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetAspectRatioMode ( ' VTable offset = 36
 BYVAL AspectRatioMode AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetVideoClippingWindow ( ' VTable offset = 40
 BYVAL hwnd AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD RepaintVideo ( ' VTable offset = 44
 BYVAL hwnd AS DWORD
 , BYVAL hdc AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD DisplayModeChanged ( ' VTable offset = 48
 ) AS LONG
 ' =====================================================================================
 METHOD GetCurrentImage ( ' VTable offset = 52
 BYREF lpDib AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetBorderColor ( ' VTable offset = 56
 BYVAL Clr AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetBorderColor ( ' VTable offset = 60
 BYREF lpClr AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' enum VMR9MixerPrefs
%EQUATE `MixerPref9_NoDecimation = &H1
%EQUATE `MixerPref9_DecimateOutput = &H2
%EQUATE `MixerPref9_ARAdjustXorY = &H4
%EQUATE `MixerPref9_NonSquareMixing = &H8
%EQUATE `MixerPref9_DecimateMask = &Hf
%EQUATE `MixerPref9_BiLinearFiltering = &H10
%EQUATE `MixerPref9_PointFiltering = &H20
%EQUATE `MixerPref9_AnisotropicFiltering = &H40
%EQUATE `MixerPref9_PyramidalQuadFiltering = &H80
%EQUATE `MixerPref9_GaussianQuadFiltering = &H100
%EQUATE `MixerPref9_FilteringReserved = &He00
%EQUATE `MixerPref9_FilteringMask = &Hff0
%EQUATE `MixerPref9_RenderTargetRGB = &H1000
%EQUATE `MixerPref9_RenderTargetYUV = &H2000
%EQUATE `MixerPref9_RenderTargetMask = &Hff000
%EQUATE `MixerPref9_DynamicSwitchToBOB = &H100000
%EQUATE `MixerPref9_DynamicDecimateBy2 = &H200000
%EQUATE `MixerPref9_DynamicReserved = &Hc00000
%EQUATE `MixerPref9_DynamicMask = &Hf00000
' // Size = 16 bytes
TYPE VMR9NormalizedRect DWORD
 left AS SINGLE
 top AS SINGLE
 right AS SINGLE
 bottom AS SINGLE
END TYPE
' enum VMR9ProcAmpControlFlags
%EQUATE `ProcAmpControl9_Brightness = &H1
%EQUATE `ProcAmpControl9_Contrast = &H2
%EQUATE `ProcAmpControl9_Hue = &H4
%EQUATE `ProcAmpControl9_Saturation = &H8
%EQUATE `ProcAmpControl9_Mask = &Hf
' // Size = 24 bytes
TYPE VMR9ProcAmpControl DWORD
 dwSize AS DWORD
 dwFlags AS DWORD
 Brightness AS SINGLE
 Contrast AS SINGLE
 Hue AS SINGLE
 Saturation AS SINGLE
END TYPE
' // Size = 24 bytes
TYPE VMR9ProcAmpControlRange DWORD
 dwSize AS DWORD
 dwProperty AS DWORD ' VMR9ProcAmpControlFlags
 MinValue AS SINGLE ' float
 MaxValue AS SINGLE ' float
 DefaultValue AS SINGLE ' float
 StepSize AS SINGLE ' float
END TYPE
' ########################################################################################
' Interface name = IVMRMixerControl9
' IID = {1A777EAA-47C8-4930-B2C9-8FEE1C1B0F3B}
' Inherited interface = IUnknown
' ########################################################################################
$IID_IVMRMixerControl9 = GUID$("{1A777EAA-47C8-4930-B2C9-8FEE1C1B0F3B}")
INTERFACE IVMRMixerControl9 $IID_IVMRMixerControl9
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetNativeVideoSize ( ' VTable offset = 12
 BYVAL dwStreamID AS DWORD
 , BYVAL Alpha AS SINGLE
 ) AS LONG
 ' =====================================================================================
 METHOD GetAlpha ( ' VTable offset = 16
 BYVAL dwStreamID AS DWORD
 , BYREF pAlpha AS SINGLE
 ) AS LONG
 ' =====================================================================================
 METHOD SetZOrder ( ' VTable offset = 20
 BYVAL dwStreamID AS DWORD
 , BYVAL dwZ AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetZOrder ( ' VTable offset = 24
 BYVAL dwStreamID AS DWORD
 , BYREF pZ AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetOutputRect ( ' VTable offset = 28
 BYVAL dwStreamID AS DWORD
 , BYVAL pRect AS VMR9NormalizedRect
 ) AS LONG
 ' =====================================================================================
 METHOD GetOutputRect ( ' VTable offset = 32
 BYVAL dwStreamID AS DWORD
 , BYREF pRect AS VMR9NormalizedRect
 ) AS LONG
 ' =====================================================================================
 METHOD SetBackgroundClr ( ' VTable offset = 36
 BYVAL ClrBkg AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetBackgroundClr ( ' VTable offset = 40
 BYVAL lpClrBkg AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetMixingPrefs ( ' VTable offset = 44
 BYVAL dwMixerPrefs AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetMixingPrefs ( ' VTable offset = 48
 BYREF pdwMixerPrefs AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetProcAmpControl ( ' VTable offset = 52
 BYVAL dwStreamID AS DWORD
 , BYVAL lpClrControl AS VMR9ProcAmpControl
 ) AS LONG
 ' =====================================================================================
 METHOD GetProcAmpControl ( ' VTable offset = 56
 BYVAL dwStreamID AS DWORD
 , BYREF lpClrControl AS VMR9ProcAmpControl
 ) AS LONG
 ' =====================================================================================
 METHOD GetProcAmpControlRange ( ' VTable offset = 60
 BYVAL dwStreamID AS DWORD
 , BYREF lpClrControl AS VMR9ProcAmpControlRange
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' // Size = 56 bytes
TYPE VMR9AlphaBitmap DWORD
 dwFlags AS DWORD ' DWORD dwFlags
 hdc AS DWORD ' HDC hdc
 pDDS AS DWORD PTR ' IDirect3DSurface9 *pDDS
 rSrc AS RECT ' RECT rSrc
 rDest AS VMR9NormalizedRect ' VMR9NormalizedRect rDest
 fAlpha AS SINGLE ' FLOAT fAlpha
 clrSrcKey AS DWORD ' COLORREF clrSrcKey
 dwFilterMode AS DWORD ' DWORD dwFilterMode
END TYPE
' enum VMR9AlphaBitmapFlags
%EQUATE `VMR9AlphaBitmap_Disable = &H1
%EQUATE `VMR9AlphaBitmap_hDC = &H2
%EQUATE `VMR9AlphaBitmap_EntireDDS = &H4
%EQUATE `VMR9AlphaBitmap_SrcColorKey = &H8
%EQUATE `VMR9AlphaBitmap_SrcRect = &H10
%EQUATE `VMR9AlphaBitmap_FilterMode = &H20
' ########################################################################################
' Interface name = IVMRMixerBitmap9
' IID = {CED175E5-1935-4820-81BD-FF6AD00C9108}
' Inherited interface = IUnknown
' ########################################################################################
$IID_IVMRMixerBitmap9 = GUID$("{CED175E5-1935-4820-81BD-FF6AD00C9108}")
INTERFACE IVMRMixerBitmap9 $IID_IVMRMixerBitmap9
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SetAlphaBitmap ( ' VTable offset = 12
 BYVAL pBmpParms AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD UpdateAlphaBitmapParameters ( ' VTable offset = 16
 BYVAL pBmpParms AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetAlphaBitmapParameters ( ' VTable offset = 24
 BYREF pBmpParms AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' Interface name = IVMRSurface9
' IID = {DFC581A1-6E1F-4C3A-8D0A-5E9792EA2AFC}
' Inherited interface = IUnknown
' ########################################################################################
$IID_IVMRSurface9 = GUID$("{DFC581A1-6E1F-4C3A-8D0A-5E9792EA2AFC}")
INTERFACE IVMRSurface9 $IID_IVMRSurface9
 INHERIT IUnknown
 ' =====================================================================================
 METHOD IsSurfaceLocked ( ' VTable offset = 12
 ) AS LONG
 ' =====================================================================================
 METHOD LockSurface ( ' VTable offset = 16
 BYREF lpSurface AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD UnlockSurface ( ' VTable offset = 20
 ) AS LONG
 ' =====================================================================================
 METHOD GetSurface ( ' VTable offset = 24
 BYREF lplpSurface AS IDirect3DSurface9
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' enum VMR9RenderPrefs
%EQUATE `RenderPrefs9_DoNotRenderBorder = &H1
%EQUATE `RenderPrefs9_Mask = &H1
' ########################################################################################
' Interface name = IVMRImagePresenterConfig9
' IID = {45C15CAB-6E22-420A-8043-AE1F0AC02C7D}
' Inherited interface = IUnknown
' ########################################################################################
$IID_IVMRImagePresenterConfig9 = GUID$("{45C15CAB-6E22-420A-8043-AE1F0AC02C7D}")
INTERFACE IVMRImagePresenterConfig9 $IID_IVMRImagePresenterConfig9
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SetRenderingPrefs ( ' VTable offset = 12
 BYVAL dwRenderFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetRenderingPrefs ( ' VTable offset = 16
 BYREF dwRenderFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' Interface name = IVMRVideoStreamControl9
' IID = {D0CFE38B-93E7-4772-8957-0400C49A4485}
' Inherited interface = IUnknown
' ########################################################################################
$IID_IVMRVideoStreamControl9 = GUID$("{D0CFE38B-93E7-4772-8957-0400C49A4485}")
INTERFACE IVMRVideoStreamControl9 $IID_IVMRVideoStreamControl9
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SetStreamActiveState ( ' VTable offset = 12
 BYVAL fActive AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD GetStreamActiveState ( ' VTable offset = 16
 BYREF lpfActive AS LONG
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' enum VMR9Mode
%EQUATE `VMR9Mode_Windowed = &H1
%EQUATE `VMR9Mode_Windowless = &H2
%EQUATE `VMR9Mode_Renderless = &H4
%EQUATE `VMR9Mode_Mask = &H7
' ########################################################################################
' Interface name = IVMRFilterConfig9
' IID = {5A804648-4F66-4867-9C43-4F5C822CF1B8}
' Inherited interface = IUnknown
' ########################################################################################
$IID_IVMRFilterConfig9 = GUID$("{5A804648-4F66-4867-9C43-4F5C822CF1B8}")
INTERFACE IVMRFilterConfig9 $IID_IVMRFilterConfig9
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SetImageCompositor ( ' VTable offset = 12
 BYVAL lpVMRImgCompositor AS IVMRImageCompositor9
 ) AS LONG
 ' =====================================================================================
 METHOD SetNumberOfStreams ( ' VTable offset = 16
 BYVAL dwMaxStreams AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetNumberOfStreams ( ' VTable offset = 20
 BYREF pdwMaxStreams AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetRenderingPrefs ( ' VTable offset = 24
 BYVAL dwRenderFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetRenderingPrefs ( ' VTable offset = 28
 BYREF pdwRenderFlags AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetRenderingMode ( ' VTable offset = 32
 BYVAL Mode AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetRenderingMode ( ' VTable offset = 36
 BYREF pMode AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' ########################################################################################
' Interface name = IVMRAspectRatioControl9
' IID = {00D96C29-BBDE-4EFC-9901-BB5036392146}
' Inherited interface = IUnknown
' ########################################################################################
$IID_IVMRAspectRatioControl9 = GUID$("{00D96C29-BBDE-4EFC-9901-BB5036392146}")
INTERFACE IVMRAspectRatioControl9 $IID_IVMRAspectRatioControl9
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetAspectRatioMode ( ' VTable offset = 12
 BYREF lpdwARMode AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetAspectRatioMode ( ' VTable offset = 12
 BYVAL dwARMode AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' // Size = 1144 bytes
TYPE VMR9MonitorInfo QWORD FILL
 uDevID AS DWORD ' UINT uDevID
 rcMonitor AS RECT ' RECT rcMonitor
 hMon AS DWORD ' HMONITOR hMon
 dwFlags AS DWORD ' DWORD dwFlags
 szDevice AS WSTRINGZ * 32 ' wchar_t szDevice[ 32 ]
 szDescription AS WSTRINGZ * 512 ' wchar_t szDescription[ 512 ]
 liDriverVersion AS QUAD ' LARGE_INTEGER liDriverVersion
 dwVendorId AS DWORD ' DWORD dwVendorId
 dwDeviceId AS DWORD ' DWORD dwDeviceId
 dwSubSysId AS DWORD ' DWORD dwSubSysId
 dwRevision AS DWORD ' DWORD dwRevision
END TYPE
' ########################################################################################
' Interface name = IVMRMonitorConfig9
' IID = {46C2E457-8BA0-4EEF-B80B-0680F0978749}
' Inherited interface = IUnknown
' ########################################################################################
$IID_IVMRMonitorConfig9 = GUID$("{46C2E457-8BA0-4EEF-B80B-0680F0978749}")
INTERFACE IVMRMonitorConfig9 $IID_IVMRMonitorConfig9
 INHERIT IUnknown
 ' =====================================================================================
 METHOD SetMonitor ( ' VTable offset = 12
 BYVAL uDev AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetMonitor ( ' VTable offset = 16
 BYREF puDev AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetDefaultMonitor ( ' VTable offset = 20
 BYVAL uDev AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetDefaultMonitor ( ' VTable offset = 24
 BYREF puDev AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetAvailableMonitors ( ' VTable offset = 28
 BYREF pInfo AS VMR9MonitorInfo
 , BYVAL dwMaxInfoArraySize AS DWORD
 , BYREF pdwNumDevices AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' enum VMR9DeinterlacePrefs
%EQUATE `DeinterlacePref9_NextBest = &H1
%EQUATE `DeinterlacePref9_BOB = &H2
%EQUATE `DeinterlacePref9_Weave = &H4
%EQUATE `DeinterlacePref9_Mask = &H7
' enum VMR9DeinterlaceTech
%EQUATE `DeinterlaceTech9_Unknown = 0
%EQUATE `DeinterlaceTech9_BOBLineReplicate = &H1
%EQUATE `DeinterlaceTech9_BOBVerticalStretch = &H2
%EQUATE `DeinterlaceTech9_MedianFiltering = &H4
%EQUATE `DeinterlaceTech9_EdgeFiltering = &H10
%EQUATE `DeinterlaceTech9_FieldAdaptive = &H20
%EQUATE `DeinterlaceTech9_PixelAdaptive = &H40
%EQUATE `DeinterlaceTech9_MotionVectorSteered = &H80
' // Size = 8 bytes
TYPE VMR9Frequency DWORD
 dwNumerator AS DWORD
 dwDenominator AS DWORD
END TYPE
' enum VMR9_SampleFormat
%EQUATE `VMR9_SampleReserved = 1
%EQUATE `VMR9_SampleProgressiveFrame = 2
%EQUATE `VMR9_SampleFieldInterleavedEvenFirst = 3
%EQUATE `VMR9_SampleFieldInterleavedOddFirst = 4
%EQUATE `VMR9_SampleFieldSingleEven = 5
%EQUATE `VMR9_SampleFieldSingleOdd = 6
' // Size = 36 bytes
TYPE VMR9VideoDesc DWORD
 dwSize AS DWORD ' DWORD dwSize
 dwSampleWidth AS DWORD ' DWORD dwSampleWidth
 dwSampleHeight AS DWORD ' DWORD dwSampleHeight
 SampleFormat AS DWORD ' VMR9_SampleFormat SampleFormat
 dwFourCC AS DWORD ' DWORD dwFourCC
 InputSampleFreq AS VMR9Frequency ' VMR9Frequency InputSampleFreq
 OutputFrameFreq AS VMR9Frequency ' VMR9Frequency OutputFrameFreq
END TYPE
' // Size = 20 bytes
TYPE VMR9DeinterlaceCaps DWORD
 dwSize AS DWORD ' DWORD dwSize
 dwNumPreviousOutputFrames AS DWORD ' DWORD dwNumPreviousOutputFrames
 dwNumForwardRefSamples AS DWORD ' DWORD dwNumForwardRefSamples
 dwNumBackwardRefSamples AS DWORD ' DWORD dwNumBackwardRefSamples
 DeinterlaceTechnology AS DWORD ' VMR9DeinterlaceTech DeinterlaceTechnology
END TYPE
' ########################################################################################
' Interface name = IVMRDeinterlaceControl9
' IID = {A215FB8D-13C2-4F7F-993C-003D6271A459}
' Inherited interface = IUnknown
' ########################################################################################
$IID_IVMRDeinterlaceControl9 = GUID$("{A215FB8D-13C2-4F7F-993C-003D6271A459}")
INTERFACE IVMRDeinterlaceControl9 $IID_IVMRDeinterlaceControl9
 INHERIT IUnknown
 ' =====================================================================================
 METHOD GetNumberOfDeinterlaceModes ( ' VTable offset = 12
 BYREF lpVideoDescription AS VMR9VideoDesc
 , BYREF lpdwNumDeinterlaceModes AS DWORD
 , BYREF lpDeinterlaceModes AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD GetDeinterlaceModeCaps ( ' VTable offset = 16
 BYREF lpDeinterlaceMode AS GUID
 , BYREF lpVideoDescription AS VMR9VideoDesc
 , BYREF lpDeinterlaceCaps AS VMR9DeinterlaceCaps
 ) AS LONG
 ' =====================================================================================
 METHOD GetDeinterlaceMode ( ' VTable offset = 20
 BYVAL dwStreamID AS DWORD
 , BYREF lpDeinterlaceMode AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD SetDeinterlaceMode ( ' VTable offset = 24
 BYVAL dwStreamID AS DWORD
 , BYREF lpDeinterlaceMode AS GUID
 ) AS LONG
 ' =====================================================================================
 METHOD GetDeinterlacePrefs ( ' VTable offset = 28
 BYREF lpdwDeinterlacePrefs AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD SetDeinterlacePrefs ( ' VTable offset = 32
 BYVAL dwDeinterlacePrefs AS DWORD
 ) AS LONG
 ' =====================================================================================
 METHOD GetActualDeinterlaceMode ( ' VTable offset = 36
 BYVAL dwStreamID AS DWORD
 , BYREF lpDeinterlaceMode AS GUID
 ) AS LONG
 ' =====================================================================================
END INTERFACE
' // Size = 64 bytes
TYPE VMR9VideoStreamInfo QWORD FILL ' Must be 8 byte aligned
 pddsVideoSurface AS DWORD PTR ' IDirect3DSurface9 *pddsVideoSurface
 dwWidth AS DWORD ' DWORD dwWidth
 dwHeight AS DWORD ' DWORD dwHeight
 dwStrmID AS DWORD ' DWORD dwStrmID
 fAlpha AS SINGLE ' FLOAT fAlpha
 rNormal AS VMR9NormalizedRect ' VMR9NormalizedRect rNormal
 rtStart AS QUAD ' REFERENCE_TIME rtStart
 rtEnd AS QUAD ' REFERENCE_TIME rtEnd
 SampleFormat AS DWORD ' VMR9_SampleFormat SampleFormat
 alignment__ AS DWORD ' // To keep 8 byte alignment
END TYPE
' ########################################################################################
' Interface name = IVMRImageCompositor9
' IID = {4A5C89EB-DF51-4654-AC2A-E48E02BBABF6}
' Inherited interface = IUnknown
' ########################################################################################
$IID_IVMRImageCompositor9 = GUID$("{4A5C89EB-DF51-4654-AC2A-E48E02BBABF6}")
INTERFACE IVMRImageCompositor9 $IID_IVMRImageCompositor9
 INHERIT IUnknown
 ' =====================================================================================
 METHOD InitCompositionDevice ( ' VTable offset = 12
 BYVAL pD3DDevice AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD TermCompositionDevice ( ' VTable offset = 16
 BYVAL pD3DDevice AS IUnknown
 ) AS LONG
 ' =====================================================================================
 METHOD SetStreamMediaType ( ' VTable offset = 20
 BYVAL dwStrmID AS DWORD
 , BYREF pmt AS AM_MEDIA_TYPE
 , BYVAL fTexture AS LONG
 ) AS LONG
 ' =====================================================================================
 METHOD CompositeImage ( ' VTable offset = 24
 BYVAL pD3DDevice AS IUnknown
 , BYVAL pddsRenderTarget AS IDirect3DSurface9
 , BYREF pmtRenderTarget AS AM_MEDIA_TYPE
 , BYVAL rtStart AS QUAD
 , BYVAL rtEnd AS QUAD
 , BYVAL dwClrBkGnd AS DWORD
 , BYREF pVideoStreamInfo AS VMR9VideoStreamInfo
 , BYVAL cStreams AS DWORD
 ) AS LONG
 ' =====================================================================================
END INTERFACE
#ENDIF
