Linux kernel & device driver programming

Cross-Referenced Linux and Device Driver Code

[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ]
Version: [ 2.6.11.8 ] [ 2.6.25 ] [ 2.6.25.8 ] [ 2.6.31.13 ] Architecture: [ i386 ]
  1 #include <inttypes.h>
  2 #include "byteswap.h"
  3 
  4 #if BYTE_ORDER == BIG_ENDIAN
  5 # define AVI_SWAP2(a) SWAP2((a))
  6 # define AVI_SWAP4(a) SWAP4((a))
  7 #else
  8 # define AVI_SWAP2(a) (a)
  9 # define AVI_SWAP4(a) (a)
 10 #endif
 11 
 12 #define WAVE_FORMAT_PCM                 (0x0001)
 13 #define WAVE_FORMAT_ALAW                (0x0006)
 14 #define WAVE_FORMAT_MULAW               (0x0007)
 15 
 16 #define AVIF_HASINDEX                   0x10
 17 
 18 struct RIFF_avih {
 19     uint32_t us_frame;          /* microsec per frame */
 20     uint32_t bps;               /* byte/s overall */
 21     uint32_t unknown1;          /* pad_gran (???) */
 22     uint32_t flags;
 23     uint32_t frames;            /* # of frames (all) */
 24     uint32_t init_frames;       /* initial frames (???) */
 25     uint32_t streams;
 26     uint32_t bufsize;           /* suggested buffer size */
 27     uint32_t width;
 28     uint32_t height;
 29     uint32_t scale;
 30     uint32_t rate;
 31     uint32_t start;
 32     uint32_t length;
 33 };
 34 
 35 struct RIFF_strh {
 36     unsigned char type[4];      /* stream type */
 37     unsigned char handler[4];
 38     uint32_t flags;
 39     uint32_t priority;
 40     uint32_t init_frames;       /* initial frames (???) */
 41     uint32_t scale;
 42     uint32_t rate;
 43     uint32_t start;
 44     uint32_t length;
 45     uint32_t bufsize;           /* suggested buffer size */
 46     uint32_t quality;
 47     uint32_t samplesize;
 48     /* XXX 16 bytes ? */
 49 };
 50 
 51 struct RIFF_strf_vids {       /* == BitMapInfoHeader */
 52     uint32_t size;
 53     uint32_t width;
 54     uint32_t height;
 55     uint16_t planes;
 56     uint16_t bit_cnt;
 57     unsigned char compression[4];
 58     uint32_t image_size;
 59     uint32_t xpels_meter;
 60     uint32_t ypels_meter;
 61     uint32_t num_colors;        /* used colors */
 62     uint32_t imp_colors;        /* important colors */
 63     /* may be more for some codecs */
 64 };
 65 
 66 struct RIFF_strf_auds {       /* == WaveHeader (?) */
 67     uint16_t format;
 68     uint16_t channels;
 69     uint32_t rate;
 70     uint32_t av_bps;
 71     uint16_t blockalign;
 72     uint16_t size;
 73 };
 74 
 75 struct AVI_HDR {
 76     unsigned char            riff_id[4];
 77     uint32_t                 riff_size;
 78     unsigned char            riff_type[4];
 79 
 80     unsigned char              hdrl_list_id[4];
 81     uint32_t                   hdrl_size;
 82     unsigned char              hdrl_type[4];
 83 
 84     unsigned char                avih_id[4];
 85     uint32_t                     avih_size;
 86     struct RIFF_avih             avih;
 87 };
 88 
 89 struct AVIX_HDR {
 90     unsigned char            riff_id[4];
 91     uint32_t                 riff_size;
 92     unsigned char            riff_type[4];
 93 
 94     unsigned char              data_list_id[4];
 95     uint32_t                   data_size;
 96     unsigned char              data_type[4];
 97 };
 98 
 99 struct AVI_HDR_VIDEO {
100     unsigned char                strl_list_id[4];
101     uint32_t                     strl_size;
102     unsigned char                strl_type[4];
103 
104     unsigned char                  strh_id[4];
105     uint32_t                       strh_size;
106     struct RIFF_strh               strh;
107 
108     unsigned char                  strf_id[4];
109     uint32_t                       strf_size;
110     struct RIFF_strf_vids          strf;
111 };
112 
113 struct AVI_HDR_AUDIO {
114     unsigned char                strl_list_id[4];
115     uint32_t                     strl_size;
116     unsigned char                strl_type[4];
117 
118     unsigned char                  strh_id[4];
119     uint32_t                       strh_size;
120     struct RIFF_strh               strh;
121 
122     unsigned char                  strf_id[4];
123     uint32_t                       strf_size;
124     struct RIFF_strf_auds          strf;
125 };
126 
127 struct AVI_HDR_ODML {
128     unsigned char                strl_list_id[4];
129     uint32_t                     strl_size;
130     unsigned char                strl_type[4];
131 
132     unsigned char                  strh_id[4];
133     uint32_t                       strh_size;
134     uint32_t                       total_frames;
135 };
136 
137 struct AVI_DATA {
138     unsigned char              data_list_id[4];
139     uint32_t                   data_size;
140     unsigned char              data_type[4];
141 
142     /* audio+video data follows */
143     
144 };
145 
146 struct CHUNK_HDR {
147     unsigned char             id[4];
148     uint32_t                  size;
149 };
150 
151 struct IDX_RECORD {
152     unsigned char             id[4];
153     uint32_t                  flags;
154     uint32_t                  offset;
155     uint32_t                  size;
156 };
157 
158 
  This page was automatically generated by the LXR engine.