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.

272 lines
10 KiB

  1. /*******************************************************************
  2. *
  3. * FILE: dciman.h
  4. *
  5. * DESCRIPTION: definitions for MS/Intel-defined DCI interface
  6. *
  7. * Copyright (c) 1994 Intel/Microsoft Corporation
  8. *
  9. *******************************************************************/
  10. #ifndef _INC_DCIDDI
  11. #define _INC_DCIDDI
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. /* DCI Command Escapes */
  16. #define DCICOMMAND 3075
  17. #define DCI_VERSION 0x0100
  18. #define DCICREATEPRIMARYSURFACE 1
  19. #define DCICREATEOFFSCREENSURFACE 2
  20. #define DCICREATEOVERLAYSURFACE 3
  21. #define DCIENUMSURFACE 4
  22. #define DCIESCAPE 5
  23. /* DCI-Defined error codes */
  24. #define DCI_OK 0 /* success */
  25. /* Hard errors -- DCI will be unavailable */
  26. #define DCI_FAIL_GENERIC -1
  27. #define DCI_FAIL_UNSUPPORTEDVERSION -2
  28. #define DCI_FAIL_INVALIDSURFACE -3
  29. #define DCI_FAIL_UNSUPPORTED -4
  30. /* Soft errors -- DCI may be available later */
  31. #define DCI_ERR_CURRENTLYNOTAVAIL -5
  32. #define DCI_ERR_INVALIDRECT -6
  33. #define DCI_ERR_UNSUPPORTEDFORMAT -7
  34. #define DCI_ERR_UNSUPPORTEDMASK -8
  35. #define DCI_ERR_TOOBIGHEIGHT -9
  36. #define DCI_ERR_TOOBIGWIDTH -10
  37. #define DCI_ERR_TOOBIGSIZE -11
  38. #define DCI_ERR_OUTOFMEMORY -12
  39. #define DCI_ERR_INVALIDPOSITION -13
  40. #define DCI_ERR_INVALIDSTRETCH -14
  41. #define DCI_ERR_INVALIDCLIPLIST -15
  42. #define DCI_ERR_SURFACEISOBSCURED -16
  43. #define DCI_ERR_XALIGN -18
  44. #define DCI_ERR_YALIGN -19
  45. #define DCI_ERR_XYALIGN -20
  46. #define DCI_ERR_WIDTHALIGN -21
  47. #define DCI_ERR_HEIGHTALIGN -22
  48. /* success messages -- DCI call succeeded, but specified item changed */
  49. #define DCI_STATUS_POINTERCHANGED 1
  50. #define DCI_STATUS_STRIDECHANGED 2
  51. #define DCI_STATUS_FORMATCHANGED 4
  52. #define DCI_STATUS_SURFACEINFOCHANGED 8
  53. #define DCI_STATUS_CHROMAKEYCHANGED 16
  54. #define DCI_STATUS_WASSTILLDRAWING 32
  55. /* DCI Capability Flags */
  56. #define DCI_SURFACE_TYPE 0x0000000F
  57. #define DCI_PRIMARY 0x00000000
  58. #define DCI_OFFSCREEN 0x00000001
  59. #define DCI_OVERLAY 0x00000002
  60. #define DCI_VISIBLE 0x00000010
  61. #define DCI_CHROMAKEY 0x00000020
  62. #define DCI_1632_ACCESS 0x00000040
  63. #define DCI_DWORDSIZE 0x00000080
  64. #define DCI_DWORDALIGN 0x00000100
  65. #define DCI_WRITEONLY 0x00000200
  66. #define DCI_ASYNC 0x00000400
  67. #define DCI_CAN_STRETCHX 0x00001000
  68. #define DCI_CAN_STRETCHY 0x00002000
  69. #define DCI_CAN_STRETCHXY (DCI_CAN_STRETCHX | DCI_CAN_STRETCHY)
  70. #define DCI_CAN_STRETCHXN 0x00004000
  71. #define DCI_CAN_STRETCHYN 0x00008000
  72. #define DCI_CAN_STRETCHXYN (DCI_CAN_STRETCHXN | DCI_CAN_STRETCHYN)
  73. #define DCI_CANOVERLAY 0x00010000
  74. /*
  75. * Win32 RGNDATA structure. This will be used for cliplist info. passing.
  76. */
  77. #if (WINVER < 0x0400)
  78. #ifndef RDH_RECTANGLES
  79. typedef struct tagRECTL
  80. {
  81. LONG left;
  82. LONG top;
  83. LONG right;
  84. LONG bottom;
  85. } RECTL;
  86. typedef RECTL* PRECTL;
  87. typedef RECTL NEAR* NPRECTL;
  88. typedef RECTL FAR* LPRECTL;
  89. typedef const RECTL FAR* LPCRECTL;
  90. #define RDH_RECTANGLES 0
  91. typedef struct tagRGNDATAHEADER {
  92. DWORD dwSize; /* size of structure */
  93. DWORD iType; /* Will be RDH_RECTANGLES */
  94. DWORD nCount; /* # of clipping rectangles */
  95. DWORD nRgnSize; /* size of buffer -- can be zero */
  96. RECTL rcBound; /* bounding rectangle for region*/
  97. } RGNDATAHEADER;
  98. typedef RGNDATAHEADER* PRGNDATAHEADER;
  99. typedef RGNDATAHEADER NEAR* NPRGNDATAHEADER;
  100. typedef RGNDATAHEADER FAR* LPRGNDATAHEADER;
  101. typedef const RGNDATAHEADER FAR* LPCRGNDATAHEADER;
  102. typedef struct tagRGNDATA {
  103. RGNDATAHEADER rdh;
  104. char Buffer[1];
  105. } RGNDATA;
  106. typedef RGNDATA* PRGNDATA;
  107. typedef RGNDATA NEAR* NPRGNDATA;
  108. typedef RGNDATA FAR* LPRGNDATA;
  109. typedef const RGNDATA FAR* LPCRGNDATA;
  110. #endif
  111. #endif
  112. typedef int DCIRVAL; /* return for callbacks */
  113. /**************************************************************************
  114. * input structures
  115. **************************************************************************/
  116. /*
  117. * Used by a DCI client to provide input parameters for the
  118. * DCICREATEPRIMARYSURFACE escape.
  119. */
  120. typedef struct _DCICMD {
  121. DWORD dwCommand;
  122. DWORD dwParam1;
  123. DWORD dwParam2;
  124. DWORD dwVersion;
  125. DWORD dwReserved;
  126. } DCICMD;
  127. /*
  128. * This structure is used by a DCI client to provide input parameters for
  129. * the DCICREATE... calls. The fields that are actually relevant differ for
  130. * each of the three calls. Details are in the DCI Spec chapter providing
  131. * the function specifications.
  132. */
  133. typedef struct _DCICREATEINPUT {
  134. DCICMD cmd; /* common header structure */
  135. DWORD dwCompression; /* format of surface to be created */
  136. DWORD dwMask[3]; /* for nonstandard RGB (e.g. 5-6-5, RGB32) */
  137. DWORD dwWidth; /* height of the surface to be created */
  138. DWORD dwHeight; /* width of input surfaces */
  139. DWORD dwDCICaps; /* capabilities of surface wanted */
  140. LPVOID lpSurface; /* pointer to an associated surface */
  141. } DCICREATEINPUT, FAR *LPDCICREATEINPUT;
  142. /*
  143. * This structure is used by a DCI client to provide input parameters for the
  144. * DCIEnumSurface call.
  145. */
  146. typedef struct _DCIENUMINPUT {
  147. DCICMD cmd; /* common header structure */
  148. RECT rSrc; /* source rect. for stretch */
  149. RECT rDst; /* dest. rect. for stretch */
  150. void (CALLBACK *EnumCallback)(LPDCISURFACEINFO, LPVOID); /* callback for supported formats */
  151. LPVOID lpContext;
  152. } DCIENUMINPUT, FAR *LPDCIENUMINPUT;
  153. /**************************************************************************
  154. * surface info. structures
  155. **************************************************************************/
  156. /*
  157. * This structure is used to return information about available support
  158. * during a DCIEnumSurface call. It is also used to create a primary
  159. * surface, and as a member of the larger structures returned by the
  160. * offscreen and overlay calls.
  161. */
  162. typedef struct _DCISURFACEINFO {
  163. DWORD dwSize; /* size of structure */
  164. DWORD dwDCICaps; /* capability flags (stretch, etc.) */
  165. DWORD dwCompression; /* format of surface to be created */
  166. DWORD dwMask[3]; /* for BI_BITMASK surfaces */
  167. DWORD dwWidth; /* width of surface */
  168. DWORD dwHeight; /* height of surface */
  169. LONG lStride; /* distance in bytes betw. one pixel */
  170. /* and the pixel directly below it */
  171. DWORD dwBitCount; /* Bits per pixel for this dwCompression */
  172. DWORD dwOffSurface; /* offset of surface pointer */
  173. WORD wSelSurface; /* selector of surface pointer */
  174. WORD wReserved;
  175. DWORD dwReserved1; /* reserved for provider */
  176. DWORD dwReserved2; /* reserved for DCIMAN */
  177. DWORD dwReserved3; /* reserved for future */
  178. DCIRVAL (CALLBACK *BeginAccess) (LPVOID, LPRECT); /* BeginAccess callback */
  179. void (CALLBACK *EndAccess) (LPVOID); /* EndAcess callback */
  180. void (CALLBACK *DestroySurface) (LPVOID); /* Destroy surface callback */
  181. } DCISURFACEINFO, FAR *LPDCISURFACEINFO;
  182. /*
  183. * This structure must be allocated and returned by the DCI provider in
  184. * response to a DCICREATEPRIMARYSURFACE call.
  185. */
  186. typedef DCISURFACEINFO DCIPRIMARY, FAR *LPDCIPRIMARY;
  187. /*
  188. * This structure must be allocated and returned by the DCI provider in
  189. * response to a DCICREATEOFFSCREENSURFACE call.
  190. */
  191. typedef struct _DCIOFFSCREEN {
  192. DCISURFACEINFO dciInfo; /* surface info */
  193. DCIRVAL (CALLBACK *Draw) (LPVOID); /* copy to onscreen buffer */
  194. DCIRVAL (CALLBACK *SetClipList) (LPVOID, LPRGNDATA); /* SetCliplist callback */
  195. DCIRVAL (CALLBACK *SetDestination) (LPVOID, LPRECT, LPRECT); /* SetDestination callback */
  196. } DCIOFFSCREEN, FAR *LPDCIOFFSCREEN;
  197. /*
  198. * This structure must be allocated and returned by the DCI provider in response
  199. * to a DCICREATEOVERLAYSURFACE call.
  200. */
  201. typedef struct _DCIOVERLAY{
  202. DCISURFACEINFO dciInfo; /* surface info */
  203. DWORD dwChromakeyValue; /* chromakey color value */
  204. DWORD dwChromakeyMask; /* specifies valid bits of value */
  205. } DCIOVERLAY, FAR *LPDCIOVERLAY;
  206. /* DCI FOURCC def.s for extended DIB formats */
  207. #ifndef YVU9
  208. #define YVU9 mmioFOURCC('Y','V','U','9')
  209. #endif
  210. #ifndef Y411
  211. #define Y411 mmioFOURCC('Y','4','1','1')
  212. #endif
  213. #ifndef YUY2
  214. #define YUY2 mmioFOURCC('Y','U','Y','2')
  215. #endif
  216. #ifndef YVYU
  217. #define YVYU mmioFOURCC('Y','V','Y','U')
  218. #endif
  219. #ifndef UYVY
  220. #define UYVY mmioFOURCC('U','Y','V','Y')
  221. #endif
  222. #ifndef Y211
  223. #define Y211 mmioFOURCC('Y','2','1','1')
  224. #endif
  225. #ifdef __cplusplus
  226. }
  227. #endif
  228. #endif // _INC_DCIDDI