xref: /reactos/sdk/include/psdk/vmr9.idl (revision c2c66aff)
1/*
2 * Copyright 2008 Maarten Lankhorst
3 *
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.
8 *
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.
13 *
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
17 */
18
19import "unknwn.idl";
20
21cpp_quote("#if 0")
22interface IDirect3DSurface9;
23interface IDirect3DDevice9;
24typedef LONGLONG REFERENCE_TIME;
25typedef DWORD D3DFORMAT;
26typedef DWORD D3DPOOL;
27typedef HANDLE HMONITOR;
28typedef struct { char dummy; } AM_MEDIA_TYPE;
29typedef struct { char dummy; } D3DCOLOR;
30cpp_quote("#endif")
31
32interface IVMRSurface9;
33interface IVMRSurfaceAllocator9;
34interface IVMRSurfaceAllocatorEx9;
35interface IVMRSurfaceAllocatorNotify9;
36interface IVMRImagePresenter9;
37interface IVMRImagePresenterConfig9;
38interface IVMRMonitorConfig9;
39interface IVMRWindowlessControl9;
40interface IVMRMixerControl9;
41interface IVMRImageCompositor9;
42interface IVMRMixerBitmap9;
43interface IVMRFilterConfig9;
44interface IVMRAspectRatioControl9;
45interface IVMRVideoStreamControl9;
46
47typedef enum _VMR9PresentationFlags
48{
49    VMR9Sample_SyncPoint = 0x1,
50    VMR9Sample_Preroll = 0x2,
51    VMR9Sample_Discontinuity = 0x4,
52    VMR9Sample_TimeValid = 0x8,
53    VMR9Sample_SrcDstRectsValid = 0x10
54} VMR9PresentationFlags;
55
56typedef struct _VMR9PresentationInfo
57{
58    DWORD dwFlags; /* Flags defined above */
59    IDirect3DSurface9 *lpSurf;
60    REFERENCE_TIME rtStart;
61    REFERENCE_TIME rtEnd;
62    SIZE szAspectRatio;
63    RECT rcSrc;
64    RECT rcDst;
65    DWORD dwReserved1;
66    DWORD dwReserved2;
67} VMR9PresentationInfo;
68
69[
70    local,
71    object,
72    uuid(69188c61-12a3-40f0-8ffc-342e7b433fd7),
73    helpstring("IVMRImagePresenter9 interface"),
74    pointer_default(unique)
75]
76interface IVMRImagePresenter9 : IUnknown
77{
78    HRESULT StartPresenting([in] DWORD_PTR id);
79    HRESULT StopPresenting([in] DWORD_PTR id);
80    HRESULT PresentImage([in] DWORD_PTR id, [in] VMR9PresentationInfo *info);
81};
82
83typedef enum _VMR9SurfaceAllocationFlags
84{
85    VMR9AllocFlag_3DRenderTarget = 0x1,
86    VMR9AllocFlag_DXVATarget = 0x2,
87    VMR9AllocFlag_TextureSurface = 0x4,
88    VMR9AllocFlag_OffscreenSurface = 0x8,
89    VMR9AllocFlag_RGBDynamicSwitch = 0x10,
90    VMR9AllocFlag_UsageReserved = 0xe0,
91    VMR9AllocFlag_UsageMask = 0xff,
92} VMR9SurfaceAllocationFlags;
93
94typedef struct _VMR9AllocationInfo
95{
96    DWORD dwFlags; /* Flags defined above */
97    DWORD dwWidth;
98    DWORD dwHeight;
99    D3DFORMAT Format;
100    D3DPOOL Pool;
101    DWORD MinBuffers;
102    SIZE szAspectRatio;
103    SIZE szNativeSize;
104} VMR9AllocationInfo;
105
106[
107    local,
108    object,
109    uuid(8d5148ea-3f5d-46cf-9df1-d1b896eedb1f),
110    helpstring("IVMRSurfaceAllocator9 interface"),
111    pointer_default(unique)
112]
113interface IVMRSurfaceAllocator9 : IUnknown
114{
115    HRESULT InitializeDevice([in] DWORD_PTR id, [in] VMR9AllocationInfo *allocinfo, [in, out] DWORD *numbuffers);
116    HRESULT TerminateDevice([in] DWORD_PTR id);
117    HRESULT GetSurface([in] DWORD_PTR id, [in] DWORD surfaceindex, [in] DWORD flags, [out] IDirect3DSurface9 **surface);
118    HRESULT AdviseNotify([in] IVMRSurfaceAllocatorNotify9 *allocnotify);
119};
120
121[
122    local,
123    object,
124    uuid(6de9a68a-a928-4522-bf57-655ae3866456),
125    helpstring("IVMRSurfaceAllocatorEx9 interface"),
126    pointer_default(unique)
127]
128interface IVMRSurfaceAllocatorEx9 : IVMRSurfaceAllocator9
129{
130    HRESULT GetSurfaceEx([in] DWORD_PTR id, [in] DWORD surfaceindex, [in] DWORD flags, [out] IDirect3DSurface9 **surface, [out] RECT *dest);
131};
132
133[
134    local,
135    object,
136    uuid(dca3f5df-bb3a-4d03-bd81-84614bfbfa0c),
137    helpstring("IVMRSurfaceAllocatorNotify9 interface"),
138    pointer_default(unique)
139]
140interface IVMRSurfaceAllocatorNotify9 : IUnknown
141{
142    HRESULT AdviseSurfaceAllocator([in] DWORD_PTR id, [in] IVMRSurfaceAllocator9 *alloc);
143    HRESULT SetD3DDevice([in] IDirect3DDevice9 *device, [in] HMONITOR monitor);
144    HRESULT ChangeD3DDevice([in] IDirect3DDevice9 *device, [in] HMONITOR monitor);
145    HRESULT AllocateSurfaceHelper([in] VMR9AllocationInfo *allocinfo, [in, out] DWORD *numbuffers, [out] IDirect3DSurface9 **surface);
146    HRESULT NotifyEvent([in] LONG code, [in] LONG_PTR param1, [in] LONG_PTR param2);
147};
148
149typedef enum _VMR9AspectRatioMode
150{
151    VMR9ARMode_None,
152    VMR9ARMode_LetterBox
153} VMR9AspectRatioMode;
154
155[
156    local,
157    object,
158    uuid(8f537d09-f85e-4414-b23b-502e54c79927),
159    helpstring("IVMRWindowlessControl interface"),
160    pointer_default(unique)
161]
162interface IVMRWindowlessControl9 : IUnknown
163{
164    HRESULT GetNativeVideoSize([out] LONG *width, [out] LONG *height, [out] LONG *arwidth, [out] LONG *arheight);
165    HRESULT GetMinIdealVideoSize([out] LONG *width, [out] LONG *height);
166    HRESULT GetMaxIdealVideoSize([out] LONG *width, [out] LONG *height);
167    HRESULT SetVideoPosition([in] const RECT *source, [in] const RECT *dest);
168    HRESULT GetVideoPosition([out] RECT *source, [out] RECT *dest);
169    HRESULT GetAspectRatioMode([out] DWORD *mode);
170    HRESULT SetAspectRatioMode([in] DWORD mode);
171    HRESULT SetVideoClippingWindow([in] HWND hwnd);
172    HRESULT RepaintVideo([in] HWND hwnd, [in] HDC hdc);
173    HRESULT DisplayModeChanged();
174    HRESULT GetCurrentImage([out] BYTE **dib);
175    HRESULT SetBorderColor([in] COLORREF color);
176    HRESULT GetBorderColor([out] COLORREF *color);
177};
178
179typedef enum _VMR9MixerPrefs
180{
181    /* Decimation */
182    MixerPref9_NoDecimation = 0x1,
183    MixerPref9_DecimateOutput = 0x2,
184    MixerPref9_ARAdjustXorY = 0x4,
185    MixerPref9_NonSquareMixing = 0x8,
186    MixerPref9_DecimateMask = 0xf,
187
188    /* Filtering */
189    MixerPref9_BiLinearFiltering = 0x10,
190    MixerPref9_PointFiltering = 0x20,
191    MixerPref9_AnisotropicFiltering = 0x40,
192    MixerPref9_PyramidalQuadFiltering = 0x80,
193    MixerPref9_GaussianQuadFiltering = 0x100,
194    MixerPref9_FilteringReserved = 0xe00,
195    MixerPref9_FilteringMask = 0xff0,
196
197    /* Render target */
198    MixerPref9_RenderTargetRGB = 0x1000,
199    MixerPref9_RenderTargetYUV = 0x2000,
200    MixerPref9_RenderTargetReserved = 0xfc000,
201
202    MixerPref9_DynamicSwitchToBOB = 0x100000,
203    MixerPref9_DynamicDecimateBy2 = 0x200000,
204    MixerPref9_DynamicReserved = 0xc00000,
205    MixerPref9_DynamicMask = 0xf00000,
206} VMR9MixerPrefs;
207
208typedef struct _VMR9NormalizedRect
209{
210    FLOAT left;
211    FLOAT top;
212    FLOAT right;
213    FLOAT bottom;
214} VMR9NormalizedRect;
215
216typedef enum _VMR9ProcAmpControlFlags
217{
218    ProcAmpControl9_Brightness = 0x1,
219    ProcAmpControl9_Contrast = 0x2,
220    ProcAmpControl9_Hue = 0x4,
221    ProcAmpControl9_Saturation = 0x8,
222    ProcAmpControl9_Mask = 0xf
223} VMR9ProcAmpControlFlags;
224
225typedef struct _VMR9ProcAmpControl
226{
227    DWORD dwSize;
228    DWORD dwFlags;
229    FLOAT Brightness;
230    FLOAT Contrast;
231    FLOAT Hue;
232    FLOAT Saturation;
233} VMR9ProcAmpControl;
234
235typedef struct _VMR9ProcAmpControlRange
236{
237    DWORD dwSize;
238    VMR9ProcAmpControlFlags dwProperty;
239    FLOAT MinValue;
240    FLOAT MaxValue;
241    FLOAT DefaultValue;
242    FLOAT StepSize;
243} VMR9ProcAmpControlRange;
244
245[
246    local,
247    object,
248    uuid(1a777eaa-47c8-4930-b2c9-8fee1c1b0f3b),
249    helpstring("IVMRMixerControl9 interface"),
250    pointer_default(unique)
251]
252interface IVMRMixerControl9 : IUnknown
253{
254    HRESULT SetAlpha([in] DWORD streamid, [in] FLOAT alpha);
255    HRESULT GetAlpha([in] DWORD streamid, [out] FLOAT *alpha);
256    HRESULT SetZOrder([in] DWORD streamid, [in] DWORD zorder);
257    HRESULT GetZOrder([in] DWORD streamid, [out] DWORD *zorder);
258    HRESULT SetOutputRect([in] DWORD streamid, [in] const VMR9NormalizedRect *rect);
259    HRESULT GetOutputRect([in] DWORD streamid, [out] VMR9NormalizedRect *rect);
260    HRESULT SetBackgroundClr([in] COLORREF back);
261    HRESULT GetBackgroundClr([out] COLORREF *back);
262    HRESULT SetMixingPrefs([in] DWORD mixingprefs);
263    HRESULT GetMixingPrefs([out] DWORD *mixingprefs);
264    HRESULT SetProcAmpControl([in] DWORD streamid, [in] VMR9ProcAmpControl *control);
265    HRESULT GetProcAmpControl([in] DWORD streamid, [in, out] VMR9ProcAmpControl *control);
266    HRESULT GetProcAmpControlRange([in] DWORD streamid, [in, out] VMR9ProcAmpControlRange *controlrange);
267};
268
269typedef struct _VMR9AlphaBitmap
270{
271    DWORD dwFlags;
272    HDC hdc;
273    IDirect3DSurface9 *pDDS;
274    RECT rSrc;
275    VMR9NormalizedRect *rDest;
276    FLOAT fAlpha;
277    COLORREF clrSrcKey;
278    DWORD dwFilterMode;
279} VMR9AlphaBitmap;
280
281typedef enum _VMR9AlphaBitmapFlags
282{
283    VMR9AlphaBitmap_Disable = 0x1,
284    VMR9AlphaBitmap_hDC = 0x2,
285    VMR9AlphaBitmap_EntireDDS = 0x4,
286    VMR9AlphaBitmap_SrcColorKey = 0x8,
287    VMR9AlphaBitmap_SrcRect = 0x10,
288    VMR9AlphaBitmap_FilterMode = 0x20
289} VMR9AlphaBitmapFlags;
290
291[
292    local,
293    object,
294    uuid(ced175e5-1935-4820-81bd-ff6ad00c9108),
295    helpstring("IVMRMixerBitmap interface"),
296    pointer_default(unique)
297]
298interface IVMRMixerBitmap9 : IUnknown
299{
300    HRESULT SetAlphaBitmap([in] const VMR9AlphaBitmap *bitmap);
301    HRESULT UpdateAlphaBitmapParameters([in] const VMR9AlphaBitmap *bitmap);
302    HRESULT GetAlphaBitmapParameters([out] VMR9AlphaBitmap *bitmap);
303};
304
305[
306    local,
307    object,
308    uuid(dfc581a1-6e1f-4c3a-8d0a-5e9792ea2afc),
309    helpstring("IVMRSurface interface"),
310    pointer_default(unique)
311]
312interface IVMRSurface9 : IUnknown
313{
314    HRESULT IsSurfaceLocked();
315    HRESULT LockSurface([out] BYTE **surface);
316    HRESULT UnlockSurface();
317    HRESULT GetSurface([out] IDirect3DSurface9 **surface);
318};
319
320typedef enum _VMR9RenderPrefs
321{
322   RenderPrefs9_DoNotRenderBorder = 0x1,
323   RenderPrefs9_Mask = 0x1
324} VMR9RenderPrefs;
325
326[
327    local,
328    object,
329    uuid(45c15cab-6e22-420a-8043-ae1f0ac02c7d),
330    helpstring("IVMRImagePresenterConfig9 interface"),
331    pointer_default(unique)
332]
333interface IVMRImagePresenterConfig9 : IUnknown
334{
335    HRESULT SetRenderingPrefs([in] DWORD renderflags);
336    HRESULT GetRenderingPrefs([out] DWORD *renderflags);
337};
338
339[
340    local,
341    object,
342    uuid(d0cfe38b-93e7-4772-8957-0400c49a4485),
343    helpstring("IVMRMixerStreamConfig interface"),
344    pointer_default(unique)
345]
346interface IVMRVideoStreamControl9: IUnknown
347{
348    HRESULT SetStreamActiveState([in] BOOL active);
349    HRESULT GetStreamActiveState([out] BOOL *active);
350};
351
352typedef enum _VMR9Mode
353{
354    VMR9Mode_Windowed = 0x1,
355    VMR9Mode_Windowless = 0x2,
356    VMR9Mode_Renderless = 0x4,
357    VMR9Mode_Mask = 0x7
358} VMR9Mode;
359
360[
361    local,
362    object,
363    uuid(5a804648-4f66-4867-9c43-4f5c822cf1b8),
364    helpstring("IVMRFilterConfig9 interface"),
365    pointer_default(unique)
366]
367interface IVMRFilterConfig9 : IUnknown
368{
369    HRESULT SetImageCompositor([in] IVMRImageCompositor9 *compositor);
370    HRESULT SetNumberOfStreams([in] DWORD max);
371    HRESULT GetNumberOfStreams([out] DWORD *max);
372    HRESULT SetRenderingPrefs([in] DWORD renderflags);
373    HRESULT GetRenderingPrefs([out] DWORD *renderflags);
374    HRESULT SetRenderingMode([in] DWORD mode);
375    HRESULT GetRenderingMode([out] DWORD *mode);
376};
377
378[
379    local,
380    object,
381    uuid(00d96c29-bbde-4efc-9901-bb5036392146),
382    helpstring("IVMRAspectRatioControl9 interface"),
383    pointer_default(unique)
384]
385interface IVMRAspectRatioControl9 : IUnknown
386{
387    HRESULT GetAspectRatioMode([out] DWORD *mode);
388    HRESULT SetAspectRatioMode([in] DWORD mode);
389}
390
391#define VMR9DEVICENAMELEN 32
392#define VMR9DEVICEDESCRIPTIONLEN 512
393
394typedef struct _VMR9MonitorInfo
395{
396    UINT uDevID;
397    RECT rcMonitor;
398    HMONITOR hMon;
399    DWORD dwFlags;
400    WCHAR szDevice[VMR9DEVICENAMELEN];
401    WCHAR szDescription[VMR9DEVICEDESCRIPTIONLEN];
402    LARGE_INTEGER liDriverVersion;
403    DWORD dwVendorId;
404    DWORD dwDeviceId;
405    DWORD dwSubSysId;
406    DWORD dwRevision;
407} VMR9MonitorInfo;
408
409[
410    local,
411    object,
412    uuid(46c2e457-8ba0-4eef-b80b-0680f0978749),
413    helpstring("IVMRMonitorConfig9 interface"),
414    pointer_default(unique)
415]
416interface IVMRMonitorConfig9 : IUnknown
417{
418    HRESULT SetMonitor([in] UINT uDev);
419    HRESULT GetMonitor([out] UINT *uDev);
420    HRESULT SetDefaultMonitor([in] UINT uDev);
421    HRESULT GetDefaultMonitor([out] UINT *uDev);
422    HRESULT GetAvailableMonitors([out, size_is(arraysize)] VMR9MonitorInfo *info, [in] DWORD arraysize, [out] DWORD *numdev);
423};
424
425typedef enum _VMR9DeinterlacePrefs
426{
427    DeinterlacePref9_NextBest = 0x1,
428    DeinterlacePref9_BOB = 0x2,
429    DeinterlacePref9_Weave = 0x4,
430    DeinterlacePref9_Mask = 0x7
431} VMR9DeinterlacePrefs;
432
433typedef enum _VMR9DeinterlaceTech
434{
435    DeinterlaceTech9_Unknown = 0,
436    DeinterlaceTech9_BOBLineReplicate = 0x1,
437    DeinterlaceTech9_BOBVerticalStretch = 0x2,
438    DeinterlaceTech9_MedianFiltering = 0x4,
439    DeinterlaceTech9_EdgeFiltering = 0x10,
440    DeinterlaceTech9_FieldAdaptive = 0x20,
441    DeinterlaceTech9_PixelAdaptive = 0x40,
442    DeinterlaceTech9_MotionVectorSteered = 0x80
443} VMR9DeinterlaceTech;
444
445typedef struct _VMR9Frequency
446{
447    DWORD dwNumerator;
448    DWORD dwDenominator;
449} VMR9Frequency;
450
451typedef enum _VMR9_SampleFormat
452{
453    VMR9_SampleReserved = 1,
454    VMR9_SampleProgressiveFrame = 2,
455    VMR9_SampleFieldInterleavedEvenFirst = 3,
456    VMR9_SampleFieldInterleavedOddFirst = 4,
457    VMR9_SampleFieldSingleEven = 5,
458    VMR9_SampleFieldSingleOdd = 6,
459} VMR9_SampleFormat;
460
461typedef struct _VMR9VideoDesc
462{
463    DWORD dwSize;
464    DWORD dwSampleWidth;
465    DWORD dwSampleHeight;
466    VMR9_SampleFormat SampleFormat;
467    DWORD dwFourCC;
468    VMR9Frequency InputSampleFreq;
469    VMR9Frequency OutputFrameFreq;
470} VMR9VideoDesc;
471
472typedef struct _VMR9DeinterlaceCaps {
473    DWORD dwSize;
474    DWORD dwNumPreviousOutputFrames;
475    DWORD dwNumForwardRefSamples;
476    DWORD dwNumBackwardRefSamples;
477    VMR9DeinterlaceTech DeinterlaceTechnology;
478} VMR9DeinterlaceCaps;
479
480[
481    local,
482    object,
483    uuid(a215fb8d-13c2-4f7f-993c-003d6271a459),
484    helpstring("IVMRDeinterlaceControl9 interface"),
485    pointer_default(unique)
486]
487interface IVMRDeinterlaceControl9 : IUnknown
488{
489    HRESULT GetNumberOfDeinterlaceModes([in] VMR9VideoDesc *desc, [in, out] DWORD *nummodes, [out] GUID *modes);
490    HRESULT GetDeinterlaceModeCaps([in] GUID *mode, [in] VMR9VideoDesc *desc, [out] VMR9DeinterlaceCaps *caps);
491    HRESULT GetDeinterlaceMode([in] DWORD streamid, [out] GUID *mode);
492    HRESULT SetDeinterlaceMode([in] DWORD streamid, [in] GUID *mode);
493    HRESULT GetDeinterlacePrefs([out] DWORD *prefs);
494    HRESULT SetDeinterlacePrefs([in] DWORD prefs);
495    HRESULT GetActualDeinterlaceMode([in] DWORD streamid, [out] GUID *mode);
496};
497
498typedef struct _VMR9VideoStreamInfo {
499    IDirect3DSurface9 *pddsVideoSurface;
500    DWORD dwWidth;
501    DWORD dwHeight;
502    DWORD dwStrmID;
503    FLOAT fAlpha;
504    VMR9NormalizedRect rNormal;
505    REFERENCE_TIME rtStart;
506    REFERENCE_TIME rtEnd;
507    VMR9_SampleFormat SampleFormat;
508} VMR9VideoStreamInfo;
509
510[
511    local,
512    object,
513    uuid(4a5c89eb-df51-4654-ac2a-e48e02bbabf6),
514    helpstring("IVMRImageCompositor9 interface"),
515    pointer_default(unique)
516]
517interface IVMRImageCompositor9 : IUnknown
518{
519    HRESULT InitCompositionDevice([in] IUnknown *d3ddev);
520    HRESULT TermCompositionDevice([in] IUnknown *d3ddev);
521    HRESULT CompositeImage([in] IUnknown *d3ddev, [in] IDirect3DSurface9 *d3dtarget, [in] AM_MEDIA_TYPE *mttarget,
522                           [in] REFERENCE_TIME start, [in] REFERENCE_TIME stop, D3DCOLOR back,
523                           [in] VMR9VideoStreamInfo *info, [in] UINT streams);
524};
525