aviriff.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. /*
  2. * Copyright (C) 2003 Robert Shearman
  3. *
  4. * This library is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with this library; if not, write to the Free Software
  16. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  17. */
  18. typedef struct _riffchunk
  19. {
  20. FOURCC fcc;
  21. DWORD cb;
  22. } RIFFCHUNK, * LPRIFFCHUNK;
  23. typedef struct _rifflist
  24. {
  25. FOURCC fcc;
  26. DWORD cb;
  27. FOURCC fccListType;
  28. } RIFFLIST, * LPRIFFLIST;
  29. #define RIFFROUND(cb) ((cb) + ((cb)&1))
  30. #define RIFFNEXT(pChunk) (LPRIFFCHUNK)((LPBYTE)(pChunk)+sizeof(RIFFCHUNK)+RIFFROUND(((LPRIFFCHUNK)pChunk)->cb))
  31. /* flags for dwFlags member of AVIMAINHEADER */
  32. #define AVIF_HASINDEX 0x00000010
  33. #define AVIF_MUSTUSEINDEX 0x00000020
  34. #define AVIF_ISINTERLEAVED 0x00000100
  35. #define AVIF_TRUSTCKTYPE 0x00000800
  36. #define AVIF_WASCAPTUREFILE 0x00010000
  37. #define AVIF_COPYRIGHTED 0x00020000
  38. typedef struct _avimainheader
  39. {
  40. FOURCC fcc;
  41. DWORD cb;
  42. DWORD dwMicroSecPerFrame;
  43. DWORD dwMaxBytesPerSec;
  44. DWORD dwPaddingGranularity;
  45. DWORD dwFlags;
  46. DWORD dwTotalFrames;
  47. DWORD dwInitialFrames;
  48. DWORD dwStreams;
  49. DWORD dwSuggestedBufferSize;
  50. DWORD dwWidth;
  51. DWORD dwHeight;
  52. DWORD dwReserved[4];
  53. } AVIMAINHEADER;
  54. typedef struct _aviextheader
  55. {
  56. FOURCC fcc;
  57. DWORD cb;
  58. DWORD dwGrandFrames;
  59. DWORD dwFuture[61];
  60. } AVIEXTHEADER;
  61. /* flags for dwFlags member of AVISTREAMHEADER */
  62. #define AVISF_DISABLED 0x00000001
  63. #define AVISF_VIDEO_PALCHANGES 0x00010000
  64. typedef struct _avistreamheader
  65. {
  66. FOURCC fcc;
  67. DWORD cb;
  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. struct
  82. {
  83. short int left;
  84. short int top;
  85. short int right;
  86. short int bottom;
  87. } rcFrame;
  88. } AVISTREAMHEADER;
  89. /* flags for dwFlags member of _avioldindex_entry */
  90. #define AVIIF_LIST 0x00000001
  91. #define AVIIF_KEYFRAME 0x00000010
  92. #define AVIIF_NO_TIME 0x00000100
  93. #define AVIIF_COMPRESSOR 0x0FFF0000
  94. typedef struct _avioldindex
  95. {
  96. FOURCC fcc;
  97. DWORD cb;
  98. struct _avioldindex_entry
  99. {
  100. DWORD dwChunkId;
  101. DWORD dwFlags;
  102. DWORD dwOffset;
  103. DWORD dwSize;
  104. } aIndex[0];
  105. } AVIOLDINDEX;
  106. typedef union _timecode
  107. {
  108. struct
  109. {
  110. WORD wFrameRate;
  111. WORD wFrameFract;
  112. LONG cFrames;
  113. } DUMMYSTRUCTNAME;
  114. DWORDLONG qw;
  115. } TIMECODE;
  116. #define TIMECODE_RATE_30DROP 0
  117. /* flags for dwSMPTEflags member of TIMECODEDATA */
  118. #define TIMECODE_SMPTE_BINARY_GROUP 0x07
  119. #define TIMECODE_SMPTE_COLOR_FRAME 0x08
  120. typedef struct _timecodedata
  121. {
  122. TIMECODE time;
  123. DWORD dwSMPTEflags;
  124. DWORD dwUser;
  125. } TIMECODEDATA;
  126. #define AVI_INDEX_OF_INDEXES 0x00
  127. #define AVI_INDEX_OF_CHUNKS 0x01
  128. #define AVI_INDEX_OF_TIMED_CHUNKS 0x02
  129. #define AVI_INDEX_OF_SUB_2FIELD 0x03
  130. #define AVI_INDEX_IS_DATA 0x80
  131. #define AVI_INDEX_SUB_DEFAULT 0x00
  132. #define AVI_INDEX_SUB_2FIELD 0x01
  133. typedef struct _avimetaindex
  134. {
  135. FOURCC fcc;
  136. UINT cb;
  137. WORD wLongsPerEntry;
  138. BYTE bIndexSubType;
  139. BYTE bIndexType;
  140. DWORD nEntriesInUse;
  141. DWORD dwChunkId;
  142. DWORD dwReserved[3];
  143. DWORD adwIndex[0];
  144. } AVIMETAINDEX;
  145. /* FIXME: index structures missing */