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.

287 lines
11 KiB

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