annotate libmpdemux/aviheader.h @ 25840:1fb0ef174cb1

Add QDM2 codec identifier
author reimar
date Sat, 26 Jan 2008 21:41:30 +0000
parents 9d0b189ce1b2
children 4129c8cfa742
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
23689
3f0d00abc073 Do not use leading underscores in multiple inclusion guards, they are reserved.
diego
parents: 21531
diff changeset
1 #ifndef AVIHEADER_H
3f0d00abc073 Do not use leading underscores in multiple inclusion guards, they are reserved.
diego
parents: 21531
diff changeset
2 #define AVIHEADER_H
1343
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
3
1485
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
4 //#include "config.h" /* get correct definition WORDS_BIGENDIAN */
21372
1767c271d710 Remove bswap.h, use libavutil/bswap.h instead.
diego
parents: 15905
diff changeset
5 #include "libavutil/common.h"
21507
fa99b3d31d13 Hack around libavutil/bswap.h compilation problems due to always_inline undefined.
reimar
parents: 21372
diff changeset
6 #include "mpbswap.h"
1343
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
7
12341
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
8 #ifndef mmioFOURCC
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
9 #define mmioFOURCC( ch0, ch1, ch2, ch3 ) \
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
10 ( (uint32_t)(uint8_t)(ch0) | ( (uint32_t)(uint8_t)(ch1) << 8 ) | \
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
11 ( (uint32_t)(uint8_t)(ch2) << 16 ) | ( (uint32_t)(uint8_t)(ch3) << 24 ) )
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
12 #endif
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
13
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
14 /* Macro to make a TWOCC out of two characters */
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
15 #ifndef aviTWOCC
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
16 #define aviTWOCC(ch0, ch1) ((uint16_t)(uint8_t)(ch0) | ((uint16_t)(uint8_t)(ch1) << 8))
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
17 #endif
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
18
12356
6a61d694f7d3 minimal fix for alex's 1000000000000l compile errors. imo the fix in
rfelker
parents: 12345
diff changeset
19 //typedef uint16_t TWOCC;
6a61d694f7d3 minimal fix for alex's 1000000000000l compile errors. imo the fix in
rfelker
parents: 12345
diff changeset
20 //typedef uint32_t FOURCC;
12341
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
21
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
22 /* form types, list types, and chunk types */
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
23 #define formtypeAVI mmioFOURCC('A', 'V', 'I', ' ')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
24 #define listtypeAVIHEADER mmioFOURCC('h', 'd', 'r', 'l')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
25 #define ckidAVIMAINHDR mmioFOURCC('a', 'v', 'i', 'h')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
26 #define listtypeSTREAMHEADER mmioFOURCC('s', 't', 'r', 'l')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
27 #define ckidSTREAMHEADER mmioFOURCC('s', 't', 'r', 'h')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
28 #define ckidSTREAMFORMAT mmioFOURCC('s', 't', 'r', 'f')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
29 #define ckidSTREAMHANDLERDATA mmioFOURCC('s', 't', 'r', 'd')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
30 #define ckidSTREAMNAME mmioFOURCC('s', 't', 'r', 'n')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
31
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
32 #define listtypeAVIMOVIE mmioFOURCC('m', 'o', 'v', 'i')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
33 #define listtypeAVIRECORD mmioFOURCC('r', 'e', 'c', ' ')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
34
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
35 #define ckidAVINEWINDEX mmioFOURCC('i', 'd', 'x', '1')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
36
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
37 /*
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
38 ** Stream types for the <fccType> field of the stream header.
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
39 */
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
40 #define streamtypeVIDEO mmioFOURCC('v', 'i', 'd', 's')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
41 #define streamtypeAUDIO mmioFOURCC('a', 'u', 'd', 's')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
42 #define streamtypeMIDI mmioFOURCC('m', 'i', 'd', 's')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
43 #define streamtypeTEXT mmioFOURCC('t', 'x', 't', 's')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
44
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
45 /* Basic chunk types */
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
46 #define cktypeDIBbits aviTWOCC('d', 'b')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
47 #define cktypeDIBcompressed aviTWOCC('d', 'c')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
48 #define cktypePALchange aviTWOCC('p', 'c')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
49 #define cktypeWAVEbytes aviTWOCC('w', 'b')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
50
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
51 /* Chunk id to use for extra chunks for padding. */
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
52 #define ckidAVIPADDING mmioFOURCC('J', 'U', 'N', 'K')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
53
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
54 /* flags for use in <dwFlags> in AVIFileHdr */
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
55 #define AVIF_HASINDEX 0x00000010 // Index at end of file?
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
56 #define AVIF_MUSTUSEINDEX 0x00000020
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
57 #define AVIF_ISINTERLEAVED 0x00000100
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
58 #define AVIF_TRUSTCKTYPE 0x00000800 // Use CKType to find key frames?
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
59 #define AVIF_WASCAPTUREFILE 0x00010000
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
60 #define AVIF_COPYRIGHTED 0x00020000
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
61
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
62 typedef struct
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
63 {
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
64 uint32_t dwMicroSecPerFrame; // frame display rate (or 0L)
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
65 uint32_t dwMaxBytesPerSec; // max. transfer rate
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
66 uint32_t dwPaddingGranularity; // pad to multiples of this
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
67 // size; normally 2K.
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
68 uint32_t dwFlags; // the ever-present flags
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
69 uint32_t dwTotalFrames; // # frames in file
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
70 uint32_t dwInitialFrames;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
71 uint32_t dwStreams;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
72 uint32_t dwSuggestedBufferSize;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
73
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
74 uint32_t dwWidth;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
75 uint32_t dwHeight;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
76
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
77 uint32_t dwReserved[4];
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
78 } MainAVIHeader;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
79
12345
886fe66a2b2d dewinify
alex
parents: 12341
diff changeset
80 typedef struct rectangle_t {
12341
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
81 short left;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
82 short top;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
83 short right;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
84 short bottom;
12345
886fe66a2b2d dewinify
alex
parents: 12341
diff changeset
85 } rectangle_t;
12341
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
86
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
87 typedef struct {
12356
6a61d694f7d3 minimal fix for alex's 1000000000000l compile errors. imo the fix in
rfelker
parents: 12345
diff changeset
88 uint32_t fccType;
6a61d694f7d3 minimal fix for alex's 1000000000000l compile errors. imo the fix in
rfelker
parents: 12345
diff changeset
89 uint32_t fccHandler;
12341
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
90 uint32_t dwFlags; /* Contains AVITF_* flags */
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
91 uint16_t wPriority;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
92 uint16_t wLanguage;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
93 uint32_t dwInitialFrames;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
94 uint32_t dwScale;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
95 uint32_t dwRate; /* dwRate / dwScale == samples/second */
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
96 uint32_t dwStart;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
97 uint32_t dwLength; /* In units above... */
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
98 uint32_t dwSuggestedBufferSize;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
99 uint32_t dwQuality;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
100 uint32_t dwSampleSize;
12345
886fe66a2b2d dewinify
alex
parents: 12341
diff changeset
101 rectangle_t rcFrame;
12341
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
102 } AVIStreamHeader;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
103
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
104 /* Flags for index */
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
105 #define AVIIF_LIST 0x00000001L // chunk is a 'LIST'
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
106 #define AVIIF_KEYFRAME 0x00000010L // this frame is a key frame.
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
107
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
108 #define AVIIF_NOTIME 0x00000100L // this frame doesn't take any time
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
109 #define AVIIF_COMPUSE 0x0FFF0000L // these bits are for compressor use
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
110
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
111 #define FOURCC_RIFF mmioFOURCC('R', 'I', 'F', 'F')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
112 #define FOURCC_LIST mmioFOURCC('L', 'I', 'S', 'T')
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
113
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
114 typedef struct
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
115 {
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
116 uint32_t ckid;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
117 uint32_t dwFlags;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
118 uint32_t dwChunkOffset; // Position of chunk
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
119 uint32_t dwChunkLength; // Length of chunk
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
120 } AVIINDEXENTRY;
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
121
0db4a3a5b01d removed loader/ dependancy, imported some files from g2, also used patches from Dominik Mierzejewski
alex
parents: 12046
diff changeset
122
25607
9d0b189ce1b2 Fix illegal identifiers: Names starting with __ or _ and uppercase are reserved
diego
parents: 25545
diff changeset
123 typedef struct avisuperindex_entry {
12036
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
124 uint64_t qwOffset; // absolute file offset
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
125 uint32_t dwSize; // size of index chunk at this offset
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
126 uint32_t dwDuration; // time span in stream ticks
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
127 } avisuperindex_entry;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
128
25607
9d0b189ce1b2 Fix illegal identifiers: Names starting with __ or _ and uppercase are reserved
diego
parents: 25545
diff changeset
129 typedef struct avistdindex_entry {
12036
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
130 uint32_t dwOffset; // qwBaseOffset + this is absolute file offset
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
131 uint32_t dwSize; // bit 31 is set if this is NOT a keyframe
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
132 } avistdindex_entry;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
133
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
134 // Standard index
25607
9d0b189ce1b2 Fix illegal identifiers: Names starting with __ or _ and uppercase are reserved
diego
parents: 25545
diff changeset
135 typedef struct __attribute__((packed)) avistdindex_chunk {
12036
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
136 char fcc[4]; // ix##
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
137 uint32_t dwSize; // size of this chunk
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
138 uint16_t wLongsPerEntry; // must be sizeof(aIndex[0])/sizeof(DWORD)
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
139 uint8_t bIndexSubType; // must be 0
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
140 uint8_t bIndexType; // must be AVI_INDEX_OF_CHUNKS
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
141 uint32_t nEntriesInUse; // first unused entry
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
142 char dwChunkId[4]; // '##dc' or '##db' or '##wb' etc..
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
143 uint64_t qwBaseOffset; // all dwOffsets in aIndex array are relative to this
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
144 uint32_t dwReserved3; // must be 0
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
145 avistdindex_entry *aIndex; // the actual frames
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
146 } avistdindex_chunk;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
147
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
148
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
149 // Base Index Form 'indx'
25607
9d0b189ce1b2 Fix illegal identifiers: Names starting with __ or _ and uppercase are reserved
diego
parents: 25545
diff changeset
150 typedef struct avisuperindex_chunk {
12036
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
151 char fcc[4];
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
152 uint32_t dwSize; // size of this chunk
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
153 uint16_t wLongsPerEntry; // size of each entry in aIndex array (must be 4*4 for us)
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
154 uint8_t bIndexSubType; // future use. must be 0
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
155 uint8_t bIndexType; // one of AVI_INDEX_* codes
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
156 uint32_t nEntriesInUse; // index of first unused member in aIndex array
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
157 char dwChunkId[4]; // fcc of what is indexed
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
158 uint32_t dwReserved[3]; // meaning differs for each index type/subtype.
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
159 // 0 if unused
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
160 avisuperindex_entry *aIndex; // position of ix## chunks
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
161 avistdindex_chunk *stdidx; // the actual std indices
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
162 } avisuperindex_chunk;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
163
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
164 typedef struct {
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
165 uint32_t CompressedBMHeight;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
166 uint32_t CompressedBMWidth;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
167 uint32_t ValidBMHeight;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
168 uint32_t ValidBMWidth;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
169 uint32_t ValidBMXOffset;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
170 uint32_t ValidBMYOffset;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
171 uint32_t VideoXOffsetInT;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
172 uint32_t VideoYValidStartLine;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
173 } VIDEO_FIELD_DESC;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
174
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
175 typedef struct {
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
176 uint32_t VideoFormatToken;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
177 uint32_t VideoStandard;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
178 uint32_t dwVerticalRefreshRate;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
179 uint32_t dwHTotalInT;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
180 uint32_t dwVTotalInLines;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
181 uint32_t dwFrameAspectRatio;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
182 uint32_t dwFrameWidthInPixels;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
183 uint32_t dwFrameHeightInLines;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
184 uint32_t nbFieldPerFrame;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
185 VIDEO_FIELD_DESC FieldInfo[2];
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
186 } VideoPropHeader;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
187
12357
13e138957b7a more cola, not mine tho
rfelker
parents: 12356
diff changeset
188 typedef enum {
12036
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
189 FORMAT_UNKNOWN,
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
190 FORMAT_PAL_SQUARE,
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
191 FORMAT_PAL_CCIR_601,
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
192 FORMAT_NTSC_SQUARE,
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
193 FORMAT_NTSC_CCIR_601,
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
194 } VIDEO_FORMAT;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
195
12357
13e138957b7a more cola, not mine tho
rfelker
parents: 12356
diff changeset
196 typedef enum {
12036
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
197 STANDARD_UNKNOWN,
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
198 STANDARD_PAL,
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
199 STANDARD_NTSC,
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
200 STANDARD_SECAM
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
201 } VIDEO_STANDARD;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
202
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
203 #define MAKE_AVI_ASPECT(a, b) (((a)<<16)|(b))
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
204 #define GET_AVI_ASPECT(a) ((float)((a)>>16)/(float)((a)&0xffff))
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
205
1343
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
206 /*
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
207 * Some macros to swap little endian structures read from an AVI file
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
208 * into machine endian format
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
209 */
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
210 #ifdef WORDS_BIGENDIAN
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
211 #define le2me_MainAVIHeader(h) { \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
212 (h)->dwMicroSecPerFrame = le2me_32((h)->dwMicroSecPerFrame); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
213 (h)->dwMaxBytesPerSec = le2me_32((h)->dwMaxBytesPerSec); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
214 (h)->dwPaddingGranularity = le2me_32((h)->dwPaddingGranularity); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
215 (h)->dwFlags = le2me_32((h)->dwFlags); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
216 (h)->dwTotalFrames = le2me_32((h)->dwTotalFrames); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
217 (h)->dwInitialFrames = le2me_32((h)->dwInitialFrames); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
218 (h)->dwStreams = le2me_32((h)->dwStreams); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
219 (h)->dwSuggestedBufferSize = le2me_32((h)->dwSuggestedBufferSize); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
220 (h)->dwWidth = le2me_32((h)->dwWidth); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
221 (h)->dwHeight = le2me_32((h)->dwHeight); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
222 }
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
223
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
224 #define le2me_AVIStreamHeader(h) { \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
225 (h)->fccType = le2me_32((h)->fccType); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
226 (h)->fccHandler = le2me_32((h)->fccHandler); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
227 (h)->dwFlags = le2me_32((h)->dwFlags); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
228 (h)->wPriority = le2me_16((h)->wPriority); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
229 (h)->wLanguage = le2me_16((h)->wLanguage); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
230 (h)->dwInitialFrames = le2me_32((h)->dwInitialFrames); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
231 (h)->dwScale = le2me_32((h)->dwScale); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
232 (h)->dwRate = le2me_32((h)->dwRate); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
233 (h)->dwStart = le2me_32((h)->dwStart); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
234 (h)->dwLength = le2me_32((h)->dwLength); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
235 (h)->dwSuggestedBufferSize = le2me_32((h)->dwSuggestedBufferSize); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
236 (h)->dwQuality = le2me_32((h)->dwQuality); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
237 (h)->dwSampleSize = le2me_32((h)->dwSampleSize); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
238 le2me_RECT(&(h)->rcFrame); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
239 }
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
240 #define le2me_RECT(h) { \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
241 (h)->left = le2me_16((h)->left); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
242 (h)->top = le2me_16((h)->top); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
243 (h)->right = le2me_16((h)->right); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
244 (h)->bottom = le2me_16((h)->bottom); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
245 }
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
246 #define le2me_BITMAPINFOHEADER(h) { \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
247 (h)->biSize = le2me_32((h)->biSize); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
248 (h)->biWidth = le2me_32((h)->biWidth); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
249 (h)->biHeight = le2me_32((h)->biHeight); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
250 (h)->biPlanes = le2me_16((h)->biPlanes); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
251 (h)->biBitCount = le2me_16((h)->biBitCount); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
252 (h)->biCompression = le2me_32((h)->biCompression); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
253 (h)->biSizeImage = le2me_32((h)->biSizeImage); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
254 (h)->biXPelsPerMeter = le2me_32((h)->biXPelsPerMeter); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
255 (h)->biYPelsPerMeter = le2me_32((h)->biYPelsPerMeter); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
256 (h)->biClrUsed = le2me_32((h)->biClrUsed); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
257 (h)->biClrImportant = le2me_32((h)->biClrImportant); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
258 }
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
259 #define le2me_WAVEFORMATEX(h) { \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
260 (h)->wFormatTag = le2me_16((h)->wFormatTag); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
261 (h)->nChannels = le2me_16((h)->nChannels); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
262 (h)->nSamplesPerSec = le2me_32((h)->nSamplesPerSec); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
263 (h)->nAvgBytesPerSec = le2me_32((h)->nAvgBytesPerSec); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
264 (h)->nBlockAlign = le2me_16((h)->nBlockAlign); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
265 (h)->wBitsPerSample = le2me_16((h)->wBitsPerSample); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
266 (h)->cbSize = le2me_16((h)->cbSize); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
267 }
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
268 #define le2me_AVIINDEXENTRY(h) { \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
269 (h)->ckid = le2me_32((h)->ckid); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
270 (h)->dwFlags = le2me_32((h)->dwFlags); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
271 (h)->dwChunkOffset = le2me_32((h)->dwChunkOffset); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
272 (h)->dwChunkLength = le2me_32((h)->dwChunkLength); \
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
273 }
12036
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
274 #define le2me_AVISTDIDXCHUNK(h) {\
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
275 char c; \
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
276 c = (h)->fcc[0]; (h)->fcc[0] = (h)->fcc[3]; (h)->fcc[3] = c; \
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
277 c = (h)->fcc[1]; (h)->fcc[1] = (h)->fcc[2]; (h)->fcc[2] = c; \
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
278 (h)->dwSize = le2me_32((h)->dwSize); \
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
279 (h)->wLongsPerEntry = le2me_16((h)->wLongsPerEntry); \
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
280 (h)->nEntriesInUse = le2me_32((h)->nEntriesInUse); \
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
281 c = (h)->dwChunkId[0]; (h)->dwChunkId[0] = (h)->dwChunkId[3]; (h)->dwChunkId[3] = c; \
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
282 c = (h)->dwChunkId[1]; (h)->dwChunkId[1] = (h)->dwChunkId[2]; (h)->dwChunkId[2] = c; \
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
283 (h)->qwBaseOffset = le2me_64((h)->qwBaseOffset); \
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
284 (h)->dwReserved3 = le2me_32((h)->dwReserved3); \
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
285 }
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
286 #define le2me_AVISTDIDXENTRY(h) {\
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
287 (h)->dwOffset = le2me_32((h)->dwOffset); \
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
288 (h)->dwSize = le2me_32((h)->dwSize); \
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
289 }
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
290 #define le2me_VideoPropHeader(h) { \
12046
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
291 (h)->VideoFormatToken = le2me_32((h)->VideoFormatToken); \
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
292 (h)->VideoStandard = le2me_32((h)->VideoStandard); \
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
293 (h)->dwVerticalRefreshRate = le2me_32((h)->dwVerticalRefreshRate); \
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
294 (h)->dwHTotalInT = le2me_32((h)->dwHTotalInT); \
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
295 (h)->dwVTotalInLines = le2me_32((h)->dwVTotalInLines); \
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
296 (h)->dwFrameAspectRatio = le2me_32((h)->dwFrameAspectRatio); \
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
297 (h)->dwFrameWidthInPixels = le2me_32((h)->dwFrameWidthInPixels); \
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
298 (h)->dwFrameHeightInLines = le2me_32((h)->dwFrameHeightInLines); \
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
299 (h)->nbFieldPerFrame = le2me_32((h)->nbFieldPerFrame); \
12036
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
300 }
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
301 #define le2me_VIDEO_FIELD_DESC(h) { \
12046
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
302 (h)->CompressedBMHeight = le2me_32((h)->CompressedBMHeight); \
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
303 (h)->CompressedBMWidth = le2me_32((h)->CompressedBMWidth); \
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
304 (h)->ValidBMHeight = le2me_32((h)->ValidBMHeight); \
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
305 (h)->ValidBMWidth = le2me_32((h)->ValidBMWidth); \
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
306 (h)->ValidBMXOffset = le2me_32((h)->ValidBMXOffset); \
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
307 (h)->ValidBMYOffset = le2me_32((h)->ValidBMYOffset); \
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
308 (h)->VideoXOffsetInT = le2me_32((h)->VideoXOffsetInT); \
cf68f8b514b0 Bigendian macro 10l
ranma
parents: 12036
diff changeset
309 (h)->VideoYValidStartLine = le2me_32((h)->VideoYValidStartLine); \
12036
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
310 }
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
311
1343
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
312 #else
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
313 #define le2me_MainAVIHeader(h) /**/
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
314 #define le2me_AVIStreamHeader(h) /**/
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
315 #define le2me_RECT(h) /**/
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
316 #define le2me_BITMAPINFOHEADER(h) /**/
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
317 #define le2me_WAVEFORMATEX(h) /**/
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
318 #define le2me_AVIINDEXENTRY(h) /**/
12036
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
319 #define le2me_AVISTDIDXCHUNK(h) /**/
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
320 #define le2me_AVISTDIDXENTRY(h) /**/
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
321 #define le2me_VideoPropHeader(h) /**/
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
322 #define le2me_VIDEO_FIELD_DESC(h) /**/
1343
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
323 #endif
ecaa8d0f1649 ASF support for non-x86 cpus
jkeil
parents:
diff changeset
324
1485
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
325 typedef struct {
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
326 // index stuff:
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
327 void* idx;
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
328 int idx_size;
6056
f980563afdbc big (>2GB) AVI files support - patch by Wolfram Gloger <wg@malloc.de>
arpi
parents: 2330
diff changeset
329 off_t idx_pos;
f980563afdbc big (>2GB) AVI files support - patch by Wolfram Gloger <wg@malloc.de>
arpi
parents: 2330
diff changeset
330 off_t idx_pos_a;
f980563afdbc big (>2GB) AVI files support - patch by Wolfram Gloger <wg@malloc.de>
arpi
parents: 2330
diff changeset
331 off_t idx_pos_v;
f980563afdbc big (>2GB) AVI files support - patch by Wolfram Gloger <wg@malloc.de>
arpi
parents: 2330
diff changeset
332 off_t idx_offset; // ennyit kell hozzaadni az index offset ertekekhez
8030
2b39ff3860b7 cleanup of .AVI timestamp calculation (ugly hack from mplayer.c removed,
arpi
parents: 6056
diff changeset
333 // bps-based PTS stuff:
2b39ff3860b7 cleanup of .AVI timestamp calculation (ugly hack from mplayer.c removed,
arpi
parents: 6056
diff changeset
334 int video_pack_no;
2b39ff3860b7 cleanup of .AVI timestamp calculation (ugly hack from mplayer.c removed,
arpi
parents: 6056
diff changeset
335 int audio_block_size;
2b39ff3860b7 cleanup of .AVI timestamp calculation (ugly hack from mplayer.c removed,
arpi
parents: 6056
diff changeset
336 off_t audio_block_no;
1485
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
337 // interleaved PTS stuff:
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
338 int skip_video_frames;
2330
8f0861360325 AVI - no audio stream fix
arpi
parents: 2310
diff changeset
339 int audio_streams;
1485
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
340 float avi_audio_pts;
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
341 float avi_video_pts;
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
342 float pts_correction;
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
343 unsigned int pts_corr_bytes;
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
344 unsigned char pts_corrected;
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
345 unsigned char pts_has_video;
8208
ae5a2ae1c349 demuxer_control(), percent position and time length query implemented in
arpi
parents: 8030
diff changeset
346 unsigned int numberofframes;
12036
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
347 avisuperindex_chunk *suidx;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
348 int suidx_size;
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
349 int isodml;
1485
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
350 } avi_priv_t;
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
351
b895f95e7657 AVI demuxer cleanups, fileformat-dependent stuff moved to priv_t
arpi
parents: 1343
diff changeset
352 #define AVI_PRIV ((avi_priv_t*)(demuxer->priv))
12036
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
353
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
354 #define AVI_IDX_OFFSET(x) ((((uint64_t)(x)->dwFlags&0xffff0000)<<16)+(x)->dwChunkOffset)
846ed866f86c OpenDML read/write support
ranma
parents: 8208
diff changeset
355
25545
0acd5b6453fb Fix wrong #endif comment that does not match the #ifdef directive.
diego
parents: 23689
diff changeset
356 #endif /* AVIHEADER_H */