Subversion Repositories Games.Chess Giants

Rev

Blame | Last modification | View Log | Download | RSS feed

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