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