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