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.

462 lines
19 KiB

  1. /**************************************************************************
  2. *
  3. * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. * PURPOSE.
  7. *
  8. *
  9. *
  10. * Compddk.h - include file for implementing installable compressors
  11. *
  12. * Copyright (c) 1990-1993, Microsoft Corp. All rights reserved.
  13. *
  14. **********************************************************************
  15. *
  16. * To register FOURCC's for codec types please obtain a
  17. * copy of the Multimedia Developer Registration Kit from:
  18. *
  19. * Microsoft Corporation
  20. * Multimedia Systems Group
  21. * Product Marketing
  22. * One Microsoft Way
  23. * Redmond, WA 98052-6399
  24. *
  25. *
  26. */
  27. #ifndef _INC_COMPDDK
  28. #define _INC_COMPDDK 50 /* version number */
  29. #ifndef RC_INVOKED
  30. #ifndef WIN32
  31. #pragma pack(1) /* Assume byte packing throughout */
  32. #endif
  33. #endif /* RC_INVOKED */
  34. #ifdef __cplusplus
  35. extern "C" { /* Assume C declarations for C++ */
  36. #endif /* __cplusplus */
  37. #define ICVERSION 0x0104
  38. DECLARE_HANDLE(HIC); /* Handle to a Installable Compressor */
  39. //
  40. // this code in biCompression means the DIB must be accesed via
  41. // 48 bit pointers! using *ONLY* the selector given.
  42. //
  43. #define BI_1632 0x32333631 // '1632'
  44. #ifndef mmioFOURCC
  45. #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
  46. ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
  47. ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
  48. #endif
  49. #ifndef aviTWOCC
  50. #define aviTWOCC(ch0, ch1) ((WORD)(BYTE)(ch0) | ((WORD)(BYTE)(ch1) << 8))
  51. #endif
  52. #ifndef ICTYPE_VIDEO
  53. #define ICTYPE_VIDEO mmioFOURCC('v', 'i', 'd', 'c')
  54. #define ICTYPE_AUDIO mmioFOURCC('a', 'u', 'd', 'c')
  55. #endif
  56. #ifndef ICERR_OK
  57. #define ICERR_OK 0L
  58. #define ICERR_DONTDRAW 1L
  59. #define ICERR_NEWPALETTE 2L
  60. #define ICERR_GOTOKEYFRAME 3L
  61. #define ICERR_UNSUPPORTED -1L
  62. #define ICERR_BADFORMAT -2L
  63. #define ICERR_MEMORY -3L
  64. #define ICERR_INTERNAL -4L
  65. #define ICERR_BADFLAGS -5L
  66. #define ICERR_BADPARAM -6L
  67. #define ICERR_BADSIZE -7L
  68. #define ICERR_BADHANDLE -8L
  69. #define ICERR_CANTUPDATE -9L
  70. #define ICERR_ABORT -10L
  71. #define ICERR_ERROR -100L
  72. #define ICERR_BADBITDEPTH -200L
  73. #define ICERR_BADIMAGESIZE -201L
  74. #define ICERR_CUSTOM -400L // errors less than ICERR_CUSTOM...
  75. #endif
  76. /* Values for dwFlags of ICOpen() */
  77. #ifndef ICMODE_COMPRESS
  78. #define ICMODE_COMPRESS 1
  79. #define ICMODE_DECOMPRESS 2
  80. #define ICMODE_FASTDECOMPRESS 3
  81. #define ICMODE_QUERY 4
  82. #define ICMODE_FASTCOMPRESS 5
  83. #define ICMODE_DRAW 8
  84. #endif
  85. /* Flags for AVI file index */
  86. #define AVIIF_LIST 0x00000001L
  87. #define AVIIF_TWOCC 0x00000002L
  88. #define AVIIF_KEYFRAME 0x00000010L
  89. /* quality flags */
  90. #define ICQUALITY_LOW 0
  91. #define ICQUALITY_HIGH 10000
  92. #define ICQUALITY_DEFAULT -1
  93. /************************************************************************
  94. ************************************************************************/
  95. #define ICM_USER (DRV_USER+0x0000)
  96. #define ICM_RESERVED ICM_RESERVED_LOW
  97. #define ICM_RESERVED_LOW (DRV_USER+0x1000)
  98. #define ICM_RESERVED_HIGH (DRV_USER+0x2000)
  99. /************************************************************************
  100. messages.
  101. ************************************************************************/
  102. #define ICM_GETSTATE (ICM_RESERVED+0) // Get compressor state
  103. #define ICM_SETSTATE (ICM_RESERVED+1) // Set compressor state
  104. #define ICM_GETINFO (ICM_RESERVED+2) // Query info about the compressor
  105. #define ICM_CONFIGURE (ICM_RESERVED+10) // show the configure dialog
  106. #define ICM_ABOUT (ICM_RESERVED+11) // show the about box
  107. #define ICM_GETERRORTEXT (ICM_RESERVED+12) // get error text TBD
  108. #define ICM_GETFORMATNAME (ICM_RESERVED+20) // get a name for a format
  109. #define ICM_ENUMFORMATS (ICM_RESERVED+21) // cycle through formats
  110. #define ICM_GETDEFAULTQUALITY (ICM_RESERVED+30) // get the default value for quality
  111. #define ICM_GETQUALITY (ICM_RESERVED+31) // get the current value for quality
  112. #define ICM_SETQUALITY (ICM_RESERVED+32) // set the default value for quality
  113. #define ICM_SET (ICM_RESERVED+40) // Tell the driver something
  114. #define ICM_GET (ICM_RESERVED+41) // Ask the driver something
  115. // Constants for ICM_SET:
  116. #define ICM_FRAMERATE mmioFOURCC('F','r','m','R')
  117. #define ICM_KEYFRAMERATE mmioFOURCC('K','e','y','R')
  118. /************************************************************************
  119. ICM specific messages.
  120. ************************************************************************/
  121. #define ICM_COMPRESS_GET_FORMAT (ICM_USER+4) // get compress format or size
  122. #define ICM_COMPRESS_GET_SIZE (ICM_USER+5) // get output size
  123. #define ICM_COMPRESS_QUERY (ICM_USER+6) // query support for compress
  124. #define ICM_COMPRESS_BEGIN (ICM_USER+7) // begin a series of compress calls.
  125. #define ICM_COMPRESS (ICM_USER+8) // compress a frame
  126. #define ICM_COMPRESS_END (ICM_USER+9) // end of a series of compress calls.
  127. #define ICM_DECOMPRESS_GET_FORMAT (ICM_USER+10) // get decompress format or size
  128. #define ICM_DECOMPRESS_QUERY (ICM_USER+11) // query support for dempress
  129. #define ICM_DECOMPRESS_BEGIN (ICM_USER+12) // start a series of decompress calls
  130. #define ICM_DECOMPRESS (ICM_USER+13) // decompress a frame
  131. #define ICM_DECOMPRESS_END (ICM_USER+14) // end a series of decompress calls
  132. #define ICM_DECOMPRESS_SET_PALETTE (ICM_USER+29) // fill in the DIB color table
  133. #define ICM_DECOMPRESS_GET_PALETTE (ICM_USER+30) // fill in the DIB color table
  134. #define ICM_DRAW_QUERY (ICM_USER+31) // query support for dempress
  135. #define ICM_DRAW_BEGIN (ICM_USER+15) // start a series of draw calls
  136. #define ICM_DRAW_GET_PALETTE (ICM_USER+16) // get the palette needed for drawing
  137. #define ICM_DRAW_UPDATE (ICM_USER+17) // update screen with current frame
  138. #define ICM_DRAW_START (ICM_USER+18) // start decompress clock
  139. #define ICM_DRAW_STOP (ICM_USER+19) // stop decompress clock
  140. #define ICM_DRAW_BITS/* not used */ (ICM_USER+20) // decompress a frame to screen
  141. #define ICM_DRAW_END (ICM_USER+21) // end a series of draw calls
  142. #define ICM_DRAW_GETTIME (ICM_USER+32) // get value of decompress clock
  143. #define ICM_DRAW (ICM_USER+33) // generalized "render" message
  144. #define ICM_DRAW_WINDOW (ICM_USER+34) // drawing window has moved or hidden
  145. #define ICM_DRAW_SETTIME (ICM_USER+35) // set correct value for decompress clock
  146. #define ICM_DRAW_REALIZE (ICM_USER+36) // realize palette for drawing
  147. #define ICM_DRAW_FLUSH (ICM_USER+37) // clear out buffered frames
  148. #define ICM_DRAW_RENDERBUFFER (ICM_USER+38) // draw undrawn things in queue
  149. #define ICM_DRAW_START_PLAY (ICM_USER+39) // start of a play
  150. #define ICM_DRAW_STOP_PLAY (ICM_USER+40) // end of a play
  151. #define ICM_DRAW_SUGGESTFORMAT (ICM_USER+50) // Like ICGetDisplayFormat
  152. #define ICM_DRAW_CHANGEPALETTE (ICM_USER+51) // for animating palette
  153. #define ICM_DRAW_IDLE (ICM_USER+52) // send each frame time
  154. #define ICM_GETBUFFERSWANTED (ICM_USER+41) // ask about prebuffering
  155. #define ICM_GETDEFAULTKEYFRAMERATE (ICM_USER+42) // get the default value for key frames
  156. #define ICM_DECOMPRESSEX_BEGIN (ICM_USER+60) // start a series of decompress calls
  157. #define ICM_DECOMPRESSEX_QUERY (ICM_USER+61) // start a series of decompress calls
  158. #define ICM_DECOMPRESSEX (ICM_USER+62) // decompress a frame
  159. #define ICM_DECOMPRESSEX_END (ICM_USER+63) // end a series of decompress calls
  160. #define ICM_COMPRESS_FRAMES_INFO (ICM_USER+70) // tell about compress to come
  161. #define ICM_COMPRESS_FRAMES (ICM_USER+71) // compress a bunch of frames
  162. #define ICM_SET_STATUS_PROC (ICM_USER+72) // set status callback
  163. #define ICM_ENUM_FORMATS (ICM_USER+80) // enum all formats
  164. #define ICM_GET_FORMAT_NAME (ICM_USER+81) // compress a bunch of frames
  165. /************************************************************************
  166. ************************************************************************/
  167. typedef struct {
  168. DWORD dwSize; // sizeof(ICOPEN)
  169. DWORD fccType; // 'vidc'
  170. DWORD fccHandler; //
  171. DWORD dwVersion; // version of compman opening you
  172. DWORD dwFlags; // LOWORD is type specific
  173. LRESULT dwError; // error return.
  174. } ICOPEN;
  175. /************************************************************************
  176. ************************************************************************/
  177. typedef struct {
  178. DWORD dwSize; // sizeof(ICINFO)
  179. DWORD fccType; // compressor type 'vidc' 'audc'
  180. DWORD fccHandler; // compressor sub-type 'rle ' 'jpeg' 'pcm '
  181. DWORD dwFlags; // flags LOWORD is type specific
  182. DWORD dwVersion; // version of the driver
  183. DWORD dwVersionICM; // version of the ICM used
  184. #ifdef WIN32
  185. //
  186. // under Win32, the driver always returns UNICODE strings.
  187. //
  188. WCHAR szName[16]; // short name
  189. WCHAR szDescription[128]; // long name
  190. WCHAR szDriver[128]; // driver that contains compressor
  191. #else
  192. char szName[16]; // short name
  193. char szDescription[128]; // long name
  194. char szDriver[128]; // driver that contains compressor
  195. #endif
  196. } ICINFO;
  197. /* Flags for the <dwFlags> field of the <ICINFO> structure. */
  198. #define VIDCF_QUALITY 0x0001 // supports quality
  199. #define VIDCF_CRUNCH 0x0002 // supports crunching to a frame size
  200. #define VIDCF_TEMPORAL 0x0004 // supports inter-frame compress
  201. #define VIDCF_COMPRESSFRAMES 0x0008 // wants the compress all frames message
  202. #define VIDCF_DRAW 0x0010 // supports drawing
  203. #define VIDCF_FASTTEMPORALC 0x0020 // does not need prev frame on compress
  204. #define VIDCF_FASTTEMPORALD 0x0080 // does not need prev frame on decompress
  205. //#define VIDCF_QUALITYTIME 0x0040 // supports temporal quality
  206. //#define VIDCF_FASTTEMPORAL (VIDCF_FASTTEMPORALC|VIDCF_FASTTEMPORALD)
  207. /************************************************************************
  208. ************************************************************************/
  209. #define ICCOMPRESS_KEYFRAME 0x00000001L
  210. typedef struct {
  211. DWORD dwFlags; // flags
  212. LPBITMAPINFOHEADER lpbiOutput; // output format
  213. LPVOID lpOutput; // output data
  214. LPBITMAPINFOHEADER lpbiInput; // format of frame to compress
  215. LPVOID lpInput; // frame data to compress
  216. LPDWORD lpckid; // ckid for data in AVI file
  217. LPDWORD lpdwFlags; // flags in the AVI index.
  218. LONG lFrameNum; // frame number of seq.
  219. DWORD dwFrameSize; // reqested size in bytes. (if non zero)
  220. DWORD dwQuality; // quality
  221. // these are new fields
  222. LPBITMAPINFOHEADER lpbiPrev; // format of previous frame
  223. LPVOID lpPrev; // previous frame
  224. } ICCOMPRESS;
  225. /************************************************************************
  226. ************************************************************************/
  227. #define ICCOMPRESSFRAMES_PADDING 0x00000001
  228. typedef struct {
  229. DWORD dwFlags; // flags
  230. LPBITMAPINFOHEADER lpbiOutput; // output format
  231. LPARAM lOutput; // output identifier
  232. LPBITMAPINFOHEADER lpbiInput; // format of frame to compress
  233. LPARAM lInput; // input identifier
  234. LONG lStartFrame; // start frame
  235. LONG lFrameCount; // # of frames
  236. LONG lQuality; // quality
  237. LONG lDataRate; // data rate
  238. LONG lKeyRate; // key frame rate
  239. DWORD dwRate; // frame rate, as always
  240. DWORD dwScale;
  241. DWORD dwOverheadPerFrame;
  242. DWORD dwReserved2;
  243. LONG (CALLBACK *GetData)(LPARAM lInput, LONG lFrame, LPVOID lpBits, LONG len);
  244. LONG (CALLBACK *PutData)(LPARAM lOutput, LONG lFrame, LPVOID lpBits, LONG len);
  245. } ICCOMPRESSFRAMES;
  246. typedef struct {
  247. DWORD dwFlags;
  248. LPARAM lParam;
  249. // messages for Status callback
  250. #define ICSTATUS_START 0
  251. #define ICSTATUS_STATUS 1 // l == % done
  252. #define ICSTATUS_END 2
  253. #define ICSTATUS_ERROR 3 // l == error string (LPSTR)
  254. #define ICSTATUS_YIELD 4
  255. // return nonzero means abort operation in progress
  256. LONG (CALLBACK *Status) (LPARAM lParam, UINT message, LONG l);
  257. } ICSETSTATUSPROC;
  258. /************************************************************************
  259. ************************************************************************/
  260. #define ICDECOMPRESS_HURRYUP 0x80000000L // don't draw just buffer (hurry up!)
  261. #define ICDECOMPRESS_UPDATE 0x40000000L // don't draw just update screen
  262. #define ICDECOMPRESS_PREROLL 0x20000000L // this frame is before real start
  263. #define ICDECOMPRESS_NULLFRAME 0x10000000L // repeat last frame
  264. #define ICDECOMPRESS_NOTKEYFRAME 0x08000000L // this frame is not a key frame
  265. typedef struct {
  266. DWORD dwFlags; // flags (from AVI index...)
  267. LPBITMAPINFOHEADER lpbiInput; // BITMAPINFO of compressed data
  268. // biSizeImage has the chunk size
  269. LPVOID lpInput; // compressed data
  270. LPBITMAPINFOHEADER lpbiOutput; // DIB to decompress to
  271. LPVOID lpOutput;
  272. DWORD ckid; // ckid from AVI file
  273. } ICDECOMPRESS;
  274. typedef struct {
  275. //
  276. // same as ICM_DECOMPRESS
  277. //
  278. DWORD dwFlags;
  279. LPBITMAPINFOHEADER lpbiSrc; // BITMAPINFO of compressed data
  280. LPVOID lpSrc; // compressed data
  281. LPBITMAPINFOHEADER lpbiDst; // DIB to decompress to
  282. LPVOID lpDst; // output data
  283. //
  284. // new for ICM_DECOMPRESSEX
  285. //
  286. int xDst; // destination rectangle
  287. int yDst;
  288. int dxDst;
  289. int dyDst;
  290. int xSrc; // source rectangle
  291. int ySrc;
  292. int dxSrc;
  293. int dySrc;
  294. } ICDECOMPRESSEX;
  295. /************************************************************************
  296. ************************************************************************/
  297. #define ICDRAW_QUERY 0x00000001L // test for support
  298. #define ICDRAW_FULLSCREEN 0x00000002L // draw to full screen
  299. #define ICDRAW_HDC 0x00000004L // draw to a HDC/HWND
  300. #define ICDRAW_ANIMATE 0x00000008L // expect palette animation
  301. #define ICDRAW_CONTINUE 0x00000010L // draw is a continuation of previous draw
  302. #define ICDRAW_MEMORYDC 0x00000020L // DC is offscreen, by the way
  303. #define ICDRAW_UPDATING 0x00000040L // We're updating, as opposed to playing
  304. #define ICDRAW_RENDER 0x00000080L // used to render data not draw it
  305. #define ICDRAW_BUFFER 0x00000100L // please buffer this data offscreen, we will need to update it
  306. typedef struct {
  307. DWORD dwFlags; // flags
  308. HPALETTE hpal; // palette to draw with
  309. HWND hwnd; // window to draw to
  310. HDC hdc; // HDC to draw to
  311. int xDst; // destination rectangle
  312. int yDst;
  313. int dxDst;
  314. int dyDst;
  315. LPBITMAPINFOHEADER lpbi; // format of frame to draw
  316. int xSrc; // source rectangle
  317. int ySrc;
  318. int dxSrc;
  319. int dySrc;
  320. DWORD dwRate; // frames/second = (dwRate/dwScale)
  321. DWORD dwScale;
  322. } ICDRAWBEGIN;
  323. /************************************************************************
  324. ************************************************************************/
  325. #define ICDRAW_HURRYUP 0x80000000L // don't draw just buffer (hurry up!)
  326. #define ICDRAW_UPDATE 0x40000000L // don't draw just update screen
  327. #define ICDRAW_PREROLL 0x20000000L // this frame is before real start
  328. #define ICDRAW_NULLFRAME 0x10000000L // repeat last frame
  329. #define ICDRAW_NOTKEYFRAME 0x08000000L // this frame is not a key frame
  330. typedef struct {
  331. DWORD dwFlags; // flags
  332. LPVOID lpFormat; // format of frame to decompress
  333. LPVOID lpData; // frame data to decompress
  334. DWORD cbData;
  335. LONG lTime; // time in drawbegin units (see dwRate and dwScale)
  336. } ICDRAW;
  337. typedef struct {
  338. LPBITMAPINFOHEADER lpbiIn; // format to be drawn
  339. LPBITMAPINFOHEADER lpbiSuggest; // location for suggested format (or NULL to get size)
  340. int dxSrc; // source extent or 0
  341. int dySrc;
  342. int dxDst; // dest extent or 0
  343. int dyDst;
  344. HIC hicDecompressor;// decompressor you can talk to
  345. } ICDRAWSUGGEST;
  346. /************************************************************************
  347. ************************************************************************/
  348. typedef struct {
  349. DWORD dwFlags; // flags (from AVI index...)
  350. int iStart; // first palette to change
  351. int iLen; // count of entries to change.
  352. LPPALETTEENTRY lppe; // palette
  353. } ICPALETTE;
  354. #ifndef RC_INVOKED
  355. #ifndef WIN32
  356. #pragma pack() /* Revert to default packing */
  357. #endif
  358. #endif /* RC_INVOKED */
  359. #ifdef __cplusplus
  360. } /* End of extern "C" { */
  361. #endif /* __cplusplus */
  362. #endif /* _INC_COMPDDK */