1 #ifndef GWAVI_PRIVATE_H
2 #define GWAVI_PRIVATE_H
3 /*
4  * gwavi_private.h
5  *
6  * gwavi declarations that shall remain private :-)
7  */
8 
9 #include <stdio.h>
10 
11 #ifdef __cplusplus
12 extern "C"
13 {
14 #endif
15 
16   /* structures */
17   struct gwavi_header_t
18   {
19     unsigned int time_delay; /* dwMicroSecPerFrame */
20     unsigned int data_rate;  /* dwMaxBytesPerSec */
21     unsigned int reserved;
22     unsigned int flags;            /* dwFlags */
23     unsigned int number_of_frames; /* dwTotalFrames */
24     unsigned int initial_frames;   /* dwInitialFrames */
25     unsigned int data_streams;     /* dwStreams */
26     unsigned int buffer_size;      /* dwSuggestedBufferSize */
27     unsigned int width;            /* dwWidth */
28     unsigned int height;           /* dwHeight */
29     unsigned int time_scale;
30     unsigned int playback_data_rate;
31     unsigned int starting_time;
32     unsigned int data_length;
33   };
34 
35   struct gwavi_stream_header_t
36   {
37     char data_type[5];  /* fccType */
38     char codec[5];      /* fccHandler */
39     unsigned int flags; /* dwFlags */
40     unsigned int priority;
41     unsigned int initial_frames; /* dwInitialFrames */
42     unsigned int time_scale;     /* dwScale */
43     unsigned int data_rate;      /* dwRate */
44     unsigned int start_time;     /* dwStart */
45     unsigned int data_length;    /* dwLength */
46     unsigned int buffer_size;    /* dwSuggestedBufferSize */
47     unsigned int video_quality;  /* dwQuality */
48     /**
49      * Value between 0-10000. If set to -1, drivers use default quality
50      * value.
51      */
52     int audio_quality;
53     unsigned int sample_size; /* dwSampleSize */
54   };
55 
56   struct gwavi_stream_format_v_t
57   {
58     unsigned int header_size;
59     unsigned int width;
60     unsigned int height;
61     unsigned short int num_planes;
62     unsigned short int bits_per_pixel;
63     unsigned int compression_type;
64     unsigned int image_size;
65     unsigned int x_pels_per_meter;
66     unsigned int y_pels_per_meter;
67     unsigned int colors_used;
68     unsigned int colors_important;
69     unsigned int* palette;
70     unsigned int palette_count;
71   };
72 
73   struct gwavi_stream_format_a_t
74   {
75     unsigned short format_type;
76     unsigned int channels;
77     unsigned int sample_rate;
78     unsigned int bytes_per_second;
79     unsigned int block_align;
80     unsigned int bits_per_sample;
81     unsigned short size;
82   };
83 
84   struct gwavi_t
85   {
86     FILE* out;
87     struct gwavi_header_t avi_header;
88     struct gwavi_stream_header_t stream_header_v;
89     struct gwavi_stream_format_v_t stream_format_v;
90     struct gwavi_stream_header_t stream_header_a;
91     struct gwavi_stream_format_a_t stream_format_a;
92     long marker;
93     int offsets_ptr;
94     int offsets_len;
95     long offsets_start;
96     unsigned int* offsets;
97     int offset_count;
98   };
99 
100   struct gwavi_audio_t
101   {
102     unsigned int channels;
103     unsigned int bits;
104     unsigned int samples_per_second;
105   };
106 
107 #ifdef __cplusplus
108 }
109 #endif
110 
111 #endif /* ndef GWAVI_PRIVATE_H */
112