qt: add device preferences for mmdevice
[vlc.git] / contrib / src / d3d9 / dxva2api.patch
blob9654e1f8ae2f40b86342daefeb4dd94e9b027c3e
1 --- a/dxva2api/dxva2api.idl 2017-06-13 14:45:14.598269100 +0200
2 +++ b/dxva2api/dxva2api.idl 2017-06-26 10:08:58.732675300 +0200
3 @@ -6,6 +6,8 @@
5 import "unknwn.idl";
7 +cpp_quote("#include <winapifamily.h>")
9 /* Fake widl types */
10 cpp_quote("#if 0")
11 typedef DWORD IDirect3DDevice9;
12 @@ -14,12 +16,15 @@ typedef DWORD D3DFORMAT;
13 typedef DWORD D3DPOOL;
14 cpp_quote("#endif")
16 +cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)")
18 interface IDirectXVideoDecoderService;
19 +interface IDirectXVideoProcessorService;
21 -cpp_quote("#ifndef __REFERENCE_TIME_DEFINED")
22 -cpp_quote("#define __REFERENCE_TIME_DEFINED")
23 -cpp_quote("typedef LONGLONG REFERENCE_TIME;")
24 -cpp_quote("#endif /*__REFERENCE_TIME_DEFINED*/")
25 +#ifndef __REFERENCE_TIME_DEFINED
26 +#define __REFERENCE_TIME_DEFINED
27 +typedef LONGLONG REFERENCE_TIME;
28 +#endif /*__REFERENCE_TIME_DEFINED*/
30 cpp_quote("#define DXVA2_ProcAmp_None 0x0000")
31 cpp_quote("#define DXVA2_ProcAmp_Brightness 0x0001")
32 @@ -142,19 +147,19 @@ cpp_quote(" DXVA2_VideoTransferMatrix_B
33 cpp_quote(" DXVA2_VideoTransferMatrix_SMPTE240M = 3 ")
34 cpp_quote("} DXVA2_VideoTransferMatrix;")
35 cpp_quote("")
36 -cpp_quote("typedef struct _DXVA2_AYUVSample16 {")
37 -cpp_quote(" USHORT Cr;")
38 -cpp_quote(" USHORT Cb;")
39 -cpp_quote(" USHORT Y;")
40 -cpp_quote(" USHORT Alpha;")
41 -cpp_quote("} DXVA2_AYUVSample16;")
42 -cpp_quote("")
43 -cpp_quote("typedef struct _DXVA2_AYUVSample8 {")
44 -cpp_quote(" UCHAR Cr;")
45 -cpp_quote(" UCHAR Cb;")
46 -cpp_quote(" UCHAR Y;")
47 -cpp_quote(" UCHAR Alpha;")
48 -cpp_quote("} DXVA2_AYUVSample8;")
49 +typedef struct _DXVA2_AYUVSample16 {
50 + USHORT Cr;
51 + USHORT Cb;
52 + USHORT Y;
53 + USHORT Alpha;
54 +} DXVA2_AYUVSample16;
56 +typedef struct _DXVA2_AYUVSample8 {
57 + UCHAR Cr;
58 + UCHAR Cb;
59 + UCHAR Y;
60 + UCHAR Alpha;
61 +} DXVA2_AYUVSample8;
63 typedef struct _DXVA2_ConfigPictureDecode {
64 GUID guidConfigBitstreamEncryption;
65 @@ -219,40 +224,40 @@ typedef struct _DXVA2_ExtendedFormat {
67 } DXVA2_ExtendedFormat;
69 -cpp_quote("typedef struct _DXVA2_Fixed32 {")
70 -cpp_quote(" __C89_NAMELESS union {")
71 -cpp_quote(" __C89_NAMELESS struct {")
72 -cpp_quote(" USHORT Fraction;")
73 -cpp_quote(" SHORT Value;")
74 -cpp_quote(" } DUMMYSTRUCTNAME;")
75 -cpp_quote(" LONG ll;")
76 -cpp_quote(" } DUMMYUNIONNAME;")
77 -cpp_quote("} DXVA2_Fixed32;")
78 -cpp_quote("")
79 -cpp_quote("typedef struct _DXVA2_FilterValues {")
80 -cpp_quote(" DXVA2_Fixed32 Level;")
81 -cpp_quote(" DXVA2_Fixed32 Threshold;")
82 -cpp_quote(" DXVA2_Fixed32 Radius;")
83 -cpp_quote("} DXVA2_FilterValues;")
84 +typedef struct _DXVA2_Fixed32 {
85 + __C89_NAMELESS union {
86 + __C89_NAMELESS struct {
87 + USHORT Fraction;
88 + SHORT Value;
89 + } DUMMYSTRUCTNAME;
90 + LONG ll;
91 + } DUMMYUNIONNAME;
92 +} DXVA2_Fixed32;
94 +typedef struct _DXVA2_FilterValues {
95 + DXVA2_Fixed32 Level;
96 + DXVA2_Fixed32 Threshold;
97 + DXVA2_Fixed32 Radius;
98 +} DXVA2_FilterValues;
100 typedef struct _DXVA2_Frequency {
101 UINT Numerator;
102 UINT Denominator;
103 } DXVA2_Frequency;
105 -cpp_quote("typedef struct _DXVA2_ProcAmpValues {")
106 -cpp_quote(" DXVA2_Fixed32 Brightness;")
107 -cpp_quote(" DXVA2_Fixed32 Contrast;")
108 -cpp_quote(" DXVA2_Fixed32 Hue;")
109 -cpp_quote(" DXVA2_Fixed32 Saturation;")
110 -cpp_quote("} DXVA2_ProcAmpValues;")
111 -cpp_quote("")
112 -cpp_quote("typedef struct _DXVA2_ValueRange {")
113 -cpp_quote(" DXVA2_Fixed32 MinValue;")
114 -cpp_quote(" DXVA2_Fixed32 MaxValue;")
115 -cpp_quote(" DXVA2_Fixed32 DefaultValue;")
116 -cpp_quote(" DXVA2_Fixed32 StepSize;")
117 -cpp_quote("} DXVA2_ValueRange;")
118 +typedef struct _DXVA2_ProcAmpValues {
119 + DXVA2_Fixed32 Brightness;
120 + DXVA2_Fixed32 Contrast;
121 + DXVA2_Fixed32 Hue;
122 + DXVA2_Fixed32 Saturation;
123 +} DXVA2_ProcAmpValues;
125 +typedef struct _DXVA2_ValueRange {
126 + DXVA2_Fixed32 MinValue;
127 + DXVA2_Fixed32 MaxValue;
128 + DXVA2_Fixed32 DefaultValue;
129 + DXVA2_Fixed32 StepSize;
130 +} DXVA2_ValueRange;
132 typedef struct _DXVA2_VideoDesc {
133 UINT SampleWidth;
134 @@ -317,57 +322,93 @@ cpp_quote("DXVA2_DetailFilterTech_Unknow
135 cpp_quote("DXVA2_DetailFilterTech_Edge")
136 cpp_quote("DXVA2_DetailFilterTech_Sharpening")
137 cpp_quote("*/")
138 -cpp_quote("typedef struct _DXVA2_VideoProcessBltParams {")
139 -cpp_quote(" REFERENCE_TIME TargetFrame;")
140 -cpp_quote(" RECT TargetRect;")
141 -cpp_quote(" SIZE ConstrictionSize;")
142 -cpp_quote(" UINT StreamingFlags;")
143 -cpp_quote(" DXVA2_AYUVSample16 BackgroundColor;")
144 -cpp_quote(" DXVA2_ExtendedFormat DestFormat;")
145 -cpp_quote(" DXVA2_ProcAmpValues ProcAmpValues;")
146 -cpp_quote(" DXVA2_Fixed32 Alpha;")
147 -cpp_quote(" DXVA2_FilterValues NoiseFilterLuma;")
148 -cpp_quote(" DXVA2_FilterValues NoiseFilterChroma;")
149 -cpp_quote(" DXVA2_FilterValues DetailFilterLuma;")
150 -cpp_quote(" DXVA2_FilterValues DetailFilterChroma;")
151 -cpp_quote(" DWORD DestData;")
152 -cpp_quote("} DXVA2_VideoProcessBltParams;")
153 -cpp_quote("")
154 -cpp_quote("#ifdef _D3D9_H_")
155 -cpp_quote("typedef struct _DXVA2_VideoProcessorCaps {")
156 -cpp_quote(" UINT DeviceCaps;")
157 -cpp_quote(" D3DPOOL InputPool;")
158 -cpp_quote(" UINT NumForwardRefSamples;")
159 -cpp_quote(" UINT NumBackwardRefSamples;")
160 -cpp_quote(" UINT Reserved;")
161 -cpp_quote(" UINT DeinterlaceTechnology;")
162 -cpp_quote(" UINT ProcAmpControlCaps;")
163 -cpp_quote(" UINT VideoProcessorOperations;")
164 -cpp_quote(" UINT NoiseFilterTechnology;")
165 -cpp_quote(" UINT DetailFilterTechnology;")
166 -cpp_quote("} DXVA2_VideoProcessorCaps;")
167 -cpp_quote("#endif")
168 -cpp_quote("")
169 -cpp_quote("/* SampleData")
170 -cpp_quote("DXVA2_SampleData_RFF")
171 -cpp_quote("DXVA2_SampleData_TFF")
172 -cpp_quote("DXVA2_SampleData_RFF_TFF_Present")
173 -cpp_quote("*/")
174 -cpp_quote("")
175 -cpp_quote("#ifdef _D3D9_H_")
176 -cpp_quote("typedef struct _DXVA2_VideoSample {")
177 -cpp_quote(" REFERENCE_TIME Start;")
178 -cpp_quote(" REFERENCE_TIME End;")
179 -cpp_quote(" DXVA2_ExtendedFormat SampleFormat;")
180 -cpp_quote(" IDirect3DSurface9* SrcSurface;")
181 -cpp_quote(" RECT SrcRect;")
182 -cpp_quote(" RECT DstRect;")
183 -cpp_quote(" DXVA2_AYUVSample8 Pal[16];")
184 -cpp_quote(" DXVA2_Fixed32 PlanarAlpha;")
185 -cpp_quote(" DWORD SampleData;")
186 -cpp_quote("} DXVA2_VideoSample;")
187 -cpp_quote("#endif")
188 -cpp_quote("")
189 +typedef struct _DXVA2_VideoProcessBltParams {
190 + REFERENCE_TIME TargetFrame;
191 + RECT TargetRect;
192 + SIZE ConstrictionSize;
193 + UINT StreamingFlags;
194 + DXVA2_AYUVSample16 BackgroundColor;
195 + DXVA2_ExtendedFormat DestFormat;
196 + DXVA2_ProcAmpValues ProcAmpValues;
197 + DXVA2_Fixed32 Alpha;
198 + DXVA2_FilterValues NoiseFilterLuma;
199 + DXVA2_FilterValues NoiseFilterChroma;
200 + DXVA2_FilterValues DetailFilterLuma;
201 + DXVA2_FilterValues DetailFilterChroma;
202 + DWORD DestData;
203 +} DXVA2_VideoProcessBltParams;
205 +#ifdef _D3D9_H_
206 +typedef struct _DXVA2_VideoProcessorCaps {
207 + UINT DeviceCaps;
208 + D3DPOOL InputPool;
209 + UINT NumForwardRefSamples;
210 + UINT NumBackwardRefSamples;
211 + UINT Reserved;
212 + UINT DeinterlaceTechnology;
213 + UINT ProcAmpControlCaps;
214 + UINT VideoProcessorOperations;
215 + UINT NoiseFilterTechnology;
216 + UINT DetailFilterTechnology;
217 +} DXVA2_VideoProcessorCaps;
218 +#endif
220 +cpp_quote("/* deinterlacing capabilities */")
221 +cpp_quote("#define DXVA2_DeinterlaceTech_Unknown 0x0")
222 +cpp_quote("#define DXVA2_DeinterlaceTech_BOBLineReplicate 0x1")
223 +cpp_quote("#define DXVA2_DeinterlaceTech_BOBVerticalStretch 0x2")
224 +cpp_quote("#define DXVA2_DeinterlaceTech_BOBVerticalStretch4Tap 0x4")
225 +cpp_quote("#define DXVA2_DeinterlaceTech_MedianFiltering 0x8")
226 +cpp_quote("#define DXVA2_DeinterlaceTech_EdgeFiltering 0x10")
227 +cpp_quote("#define DXVA2_DeinterlaceTech_FieldAdaptive 0x20")
228 +cpp_quote("#define DXVA2_DeinterlaceTech_PixelAdaptive 0x40")
229 +cpp_quote("#define DXVA2_DeinterlaceTech_MotionVectorSteered 0x80")
230 +cpp_quote("#define DXVA2_DeinterlaceTech_InverseTelecine 0x100")
231 +cpp_quote("#define DXVA2_DeinterlaceTech_Mask 0x1FF")
233 +cpp_quote("/* VideoProcessor capabilities */")
234 +cpp_quote("#define DXVA2_VideoProcess_None 0x0")
235 +cpp_quote("#define DXVA2_VideoProcess_YUV2RGB 0x1")
236 +cpp_quote("#define DXVA2_VideoProcess_StretchX 0x2")
237 +cpp_quote("#define DXVA2_VideoProcess_StretchY 0x4")
238 +cpp_quote("#define DXVA2_VideoProcess_AlphaBlend 0x8")
239 +cpp_quote("#define DXVA2_VideoProcess_SubRects 0x10")
240 +cpp_quote("#define DXVA2_VideoProcess_SubStreams 0x20")
241 +cpp_quote("#define DXVA2_VideoProcess_SubStreamsExtended 0x40")
242 +cpp_quote("#define DXVA2_VideoProcess_YUV2RGBExtended 0x80")
243 +cpp_quote("#define DXVA2_VideoProcess_AlphaBlendExtended 0x100")
244 +cpp_quote("#define DXVA2_VideoProcess_Constriction 0x200")
245 +cpp_quote("#define DXVA2_VideoProcess_NoiseFilter 0x400")
246 +cpp_quote("#define DXVA2_VideoProcess_DetailFilter 0x800")
247 +cpp_quote("#define DXVA2_VideoProcess_PlanarAlpha 0x1000")
248 +cpp_quote("#define DXVA2_VideoProcess_LinearScaling 0x2000")
249 +cpp_quote("#define DXVA2_VideoProcess_GammaCompensated 0x4000")
250 +cpp_quote("#define DXVA2_VideoProcess_MaintainsOriginalFieldData 0x8000")
251 +cpp_quote("#define DXVA2_VideoProcess_Mask 0xFFFF")
253 +cpp_quote("/* SampleData */")
254 +enum
256 + DXVA2_SampleData_RFF = 1,
257 + DXVA2_SampleData_TFF = 2,
258 + DXVA2_SampleData_RFF_TFF_Present = 4,
259 + DXVA2_SampleData_Mask = 0xFFFF
262 +#ifdef _D3D9_H_
263 +typedef struct _DXVA2_VideoSample {
264 + REFERENCE_TIME Start;
265 + REFERENCE_TIME End;
266 + DXVA2_ExtendedFormat SampleFormat;
267 + IDirect3DSurface9* SrcSurface;
268 + RECT SrcRect;
269 + RECT DstRect;
270 + DXVA2_AYUVSample8 Pal[16];
271 + DXVA2_Fixed32 PlanarAlpha;
272 + DWORD SampleData;
273 +} DXVA2_VideoSample;
274 +#endif
276 cpp_quote("/* Constants */")
277 cpp_quote("")
278 cpp_quote("#define DXVA2_VideoDecoderRenderTarget 0")
279 @@ -385,13 +426,13 @@ cpp_quote("#define DXVA2_BitStreamDateBu
280 cpp_quote("#define DXVA2_MotionVectorBuffer 7")
281 cpp_quote("#define DXVA2_FilmGrainBuffer 8")
282 cpp_quote("")
283 -cpp_quote("__forceinline const DXVA2_Fixed32 DXVA2_Fixed32OpaqueAlpha (void) {")
284 +cpp_quote("__forceinline DXVA2_Fixed32 DXVA2_Fixed32OpaqueAlpha (void) {")
285 cpp_quote(" DXVA2_Fixed32 f32;")
286 cpp_quote(" f32.ll = 0 + (1 << 16);")
287 cpp_quote(" return f32;")
288 cpp_quote("}")
289 cpp_quote("")
290 -cpp_quote("__forceinline const DXVA2_Fixed32 DXVA2_Fixed32TransparentAlpha (void) {")
291 +cpp_quote("__forceinline DXVA2_Fixed32 DXVA2_Fixed32TransparentAlpha (void) {")
292 cpp_quote(" DXVA2_Fixed32 f32;")
293 cpp_quote(" f32.ll = 0;")
294 cpp_quote(" return f32;")
295 @@ -481,4 +522,84 @@ interface IDirectXVideoDecoderService :
296 [in] UINT NumRenderTargets, [out] IDirectXVideoDecoder **ppDecode);
300 + object,
301 + uuid(8c3a39f0-916e-4690-804f-4c8001355d25),
302 + local
304 +interface IDirectXVideoProcessor : IUnknown
306 + HRESULT GetVideoProcessorService([out] IDirectXVideoProcessorService** ppService);
308 + HRESULT GetCreationParameters(
309 + [out] GUID* pDeviceGuid,
310 + [out] DXVA2_VideoDesc* pVideoDesc,
311 + [out] D3DFORMAT* pRenderTargetFormat,
312 + [out] UINT* pMaxNumSubStreams);
313 + HRESULT GetVideoProcessorCaps([out] DXVA2_VideoProcessorCaps* pCaps);
314 + HRESULT GetProcAmpRange(
315 + [in] UINT ProcAmpCap,
316 + [out] DXVA2_ValueRange* pRange);
317 + HRESULT GetFilterPropertyRange(
318 + [in] UINT FilterSetting,
319 + [out] DXVA2_ValueRange* pRange);
320 + HRESULT VideoProcessBlt(
321 + [in] IDirect3DSurface9* pRenderTarget,
322 + [in] const DXVA2_VideoProcessBltParams* pBltParams,
323 + [in] const DXVA2_VideoSample* pSamples,
324 + [in] UINT NumSamples,
325 + [out] HANDLE* pHandleComplete);
329 + object,
330 + uuid(fc51a552-d5e7-11d9-af55-00054e43ff02),
331 + local
333 +interface IDirectXVideoProcessorService : IDirectXVideoAccelerationService
335 + HRESULT RegisterVideoProcessorSoftwareDevice([in] void* pCallbacks);
337 + HRESULT GetVideoProcessorDeviceGuids(
338 + [in] const DXVA2_VideoDesc* pVideoDesc,
339 + [out] UINT* pCount,
340 + [out] GUID** pGuids);
341 + HRESULT GetVideoProcessorRenderTargets(
342 + [in] REFGUID VideoProcDeviceGuid,
343 + [in] const DXVA2_VideoDesc* pVideoDesc,
344 + [out] UINT* pCount,
345 + [out] D3DFORMAT** pFormats);
346 + HRESULT GetVideoProcessorSubStreamFormats(
347 + [in] REFGUID VideoProcDeviceGuid,
348 + [in] const DXVA2_VideoDesc* pVideoDesc,
349 + [in] D3DFORMAT RenderTargetFormat,
350 + [out] UINT* pCount,
351 + [out] D3DFORMAT** pFormats);
352 + HRESULT GetVideoProcessorCaps(
353 + [in] REFGUID VideoProcDeviceGuid,
354 + [in] const DXVA2_VideoDesc* pVideoDesc,
355 + [in] D3DFORMAT RenderTargetFormat,
356 + [out] DXVA2_VideoProcessorCaps* pCaps);
357 + HRESULT GetProcAmpRange(
358 + [in] REFGUID VideoProcDeviceGuid,
359 + [in] const DXVA2_VideoDesc* pVideoDesc,
360 + [in] D3DFORMAT RenderTargetFormat,
361 + [in] UINT ProcAmpCap,
362 + [out] DXVA2_ValueRange* pRange);
363 + HRESULT GetFilterPropertyRange(
364 + [in] REFGUID VideoProcDeviceGuid,
365 + [in] const DXVA2_VideoDesc* pVideoDesc,
366 + [in] D3DFORMAT RenderTargetFormat,
367 + [in] UINT FilterSetting,
368 + [out] DXVA2_ValueRange* pRange);
369 + HRESULT CreateVideoProcessor(
370 + [in] REFGUID VideoProcDeviceGuid,
371 + [in] const DXVA2_VideoDesc* pVideoDesc,
372 + [in] D3DFORMAT RenderTargetFormat,
373 + [in] UINT MaxNumSubStreams,
374 + [out] IDirectXVideoProcessor** ppVidProcess);
377 cpp_quote("#endif /* _D3D9_H_ */")
379 +cpp_quote("#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) */")