// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0 > or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT >, at your option.
// All files in the project carrying such notice may not be copied, modified, or distributed
// except according to those terms.
use ctypes::{c_float, c_void};
use shared::basetsd::UINT64;
use shared::d3d9::{IDirect3DDevice9, IDirect3DSurface9};
use shared::d3d9types::{D3DFORMAT, D3DPOOL};
use shared::guiddef::{GUID, REFGUID, REFIID};
use shared::minwindef::{BOOL, DWORD, FLOAT, HIWORD, LOWORD, UCHAR, UINT, USHORT};
use shared::windef::{RECT, SIZE};
use um::unknwnbase::{IUnknown, IUnknownVtbl};
use um::winnt::{HANDLE, HRESULT, LONG, LONGLONG, PVOID, SHORT};
DEFINE_GUID!{DXVA2_ModeMPEG2_MoComp,
0 xe6a9f44b,
0 x61b0,
0 x4563,
0 x9e,
0 xa4,
0 x63,
0 xd2,
0 xa3,
0 xc6,
0 xfe,
0 x66}
DEFINE_GUID!{DXVA2_ModeMPEG2_IDCT,
0 xbf22ad00,
0 x03ea,
0 x4690,
0 x80,
0 x77,
0 x47,
0 x33,
0 x46,
0 x20,
0 x9b,
0 x7e}
DEFINE_GUID!{DXVA2_ModeMPEG2_VLD,
0 xee27417f,
0 x5e28,
0 x4e65,
0 xbe,
0 xea,
0 x1d,
0 x26,
0 xb5,
0 x08,
0 xad,
0 xc9}
DEFINE_GUID!{DXVA2_ModeMPEG1_VLD,
0 x6f3ec719,
0 x3735,
0 x42cc,
0 x80,
0 x63,
0 x65,
0 xcc,
0 x3c,
0 xb3,
0 x66,
0 x16}
DEFINE_GUID!{DXVA2_ModeMPEG2and1_VLD,
0 x86695f12,
0 x340e,
0 x4f04,
0 x9f,
0 xd3,
0 x92,
0 x53,
0 xdd,
0 x32,
0 x74,
0 x60}
DEFINE_GUID!{DXVA2_ModeH264_A,
0 x1b81be64,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_ModeH264_B,
0 x1b81be65,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_ModeH264_C,
0 x1b81be66,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_ModeH264_D,
0 x1b81be67,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_ModeH264_E,
0 x1b81be68,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_ModeH264_F,
0 x1b81be69,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_ModeH264_VLD_WithFMOASO_NoFGT,
0 xd5f04ff9,
0 x3418,
0 x45d8,
0 x95,
0 x61,
0 x32,
0 xa7,
0 x6a,
0 xae,
0 x2d,
0 xdd}
DEFINE_GUID!{DXVA2_ModeH264_VLD_Stereo_Progressive_NoFGT,
0 xd79be8da,
0 x0cf1,
0 x4c81,
0 xb8,
0 x2a,
0 x69,
0 xa4,
0 xe2,
0 x36,
0 xf4,
0 x3d}
DEFINE_GUID!{DXVA2_ModeH264_VLD_Stereo_NoFGT,
0 xf9aaccbb,
0 xc2b6,
0 x4cfc,
0 x87,
0 x79,
0 x57,
0 x07,
0 xb1,
0 x76,
0 x05,
0 x52}
DEFINE_GUID!{DXVA2_ModeH264_VLD_Multiview_NoFGT,
0 x705b9d82,
0 x76cf,
0 x49d6,
0 xb7,
0 xe6,
0 xac,
0 x88,
0 x72,
0 xdb,
0 x01,
0 x3c}
DEFINE_GUID!{DXVA2_ModeWMV8_A,
0 x1b81be80,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_ModeWMV8_B,
0 x1b81be81,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_ModeWMV9_A,
0 x1b81be90,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_ModeWMV9_B,
0 x1b81be91,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_ModeWMV9_C,
0 x1b81be94,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_ModeVC1_A,
0 x1b81bea0,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_ModeVC1_B,
0 x1b81bea1,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_ModeVC1_C,
0 x1b81bea2,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_ModeVC1_D,
0 x1b81bea3,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_ModeVC1_D2010,
0 x1b81bea4,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_NoEncrypt,
0 x1b81bed0,
0 xa0c7,
0 x11d3,
0 xb9,
0 x84,
0 x00,
0 xc0,
0 x4f,
0 x2e,
0 x73,
0 xc5}
DEFINE_GUID!{DXVA2_VideoProcProgressiveDevice,
0 x5a54a0c9,
0 xc7ec,
0 x4bd9,
0 x8e,
0 xde,
0 xf3,
0 xc7,
0 x5d,
0 xc4,
0 x39,
0 x3b}
DEFINE_GUID!{DXVA2_VideoProcBobDevice,
0 x335aa36e,
0 x7884,
0 x43a4,
0 x9c,
0 x91,
0 x7f,
0 x87,
0 xfa,
0 xf3,
0 xe3,
0 x7e}
DEFINE_GUID!{DXVA2_VideoProcSoftwareDevice,
0 x4553d47f,
0 xee7e,
0 x4e3f,
0 x94,
0 x75,
0 xdb,
0 xf1,
0 x37,
0 x6c,
0 x48,
0 x10}
DEFINE_GUID!{DXVA2_ModeMPEG4pt2_VLD_Simple,
0 xefd64d74,
0 xc9e8,
0 x41d7,
0 xa5,
0 xe9,
0 xe9,
0 xb0,
0 xe3,
0 x9f,
0 xa3,
0 x19}
DEFINE_GUID!{DXVA2_ModeMPEG4pt2_VLD_AdvSimple_NoGMC,
0 xed418a9f,
0 x010d,
0 x4eda,
0 x9a,
0 xe3,
0 x9a,
0 x65,
0 x35,
0 x8d,
0 x8d,
0 x2e}
DEFINE_GUID!{DXVA2_ModeMPEG4pt2_VLD_AdvSimple_GMC,
0 xab998b5b,
0 x4258,
0 x44a9,
0 x9f,
0 xeb,
0 x94,
0 xe5,
0 x97,
0 xa6,
0 xba,
0 xae}
DEFINE_GUID!{DXVA2_ModeHEVC_VLD_Main,
0 x5b11d51b,
0 x2f4c,
0 x4452,
0 xbc,
0 xc3,
0 x09,
0 xf2,
0 xa1,
0 x16,
0 x0c,
0 xc0}
DEFINE_GUID!{DXVA2_ModeHEVC_VLD_Main10,
0 x107af0e0,
0 xef1a,
0 x4d19,
0 xab,
0 xa8,
0 x67,
0 xa1,
0 x63,
0 x07,
0 x3d,
0 x13}
DEFINE_GUID!{DXVA2_ModeVP9_VLD_Profile0,
0 x463707f8,
0 xa1d0,
0 x4585,
0 x87,
0 x6d,
0 x83,
0 xaa,
0 x6d,
0 x60,
0 xb8,
0 x9e}
DEFINE_GUID!{DXVA2_ModeVP9_VLD_10bit_Profile2,
0 xa4c749ef,
0 x6ecf,
0 x48aa,
0 x84,
0 x48,
0 x50,
0 xa7,
0 xa1,
0 x16,
0 x5f,
0 xf7}
DEFINE_GUID!{DXVA2_ModeVP8_VLD,
0 x90b899ea,
0 x3a62,
0 x4705,
0 x88,
0 xb3,
0 x8d,
0 xf0,
0 x4b,
0 x27,
0 x44,
0 xe7}
pub const DXVA2_ModeMPEG2_MOCOMP: GUID = DXVA2_ModeMPEG2_MoComp;
pub const DXVA2_ModeWMV8_PostProc: GUID = DXVA2_ModeWMV8_A;
pub const DXVA2_ModeWMV8_MoComp: GUID = DXVA2_ModeWMV8_B;
pub const DXVA2_ModeWMV9_PostProc: GUID = DXVA2_ModeWMV9_A;
pub const DXVA2_ModeWMV9_MoComp: GUID = DXVA2_ModeWMV9_B;
pub const DXVA2_ModeWMV9_IDCT: GUID = DXVA2_ModeWMV9_C;
pub const DXVA2_ModeVC1_PostProc: GUID = DXVA2_ModeVC1_A;
pub const DXVA2_ModeVC1_MoComp: GUID = DXVA2_ModeVC1_B;
pub const DXVA2_ModeVC1_IDCT: GUID = DXVA2_ModeVC1_C;
pub const DXVA2_ModeVC1_VLD: GUID = DXVA2_ModeVC1_D;
pub const DXVA2_ModeH264_MoComp_NoFGT: GUID = DXVA2_ModeH264_A;
pub const DXVA2_ModeH264_MoComp_FGT: GUID = DXVA2_ModeH264_B;
pub const DXVA2_ModeH264_IDCT_NoFGT: GUID = DXVA2_ModeH264_C;
pub const DXVA2_ModeH264_IDCT_FGT: GUID = DXVA2_ModeH264_D;
pub const DXVA2_ModeH264_VLD_NoFGT: GUID = DXVA2_ModeH264_E;
pub const DXVA2_ModeH264_VLD_FGT: GUID = DXVA2_ModeH264_F;
pub const DXVA2_E_NOT_INITIALIZED: HRESULT =
0 x80041000;
pub const DXVA2_E_NEW_VIDEO_DEVICE: HRESULT =
0 x80041001;
pub const DXVA2_E_VIDEO_DEVICE_LOCKED: HRESULT =
0 x80041002;
pub const DXVA2_E_NOT_AVAILABLE: HRESULT =
0 x80041003;
DEFINE_GUID!{IID_IDirect3DDeviceManager9,
0 xa0cade0f,
0 x06d5,
0 x4cf4,
0 xa1,
0 xc7,
0 xf3,
0 xcd,
0 xd7,
0 x25,
0 xaa,
0 x75}
DEFINE_GUID!{IID_IDirectXVideoAccelerationService,
0 xfc51a550,
0 xd5e7,
0 x11d9,
0 xaf,
0 x55,
0 x00,
0 x05,
0 x4e,
0 x43,
0 xff,
0 x02}
DEFINE_GUID!{IID_IDirectXVideoDecoderService,
0 xfc51a551,
0 xd5e7,
0 x11d9,
0 xaf,
0 x55,
0 x00,
0 x05,
0 x4e,
0 x43,
0 xff,
0 x02}
DEFINE_GUID!{IID_IDirectXVideoProcessorService,
0 xfc51a552,
0 xd5e7,
0 x11d9,
0 xaf,
0 x55,
0 x00,
0 x05,
0 x4e,
0 x43,
0 xff,
0 x02}
DEFINE_GUID!{IID_IDirectXVideoDecoder,
0 xf2b0810a,
0 xfd00,
0 x43c9,
0 x91,
0 x8c,
0 xdf,
0 x94,
0 xe2,
0 xd8,
0 xef,
0 x7d}
DEFINE_GUID!{IID_IDirectXVideoProcessor,
0 x8c3a39f0,
0 x916e,
0 x4690,
0 x80,
0 x4f,
0 x4c,
0 x80,
0 x01,
0 x35,
0 x5d,
0 x25}
DEFINE_GUID!{IID_IDirectXVideoMemoryConfiguration,
0 xb7f916dd,
0 xdb3b,
0 x49c1,
0 x84,
0 xd7,
0 xe4,
0 x5e,
0 xf9,
0 x9e,
0 xc7,
0 x26}
pub const MAX_DEINTERLACE_SURFACES: usize =
32 ;
pub const MAX_SUBSTREAMS: usize =
15 ;
STRUCT !{
struct DXVA2_ExtendedFormat {
value: UINT,
}}
BITFIELD!{DXVA2_ExtendedFormat value: UINT [
SampleFormat set_SampleFormat[
0 ..
8 ],
VideoChromaSubsampling set_VideoChromaSubsampling[
8 ..
12 ],
NominalRange set_NominalRange[
12 ..
15 ],
VideoTransferMatrix set_VideoTransferMatrix[
15 ..
18 ],
VideoLighting set_VideoLighting[
18 ..
22 ],
VideoPrimaries set_VideoPrimaries[
22 ..
27 ],
VideoTransferFunction set_VideoTransferFunction[
27 ..
32 ],
]}
ENUM !{
enum DXVA2_SampleFormat {
DXVA2_SampleFormatMask =
0 xff,
DXVA2_SampleUnknown =
0 ,
DXVA2_SampleProgressiveFrame =
2 ,
DXVA2_SampleFieldInterleavedEvenFirst =
3 ,
DXVA2_SampleFieldInterleavedOddFirst =
4 ,
DXVA2_SampleFieldSingleEven =
5 ,
DXVA2_SampleFieldSingleOdd =
6 ,
DXVA2_SampleSubStream =
7 ,
}}
ENUM !{
enum DXVA2_VideoChromaSubSampling {
DXVA2_VideoChromaSubsamplingMask =
0 xf,
DXVA2_VideoChromaSubsampling_Unknown =
0 ,
DXVA2_VideoChromaSubsampling_ProgressiveChroma =
0 x8,
DXVA2_VideoChromaSubsampling_Horizontally_Cosited =
0 x4,
DXVA2_VideoChromaSubsampling_Vertically_Cosited =
0 x2,
DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes =
0 x1,
DXVA2_VideoChromaSubsampling_MPEG2 = DXVA2_VideoChromaSubsampling_Horizontally_Cos
ited |
DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes,
DXVA2_VideoChromaSubsampling_MPEG1 =
DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes,
DXVA2_VideoChromaSubsampling_DV_PAL = DXVA2_VideoChromaSubsampling_Horizontally_Cosited |
DXVA2_VideoChromaSubsampling_Vertically_Cosited,
DXVA2_VideoChromaSubsampling_Cosited = DXVA2_VideoChromaSubsampling_Horizontally_Cosited |
DXVA2_VideoChromaSubsampling_Vertically_Cosited |
DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes,
}}
ENUM !{enum DXVA2_NominalRange {
DXVA2_NominalRangeMask = 0 x7,
DXVA2_NominalRange_Unknown = 0 ,
DXVA2_NominalRange_Normal = 1 ,
DXVA2_NominalRange_Wide = 2 ,
DXVA2_NominalRange_0_255 = 1 ,
DXVA2_NominalRange_16_235 = 2 ,
DXVA2_NominalRange_48_208 = 3 ,
}}
ENUM !{enum DXVA2_VideoTransferMatrix {
DXVA2_VideoTransferMatrixMask = 0 x7,
DXVA2_VideoTransferMatrix_Unknown = 0 ,
DXVA2_VideoTransferMatrix_BT709 = 1 ,
DXVA2_VideoTransferMatrix_BT601 = 2 ,
DXVA2_VideoTransferMatrix_SMPTE240M = 3 ,
}}
ENUM !{enum DXVA2_VideoLighting {
DXVA2_VideoLightingMask = 0 xf,
DXVA2_VideoLighting_Unknown = 0 ,
DXVA2_VideoLighting_bright = 1 ,
DXVA2_VideoLighting_office = 2 ,
DXVA2_VideoLighting_dim = 3 ,
DXVA2_VideoLighting_dark = 4 ,
}}
ENUM !{enum DXVA2_VideoPrimaries {
DXVA2_VideoPrimariesMask = 0 x1f,
DXVA2_VideoPrimaries_Unknown = 0 ,
DXVA2_VideoPrimaries_reserved = 1 ,
DXVA2_VideoPrimaries_BT709 = 2 ,
DXVA2_VideoPrimaries_BT470_2_SysM = 3 ,
DXVA2_VideoPrimaries_BT470_2_SysBG = 4 ,
DXVA2_VideoPrimaries_SMPTE170M = 5 ,
DXVA2_VideoPrimaries_SMPTE240M = 6 ,
DXVA2_VideoPrimaries_EBU3213 = 7 ,
DXVA2_VideoPrimaries_SMPTE_C = 8 ,
}}
ENUM !{enum DXVA2_VideoTransferFunction {
DXVA2_VideoTransFuncMask = 0 x1f,
DXVA2_VideoTransFunc_Unknown = 0 ,
DXVA2_VideoTransFunc_10 = 1 ,
DXVA2_VideoTransFunc_18 = 2 ,
DXVA2_VideoTransFunc_20 = 3 ,
DXVA2_VideoTransFunc_22 = 4 ,
DXVA2_VideoTransFunc_709 = 5 ,
DXVA2_VideoTransFunc_240M = 6 ,
DXVA2_VideoTransFunc_sRGB = 7 ,
DXVA2_VideoTransFunc_28 = 8 ,
}}
pub const DXVA2_VideoTransFunc_22_709: DWORD = DXVA2_VideoTransFunc_709;
pub const DXVA2_VideoTransFunc_22_240M: DWORD = DXVA2_VideoTransFunc_240M;
pub const DXVA2_VideoTransFunc_22_8bit_sRGB: DWORD = DXVA2_VideoTransFunc_sRGB;
STRUCT !{struct DXVA2_Frequency {
Numerator: UINT,
Denominator: UINT,
}}
STRUCT !{struct DXVA2_VideoDesc {
SampleWidth: UINT,
SampleHeight: UINT,
SampleFormat: DXVA2_ExtendedFormat,
Format: D3DFORMAT,
InputSampleFreq: DXVA2_Frequency,
OutputFrameFreq: DXVA2_Frequency,
UABProtectionLevel: UINT,
Reserved: UINT,
}}
ENUM !{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0003 {
DXVA2_DeinterlaceTech_Unknown = 0 ,
DXVA2_DeinterlaceTech_BOBLineReplicate = 0 x1,
DXVA2_DeinterlaceTech_BOBVerticalStretch = 0 x2,
DXVA2_DeinterlaceTech_BOBVerticalStretch4Tap = 0 x4,
DXVA2_DeinterlaceTech_MedianFiltering = 0 x8,
DXVA2_DeinterlaceTech_EdgeFiltering = 0 x10,
DXVA2_DeinterlaceTech_FieldAdaptive = 0 x20,
DXVA2_DeinterlaceTech_PixelAdaptive = 0 x40,
DXVA2_DeinterlaceTech_MotionVectorSteered = 0 x80,
DXVA2_DeinterlaceTech_InverseTelecine = 0 x100,
DXVA2_DeinterlaceTech_Mask = 0 x1ff,
}}
ENUM !{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0004 {
DXVA2_NoiseFilterLumaLevel = 1 ,
DXVA2_NoiseFilterLumaThreshold = 2 ,
DXVA2_NoiseFilterLumaRadius = 3 ,
DXVA2_NoiseFilterChromaLevel = 4 ,
DXVA2_NoiseFilterChromaThreshold = 5 ,
DXVA2_NoiseFilterChromaRadius = 6 ,
DXVA2_DetailFilterLumaLevel = 7 ,
DXVA2_DetailFilterLumaThreshold = 8 ,
DXVA2_DetailFilterLumaRadius = 9 ,
DXVA2_DetailFilterChromaLevel = 10 ,
DXVA2_DetailFilterChromaThreshold = 11 ,
DXVA2_DetailFilterChromaRadius = 12 ,
}}
ENUM !{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0005 {
DXVA2_NoiseFilterTech_Unsupported = 0 ,
DXVA2_NoiseFilterTech_Unknown = 0 x1,
DXVA2_NoiseFilterTech_Median = 0 x2,
DXVA2_NoiseFilterTech_Temporal = 0 x4,
DXVA2_NoiseFilterTech_BlockNoise = 0 x8,
DXVA2_NoiseFilterTech_MosquitoNoise = 0 x10,
DXVA2_NoiseFilterTech_Mask = 0 x1f,
}}
ENUM !{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0006 {
DXVA2_DetailFilterTech_Unsupported = 0 ,
DXVA2_DetailFilterTech_Unknown = 0 x1,
DXVA2_DetailFilterTech_Edge = 0 x2,
DXVA2_DetailFilterTech_Sharpening = 0 x4,
DXVA2_DetailFilterTech_Mask = 0 x7,
}}
ENUM !{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0007 {
DXVA2_ProcAmp_None = 0 ,
DXVA2_ProcAmp_Brightness = 0 x1,
DXVA2_ProcAmp_Contrast = 0 x2,
DXVA2_ProcAmp_Hue = 0 x4,
DXVA2_ProcAmp_Saturation = 0 x8,
DXVA2_ProcAmp_Mask = 0 xf,
}}
ENUM !{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0008 {
DXVA2_VideoProcess_None = 0 ,
DXVA2_VideoProcess_YUV2RGB = 0 x1,
DXVA2_VideoProcess_StretchX = 0 x2,
DXVA2_VideoProcess_StretchY = 0 x4,
DXVA2_VideoProcess_AlphaBlend = 0 x8,
DXVA2_VideoProcess_SubRects = 0 x10,
DXVA2_VideoProcess_SubStreams = 0 x20,
DXVA2_VideoProcess_SubStreamsExtended = 0 x40,
DXVA2_VideoProcess_YUV2RGBExtended = 0 x80,
DXVA2_VideoProcess_AlphaBlendExtended = 0 x100,
DXVA2_VideoProcess_Constriction = 0 x200,
DXVA2_VideoProcess_NoiseFilter = 0 x400,
DXVA2_VideoProcess_DetailFilter = 0 x800,
DXVA2_VideoProcess_PlanarAlpha = 0 x1000,
DXVA2_VideoProcess_LinearScaling = 0 x2000,
DXVA2_VideoProcess_GammaCompensated = 0 x4000,
DXVA2_VideoProcess_MaintainsOriginalFieldData = 0 x8000,
DXVA2_VideoProcess_Mask = 0 xffff,
}}
ENUM !{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0009 {
DXVA2_VPDev_HardwareDevice = 0 x1,
DXVA2_VPDev_EmulatedDXVA1 = 0 x2,
DXVA2_VPDev_SoftwareDevice = 0 x4,
DXVA2_VPDev_Mask = 0 x7,
}}
ENUM !{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0010 {
DXVA2_SampleData_RFF = 0 x1,
DXVA2_SampleData_TFF = 0 x2,
DXVA2_SampleData_RFF_TFF_Present = 0 x4,
DXVA2_SampleData_Mask = 0 xffff,
}}
ENUM !{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0011 {
DXVA2_DestData_RFF = 0 x1,
DXVA2_DestData_TFF = 0 x2,
DXVA2_DestData_RFF_TFF_Present = 0 x4,
DXVA2_DestData_Mask = 0 xffff,
}}
STRUCT !{struct DXVA2_VideoProcessorCaps {
DeviceCaps: UINT,
InputPool: D3DPOOL,
NumForwardRefSamples: UINT,
NumBackwardRefSamples: UINT,
Reserved: UINT,
DeinterlaceTechnology: UINT,
ProcAmpControlCaps: UINT,
VideoProcessorOperations: UINT,
NoiseFilterTechnology: UINT,
DetailFilterTechnology: UINT,
}}
STRUCT !{struct DXVA2_Fixed32_s {
Fraction: USHORT,
Value: SHORT,
}}
UNION!{union DXVA2_Fixed32 {
[u32; 1 ],
s s_mut: DXVA2_Fixed32_s,
ll s_ll: LONG,
}}
STRUCT !{struct DXVA2_AYUVSample8 {
Cr: UCHAR,
Cb: UCHAR,
Y: UCHAR,
Alpha: UCHAR,
}}
STRUCT !{struct DXVA2_AYUVSample16 {
Cr: USHORT,
Cb: USHORT,
Y: USHORT,
Alpha: USHORT,
}}
pub type REFERENCE_TIME = LONGLONG;
STRUCT !{struct DXVA2_VideoSample {
Start: REFERENCE_TIME,
End: REFERENCE_TIME,
SampleFormat: DXVA2_ExtendedFormat,
SrcSurface: *mut IDirect3DSurface9,
SrcRect: RECT,
DstRect: RECT,
Pal: [DXVA2_AYUVSample8; 16 ],
PlanarAlpha: DXVA2_Fixed32,
SampleData: DWORD,
}}
STRUCT !{struct DXVA2_ValueRange {
MinValue: DXVA2_Fixed32,
MaxValue: DXVA2_Fixed32,
DefaultValue: DXVA2_Fixed32,
StepSize: DXVA2_Fixed32,
}}
STRUCT !{struct DXVA2_ProcAmpValues {
Brightness: DXVA2_Fixed32,
Contrast: DXVA2_Fixed32,
Hue: DXVA2_Fixed32,
Saturation: DXVA2_Fixed32,
}}
STRUCT !{struct DXVA2_FilterValues {
Level: DXVA2_Fixed32,
Threshold: DXVA2_Fixed32,
Radius: DXVA2_Fixed32,
}}
STRUCT !{struct DXVA2_VideoProcessBltParams {
TargetFrame: REFERENCE_TIME,
TargetRect: RECT,
ConstrictionSize: SIZE,
StreamingFlags: UINT,
BackgroundColor: DXVA2_AYUVSample16,
DestFormat: DXVA2_ExtendedFormat,
ProcAmpValues: DXVA2_ProcAmpValues,
Alpha: DXVA2_Fixed32,
NoiseFilterLuma: DXVA2_FilterValues,
NoiseFilterChroma: DXVA2_FilterValues,
DetailFilterLuma: DXVA2_FilterValues,
DetailFilterChroma: DXVA2_FilterValues,
DestData: DWORD,
}}
ENUM !{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0012 {
DXVA2_PictureParametersBufferType = 0 ,
DXVA2_MacroBlockControlBufferType = 1 ,
DXVA2_ResidualDifferenceBufferType = 2 ,
DXVA2_DeblockingControlBufferType = 3 ,
DXVA2_InverseQuantizationMatrixBufferType = 4 ,
DXVA2_SliceControlBufferType = 5 ,
DXVA2_BitStreamDateBufferType = 6 ,
DXVA2_MotionVectorBuffer = 7 ,
DXVA2_FilmGrainBuffer = 8 ,
}}
ENUM !{enum __MIDL___MIDL_itf_dxva2api_0000_0000_0013 {
DXVA2_VideoDecoderRenderTarget = 0 ,
DXVA2_VideoProcessorRenderTarget = 1 ,
DXVA2_VideoSoftwareRenderTarget = 2 ,
}}
STRUCT !{struct DXVA2_ConfigPictureDecode {
guidConfigBitstreamEncryption: GUID,
guidConfigMBcontrolEncryption: GUID,
guidConfigResidDiffEncryption: GUID,
ConfigBitstreamRaw: UINT,
ConfigMBcontrolRasterOrder: UINT,
ConfigResidDiffHost: UINT,
ConfigSpatialResid8: UINT,
ConfigResid8Subtraction: UINT,
ConfigSpatialHost8or9Clipping: UINT,
ConfigSpatialResidInterleaved: UINT,
ConfigIntraResidUnsigned: UINT,
ConfigResidDiffAccelerator: UINT,
ConfigHostInverseScan: UINT,
ConfigSpecificIDCT: UINT,
Config4GroupedCoefs: UINT,
ConfigMinRenderTargetBuffCount: USHORT,
ConfigDecoderSpecific: USHORT,
}}
STRUCT !{struct DXVA2_DecodeBufferDesc {
CompressedBufferType: DWORD,
BufferIndex: UINT,
DataOffset: UINT,
DataSize: UINT,
FirstMBaddress: UINT,
NumMBsInBuffer: UINT,
Width: UINT,
Height: UINT,
Stride: UINT,
ReservedBits: UINT,
pvPVPState: PVOID,
}}
STRUCT !{struct DXVA2_AES_CTR_IV {
IV: UINT64,
Count: UINT64,
}}
STRUCT !{struct DXVA2_DecodeExtensionData {
Function: UINT,
pPrivateInputData: PVOID,
PrivateInputDataSize: UINT,
pPrivateOutputData: PVOID,
PrivateOutputDataSize: UINT,
}}
pub const DXVA2_DECODE_GET_DRIVER_HANDLE: UINT = 0 x725;
pub const DXVA2_DECODE_SPECIFY_ENCRYPTED_BLOCKS: UINT = 0 x724;
STRUCT !{struct DXVA2_DecodeExecuteParams {
NumCompBuffers: UINT,
pCompressedBuffers: *mut DXVA2_DecodeBufferDesc,
pExtensionData: *mut DXVA2_DecodeExtensionData,
}}
RIDL!{#[ uuid(0 xa0cade0f, 0 x06d5, 0 x4cf4, 0 xa1, 0 xc7, 0 xf3, 0 xcd, 0 xd7, 0 x25, 0 xaa, 0 x75)]
interface IDirect3DDeviceManager9(IDirect3DDeviceManager9Vtbl): IUnknown(IUnknownVtbl) {
fn ResetDevice(
pDevice: *mut IDirect3DDevice9,
resetToken: UINT,
) -> HRESULT,
fn OpenDeviceHandle(
phDevice: *mut HANDLE,
) -> HRESULT,
fn CloseDeviceHandle(
hDevice: HANDLE,
) -> HRESULT,
fn TestDevice(
hDevice: HANDLE,
) -> HRESULT,
fn LockDevice(
hDevice: HANDLE,
ppDevice: *mut *mut IDirect3DDevice9,
fBloc: BOOL,
) -> HRESULT,
fn UnlockDevice(
hDevice: HANDLE,
fSaveState: BOOL,
) -> HRESULT,
fn GetVideoService(
hDevice: HANDLE,
riid: REFIID,
ppService: *mut *mut c_void,
) -> HRESULT,
}}
RIDL!{#[ uuid(0 xfc51a550, 0 xd5e7, 0 x11d9, 0 xaf, 0 x55, 0 x00, 0 x05, 0 x4e, 0 x43, 0 xff, 0 x02)]
interface IDirectXVideoAccelerationService(IDirectXVideoAccelerationServiceVtbl):
IUnknown(IUnknownVtbl) {
fn CreateSurface(
Width: UINT,
Height: UINT,
BackBuffers: UINT,
Format: D3DFORMAT,
Pool: D3DPOOL,
Usage: DWORD,
DxvaType: DWORD,
ppSurface: *mut *mut IDirect3DSurface9,
pSharedHandle: *mut HANDLE,
) -> HRESULT,
}}
RIDL!{#[ uuid(0 xfc51a551, 0 xd5e7, 0 x11d9, 0 xaf, 0 x55, 0 x00, 0 x05, 0 x4e, 0 x43, 0 xff, 0 x02)]
interface IDirectXVideoDecoderService(IDirectXVideoDecoderServiceVtbl):
IDirectXVideoAccelerationService(IDirectXVideoAccelerationServiceVtbl) {
fn GetDecoderDeviceGuids(
pCount: *mut UINT,
pGuids: *mut *mut GUID,
) -> HRESULT,
fn GetDecoderRenderTargets(
Guid: REFGUID,
pCount: *mut UINT,
pFormats: *mut *mut D3DFORMAT,
) -> HRESULT,
fn GetDecoderConfigurations(
Guid: REFGUID,
pVideoDesc: *const DXVA2_VideoDesc,
pReserved: *mut c_void,
pCount: *mut UINT,
ppConfigs: *mut *mut DXVA2_ConfigPictureDecode,
) -> HRESULT,
fn CreateVideoDecoder(
Guid: REFGUID,
pVideoDesc: *const DXVA2_VideoDesc,
pConfig: *const DXVA2_ConfigPictureDecode,
ppDecoderRenderTargets: *mut *mut IDirect3DSurface9,
NumRenderTargets: UINT,
ppDecode: *mut *mut IDirectXVideoDecoder,
) -> HRESULT,
}}
RIDL!{#[ uuid(0 xfc51a552, 0 xd5e7, 0 x11d9, 0 xaf, 0 x55, 0 x00, 0 x05, 0 x4e, 0 x43, 0 xff, 0 x02)]
interface IDirectXVideoProcessorService(IDirectXVideoProcessorServiceVtbl):
IDirectXVideoAccelerationService(IDirectXVideoAccelerationServiceVtbl) {
fn RegisterVideoProcessorSoftwareDevice(
pCallbacks: *mut c_void,
) -> HRESULT,
fn GetVideoProcessorDeviceGuids(
pVideoDesc: *mut DXVA2_VideoDesc,
pCount: *mut UINT,
pGuids: *mut *mut GUID,
) -> HRESULT,
fn GetVideoProcessorRenderTargets(
VideoProcDeviceGuid: REFGUID,
pVideoDesc: *const DXVA2_VideoDesc,
pCount: *mut UINT,
pFormats: *mut *mut D3DFORMAT,
) -> HRESULT,
fn GetVideoProcessorSubStreamFormats(
VideoProcDeviceGuid: REFGUID,
pVideoDesc: *const DXVA2_VideoDesc,
RenderTargetFormat: D3DFORMAT,
pCount: *mut UINT,
pFormats: *mut *mut D3DFORMAT,
) -> HRESULT,
fn GetVideoProcessorCaps(
VideoProcDeviceGuid: REFGUID,
pVideoDesc: *const DXVA2_VideoDesc,
RenderTargetFormat: D3DFORMAT,
pCaps: *mut DXVA2_VideoProcessorCaps,
) -> HRESULT,
fn GetProcAmpRange(
VideoProcDeviceGuid: REFGUID,
pVideoDesc: *const DXVA2_VideoDesc,
RenderTargetFormat: D3DFORMAT,
ProcAmpCap: UINT,
pRange: *mut DXVA2_ValueRange,
) -> HRESULT,
fn GetFilterPropertyRange(
VideoProcDeviceGuid: REFGUID,
pVideoDesc: *const DXVA2_VideoDesc,
RenderTargetFormat: D3DFORMAT,
FilterSetting: UINT,
pRange: *mut DXVA2_ValueRange,
) -> HRESULT,
fn CreateVideoProcessor(
VideoProcDeviceGuid: REFGUID,
pVideoDesc: *const DXVA2_VideoDesc,
RenderTargetFormat: D3DFORMAT,
MaxNumSubStreams: UINT,
ppVidProcess: *mut *mut IDirectXVideoProcessor,
) -> HRESULT,
}}
RIDL!{#[ uuid(0 xf2b0810a, 0 xfd00, 0 x43c9, 0 x91, 0 x8c, 0 xdf, 0 x94, 0 xe2, 0 xd8, 0 xef, 0 x7d)]
interface IDirectXVideoDecoder(IDirectXVideoDecoderVtbl): IUnknown(IUnknownVtbl) {
fn GetVideoDecoderService(
ppService: *mut *mut IDirectXVideoDecoderService,
) -> HRESULT,
fn GetCreationParameters(
pDeviceGuid: *mut GUID,
pVideoDesc: *mut DXVA2_VideoDesc,
pConfig: *mut DXVA2_ConfigPictureDecode,
pDecoderRenderTargets: *mut *mut *mut IDirect3DSurface9,
pNumSurfaces: *mut UINT,
) -> HRESULT,
fn GetBuffer(
BufferType: UINT,
ppBuffer: *mut *mut c_void,
pBufferSize: *mut UINT,
) -> HRESULT,
fn ReleaseBuffer(
BufferType: UINT,
) -> HRESULT,
fn BeginFrame(
pRenderTarget: *mut IDirect3DSurface9,
pvPVPData: *mut c_void,
) -> HRESULT,
fn EndFrame(
pHandleComplete: *mut HANDLE,
) -> HRESULT,
fn Execute(
pExecuteParams: *const DXVA2_DecodeExecuteParams,
) -> HRESULT,
}}
RIDL!{#[ uuid(0 x8c3a39f0, 0 x916e, 0 x4690, 0 x80, 0 x4f, 0 x4c, 0 x80, 0 x01, 0 x35, 0 x5d, 0 x25)]
interface IDirectXVideoProcessor(IDirectXVideoProcessorVtbl): IUnknown(IUnknownVtbl) {
fn GetVideoProcessorService(
ppService: *mut *mut IDirectXVideoProcessorService,
) -> HRESULT,
fn GetCreationParameters(
pDeviceGuid: *mut GUID,
pVideoDesc: *mut DXVA2_VideoDesc,
pRenderTargetFormat: *mut D3DFORMAT,
pMaxNumSubStreams: *mut UINT,
) -> HRESULT,
fn GetVideoProcessorCaps(
pCaps: *mut DXVA2_VideoProcessorCaps,
) -> HRESULT,
fn GetProcAmpRange(
ProcAmpCap: UINT,
pRange: *mut DXVA2_ValueRange,
) -> HRESULT,
fn GetFilterPropertyRange(
FilterSetting: UINT,
pRange: *mut DXVA2_ValueRange,
) -> HRESULT,
fn VideoProcessBlt(
pRenderTarget: *mut IDirect3DSurface9,
pBltParams: *const DXVA2_VideoProcessBltParams,
pSamples: *const DXVA2_VideoSample,
NumSamples: UINT,
pHandleComplete: *mut HANDLE,
) -> HRESULT,
}}
ENUM !{enum DXVA2_SurfaceType {
DXVA2_SurfaceType_DecoderRenderTarget = 0 ,
DXVA2_SurfaceType_ProcessorRenderTarget = 1 ,
DXVA2_SurfaceType_D3DRenderTargetTexture = 2 ,
}}
RIDL!{#[ uuid(0 xb7f916dd, 0 xdb3b, 0 x49c1, 0 x84, 0 xd7, 0 xe4, 0 x5e, 0 xf9, 0 x9e, 0 xc7, 0 x26)]
interface IDirectXVideoMemoryConfiguration(IDirectXVideoMemoryConfigurationVtbl):
IUnknown(IUnknownVtbl) {
fn GetAvailableSurfaceTypeByIndex(
dwTypeIndex: DWORD,
pdwType: *mut DXVA2_SurfaceType,
) -> HRESULT,
fn SetSurfaceType(
dwType: DXVA2_SurfaceType,
) -> HRESULT,
}}
extern "system" {
pub fn DXVA2CreateDirect3DDeviceManager9(
pResetToken: *mut UINT,
ppDeviceManager: *mut *mut IDirect3DDeviceManager9,
) -> HRESULT;
pub fn DXVA2CreateVideoService(
pDD: *mut IDirect3DDevice9,
riid: REFIID,
ppService: *mut *mut c_void,
) -> HRESULT;
}
#[ inline]
pub fn DXVA2FloatToFixed(_float_: c_float) -> DXVA2_Fixed32 {
unsafe {
let mut _fixed_: DXVA2_Fixed32 = ::core::mem::uninitialized();
_fixed_.s_mut().Fraction = LOWORD((_float_ * 0 x10000 as c_float) as DWORD);
_fixed_.s_mut().Value = HIWORD((_float_ * 0 x10000 as c_float) as DWORD) as SHORT;
_fixed_
}
}
#[ inline]
pub fn DXVA2FixedToFloat(_fixed_: DXVA2_Fixed32) -> c_float {
unsafe {
_fixed_.s().Value as FLOAT + _fixed_.s().Fraction as FLOAT / 0 x10000 as FLOAT
}
}
#[ inline]
pub fn DXVA2_Fixed32TransparentAlpha() -> DXVA2_Fixed32 {
unsafe {
let mut _fixed_: DXVA2_Fixed32 = ::core::mem::uninitialized();
_fixed_.s_mut().Fraction = 0 ;
_fixed_.s_mut().Value = 0 ;
_fixed_
}
}
#[ inline]
pub fn DXVA2_Fixed32OpaqueAlpha() -> DXVA2_Fixed32 {
unsafe {
let mut _fixed_: DXVA2_Fixed32 = ::core::mem::uninitialized();
_fixed_.s_mut().Fraction = 0 ;
_fixed_.s_mut().Value = 1 ;
_fixed_
}
}
Messung V0.5 in Prozent C=99 H=98 G=98
¤ Dauer der Verarbeitung: 0.18 Sekunden
(vorverarbeitet am 2026-06-21)
¤
*© Formatika GbR, Deutschland