00001 struct AVIAudioInfo {
00002 int freq, chs, bits;
00003 uint16 codec;
00004 int stmidx;
00005 };
00006
00007 #define AVI_PCM 0x0001
00008 #define AVI_MP3 0x0055
00009
00010 struct AVIVideoInfo {
00011 int x, y;
00012 int fps;
00013 uint32 codec;
00014 uint32 compression;
00015 uint32 framecnt;
00016 int stmidx;
00017 };
00018
00019 #define AVI_MAX_STREAMS 4
00020
00021 struct AVI_index;
00022
00023 class AVI : public SystemCode {
00024 private:
00025 File *f;
00026 BOOL create;
00027 BOOL Valid;
00028 BOOL done;
00029 int framecnt;
00030 int rifflen, riffoff;
00031 int headeroff;
00032 int movilen, movioff;
00033 int vidlen, vidoff;
00034 int audlen, audoff;
00035 int dmlheaderoff;
00036 BOOL vid, aud;
00037 List<AVI_index *> idxlst;
00038 uint32 idxoff;
00039 int audstr, vidstr;
00040 int stmoff[AVI_MAX_STREAMS];
00041 public:
00042 AVI();
00043 ~AVI();
00044
00045 BOOL Open(File *f, AVIAudioInfo *, AVIVideoInfo *);
00046 BOOL Create(File *f, AVIAudioInfo *, AVIVideoInfo *);
00047 BOOL Close();
00048
00049 uint32 streams[AVI_MAX_STREAMS];
00050 int streamcnt;
00051
00052 BOOL GetChunk(void **chunk, int *len, int *stmidx, int *flgs);
00053 BOOL GetChunk(void **chunk, int *len, int stmidx, int *flgs);
00054
00055 BOOL AddChunk(void *chunk, int len, BOOL video, int flgs);
00056 };
00057
00058
00059 #define AVI_RIFF 0x46464952 //"RIFF"
00060 #define AVI_AVI 0x20495641 //"AVI "
00061 #define AVI_LIST 0x5453494c //"LIST"
00062 #define AVI_hdrl 0x6c726468 //"hdrl"
00063 #define AVI_avih 0x68697661 //"avih" //AVI_header
00064 #define AVI_strl 0x6c727473 //"strl"
00065 #define AVI_strh 0x68727473 //"strh" //AVI_streamheader
00066 #define AVI_vids 0x73646976 //"vids"
00067 #define AVI_auds 0x73647561 //"auds"
00068 #define AVI_divx 0x78766964 //"divx"
00069 #define AVI_strf 0x66727473 //"strf" //AVI_videoformat | AVI_audioformat
00070 #define AVI_DX50 0x30355844 //"DX50"
00071 #define AVI_odml 0x6c6d646f //"odml"
00072 #define AVI_dmlh 0x686c6d64 //"dmlh"
00073 #define AVI_movi 0x69766f6d //"movi"
00074 #define AVI_JUNK 0x4b4e554a //"JUNK"
00075 #define AVI_idx1 0x31786469 //"idx1"
00076
00077 #define AVI_VIDC 43444956 //"VIDC" (used by VFW functions only)
00078
00079
00080 #define AVI_FLG_HASINDEX 0x00010
00081 #define AVI_FLG_MUSTUSEINDEX 0x00020
00082 #define AVI_FLG_ISINTERLEAVED 0x00100
00083 #define AVI_FLG_TRUSTCKTYPE 0x00800
00084 #define AVI_FLG_WASCAPTUREFILE 0x10000
00085 #define AVI_FLG_COPYRIGHTED 0x20000
00086
00087
00088 #define AVI_FLG_KEYFRAME 0x0010 //always set for audio chunks, 1st video chunk, and keyframe video chunks
00089
00090
00091