13 //class IAviWriteFile;
15 //class IAviReadStream;
17 #define MAX_STREAMS 256
19 class FileAVI
: public FileBase
22 FileAVI(Asset
*asset
, File
*file
);
25 static int check_sig(Asset
*asset
);
26 static void get_parameters(BC_WindowBase
*parent_window
,
28 BC_WindowBase
* &format_window
,
33 int get_best_colormodel(int driver
, int colormodel
);
34 int open_file(int rd
, int wr
);
37 int set_audio_position(int64_t x
);
38 int set_video_position(int64_t x
);
39 int write_samples(double **buffer
, int64_t len
);
40 int write_frames(VFrame
***frames
, int len
);
41 int write_compressed_frame(VFrame
*buffer
);
42 int read_compressed_frame(VFrame
*buffer
);
43 int64_t compressed_frame_size();
44 int read_samples(double *buffer
, int64_t len
);
45 int read_frame(VFrame
*frame
);
46 static char* vcodec_to_fourcc(char *input
, char *output
);
47 static char* fourcc_to_vcodec(char *input
, char *output
);
48 static char* acodec_to_fourcc(char *input
, char *output
);
49 static char* fourcc_to_acodec(char *input
, char *output
);
50 static int cmodel_bc_to_avi(int input
);
52 static void initialize_avifile();
56 static int check_sig_arne2(Asset
*asset
, int &score
);
57 static int check_sig_arne1(Asset
*asset
, int &score
);
58 static int check_sig_lavtools(Asset
*asset
, int &score
);
59 static int check_sig_avifile(Asset
*asset
, int &score
);
61 int open_avifile_in(Asset
*asset
);
62 int open_arne2_in(Asset
*asset
);
63 int open_arne1_in(Asset
*asset
);
64 int open_lavtools_in(Asset
*asset
);
67 int open_avifile_out(Asset
*asset
);
68 int open_arne2_out(Asset
*asset
);
69 int open_arne1_out(Asset
*asset
);
70 int open_lavtools_out(Asset
*asset
);
73 IAviWriteFile
*out_fd
;
76 IAviReadStream
*astream_in
[MAX_STREAMS
];
77 IAviReadStream
*vstream_in
[MAX_STREAMS
];
78 IAviWriteStream
*astream_out
[MAX_STREAMS
];
79 IAviVideoWriteStream
*vstream_out
[MAX_STREAMS
];
81 BitmapInfo
*out_bitmap_info
;
82 static int avifile_initialized
;
92 unsigned char *temp_audio
;
93 int64_t temp_allocated
;
100 class AVIACodecList
: public BC_PopupTextBox
103 AVIACodecList(AVIConfigAudio
*gui
, int x
, int y
);
111 class AVIConfigAudio
: public BC_Window
114 AVIConfigAudio(BC_WindowBase
*parent_window
, Asset
*asset
);
117 static int calculate_w(int format
);
118 static int calculate_h(int format
);
119 int create_objects();
121 int generate_codeclist();
122 void update_codecs();
126 ArrayList
<BC_ListBoxItem
*> codec_items
;
127 ArrayList
<BC_ISlider
*> attribute_sliders
;
128 BC_WindowBase
*parent_window
;
130 char string
[BCTEXTLEN
];
133 class AVIConfigVideo
;
135 class AVIVCodecList
: public BC_PopupTextBox
138 AVIVCodecList(AVIConfigVideo
*gui
, int x
, int y
);
146 class AVIVAttributeList
: public BC_ListBox
149 AVIVAttributeList(AVIConfigVideo
*gui
, int x
, int y
);
151 int selection_changed();
155 class AVIVAttribute
: public BC_TextBox
158 AVIVAttribute(AVIConfigVideo
*gui
, int x
, int y
);
163 class AVIConfigVideo
: public BC_Window
166 AVIConfigVideo(BC_WindowBase
*parent_window
,
168 int lock_compressor
);
171 static int calculate_w(int format
);
172 static int calculate_h(int format
);
173 int create_objects();
175 int generate_codeclist();
176 void generate_attributelist();
177 void update_attribute(int recursive
);
178 // Get text associated with current attribute
179 char* get_current_attribute_text();
180 char* get_current_attribute_value();
181 void set_current_attribute(char *text
);
185 AVIVAttributeList
*attributes
;
186 AVIVAttribute
*attribute
;
187 ArrayList
<BC_ListBoxItem
*> codec_items
;
188 ArrayList
<BC_ListBoxItem
*> attribute_items
[2];
189 BC_WindowBase
*parent_window
;
192 char string
[BCTEXTLEN
];