14 //class IAviWriteFile;
16 //class IAviReadStream;
18 #define MAX_STREAMS 256
20 class FileAVI
: public FileBase
23 FileAVI(Asset
*asset
, File
*file
);
26 static int check_sig(Asset
*asset
);
27 static void get_parameters(BC_WindowBase
*parent_window
,
29 BC_WindowBase
* &format_window
,
32 char *locked_compressor
);
34 int get_best_colormodel(int driver
, int colormodel
);
35 int open_file(int rd
, int wr
);
38 int set_audio_position(int64_t x
);
39 int set_video_position(int64_t x
);
40 int write_samples(double **buffer
, int64_t len
);
41 int write_frames(VFrame
***frames
, int len
);
42 int write_compressed_frame(VFrame
*buffer
);
43 int read_compressed_frame(VFrame
*buffer
);
44 int64_t compressed_frame_size();
45 int read_samples(double *buffer
, int64_t len
);
46 int read_frame(VFrame
*frame
);
47 static char* vcodec_to_fourcc(char *input
, char *output
);
48 static char* fourcc_to_vcodec(char *input
, char *output
);
49 static char* acodec_to_fourcc(char *input
, char *output
);
50 static char* fourcc_to_acodec(char *input
, char *output
);
51 static int cmodel_bc_to_avi(int input
);
53 static void initialize_avifile();
57 static int check_sig_arne2(Asset
*asset
, int &score
);
58 static int check_sig_arne1(Asset
*asset
, int &score
);
59 static int check_sig_lavtools(Asset
*asset
, int &score
);
60 static int check_sig_avifile(Asset
*asset
, int &score
);
62 int open_avifile_in(Asset
*asset
);
63 int open_arne2_in(Asset
*asset
);
64 int open_arne1_in(Asset
*asset
);
65 int open_lavtools_in(Asset
*asset
);
68 int open_avifile_out(Asset
*asset
);
69 int open_arne2_out(Asset
*asset
);
70 int open_arne1_out(Asset
*asset
);
71 int open_lavtools_out(Asset
*asset
);
74 IAviWriteFile
*out_fd
;
77 IAviReadStream
*astream_in
[MAX_STREAMS
];
78 IAviReadStream
*vstream_in
[MAX_STREAMS
];
79 IAviWriteStream
*astream_out
[MAX_STREAMS
];
80 IAviVideoWriteStream
*vstream_out
[MAX_STREAMS
];
82 BitmapInfo
*out_bitmap_info
;
83 static int avifile_initialized
;
93 unsigned char *temp_audio
;
94 int64_t temp_allocated
;
101 class AVIACodecList
: public BC_PopupTextBox
104 AVIACodecList(AVIConfigAudio
*gui
, int x
, int y
);
112 class AVIConfigAudio
: public BC_Window
115 AVIConfigAudio(BC_WindowBase
*parent_window
, Asset
*asset
);
118 static int calculate_w(int format
);
119 static int calculate_h(int format
);
120 int create_objects();
122 int generate_codeclist();
123 void update_codecs();
127 ArrayList
<BC_ListBoxItem
*> codec_items
;
128 ArrayList
<BC_ISlider
*> attribute_sliders
;
129 BC_WindowBase
*parent_window
;
131 char string
[BCTEXTLEN
];
134 class AVIConfigVideo
;
136 class AVIVCodecList
: public BC_PopupTextBox
139 AVIVCodecList(AVIConfigVideo
*gui
, int x
, int y
);
147 class AVIVAttributeList
: public BC_ListBox
150 AVIVAttributeList(AVIConfigVideo
*gui
, int x
, int y
);
152 int selection_changed();
156 class AVIVAttribute
: public BC_TextBox
159 AVIVAttribute(AVIConfigVideo
*gui
, int x
, int y
);
164 class AVIConfigVideo
: public BC_Window
167 AVIConfigVideo(BC_WindowBase
*parent_window
,
169 char *locked_compressor
);
172 static int calculate_w(int format
);
173 static int calculate_h(int format
);
174 int create_objects();
176 int generate_codeclist();
177 void generate_attributelist();
178 void update_attribute(int recursive
);
179 // Get text associated with current attribute
180 char* get_current_attribute_text();
181 char* get_current_attribute_value();
182 void set_current_attribute(char *text
);
186 AVIVAttributeList
*attributes
;
187 AVIVAttribute
*attribute
;
188 ArrayList
<BC_ListBoxItem
*> codec_items
;
189 ArrayList
<BC_ListBoxItem
*> attribute_items
[2];
190 BC_WindowBase
*parent_window
;
192 char *locked_compressor
;
193 char string
[BCTEXTLEN
];