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.

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