Leaked source code of windows server 2003
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.

994 lines
33 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: dvp.h
  6. * Content: DirectDrawVideoPort include file
  7. *@@BEGIN_MSINTERNAL
  8. * History:
  9. * Date By Reason
  10. * ==== == ======
  11. * 11-jun-96 scottm initial implementation
  12. * 29-jan-97 smac Various API changes
  13. *@@END_MSINTERNAL
  14. *
  15. ***************************************************************************/
  16. #ifndef __DVP_INCLUDED__
  17. #define __DVP_INCLUDED__
  18. /*
  19. * GUIDS used by DirectDrawVideoPort objects
  20. */
  21. #if defined( _WIN32 ) && (!defined( _NO_COM ) || defined( DEFINE_GUID ))
  22. DEFINE_GUID( IID_IDDVideoPortContainer, 0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
  23. DEFINE_GUID( IID_IDirectDrawVideoPort, 0xB36D93E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
  24. DEFINE_GUID( IID_IDirectDrawVideoPortNotify, 0xA655FB94,0x0589,0x4E57,0xB3,0x33,0x56,0x7A,0x89,0x46,0x8C,0x88);
  25. DEFINE_GUID( DDVPTYPE_E_HREFH_VREFH, 0x54F39980L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
  26. DEFINE_GUID( DDVPTYPE_E_HREFH_VREFL, 0x92783220L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
  27. DEFINE_GUID( DDVPTYPE_E_HREFL_VREFH, 0xA07A02E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
  28. DEFINE_GUID( DDVPTYPE_E_HREFL_VREFL, 0xE09C77E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
  29. DEFINE_GUID( DDVPTYPE_CCIR656, 0xFCA326A0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
  30. DEFINE_GUID( DDVPTYPE_BROOKTREE, 0x1352A560L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
  31. DEFINE_GUID( DDVPTYPE_PHILIPS, 0x332CF160L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
  32. #endif
  33. #ifndef GUID_DEFS_ONLY
  34. #if defined( _WIN32 ) && !defined( _NO_COM )
  35. #define COM_NO_WINDOWS_H
  36. #include <objbase.h>
  37. #else
  38. #define IUnknown void
  39. #endif
  40. /*
  41. * These definitions are required to allow polymorphic structure members (i.e. those
  42. * that are referred to both as DWORDs and as pointers) to resolve into a type
  43. * of correct size to hold the largest of those two types (i.e. pointer) on 64 bit
  44. * systems. For 32 bit environments, ULONG_PTR resolves to a DWORD.
  45. */
  46. #ifndef MAXULONG_PTR
  47. #define ULONG_PTR DWORD
  48. #endif //MAXULONG_PTR
  49. #ifdef __cplusplus
  50. extern "C" {
  51. #endif
  52. /*============================================================================
  53. *
  54. * DirectDraw Structures
  55. *
  56. * Various structures used to invoke DirectDraw.
  57. *
  58. *==========================================================================*/
  59. struct IDirectDraw;
  60. struct IDirectDrawSurface;
  61. //@@BEGIN_MSINTERNAL
  62. #ifdef COMPOSITION
  63. struct IDirectDrawSurfaceComposition;
  64. #endif
  65. #ifdef STREAMING
  66. struct IDirectDrawSurfaceStreaming;
  67. #endif
  68. //@@END_MSINTERNAL
  69. struct IDirectDrawPalette;
  70. struct IDirectDrawClipper;
  71. typedef struct IDDVideoPortContainer FAR *LPDDVIDEOPORTCONTAINER;
  72. typedef struct IDirectDrawVideoPort FAR *LPDIRECTDRAWVIDEOPORT;
  73. typedef struct IDirectDrawVideoPortNotify FAR *LPDIRECTDRAWVIDEOPORTNOTIFY;
  74. typedef struct _DDVIDEOPORTCONNECT FAR *LPDDVIDEOPORTCONNECT;
  75. typedef struct _DDVIDEOPORTCAPS FAR *LPDDVIDEOPORTCAPS;
  76. typedef struct _DDVIDEOPORTDESC FAR *LPDDVIDEOPORTDESC;
  77. typedef struct _DDVIDEOPORTINFO FAR *LPDDVIDEOPORTINFO;
  78. typedef struct _DDVIDEOPORTBANDWIDTH FAR *LPDDVIDEOPORTBANDWIDTH;
  79. typedef struct _DDVIDEOPORTSTATUS FAR *LPDDVIDEOPORTSTATUS;
  80. typedef struct _DDVIDEOPORTNOTIFY FAR *LPDDVIDEOPORTNOTIFY;
  81. typedef struct IDDVideoPortContainerVtbl DDVIDEOPORTCONTAINERCALLBACKS;
  82. typedef struct IDirectDrawVideoPortVtbl DIRECTDRAWVIDEOPORTCALLBACKS;
  83. typedef struct IDirectDrawVideoPortNotifyVtbl DIRECTDRAWVIDEOPORTNOTIFYCALLBACKS;
  84. /*
  85. * API's
  86. */
  87. typedef HRESULT (FAR PASCAL * LPDDENUMVIDEOCALLBACK)(LPDDVIDEOPORTCAPS, LPVOID);
  88. /*
  89. * INTERACES FOLLOW:
  90. * IDirectDrawVideoPort
  91. * IVideoPort
  92. */
  93. /*
  94. * IDirectDrawVideoPortContainer
  95. */
  96. #if defined( _WIN32 ) && !defined( _NO_COM )
  97. #undef INTERFACE
  98. #define INTERFACE IDDVideoPortContainer
  99. DECLARE_INTERFACE_( IDDVideoPortContainer, IUnknown )
  100. {
  101. /*** IUnknown methods ***/
  102. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  103. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  104. STDMETHOD_(ULONG,Release) (THIS) PURE;
  105. /*** IDirectDrawVideoPort methods ***/
  106. STDMETHOD(CreateVideoPort)(THIS_ DWORD, LPDDVIDEOPORTDESC, LPDIRECTDRAWVIDEOPORT FAR *, IUnknown FAR *) PURE;
  107. STDMETHOD(EnumVideoPorts)(THIS_ DWORD, LPDDVIDEOPORTCAPS, LPVOID,LPDDENUMVIDEOCALLBACK ) PURE;
  108. STDMETHOD(GetVideoPortConnectInfo)(THIS_ DWORD, LPDWORD, LPDDVIDEOPORTCONNECT ) PURE;
  109. STDMETHOD(QueryVideoPortStatus)(THIS_ DWORD, LPDDVIDEOPORTSTATUS ) PURE;
  110. };
  111. #if !defined(__cplusplus) || defined(CINTERFACE)
  112. #define IVideoPortContainer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
  113. #define IVideoPortContainer_AddRef(p) (p)->lpVtbl->AddRef(p)
  114. #define IVideoPortContainer_Release(p) (p)->lpVtbl->Release(p)
  115. #define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->lpVtbl->CreateVideoPort(p, a, b, c, d)
  116. #define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->lpVtbl->EnumVideoPorts(p, a, b, c, d)
  117. #define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->lpVtbl->GetVideoPortConnectInfo(p, a, b, c)
  118. #define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->lpVtbl->QueryVideoPortStatus(p, a, b)
  119. #else
  120. #define IVideoPortContainer_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
  121. #define IVideoPortContainer_AddRef(p) (p)->AddRef()
  122. #define IVideoPortContainer_Release(p) (p)->Release()
  123. #define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->CreateVideoPort(a, b, c, d)
  124. #define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->EnumVideoPorts(a, b, c, d)
  125. #define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->GetVideoPortConnectInfo(a, b, c)
  126. #define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->QueryVideoPortStatus(a, b)
  127. #endif
  128. #endif
  129. /*
  130. * IDirectDrawVideoPort
  131. */
  132. #if defined( _WIN32 ) && !defined( _NO_COM )
  133. #undef INTERFACE
  134. #define INTERFACE IDirectDrawVideoPort
  135. DECLARE_INTERFACE_( IDirectDrawVideoPort, IUnknown )
  136. {
  137. /*** IUnknown methods ***/
  138. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  139. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  140. STDMETHOD_(ULONG,Release) (THIS) PURE;
  141. /*** IVideoPort methods ***/
  142. STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
  143. STDMETHOD(GetBandwidthInfo)(THIS_ LPDDPIXELFORMAT, DWORD, DWORD, DWORD, LPDDVIDEOPORTBANDWIDTH) PURE;
  144. STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
  145. STDMETHOD(GetInputFormats)(THIS_ LPDWORD, LPDDPIXELFORMAT, DWORD) PURE;
  146. STDMETHOD(GetOutputFormats)(THIS_ LPDDPIXELFORMAT, LPDWORD, LPDDPIXELFORMAT, DWORD) PURE;
  147. STDMETHOD(GetFieldPolarity)(THIS_ LPBOOL) PURE;
  148. STDMETHOD(GetVideoLine)(THIS_ LPDWORD) PURE;
  149. STDMETHOD(GetVideoSignalStatus)(THIS_ LPDWORD) PURE;
  150. STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
  151. STDMETHOD(SetTargetSurface)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
  152. STDMETHOD(StartVideo)(THIS_ LPDDVIDEOPORTINFO) PURE;
  153. STDMETHOD(StopVideo)(THIS) PURE;
  154. STDMETHOD(UpdateVideo)(THIS_ LPDDVIDEOPORTINFO) PURE;
  155. STDMETHOD(WaitForSync)(THIS_ DWORD, DWORD, DWORD) PURE;
  156. };
  157. #if !defined(__cplusplus) || defined(CINTERFACE)
  158. #define IVideoPort_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  159. #define IVideoPort_AddRef(p) (p)->lpVtbl->AddRef(p)
  160. #define IVideoPort_Release(p) (p)->lpVtbl->Release(p)
  161. #define IVideoPort_SetTargetSurface(p,a,b) (p)->lpVtbl->SetTargetSurface(p,a,b)
  162. #define IVideoPort_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b)
  163. #define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->lpVtbl->GetBandwidthInfo(p,a,b,c,d,e)
  164. #define IVideoPort_GetColorControls(p,a) (p)->lpVtbl->GetColorControls(p,a)
  165. #define IVideoPort_GetInputFormats(p,a,b,c) (p)->lpVtbl->GetInputFormats(p,a,b,c)
  166. #define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->lpVtbl->GetOutputFormats(p,a,b,c,d)
  167. #define IVideoPort_GetFieldPolarity(p,a) (p)->lpVtbl->GetFieldPolarity(p,a)
  168. #define IVideoPort_GetVideoLine(p,a) (p)->lpVtbl->GetVideoLine(p,a)
  169. #define IVideoPort_GetVideoSignalStatus(p,a) (p)->lpVtbl->GetVideoSignalStatus(p,a)
  170. #define IVideoPort_SetColorControls(p,a) (p)->lpVtbl->SetColorControls(p,a)
  171. #define IVideoPort_StartVideo(p,a) (p)->lpVtbl->StartVideo(p,a)
  172. #define IVideoPort_StopVideo(p) (p)->lpVtbl->StopVideo(p)
  173. #define IVideoPort_UpdateVideo(p,a) (p)->lpVtbl->UpdateVideo(p,a)
  174. #define IVideoPort_WaitForSync(p,a,b,c) (p)->lpVtbl->WaitForSync(p,a,b,c)
  175. #else
  176. #define IVideoPort_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  177. #define IVideoPort_AddRef(p) (p)->AddRef()
  178. #define IVideoPort_Release(p) (p)->Release()
  179. #define IVideoPort_SetTargetSurface(p,a,b) (p)->SetTargetSurface(a,b)
  180. #define IVideoPort_Flip(p,a,b) (p)->Flip(a,b)
  181. #define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->GetBandwidthInfo(a,b,c,d,e)
  182. #define IVideoPort_GetColorControls(p,a) (p)->GetColorControls(a)
  183. #define IVideoPort_GetInputFormats(p,a,b,c) (p)->GetInputFormats(a,b,c)
  184. #define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->GetOutputFormats(a,b,c,d)
  185. #define IVideoPort_GetFieldPolarity(p,a) (p)->GetFieldPolarity(a)
  186. #define IVideoPort_GetVideoLine(p,a) (p)->GetVideoLine(a)
  187. #define IVideoPort_GetVideoSignalStatus(p,a) (p)->GetVideoSignalStatus(a)
  188. #define IVideoPort_SetColorControls(p,a) (p)->SetColorControls(a)
  189. #define IVideoPort_StartVideo(p,a) (p)->StartVideo(a)
  190. #define IVideoPort_StopVideo(p) (p)->StopVideo()
  191. #define IVideoPort_UpdateVideo(p,a) (p)->UpdateVideo(a)
  192. #define IVideoPort_WaitForSync(p,a,b,c) (p)->WaitForSync(a,b,c)
  193. #endif
  194. #endif
  195. /*
  196. * IDirectDrawVideoPort
  197. */
  198. #if defined( _WIN32 ) && !defined( _NO_COM )
  199. #undef INTERFACE
  200. #define INTERFACE IDirectDrawVideoPortNotify
  201. DECLARE_INTERFACE_( IDirectDrawVideoPortNotify, IUnknown )
  202. {
  203. /*** IUnknown methods ***/
  204. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
  205. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  206. STDMETHOD_(ULONG,Release) (THIS) PURE;
  207. /*** IVideoPort methods ***/
  208. STDMETHOD(AcquireNotification)(THIS_ HANDLE *, LPDDVIDEOPORTNOTIFY) PURE;
  209. STDMETHOD(ReleaseNotification)(THIS_ HANDLE) PURE;
  210. };
  211. #if !defined(__cplusplus) || defined(CINTERFACE)
  212. #define IVideoPortNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
  213. #define IVideoPortNotify_AddRef(p) (p)->lpVtbl->AddRef(p)
  214. #define IVideoPortNotify_Release(p) (p)->lpVtbl->Release(p)
  215. #define IVideoPortNotify_AcquireNotification(p,a,b) (p)->lpVtbl->AcquireNotification(p,a,b)
  216. #define IVideoPortNotify_ReleaseNotification(p,a) (p)->lpVtbl->ReleaseNotification(p,a)
  217. #else
  218. #define IVideoPortNotify_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
  219. #define IVideoPortNotify_AddRef(p) (p)->AddRef()
  220. #define IVideoPortNotify_Release(p) (p)->Release()
  221. #define IVideoPortNotify_AcquireNotification(p,a,b) (p)->lpVtbl->AcquireNotification(a,b)
  222. #define IVideoPortNotify_ReleaseNotification(p,a) (p)->lpVtbl->ReleaseNotification(a)
  223. #endif
  224. #endif
  225. /*
  226. * DDVIDEOPORTCONNECT
  227. */
  228. typedef struct _DDVIDEOPORTCONNECT
  229. {
  230. DWORD dwSize; // size of the DDVIDEOPORTCONNECT structure
  231. DWORD dwPortWidth; // Width of the video port
  232. GUID guidTypeID; // Description of video port connection
  233. DWORD dwFlags; // Connection flags
  234. ULONG_PTR dwReserved1; // Reserved, set to zero.
  235. } DDVIDEOPORTCONNECT;
  236. /*
  237. * DDVIDEOPORTCAPS
  238. */
  239. typedef struct _DDVIDEOPORTCAPS
  240. {
  241. DWORD dwSize; // size of the DDVIDEOPORTCAPS structure
  242. DWORD dwFlags; // indicates which fields contain data
  243. DWORD dwMaxWidth; // max width of the video port field
  244. DWORD dwMaxVBIWidth; // max width of the VBI data
  245. DWORD dwMaxHeight; // max height of the video port field
  246. DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1))
  247. DWORD dwCaps; // Video port capabilities
  248. DWORD dwFX; // More video port capabilities
  249. DWORD dwNumAutoFlipSurfaces; // Max number of autoflippable surfaces allowed
  250. DWORD dwAlignVideoPortBoundary; // Byte restriction of placement within the surface
  251. DWORD dwAlignVideoPortPrescaleWidth;// Byte restriction of width after prescaling
  252. DWORD dwAlignVideoPortCropBoundary; // Byte restriction of left cropping
  253. DWORD dwAlignVideoPortCropWidth; // Byte restriction of cropping width
  254. DWORD dwPreshrinkXStep; // Width can be shrunk in steps of 1/x
  255. DWORD dwPreshrinkYStep; // Height can be shrunk in steps of 1/x
  256. DWORD dwNumVBIAutoFlipSurfaces; // Max number of VBI autoflippable surfaces allowed
  257. DWORD dwNumPreferredAutoflip; // Optimal number of autoflippable surfaces for hardware
  258. WORD wNumFilterTapsX; // Number of taps the prescaler uses in the X direction (0 - no prescale, 1 - replication, etc.)
  259. WORD wNumFilterTapsY; // Number of taps the prescaler uses in the Y direction (0 - no prescale, 1 - replication, etc.)
  260. } DDVIDEOPORTCAPS;
  261. /*
  262. * The dwMaxWidth and dwMaxVBIWidth members are valid
  263. */
  264. #define DDVPD_WIDTH 0x00000001l
  265. /*
  266. * The dwMaxHeight member is valid
  267. */
  268. #define DDVPD_HEIGHT 0x00000002l
  269. /*
  270. * The dwVideoPortID member is valid
  271. */
  272. #define DDVPD_ID 0x00000004l
  273. /*
  274. * The dwCaps member is valid
  275. */
  276. #define DDVPD_CAPS 0x00000008l
  277. /*
  278. * The dwFX member is valid
  279. */
  280. #define DDVPD_FX 0x00000010l
  281. /*
  282. * The dwNumAutoFlipSurfaces member is valid
  283. */
  284. #define DDVPD_AUTOFLIP 0x00000020l
  285. /*
  286. * All of the alignment members are valid
  287. */
  288. #define DDVPD_ALIGN 0x00000040l
  289. /*
  290. * The dwNumPreferredAutoflip member is valid
  291. */
  292. #define DDVPD_PREFERREDAUTOFLIP 0x00000080l
  293. /*
  294. * The wNumFilterTapsX and wNumFilterTapsY fields are valid
  295. */
  296. #define DDVPD_FILTERQUALITY 0x00000100l
  297. /*
  298. * DDVIDEOPORTDESC
  299. */
  300. typedef struct _DDVIDEOPORTDESC
  301. {
  302. DWORD dwSize; // size of the DDVIDEOPORTDESC structure
  303. DWORD dwFieldWidth; // width of the video port field
  304. DWORD dwVBIWidth; // width of the VBI data
  305. DWORD dwFieldHeight; // height of the video port field
  306. DWORD dwMicrosecondsPerField; // Microseconds per video field
  307. DWORD dwMaxPixelsPerSecond; // Maximum pixel rate per second
  308. DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1))
  309. DWORD dwReserved1; // Reserved for future use - set to zero (struct padding)
  310. DDVIDEOPORTCONNECT VideoPortType; // Description of video port connection
  311. ULONG_PTR dwReserved2; // Reserved for future use - set to zero
  312. ULONG_PTR dwReserved3; // Reserved for future use - set to zero
  313. } DDVIDEOPORTDESC;
  314. /*
  315. * DDVIDEOPORTINFO
  316. */
  317. typedef struct _DDVIDEOPORTINFO
  318. {
  319. DWORD dwSize; // Size of the structure
  320. DWORD dwOriginX; // Placement of the video data within the surface.
  321. DWORD dwOriginY; // Placement of the video data within the surface.
  322. DWORD dwVPFlags; // Video port options
  323. RECT rCrop; // Cropping rectangle (optional).
  324. DWORD dwPrescaleWidth; // Determines pre-scaling/zooming in the X direction (optional).
  325. DWORD dwPrescaleHeight; // Determines pre-scaling/zooming in the Y direction (optional).
  326. LPDDPIXELFORMAT lpddpfInputFormat; // Video format written to the video port
  327. LPDDPIXELFORMAT lpddpfVBIInputFormat; // Input format of the VBI data
  328. LPDDPIXELFORMAT lpddpfVBIOutputFormat;// Output format of the data
  329. DWORD dwVBIHeight; // Specifies the number of lines of data within the vertical blanking interval.
  330. ULONG_PTR dwReserved1; // Reserved for future use - set to zero
  331. ULONG_PTR dwReserved2; // Reserved for future use - set to zero
  332. } DDVIDEOPORTINFO;
  333. /*
  334. * DDVIDEOPORTBANDWIDTH
  335. */
  336. typedef struct _DDVIDEOPORTBANDWIDTH
  337. {
  338. DWORD dwSize; // Size of the structure
  339. DWORD dwCaps;
  340. DWORD dwOverlay; // Zoom factor at which overlay is supported
  341. DWORD dwColorkey; // Zoom factor at which overlay w/ colorkey is supported
  342. DWORD dwYInterpolate; // Zoom factor at which overlay w/ Y interpolation is supported
  343. DWORD dwYInterpAndColorkey; // Zoom factor at which ovelray w/ Y interpolation and colorkeying is supported
  344. ULONG_PTR dwReserved1; // Reserved for future use - set to zero
  345. ULONG_PTR dwReserved2; // Reserved for future use - set to zero
  346. } DDVIDEOPORTBANDWIDTH;
  347. /*
  348. * DDVIDEOPORTSTATUS
  349. */
  350. typedef struct _DDVIDEOPORTSTATUS
  351. {
  352. DWORD dwSize; // Size of the structure
  353. BOOL bInUse; // TRUE if video port is currently being used
  354. DWORD dwFlags; // Currently not used
  355. DWORD dwReserved1; // Reserved for future use
  356. DDVIDEOPORTCONNECT VideoPortType; // Information about the connection
  357. ULONG_PTR dwReserved2; // Reserved for future use
  358. ULONG_PTR dwReserved3; // Reserved for future use
  359. } DDVIDEOPORTSTATUS;
  360. /*
  361. * DDVIDEOPORTNOTIFY
  362. */
  363. typedef struct _DDVIDEOPORTNOTIFY
  364. {
  365. LARGE_INTEGER ApproximateTimeStamp; // Timestamp in the event notification
  366. LONG lField; // 0 if even, 1 if odd, -1 if unknown
  367. UINT dwSurfaceIndex; // Index in the surface chain of the surface that received the sample
  368. LONG lDone; // Call InterlockedIncrement on this when done with sample
  369. } DDVIDEOPORTNOTIFY;
  370. /*============================================================================
  371. *
  372. * Video Port Flags
  373. *
  374. * All flags are bit flags.
  375. *
  376. *==========================================================================*/
  377. /****************************************************************************
  378. *
  379. * VIDEOPORT DDVIDEOPORTCONNECT FLAGS
  380. *
  381. ****************************************************************************/
  382. /*
  383. * When this is set by the driver and passed to the client, this
  384. * indicates that the video port is capable of double clocking the data.
  385. * When this is set by the client, this indicates that the video port
  386. * should enable double clocking. This flag is only valid with external
  387. * syncs.
  388. */
  389. #define DDVPCONNECT_DOUBLECLOCK 0x00000001l
  390. /*
  391. * When this is set by the driver and passed to the client, this
  392. * indicates that the video port is capable of using an external VACT
  393. * signal. When this is set by the client, this indicates that the
  394. * video port should use the external VACT signal.
  395. */
  396. #define DDVPCONNECT_VACT 0x00000002l
  397. /*
  398. * When this is set by the driver and passed to the client, this
  399. * indicates that the video port is capable of treating even fields
  400. * like odd fields and visa versa. When this is set by the client,
  401. * this indicates that the video port should treat even fields like odd
  402. * fields.
  403. */
  404. #define DDVPCONNECT_INVERTPOLARITY 0x00000004l
  405. /*
  406. * Indicates that any data written to the video port during the VREF
  407. * period will not be written into the frame buffer. This flag is read only.
  408. */
  409. #define DDVPCONNECT_DISCARDSVREFDATA 0x00000008l
  410. /*
  411. * When this is set be the driver and passed to the client, this
  412. * indicates that the device will write half lines into the frame buffer
  413. * if half lines are provided by the decoder. If this is set by the client,
  414. * this indicates that the decoder will be supplying half lines.
  415. */
  416. #define DDVPCONNECT_HALFLINE 0x00000010l
  417. /*
  418. * Indicates that the signal is interlaced. This flag is only
  419. * set by the client.
  420. */
  421. #define DDVPCONNECT_INTERLACED 0x00000020l
  422. /*
  423. * Indicates that video port is shareable and that this video port
  424. * will use the even fields. This flag is only set by the client.
  425. */
  426. #define DDVPCONNECT_SHAREEVEN 0x00000040l
  427. /*
  428. * Indicates that video port is shareable and that this video port
  429. * will use the odd fields. This flag is only set by the client.
  430. */
  431. #define DDVPCONNECT_SHAREODD 0x00000080l
  432. /****************************************************************************
  433. *
  434. * VIDEOPORT DDVIDEOPORTDESC CAPS
  435. *
  436. ****************************************************************************/
  437. /*
  438. * Flip can be performed automatically to avoid tearing.
  439. */
  440. #define DDVPCAPS_AUTOFLIP 0x00000001l
  441. /*
  442. * Supports interlaced video
  443. */
  444. #define DDVPCAPS_INTERLACED 0x00000002l
  445. /*
  446. * Supports non-interlaced video
  447. */
  448. #define DDVPCAPS_NONINTERLACED 0x00000004l
  449. /*
  450. * Indicates that the device can return whether the current field
  451. * of an interlaced signal is even or odd.
  452. */
  453. #define DDVPCAPS_READBACKFIELD 0x00000008l
  454. /*
  455. * Indicates that the device can return the current line of video
  456. * being written into the frame buffer.
  457. */
  458. #define DDVPCAPS_READBACKLINE 0x00000010l
  459. /*
  460. * Allows two gen-locked video streams to share a single video port,
  461. * where one stream uses the even fields and the other uses the odd
  462. * fields. Separate parameters (including address, scaling,
  463. * cropping, etc.) are maintained for both fields.)
  464. */
  465. #define DDVPCAPS_SHAREABLE 0x00000020l
  466. /*
  467. * Even fields of video can be automatically discarded.
  468. */
  469. #define DDVPCAPS_SKIPEVENFIELDS 0x00000040l
  470. /*
  471. * Odd fields of video can be automatically discarded.
  472. */
  473. #define DDVPCAPS_SKIPODDFIELDS 0x00000080l
  474. /*
  475. * Indicates that the device is capable of driving the graphics
  476. * VSYNC with the video port VSYNC.
  477. */
  478. #define DDVPCAPS_SYNCMASTER 0x00000100l
  479. /*
  480. * Indicates that data within the vertical blanking interval can
  481. * be written to a different surface.
  482. */
  483. #define DDVPCAPS_VBISURFACE 0x00000200l
  484. /*
  485. * Indicates that the video port can perform color operations
  486. * on the incoming data before it is written to the frame buffer.
  487. */
  488. #define DDVPCAPS_COLORCONTROL 0x00000400l
  489. /*
  490. * Indicates that the video port can accept VBI data in a different
  491. * width or format than the regular video data.
  492. */
  493. #define DDVPCAPS_OVERSAMPLEDVBI 0x00000800l
  494. /*
  495. * Indicates that the video port can write data directly to system memory
  496. */
  497. #define DDVPCAPS_SYSTEMMEMORY 0x00001000l
  498. /*
  499. * Indicates that the VBI and video portions of the video stream can
  500. * be controlled by an independent processes.
  501. */
  502. #define DDVPCAPS_VBIANDVIDEOINDEPENDENT 0x00002000l
  503. /*
  504. * Indicates that the video port contains high quality hardware
  505. * de-interlacing hardware that should be used instead of the
  506. * bob/weave algorithms.
  507. */
  508. #define DDVPCAPS_HARDWAREDEINTERLACE 0x00004000l
  509. /****************************************************************************
  510. *
  511. * VIDEOPORT DDVIDEOPORTDESC FX
  512. *
  513. ****************************************************************************/
  514. /*
  515. * Limited cropping is available to crop out the vertical interval data.
  516. */
  517. #define DDVPFX_CROPTOPDATA 0x00000001l
  518. /*
  519. * Incoming data can be cropped in the X direction before it is written
  520. * to the surface.
  521. */
  522. #define DDVPFX_CROPX 0x00000002l
  523. /*
  524. * Incoming data can be cropped in the Y direction before it is written
  525. * to the surface.
  526. */
  527. #define DDVPFX_CROPY 0x00000004l
  528. /*
  529. * Supports interleaving interlaced fields in memory.
  530. */
  531. #define DDVPFX_INTERLEAVE 0x00000008l
  532. /*
  533. * Supports mirroring left to right as the video data is written
  534. * into the frame buffer.
  535. */
  536. #define DDVPFX_MIRRORLEFTRIGHT 0x00000010l
  537. /*
  538. * Supports mirroring top to bottom as the video data is written
  539. * into the frame buffer.
  540. */
  541. #define DDVPFX_MIRRORUPDOWN 0x00000020l
  542. /*
  543. * Data can be arbitrarily shrunk in the X direction before it
  544. * is written to the surface.
  545. */
  546. #define DDVPFX_PRESHRINKX 0x00000040l
  547. /*
  548. * Data can be arbitrarily shrunk in the Y direction before it
  549. * is written to the surface.
  550. */
  551. #define DDVPFX_PRESHRINKY 0x00000080l
  552. /*
  553. * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the X
  554. * direction before it is written to the surface.
  555. */
  556. #define DDVPFX_PRESHRINKXB 0x00000100l
  557. /*
  558. * Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the Y
  559. * direction before it is written to the surface.
  560. */
  561. #define DDVPFX_PRESHRINKYB 0x00000200l
  562. /*
  563. * Data can be shrunk in increments of 1/x in the X direction
  564. * (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkXStep)
  565. * before it is written to the surface.
  566. */
  567. #define DDVPFX_PRESHRINKXS 0x00000400l
  568. /*
  569. * Data can be shrunk in increments of 1/x in the Y direction
  570. * (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkYStep)
  571. * before it is written to the surface.
  572. */
  573. #define DDVPFX_PRESHRINKYS 0x00000800l
  574. /*
  575. * Data can be arbitrarily stretched in the X direction before
  576. * it is written to the surface.
  577. */
  578. #define DDVPFX_PRESTRETCHX 0x00001000l
  579. /*
  580. * Data can be arbitrarily stretched in the Y direction before
  581. * it is written to the surface.
  582. */
  583. #define DDVPFX_PRESTRETCHY 0x00002000l
  584. /*
  585. * Data can be integer stretched in the X direction before it is
  586. * written to the surface.
  587. */
  588. #define DDVPFX_PRESTRETCHXN 0x00004000l
  589. /*
  590. * Data can be integer stretched in the Y direction before it is
  591. * written to the surface.
  592. */
  593. #define DDVPFX_PRESTRETCHYN 0x00008000l
  594. /*
  595. * Indicates that data within the vertical blanking interval can
  596. * be converted independently of the remaining video data.
  597. */
  598. #define DDVPFX_VBICONVERT 0x00010000l
  599. /*
  600. * Indicates that scaling can be disabled for data within the
  601. * vertical blanking interval.
  602. */
  603. #define DDVPFX_VBINOSCALE 0x00020000l
  604. /*
  605. * Indicates that the video data can ignore the left and right
  606. * cropping coordinates when cropping oversampled VBI data.
  607. */
  608. #define DDVPFX_IGNOREVBIXCROP 0x00040000l
  609. /*
  610. * Indicates that interleaving can be disabled for data within the
  611. * vertical blanking interval.
  612. */
  613. #define DDVPFX_VBINOINTERLEAVE 0x00080000l
  614. /****************************************************************************
  615. *
  616. * VIDEOPORT DDVIDEOPORTINFO FLAGS
  617. *
  618. ****************************************************************************/
  619. /*
  620. * Perform automatic flipping. Auto-flipping is performed between
  621. * the overlay surface that was attached to the video port using
  622. * IDirectDrawVideoPort::AttachSurface and the overlay surfaces that
  623. * are attached to the surface via the IDirectDrawSurface::AttachSurface
  624. * method. The flip order is the order in which the overlay surfaces
  625. * were. attached.
  626. */
  627. #define DDVP_AUTOFLIP 0x00000001l
  628. /*
  629. * Perform conversion using the ddpfOutputFormat information.
  630. */
  631. #define DDVP_CONVERT 0x00000002l
  632. /*
  633. * Perform cropping using the specified rectangle.
  634. */
  635. #define DDVP_CROP 0x00000004l
  636. /*
  637. * Indicates that interlaced fields should be interleaved in memory.
  638. */
  639. #define DDVP_INTERLEAVE 0x00000008l
  640. /*
  641. * Indicates that the data should be mirrored left to right as it's
  642. * written into the frame buffer.
  643. */
  644. #define DDVP_MIRRORLEFTRIGHT 0x00000010l
  645. /*
  646. * Indicates that the data should be mirrored top to bottom as it's
  647. * written into the frame buffer.
  648. */
  649. #define DDVP_MIRRORUPDOWN 0x00000020l
  650. /*
  651. * Perform pre-scaling/zooming based on the pre-scale parameters.
  652. */
  653. #define DDVP_PRESCALE 0x00000040l
  654. /*
  655. * Ignore input of even fields.
  656. */
  657. #define DDVP_SKIPEVENFIELDS 0x00000080l
  658. /*
  659. * Ignore input of odd fields.
  660. */
  661. #define DDVP_SKIPODDFIELDS 0x00000100l
  662. /*
  663. * Drive the graphics VSYNCs using the video port VYSNCs.
  664. */
  665. #define DDVP_SYNCMASTER 0x00000200l
  666. /*
  667. * The ddpfVBIOutputFormatFormat member contains data that should be used
  668. * to convert the data within the vertical blanking interval.
  669. */
  670. #define DDVP_VBICONVERT 0x00000400l
  671. /*
  672. * Indicates that data within the vertical blanking interval
  673. * should not be scaled.
  674. */
  675. #define DDVP_VBINOSCALE 0x00000800l
  676. /*
  677. * Indicates that these bob/weave decisions should not be
  678. * overriden by other interfaces.
  679. */
  680. #define DDVP_OVERRIDEBOBWEAVE 0x00001000l
  681. /*
  682. * Indicates that the video data should ignore the left and right
  683. * cropping coordinates when cropping the VBI data.
  684. */
  685. #define DDVP_IGNOREVBIXCROP 0x00002000l
  686. /*
  687. * Indicates that interleaving can be disabled for data within the
  688. * vertical blanking interval.
  689. */
  690. #define DDVP_VBINOINTERLEAVE 0x00004000l
  691. /*
  692. * Indicates that the video port should use the hardware
  693. * de-interlacing hardware.
  694. */
  695. #define DDVP_HARDWAREDEINTERLACE 0x00008000l
  696. /****************************************************************************
  697. *
  698. * DIRIRECTDRAWVIDEOPORT GETINPUTFORMAT/GETOUTPUTFORMAT FLAGS
  699. *
  700. ****************************************************************************/
  701. /*
  702. * Return formats for the video data
  703. */
  704. #define DDVPFORMAT_VIDEO 0x00000001l
  705. /*
  706. * Return formats for the VBI data
  707. */
  708. #define DDVPFORMAT_VBI 0x00000002l
  709. //@@BEGIN_MSINTERNAL
  710. /*
  711. * Internal flag to disable the VBI/video-only check
  712. */
  713. #define DDVPFORMAT_NOFAIL 0x08000000l
  714. //@@END_MSINTERNAL
  715. /****************************************************************************
  716. *
  717. * DIRIRECTDRAWVIDEOPORT SETTARGETSURFACE FLAGS
  718. *
  719. ****************************************************************************/
  720. /*
  721. * Surface should receive video data (and VBI data if a surface
  722. * is not explicitly attached for that purpose)
  723. */
  724. #define DDVPTARGET_VIDEO 0x00000001l
  725. /*
  726. * Surface should receive VBI data
  727. */
  728. #define DDVPTARGET_VBI 0x00000002l
  729. /****************************************************************************
  730. *
  731. * DIRIRECTDRAWVIDEOPORT WAITFORSYNC FLAGS
  732. *
  733. ****************************************************************************/
  734. /*
  735. * Waits until the beginning of the next VSYNC
  736. */
  737. #define DDVPWAIT_BEGIN 0x00000001l
  738. /*
  739. * Waits until the end of the next/current VSYNC
  740. */
  741. #define DDVPWAIT_END 0x00000002l
  742. /*
  743. * Waits until the beginning of the specified line
  744. */
  745. #define DDVPWAIT_LINE 0x00000003l
  746. /****************************************************************************
  747. *
  748. * DIRECTDRAWVIDEOPORT FLIP FLAGS
  749. *
  750. ****************************************************************************/
  751. /*
  752. * Flips the normal video surface
  753. */
  754. #define DDVPFLIP_VIDEO 0x00000001l
  755. /*
  756. * Flips the VBI surface
  757. */
  758. #define DDVPFLIP_VBI 0x00000002l
  759. /****************************************************************************
  760. *
  761. * DIRIRECTDRAWVIDEOPORT GETVIDEOSIGNALSTATUS VALUES
  762. *
  763. ****************************************************************************/
  764. /*
  765. * No video signal is present at the video port
  766. */
  767. #define DDVPSQ_NOSIGNAL 0x00000001l
  768. /*
  769. * A valid video signal is present at the video port
  770. */
  771. #define DDVPSQ_SIGNALOK 0x00000002l
  772. /****************************************************************************
  773. *
  774. * VIDEOPORTBANDWIDTH Flags
  775. *
  776. ****************************************************************************/
  777. /*
  778. * The specified height/width refer to the size of the video port data
  779. * written into memory, after prescaling has occured.
  780. */
  781. #define DDVPB_VIDEOPORT 0x00000001l
  782. /*
  783. * The specified height/width refer to the source size of the overlay.
  784. */
  785. #define DDVPB_OVERLAY 0x00000002l
  786. /*
  787. * This is a query for the device to return which caps this device requires.
  788. */
  789. #define DDVPB_TYPE 0x00000004l
  790. /****************************************************************************
  791. *
  792. * VIDEOPORTBANDWIDTH Caps
  793. *
  794. ****************************************************************************/
  795. /*
  796. * The bandwidth for this device is dependant on the overlay source size.
  797. */
  798. #define DDVPBCAPS_SOURCE 0x00000001l
  799. /*
  800. * The bandwidth for this device is dependant on the overlay destination
  801. * size.
  802. */
  803. #define DDVPBCAPS_DESTINATION 0x00000002l
  804. /****************************************************************************
  805. *
  806. * DDVIDEOPORTCONTAINER CreateVideoPort flags
  807. *
  808. ****************************************************************************/
  809. /*
  810. * The process only wants to control the VBI portion of the video stream.
  811. */
  812. #define DDVPCREATE_VBIONLY 0x00000001l
  813. /*
  814. * The process only wants to control the non-VBI (video) portion of
  815. * the video stream.
  816. */
  817. #define DDVPCREATE_VIDEOONLY 0x00000002l
  818. //@@BEGIN_MSINTERNAL
  819. /*
  820. * Internal flag indicating interface is for the IDirectDrawVidoePortNotify object
  821. */
  822. #define DDVPCREATE_NOTIFY 0x80000000l
  823. //@@END_MSINTERNAL
  824. /****************************************************************************
  825. *
  826. * DDVIDEOPORTSTATUS flags
  827. *
  828. ****************************************************************************/
  829. /*
  830. * The video port interface is only controlling the VBI portion of the
  831. * video stream
  832. */
  833. #define DDVPSTATUS_VBIONLY 0x00000001l
  834. /*
  835. * The video port interface is only controlling the video portion of the
  836. * video stream
  837. */
  838. #define DDVPSTATUS_VIDEOONLY 0x00000002l
  839. #ifdef __cplusplus
  840. };
  841. #endif
  842. #endif // GUID_DEFS_ONLY
  843. #endif