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.

506 lines
21 KiB

  1. /****************************************************************************
  2. *
  3. * AVIFILE.D
  4. *
  5. * Autodoc for the AVI clipboard and editing functions.
  6. *
  7. ***************************************************************************/
  8. //
  9. // Defines for the dwFlags field of the AVICOMPRESSOPTIONS struct
  10. //
  11. #define AVICOMPRESSF_INTERLEAVE 0x00000001
  12. #define AVICOMPRESSF_DATARATE 0x00000002
  13. #define AVICOMPRESSF_KEYFRAMES 0x00000004
  14. #define AVICOMPRESSF_VALID 0x00000008 // has valid data?
  15. STDAPI_(void) AVIFileInit(void); // Call this first!
  16. STDAPI_(void) AVIFileExit(void);
  17. #define MAKE_AVIERR(error) MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 0x4000 + error)
  18. #define AVIERR_UNSUPPORTED MAKE_AVIERR(101)
  19. #define AVIERR_BADFORMAT MAKE_AVIERR(102)
  20. #define AVIERR_MEMORY MAKE_AVIERR(103)
  21. #define AVIERR_INTERNAL MAKE_AVIERR(104)
  22. #define AVIERR_BADFLAGS MAKE_AVIERR(105)
  23. #define AVIERR_BADPARAM MAKE_AVIERR(106)
  24. #define AVIERR_BADSIZE MAKE_AVIERR(107)
  25. #define AVIERR_BADHANDLE MAKE_AVIERR(108)
  26. #define AVIERR_FILEREAD MAKE_AVIERR(109)
  27. #define AVIERR_FILEWRITE MAKE_AVIERR(110)
  28. #define AVIERR_FILEOPEN MAKE_AVIERR(111)
  29. #define AVIERR_COMPRESSOR MAKE_AVIERR(112)
  30. #define AVIERR_NOCOMPRESSOR MAKE_AVIERR(113)
  31. #define AVIERR_READONLY MAKE_AVIERR(114)
  32. #define AVIERR_NODATA MAKE_AVIERR(115)
  33. #define AVIERR_BUFFERTOOSMALL MAKE_AVIERR(116)
  34. #define AVIERR_CANTCOMPRESS MAKE_AVIERR(117)
  35. #define AVIERR_USERABORT MAKE_AVIERR(198)
  36. #define AVIERR_ERROR MAKE_AVIERR(199)
  37. #endif
  38. /*****************************************************************************
  39. * @doc EXTERNAL AVISTREAMINFO
  40. *
  41. * @types AVISTREAMINFO | This structure contains information
  42. * for a single stream. It is similar to, but not
  43. * identical to <t AVIStreamHeader> found in AVI files.
  44. *
  45. * @field DWORD | fccType | Specifies a four-character code
  46. * indicating the stream type. The following
  47. * constants have been defined for the data commonly
  48. * found in AVI streams:
  49. *
  50. * @flag streamtypeAUDIO | Indicates an audio stream.
  51. * @flag streamtypeMIDI | Indicates a MIDI stream.
  52. * @flag streamtypeTEXT | Indicates a text stream.
  53. * @flag streamtypeVIDEO | Indicates a video stream.
  54. *
  55. * @field DWORD | fccHandler | For a video stream, specifies the
  56. * four-character code of the compressor handler that
  57. * will compress this stream when it is saved
  58. * (For example, mmioFOURCC('M','S','V','C')).
  59. * This member is not used for audio streams.
  60. *
  61. * @field DWORD | dwFlags | Specifies any applicable flags. The bits
  62. * in the high-order word of these flags are specific
  63. * to the type of data contained in the stream. The following
  64. * flags are defined:
  65. *
  66. * @flag AVISF_DISABLED | Indicates this stream should not be enabled by default.
  67. * @flag AVISF_VIDEO_PALCHANGES | Indicates this video stream contains
  68. * palette changes. This flag warns the playback software that it will need
  69. * to animate the palette.
  70. *
  71. * @field DWORD | dwCaps | Specifies capability flags. This is currently
  72. * unused.
  73. *
  74. * @field WORD | wPriority | Specifies the priority of the stream.
  75. *
  76. * @field WORD | wLanguage | Specifies the language of the stream.
  77. *
  78. * @field DWORD | dwScale | This member is used with <e AVISTREAMINFO.dwRate>
  79. * to specify the time scale this stream will use.
  80. * Dividing <e AVISTREAMINFO.dwRate> by <e AVISTREAMINFO.dwScale>
  81. * gives the number of samples per second.
  82. * For video streams, this rate should be the frame rate.
  83. * For audio streams, this rate should correspond to the time
  84. * needed for <e WAVEFORMAT.nBlockAlign> bytes of audio,
  85. * which for PCM audio simply reduces to the sample rate.
  86. *
  87. * @field DWORD | dwRate | See <e AVISTREAMINFO.dwScale>.
  88. *
  89. * @field DWORD | dwStart | Specifies the starting time of the AVI file.
  90. * The units are defined by the <e AVISTREAMINFO.dwRate>
  91. * and <e AVISTREAMINFO.dwScale> members of this structure.
  92. * Normally, this is zero, but it can specify a
  93. * delay time for a stream which does not start concurrently
  94. * with the file.
  95. * Note: The 1.0 release of the AVI tools does not support
  96. * a non-zero starting time.
  97. *
  98. * @field DWORD | dwLength | Specifies the length of this stream.
  99. * The units are defined by the <e AVISTREAMINFO.dwRate>
  100. * and <e AVISTREAMINFO.dwScale> members of this structure.
  101. *
  102. * @field DWORD | dwInitialFrames | Specifies how far audio
  103. * data is skewed ahead of the video frames in
  104. * interleaved files. Typically, this is about 0.75 seconds.
  105. *
  106. * @field DWORD | dwSuggestedBufferSize | Suggests how large a buffer
  107. * should be used to read this stream. Typically, this
  108. * contains a value corresponding to the largest chunk
  109. * present in the stream. Using the correct buffer size
  110. * makes playback more efficient. Use zero if you
  111. * do not know the correct buffer size.
  112. *
  113. * @field DWORD | dwQuality | Specifies an indicator of the quality of
  114. * the data in the stream. Quality is represented as a number
  115. * between 0 and 10000. For compressed data, this typically represents
  116. * the value of the quality parameter passed to the compression software.
  117. * If set to -1, drivers use the default quality value.
  118. *
  119. * @field DWORD | dwSampleSize | Specifies the size of a single
  120. * sample of data. This is set to zero if the samples can
  121. * vary in size. If this number is non-zero, then multiple
  122. * samples of data can be grouped into a single chunk
  123. * within the file. If it is zero, each sample of data (such as a
  124. * video frame) must be in a separate chunk.
  125. *
  126. * For video streams, this number is typically zero, although it can
  127. * be non-zero if all video frames are the same size. For audio streams,
  128. * this number should be the same as the <e WAVEFORMAT.nBlockAlign>
  129. * member of the <t WAVEFORMAT> structure describing the audio.
  130. *
  131. * @field RECT | rcFrame | Specifies the dimensions of the destination
  132. * rectangle for the video. The coordinates rpresent the
  133. * the upper-left corner, and the height and width.
  134. *
  135. * @field DWORD | dwEditCount | Specifies the number of times the
  136. * stream has been edited. The stream handler maintains this
  137. * count.
  138. *
  139. * @field DWORD | dwFormatChangeCount | Specifies the number of times
  140. * stream format has changed. The stream handler maintains this
  141. * count.
  142. *
  143. * @field char | szName[64] | Specifies a zero-terminated string containing
  144. * a description of the stream.
  145. *
  146. ***************************************************************************/
  147. /*****************************************************************************
  148. * @doc EXTERNAL AVIFILEINFO
  149. *
  150. * @types AVIFILEINFO | This structure contains global information
  151. * for an entire AVI file. It is similar to, but not
  152. * identical to <t MainAVIHeader> found in AVI files.
  153. *
  154. * @field DWORD | dwMaxBytesPerSec | Specifies the approximate maximum
  155. * data rate of file.
  156. *
  157. * @field DWORD | dwFlags | Specifies any applicable flags.
  158. * The following flags are defined:
  159. *
  160. * @flag AVIF_HASINDEX | Indicates the AVI file has
  161. * an index at the end of the file. For good performance,
  162. * all AVI files should contain an index.
  163. * @flag AVIF_MUSTUSEINDEX | Indicates that the index, rather than the
  164. * physical ordering of the chunks in the file, should be used to
  165. * determine the order of presentation of the data. For example, this
  166. * could be used for creating a list frames for editing.
  167. * @flag AVIF_ISINTERLEAVED | Indicates the AVI file is interleaved.
  168. * @flag AVIF_WASCAPTUREFILE | Indicates the AVI file is a specially
  169. * allocated file used for capturing real-time video. Applications
  170. * should warn the user before writing over a file with this flag set
  171. * because the user probably defragmented this file.
  172. * @flag AVIF_COPYRIGHTED | Indicates the AVI file contains copyrighted
  173. * data and software. When this flag is used, software should
  174. * not permit the data to be duplicated.
  175. *
  176. * @field DWORD | dwCaps | Specifies capability flags. This is currently unused.
  177. *
  178. * @field DWORD | dwStreams | Specifies the number of streams in the file.
  179. * For example, a file with audio and video has two streams.
  180. *
  181. * @field DWORD | dwSuggestedBufferSize | Specifies the suggested buffer
  182. * size for reading the file. Generally, this size should be large
  183. * enough to contain the largest chunk in the file. If set to zero, or
  184. * if it is too small, the playback software will have to reallocate
  185. * memory during playback which will reduce performance.
  186. *
  187. * For an interleaved file, this buffer size should be large enough to read
  188. * an entire record and not just a chunk.
  189. *
  190. * @field DWORD | dwWidth | Specifies the width of the AVI file in pixels.
  191. *
  192. * @field DWORD | dwHeight | Specifies the height of the AVI file in pixels.
  193. *
  194. * @field DWORD | dwScale | This field is used with <e AVIFILEINFO.dwRate>
  195. * to specify the time scale that the file as a whole will use. In addition,
  196. * each stream can have its own time scale.
  197. * Dividing <e AVIFILEINFO.dwRate> by <e AVIFILEINFO.dwScale>
  198. * gives the number of samples per second.
  199. *
  200. * @field DWORD | dwRate | See <e AVIFILEINFO.dwScale>.
  201. *
  202. * @field DWORD | dwLength | Specifies the length of the AVI file.
  203. * The units are defined by <e AVIFILEINFO.dwRate> and
  204. * <e AVIFILEINFO.dwScale> .
  205. *
  206. * @field DWORD | dwEditCount | Specifies the number of streams that have
  207. * been added or deleted.
  208. *
  209. * @field char | szFileType[64] | Specifies a zero-terminated string
  210. * containing descriptive information for the file type.
  211. *
  212. ***************************************************************************/
  213. /**************************************************************************
  214. * @doc EXTERNAL AVIPutFileOnClipboard
  215. *
  216. * @api STDAPI | AVIPutFileOnClipboard | Copies an AVI file onto the Clipboard.
  217. *
  218. * @parm PAVIFILE | pf | Specifies a handle to an open AVI file.
  219. *
  220. * @rdesc Returns zero if successful; otherwise returns an error code.
  221. *
  222. * @comm This function will also copy data with the CF_DIB and
  223. * CF_WAVE Clipboard flags onto the Clipboard.
  224. *
  225. *************************************************************************/
  226. /**************************************************************************
  227. * @doc EXTERNAL AVIGetFromClipboard
  228. *
  229. * @api STDAPI | AVIGetFromClipboard | Copies an AVI file from the Clipboard.
  230. *
  231. * @parm PAVIFILE * | lppf | Specifies the location used to return
  232. * the handle created for the AVI file.
  233. *
  234. * @rdesc Returns zero if successful; otherwise returns an error code.
  235. *
  236. * @comm This function will also copy data with the CF_DIB or CF_WAVE
  237. * Clipboard flags.
  238. *
  239. *************************************************************************/
  240. /**************************************************************************
  241. * @doc EXTERNAL AVIClearClipboard
  242. *
  243. * @api STDAPI | AVIClearClipboard | Clears an AVI file from the Clipboard.
  244. * Use this function before ending your application to clear the
  245. * contents of the Clipboard.
  246. *
  247. * @rdesc Returns zero if successful; otherwise returns an error code.
  248. *
  249. *************************************************************************/
  250. /**************************************************************************
  251. * @doc EXTERNAL CreateEditableStream
  252. *
  253. * @api STDAPI | CreateEditableStream | Creates an editable stream.
  254. * Use this function before using other <f EditStream> functions.
  255. *
  256. * @parm PAVISTREAM FAR * | ppsEditable | Specifies a pointer to the location
  257. * used to return the handle to the new stream.
  258. *
  259. * @parm PAVISTREAM | psSource | Specifies a handle to the open stream
  260. * used as the source of data. Specify NULL to create
  261. * an empty editable string that you can copy and paste data
  262. * into.
  263. *
  264. * @rdesc Returns zero if successful; otherwise returns an error code.
  265. *
  266. * @comm The stream pointer returned in <p ppsEditable> must be
  267. * used as the source stream in the other <f EditStream> functions.
  268. *
  269. * Internally, this function creates tables to keep track of
  270. * changes to a stream. The original stream is never changed
  271. * by the <f EditStream> functions. The stream pointer
  272. * created by this function can be used in any AVIFile function
  273. * that accepts stream pointers. You can use this function on
  274. * the same stream multiple times. A copy of a stream is not
  275. * affected by changes in another copy.
  276. *
  277. *************************************************************************/
  278. /**************************************************************************
  279. * @doc EXTERNAL EditStreamCut
  280. *
  281. * @api STDAPI | EditStreamCut | Deletes an editable
  282. * stream (or a portion of it) and copies it into a temporary stream.
  283. *
  284. * @parm PAVISTREAM | pavi | Specifies a handle to the editable stream used
  285. * as the source of the data.
  286. *
  287. * @parm LONG FAR * | plStart | Specifies the starting position of the data
  288. * to be cut from the stream referenced by <p pavi>.
  289. *
  290. * @parm LONG FAR * | plLength | Specifies the length of the data
  291. * to be cut from the stream referenced by <p pavi>.
  292. *
  293. * @parm PAVISTREAM FAR * | ppResult | Specifies a pointer to the location
  294. * used to return the handle created for the new stream.
  295. *
  296. * @comm The editable stream must be created by <f CreateEditableStream>
  297. * or one of the <f EditStream> functions.
  298. *
  299. * The temporary stream is an editable stream and
  300. * can be treated as any other AVI stream.
  301. *
  302. * @rdesc Returns zero if successful; otherwise returns an error code.
  303. *
  304. *************************************************************************/
  305. /**************************************************************************
  306. * @doc EXTERNAL EditStreamCopy
  307. *
  308. * @api STDAPI | EditStreamCopy | Copies an editable
  309. * stream (or a portion of it) into a temporary stream.
  310. *
  311. * @parm PAVISTREAM | pavi | Specifies a handle to an editable stream used
  312. * as the source of the data.
  313. *
  314. * @parm LONG FAR * | plStart | Specifies the starting position of the data
  315. * to be copied from the stream referenced by <p pavi>. The
  316. * actual starting postion is returned.
  317. *
  318. * @parm LONG FAR * | plLength | Specifies the length of the data
  319. * to be copied from the stream referenced by <p pavi>.
  320. * The actual length of the copied data is returned.
  321. *
  322. * @parm PAVISTREAM FAR * | ppResult | Specifies a pointer to the location
  323. * used to return the handle created for the new stream.
  324. *
  325. * @rdesc Returns zero if successful; otherwise returns an error code.
  326. *
  327. * @comm The editable stream must be created by <f CreateEditableStream>
  328. * or one of the <f EditStream> functions.
  329. *
  330. * The temporary stream can be treated as any other AVI stream.
  331. *
  332. *************************************************************************/
  333. /**************************************************************************
  334. * @doc EXTERNAL EditStreamPaste
  335. *
  336. * @api STDAPI | EditStreamPaste | Copies a stream (or a portion of it) into
  337. * another stream.
  338. *
  339. * @parm PAVISTREAM | pavi | Specifies a handle to a editable stream
  340. * used as the destination of data from the stream specified
  341. * for <p pstream>.
  342. *
  343. * @parm LONG FAR * | plPos | Specifies the starting position of the data
  344. * to be copied from the stream referenced by <p pavi>. On returning
  345. * from the function, <p plPos>
  346. *
  347. * @parm LONG FAR * | plLength | Specifies a pointer to where the length
  348. * of the data pasted in will be returned.
  349. *
  350. * @parm PAVISTREAM | pstream | Specifies a handle to a stream used
  351. * as the source of the data. This stream does not need to
  352. * be an editable stream.
  353. *
  354. * @parm LONG | lStart | Specifies the starting position within the stream
  355. * referenced by <p pstream> of the portion that will be pasted into
  356. * stream <p pavi>.
  357. *
  358. * @parm LONG | lLength | Specifies the length of the data
  359. * to be copied to the stream specified by <p pavi>. If <p lLength>
  360. * is -1, the entire stream <p pstream> will be pasted in.
  361. *
  362. * @rdesc Returns zero if successful; otherwise returns an error code.
  363. *
  364. * @comm The stream <p pavi> must be created by <f CreateEditableStream>
  365. * or one of the <f EditStream> functions.
  366. *
  367. * @xref <f CreateEditableStream> <f EditStreamCopy> <f EditStreamCut>
  368. *
  369. *************************************************************************/
  370. /**************************************************************************
  371. * @doc EXTERNAL EditStreamClone
  372. *
  373. * @api STDAPI | EditStreamClone | Creates a duplicate editable
  374. * stream.
  375. *
  376. * @parm PAVISTREAM | pavi | Specifies a handle to an editable stream.
  377. *
  378. * @parm PAVISTREAM FAR * | ppResult | Specifies the location used
  379. * to return the handle to the stream created. This stream is
  380. * an editable stream.
  381. *
  382. * @rdesc Returns zero if successful; otherwise returns an error code.
  383. *
  384. * @comm The editable stream must be created by <f CreateEditableStream>
  385. * or one of the <f EditStream> functions.
  386. *
  387. * The stream created can be treated as any other AVI stream.
  388. *
  389. * You can use this function as the basis of an "undo" feature.
  390. * You can also use this function to create a stream copied to
  391. * the clipboard.
  392. *
  393. *************************************************************************/
  394. /**************************************************************************
  395. * @doc EXTERNAL EditStreamSetInfo
  396. *
  397. * @api SDTAPI | EditStreamSetInfo | Changes characteristics of an
  398. * editable stream.
  399. *
  400. * @parm PAVISTREAM | pavi | Specifies a handle to an open stream.
  401. *
  402. * @parm AVISTREAMINFO FAR * | lpInfo | Points to an <t AVISTREAMINFO>
  403. * structure containing new information.
  404. *
  405. * @parm LONG | cbInfo | Specifies the size of the structure pointed to
  406. * by <p lpInfo>.
  407. *
  408. * @rdesc Returns zero if successful; otherwise returns an error code.
  409. *
  410. * @comm You must fill out the <t AVISTREAMINFO> structure, including
  411. * the members you will not use. You can use <f AVIStreamInfo> to
  412. * to initialize the structure and then updated selected members
  413. * with your data.
  414. *
  415. * This function does not change the following members:
  416. *
  417. * <e AVISTREAMINFO.fccType>
  418. *
  419. * <e AVISTREAMINFO.fccHandler>
  420. *
  421. * <e AVISTREAMINFO.dwFlags>
  422. *
  423. * <e AVISTREAMINFO.dwCaps>
  424. *
  425. * <e AVISTREAMINFO.dwLength>
  426. *
  427. * <e AVISTREAMINFO.dwInitialFrames>
  428. *
  429. * <e AVISTREAMINFO.dwSuggestedBufferSize>
  430. *
  431. * <e AVISTREAMINFO.dwSampleSize>
  432. *
  433. * <e AVISTREAMINFO.dwEditCount>
  434. *
  435. * It does change:
  436. *
  437. * <e AVISTREAMINFO.wPriority>
  438. *
  439. * <e AVISTREAMINFO.wLanguage>
  440. *
  441. * <e AVISTREAMINFO.dwScale>
  442. *
  443. * <e AVISTREAMINFO.dwRate>
  444. *
  445. * <e AVISTREAMINFO.dwStart>
  446. *
  447. * <e AVISTREAMINFO.dwQuality>
  448. *
  449. * <e AVISTREAMINFO.rcFrame>
  450. *
  451. * <e AVISTREAMINFO.szName>
  452. *
  453. *************************************************************************/
  454. /**************************************************************************
  455. * @doc EXTERNAL EditStreamSetName
  456. *
  457. * @api SDTAPI | EditStreamSetName | Assigns a descriptive string to a stream.
  458. *
  459. * @parm PAVISTREAM | pavi | Specifies a handle to an open stream.
  460. *
  461. * @parm LPCSTR | lpszName | Specifies a zero-terminated string
  462. * containing the description of the stream.
  463. *
  464. * @rdesc Returns zero if successful; otherwise returns an error code.
  465. *
  466. * @comm This function updates the <e AVISTREAMINFO.szName> member
  467. * of the <t AVISTREAMINFO> structure.
  468. *
  469. *************************************************************************/
  470. STDAPI AVIMakeStreamFromClipboard(UINT cfFormat, HANDLE hGlobal, PAVISTREAM FAR *ppstream);
  471. /**************************************************************************
  472. * @doc EXTERNAL AVIMakeStreamFromClipboard
  473. *
  474. * @api SDTAPI | AVIMakeStreamFromClipboard | Creates a stream from a
  475. * stream on the Clipboard.
  476. *
  477. * @parm UINT | cfFormat | Specifies a Clipboard flag.
  478. *
  479. * @parm HANDLE | hGlobal | Specifies a handle to an open stream.
  480. *
  481. * @parm PAVISTREAM FAR * | ppstream | Specifies a handle to an open stream.
  482. *
  483. * @rdesc Returns zero if successful; otherwise returns an error code.
  484. *
  485. *************************************************************************/