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.

766 lines
24 KiB

  1. /****************************************************************************
  2. *
  3. * AVIFILE.H
  4. *
  5. * routines for reading Standard AVI files
  6. *
  7. * Copyright (c) 1992 - 1994 Microsoft Corporation. All Rights Reserved.
  8. *
  9. * You have a royalty-free right to use, modify, reproduce and
  10. * distribute the Sample Files (and/or any modified version) in
  11. * any way you find useful, provided that you agree that
  12. * Microsoft has no warranty obligations or liability for any
  13. * Sample Application Files which are modified.
  14. *
  15. ***************************************************************************/
  16. #if !defined( _AVIFILE_H_ )
  17. #define _AVIFILE_H_
  18. #ifdef __cplusplus
  19. extern "C" { /* Assume C declarations for C++ */
  20. #endif /* __cplusplus */
  21. // begin_vfw32
  22. /*
  23. * Ansi - Unicode thunking.
  24. *
  25. * Unicode or Ansi-only apps can call the avifile APIs.
  26. * any Win32 app who wants to use
  27. * any of the AVI COM interfaces must be UNICODE - the AVISTREAMINFO and
  28. * AVIFILEINFO structures used in the Info methods of these interfaces are
  29. * the unicode variants, and no thunking to or from ansi takes place
  30. * except in the AVIFILE api entrypoints.
  31. *
  32. * For Ansi/Unicode thunking: for each entrypoint or structure that
  33. * uses chars or strings, two versions are declared in the Win32 version,
  34. * ApiNameW and ApiNameA. The default name ApiName is #defined to one or
  35. * other of these depending on whether UNICODE is defined (during
  36. * compilation of the app that is including this header). The source will
  37. * contain ApiName and ApiNameA (with ApiName being the Win16 implementation,
  38. * and also #defined to ApiNameW, and ApiNameA being the thunk entrypoint).
  39. *
  40. */
  41. #ifndef mmioFOURCC
  42. #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
  43. ( (DWORD)(BYTE)(ch0) | ( (DWORD)(BYTE)(ch1) << 8 ) | \
  44. ( (DWORD)(BYTE)(ch2) << 16 ) | ( (DWORD)(BYTE)(ch3) << 24 ) )
  45. #endif
  46. #ifndef streamtypeVIDEO
  47. #define streamtypeVIDEO mmioFOURCC('v', 'i', 'd', 's')
  48. #define streamtypeAUDIO mmioFOURCC('a', 'u', 'd', 's')
  49. #define streamtypeMIDI mmioFOURCC('m', 'i', 'd', 's')
  50. #define streamtypeTEXT mmioFOURCC('t', 'x', 't', 's')
  51. #endif
  52. #ifndef AVIIF_KEYFRAME
  53. #define AVIIF_KEYFRAME 0x00000010L // this frame is a key frame.
  54. #endif
  55. //
  56. // Structures used by AVIStreamInfo & AVIFileInfo.
  57. //
  58. // These are related to, but not identical to, the header chunks
  59. // in an AVI file.
  60. //
  61. /*
  62. *
  63. * --- AVISTREAMINFO ------------------------------------------------
  64. *
  65. * for Unicode/Ansi thunking we need to declare three versions of this!
  66. */
  67. // end_vfw32
  68. #ifdef WIN32
  69. // begin_vfw32
  70. typedef struct _AVISTREAMINFOW {
  71. DWORD fccType;
  72. DWORD fccHandler;
  73. DWORD dwFlags; /* Contains AVITF_* flags */
  74. DWORD dwCaps;
  75. WORD wPriority;
  76. WORD wLanguage;
  77. DWORD dwScale;
  78. DWORD dwRate; /* dwRate / dwScale == samples/second */
  79. DWORD dwStart;
  80. DWORD dwLength; /* In units above... */
  81. DWORD dwInitialFrames;
  82. DWORD dwSuggestedBufferSize;
  83. DWORD dwQuality;
  84. DWORD dwSampleSize;
  85. RECT rcFrame;
  86. DWORD dwEditCount;
  87. DWORD dwFormatChangeCount;
  88. WCHAR szName[64];
  89. } AVISTREAMINFOW, FAR * LPAVISTREAMINFOW;
  90. typedef struct _AVISTREAMINFOA {
  91. DWORD fccType;
  92. DWORD fccHandler;
  93. DWORD dwFlags; /* Contains AVITF_* flags */
  94. DWORD dwCaps;
  95. WORD wPriority;
  96. WORD wLanguage;
  97. DWORD dwScale;
  98. DWORD dwRate; /* dwRate / dwScale == samples/second */
  99. DWORD dwStart;
  100. DWORD dwLength; /* In units above... */
  101. DWORD dwInitialFrames;
  102. DWORD dwSuggestedBufferSize;
  103. DWORD dwQuality;
  104. DWORD dwSampleSize;
  105. RECT rcFrame;
  106. DWORD dwEditCount;
  107. DWORD dwFormatChangeCount;
  108. char szName[64];
  109. } AVISTREAMINFOA, FAR * LPAVISTREAMINFOA;
  110. #ifdef UNICODE
  111. #define AVISTREAMINFO AVISTREAMINFOW
  112. #define LPAVISTREAMINFO LPAVISTREAMINFOW
  113. #else
  114. #define AVISTREAMINFO AVISTREAMINFOA
  115. #define LPAVISTREAMINFO LPAVISTREAMINFOA
  116. #endif
  117. // end_vfw32
  118. #else //win16 variant
  119. #define AVISTREAMINFOW AVISTREAMINFO
  120. typedef struct _AVISTREAMINFO {
  121. DWORD fccType;
  122. DWORD fccHandler;
  123. DWORD dwFlags; /* Contains AVITF_* flags */
  124. DWORD dwCaps;
  125. WORD wPriority;
  126. WORD wLanguage;
  127. DWORD dwScale;
  128. DWORD dwRate; /* dwRate / dwScale == samples/second */
  129. DWORD dwStart;
  130. DWORD dwLength; /* In units above... */
  131. DWORD dwInitialFrames;
  132. DWORD dwSuggestedBufferSize;
  133. DWORD dwQuality;
  134. DWORD dwSampleSize;
  135. RECT rcFrame;
  136. DWORD dwEditCount;
  137. DWORD dwFormatChangeCount;
  138. char szName[64];
  139. } AVISTREAMINFO, FAR * LPAVISTREAMINFO;
  140. #endif
  141. // begin_vfw32
  142. #define AVISTREAMINFO_DISABLED 0x00000001
  143. #define AVISTREAMINFO_FORMATCHANGES 0x00010000
  144. /*
  145. * --- AVIFILEINFO ----------------------------------------------------
  146. *
  147. */
  148. // end_vfw32
  149. #ifdef WIN32
  150. // begin_vfw32
  151. typedef struct _AVIFILEINFOW {
  152. DWORD dwMaxBytesPerSec; // max. transfer rate
  153. DWORD dwFlags; // the ever-present flags
  154. DWORD dwCaps;
  155. DWORD dwStreams;
  156. DWORD dwSuggestedBufferSize;
  157. DWORD dwWidth;
  158. DWORD dwHeight;
  159. DWORD dwScale;
  160. DWORD dwRate; /* dwRate / dwScale == samples/second */
  161. DWORD dwLength;
  162. DWORD dwEditCount;
  163. WCHAR szFileType[64]; // descriptive string for file type?
  164. } AVIFILEINFOW, FAR * LPAVIFILEINFOW;
  165. typedef struct _AVIFILEINFOA {
  166. DWORD dwMaxBytesPerSec; // max. transfer rate
  167. DWORD dwFlags; // the ever-present flags
  168. DWORD dwCaps;
  169. DWORD dwStreams;
  170. DWORD dwSuggestedBufferSize;
  171. DWORD dwWidth;
  172. DWORD dwHeight;
  173. DWORD dwScale;
  174. DWORD dwRate; /* dwRate / dwScale == samples/second */
  175. DWORD dwLength;
  176. DWORD dwEditCount;
  177. char szFileType[64]; // descriptive string for file type?
  178. } AVIFILEINFOA, FAR * LPAVIFILEINFOA;
  179. #ifdef UNICODE
  180. #define AVIFILEINFO AVIFILEINFOW
  181. #define LPAVIFILEINFO LPAVIFILEINFOW
  182. #else
  183. #define AVIFILEINFO AVIFILEINFOA
  184. #define LPAVIFILEINFO LPAVIFILEINFOA
  185. #endif
  186. // end_vfw32
  187. #else // win16 variant
  188. #define AVIFILEINFOW AVIFILEINFO
  189. typedef struct _AVIFILEINFO {
  190. DWORD dwMaxBytesPerSec; // max. transfer rate
  191. DWORD dwFlags; // the ever-present flags
  192. DWORD dwCaps;
  193. DWORD dwStreams;
  194. DWORD dwSuggestedBufferSize;
  195. DWORD dwWidth;
  196. DWORD dwHeight;
  197. DWORD dwScale;
  198. DWORD dwRate; /* dwRate / dwScale == samples/second */
  199. DWORD dwLength;
  200. DWORD dwEditCount;
  201. char szFileType[64]; // descriptive string for file type?
  202. } AVIFILEINFO, FAR * LPAVIFILEINFO;
  203. #endif
  204. // begin_vfw32
  205. // Flags for dwFlags
  206. #define AVIFILEINFO_HASINDEX 0x00000010
  207. #define AVIFILEINFO_MUSTUSEINDEX 0x00000020
  208. #define AVIFILEINFO_ISINTERLEAVED 0x00000100
  209. #define AVIFILEINFO_WASCAPTUREFILE 0x00010000
  210. #define AVIFILEINFO_COPYRIGHTED 0x00020000
  211. // Flags for dwCaps
  212. #define AVIFILECAPS_CANREAD 0x00000001
  213. #define AVIFILECAPS_CANWRITE 0x00000002
  214. #define AVIFILECAPS_ALLKEYFRAMES 0x00000010
  215. #define AVIFILECAPS_NOCOMPRESSION 0x00000020
  216. typedef BOOL (FAR PASCAL * AVISAVECALLBACK)(int);
  217. /************************************************************************/
  218. /* Declaration for the AVICOMPRESSOPTIONS structure. Make sure it */
  219. /* matches the AutoDoc in avisave.c !!! */
  220. /************************************************************************/
  221. typedef struct {
  222. DWORD fccType; /* stream type, for consistency */
  223. DWORD fccHandler; /* compressor */
  224. DWORD dwKeyFrameEvery; /* keyframe rate */
  225. DWORD dwQuality; /* compress quality 0-10,000 */
  226. DWORD dwBytesPerSecond; /* bytes per second */
  227. DWORD dwFlags; /* flags... see below */
  228. LPVOID lpFormat; /* save format */
  229. DWORD cbFormat;
  230. LPVOID lpParms; /* compressor options */
  231. DWORD cbParms;
  232. DWORD dwInterleaveEvery; /* for non-video streams only */
  233. } AVICOMPRESSOPTIONS, FAR *LPAVICOMPRESSOPTIONS;
  234. //
  235. // Defines for the dwFlags field of the AVICOMPRESSOPTIONS struct
  236. // Each of these flags determines if the appropriate field in the structure
  237. // (dwInterleaveEvery, dwBytesPerSecond, and dwKeyFrameEvery) is payed
  238. // attention to. See the autodoc in avisave.c for details.
  239. //
  240. #define AVICOMPRESSF_INTERLEAVE 0x00000001 // interleave
  241. #define AVICOMPRESSF_DATARATE 0x00000002 // use a data rate
  242. #define AVICOMPRESSF_KEYFRAMES 0x00000004 // use keyframes
  243. #define AVICOMPRESSF_VALID 0x00000008 // has valid data?
  244. // end_vfw32
  245. #ifdef __cplusplus
  246. } /* End of extern "C" { */
  247. #endif /* __cplusplus */
  248. #include "aviiface.h"
  249. #ifdef __cplusplus
  250. extern "C" { /* Assume C declarations for C++ */
  251. #endif /* __cplusplus */
  252. // begin2_vfw32
  253. //
  254. // functions
  255. //
  256. STDAPI_(void) AVIFileInit(void); // Call this first!
  257. STDAPI_(void) AVIFileExit(void);
  258. STDAPI_(ULONG) AVIFileAddRef (PAVIFILE pfile);
  259. STDAPI_(ULONG) AVIFileRelease (PAVIFILE pfile);
  260. #ifdef WIN32
  261. STDAPI AVIFileOpenA (PAVIFILE FAR * ppfile, LPCSTR szFile,
  262. UINT uMode, LPCLSID lpHandler);
  263. STDAPI AVIFileOpenW (PAVIFILE FAR * ppfile, LPCWSTR szFile,
  264. UINT uMode, LPCLSID lpHandler);
  265. #ifdef UNICODE
  266. #define AVIFileOpen AVIFileOpenW
  267. #else
  268. #define AVIFileOpen AVIFileOpenA
  269. #endif
  270. #else // win16
  271. STDAPI AVIFileOpen (PAVIFILE FAR * ppfile, LPCSTR szFile,
  272. UINT uMode, LPCLSID lpHandler);
  273. #endif
  274. #ifdef WIN32
  275. STDAPI AVIFileInfoW (PAVIFILE pfile, LPAVIFILEINFOW pfi, LONG lSize);
  276. STDAPI AVIFileInfoA (PAVIFILE pfile, LPAVIFILEINFOA pfi, LONG lSize);
  277. #ifdef UNICODE
  278. #define AVIFileInfo AVIFileInfoW
  279. #else
  280. #define AVIFileInfo AVIFileInfoA
  281. #endif
  282. #else //win16 version
  283. STDAPI AVIFileInfo (PAVIFILE pfile, LPAVIFILEINFO pfi, LONG lSize);
  284. #endif
  285. STDAPI AVIFileGetStream (PAVIFILE pfile, PAVISTREAM FAR * ppavi, DWORD fccType, LONG lParam);
  286. STDAPI AVIFileCreateStream (PAVIFILE pfile,
  287. PAVISTREAM FAR *ppavi,
  288. AVISTREAMINFOW FAR *psi);
  289. STDAPI AVIFileWriteData (PAVIFILE pfile,
  290. DWORD ckid,
  291. LPVOID lpData,
  292. LONG cbData);
  293. STDAPI AVIFileReadData (PAVIFILE pfile,
  294. DWORD ckid,
  295. LPVOID lpData,
  296. LONG FAR *lpcbData);
  297. STDAPI AVIFileEndRecord (PAVIFILE pfile);
  298. STDAPI_(ULONG) AVIStreamAddRef (PAVISTREAM pavi);
  299. STDAPI_(ULONG) AVIStreamRelease (PAVISTREAM pavi);
  300. // end2_vfw32
  301. #ifdef WIN32
  302. // begin2_vfw32
  303. STDAPI AVIStreamInfoW (PAVISTREAM pavi, LPAVISTREAMINFOW psi, LONG lSize);
  304. STDAPI AVIStreamInfoA (PAVISTREAM pavi, LPAVISTREAMINFOA psi, LONG lSize);
  305. #ifdef UNICODE
  306. #define AVIStreamInfo AVIStreamInfoW
  307. #else
  308. #define AVIStreamInfo AVIStreamInfoA
  309. #endif
  310. // end2_vfw32
  311. #else // win16
  312. STDAPI AVIStreamInfo (PAVISTREAM pavi, LPAVISTREAMINFO psi, LONG lSize);
  313. #endif
  314. // begin2_vfw32
  315. STDAPI_(LONG) AVIStreamFindSample(PAVISTREAM pavi, LONG lPos, LONG lFlags);
  316. STDAPI AVIStreamReadFormat (PAVISTREAM pavi, LONG lPos,LPVOID lpFormat,LONG FAR *lpcbFormat);
  317. STDAPI AVIStreamSetFormat (PAVISTREAM pavi, LONG lPos,LPVOID lpFormat,LONG cbFormat);
  318. STDAPI AVIStreamReadData (PAVISTREAM pavi, DWORD fcc, LPVOID lp, LONG FAR *lpcb);
  319. STDAPI AVIStreamWriteData (PAVISTREAM pavi, DWORD fcc, LPVOID lp, LONG cb);
  320. STDAPI AVIStreamRead (PAVISTREAM pavi,
  321. LONG lStart,
  322. LONG lSamples,
  323. LPVOID lpBuffer,
  324. LONG cbBuffer,
  325. LONG FAR * plBytes,
  326. LONG FAR * plSamples);
  327. #define AVISTREAMREAD_CONVENIENT (-1L)
  328. STDAPI AVIStreamWrite (PAVISTREAM pavi,
  329. LONG lStart, LONG lSamples,
  330. LPVOID lpBuffer, LONG cbBuffer, DWORD dwFlags,
  331. LONG FAR *plSampWritten,
  332. LONG FAR *plBytesWritten);
  333. // Right now, these just use AVIStreamInfo() to get information, then
  334. // return some of it. Can they be more efficient?
  335. STDAPI_(LONG) AVIStreamStart (PAVISTREAM pavi);
  336. STDAPI_(LONG) AVIStreamLength (PAVISTREAM pavi);
  337. STDAPI_(LONG) AVIStreamTimeToSample (PAVISTREAM pavi, LONG lTime);
  338. STDAPI_(LONG) AVIStreamSampleToTime (PAVISTREAM pavi, LONG lSample);
  339. STDAPI AVIStreamBeginStreaming(PAVISTREAM pavi, LONG lStart, LONG lEnd, LONG lRate);
  340. STDAPI AVIStreamEndStreaming(PAVISTREAM pavi);
  341. //
  342. // helper functions for using IGetFrame
  343. //
  344. STDAPI_(PGETFRAME) AVIStreamGetFrameOpen(PAVISTREAM pavi,
  345. LPBITMAPINFOHEADER lpbiWanted);
  346. STDAPI_(LPVOID) AVIStreamGetFrame(PGETFRAME pg, LONG lPos);
  347. STDAPI AVIStreamGetFrameClose(PGETFRAME pg);
  348. // !!! We need some way to place an advise on a stream....
  349. // STDAPI AVIStreamHasChanged (PAVISTREAM pavi);
  350. // Shortcut function
  351. // end2_vfw32
  352. #ifdef WIN32
  353. // begin2_vfw32
  354. STDAPI AVIStreamOpenFromFileA(PAVISTREAM FAR *ppavi, LPCSTR szFile,
  355. DWORD fccType, LONG lParam,
  356. UINT mode, CLSID FAR *pclsidHandler);
  357. STDAPI AVIStreamOpenFromFileW(PAVISTREAM FAR *ppavi, LPCWSTR szFile,
  358. DWORD fccType, LONG lParam,
  359. UINT mode, CLSID FAR *pclsidHandler);
  360. #ifdef UNICODE
  361. #define AVIStreamOpenFromFile AVIStreamOpenFromFileW
  362. #else
  363. #define AVIStreamOpenFromFile AVIStreamOpenFromFileA
  364. #endif
  365. // end2_vfw32
  366. #else // win16
  367. STDAPI AVIStreamOpenFromFile(PAVISTREAM FAR *ppavi, LPCSTR szFile,
  368. DWORD fccType, LONG lParam,
  369. UINT mode, CLSID FAR *pclsidHandler);
  370. #endif
  371. // begin2_vfw32
  372. // Use to create disembodied streams
  373. STDAPI AVIStreamCreate(PAVISTREAM FAR *ppavi, LONG lParam1, LONG lParam2,
  374. CLSID FAR *pclsidHandler);
  375. // PHANDLER AVIAPI AVIGetHandler (PAVISTREAM pavi, PAVISTREAMHANDLER psh);
  376. // PAVISTREAM AVIAPI AVIGetStream (PHANDLER p);
  377. //
  378. // flags for AVIStreamFindSample
  379. //
  380. #define FIND_DIR 0x0000000FL // direction
  381. #define FIND_NEXT 0x00000001L // go forward
  382. #define FIND_PREV 0x00000004L // go backward
  383. #define FIND_TYPE 0x000000F0L // type mask
  384. #define FIND_KEY 0x00000010L // find key frame.
  385. #define FIND_ANY 0x00000020L // find any (non-empty) sample
  386. #define FIND_FORMAT 0x00000040L // find format change
  387. #define FIND_RET 0x0000F000L // return mask
  388. #define FIND_POS 0x00000000L // return logical position
  389. #define FIND_LENGTH 0x00001000L // return logical size
  390. #define FIND_OFFSET 0x00002000L // return physical position
  391. #define FIND_SIZE 0x00003000L // return physical size
  392. #define FIND_INDEX 0x00004000L // return physical index position
  393. //
  394. // stuff to support backward compat.
  395. //
  396. #define AVIStreamFindKeyFrame AVIStreamFindSample
  397. #define FindKeyFrame FindSample
  398. #define AVIStreamClose AVIStreamRelease
  399. #define AVIFileClose AVIFileRelease
  400. #define AVIStreamInit AVIFileInit
  401. #define AVIStreamExit AVIFileExit
  402. #define SEARCH_NEAREST FIND_PREV
  403. #define SEARCH_BACKWARD FIND_PREV
  404. #define SEARCH_FORWARD FIND_NEXT
  405. #define SEARCH_KEY FIND_KEY
  406. #define SEARCH_ANY FIND_ANY
  407. //
  408. // helper macros.
  409. //
  410. #define AVIStreamSampleToSample(pavi1, pavi2, l) \
  411. AVIStreamTimeToSample(pavi1,AVIStreamSampleToTime(pavi2, l))
  412. #define AVIStreamNextSample(pavi, l) \
  413. AVIStreamFindSample(pavi,l+1,FIND_NEXT|FIND_ANY)
  414. #define AVIStreamPrevSample(pavi, l) \
  415. AVIStreamFindSample(pavi,l-1,FIND_PREV|FIND_ANY)
  416. #define AVIStreamNearestSample(pavi, l) \
  417. AVIStreamFindSample(pavi,l,FIND_PREV|FIND_ANY)
  418. #define AVIStreamNextKeyFrame(pavi,l) \
  419. AVIStreamFindSample(pavi,l+1,FIND_NEXT|FIND_KEY)
  420. #define AVIStreamPrevKeyFrame(pavi, l) \
  421. AVIStreamFindSample(pavi,l-1,FIND_PREV|FIND_KEY)
  422. #define AVIStreamNearestKeyFrame(pavi, l) \
  423. AVIStreamFindSample(pavi,l,FIND_PREV|FIND_KEY)
  424. #define AVIStreamIsKeyFrame(pavi, l) \
  425. (AVIStreamNearestKeyFrame(pavi,l) == l)
  426. #define AVIStreamPrevSampleTime(pavi, t) \
  427. AVIStreamSampleToTime(pavi, AVIStreamPrevSample(pavi,AVIStreamTimeToSample(pavi,t)))
  428. #define AVIStreamNextSampleTime(pavi, t) \
  429. AVIStreamSampleToTime(pavi, AVIStreamNextSample(pavi,AVIStreamTimeToSample(pavi,t)))
  430. #define AVIStreamNearestSampleTime(pavi, t) \
  431. AVIStreamSampleToTime(pavi, AVIStreamNearestSample(pavi,AVIStreamTimeToSample(pavi,t)))
  432. #define AVIStreamNextKeyFrameTime(pavi, t) \
  433. AVIStreamSampleToTime(pavi, AVIStreamNextKeyFrame(pavi,AVIStreamTimeToSample(pavi, t)))
  434. #define AVIStreamPrevKeyFrameTime(pavi, t) \
  435. AVIStreamSampleToTime(pavi, AVIStreamPrevKeyFrame(pavi,AVIStreamTimeToSample(pavi, t)))
  436. #define AVIStreamNearestKeyFrameTime(pavi, t) \
  437. AVIStreamSampleToTime(pavi, AVIStreamNearestKeyFrame(pavi,AVIStreamTimeToSample(pavi, t)))
  438. #define AVIStreamStartTime(pavi) \
  439. AVIStreamSampleToTime(pavi, AVIStreamStart(pavi))
  440. #define AVIStreamLengthTime(pavi) \
  441. AVIStreamSampleToTime(pavi, AVIStreamLength(pavi))
  442. #define AVIStreamEnd(pavi) \
  443. (AVIStreamStart(pavi) + AVIStreamLength(pavi))
  444. #define AVIStreamEndTime(pavi) \
  445. AVIStreamSampleToTime(pavi, AVIStreamEnd(pavi))
  446. #define AVIStreamSampleSize(pavi, lPos, plSize) \
  447. AVIStreamRead(pavi,lPos,1,NULL,0,plSize,NULL)
  448. #define AVIStreamFormatSize(pavi, lPos, plSize) \
  449. AVIStreamReadFormat(pavi,lPos,NULL,plSize)
  450. #define AVIStreamDataSize(pavi, fcc, plSize) \
  451. AVIStreamReadData(pavi,fcc,NULL,plSize)
  452. /****************************************************************************
  453. *
  454. * AVISave routines and structures
  455. *
  456. ***************************************************************************/
  457. #ifndef comptypeDIB
  458. #define comptypeDIB mmioFOURCC('D', 'I', 'B', ' ')
  459. #endif
  460. STDAPI AVIMakeCompressedStream(
  461. PAVISTREAM FAR * ppsCompressed,
  462. PAVISTREAM ppsSource,
  463. AVICOMPRESSOPTIONS FAR * lpOptions,
  464. CLSID FAR *pclsidHandler);
  465. // end2_vfw32
  466. #ifdef WIN32
  467. // begin2_vfw32
  468. EXTERN_C HRESULT CDECL AVISaveA (LPCSTR szFile,
  469. CLSID FAR *pclsidHandler,
  470. AVISAVECALLBACK lpfnCallback,
  471. int nStreams,
  472. PAVISTREAM pfile,
  473. LPAVICOMPRESSOPTIONS lpOptions,
  474. ...);
  475. STDAPI AVISaveVA(LPCSTR szFile,
  476. CLSID FAR *pclsidHandler,
  477. AVISAVECALLBACK lpfnCallback,
  478. int nStreams,
  479. PAVISTREAM FAR * ppavi,
  480. LPAVICOMPRESSOPTIONS FAR *plpOptions);
  481. EXTERN_C HRESULT CDECL AVISaveW (LPCWSTR szFile,
  482. CLSID FAR *pclsidHandler,
  483. AVISAVECALLBACK lpfnCallback,
  484. int nStreams,
  485. PAVISTREAM pfile,
  486. LPAVICOMPRESSOPTIONS lpOptions,
  487. ...);
  488. STDAPI AVISaveVW(LPCWSTR szFile,
  489. CLSID FAR *pclsidHandler,
  490. AVISAVECALLBACK lpfnCallback,
  491. int nStreams,
  492. PAVISTREAM FAR * ppavi,
  493. LPAVICOMPRESSOPTIONS FAR *plpOptions);
  494. #ifdef UNICODE
  495. #define AVISave AVISaveW
  496. #define AVISaveV AVISaveVW
  497. #else
  498. #define AVISave AVISaveA
  499. #define AVISaveV AVISaveVA
  500. #endif
  501. // end2_vfw32
  502. #else // Win16
  503. EXTERN_C HRESULT CDECL AVISave (LPCTSTR szFile,
  504. CLSID FAR *pclsidHandler,
  505. AVISAVECALLBACK lpfnCallback,
  506. int nStreams,
  507. PAVISTREAM pfile,
  508. LPAVICOMPRESSOPTIONS lpOptions,
  509. ...);
  510. STDAPI AVISaveV(LPCTSTR szFile,
  511. CLSID FAR *pclsidHandler,
  512. AVISAVECALLBACK lpfnCallback,
  513. int nStreams,
  514. PAVISTREAM FAR * ppavi,
  515. LPAVICOMPRESSOPTIONS FAR *plpOptions);
  516. #endif
  517. // begin2_vfw32
  518. STDAPI_(BOOL) AVISaveOptions(HWND hwnd,
  519. UINT uiFlags,
  520. int nStreams,
  521. PAVISTREAM FAR *ppavi,
  522. LPAVICOMPRESSOPTIONS FAR *plpOptions);
  523. STDAPI AVISaveOptionsFree(int nStreams,
  524. LPAVICOMPRESSOPTIONS FAR *plpOptions);
  525. // FLAGS FOR uiFlags:
  526. //
  527. // Same as the flags for ICCompressorChoose (see compman.h)
  528. // These determine what the compression options dialog for video streams
  529. // will look like.
  530. // end2_vfw32
  531. #ifdef WIN32
  532. // begin2_vfw32
  533. STDAPI AVIBuildFilterW(LPWSTR lpszFilter, LONG cbFilter, BOOL fSaving);
  534. STDAPI AVIBuildFilterA(LPSTR lpszFilter, LONG cbFilter, BOOL fSaving);
  535. #ifdef UNICODE
  536. #define AVIBuildFilter AVIBuildFilterW
  537. #else
  538. #define AVIBuildFilter AVIBuildFilterA
  539. #endif
  540. // end2_vfw32
  541. #else //win16
  542. STDAPI AVIBuildFilter(LPTSTR lpszFilter, LONG cbFilter, BOOL fSaving);
  543. #endif
  544. // begin2_vfw32
  545. STDAPI AVIMakeFileFromStreams(PAVIFILE FAR * ppfile,
  546. int nStreams,
  547. PAVISTREAM FAR * papStreams);
  548. STDAPI AVIMakeStreamFromClipboard(UINT cfFormat, HANDLE hGlobal, PAVISTREAM FAR *ppstream);
  549. /****************************************************************************
  550. *
  551. * Clipboard routines
  552. *
  553. ***************************************************************************/
  554. STDAPI AVIPutFileOnClipboard(PAVIFILE pf);
  555. STDAPI AVIGetFromClipboard(PAVIFILE FAR * lppf);
  556. STDAPI AVIClearClipboard(void);
  557. /****************************************************************************
  558. *
  559. * Editing routines
  560. *
  561. ***************************************************************************/
  562. STDAPI CreateEditableStream(
  563. PAVISTREAM FAR * ppsEditable,
  564. PAVISTREAM psSource);
  565. STDAPI EditStreamCut(PAVISTREAM pavi, LONG FAR *plStart, LONG FAR *plLength, PAVISTREAM FAR * ppResult);
  566. STDAPI EditStreamCopy(PAVISTREAM pavi, LONG FAR *plStart, LONG FAR *plLength, PAVISTREAM FAR * ppResult);
  567. STDAPI EditStreamPaste(PAVISTREAM pavi, LONG FAR *plPos, LONG FAR *plLength, PAVISTREAM pstream, LONG lStart, LONG lEnd);
  568. STDAPI EditStreamClone(PAVISTREAM pavi, PAVISTREAM FAR *ppResult);
  569. // end2_vfw32
  570. #ifdef WIN32
  571. // begin2_vfw32
  572. STDAPI EditStreamSetNameA(PAVISTREAM pavi, LPCSTR lpszName);
  573. STDAPI EditStreamSetNameW(PAVISTREAM pavi, LPCWSTR lpszName);
  574. STDAPI EditStreamSetInfoW(PAVISTREAM pavi, LPAVISTREAMINFOW lpInfo, LONG cbInfo);
  575. STDAPI EditStreamSetInfoA(PAVISTREAM pavi, LPAVISTREAMINFOA lpInfo, LONG cbInfo);
  576. #ifdef UNICODE
  577. #define EditStreamSetInfo EditStreamSetInfoW
  578. #define EditStreamSetName EditStreamSetNameW
  579. #else
  580. #define EditStreamSetInfo EditStreamSetInfoA
  581. #define EditStreamSetName EditStreamSetNameA
  582. #endif
  583. // end2_vfw32
  584. #else // win16
  585. STDAPI EditStreamSetInfo(PAVISTREAM pavi, LPAVISTREAMINFO lpInfo, LONG cbInfo);
  586. STDAPI EditStreamSetName(PAVISTREAM pavi, LPCTSTR lpszName);
  587. #endif
  588. #ifdef __cplusplus
  589. } /* End of extern "C" { */
  590. #endif /* __cplusplus */
  591. #endif
  592. // begin2_vfw32
  593. /* - - - - - - - - */
  594. #ifndef AVIERR_OK
  595. #define AVIERR_OK 0L
  596. #define MAKE_AVIERR(error) MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, 0x4000 + error)
  597. // !!! Questions to be answered:
  598. // How can you get a string form of these errors?
  599. // Which of these errors should be replaced by errors in SCODE.H?
  600. #define AVIERR_UNSUPPORTED MAKE_AVIERR(101)
  601. #define AVIERR_BADFORMAT MAKE_AVIERR(102)
  602. #define AVIERR_MEMORY MAKE_AVIERR(103)
  603. #define AVIERR_INTERNAL MAKE_AVIERR(104)
  604. #define AVIERR_BADFLAGS MAKE_AVIERR(105)
  605. #define AVIERR_BADPARAM MAKE_AVIERR(106)
  606. #define AVIERR_BADSIZE MAKE_AVIERR(107)
  607. #define AVIERR_BADHANDLE MAKE_AVIERR(108)
  608. #define AVIERR_FILEREAD MAKE_AVIERR(109)
  609. #define AVIERR_FILEWRITE MAKE_AVIERR(110)
  610. #define AVIERR_FILEOPEN MAKE_AVIERR(111)
  611. #define AVIERR_COMPRESSOR MAKE_AVIERR(112)
  612. #define AVIERR_NOCOMPRESSOR MAKE_AVIERR(113)
  613. #define AVIERR_READONLY MAKE_AVIERR(114)
  614. #define AVIERR_NODATA MAKE_AVIERR(115)
  615. #define AVIERR_BUFFERTOOSMALL MAKE_AVIERR(116)
  616. #define AVIERR_CANTCOMPRESS MAKE_AVIERR(117)
  617. #define AVIERR_USERABORT MAKE_AVIERR(198)
  618. #define AVIERR_ERROR MAKE_AVIERR(199)
  619. #endif
  620. // end2_vfw32