dmime/tests: Test wave segments and DMUS_WAVE_PMSG.
[wine.git] / include / dxva2api.idl
blob205491e37908a192fa81dccce64b8c426169db02
1 /*
2 * Copyright 2014 Michael Müller for Pipelight
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 import "unknwn.idl";
21 cpp_quote("#if 0")
22 typedef DWORD IDirect3DDevice9;
23 typedef DWORD IDirect3DSurface9;
25 typedef DWORD D3DFORMAT;
26 typedef DWORD D3DPOOL;
27 cpp_quote("#endif")
29 /* MPEG2 */
30 cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG2_MoComp, 0xe6a9f44b, 0x61b0,0x4563, 0x9e,0xa4,0x63,0xd2,0xa3,0xc6,0xfe,0x66);")
31 cpp_quote("#define DXVA2_ModeMPEG2_MOCOMP DXVA2_ModeMPEG2_MoComp")
33 cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG2_IDCT, 0xbf22ad00, 0x03ea,0x4690, 0x80,0x77,0x47,0x33,0x46,0x20,0x9b,0x7e);")
35 cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG2_VLD, 0xee27417f, 0x5e28,0x4e65, 0xbe,0xea,0x1d,0x26,0xb5,0x08,0xad,0xc9);")
37 cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG1_VLD, 0x6f3ec719, 0x3735,0x42cc, 0x80,0x63,0x65,0xcc,0x3c,0xb3,0x66,0x16);")
39 cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG2and1_VLD, 0x86695f12, 0x340e,0x4f04, 0x9f,0xd3,0x92,0x53,0xdd,0x32,0x74,0x60);")
41 /* H264 */
42 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_A, 0x1b81be64, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
43 cpp_quote("#define DXVA2_ModeH264_MoComp_NoFGT DXVA2_ModeH264_A")
45 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_B, 0x1b81be65, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
46 cpp_quote("#define DXVA2_ModeH264_MoComp_FGT DXVA2_ModeH264_B")
48 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_C, 0x1b81be66, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
49 cpp_quote("#define DXVA2_ModeH264_IDCT_NoFGT DXVA2_ModeH264_C")
51 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_D, 0x1b81be67, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
52 cpp_quote("#define DXVA2_ModeH264_IDCT_FGT DXVA2_ModeH264_D")
54 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_E, 0x1b81be68, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
55 cpp_quote("#define DXVA2_ModeH264_VLD_NoFGT DXVA2_ModeH264_E")
57 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_F, 0x1b81be69, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
58 cpp_quote("#define DXVA2_ModeH264_VLD_FGT DXVA2_ModeH264_F")
60 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_VLD_WithFMOASO_NoFGT, 0xd5f04ff9, 0x3418,0x45d8, 0x95,0x61,0x32,0xa7,0x6a,0xae,0x2d,0xdd);")
62 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_VLD_Stereo_Progressive_NoFGT, 0xd79be8da, 0x0cf1,0x4c81, 0xb8,0x2a,0x69,0xa4,0xe2,0x36,0xf4,0x3d);")
63 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_VLD_Stereo_NoFGT, 0xf9aaccbb, 0xc2b6,0x4cfc, 0x87,0x79,0x57,0x07,0xb1,0x76,0x05,0x52);")
64 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_VLD_Multiview_NoFGT, 0x705b9d82, 0x76cf,0x49d6, 0xb7,0xe6,0xac,0x88,0x72,0xdb,0x01,0x3c);")
66 /* WMV8 */
67 cpp_quote("DEFINE_GUID(DXVA2_ModeWMV8_A, 0x1b81be80, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
68 cpp_quote("#define DXVA2_ModeWMV8_PostProc DXVA2_ModeWMV8_A")
70 cpp_quote("DEFINE_GUID(DXVA2_ModeWMV8_B, 0x1b81be81, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
71 cpp_quote("#define DXVA2_ModeWMV8_MoComp DXVA2_ModeWMV8_B")
73 /* WMV9 */
74 cpp_quote("DEFINE_GUID(DXVA2_ModeWMV9_A, 0x1b81be90, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
75 cpp_quote("#define DXVA2_ModeWMV9_PostProc DXVA2_ModeWMV9_A")
77 cpp_quote("DEFINE_GUID(DXVA2_ModeWMV9_B, 0x1b81be91, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
78 cpp_quote("#define DXVA2_ModeWMV9_MoComp DXVA2_ModeWMV9_B")
80 cpp_quote("DEFINE_GUID(DXVA2_ModeWMV9_C, 0x1b81be94, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
81 cpp_quote("#define DXVA2_ModeWMV9_IDCT DXVA2_ModeWMV9_C")
83 /* VC1 */
84 cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_A, 0x1b81beA0, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
85 cpp_quote("#define DXVA2_ModeVC1_PostProc DXVA2_ModeVC1_A")
87 cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_B, 0x1b81beA1, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
88 cpp_quote("#define DXVA2_ModeVC1_MoComp DXVA2_ModeVC1_B")
90 cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_C, 0x1b81beA2, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
91 cpp_quote("#define DXVA2_ModeVC1_IDCT DXVA2_ModeVC1_C")
93 cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_D, 0x1b81beA3, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
94 cpp_quote("#define DXVA2_ModeVC1_VLD DXVA2_ModeVC1_D")
96 cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_D2010, 0x1b81bea4, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
98 /* Encryption */
99 cpp_quote("DEFINE_GUID(DXVA2_NoEncrypt, 0x1b81bed0, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
101 cpp_quote("DEFINE_GUID(DXVA2_VideoProcProgressiveDevice, 0x5a54a0c9, 0xc7ec,0x4bd9, 0x8e,0xde,0xf3,0xc7,0x5d,0xc4,0x39,0x3b);")
102 cpp_quote("DEFINE_GUID(DXVA2_VideoProcBobDevice, 0x335aa36e, 0x7884,0x43a4, 0x9c,0x91,0x7f,0x87,0xfa,0xf3,0xe3,0x7e);")
103 cpp_quote("DEFINE_GUID(DXVA2_VideoProcSoftwareDevice, 0x4553d47f, 0xee7e,0x4e3f, 0x94,0x75,0xdb,0xf1,0x37,0x6c,0x48,0x10);")
105 cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG4pt2_VLD_Simple, 0xefd64d74, 0xc9e8,0x41d7, 0xa5,0xe9,0xe9,0xb0,0xe3,0x9f,0xa3,0x19);")
106 cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG4pt2_VLD_AdvSimple_NoGMC, 0xed418a9f, 0x010d,0x4eda, 0x9a,0xe3,0x9a,0x65,0x35,0x8d,0x8d,0x2e);")
107 cpp_quote("DEFINE_GUID(DXVA2_ModeMPEG4pt2_VLD_AdvSimple_GMC, 0xab998b5b, 0x4258,0x44a9, 0x9f,0xeb,0x94,0xe5,0x97,0xa6,0xba,0xae);")
109 cpp_quote("DEFINE_GUID(DXVA2_ModeHEVC_VLD_Main, 0x5b11d51b, 0x2f4c,0x4452, 0xbc,0xc3,0x09,0xf2,0xa1,0x16,0x0c,0xc0);")
110 cpp_quote("DEFINE_GUID(DXVA2_ModeHEVC_VLD_Main10, 0x107af0e0, 0xef1a,0x4d19, 0xab,0xa8,0x67,0xa1,0x63,0x07,0x3d,0x13);")
112 cpp_quote("DEFINE_GUID(DXVA2_ModeVP9_VLD_Profile0, 0x463707f8, 0xa1d0,0x4585, 0x87,0x6d,0x83,0xaa,0x6d,0x60,0xb8,0x9e);")
113 cpp_quote("DEFINE_GUID(DXVA2_ModeVP9_VLD_10bit_Profile2, 0xa4c749ef, 0x6ecf,0x48aa, 0x84,0x48,0x50,0xa7,0xa1,0x16,0x5f,0xf7);")
114 cpp_quote("DEFINE_GUID(DXVA2_ModeVP8_VLD, 0x90b899ea, 0x3a62,0x4705, 0x88,0xb3,0x8d,0xf0,0x4b,0x27,0x44,0xe7);")
116 cpp_quote("#ifndef REFERENCE_TIME_DEFINED")
117 cpp_quote("#define REFERENCE_TIME_DEFINED")
118 typedef LONGLONG REFERENCE_TIME;
119 cpp_quote("#endif")
121 /* DXVA2-specific error codes */
122 cpp_quote("#define DXVA2_E_NOT_INITIALIZED ((HRESULT)0x80041000)")
123 cpp_quote("#define DXVA2_E_NEW_VIDEO_DEVICE ((HRESULT)0x80041001)")
124 cpp_quote("#define DXVA2_E_VIDEO_DEVICE_LOCKED ((HRESULT)0x80041002)")
125 cpp_quote("#define DXVA2_E_NOT_AVAILABLE ((HRESULT)0x80041003)")
127 enum
129 DXVA2_PictureParametersBufferType,
130 DXVA2_MacroBlockControlBufferType,
131 DXVA2_ResidualDifferenceBufferType,
132 DXVA2_DeblockingControlBufferType,
133 DXVA2_InverseQuantizationMatrixBufferType,
134 DXVA2_SliceControlBufferType,
135 DXVA2_BitStreamDateBufferType,
136 DXVA2_MotionVectorBuffer,
137 DXVA2_FilmGrainBuffer
140 enum
142 DXVA2_VideoDecoderRenderTarget,
143 DXVA2_VideoProcessorRenderTarget,
144 DXVA2_VideoSoftwareRenderTarget
147 typedef struct _DXVA2_ExtendedFormat
149 union
151 struct
153 UINT SampleFormat :8;
154 UINT VideoChromaSubsampling :4;
155 UINT NominalRange :3;
156 UINT VideoTransferMatrix :3;
157 UINT VideoLighting :4;
158 UINT VideoPrimaries :5;
159 UINT VideoTransferFunction :5;
161 UINT value;
163 } DXVA2_ExtendedFormat;
165 typedef enum _DXVA2_SampleFormat
167 DXVA2_SampleFormatMask = 0x00FF,
168 DXVA2_SampleUnknown = 0,
169 DXVA2_SampleProgressiveFrame = 2,
170 DXVA2_SampleFieldInterleavedEvenFirst = 3,
171 DXVA2_SampleFieldInterleavedOddFirst = 4,
172 DXVA2_SampleFieldSingleEven = 5,
173 DXVA2_SampleFieldSingleOdd = 6,
174 DXVA2_SampleSubStream = 7
175 } DXVA2_SampleFormat;
177 typedef enum _DXVA2_VideoChromaSubSampling
179 DXVA2_VideoChromaSubsamplingMask = 0x0F,
180 DXVA2_VideoChromaSubsampling_Unknown = 0,
181 DXVA2_VideoChromaSubsampling_ProgressiveChroma = 0x8,
182 DXVA2_VideoChromaSubsampling_Horizontally_Cosited = 0x4,
183 DXVA2_VideoChromaSubsampling_Vertically_Cosited = 0x2,
184 DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes = 0x1,
185 DXVA2_VideoChromaSubsampling_MPEG2 = DXVA2_VideoChromaSubsampling_Horizontally_Cosited |
186 DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes,
187 DXVA2_VideoChromaSubsampling_MPEG1 = DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes,
188 DXVA2_VideoChromaSubsampling_DV_PAL = DXVA2_VideoChromaSubsampling_Horizontally_Cosited |
189 DXVA2_VideoChromaSubsampling_Vertically_Cosited,
190 DXVA2_VideoChromaSubsampling_Cosited = DXVA2_VideoChromaSubsampling_Horizontally_Cosited |
191 DXVA2_VideoChromaSubsampling_Vertically_Cosited |
192 DXVA2_VideoChromaSubsampling_Vertically_AlignedChromaPlanes
193 } DXVA2_VideoChromaSubSampling;
195 typedef enum _DXVA2_NominalRange
197 DXVA2_NominalRangeMask = 0x07,
198 DXVA2_NominalRange_Unknown = 0,
199 DXVA2_NominalRange_Normal = 1,
200 DXVA2_NominalRange_Wide = 2,
201 DXVA2_NominalRange_0_255 = 1,
202 DXVA2_NominalRange_16_235 = 2,
203 DXVA2_NominalRange_48_208 = 3
204 } DXVA2_NominalRange;
206 typedef enum _DXVA2_VideoTransferMatrix
208 DXVA2_VideoTransferMatrixMask = 0x07,
209 DXVA2_VideoTransferMatrix_Unknown = 0,
210 DXVA2_VideoTransferMatrix_BT709 = 1,
211 DXVA2_VideoTransferMatrix_BT601 = 2,
212 DXVA2_VideoTransferMatrix_SMPTE240M = 3
213 } DXVA2_VideoTransferMatrix;
215 typedef enum _DXVA2_VideoLighting
217 DXVA2_VideoLightingMask = 0x0F,
218 DXVA2_VideoLighting_Unknown = 0,
219 DXVA2_VideoLighting_bright = 1,
220 DXVA2_VideoLighting_office = 2,
221 DXVA2_VideoLighting_dim = 3,
222 DXVA2_VideoLighting_dark = 4
223 } DXVA2_VideoLighting;
225 typedef enum _DXVA2_VideoPrimaries
227 DXVA2_VideoPrimariesMask = 0x001f,
228 DXVA2_VideoPrimaries_Unknown = 0,
229 DXVA2_VideoPrimaries_reserved = 1,
230 DXVA2_VideoPrimaries_BT709 = 2,
231 DXVA2_VideoPrimaries_BT470_2_SysM = 3,
232 DXVA2_VideoPrimaries_BT470_2_SysBG = 4,
233 DXVA2_VideoPrimaries_SMPTE170M = 5,
234 DXVA2_VideoPrimaries_SMPTE240M = 6,
235 DXVA2_VideoPrimaries_EBU3213 = 7,
236 DXVA2_VideoPrimaries_SMPTE_C = 8
237 } DXVA2_VideoPrimaries;
239 typedef enum _DXVA2_VideoTransferFunction
241 DXVA2_VideoTransFuncMask = 0x001f,
242 DXVA2_VideoTransFunc_Unknown = 0,
243 DXVA2_VideoTransFunc_10 = 1,
244 DXVA2_VideoTransFunc_18 = 2,
245 DXVA2_VideoTransFunc_20 = 3,
246 DXVA2_VideoTransFunc_22 = 4,
247 DXVA2_VideoTransFunc_709 = 5,
248 DXVA2_VideoTransFunc_240M = 6,
249 DXVA2_VideoTransFunc_sRGB = 7,
250 DXVA2_VideoTransFunc_28 = 8
251 } DXVA2_VideoTransferFunction;
253 cpp_quote("#define DXVA2_VideoTransFunc_22_709 DXVA2_VideoTransFunc_709")
254 cpp_quote("#define DXVA2_VideoTransFunc_22_240M DXVA2_VideoTransFunc_240M")
255 cpp_quote("#define DXVA2_VideoTransFunc_22_8bit_sRGB DXVA2_VideoTransFunc_sRGB")
257 typedef struct _DXVA2_Frequency
259 UINT Numerator;
260 UINT Denominator;
261 } DXVA2_Frequency;
263 typedef struct _DXVA2_ConfigPictureDecode
265 GUID guidConfigBitstreamEncryption;
266 GUID guidConfigMBcontrolEncryption;
267 GUID guidConfigResidDiffEncryption;
268 UINT ConfigBitstreamRaw;
269 UINT ConfigMBcontrolRasterOrder;
270 UINT ConfigResidDiffHost;
271 UINT ConfigSpatialResid8;
272 UINT ConfigResid8Subtraction;
273 UINT ConfigSpatialHost8or9Clipping;
274 UINT ConfigSpatialResidInterleaved;
275 UINT ConfigIntraResidUnsigned;
276 UINT ConfigResidDiffAccelerator;
277 UINT ConfigHostInverseScan;
278 UINT ConfigSpecificIDCT;
279 UINT Config4GroupedCoefs;
280 UINT ConfigMinRenderTargetBuffCount;
281 USHORT ConfigDecoderSpecific;
282 } DXVA2_ConfigPictureDecode;
284 typedef struct _DXVA2_VideoDesc
286 UINT SampleWidth;
287 UINT SampleHeight;
288 DXVA2_ExtendedFormat SampleFormat;
289 D3DFORMAT Format;
290 DXVA2_Frequency InputSampleFreq;
291 DXVA2_Frequency OutputFrameFreq;
292 UINT UABProtectionLevel;
293 UINT Reserved;
294 } DXVA2_VideoDesc;
296 enum
298 DXVA2_DeinterlaceTech_Unknown = 0x0000,
299 DXVA2_DeinterlaceTech_BOBLineReplicate = 0x0001,
300 DXVA2_DeinterlaceTech_BOBVerticalStretch = 0x0002,
301 DXVA2_DeinterlaceTech_BOBVerticalStretch4Tap = 0x0004,
302 DXVA2_DeinterlaceTech_MedianFiltering = 0x0008,
303 DXVA2_DeinterlaceTech_EdgeFiltering = 0x0010,
304 DXVA2_DeinterlaceTech_FieldAdaptive = 0x0020,
305 DXVA2_DeinterlaceTech_PixelAdaptive = 0x0040,
306 DXVA2_DeinterlaceTech_MotionVectorSteered = 0x0080,
307 DXVA2_DeinterlaceTech_InverseTelecine = 0x0100,
308 DXVA2_DeinterlaceTech_Mask = 0x01ff
311 enum
313 DXVA2_NoiseFilterLumaLevel = 1,
314 DXVA2_NoiseFilterLumaThreshold = 2,
315 DXVA2_NoiseFilterLumaRadius = 3,
316 DXVA2_NoiseFilterChromaLevel = 4,
317 DXVA2_NoiseFilterChromaThreshold = 5,
318 DXVA2_NoiseFilterChromaRadius = 6,
319 DXVA2_DetailFilterLumaLevel = 7,
320 DXVA2_DetailFilterLumaThreshold = 8,
321 DXVA2_DetailFilterLumaRadius = 9,
322 DXVA2_DetailFilterChromaLevel = 10,
323 DXVA2_DetailFilterChromaThreshold = 11,
324 DXVA2_DetailFilterChromaRadius = 12
327 enum
329 DXVA2_NoiseFilterTech_Unsupported = 0,
330 DXVA2_NoiseFilterTech_Unknown = 0x0001,
331 DXVA2_NoiseFilterTech_Median = 0x0002,
332 DXVA2_NoiseFilterTech_Temporal = 0x0004,
333 DXVA2_NoiseFilterTech_BlockNoise = 0x0008,
334 DXVA2_NoiseFilterTech_MosquitoNoise = 0x0010,
335 DXVA2_NoiseFilterTech_Mask = 0x001f
338 enum
340 DXVA2_DetailFilterTech_Unsupported = 0,
341 DXVA2_DetailFilterTech_Unknown = 0x0001,
342 DXVA2_DetailFilterTech_Edge = 0x0002,
343 DXVA2_DetailFilterTech_Sharpening = 0x0004,
344 DXVA2_DetailFilterTech_Mask = 0x0007
347 enum
349 DXVA2_ProcAmp_None = 0x0000,
350 DXVA2_ProcAmp_Brightness = 0x0001,
351 DXVA2_ProcAmp_Contrast = 0x0002,
352 DXVA2_ProcAmp_Hue = 0x0004,
353 DXVA2_ProcAmp_Saturation = 0x0008,
354 DXVA2_ProcAmp_Mask = 0x000f
357 enum
359 DXVA2_VideoProcess_None = 0x0000,
360 DXVA2_VideoProcess_YUV2RGB = 0x0001,
361 DXVA2_VideoProcess_StretchX = 0x0002,
362 DXVA2_VideoProcess_StretchY = 0x0004,
363 DXVA2_VideoProcess_AlphaBlend = 0x0008,
364 DXVA2_VideoProcess_SubRects = 0x0010,
365 DXVA2_VideoProcess_SubStreams = 0x0020,
366 DXVA2_VideoProcess_SubStreamsExtended = 0x0040,
367 DXVA2_VideoProcess_YUV2RGBExtended = 0x0080,
368 DXVA2_VideoProcess_AlphaBlendExtended = 0x0100,
369 DXVA2_VideoProcess_Constriction = 0x0200,
370 DXVA2_VideoProcess_NoiseFilter = 0x0400,
371 DXVA2_VideoProcess_DetailFilter = 0x0800,
372 DXVA2_VideoProcess_PlanarAlpha = 0x1000,
373 DXVA2_VideoProcess_LinearScaling = 0x2000,
374 DXVA2_VideoProcess_GammaCompensated = 0x4000,
375 DXVA2_VideoProcess_MaintainsOriginalFieldData = 0x8000,
376 DXVA2_VideoProcess_Mask = 0xffff
379 enum
381 DXVA2_VPDev_HardwareDevice = 0x0001,
382 DXVA2_VPDev_EmulatedDXVA1 = 0x0002,
383 DXVA2_VPDev_SoftwareDevice = 0x0004,
384 DXVA2_VPDev_Mask = 0x0007
387 enum
389 DXVA2_SampleData_RFF = 0x0001,
390 DXVA2_SampleData_TFF = 0x0002,
391 DXVA2_SampleData_RFF_TFF_Present = 0x0004,
392 DXVA2_SampleData_Mask = 0xffff
395 enum
397 DXVA2_DestData_RFF = 0x0001,
398 DXVA2_DestData_TFF = 0x0002,
399 DXVA2_DestData_RFF_TFF_Present = 0x0004,
400 DXVA2_DestData_Mask = 0xffff
403 typedef struct _DXVA2_DecodeBufferDesc
405 DWORD CompressedBufferType;
406 UINT BufferIndex;
407 UINT DataOffset;
408 UINT DataSize;
409 UINT FirstMBaddress;
410 UINT NumMBsInBuffer;
411 UINT Width;
412 UINT Height;
413 UINT Stride;
414 UINT ReservedBits;
415 PVOID pvPVPState;
416 } DXVA2_DecodeBufferDesc;
418 typedef struct _DXVA2_AES_CTR_IV
420 UINT64 IV;
421 UINT64 Count;
422 } DXVA2_AES_CTR_IV;
424 typedef struct _DXVA2_DecodeExtensionData
426 UINT Function;
427 PVOID pPrivateInputData;
428 UINT PrivateInputDataSize;
429 PVOID pPrivateOutputData;
430 UINT PrivateOutputDataSize;
431 } DXVA2_DecodeExtensionData;
433 typedef struct _DXVA2_DecodeExecuteParams
435 UINT NumCompBuffers;
436 DXVA2_DecodeBufferDesc* pCompressedBuffers;
437 DXVA2_DecodeExtensionData* pExtensionData;
438 } DXVA2_DecodeExecuteParams;
440 typedef struct _DXVA2_VideoProcessorCaps
442 UINT DeviceCaps;
443 D3DPOOL InputPool;
444 UINT NumForwardRefSamples;
445 UINT NumBackwardRefSamples;
446 UINT Reserved;
447 UINT DeinterlaceTechnology;
448 UINT ProcAmpControlCaps;
449 UINT VideoProcessorOperations;
450 UINT NoiseFilterTechnology;
451 UINT DetailFilterTechnology;
452 } DXVA2_VideoProcessorCaps;
454 typedef struct _DXVA2_Fixed32
456 union
458 struct
460 USHORT Fraction;
461 SHORT Value;
463 LONG ll;
465 } DXVA2_Fixed32;
467 typedef struct _DXVA2_ValueRange
469 DXVA2_Fixed32 MinValue;
470 DXVA2_Fixed32 MaxValue;
471 DXVA2_Fixed32 DefaultValue;
472 DXVA2_Fixed32 StepSize;
473 } DXVA2_ValueRange;
475 typedef struct _DXVA2_AYUVSample8
477 UCHAR Cr;
478 UCHAR Cb;
479 UCHAR Y;
480 UCHAR Alpha;
481 } DXVA2_AYUVSample8;
483 typedef struct _DXVA2_AYUVSample16
485 USHORT Cr;
486 USHORT Cb;
487 USHORT Y;
488 USHORT Alpha;
489 } DXVA2_AYUVSample16;
491 typedef struct _DXVA2_ProcAmpValues
493 DXVA2_Fixed32 Brightness;
494 DXVA2_Fixed32 Contrast;
495 DXVA2_Fixed32 Hue;
496 DXVA2_Fixed32 Saturation;
497 } DXVA2_ProcAmpValues;
499 typedef struct _DXVA2_FilterValues
501 DXVA2_Fixed32 Level;
502 DXVA2_Fixed32 Threshold;
503 DXVA2_Fixed32 Radius;
504 } DXVA2_FilterValues;
506 typedef struct _DXVA2_VideoProcessBltParams
508 REFERENCE_TIME TargetFrame;
509 RECT TargetRect;
510 SIZE ConstrictionSize;
511 UINT StreamingFlags;
512 DXVA2_AYUVSample16 BackgroundColor;
513 DXVA2_ExtendedFormat DestFormat;
514 DXVA2_ProcAmpValues ProcAmpValues;
515 DXVA2_Fixed32 Alpha;
516 DXVA2_FilterValues NoiseFilterLuma;
517 DXVA2_FilterValues NoiseFilterChroma;
518 DXVA2_FilterValues DetailFilterLuma;
519 DXVA2_FilterValues DetailFilterChroma;
520 DWORD DestData;
521 } DXVA2_VideoProcessBltParams;
523 cpp_quote("#ifdef _D3D9_H_")
525 typedef struct _DXVA2_VideoSample
527 REFERENCE_TIME Start;
528 REFERENCE_TIME End;
529 DXVA2_ExtendedFormat SampleFormat;
530 IDirect3DSurface9* SrcSurface;
531 RECT SrcRect;
532 RECT DstRect;
533 DXVA2_AYUVSample8 Pal[16];
534 DXVA2_Fixed32 PlanarAlpha;
535 DWORD SampleData;
536 } DXVA2_VideoSample;
538 typedef enum
540 DXVA2_SurfaceType_DecoderRenderTarget,
541 DXVA2_SurfaceType_ProcessorRenderTarget,
542 DXVA2_SurfaceType_D3DRenderTargetTexture,
543 } DXVA2_SurfaceType;
545 interface IDirect3DDeviceManager9;
546 interface IDirectXVideoAccelerationService;
547 interface IDirectXVideoDecoderService;
548 interface IDirectXVideoProcessorService;
549 interface IDirectXVideoDecoder;
550 interface IDirectXVideoProcessor;
552 /*****************************************************************************
553 * IDirect3DDeviceManager9 interface
556 object,
557 uuid(a0cade0f-06d5-4cf4-a1c7-f3cdd725aa75),
558 local
560 interface IDirect3DDeviceManager9 : IUnknown
562 HRESULT ResetDevice(
563 [in] IDirect3DDevice9* pDevice,
564 [in] UINT resetToken);
566 HRESULT OpenDeviceHandle(
567 [out] HANDLE* phDevice);
569 HRESULT CloseDeviceHandle(
570 [in] HANDLE hDevice);
572 HRESULT TestDevice(
573 [in] HANDLE hDevice);
575 HRESULT LockDevice(
576 [in] HANDLE hDevice,
577 [out] IDirect3DDevice9** ppDevice,
578 [in] BOOL fBlock);
580 HRESULT UnlockDevice(
581 [in] HANDLE hDevice,
582 [in] BOOL fSaveState);
584 HRESULT GetVideoService(
585 [in] HANDLE hDevice,
586 [in] REFIID riid,
587 [out] void** ppService);
590 /*****************************************************************************
591 * IDirectXVideoAccelerationService interface
594 object,
595 uuid(fc51a550-d5e7-11d9-af55-00054e43ff02),
596 local
598 interface IDirectXVideoAccelerationService : IUnknown
600 HRESULT CreateSurface(
601 [in] UINT width,
602 [in] UINT height,
603 [in] UINT backBuffers,
604 [in] D3DFORMAT format,
605 [in] D3DPOOL pool,
606 [in] DWORD usage,
607 [in] DWORD dxvaType,
608 [out] IDirect3DSurface9 **ppSurface,
609 [in, out] HANDLE *pSharedHandle);
612 /*****************************************************************************
613 * IDirectXVideoDecoderService interface
616 object,
617 uuid(fc51a551-d5e7-11d9-af55-00054e43ff02),
618 local
620 interface IDirectXVideoDecoderService : IDirectXVideoAccelerationService
622 HRESULT GetDecoderDeviceGuids(
623 [out] UINT *count,
624 [out] GUID **pGuids);
626 HRESULT GetDecoderRenderTargets(
627 [in] REFGUID guid,
628 [out] UINT *pCount,
629 [out] D3DFORMAT **pFormats);
631 HRESULT GetDecoderConfigurations(
632 [in] REFGUID guid,
633 [in] const DXVA2_VideoDesc *pVideoDesc,
634 [in] void *pReserved,
635 [out] UINT *pCount,
636 [out] DXVA2_ConfigPictureDecode **ppConfigs);
638 HRESULT CreateVideoDecoder(
639 [in] REFGUID guid,
640 [in] const DXVA2_VideoDesc *pVideoDesc,
641 [in] const DXVA2_ConfigPictureDecode *pConfig,
642 [in] IDirect3DSurface9 **ppDecoderRenderTargets,
643 [in] UINT NumSurfaces,
644 [out] IDirectXVideoDecoder **ppDecode);
647 /*****************************************************************************
648 * IDirectXVideoDecoder interface
651 object,
652 uuid(f2b0810a-fd00-43c9-918c-df94e2d8ef7d),
653 local
655 interface IDirectXVideoDecoder : IUnknown
657 HRESULT GetVideoDecoderService(
658 [out] IDirectXVideoDecoderService** ppService);
660 HRESULT GetCreationParameters(
661 [out] GUID* pDeviceGuid,
662 [out] DXVA2_VideoDesc* pVideoDesc,
663 [out] DXVA2_ConfigPictureDecode* pConfig,
664 [out] IDirect3DSurface9*** pDecoderRenderTargets,
665 [out] UINT* pNumSurfaces);
667 HRESULT GetBuffer(
668 [in] UINT BufferType,
669 [out] void** ppBuffer,
670 [out] UINT* pBufferSize);
672 HRESULT ReleaseBuffer(
673 [in] UINT BufferType);
675 HRESULT BeginFrame(
676 [in] IDirect3DSurface9* pRenderTarget,
677 [in] void* pvPVPData);
679 HRESULT EndFrame(
680 [out] HANDLE* pHandleComplete);
682 HRESULT Execute(
683 [in] const DXVA2_DecodeExecuteParams* pExecuteParams);
686 /*****************************************************************************
687 * IDirectXVideoProcessorService interface
690 object,
691 uuid(fc51a552-d5e7-11d9-af55-00054e43ff02),
692 local
694 interface IDirectXVideoProcessorService : IDirectXVideoAccelerationService
696 HRESULT RegisterVideoProcessorSoftwareDevice(
697 [in] void* pCallbacks);
699 HRESULT GetVideoProcessorDeviceGuids(
700 [in] const DXVA2_VideoDesc* pVideoDesc,
701 [out] UINT* pCount,
702 [out] GUID** pGuids);
704 HRESULT GetVideoProcessorRenderTargets(
705 [in] REFGUID VideoProcDeviceGuid,
706 [in] const DXVA2_VideoDesc* pVideoDesc,
707 [out] UINT* pCount,
708 [out] D3DFORMAT** pFormats);
710 HRESULT GetVideoProcessorSubStreamFormats(
711 [in] REFGUID VideoProcDeviceGuid,
712 [in] const DXVA2_VideoDesc* pVideoDesc,
713 [in] D3DFORMAT RenderTargetFormat,
714 [out] UINT* pCount,
715 [out] D3DFORMAT** pFormats);
717 HRESULT GetVideoProcessorCaps(
718 [in] REFGUID VideoProcDeviceGuid,
719 [in] const DXVA2_VideoDesc* pVideoDesc,
720 [in] D3DFORMAT RenderTargetFormat,
721 [out] DXVA2_VideoProcessorCaps* pCaps);
723 HRESULT GetProcAmpRange(
724 [in] REFGUID VideoProcDeviceGuid,
725 [in] const DXVA2_VideoDesc* pVideoDesc,
726 [in] D3DFORMAT RenderTargetFormat,
727 [in] UINT ProcAmpCap,
728 [out] DXVA2_ValueRange* pRange);
730 HRESULT GetFilterPropertyRange(
731 [in] REFGUID VideoProcDeviceGuid,
732 [in] const DXVA2_VideoDesc* pVideoDesc,
733 [in] D3DFORMAT renderTargetFormat,
734 [in] UINT FilterSetting,
735 [out] DXVA2_ValueRange* pRange);
737 HRESULT CreateVideoProcessor(
738 [in] REFGUID VideoProcDeviceGuid,
739 [in] const DXVA2_VideoDesc* pVideoDesc,
740 [in] D3DFORMAT RenderTargetFormat,
741 [in] UINT MaxNumSubStreams,
742 [out] IDirectXVideoProcessor** ppVidProcess);
745 /*****************************************************************************
746 * IDirectXVideoProcessor interface
749 object,
750 uuid(8c3a39f0-916e-4690-804f-4c8001355d25),
751 local
753 interface IDirectXVideoProcessor : IUnknown
755 HRESULT GetVideoProcessorService(
756 [out] IDirectXVideoProcessorService** ppService);
758 HRESULT GetCreationParameters(
759 [out] GUID* pDeviceGuid,
760 [out] DXVA2_VideoDesc* pVideoDesc,
761 [out] D3DFORMAT* pRenderTargetFormat,
762 [out] UINT* pMaxNumSubStreams);
764 HRESULT GetVideoProcessorCaps(
765 [out] DXVA2_VideoProcessorCaps* pCaps);
767 HRESULT GetProcAmpRange(
768 [in] UINT ProcAmpCap,
769 [out] DXVA2_ValueRange* pRange);
771 HRESULT GetFilterPropertyRange(
772 [in] UINT FilterSetting,
773 [out] DXVA2_ValueRange* pRange);
775 HRESULT VideoProcessBlt(
776 [in] IDirect3DSurface9* pRenderTarget,
777 [in] const DXVA2_VideoProcessBltParams* pBltParams,
778 [in] const DXVA2_VideoSample* pSamples,
779 [in] UINT NumSamples,
780 [out] HANDLE* pHandleComplete);
783 /*****************************************************************************
784 * IDirectXVideoMemoryConfiguration interface
787 object,
788 uuid(b7f916dd-db3b-49c1-84d7-e45ef99ec726),
789 local
791 interface IDirectXVideoMemoryConfiguration : IUnknown
793 HRESULT GetAvailableSurfaceTypeByIndex(
794 [in] DWORD wTypeIndex,
795 [out] DXVA2_SurfaceType *pdwType);
797 HRESULT SetSurfaceType(
798 [in] DXVA2_SurfaceType dwType);
801 cpp_quote("HRESULT WINAPI DXVA2CreateDirect3DDeviceManager9(UINT *pResetToken,IDirect3DDeviceManager9 **ppDXVAManager);")
802 cpp_quote("HRESULT WINAPI DXVA2CreateVideoService(IDirect3DDevice9 *pDD,REFIID riid,void **ppService);")
804 cpp_quote("#endif")
806 cpp_quote("static inline DXVA2_Fixed32 DXVA2_Fixed32OpaqueAlpha(void) {")
807 cpp_quote(" DXVA2_Fixed32 f32;")
808 cpp_quote(" f32.ll = 0 + (1 << 16);")
809 cpp_quote(" return f32;")
810 cpp_quote("}")
811 cpp_quote("")
812 cpp_quote("static inline DXVA2_Fixed32 DXVA2_Fixed32TransparentAlpha(void) {")
813 cpp_quote(" DXVA2_Fixed32 f32;")
814 cpp_quote(" f32.ll = 0;")
815 cpp_quote(" return f32;")
816 cpp_quote("}")
817 cpp_quote("")
818 cpp_quote("static inline float DXVA2FixedToFloat(DXVA2_Fixed32 f32) {")
819 cpp_quote(" return (float)f32.Value + (float)f32.Fraction / (1 << 16);")
820 cpp_quote("}")
821 cpp_quote("")
822 cpp_quote("static inline DXVA2_Fixed32 DXVA2FloatToFixed(float f) {")
823 cpp_quote(" DXVA2_Fixed32 f32;")
824 cpp_quote(" f32.Value = ((ULONG) (f * (1 << 16))) >> 16;")
825 cpp_quote(" f32.Fraction = ((ULONG) (f * (1 << 16))) & 0xFFFF;")
826 cpp_quote(" return f32;")
827 cpp_quote("}")