2 * Copyright 2008 Maarten Lankhorst
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
22 interface IDirect3DSurface9
;
23 interface IDirect3DDevice9
;
24 typedef LONGLONG REFERENCE_TIME
;
25 typedef DWORD D3DFORMAT
;
26 typedef DWORD D3DPOOL
;
27 typedef HANDLE HMONITOR
;
29 typedef struct { } AM_MEDIA_TYPE
;
30 typedef struct { } D3DCOLOR
;
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
;
48 typedef enum _VMR9PresentationFlags
50 VMR9Sample_SyncPoint
= 0x1,
51 VMR9Sample_Preroll
= 0x2,
52 VMR9Sample_Discontinuity
= 0x4,
53 VMR9Sample_TimeValid
= 0x8,
54 VMR9Sample_SrcDstRectsValid
= 0x10
55 } VMR9PresentationFlags
;
57 typedef struct _VMR9PresentationInfo
59 DWORD dwFlags
; /* Flags defined above */
60 IDirect3DSurface9
*lpSurf
;
61 REFERENCE_TIME rtStart
;
68 } VMR9PresentationInfo
;
73 uuid(69188c61
-12a3
-40f0
-8ffc
-342e7b433fd7
),
74 helpstring("IVMRImagePresenter9 interface"),
75 pointer_default(unique)
77 interface IVMRImagePresenter9
: IUnknown
79 HRESULT StartPresenting
([in] DWORD_PTR
id);
80 HRESULT StopPresenting
([in] DWORD_PTR
id);
81 HRESULT PresentImage
([in] DWORD_PTR
id, [in] VMR9PresentationInfo
*info
);
84 typedef enum _VMR9SurfaceAllocationFlags
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
;
95 typedef struct _VMR9AllocationInfo
97 DWORD dwFlags
; /* Flags defined above */
105 } VMR9AllocationInfo
;
110 uuid(8d5148ea
-3f5d
-46cf
-9df1
-d1b896eedb1f
),
111 helpstring("IVMRSurfaceAllocator9 interface"),
112 pointer_default(unique)
114 interface IVMRSurfaceAllocator9
: IUnknown
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
);
125 uuid(6de9a68a
-a928
-4522-bf57
-655ae3866456
),
126 helpstring("IVMRSurfaceAllocatorEx9 interface"),
127 pointer_default(unique)
129 interface IVMRSurfaceAllocatorEx9
: IVMRSurfaceAllocator9
131 HRESULT GetSurfaceEx
([in] DWORD_PTR
id, [in] DWORD surfaceindex
, [in] DWORD flags
, [out] IDirect3DSurface9
**surface
, [out] RECT
*dest
);
137 uuid(dca3f5df
-bb3a
-4d03
-bd81
-84614bfbfa0c
),
138 helpstring("IVMRSurfaceAllocatorNotify9 interface"),
139 pointer_default(unique)
141 interface IVMRSurfaceAllocatorNotify9
: IUnknown
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
);
150 typedef enum _VMR9AspectRatioMode
154 } VMR9AspectRatioMode
;
159 uuid(8f537d09
-f85e
-4414
-b23b
-502e54c79927
),
160 helpstring("IVMRWindowlessControl interface"),
161 pointer_default(unique)
163 interface IVMRWindowlessControl9
: IUnknown
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
);
180 typedef enum _VMR9MixerPrefs
183 MixerPref9_NoDecimation
= 0x1,
184 MixerPref9_DecimateOutput
= 0x2,
185 MixerPref9_ARAdjustXorY
= 0x4,
186 MixerPref9_NonSquareMixing
= 0x8,
187 MixerPref9_DecimateMask
= 0xf,
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,
199 MixerPref9_RenderTargetRGB
= 0x1000,
200 MixerPref9_RenderTargetYUV
= 0x2000,
201 MixerPref9_RenderTargetReserved
= 0xfc000,
203 MixerPref9_DynamicSwitchToBOB
= 0x100000,
204 MixerPref9_DynamicDecimateBy2
= 0x200000,
205 MixerPref9_DynamicReserved
= 0xc00000,
206 MixerPref9_DynamicMask
= 0xf00000,
209 typedef struct _VMR9NormalizedRect
215 } VMR9NormalizedRect
;
217 typedef enum _VMR9ProcAmpControlFlags
219 ProcAmpControl9_Brightness
= 0x1,
220 ProcAmpControl9_Contrast
= 0x2,
221 ProcAmpControl9_Hue
= 0x4,
222 ProcAmpControl9_Saturation
= 0x8,
223 ProcAmpControl9_Mask
= 0xf
224 } VMR9ProcAmpControlFlags
;
226 typedef struct _VMR9ProcAmpControl
234 } VMR9ProcAmpControl
;
236 typedef struct _VMR9ProcAmpControlRange
239 VMR9ProcAmpControlFlags dwProperty
;
244 } VMR9ProcAmpControlRange
;
249 uuid(1a777eaa
-47c8
-4930-b2c9
-8fee1c1b0f3b
),
250 helpstring("IVMRMixerControl9 interface"),
251 pointer_default(unique)
253 interface IVMRMixerControl9
: IUnknown
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
);
270 typedef struct _VMR9AlphaBitmap
274 IDirect3DSurface9
*pDDS
;
276 VMR9NormalizedRect
*rDest
;
282 typedef enum _VMR9AlphaBitmapFlags
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
;
295 uuid(ced175e5
-1935-4820-81bd
-ff6ad00c9108
),
296 helpstring("IVMRMixerBitmap interface"),
297 pointer_default(unique)
299 interface IVMRMixerBitmap9
: IUnknown
301 HRESULT SetAlphaBitmap
([in] const VMR9AlphaBitmap
*bitmap
);
302 HRESULT UpdateAlphaBitmapParameters
([in] const VMR9AlphaBitmap
*bitmap
);
303 HRESULT GetAlphaBitmapParameters
([out] VMR9AlphaBitmap
*bitmap
);
309 uuid(dfc581a1
-6e1f
-4c3a
-8d0a
-5e9792ea2afc
),
310 helpstring("IVMRSurface interface"),
311 pointer_default(unique)
313 interface IVMRSurface9
: IUnknown
315 HRESULT IsSurfaceLocked
();
316 HRESULT LockSurface
([out] BYTE **surface
);
317 HRESULT UnlockSurface
();
318 HRESULT GetSurface
([out] IDirect3DSurface9
**surface
);
321 typedef enum _VMR9RenderPrefs
323 RenderPrefs9_DoNotRenderBorder
= 0x1,
324 RenderPrefs9_Mask
= 0x1
330 uuid(45c15cab
-6e22
-420a
-8043-ae1f0ac02c7d
),
331 helpstring("IVMRImagePresenterConfig9 interface"),
332 pointer_default(unique)
334 interface IVMRImagePresenterConfig9
: IUnknown
336 HRESULT SetRenderingPrefs
([in] DWORD renderflags
);
337 HRESULT GetRenderingPrefs
([out] DWORD
*renderflags
);
343 uuid(d0cfe38b
-93e7
-4772-8957-0400c49a4485
),
344 helpstring("IVMRMixerStreamConfig interface"),
345 pointer_default(unique)
347 interface IVMRVideoStreamControl9
: IUnknown
349 HRESULT SetStreamActiveState
([in] BOOL active
);
350 HRESULT GetStreamActiveState
([out] BOOL
*active
);
353 typedef enum _VMR9Mode
355 VMR9Mode_Windowed
= 0x1,
356 VMR9Mode_Windowless
= 0x2,
357 VMR9Mode_Renderless
= 0x4,
364 uuid(5a804648
-4f66
-4867-9c43
-4f5c822cf1b8
),
365 helpstring("IVMRFilterConfig9 interface"),
366 pointer_default(unique)
368 interface IVMRFilterConfig9
: IUnknown
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
);
382 uuid(00d96c29
-bbde
-4efc
-9901-bb5036392146
),
383 helpstring("IVMRAspectRatioControl9 interface"),
384 pointer_default(unique)
386 interface IVMRAspectRatioControl9
: IUnknown
388 HRESULT GetAspectRatioMode
([out] DWORD
*mode
);
389 HRESULT SetAspectRatioMode
([in] DWORD mode
);
392 #define VMR9DEVICENAMELEN
32
393 #define VMR9DEVICEDESCRIPTIONLEN
512
395 typedef struct _VMR9MonitorInfo
401 WCHAR szDevice
[VMR9DEVICENAMELEN
];
402 WCHAR szDescription
[VMR9DEVICEDESCRIPTIONLEN
];
403 LARGE_INTEGER liDriverVersion
;
413 uuid(46c2e457
-8ba0
-4eef
-b80b
-0680f0978749
),
414 helpstring("IVMRMonitorConfig9 interface"),
415 pointer_default(unique)
417 interface IVMRMonitorConfig9
: IUnknown
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
);
426 typedef enum _VMR9DeinterlacePrefs
428 DeinterlacePref9_NextBest
= 0x1,
429 DeinterlacePref9_BOB
= 0x2,
430 DeinterlacePref9_Weave
= 0x4,
431 DeinterlacePref9_Mask
= 0x7
432 } VMR9DeinterlacePrefs
;
434 typedef enum _VMR9DeinterlaceTech
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
;
446 typedef struct _VMR9Frequency
452 typedef enum _VMR9_SampleFormat
454 VMR9_SampleReserved
= 1,
455 VMR9_SampleProgressiveFrame
= 2,
456 VMR9_SampleFieldInterleavedEvenFirst
= 3,
457 VMR9_SampleFieldInterleavedOddFirst
= 4,
458 VMR9_SampleFieldSingleEven
= 5,
459 VMR9_SampleFieldSingleOdd
= 6,
462 typedef struct _VMR9VideoDesc
466 DWORD dwSampleHeight
;
467 VMR9_SampleFormat SampleFormat
;
469 VMR9Frequency InputSampleFreq
;
470 VMR9Frequency OutputFrameFreq
;
473 typedef struct _VMR9DeinterlaceCaps
{
475 DWORD dwNumPreviousOutputFrames
;
476 DWORD dwNumForwardRefSamples
;
477 DWORD dwNumBackwardRefSamples
;
478 VMR9DeinterlaceTech DeinterlaceTechnology
;
479 } VMR9DeinterlaceCaps
;
484 uuid(a215fb8d
-13c2
-4f7f
-993c
-003d6271a459
),
485 helpstring("IVMRDeinterlaceControl9 interface"),
486 pointer_default(unique)
488 interface IVMRDeinterlaceControl9
: IUnknown
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
);
499 typedef struct _VMR9VideoStreamInfo
{
500 IDirect3DSurface9
*pddsVideoSurface
;
505 VMR9NormalizedRect rNormal
;
506 REFERENCE_TIME rtStart
;
507 REFERENCE_TIME rtEnd
;
508 VMR9_SampleFormat SampleFormat
;
509 } VMR9VideoStreamInfo
;
514 uuid(4a5c89eb
-df51
-4654-ac2a
-e48e02bbabf6
),
515 helpstring("IVMRImageCompositor9 interface"),
516 pointer_default(unique)
518 interface IVMRImageCompositor9
: IUnknown
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
);