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.

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