avifmt.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /**
  2. * This file is part of the mingw-w64 runtime package.
  3. * No warranty is given; refer to the file DISCLAIMER within this package.
  4. */
  5. #include <winapifamily.h>
  6. /* The contents of this file is duplicated in vfw.h */
  7. #ifndef _INC_AVIFMT
  8. #define _INC_AVIFMT 100
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. #if WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
  13. #ifndef mmioFOURCC
  14. #define mmioFOURCC(ch0, ch1, ch2, ch3) ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24))
  15. #endif
  16. #ifndef aviTWOCC
  17. #define aviTWOCC(ch0, ch1) ((WORD) (BYTE) (ch0) | ((WORD) (BYTE) (ch1) << 8))
  18. #endif
  19. typedef WORD TWOCC;
  20. #define formtypeAVI mmioFOURCC('A', 'V', 'I', ' ')
  21. #define listtypeAVIHEADER mmioFOURCC('h', 'd', 'r', 'l')
  22. #define ckidAVIMAINHDR mmioFOURCC('a', 'v', 'i', 'h')
  23. #define listtypeSTREAMHEADER mmioFOURCC('s', 't', 'r', 'l')
  24. #define ckidSTREAMHEADER mmioFOURCC('s', 't', 'r', 'h')
  25. #define ckidSTREAMFORMAT mmioFOURCC('s', 't', 'r', 'f')
  26. #define ckidSTREAMHANDLERDATA mmioFOURCC('s', 't', 'r', 'd')
  27. #define ckidSTREAMNAME mmioFOURCC('s', 't', 'r', 'n')
  28. #define listtypeAVIMOVIE mmioFOURCC('m', 'o', 'v', 'i')
  29. #define listtypeAVIRECORD mmioFOURCC('r', 'e', 'c', ' ')
  30. #define ckidAVINEWINDEX mmioFOURCC('i', 'd', 'x', '1')
  31. #define streamtypeVIDEO mmioFOURCC('v', 'i', 'd', 's')
  32. #define streamtypeAUDIO mmioFOURCC('a', 'u', 'd', 's')
  33. #define streamtypeMIDI mmioFOURCC('m', 'i', 'd', 's')
  34. #define streamtypeTEXT mmioFOURCC('t', 'x', 't', 's')
  35. #define cktypeDIBbits aviTWOCC('d', 'b')
  36. #define cktypeDIBcompressed aviTWOCC('d', 'c')
  37. #define cktypePALchange aviTWOCC('p', 'c')
  38. #define cktypeWAVEbytes aviTWOCC('w', 'b')
  39. #define ckidAVIPADDING mmioFOURCC('J', 'U', 'N', 'K')
  40. #define FromHex(n) (((n) >= 'A') ? ((n) + 10 - 'A') : ((n) - '0'))
  41. #define StreamFromFOURCC(fcc) ((WORD) ((FromHex(LOBYTE(LOWORD(fcc))) << 4) + (FromHex(HIBYTE(LOWORD(fcc))))))
  42. #define TWOCCFromFOURCC(fcc) HIWORD(fcc)
  43. #define ToHex(n) ((BYTE) (((n) > 9) ? ((n) - 10 + 'A') : ((n) + '0')))
  44. #define MAKEAVICKID(tcc, stream) MAKELONG((ToHex((stream) & 0xf) << 8) | (ToHex(((stream) & 0xf0) >> 4)), tcc)
  45. #define AVIF_HASINDEX 0x00000010
  46. #define AVIF_MUSTUSEINDEX 0x00000020
  47. #define AVIF_ISINTERLEAVED 0x00000100
  48. #define AVIF_TRUSTCKTYPE 0x00000800
  49. #define AVIF_WASCAPTUREFILE 0x00010000
  50. #define AVIF_COPYRIGHTED 0x00020000
  51. #define AVI_HEADERSIZE 2048
  52. typedef struct {
  53. DWORD dwMicroSecPerFrame;
  54. DWORD dwMaxBytesPerSec;
  55. DWORD dwPaddingGranularity;
  56. DWORD dwFlags;
  57. DWORD dwTotalFrames;
  58. DWORD dwInitialFrames;
  59. DWORD dwStreams;
  60. DWORD dwSuggestedBufferSize;
  61. DWORD dwWidth;
  62. DWORD dwHeight;
  63. DWORD dwReserved[4];
  64. } MainAVIHeader;
  65. #define AVISF_DISABLED 0x00000001
  66. #define AVISF_VIDEO_PALCHANGES 0x00010000
  67. typedef struct {
  68. FOURCC fccType;
  69. FOURCC fccHandler;
  70. DWORD dwFlags;
  71. WORD wPriority;
  72. WORD wLanguage;
  73. DWORD dwInitialFrames;
  74. DWORD dwScale;
  75. DWORD dwRate;
  76. DWORD dwStart;
  77. DWORD dwLength;
  78. DWORD dwSuggestedBufferSize;
  79. DWORD dwQuality;
  80. DWORD dwSampleSize;
  81. RECT rcFrame;
  82. } AVIStreamHeader;
  83. #define AVIIF_LIST __MSABI_LONG(0x00000001)
  84. #define AVIIF_KEYFRAME __MSABI_LONG(0x00000010)
  85. #define AVIIF_FIRSTPART __MSABI_LONG(0x00000020)
  86. #define AVIIF_LASTPART __MSABI_LONG(0x00000040)
  87. #define AVIIF_MIDPART (AVIIF_LASTPART|AVIIF_FIRSTPART)
  88. #define AVIIF_NOTIME __MSABI_LONG(0x00000100)
  89. #define AVIIF_COMPUSE __MSABI_LONG(0x0fff0000)
  90. typedef struct {
  91. DWORD ckid;
  92. DWORD dwFlags;
  93. DWORD dwChunkOffset;
  94. DWORD dwChunkLength;
  95. } AVIINDEXENTRY;
  96. typedef struct {
  97. BYTE bFirstEntry;
  98. BYTE bNumEntries;
  99. WORD wFlags;
  100. PALETTEENTRY peNew[];
  101. } AVIPALCHANGE;
  102. #endif
  103. #ifdef __cplusplus
  104. }
  105. #endif
  106. #endif