Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1072 lines
30 KiB

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Public Interfaces for the Video Mixing Renderer DShow filter
  4. //
  5. // Copyright (c) 1999 - 2002, Microsoft Corporation. All rights reserved.
  6. ///////////////////////////////////////////////////////////////////////////////
  7. cpp_quote("#if 0")
  8. // This is temporary work around to persuade
  9. // MIDL to allow forward declarations.
  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. cpp_quote("#include <ddraw.h>")
  18. // public interfaces supported by the VMR
  19. interface IVMRSurface;
  20. interface IVMRSurfaceAllocator;
  21. interface IVMRSurfaceAllocatorNotify;
  22. interface IVMRImagePresenter;
  23. interface IVMRImagePresenterConfig;
  24. interface IVMRWindowlessControl;
  25. interface IVMRMixerControl;
  26. interface IVMRMixerBitmap;
  27. interface IVMRFilterConfig;
  28. interface IVMRAspectRatioControl;
  29. interface IVMRDeinterlaceControl;
  30. interface IVMRMonitorConfig;
  31. interface IVMRImageCompositor;
  32. interface IVMRVideoStreamControl;
  33. ///////////////////////////////////////////////////////////////////////////////
  34. //
  35. // Allocator Presenter interfaces
  36. //
  37. ///////////////////////////////////////////////////////////////////////////////
  38. //=====================================================================
  39. //
  40. // IVMRImagePresenter
  41. //
  42. //=====================================================================
  43. typedef enum {
  44. VMRSample_SyncPoint = 0x00000001,
  45. VMRSample_Preroll = 0x00000002,
  46. VMRSample_Discontinuity = 0x00000004,
  47. VMRSample_TimeValid = 0x00000008,
  48. } VMRPresentationFlags;
  49. typedef struct tagVMRPRESENTATIONINFO {
  50. DWORD dwFlags;
  51. LPDIRECTDRAWSURFACE7 lpSurf;
  52. REFERENCE_TIME rtStart;
  53. REFERENCE_TIME rtEnd;
  54. SIZE szAspectRatio;
  55. RECT rcSrc;
  56. RECT rcDst;
  57. DWORD dwTypeSpecificFlags;
  58. DWORD dwInterlaceFlags;
  59. } VMRPRESENTATIONINFO;
  60. [
  61. local,
  62. object,
  63. local,
  64. uuid(CE704FE7-E71E-41fb-BAA2-C4403E1182F5),
  65. helpstring("IVMRImagePresenter Interface"),
  66. pointer_default(unique)
  67. ]
  68. interface IVMRImagePresenter : IUnknown
  69. {
  70. HRESULT StartPresenting(
  71. [in] DWORD_PTR dwUserID
  72. );
  73. HRESULT StopPresenting(
  74. [in] DWORD_PTR dwUserID
  75. );
  76. HRESULT PresentImage(
  77. [in] DWORD_PTR dwUserID,
  78. [in] VMRPRESENTATIONINFO* lpPresInfo
  79. );
  80. };
  81. //=====================================================================
  82. //
  83. // IVMRSurfaceAllocator
  84. //
  85. //=====================================================================
  86. typedef enum {
  87. AMAP_PIXELFORMAT_VALID = 0x01,
  88. AMAP_3D_TARGET = 0x02,
  89. AMAP_ALLOW_SYSMEM = 0x04,
  90. AMAP_FORCE_SYSMEM = 0x08,
  91. AMAP_DIRECTED_FLIP = 0x10,
  92. AMAP_DXVA_TARGET = 0x20
  93. } VMRSurfaceAllocationFlags;
  94. typedef struct tagVMRALLOCATIONINFO {
  95. DWORD dwFlags;
  96. LPBITMAPINFOHEADER lpHdr;
  97. LPDDPIXELFORMAT lpPixFmt;
  98. SIZE szAspectRatio;
  99. DWORD dwMinBuffers;
  100. DWORD dwMaxBuffers;
  101. DWORD dwInterlaceFlags;
  102. SIZE szNativeSize;
  103. } VMRALLOCATIONINFO;
  104. [
  105. local,
  106. object,
  107. local,
  108. uuid(31ce832e-4484-458b-8cca-f4d7e3db0b52),
  109. helpstring("IVMRSurfaceAllocator Interface"),
  110. pointer_default(unique)
  111. ]
  112. interface IVMRSurfaceAllocator : IUnknown
  113. {
  114. HRESULT AllocateSurface(
  115. [in] DWORD_PTR dwUserID,
  116. [in] VMRALLOCATIONINFO* lpAllocInfo,
  117. [in] [out] DWORD* lpdwActualBuffers,
  118. [out] LPDIRECTDRAWSURFACE7 *lplpSurface
  119. );
  120. HRESULT FreeSurface(
  121. [in] DWORD_PTR dwID
  122. );
  123. HRESULT PrepareSurface(
  124. [in] DWORD_PTR dwUserID,
  125. [in] LPDIRECTDRAWSURFACE7 lpSurface,
  126. [in] DWORD dwSurfaceFlags
  127. );
  128. HRESULT AdviseNotify(
  129. [in] IVMRSurfaceAllocatorNotify* lpIVMRSurfAllocNotify
  130. );
  131. };
  132. //=====================================================================
  133. //
  134. // IVMRSurfaceAllocatorNotify
  135. //
  136. //=====================================================================
  137. [
  138. local,
  139. object,
  140. local,
  141. uuid(aada05a8-5a4e-4729-af0b-cea27aed51e2),
  142. helpstring("IVMRSurfaceAllocatorNotify Interface"),
  143. pointer_default(unique)
  144. ]
  145. interface IVMRSurfaceAllocatorNotify : IUnknown
  146. {
  147. HRESULT AdviseSurfaceAllocator(
  148. [in] DWORD_PTR dwUserID,
  149. [in] IVMRSurfaceAllocator* lpIVRMSurfaceAllocator
  150. );
  151. HRESULT SetDDrawDevice(
  152. [in] LPDIRECTDRAW7 lpDDrawDevice,
  153. [in] HMONITOR hMonitor
  154. );
  155. HRESULT ChangeDDrawDevice(
  156. [in] LPDIRECTDRAW7 lpDDrawDevice,
  157. [in] HMONITOR hMonitor
  158. );
  159. HRESULT RestoreDDrawSurfaces();
  160. HRESULT NotifyEvent(
  161. [in] LONG EventCode,
  162. [in] LONG_PTR Param1,
  163. [in] LONG_PTR Param2
  164. );
  165. HRESULT SetBorderColor(
  166. [in] COLORREF clrBorder
  167. );
  168. };
  169. ///////////////////////////////////////////////////////////////////////////////
  170. //
  171. // Application control and configuration interfaces
  172. //
  173. ///////////////////////////////////////////////////////////////////////////////
  174. //=====================================================================
  175. //
  176. // IVMRWindowlessControl
  177. //
  178. //=====================================================================
  179. typedef enum {
  180. VMR_ARMODE_NONE,
  181. VMR_ARMODE_LETTER_BOX
  182. } VMR_ASPECT_RATIO_MODE;
  183. [
  184. local,
  185. object,
  186. local,
  187. uuid(0eb1088c-4dcd-46f0-878f-39dae86a51b7),
  188. helpstring("IVMRWindowlessControl Interface"),
  189. pointer_default(unique)
  190. ]
  191. interface IVMRWindowlessControl : IUnknown
  192. {
  193. //
  194. //////////////////////////////////////////////////////////
  195. // Video size and position information
  196. //////////////////////////////////////////////////////////
  197. //
  198. HRESULT GetNativeVideoSize(
  199. [out] LONG* lpWidth,
  200. [out] LONG* lpHeight,
  201. [out] LONG* lpARWidth,
  202. [out] LONG* lpARHeight
  203. );
  204. HRESULT GetMinIdealVideoSize(
  205. [out] LONG* lpWidth,
  206. [out] LONG* lpHeight
  207. );
  208. HRESULT GetMaxIdealVideoSize(
  209. [out] LONG* lpWidth,
  210. [out] LONG* lpHeight
  211. );
  212. HRESULT SetVideoPosition(
  213. [in] const LPRECT lpSRCRect,
  214. [in] const LPRECT lpDSTRect
  215. );
  216. HRESULT GetVideoPosition(
  217. [out] LPRECT lpSRCRect,
  218. [out] LPRECT lpDSTRect
  219. );
  220. HRESULT GetAspectRatioMode(
  221. [out] DWORD* lpAspectRatioMode
  222. );
  223. HRESULT SetAspectRatioMode(
  224. [in] DWORD AspectRatioMode
  225. );
  226. //
  227. //////////////////////////////////////////////////////////
  228. // Display and clipping management
  229. //////////////////////////////////////////////////////////
  230. //
  231. HRESULT SetVideoClippingWindow(
  232. [in] HWND hwnd
  233. );
  234. HRESULT RepaintVideo(
  235. [in] HWND hwnd,
  236. [in] HDC hdc
  237. );
  238. HRESULT DisplayModeChanged();
  239. //
  240. //////////////////////////////////////////////////////////
  241. // GetCurrentImage
  242. //
  243. // Returns the current image being displayed. This images
  244. // is returned in the form of packed Windows DIB.
  245. //
  246. // GetCurrentImage can be called at any time, also
  247. // the caller is responsible for free the returned memory
  248. // by calling CoTaskMemFree.
  249. //
  250. // Excessive use of this function will degrade video
  251. // playback performed.
  252. //////////////////////////////////////////////////////////
  253. //
  254. HRESULT GetCurrentImage(
  255. [out] BYTE** lpDib
  256. );
  257. //
  258. //////////////////////////////////////////////////////////
  259. // Border Color control
  260. //
  261. // The border color is color used to fill any area of the
  262. // the destination rectangle that does not contain video.
  263. // It is typically used in two instances. When the video
  264. // straddles two monitors and when the VMR is trying
  265. // to maintain the aspect ratio of the movies by letter
  266. // boxing the video to fit within the specified destination
  267. // rectangle. See SetAspectRatioMode above.
  268. //////////////////////////////////////////////////////////
  269. //
  270. HRESULT SetBorderColor(
  271. [in] COLORREF Clr
  272. );
  273. HRESULT GetBorderColor(
  274. [out] COLORREF* lpClr
  275. );
  276. //
  277. //////////////////////////////////////////////////////////
  278. // Color key control only meaningful when the VMR is using
  279. // and overlay
  280. //////////////////////////////////////////////////////////
  281. //
  282. HRESULT SetColorKey(
  283. [in] COLORREF Clr
  284. );
  285. HRESULT GetColorKey(
  286. [out] COLORREF* lpClr
  287. );
  288. };
  289. //=====================================================================
  290. //
  291. // IVMRMixerControl
  292. //
  293. //=====================================================================
  294. typedef enum {
  295. MixerPref_NoDecimation = 0x00000001, // No decimation - full size
  296. MixerPref_DecimateOutput = 0x00000002, // decimate output by 2 in x & y
  297. MixerPref_DecimateMask = 0x0000000F,
  298. MixerPref_BiLinearFiltering = 0x00000010, // use bi-linear filtering
  299. MixerPref_PointFiltering = 0x00000020, // use point filtering
  300. MixerPref_FilteringMask = 0x000000F0, // OR of all above flags
  301. MixerPref_RenderTargetRGB = 0x00000100,
  302. MixerPref_RenderTargetYUV420 = 0x00000200,
  303. MixerPref_RenderTargetYUV422 = 0x00000400,
  304. MixerPref_RenderTargetYUV444 = 0x00000800, // AYUV render target.
  305. MixerPref_RenderTargetReserved = 0x0000F000, // 4 bits reserved for future use.
  306. MixerPref_RenderTargetMask = 0x0000FF00, // OR of all above flags
  307. } VMRMixerPrefs;
  308. //
  309. // Normalized relative rectangle
  310. // Coordinate ranges: x=[0...1) y=[0...1)
  311. // Where the output window goes from 0,0 (closed inclusive lower bound)
  312. // to 1,1 (open exclusive upper bound)
  313. //
  314. typedef struct _NORMALIZEDRECT
  315. {
  316. float left;
  317. float top;
  318. float right;
  319. float bottom;
  320. } NORMALIZEDRECT, *PNORMALIZEDRECT;
  321. [
  322. local,
  323. object,
  324. local,
  325. uuid(1c1a17b0-bed0-415d-974b-dc6696131599),
  326. helpstring("IVMRMixerControl Interface"),
  327. pointer_default(unique)
  328. ]
  329. interface IVMRMixerControl : IUnknown
  330. {
  331. HRESULT SetAlpha(
  332. [in] DWORD dwStreamID,
  333. [in] float Alpha // Source alpha premultication factor (global alpha for source)
  334. );
  335. HRESULT GetAlpha(
  336. [in] DWORD dwStreamID,
  337. [out] float* pAlpha
  338. );
  339. HRESULT SetZOrder(
  340. [in] DWORD dwStreamID,
  341. [in] DWORD dwZ
  342. );
  343. HRESULT GetZOrder(
  344. [in] DWORD dwStreamID,
  345. [out] DWORD* pZ
  346. );
  347. HRESULT SetOutputRect(
  348. [in] DWORD dwStreamID,
  349. [in] const NORMALIZEDRECT *pRect
  350. );
  351. HRESULT GetOutputRect(
  352. [in] DWORD dwStreamID,
  353. [out] NORMALIZEDRECT *pRect
  354. );
  355. HRESULT SetBackgroundClr(
  356. [in] COLORREF ClrBkg
  357. );
  358. HRESULT GetBackgroundClr(
  359. [in] COLORREF* lpClrBkg
  360. );
  361. HRESULT SetMixingPrefs(
  362. [in] DWORD dwMixerPrefs // a combination of VMRMixingPrefFlags
  363. );
  364. HRESULT GetMixingPrefs(
  365. [out] DWORD* pdwMixerPrefs
  366. );
  367. };
  368. ///////////////////////////////////////////////////////////////////////////////
  369. //
  370. // VMR Multimon configuration interface
  371. //
  372. ///////////////////////////////////////////////////////////////////////////////
  373. typedef struct tagVMRGUID {
  374. GUID* pGUID; // is NULL if the default DDraw device
  375. GUID GUID; // otherwise points to this GUID
  376. } VMRGUID;
  377. #define VMRDEVICENAMELEN 32
  378. #define VMRDEVICEDESCRIPTIONLEN 256
  379. typedef struct tagVMRMONITORINFO {
  380. VMRGUID guid;
  381. RECT rcMonitor;
  382. HMONITOR hMon;
  383. DWORD dwFlags; // described in MONITORINFOEX, currently only MONITORINFOF_PRIMARY
  384. wchar_t szDevice[VMRDEVICENAMELEN];
  385. wchar_t szDescription[VMRDEVICEDESCRIPTIONLEN];
  386. LARGE_INTEGER liDriverVersion;
  387. DWORD dwVendorId;
  388. DWORD dwDeviceId;
  389. DWORD dwSubSysId;
  390. DWORD dwRevision;
  391. // find out the DDCAPS using DDrawCreate on the monitor GUID
  392. } VMRMONITORINFO;
  393. [
  394. object,
  395. local,
  396. uuid(9cf0b1b6-fbaa-4b7f-88cf-cf1f130a0dce),
  397. helpstring("IVMRMonitorConfig Interface"),
  398. pointer_default(unique)
  399. ]
  400. interface IVMRMonitorConfig : IUnknown
  401. {
  402. // Use this method on a Multi-Monitor system to specify to the
  403. // mixer filter which Direct Draw driver should be used when connecting
  404. // to an upstream decoder filter.
  405. //
  406. HRESULT SetMonitor(
  407. [in] const VMRGUID *pGUID
  408. );
  409. // Use this method to determine the direct draw object that will be used when
  410. // connecting the mixer filter to an upstream decoder filter.
  411. //
  412. HRESULT GetMonitor(
  413. [out] VMRGUID *pGUID
  414. );
  415. // Use this method on a multi-monitor system to specify to the
  416. // mixer filter the default Direct Draw device to use when
  417. // connecting to an upstream filter. The default direct draw device
  418. // can be overriden for a particular connection by SetMonitor method
  419. // described above.
  420. //
  421. HRESULT SetDefaultMonitor(
  422. [in] const VMRGUID *pGUID
  423. );
  424. // Use this method on a multi-monitor system to determine which
  425. // is the default direct draw device the overlay mixer filter
  426. // will use when connecting to an upstream filter.
  427. //
  428. HRESULT GetDefaultMonitor(
  429. [out] VMRGUID *pGUID
  430. );
  431. // Use this method to get a list of Direct Draw device GUIDs and thier
  432. // associated monitor information that the mixer can use when
  433. // connecting to an upstream decoder filter. Passing down a NULL pInfo
  434. // parameter allows the app to determine the required array size (returned
  435. // in pdwNumDevices). Otherwise, dwNumDevices returns the actual
  436. // number of devices retrieved.
  437. //
  438. HRESULT GetAvailableMonitors(
  439. [out, size_is(dwMaxInfoArraySize)] VMRMONITORINFO* pInfo,
  440. [in] DWORD dwMaxInfoArraySize, // in array members
  441. [out] DWORD* pdwNumDevices // actual number of devices retrieved
  442. );
  443. };
  444. ///////////////////////////////////////////////////////////////////////////////
  445. //
  446. // VMR Filter configuration interfaces
  447. //
  448. ///////////////////////////////////////////////////////////////////////////////
  449. typedef enum {
  450. RenderPrefs_ForceOffscreen = 0x00000001,
  451. RenderPrefs_ForceOverlays = 0x00000002, // fail if no overlays
  452. RenderPrefs_AllowOverlays = 0x00000000, // overlay used by default
  453. RenderPrefs_AllowOffscreen = 0x00000000, // offscreen used if no overlay
  454. RenderPrefs_DoNotRenderColorKeyAndBorder = 0x00000008, // app paints color keys
  455. RenderPrefs_RestrictToInitialMonitor = 0x00000010, // output only to initial monitor
  456. RenderPrefs_PreferAGPMemWhenMixing = 0x00000020, // try agp mem when allocating textures
  457. RenderPrefs_Mask = 0x0000003f, // OR of all above flags
  458. } VMRRenderPrefs;
  459. typedef enum {
  460. VMRMode_Windowed = 0x00000001,
  461. VMRMode_Windowless = 0x00000002,
  462. VMRMode_Renderless = 0x00000004,
  463. // not a valid value to pass to SetRenderMode
  464. VMRMode_Mask = 0x00000007, // OR of all above flags
  465. } VMRMode;
  466. enum {
  467. MAX_NUMBER_OF_STREAMS = 16
  468. };
  469. [
  470. object,
  471. local,
  472. uuid(9e5530c5-7034-48b4-bb46-0b8a6efc8e36),
  473. helpstring("IVMRFilterConfig Interface"),
  474. pointer_default(unique)
  475. ]
  476. interface IVMRFilterConfig : IUnknown
  477. {
  478. HRESULT SetImageCompositor(
  479. [in] IVMRImageCompositor* lpVMRImgCompositor
  480. );
  481. HRESULT SetNumberOfStreams(
  482. [in] DWORD dwMaxStreams
  483. );
  484. HRESULT GetNumberOfStreams(
  485. [out] DWORD* pdwMaxStreams
  486. );
  487. HRESULT SetRenderingPrefs(
  488. [in] DWORD dwRenderFlags // a combination of VMRRenderingPrefFlags
  489. );
  490. HRESULT GetRenderingPrefs(
  491. [out] DWORD* pdwRenderFlags
  492. );
  493. HRESULT SetRenderingMode(
  494. [in] DWORD Mode // a combination of VMRMode
  495. );
  496. HRESULT GetRenderingMode(
  497. [out] DWORD* pMode
  498. );
  499. }
  500. //=====================================================================
  501. //
  502. // IVMRAspectRatioControl
  503. //
  504. //=====================================================================
  505. [
  506. object,
  507. local,
  508. uuid(ede80b5c-bad6-4623-b537-65586c9f8dfd),
  509. helpstring("IVMRAspectRatioControl Interface"),
  510. pointer_default(unique)
  511. ]
  512. interface IVMRAspectRatioControl : IUnknown
  513. {
  514. HRESULT GetAspectRatioMode(
  515. [out] LPDWORD lpdwARMode
  516. );
  517. HRESULT SetAspectRatioMode(
  518. [in] DWORD dwARMode
  519. );
  520. }
  521. //=====================================================================
  522. //
  523. // IVMRDeinterlaceControl
  524. //
  525. // New interfaced introduced into the WindowsXP SP1 release of the VMR.
  526. // This interface allows applications to control the DX-VA deinterlacing
  527. // support provided by the VMR.
  528. //
  529. // The VMR needs to be set into "mixing" mode for this interface to work.
  530. //
  531. // SetDeinterlaceMode is only effective for new connections made to the
  532. // VMR. It should be noted that the graphics device driver may refuse
  533. // to use the specified deinterlace mode, in which case 3 fallback
  534. // policies are offered by the VMR, these being:
  535. //
  536. // 1. Fallback to the next best mode offered by the driver.
  537. // 2. Fallback to the BOB deinterlace mode.
  538. // 3. Fallback to the WEAVE deinterlace mode (ie. turn deinterlacing off).
  539. //
  540. //=====================================================================
  541. typedef enum {
  542. DeinterlacePref_NextBest = 0x01,
  543. DeinterlacePref_BOB = 0x02,
  544. DeinterlacePref_Weave = 0x04,
  545. DeinterlacePref_Mask = 0x07
  546. } VMRDeinterlacePrefs;
  547. typedef enum {
  548. // the algorithm is unknown or proprietary
  549. DeinterlaceTech_Unknown = 0x0000,
  550. // the algorithm creates the missing lines by repeating
  551. // the line either above or below it - this method will look very jaggy and
  552. // isn't recommended
  553. DeinterlaceTech_BOBLineReplicate = 0x0001,
  554. // the algorithm creates the missing lines by vertically stretching each
  555. // video field by a factor of two, for example by averaging two lines or
  556. // using a [-1, 9, 9, -1]/16 filter across four lines.
  557. // Slight vertical adjustments are made to ensure that the resulting image
  558. // does not "bob" up and down.
  559. DeinterlaceTech_BOBVerticalStretch = 0x0002,
  560. // the pixels in the missing line are recreated by a median filtering operation
  561. DeinterlaceTech_MedianFiltering = 0x0004,
  562. // the pixels in the missing line are recreated by an edge filter.
  563. // In this process, spatial directional filters are applied to determine
  564. // the orientation of edges in the picture content, and missing
  565. // pixels are created by filtering along (rather than across) the
  566. // detected edges.
  567. DeinterlaceTech_EdgeFiltering = 0x0010,
  568. // the pixels in the missing line are recreated by switching on a field by
  569. // field basis between using either spatial or temporal interpolation
  570. // depending on the amount of motion.
  571. DeinterlaceTech_FieldAdaptive = 0x0020,
  572. // the pixels in the missing line are recreated by switching on a pixel by pixel
  573. // basis between using either spatial or temporal interpolation depending on
  574. // the amount of motion..
  575. DeinterlaceTech_PixelAdaptive = 0x0040,
  576. // Motion Vector Steering identifies objects within a sequence of video
  577. // fields. The missing pixels are recreated after first aligning the
  578. // movement axes of the individual objects in the scene to make them
  579. // parallel with the time axis.
  580. DeinterlaceTech_MotionVectorSteered = 0x0080
  581. } VMRDeinterlaceTech;
  582. typedef struct _VMRFrequency {
  583. DWORD dwNumerator;
  584. DWORD dwDenominator;
  585. } VMRFrequency;
  586. typedef struct _VMRVideoDesc {
  587. DWORD dwSize;
  588. DWORD dwSampleWidth;
  589. DWORD dwSampleHeight;
  590. BOOL SingleFieldPerSample;
  591. DWORD dwFourCC;
  592. VMRFrequency InputSampleFreq;
  593. VMRFrequency OutputFrameFreq;
  594. } VMRVideoDesc;
  595. typedef struct _VMRDeinterlaceCaps {
  596. DWORD dwSize;
  597. DWORD dwNumPreviousOutputFrames;
  598. DWORD dwNumForwardRefSamples;
  599. DWORD dwNumBackwardRefSamples;
  600. VMRDeinterlaceTech DeinterlaceTechnology;
  601. } VMRDeinterlaceCaps;
  602. [
  603. object,
  604. local,
  605. uuid(bb057577-0db8-4e6a-87a7-1a8c9a505a0f),
  606. helpstring("IVMRDeinterlaceControl Interface"),
  607. pointer_default(unique)
  608. ]
  609. interface IVMRDeinterlaceControl : IUnknown
  610. {
  611. //
  612. // For the specified video description returns the
  613. // number of deinterlacing modes available to the VMR.
  614. // The deinterlacing modes are returned in descending
  615. // quality order ie. the best quality mode is at
  616. // lpdwNumDeinterlaceModes[0], the next best at
  617. // lpdwNumDeinterlaceModes[1] and so on.
  618. //
  619. // To determine how big an array of guids to pass to the
  620. // GetNumberOfDeinterlaceModes method call
  621. // GetNumberOfDeinterlaceModes(lpVideoDescription, &dwNumModes, NULL);
  622. //
  623. HRESULT GetNumberOfDeinterlaceModes(
  624. [in] VMRVideoDesc* lpVideoDescription,
  625. [in] [out] LPDWORD lpdwNumDeinterlaceModes,
  626. [out] LPGUID lpDeinterlaceModes
  627. );
  628. //
  629. // For the given video description get the capabilities of the
  630. // specified de-interlace mode.
  631. //
  632. HRESULT GetDeinterlaceModeCaps(
  633. [in] LPGUID lpDeinterlaceMode,
  634. [in] VMRVideoDesc* lpVideoDescription,
  635. [out] VMRDeinterlaceCaps* lpDeinterlaceCaps
  636. );
  637. //
  638. // Get/Set the deinterlace mode that you would like the
  639. // VMR to use when de-interlacing the specified stream.
  640. // It should be noted that the VMR may not actually be able
  641. // to use the requested deinterlace mode, in which case the
  642. // the VMR will fall back to other de-interlace modes as specified
  643. // by the de-interlace preferences (see SetDeinterlacePrefs below).
  644. //
  645. HRESULT GetDeinterlaceMode(
  646. [in] DWORD dwStreamID,
  647. [out] LPGUID lpDeinterlaceMode // returns S_FALSE and GUID_NULL if
  648. ); // SetDeinterlaceMode has not been called yet.
  649. HRESULT SetDeinterlaceMode(
  650. [in] DWORD dwStreamID, // use 0xFFFFFFFF to set mode for all streams
  651. [in] LPGUID lpDeinterlaceMode // GUID_NULL == turn deinterlacing off
  652. );
  653. HRESULT GetDeinterlacePrefs(
  654. [out] LPDWORD lpdwDeinterlacePrefs
  655. );
  656. HRESULT SetDeinterlacePrefs(
  657. [in] DWORD dwDeinterlacePrefs
  658. );
  659. //
  660. // Get the DeinterlaceMode currently in use for the specified
  661. // video stream (ie. pin). The returned GUID will be NULL if
  662. // the de-interlacing h/w has not been created by the VMR at the
  663. // time the function is called, or if the VMR determines that
  664. // this stream should not or can be de-interlaced.
  665. //
  666. HRESULT GetActualDeinterlaceMode(
  667. [in] DWORD dwStreamID,
  668. [out] LPGUID lpDeinterlaceMode
  669. );
  670. }
  671. //=====================================================================
  672. //
  673. // IVMRMixerBitmap
  674. //
  675. //=====================================================================
  676. typedef struct _VMRALPHABITMAP
  677. {
  678. DWORD dwFlags; // flags word
  679. HDC hdc; // DC for the bitmap to copy
  680. LPDIRECTDRAWSURFACE7 pDDS; // DirectDraw surface to copy
  681. RECT rSrc; // rectangle to copy from the DC/DDS
  682. NORMALIZEDRECT rDest; // output rectangle in composition space
  683. FLOAT fAlpha; // opacity of the bitmap
  684. COLORREF clrSrcKey; // src color key
  685. } VMRALPHABITMAP, *PVMRALPHABITMAP;
  686. // Disable the alpha bitmap for now
  687. cpp_quote("#define VMRBITMAP_DISABLE 0x00000001")
  688. // Take the bitmap from the HDC rather than the DirectDraw surface
  689. cpp_quote("#define VMRBITMAP_HDC 0x00000002")
  690. // Take the entire DDraw surface - rSrc is ignored
  691. cpp_quote("#define VMRBITMAP_ENTIREDDS 0x00000004")
  692. // Indicates that the clrTrans value is valid and should be
  693. // used when blending
  694. cpp_quote("#define VMRBITMAP_SRCCOLORKEY 0x00000008")
  695. // Indicates that the rSrc rectangle is valid and specifies a
  696. // sub-rectangle of the of original app image to be blended.
  697. // Use of this parameter enables "Image Strips"
  698. cpp_quote("#define VMRBITMAP_SRCRECT 0x00000010")
  699. [
  700. object,
  701. local,
  702. uuid(1E673275-0257-40aa-AF20-7C608D4A0428),
  703. helpstring("IVMRMixerBitmap Interface"),
  704. pointer_default(unique)
  705. ]
  706. interface IVMRMixerBitmap : IUnknown
  707. {
  708. // Set bitmap, location to blend it, and blending value
  709. HRESULT SetAlphaBitmap(
  710. [in] const VMRALPHABITMAP *pBmpParms
  711. );
  712. // Change bitmap location, size and blending value,
  713. // graph must be running for change to take effect.
  714. HRESULT UpdateAlphaBitmapParameters(
  715. [in] PVMRALPHABITMAP pBmpParms
  716. );
  717. // Get bitmap, location to blend it, and blending value
  718. HRESULT GetAlphaBitmapParameters(
  719. [out] PVMRALPHABITMAP pBmpParms
  720. );
  721. };
  722. //=====================================================================
  723. //
  724. // IVMRImageCompositor
  725. //
  726. //=====================================================================
  727. typedef struct _VMRVIDEOSTREAMINFO {
  728. LPDIRECTDRAWSURFACE7 pddsVideoSurface;
  729. DWORD dwWidth, dwHeight;
  730. DWORD dwStrmID;
  731. FLOAT fAlpha;
  732. DDCOLORKEY ddClrKey;
  733. NORMALIZEDRECT rNormal;
  734. } VMRVIDEOSTREAMINFO;
  735. [
  736. local,
  737. object,
  738. local,
  739. uuid(7a4fb5af-479f-4074-bb40-ce6722e43c82),
  740. helpstring("IVMRImageCompositor Interface"),
  741. pointer_default(unique)
  742. ]
  743. interface IVMRImageCompositor : IUnknown
  744. {
  745. HRESULT InitCompositionTarget(
  746. [in] IUnknown* pD3DDevice,
  747. [in] LPDIRECTDRAWSURFACE7 pddsRenderTarget
  748. );
  749. HRESULT TermCompositionTarget(
  750. [in] IUnknown* pD3DDevice,
  751. [in] LPDIRECTDRAWSURFACE7 pddsRenderTarget
  752. );
  753. HRESULT SetStreamMediaType(
  754. [in] DWORD dwStrmID,
  755. [in] AM_MEDIA_TYPE* pmt,
  756. [in] BOOL fTexture
  757. );
  758. HRESULT CompositeImage(
  759. [in] IUnknown* pD3DDevice,
  760. [in] LPDIRECTDRAWSURFACE7 pddsRenderTarget,
  761. [in] AM_MEDIA_TYPE* pmtRenderTarget,
  762. [in] REFERENCE_TIME rtStart,
  763. [in] REFERENCE_TIME rtEnd,
  764. [in] DWORD dwClrBkGnd,
  765. [in] VMRVIDEOSTREAMINFO* pVideoStreamInfo,
  766. [in] UINT cStreams
  767. );
  768. };
  769. //=====================================================================
  770. //
  771. // IVMRVideoStreamControl
  772. //
  773. //=====================================================================
  774. [
  775. object,
  776. local,
  777. uuid(058d1f11-2a54-4bef-bd54-df706626b727),
  778. helpstring("IVMRMixerStreamConfig Interface"),
  779. pointer_default(unique)
  780. ]
  781. interface IVMRVideoStreamControl: IUnknown
  782. {
  783. HRESULT SetColorKey(
  784. [in] LPDDCOLORKEY lpClrKey // Source color key, set to 0xFFFFFFFF to disable
  785. );
  786. HRESULT GetColorKey(
  787. [out] LPDDCOLORKEY lpClrKey
  788. );
  789. HRESULT SetStreamActiveState(
  790. [in] BOOL fActive
  791. );
  792. HRESULT GetStreamActiveState(
  793. [out] BOOL* lpfActive
  794. );
  795. };
  796. //=====================================================================
  797. //
  798. // IVMRSurface
  799. //
  800. //=====================================================================
  801. [
  802. local,
  803. object,
  804. local,
  805. uuid(a9849bbe-9ec8-4263-b764-62730f0d15d0),
  806. helpstring("IVMRSurface Interface"),
  807. pointer_default(unique)
  808. ]
  809. interface IVMRSurface : IUnknown
  810. {
  811. HRESULT IsSurfaceLocked();
  812. HRESULT LockSurface(
  813. [out] BYTE** lpSurface
  814. );
  815. HRESULT UnlockSurface();
  816. HRESULT GetSurface(
  817. [out] LPDIRECTDRAWSURFACE7 *lplpSurface
  818. );
  819. };
  820. //=====================================================================
  821. //
  822. // IID_IVMRImagePresenterConfig - this interface allows applications
  823. // to configure the default Microsoft provided allocator-presenter
  824. // inorder to simplify the implementation of their own
  825. // allocator-presenter plug-in.
  826. //
  827. //=====================================================================
  828. [
  829. local,
  830. object,
  831. local,
  832. uuid(9f3a1c85-8555-49ba-935f-be5b5b29d178),
  833. helpstring("IVMRImagePresenterConfig Interface"),
  834. pointer_default(unique)
  835. ]
  836. interface IVMRImagePresenterConfig : IUnknown
  837. {
  838. HRESULT SetRenderingPrefs(
  839. [in] DWORD dwRenderFlags // see VMRRenderPrefs for valid flags
  840. );
  841. HRESULT GetRenderingPrefs(
  842. [out] DWORD* dwRenderFlags // see VMRRenderPrefs for valid flags
  843. );
  844. }
  845. //=====================================================================
  846. //
  847. // IID_IVMRImagePresenterExclModeConfig - this interface allows applications
  848. // to configure the DDraw exclusive mode allocator-presenter. This
  849. // interface extends the IVMRImagePresenterConfig interface defined
  850. // above and is only implemented by the CLSID_AllocPresenterDDXclMode
  851. // allocator-presenter object.
  852. //
  853. //=====================================================================
  854. [
  855. local,
  856. object,
  857. local,
  858. uuid(e6f7ce40-4673-44f1-8f77-5499d68cb4ea),
  859. helpstring("IVMRImagePresenterExclModeConfig Interface"),
  860. pointer_default(unique)
  861. ]
  862. interface IVMRImagePresenterExclModeConfig : IVMRImagePresenterConfig
  863. {
  864. HRESULT SetXlcModeDDObjAndPrimarySurface(
  865. [in] LPDIRECTDRAW7 lpDDObj,
  866. [in] LPDIRECTDRAWSURFACE7 lpPrimarySurf
  867. );
  868. HRESULT GetXlcModeDDObjAndPrimarySurface(
  869. [out] LPDIRECTDRAW7* lpDDObj,
  870. [out] LPDIRECTDRAWSURFACE7* lpPrimarySurf
  871. );
  872. }
  873. //=====================================================================
  874. //
  875. // IVPManager
  876. //
  877. //=====================================================================
  878. [
  879. local,
  880. object,
  881. local,
  882. uuid(aac18c18-e186-46d2-825d-a1f8dc8e395a),
  883. helpstring("IVPManager Interface"),
  884. pointer_default(unique)
  885. ]
  886. interface IVPManager : IUnknown
  887. {
  888. // Use this method on a Multi-Monitor system to specify to the
  889. // video port manager filter which videoport index is used
  890. // to an upstream decoder filter.
  891. //
  892. HRESULT SetVideoPortIndex(
  893. [in] DWORD dwVideoPortIndex // the video port number that this is connected to
  894. );
  895. // This method returns the current video port index being used by the VPM.
  896. //
  897. HRESULT GetVideoPortIndex(
  898. [out] DWORD* pdwVideoPortIndex // the video port number that this is connected to
  899. );
  900. };