summaryrefslogtreecommitdiff
path: root/noncore/multimedia/camera/jpegtoavi/avifmt.h
blob: 53ce60d106d9caf662deec74d40f8403fe14c218 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#ifndef _AVIFMT_HH_
#define _AVIFMT_HH_

/* 4 bytes */
typedef int WORD;
typedef unsigned int DWORD;
/* 1 byte */
typedef char BYTE;


/* flags for use in flags in AVI_avih */
const DWORD AVIF_HASINDEX=0x00000010;	/* index at end of file */
const DWORD AVIF_MUSTUSEINDEX=0x00000020;
const DWORD AVIF_ISINTERLEAVED=0x00000100;
const DWORD AVIF_TRUSTCKTYPE=0x00000800;
const DWORD AVIF_WASCAPTUREFILE=0x00010000;
const DWORD AVIF_COPYRIGHTED=0x00020000;


struct AVI_avih {
  DWORD	us_per_frame;	// frame display rate (or 0L)
  DWORD max_bytes_per_sec;	// max. transfer rate
  DWORD padding;	// pad to multiples of this size;
  // normally 2K.
  DWORD flags;
  DWORD tot_frames;		// # frames in file
  DWORD init_frames;
  DWORD streams;
  DWORD buff_sz;  
  DWORD width;
  DWORD height;
  DWORD reserved[4];
};


struct AVI_strh {
  unsigned char type[4];      /* stream type */
  unsigned char handler[4];
  DWORD flags;
  DWORD priority;
  DWORD init_frames;       /* initial frames (???) */
  DWORD scale;
  DWORD rate;
  DWORD start;
  DWORD length;
  DWORD buff_sz;           /* suggested buffer size */
  DWORD quality;
  DWORD sample_sz;
  /*
  DWORD frame[4];
     XXX 16 bytes ? */
};


struct AVI_strf {       /* == BitMapInfoHeader */
  DWORD sz;
  DWORD width;
  DWORD height;
  DWORD planes_bit_cnt;
  unsigned char compression[4];
  DWORD image_sz;
  DWORD xpels_meter;
  DWORD ypels_meter;
  DWORD num_colors;        /* used colors */
  DWORD imp_colors;        /* important colors */
  /* may be more for some codecs */
};


struct AVI_list_hdr {
  unsigned char id[4];
  DWORD sz;
  unsigned char type[4];
};


struct AVI_list_odml {
  struct AVI_list_hdr list_hdr;

  unsigned char id[4];
  DWORD sz;
  DWORD frames;
};


struct AVI_list_strl {
  struct AVI_list_hdr list_hdr;
  
  /* chunk strh */
  unsigned char strh_id[4];
  DWORD strh_sz;
  struct AVI_strh strh;

  /* chunk strf */
  unsigned char strf_id[4];
  DWORD strf_sz;
  struct AVI_strf strf;

  /* list odml */
  struct AVI_list_odml list_odml;
};


struct AVI_list_hdrl {
  struct AVI_list_hdr list_hdr;

  /* chunk avih */
  unsigned char avih_id[4];
  DWORD avih_sz;
  struct AVI_avih avih;
  
  /* list strl */
  struct AVI_list_strl strl;
};

#endif