' ########################################################################################
' Microsoft Windows
' File: dxva2SWDev.inc
' Contents: DirectX Video Acceleration 2 header file for software video processing devices
' 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_dxva2swdev_PBI)
#DEFINE PBX_dxva2swdev_PBI
%EQUATE `DXVA2SWDEV_INC = 1
#INCLUDE ONCE "Legacy/Graphics/dxva2api.inc"
' enum DXVA2_SampleFlags
%EQUATE `DXVA2_SampleFlag_Palette_Changed = &H00000001
%EQUATE `DXVA2_SampleFlag_SrcRect_Changed = &H00000002
%EQUATE `DXVA2_SampleFlag_DstRect_Changed = &H00000004
%EQUATE `DXVA2_SampleFlag_ColorData_Changed = &H00000008
%EQUATE `DXVA2_SampleFlag_PlanarAlpha_Changed = &H00000010
%EQUATE `DXVA2_SampleFlag_RFF = &H00010000
%EQUATE `DXVA2_SampleFlag_TFF = &H00020000
%EQUATE `DXVA2_SampleFlag_RFF_TFF_Present = &H00040000
%EQUATE `DXVA2_SampleFlagsMask = &HFFFF001F
' enum DXVA2_DestinationFlags
%EQUATE `DXVA2_DestinationFlag_Background_Changed = &H00000001
%EQUATE `DXVA2_DestinationFlag_TargetRect_Changed = &H00000002
%EQUATE `DXVA2_DestinationFlag_ColorData_Changed = &H00000004
%EQUATE `DXVA2_DestinationFlag_Alpha_Changed = &H00000008
%EQUATE `DXVA2_DestinationFlag_RFF = &H00010000
%EQUATE `DXVA2_DestinationFlag_TFF = &H00020000
%EQUATE `DXVA2_DestinationFlag_RFF_TFF_Present = &H00040000
%EQUATE `DXVA2_DestinationFlagMask = &HFFFF000F
' Already defined in dxva2api.inc
'typedef struct _DXVA2_VIDEOSAMPLE
'{
' REFERENCE_TIME Start;
' REFERENCE_TIME End;
' DXVA2_ExtendedFormat SampleFormat;
' UINT SampleFlags;
' VOID* SrcResource;
' RECT SrcRect;
' RECT DstRect;
' DXVA2_AYUVSample8 Pal[16];
' DXVA2_Fixed32 PlanarAlpha;
'} DXVA2_VIDEOSAMPLE;
' // Size = 128 bytes
TYPE DXVA2_VIDEOPROCESSBLT DWORD
 TargetFrame AS QUAD ' REFERENCE_TIME
 TargetRect AS RECT
 ConstrictionSize AS SIZE ' SIZE
 StreamingFlags AS DWORD ' UINT
 BackgroundColor AS DXVA2_AYUVSample16
 DestFormat AS DXVA2_ExtendedFormat
 DestFlags AS DWORD ' UINT
 ProcAmpValues AS DXVA2_ProcAmpValues
 Alpha AS DXVA2_Fixed32
 NoiseFilterLuma AS DXVA2_FilterValues
 NoiseFilterChroma AS DXVA2_FilterValues
 DetailFilterLuma AS DXVA2_FilterValues
 DetailFilterChroma AS DXVA2_FilterValues
 pSrcSurfaces AS DXVA2_VIDEOSAMPLE PTR
 NumSrcSurfaces AS DWORD ' UINT
END TYPE
'#if defined(_D3D9_H_) || defined(_d3d9P_H_)
'typedef HRESULT (CALLBACK* PDXVA2SW_GETVIDEOPROCESSORRENDERTARGETCOUNT)(
' );
'FUNCTION DXVA2SW_GETVIDEOPROCESSORRENDERTARGETCOUNT ( ' BYREF pVideoDesc AS DXVA2_VideoDesc
' , BYREF pCount AS DWORD
' ) AS LONG
'typedef HRESULT (CALLBACK* PDXVA2SW_GETVIDEOPROCESSORRENDERTARGETS)(
' );
'FUNCTION DXVA2SW_GETVIDEOPROCESSORRENDERTARGETS ( ' BYREF pVideoDesc AS DXVA2_VideoDesc
' , BYVAL Count AS DWORD
' , BYVAL pFormats AS DWORD
' ) AS LONG
'typedef HRESULT (CALLBACK* PDXVA2SW_GETVIDEOPROCESSORCAPS)(
' );
'FUNCTION DXVA2SW_GETVIDEOPROCESSORCAPS ( ' BYREF pVideoDesc AS DXVA2_VideoDesc
' , BYVAL RenderTargetFormat AS DWORD
' , BYREF pCaps AS DXVA2_VideoProcessorCaps
' ) AS LONG
'typedef HRESULT (CALLBACK* PDXVA2SW_GETVIDEOPROCESSORSUBSTREAMFORMATCOUNT)(
' );
'FUNCTION DXVA2SW_GETVIDEOPROCESSORSUBSTREAMFORMATCOUNT ( ' BYREF pVideoDesc AS DXVA2_VideoDesc
' , BYVAL RenderTargetFormat AS DWORD
' , BYREF pCount AS DWORD
' ) AS LONG
'typedef HRESULT (CALLBACK* PDXVA2SW_GETVIDEOPROCESSORSUBSTREAMFORMATS)(
' );
'FUNCTION DXVA2SW_GETVIDEOPROCESSORSUBSTREAMFORMATS ( ' BYREF pVideoDesc AS DXVA2_VideoDesc
' , BYVAL RenderTargetFormat AS DWORD
' , BYVAL Count AS DWORD
' , BYREF pFormats AS DWORD
' ) AS LONG
'typedef HRESULT (CALLBACK* PDXVA2SW_GETPROCAMPRANGE)(
' );
'FUNCTION DXVA2SW_GETPROCAMPRANGE ( ' BYREF pVideoDesc AS DXVA2_VideoDesc
' , BYVAL RenderTargetFormat AS DWORD
' , BYVAL ProcAmpCap AS DWORD
' , BYREF pRange AS DXVA2_ValueRange
' ) AS LONG
'typedef HRESULT (CALLBACK* PDXVA2SW_GETFILTERPROPERTYRANGE)(
' );
'FUNCTION DXVA2SW_GETFILTERPROPERTYRANGE ( ' BYREF pVideoDesc AS DXVA2_VideoDesc
' , BYVAL RenderTargetFormat AS DWORD
' , BYVAL FilterSetting AS DWORD
' , BYREF pRange AS DXVA2_ValueRange
' ) AS LONG
'typedef HRESULT (CALLBACK* PDXVA2SW_CREATEVIDEOPROCESSDEVICE)(
' );
'FUNCTION DXVA2SW_CREATEVIDEOPROCESSDEVICE ( ' BYVAL pD3DD9 AS IDirect3DDevice9
' , BYREF pVideoDesc AS DXVA2_VideoDesc
' , BYVAL RenderTargetFormat AS DWORD
' , BYVAL MaxSubStreams AS DWORD
' , BYREF phDevice AS DWORD
' ) AS LONG
'typedef HRESULT (CALLBACK* PDXVA2SW_DESTROYVIDEOPROCESSDEVICE)(
' );
'FUNCTION DXVA2SW_DESTROYVIDEOPROCESSDEVICE ( ' BYVAL hDevice AS DWORD
' ) AS LONG
'typedef HRESULT (CALLBACK* PDXVA2SW_VIDEOPROCESSBEGINFRAME)(
' );
'FUNCTION DXVA2SW_VIDEOPROCESSBEGINFRAME ( ' BYVAL hDevice AS DWORD
' ) AS LONG
'typedef HRESULT (CALLBACK* PDXVA2SW_VIDEOPROCESSENDFRAME)(
' );
'FUNCTION DXVA2SW_VIDEOPROCESSENDFRAME ( ' BYVAL hDevice AS DWORD
' , BYREF pHandleComplete AS DWORD
' ) AS LONG
'typedef HRESULT (CALLBACK* PDXVA2SW_VIDEOPROCESSSETRENDERTARGET)(
' );
'FUNCTION DXVA2SW_VIDEOPROCESSSETRENDERTARGET ( ' BYVAL hDevice AS DWORD
' , BYVAL pRenderTarget AS IDirect3DSurface9
' ) AS LONG
'typedef HRESULT (CALLBACK* PDXVA2SW_VIDEOPROCESSBLT)(
' );
'FUNCTION DXVA2SW_VIDEOPROCESSBLT ( ' BYVAL hDevice AS DWORD
' , BYREF pBlt AS DXVA2_VIDEOPROCESSBLT
' ) AS LONG
' // Size = 56 bytes
TYPE DXVA2SW_CALLBACKS DWORD
 Size AS DWORD ' UINT
 GetVideoProcessorRenderTargetCount AS DWORD ' PDXVA2SW_GETVIDEOPROCESSORRENDERTARGETCOUNT
 GetVideoProcessorRenderTargets AS DWORD ' PDXVA2SW_GETVIDEOPROCESSORRENDERTARGETS
 GetVideoProcessorCaps AS DWORD ' PDXVA2SW_GETVIDEOPROCESSORCAPS
 GetVideoProcessorSubStreamFormatCount AS DWORD ' PDXVA2SW_GETVIDEOPROCESSORSUBSTREAMFORMATCOUNT
 GetVideoProcessorSubStreamFormats AS DWORD ' PDXVA2SW_GETVIDEOPROCESSORSUBSTREAMFORMATS
 GetProcAmpRange AS DWORD ' PDXVA2SW_GETPROCAMPRANGE
 GetFilterPropertyRange AS DWORD ' PDXVA2SW_GETFILTERPROPERTYRANGE
 CreateVideoProcessDevice AS DWORD ' PDXVA2SW_CREATEVIDEOPROCESSDEVICE
 DestroyVideoProcessDevice AS DWORD ' PDXVA2SW_DESTROYVIDEOPROCESSDEVICE
 VideoProcessBeginFrame AS DWORD ' PDXVA2SW_VIDEOPROCESSBEGINFRAME
 VideoProcessEndFrame AS DWORD ' PDXVA2SW_VIDEOPROCESSENDFRAME
 VideoProcessSetRenderTarget AS DWORD ' PDXVA2SW_VIDEOPROCESSSETRENDERTARGET
 VideoProcessBlt AS DWORD ' PDXVA2SW_VIDEOPROCESSBLT
END TYPE
'#endif // _D3D9_H_
#ENDIF
