124fc3b9125e792ce8d719f9d071d67860629e8c
[reactos.git] / reactos / include / dxsdk / vmrender.idl
1
2 cpp_quote("#if 0")
3
4 import "unknwn.idl";
5 typedef int DWORD;
6 typedef int REFERENCE_TIME;
7 typedef int HMONITOR;
8 typedef int AM_MEDIA_TYPE;
9
10 typedef DWORD* LPDIRECTDRAW7;
11 typedef DWORD* LPDIRECTDRAWSURFACE7;
12 typedef DWORD* LPDDPIXELFORMAT;
13 typedef DWORD* LPBITMAPINFOHEADER;
14 typedef struct {DWORD dw1; DWORD dw2;} DDCOLORKEY;
15 typedef DDCOLORKEY* LPDDCOLORKEY;
16 cpp_quote ("#endif")
17
18 cpp_quote("#include <ddraw.h>")
19
20 cpp_quote("#define VMRBITMAP_DISABLE 0x00000001")
21 cpp_quote("#define VMRBITMAP_HDC 0x00000002")
22 cpp_quote("#define VMRBITMAP_ENTIREDDS 0x00000004")
23 cpp_quote("#define VMRBITMAP_SRCCOLORKEY 0x00000008")
24 cpp_quote("#define VMRBITMAP_SRCRECT 0x00000010")
25
26 interface IVMRSurface;
27 interface IVMRSurfaceAllocator;
28 interface IVMRSurfaceAllocatorNotify;
29 interface IVMRImagePresenter;
30 interface IVMRImagePresenterConfig;
31 interface IVMRWindowlessControl;
32 interface IVMRMixerControl;
33 interface IVMRMixerBitmap;
34 interface IVMRFilterConfig;
35 interface IVMRAspectRatioControl;
36 interface IVMRDeinterlaceControl;
37 interface IVMRMonitorConfig;
38 interface IVMRImageCompositor;
39 interface IVMRVideoStreamControl;
40
41 #define VMRDEVICENAMELEN 32
42 #define VMRDEVICEDESCRIPTIONLEN 256
43
44 typedef enum
45 {
46 VMRSample_SyncPoint = 0x00000001,
47 VMRSample_Preroll = 0x00000002,
48 VMRSample_Discontinuity = 0x00000004,
49 VMRSample_TimeValid = 0x00000008,
50 VMRSample_SrcDstRectsValid= 0x00000010
51 } VMRPresentationFlags;
52
53 typedef enum
54 {
55 AMAP_PIXELFORMAT_VALID = 0x01,
56 AMAP_3D_TARGET = 0x02,
57 AMAP_ALLOW_SYSMEM = 0x04,
58 AMAP_FORCE_SYSMEM = 0x08,
59 AMAP_DIRECTED_FLIP = 0x10,
60 AMAP_DXVA_TARGET = 0x20
61 } VMRSurfaceAllocationFlags;
62
63 typedef enum
64 {
65 VMR_ARMODE_NONE,
66 VMR_ARMODE_LETTER_BOX
67 } VMR_ASPECT_RATIO_MODE;
68
69
70 typedef enum
71 {
72 MixerPref_NoDecimation = 0x00000001,
73 MixerPref_DecimateOutput = 0x00000002,
74 MixerPref_ARAdjustXorY = 0x00000004,
75 MixerPref_DecimationReserved = 0x00000008,
76 MixerPref_DecimateMask = 0x0000000F,
77 MixerPref_BiLinearFiltering = 0x00000010,
78 MixerPref_PointFiltering = 0x00000020,
79 MixerPref_FilteringMask = 0x000000F0,
80 MixerPref_RenderTargetRGB = 0x00000100,
81 MixerPref_RenderTargetYUV = 0x00001000,
82 MixerPref_RenderTargetYUV420 = 0x00000200,
83 MixerPref_RenderTargetYUV422 = 0x00000400,
84 MixerPref_RenderTargetYUV444 = 0x00000800,
85 MixerPref_RenderTargetReserved = 0x0000E000,
86 MixerPref_RenderTargetMask = 0x0000FF00,
87 MixerPref_DynamicSwitchToBOB = 0x00010000,
88 MixerPref_DynamicDecimateBy2 = 0x00020000,
89 MixerPref_DynamicReserved = 0x000C0000,
90 MixerPref_DynamicMask = 0x000F0000
91 } VMRMixerPrefs;
92
93 typedef enum
94 {
95 RenderPrefs_RestrictToInitialMonitor = 0x00000000,
96 RenderPrefs_ForceOffscreen = 0x00000001,
97 RenderPrefs_ForceOverlays = 0x00000002,
98 RenderPrefs_AllowOverlays = 0x00000000,
99 RenderPrefs_AllowOffscreen = 0x00000000,
100 RenderPrefs_DoNotRenderColorKeyAndBorder = 0x00000008,
101 RenderPrefs_Reserved = 0x00000010,
102 RenderPrefs_PreferAGPMemWhenMixing = 0x00000020,
103
104 RenderPrefs_Mask = 0x0000003f,
105 } VMRRenderPrefs;
106
107 typedef enum
108 {
109 VMRMode_Windowed = 0x00000001,
110 VMRMode_Windowless = 0x00000002,
111 VMRMode_Renderless = 0x00000004,
112 VMRMode_Mask = 0x00000007,
113 } VMRMode;
114
115 enum
116 {
117 MAX_NUMBER_OF_STREAMS = 16
118 };
119
120 typedef enum
121 {
122 DeinterlacePref_NextBest = 0x01,
123 DeinterlacePref_BOB = 0x02,
124 DeinterlacePref_Weave = 0x04,
125 DeinterlacePref_Mask = 0x07
126 } VMRDeinterlacePrefs;
127
128 typedef enum
129 {
130 DeinterlaceTech_Unknown = 0x0000,
131 DeinterlaceTech_BOBLineReplicate = 0x0001,
132 DeinterlaceTech_BOBVerticalStretch = 0x0002,
133 DeinterlaceTech_MedianFiltering = 0x0004,
134 DeinterlaceTech_EdgeFiltering = 0x0010,
135 DeinterlaceTech_FieldAdaptive = 0x0020,
136 DeinterlaceTech_PixelAdaptive = 0x0040,
137 DeinterlaceTech_MotionVectorSteered = 0x0080
138 } VMRDeinterlaceTech;
139
140 typedef struct tagVMRPRESENTATIONINFO
141 {
142 DWORD dwFlags;
143 LPDIRECTDRAWSURFACE7 lpSurf;
144 REFERENCE_TIME rtStart;
145 REFERENCE_TIME rtEnd;
146 SIZE szAspectRatio;
147 RECT rcSrc;
148 RECT rcDst;
149 DWORD dwTypeSpecificFlags;
150 DWORD dwInterlaceFlags;
151 } VMRPRESENTATIONINFO;
152
153 typedef struct tagVMRALLOCATIONINFO
154 {
155 DWORD dwFlags;
156 LPBITMAPINFOHEADER lpHdr;
157 LPDDPIXELFORMAT lpPixFmt;
158 SIZE szAspectRatio;
159 DWORD dwMinBuffers;
160 DWORD dwMaxBuffers;
161 DWORD dwInterlaceFlags;
162 SIZE szNativeSize;
163 } VMRALLOCATIONINFO;
164
165 typedef struct _NORMALIZEDRECT
166 {
167 float left;
168 float top;
169 float right;
170 float bottom;
171 } NORMALIZEDRECT, *PNORMALIZEDRECT;
172
173 typedef struct tagVMRGUID
174 {
175 GUID* pGUID;
176 GUID GUID;
177 } VMRGUID;
178
179 typedef struct tagVMRMONITORINFO
180 {
181 VMRGUID guid;
182 RECT rcMonitor;
183 HMONITOR hMon;
184 DWORD dwFlags;
185 wchar_t szDevice[VMRDEVICENAMELEN];
186 wchar_t szDescription[VMRDEVICEDESCRIPTIONLEN];
187 LARGE_INTEGER liDriverVersion;
188 DWORD dwVendorId;
189 DWORD dwDeviceId;
190 DWORD dwSubSysId;
191 DWORD dwRevision;
192 } VMRMONITORINFO;
193
194 typedef struct _VMRFrequency
195 {
196 DWORD dwNumerator;
197 DWORD dwDenominator;
198 } VMRFrequency;
199
200 typedef struct _VMRVideoDesc
201 {
202 DWORD dwSize;
203 DWORD dwSampleWidth;
204 DWORD dwSampleHeight;
205 BOOL SingleFieldPerSample;
206 DWORD dwFourCC;
207 VMRFrequency InputSampleFreq;
208 VMRFrequency OutputFrameFreq;
209 } VMRVideoDesc;
210
211 typedef struct _VMRDeinterlaceCaps
212 {
213 DWORD dwSize;
214 DWORD dwNumPreviousOutputFrames;
215 DWORD dwNumForwardRefSamples;
216 DWORD dwNumBackwardRefSamples;
217 VMRDeinterlaceTech DeinterlaceTechnology;
218 } VMRDeinterlaceCaps;
219
220 typedef struct _VMRALPHABITMAP
221 {
222 DWORD dwFlags;
223 HDC hdc;
224 LPDIRECTDRAWSURFACE7 pDDS;
225 RECT rSrc;
226 NORMALIZEDRECT rDest;
227 FLOAT fAlpha;
228 COLORREF clrSrcKey;
229 } VMRALPHABITMAP, *PVMRALPHABITMAP;
230
231 typedef struct _VMRVIDEOSTREAMINFO
232 {
233 LPDIRECTDRAWSURFACE7 pddsVideoSurface;
234 DWORD dwWidth;
235 DWORD dwHeight;
236 FLOAT dwStrmID;
237 FLOAT fAlpha;
238 DDCOLORKEY ddClrKey;
239 NORMALIZEDRECT rNormal;
240 } VMRVIDEOSTREAMINFO;
241
242
243
244 [
245 local,
246 object,
247 local,
248 uuid(CE704FE7-E71E-41fb-BAA2-C4403E1182F5),
249 pointer_default(unique)
250 ]
251 interface IVMRImagePresenter : IUnknown
252 {
253 HRESULT StartPresenting([in] DWORD_PTR dwUserID);
254 HRESULT StopPresenting([in] DWORD_PTR dwUserID);
255 HRESULT PresentImage([in] DWORD_PTR dwUserID, [in] VMRPRESENTATIONINFO* lpPresInfo);
256 };
257
258 [
259 local,
260 object,
261 local,
262 uuid(31ce832e-4484-458b-8cca-f4d7e3db0b52),
263 pointer_default(unique)
264 ]
265 interface IVMRSurfaceAllocator : IUnknown
266 {
267 HRESULT AllocateSurface([in] DWORD_PTR dwUserID, [in] VMRALLOCATIONINFO* lpAllocInfo, [in] [out] DWORD* lpdwActualBuffers, [out] LPDIRECTDRAWSURFACE7 *lplpSurface);
268 HRESULT FreeSurface([in] DWORD_PTR dwID);
269 HRESULT PrepareSurface([in] DWORD_PTR dwUserID, [in] LPDIRECTDRAWSURFACE7 lpSurface, [in] DWORD dwSurfaceFlags);
270 HRESULT AdviseNotify([in] IVMRSurfaceAllocatorNotify* lpIVMRSurfAllocNotify);
271 };
272
273 [
274 local,
275 object,
276 local,
277 uuid(aada05a8-5a4e-4729-af0b-cea27aed51e2),
278 pointer_default(unique)
279 ]
280 interface IVMRSurfaceAllocatorNotify : IUnknown
281 {
282 HRESULT AdviseSurfaceAllocator([in] DWORD_PTR dwUserID, [in] IVMRSurfaceAllocator* lpIVRMSurfaceAllocator);
283 HRESULT SetDDrawDevice([in] LPDIRECTDRAW7 lpDDrawDevice, [in] HMONITOR hMonitor);
284 HRESULT ChangeDDrawDevice([in] LPDIRECTDRAW7 lpDDrawDevice, [in] HMONITOR hMonitor);
285 HRESULT RestoreDDrawSurfaces();
286 HRESULT NotifyEvent([in] LONG EventCode, [in] LONG_PTR Param1, [in] LONG_PTR Param2);
287 HRESULT SetBorderColor([in] COLORREF clrBorder);
288 };
289
290 [
291 local,
292 object,
293 local,
294 uuid(0eb1088c-4dcd-46f0-878f-39dae86a51b7),
295 pointer_default(unique)
296 ]
297 interface IVMRWindowlessControl : IUnknown
298 {
299 HRESULT GetNativeVideoSize([out] LONG* lpWidth, [out] LONG* lpHeight, [out] LONG* lpARWidth, [out] LONG* lpARHeight);
300 HRESULT GetMinIdealVideoSize([out] LONG* lpWidth, [out] LONG* lpHeight);
301 HRESULT GetMaxIdealVideoSize([out] LONG* lpWidth, [out] LONG* lpHeight);
302 HRESULT SetVideoPosition([in] const LPRECT lpSRCRect, [in] const LPRECT lpDSTRect);
303 HRESULT GetVideoPosition([out] LPRECT lpSRCRect, [out] LPRECT lpDSTRect);
304 HRESULT GetAspectRatioMode([out] DWORD* lpAspectRatioMode);
305 HRESULT SetAspectRatioMode([in] DWORD AspectRatioMode);
306 HRESULT SetVideoClippingWindow([in] HWND hwnd);
307 HRESULT RepaintVideo([in] HWND hwnd, [in] HDC hdc);
308 HRESULT DisplayModeChanged();
309 HRESULT GetCurrentImage([out] BYTE** lpDib);
310 HRESULT SetBorderColor([in] COLORREF Clr);
311 HRESULT GetBorderColor([out] COLORREF* lpClr);
312 HRESULT SetColorKey([in] COLORREF Clr);
313 HRESULT GetColorKey([out] COLORREF* lpClr);
314 };
315
316 [
317 local,
318 object,
319 local,
320 uuid(1c1a17b0-bed0-415d-974b-dc6696131599),
321 pointer_default(unique)
322 ]
323 interface IVMRMixerControl : IUnknown
324 {
325 HRESULT SetAlpha([in] DWORD dwStreamID, [in] float Alpha);
326 HRESULT GetAlpha([in] DWORD dwStreamID, [out] float* pAlpha);
327 HRESULT SetZOrder([in] DWORD dwStreamID, [in] DWORD dwZ);
328 HRESULT GetZOrder([in] DWORD dwStreamID, [out] DWORD* pZ);
329 HRESULT SetOutputRect([in] DWORD dwStreamID, [in] const NORMALIZEDRECT *pRect);
330 HRESULT GetOutputRect([in] DWORD dwStreamID, [out] NORMALIZEDRECT *pRect);
331 HRESULT SetBackgroundClr([in] COLORREF ClrBkg);
332 HRESULT GetBackgroundClr([in] COLORREF* lpClrBkg);
333 HRESULT SetMixingPrefs([in] DWORD dwMixerPrefs);
334 HRESULT GetMixingPrefs([out] DWORD* pdwMixerPrefs);
335 };
336
337 [
338 object,
339 local,
340 uuid(9cf0b1b6-fbaa-4b7f-88cf-cf1f130a0dce),
341 pointer_default(unique)
342 ]
343 interface IVMRMonitorConfig : IUnknown
344 {
345 HRESULT SetMonitor([in] const VMRGUID *pGUID);
346 HRESULT GetMonitor([out] VMRGUID *pGUID);
347 HRESULT SetDefaultMonitor([in] const VMRGUID *pGUID);
348 HRESULT GetDefaultMonitor([out] VMRGUID *pGUID);
349 HRESULT GetAvailableMonitors([out, size_is(dwMaxInfoArraySize)] VMRMONITORINFO* pInfo, [in] DWORD dwMaxInfoArraySize, [out] DWORD* pdwNumDevices);
350 };
351
352
353 [
354 object,
355 local,
356 uuid(9e5530c5-7034-48b4-bb46-0b8a6efc8e36),
357 pointer_default(unique)
358 ]
359 interface IVMRFilterConfig : IUnknown
360 {
361 HRESULT SetImageCompositor([in] IVMRImageCompositor* lpVMRImgCompositor);
362 HRESULT SetNumberOfStreams([in] DWORD dwMaxStreams);
363 HRESULT GetNumberOfStreams([out] DWORD* pdwMaxStreams);
364 HRESULT SetRenderingPrefs([in] DWORD dwRenderFlags);
365 HRESULT GetRenderingPrefs([out] DWORD* pdwRenderFlags);
366 HRESULT SetRenderingMode([in] DWORD Mode);
367 HRESULT GetRenderingMode([out] DWORD* pMode);
368 }
369
370
371 [
372 object,
373 local,
374 uuid(ede80b5c-bad6-4623-b537-65586c9f8dfd),
375 pointer_default(unique)
376 ]
377 interface IVMRAspectRatioControl : IUnknown
378 {
379 HRESULT GetAspectRatioMode([out] LPDWORD lpdwARMode);
380 HRESULT SetAspectRatioMode([in] DWORD dwARMode);
381 }
382
383 [
384 object,
385 local,
386 uuid(bb057577-0db8-4e6a-87a7-1a8c9a505a0f),
387 pointer_default(unique)
388 ]
389 interface IVMRDeinterlaceControl : IUnknown
390 {
391
392 HRESULT GetNumberOfDeinterlaceModes([in] VMRVideoDesc* lpVideoDescription, [in] [out] LPDWORD lpdwNumDeinterlaceModes, [out] LPGUID lpDeinterlaceModes);
393 HRESULT GetDeinterlaceModeCaps([in] LPGUID lpDeinterlaceMode, [in] VMRVideoDesc* lpVideoDescription, [in] [out] VMRDeinterlaceCaps* lpDeinterlaceCaps);
394 HRESULT GetDeinterlaceMode([in] DWORD dwStreamID, [out] LPGUID lpDeinterlaceMode );
395 HRESULT SetDeinterlaceMode([in] DWORD dwStreamID, [in] LPGUID lpDeinterlaceMode);
396 HRESULT GetDeinterlacePrefs([out] LPDWORD lpdwDeinterlacePrefs);
397 HRESULT SetDeinterlacePrefs([in] DWORD dwDeinterlacePrefs);
398 HRESULT GetActualDeinterlaceMode([in] DWORD dwStreamID, [out] LPGUID lpDeinterlaceMode);
399 }
400
401 [
402 object,
403 local,
404 uuid(1E673275-0257-40aa-AF20-7C608D4A0428),
405 pointer_default(unique)
406 ]
407 interface IVMRMixerBitmap : IUnknown
408 {
409 HRESULT SetAlphaBitmap([in] const VMRALPHABITMAP *pBmpParms);
410 HRESULT UpdateAlphaBitmapParameters([in] PVMRALPHABITMAP pBmpParms);
411 HRESULT GetAlphaBitmapParameters([out] PVMRALPHABITMAP pBmpParms);
412 };
413
414 [
415 local,
416 object,
417 local,
418 uuid(7a4fb5af-479f-4074-bb40-ce6722e43c82),
419 pointer_default(unique)
420 ]
421 interface IVMRImageCompositor : IUnknown
422 {
423 HRESULT InitCompositionTarget([in] IUnknown* pD3DDevice, [in] LPDIRECTDRAWSURFACE7 pddsRenderTarget);
424 HRESULT TermCompositionTarget([in] IUnknown* pD3DDevice, [in] LPDIRECTDRAWSURFACE7 pddsRenderTarget);
425 HRESULT SetStreamMediaType([in] DWORD dwStrmID, [in] AM_MEDIA_TYPE* pmt, [in] BOOL fTexture);
426 HRESULT CompositeImage([in] IUnknown* pD3DDevice, [in] LPDIRECTDRAWSURFACE7 pddsRenderTarget, [in] AM_MEDIA_TYPE* pmtRenderTarget, [in] REFERENCE_TIME rtStart, [in] REFERENCE_TIME rtEnd, [in] DWORD dwClrBkGnd, [in] VMRVIDEOSTREAMINFO* pVideoStreamInfo, [in] UINT cStreams);
427 };
428
429 [
430 object,
431 local,
432 uuid(058d1f11-2a54-4bef-bd54-df706626b727),
433 pointer_default(unique)
434 ]
435 interface IVMRVideoStreamControl: IUnknown
436 {
437 HRESULT SetColorKey([in] LPDDCOLORKEY lpClrKey);
438 HRESULT GetColorKey([out] LPDDCOLORKEY lpClrKey);
439 HRESULT SetStreamActiveState([in] BOOL fActive);
440 HRESULT GetStreamActiveState([out] BOOL* lpfActive);
441 };
442
443 [
444 local,
445 object,
446 local,
447 uuid(a9849bbe-9ec8-4263-b764-62730f0d15d0),
448 pointer_default(unique)
449 ]
450 interface IVMRSurface : IUnknown
451 {
452 HRESULT IsSurfaceLocked();
453 HRESULT LockSurface([out] BYTE** lpSurface);
454 HRESULT UnlockSurface();
455 HRESULT GetSurface([out] LPDIRECTDRAWSURFACE7 *lplpSurface);
456 };
457
458 [
459 local,
460 object,
461 local,
462 uuid(9f3a1c85-8555-49ba-935f-be5b5b29d178),
463 pointer_default(unique)
464 ]
465
466 interface IVMRImagePresenterConfig : IUnknown
467 {
468 HRESULT SetRenderingPrefs([in] DWORD dwRenderFlags);
469 HRESULT GetRenderingPrefs([out] DWORD* dwRenderFlags);
470 }
471
472 [
473 local,
474 object,
475 local,
476 uuid(e6f7ce40-4673-44f1-8f77-5499d68cb4ea),
477 pointer_default(unique)
478 ]
479
480 interface IVMRImagePresenterExclModeConfig : IVMRImagePresenterConfig
481 {
482 HRESULT SetXlcModeDDObjAndPrimarySurface([in] LPDIRECTDRAW7 lpDDObj, [in] LPDIRECTDRAWSURFACE7 lpPrimarySurf);
483 HRESULT GetXlcModeDDObjAndPrimarySurface([out] LPDIRECTDRAW7* lpDDObj, [out] LPDIRECTDRAWSURFACE7* lpPrimarySurf);
484 }
485
486 [
487 local,
488 object,
489 local,
490 uuid(aac18c18-e186-46d2-825d-a1f8dc8e395a),
491 pointer_default(unique)
492 ]
493 interface IVPManager : IUnknown
494 {
495 HRESULT SetVideoPortIndex([in] DWORD dwVideoPortIndex);
496 HRESULT GetVideoPortIndex([out] DWORD* pdwVideoPortIndex);
497 };
498