dinput: Avoid deadlock when CS are acquired in different order.
[wine.git] / include / dxva2api.idl
blob88c586fa0889062b31bb850e8718f5f7f05eeeeb
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 /* H264 */
38 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_A, 0x1b81be64, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
39 cpp_quote("#define DXVA2_ModeH264_MoComp_NoFGT DXVA2_ModeH264_A")
41 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_B, 0x1b81be65, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
42 cpp_quote("#define DXVA2_ModeH264_MoComp_FGT DXVA2_ModeH264_B")
44 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_C, 0x1b81be66, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
45 cpp_quote("#define DXVA2_ModeH264_IDCT_NoFGT DXVA2_ModeH264_C")
47 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_D, 0x1b81be67, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
48 cpp_quote("#define DXVA2_ModeH264_IDCT_FGT DXVA2_ModeH264_D")
50 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_E, 0x1b81be68, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
51 cpp_quote("#define DXVA2_ModeH264_VLD_NoFGT DXVA2_ModeH264_E")
53 cpp_quote("DEFINE_GUID(DXVA2_ModeH264_F, 0x1b81be69, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
54 cpp_quote("#define DXVA2_ModeH264_VLD_FGT DXVA2_ModeH264_F")
56 /* WMV8 */
57 cpp_quote("DEFINE_GUID(DXVA2_ModeWMV8_A, 0x1b81be80, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
58 cpp_quote("#define DXVA2_ModeWMV8_PostProc DXVA2_ModeWMV8_A")
60 cpp_quote("DEFINE_GUID(DXVA2_ModeWMV8_B, 0x1b81be81, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
61 cpp_quote("#define DXVA2_ModeWMV8_MoComp DXVA2_ModeWMV8_B")
63 /* WMV9 */
64 cpp_quote("DEFINE_GUID(DXVA2_ModeWMV9_A, 0x1b81be90, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
65 cpp_quote("#define DXVA2_ModeWMV9_PostProc DXVA2_ModeWMV9_A")
67 cpp_quote("DEFINE_GUID(DXVA2_ModeWMV9_B, 0x1b81be91, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
68 cpp_quote("#define DXVA2_ModeWMV9_MoComp DXVA2_ModeWMV9_B")
70 cpp_quote("DEFINE_GUID(DXVA2_ModeWMV9_C, 0x1b81be94, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
71 cpp_quote("#define DXVA2_ModeWMV9_IDCT DXVA2_ModeWMV9_C")
73 /* VC1 */
74 cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_A, 0x1b81beA0, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
75 cpp_quote("#define DXVA2_ModeVC1_PostProc DXVA2_ModeVC1_A")
77 cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_B, 0x1b81beA1, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
78 cpp_quote("#define DXVA2_ModeVC1_MoComp DXVA2_ModeVC1_B")
80 cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_C, 0x1b81beA2, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
81 cpp_quote("#define DXVA2_ModeVC1_IDCT DXVA2_ModeVC1_C")
83 cpp_quote("DEFINE_GUID(DXVA2_ModeVC1_D, 0x1b81beA3, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
84 cpp_quote("#define DXVA2_ModeVC1_VLD DXVA2_ModeVC1_D")
86 /* Encryption */
87 cpp_quote("DEFINE_GUID(DXVA_NoEncrypt, 0x1b81bed0, 0xa0c7,0x11d3, 0xb9,0x84,0x00,0xc0,0x4f,0x2e,0x73,0xc5);")
89 cpp_quote("#ifndef REFERENCE_TIME_DEFINED")
90 cpp_quote("#define REFERENCE_TIME_DEFINED")
91 typedef LONGLONG REFERENCE_TIME;
92 cpp_quote("#endif")
94 enum
96 DXVA2_PictureParametersBufferType,
97 DXVA2_MacroBlockControlBufferType,
98 DXVA2_ResidualDifferenceBufferType,
99 DXVA2_DeblockingControlBufferType,
100 DXVA2_InverseQuantizationMatrixBufferType,
101 DXVA2_SliceControlBufferType,
102 DXVA2_BitStreamDateBufferType,
103 DXVA2_MotionVectorBuffer,
104 DXVA2_FilmGrainBuffer
107 enum
109 DXVA2_VideoDecoderRenderTarget,
110 DXVA2_VideoProcessorRenderTarget,
111 DXVA2_VideoSoftwareRenderTarget
114 typedef struct _DXVA2_ExtendedFormat
116 union
118 struct
120 UINT SampleFormat :8;
121 UINT VideoChromaSubsampling :4;
122 UINT NominalRange :3;
123 UINT VideoTransferMatrix :3;
124 UINT VideoLighting :4;
125 UINT VideoPrimaries :5;
126 UINT VideoTransferFunction :5;
128 UINT value;
130 } DXVA2_ExtendedFormat;
132 typedef struct _DXVA2_Frequency
134 UINT Numerator;
135 UINT Denominator;
136 } DXVA2_Frequency;
138 typedef struct _DXVA2_ConfigPictureDecode
140 GUID guidConfigBitstreamEncryption;
141 GUID guidConfigMBcontrolEncryption;
142 GUID guidConfigResidDiffEncryption;
143 UINT ConfigBitstreamRaw;
144 UINT ConfigMBcontrolRasterOrder;
145 UINT ConfigResidDiffHost;
146 UINT ConfigSpatialResid8;
147 UINT ConfigResid8Subtraction;
148 UINT ConfigSpatialHost8or9Clipping;
149 UINT ConfigSpatialResidInterleaved;
150 UINT ConfigIntraResidUnsigned;
151 UINT ConfigResidDiffAccelerator;
152 UINT ConfigHostInverseScan;
153 UINT ConfigSpecificIDCT;
154 UINT Config4GroupedCoefs;
155 UINT ConfigMinRenderTargetBuffCount;
156 USHORT ConfigDecoderSpecific;
157 } DXVA2_ConfigPictureDecode;
159 typedef struct _DXVA2_VideoDesc
161 UINT SampleWidth;
162 UINT SampleHeight;
163 DXVA2_ExtendedFormat SampleFormat;
164 D3DFORMAT Format;
165 DXVA2_Frequency InputSampleFreq;
166 DXVA2_Frequency OutputFrameFreq;
167 UINT UABProtectionLevel;
168 UINT Reserved;
169 } DXVA2_VideoDesc;
171 typedef struct _DXVA2_DecodeBufferDesc
173 DWORD CompressedBufferType;
174 UINT BufferIndex;
175 UINT DataOffset;
176 UINT DataSize;
177 UINT FirstMBaddress;
178 UINT NumMBsInBuffer;
179 UINT Width;
180 UINT Height;
181 UINT Stride;
182 UINT ReservedBits;
183 PVOID pvPVPState;
184 } DXVA2_DecodeBufferDesc;
186 typedef struct _DXVA2_DecodeExtensionData
188 UINT Function;
189 PVOID pPrivateInputData;
190 UINT PrivateInputDataSize;
191 PVOID pPrivateOutputData;
192 UINT PrivateOutputDataSize;
193 } DXVA2_DecodeExtensionData;
195 typedef struct _DXVA2_DecodeExecuteParams
197 UINT NumCompBuffers;
198 DXVA2_DecodeBufferDesc* pCompressedBuffers;
199 DXVA2_DecodeExtensionData* pExtensionData;
200 } DXVA2_DecodeExecuteParams;
202 typedef struct _DXVA2_VideoProcessorCaps
204 UINT DeviceCaps;
205 D3DPOOL InputPool;
206 UINT NumForwardRefSamples;
207 UINT NumBackwardRefSamples;
208 UINT Reserved;
209 UINT DeinterlaceTechnology;
210 UINT ProcAmpControlCaps;
211 UINT VideoProcessorOperations;
212 UINT NoiseFilterTechnology;
213 UINT DetailFilterTechnology;
214 } DXVA2_VideoProcessorCaps;
216 typedef struct _DXVA2_Fixed32
218 union
220 struct
222 USHORT Fraction;
223 SHORT Value;
225 LONG ll;
227 } DXVA2_Fixed32;
229 typedef struct _DXVA2_ValueRange
231 DXVA2_Fixed32 MinValue;
232 DXVA2_Fixed32 MaxValue;
233 DXVA2_Fixed32 DefaultValue;
234 DXVA2_Fixed32 StepSize;
235 } DXVA2_ValueRange;
237 typedef struct _DXVA2_AYUVSample8
239 UCHAR Cr;
240 UCHAR Cb;
241 UCHAR Y;
242 UCHAR Alpha;
243 } DXVA2_AYUVSample8;
245 typedef struct _DXVA2_AYUVSample16
247 USHORT Cr;
248 USHORT Cb;
249 USHORT Y;
250 USHORT Alpha;
251 } DXVA2_AYUVSample16;
253 typedef struct _DXVA2_ProcAmpValues
255 DXVA2_Fixed32 Brightness;
256 DXVA2_Fixed32 Contrast;
257 DXVA2_Fixed32 Hue;
258 DXVA2_Fixed32 Saturation;
259 } DXVA2_ProcAmpValues;
261 typedef struct _DXVA2_FilterValues
263 DXVA2_Fixed32 Level;
264 DXVA2_Fixed32 Threshold;
265 DXVA2_Fixed32 Radius;
266 } DXVA2_FilterValues;
268 typedef struct _DXVA2_VideoProcessBltParams
270 REFERENCE_TIME TargetFrame;
271 RECT TargetRect;
272 SIZE ConstrictionSize;
273 UINT StreamingFlags;
274 DXVA2_AYUVSample16 BackgroundColor;
275 DXVA2_ExtendedFormat DestFormat;
276 DXVA2_ProcAmpValues ProcAmpValues;
277 DXVA2_Fixed32 Alpha;
278 DXVA2_FilterValues NoiseFilterLuma;
279 DXVA2_FilterValues NoiseFilterChroma;
280 DXVA2_FilterValues DetailFilterLuma;
281 DXVA2_FilterValues DetailFilterChroma;
282 DWORD DestData;
283 } DXVA2_VideoProcessBltParams;
285 typedef struct _DXVA2_VideoSample
287 REFERENCE_TIME Start;
288 REFERENCE_TIME End;
289 DXVA2_ExtendedFormat SampleFormat;
290 IDirect3DSurface9* SrcSurface;
291 RECT SrcRect;
292 RECT DstRect;
293 DXVA2_AYUVSample8 Pal[16];
294 DXVA2_Fixed32 PlanarAlpha;
295 DWORD SampleData;
296 } DXVA2_VideoSample;
298 typedef enum
300 DXVA2_SurfaceType_DecoderRenderTarget,
301 DXVA2_SurfaceType_ProcessorRenderTarget,
302 DXVA2_SurfaceType_D3DRenderTargetTexture,
303 } DXVA2_SurfaceType;
305 interface IDirectXVideoDecoder;
306 interface IDirectXVideoProcessor;
308 /*****************************************************************************
309 * IDirect3DDeviceManager9 interface
312 object,
313 uuid(a0cade0f-06d5-4cf4-a1c7-f3cdd725aa75),
314 local
316 interface IDirect3DDeviceManager9 : IUnknown
318 HRESULT ResetDevice(
319 [in] IDirect3DDevice9* pDevice,
320 [in] UINT resetToken);
322 HRESULT OpenDeviceHandle(
323 [out] HANDLE* phDevice);
325 HRESULT CloseDeviceHandle(
326 [in] HANDLE hDevice);
328 HRESULT TestDevice(
329 [in] HANDLE hDevice);
331 HRESULT LockDevice(
332 [in] HANDLE hDevice,
333 [out] IDirect3DDevice9** ppDevice,
334 [in] BOOL fBlock);
336 HRESULT UnlockDevice(
337 [in] HANDLE hDevice,
338 [in] BOOL fSaveState);
340 HRESULT GetVideoService(
341 [in] HANDLE hDevice,
342 [in] REFIID riid,
343 [out] void** ppService);
346 /*****************************************************************************
347 * IDirectXVideoAccelerationService interface
350 object,
351 uuid(fc51a550-d5e7-11d9-af55-00054e43ff02),
352 local
354 interface IDirectXVideoAccelerationService : IUnknown
356 HRESULT CreateSurface(
357 [in] UINT width,
358 [in] UINT height,
359 [in] UINT backBuffers,
360 [in] D3DFORMAT format,
361 [in] D3DPOOL pool,
362 [in] DWORD usage,
363 [in] DWORD dxvaType,
364 [out] IDirect3DSurface9 **ppSurface,
365 [in, out] HANDLE *pSharedHandle);
368 /*****************************************************************************
369 * IDirectXVideoDecoderService interface
372 object,
373 uuid(fc51a551-d5e7-11d9-af55-00054e43ff02),
374 local
376 interface IDirectXVideoDecoderService : IDirectXVideoAccelerationService
378 HRESULT GetDecoderDeviceGuids(
379 [out] UINT *count,
380 [out] GUID **pGuids);
382 HRESULT GetDecoderRenderTargets(
383 [in] REFGUID guid,
384 [out] UINT *pCount,
385 [out] D3DFORMAT **pFormats);
387 HRESULT GetDecoderConfigurations(
388 [in] REFGUID guid,
389 [in] const DXVA2_VideoDesc *pVideoDesc,
390 [in] IUnknown *pReserved,
391 [out] UINT *pCount,
392 [out] DXVA2_ConfigPictureDecode **ppConfigs);
394 HRESULT CreateVideoDecoder(
395 [in] REFGUID guid,
396 [in] const DXVA2_VideoDesc *pVideoDesc,
397 [in] DXVA2_ConfigPictureDecode *pConfig,
398 [in] IDirect3DSurface9 **ppDecoderRenderTargets,
399 [in] UINT NumSurfaces,
400 [out] IDirectXVideoDecoder **ppDecode);
403 /*****************************************************************************
404 * IDirectXVideoDecoder interface
407 object,
408 uuid(f2b0810a-fd00-43c9-918c-df94e2d8ef7d),
409 local
411 interface IDirectXVideoDecoder : IUnknown
413 HRESULT GetVideoDecoderService(
414 [out] IDirectXVideoDecoderService** ppService);
416 HRESULT GetCreationParameters(
417 [out] GUID* pDeviceGuid,
418 [out] DXVA2_VideoDesc* pVideoDesc,
419 [out] DXVA2_ConfigPictureDecode* pConfig,
420 [out] IDirect3DSurface9*** pDecoderRenderTargets,
421 [out] UINT* pNumSurfaces);
423 HRESULT GetBuffer(
424 [in] UINT BufferType,
425 [out] void** ppBuffer,
426 [out] UINT* pBufferSize);
428 HRESULT ReleaseBuffer(
429 [in] UINT BufferType);
431 HRESULT BeginFrame(
432 [in] IDirect3DSurface9* pRenderTarget,
433 [in] void* pvPVPData);
435 HRESULT EndFrame(
436 [out] HANDLE* pHandleComplete);
438 HRESULT Execute(
439 [in] const DXVA2_DecodeExecuteParams* pExecuteParams);
442 /*****************************************************************************
443 * IDirectXVideoProcessorService interface
446 object,
447 uuid(fc51a552-d5e7-11d9-af55-00054e43ff02),
448 local
450 interface IDirectXVideoProcessorService : IDirectXVideoAccelerationService
452 HRESULT RegisterVideoProcessorSoftwareDevice(
453 [in] void* pCallbacks);
455 HRESULT GetVideoProcessorDeviceGuids(
456 [in] const DXVA2_VideoDesc* pVideoDesc,
457 [out] UINT* pCount,
458 [out] GUID** pGuids);
460 HRESULT GetVideoProcessorRenderTargets(
461 [in] REFGUID VideoProcDeviceGuid,
462 [in] const DXVA2_VideoDesc* pVideoDesc,
463 [out] UINT* pCount,
464 [out] D3DFORMAT** pFormats);
466 HRESULT GetVideoProcessorSubStreamFormats(
467 [in] REFGUID VideoProcDeviceGuid,
468 [in] const DXVA2_VideoDesc* pVideoDesc,
469 [in] D3DFORMAT RenderTargetFormat,
470 [out] UINT* pCount,
471 [out] D3DFORMAT** pFormats);
473 HRESULT GetVideoProcessorCaps(
474 [in] REFGUID VideoProcDeviceGuid,
475 [in] const DXVA2_VideoDesc* pVideoDesc,
476 [in] D3DFORMAT RenderTargetFormat,
477 [out] DXVA2_VideoProcessorCaps* pCaps);
479 HRESULT GetProcAmpRange(
480 [in] REFGUID VideoProcDeviceGuid,
481 [in] const DXVA2_VideoDesc* pVideoDesc,
482 [in] D3DFORMAT RenderTargetFormat,
483 [in] UINT ProcAmpCap,
484 [out] DXVA2_ValueRange* pRange);
486 HRESULT GetFilterPropertyRange(
487 [in] REFGUID VideoProcDeviceGuid,
488 [in] const DXVA2_VideoDesc* pVideoDesc,
489 [in] D3DFORMAT renderTargetFormat,
490 [in] UINT FilterSetting,
491 [out] DXVA2_ValueRange* pRange);
493 HRESULT CreateVideoProcessor(
494 [in] REFGUID VideoProcDeviceGuid,
495 [in] const DXVA2_VideoDesc* pVideoDesc,
496 [in] D3DFORMAT RenderTargetFormat,
497 [in] UINT MaxNumSubStreams,
498 [out] IDirectXVideoProcessor** ppVidProcess);
501 /*****************************************************************************
502 * IDirectXVideoProcessor interface
505 object,
506 uuid(8c3a39f0-916e-4690-804f-4c8001355d25),
507 local
509 interface IDirectXVideoProcessor : IUnknown
511 HRESULT GetVideoProcessorService(
512 [out] IDirectXVideoProcessorService** ppService);
514 HRESULT GetCreationParameters(
515 [out] GUID* pDeviceGuid,
516 [out] DXVA2_VideoDesc* pVideoDesc,
517 [out] D3DFORMAT* pRenderTargetFormat,
518 [out] UINT* pMaxNumSubStreams);
520 HRESULT GetVideoProcessorCaps(
521 [out] DXVA2_VideoProcessorCaps* pCaps);
523 HRESULT GetProcAmpRange(
524 [in] UINT ProcAmpCap,
525 [out] DXVA2_ValueRange* pRange);
527 HRESULT GetFilterPropertyRange(
528 [in] UINT FilterSetting,
529 [out] DXVA2_ValueRange* pRange);
531 HRESULT VideoProcessBlt(
532 [in] IDirect3DSurface9* pRenderTarget,
533 [in] const DXVA2_VideoProcessBltParams* pBltParams,
534 [in] const DXVA2_VideoSample* pSamples,
535 [in] UINT NumSamples,
536 [out] HANDLE* pHandleCompleteIDirect3DDeviceManager9);
539 /*****************************************************************************
540 * IDirectXVideoMemoryConfiguration interface
543 object,
544 uuid(b7f916dd-db3b-49c1-84d7-e45ef99ec726),
545 local
547 interface IDirectXVideoMemoryConfiguration : IUnknown
549 HRESULT GetAvailableSurfaceTypeByIndex(
550 [in] DWORD wTypeIndex,
551 [out] DXVA2_SurfaceType *pdwType);
553 HRESULT SetSurfaceType(
554 [in] DXVA2_SurfaceType dwType);