r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / fileavi.h
blob3216c32e3ecd415a4bd58920a81d9f6101e422e7
1 #ifndef FILEAVI_H
2 #define FILEAVI_H
4 #include "assets.inc"
5 #include "file.inc"
6 #include "filebase.h"
8 #ifdef USE_AVIFILE
9 #include "avifile.h"
10 #include <vector.h>
11 #endif
13 //class IAviWriteFile;
14 //class IAviReadFile;
15 //class IAviReadStream;
17 #define MAX_STREAMS 256
19 class FileAVI : public FileBase
21 public:
22 FileAVI(Asset *asset, File *file);
23 ~FileAVI();
25 static int check_sig(Asset *asset);
26 static void get_parameters(BC_WindowBase *parent_window,
27 Asset *asset,
28 BC_WindowBase* &format_window,
29 int audio_options,
30 int video_options,
31 int lock_compressor);
33 int get_best_colormodel(int driver, int colormodel);
34 int open_file(int rd, int wr);
35 int close_file();
36 void reset();
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();
55 private:
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);
72 #ifdef USE_AVIFILE
73 IAviWriteFile *out_fd;
74 IAviReadFile *in_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];
80 int out_color_model;
81 BitmapInfo *out_bitmap_info;
82 static int avifile_initialized;
84 #endif
92 unsigned char *temp_audio;
93 int64_t temp_allocated;
94 int source_cmodel;
98 class AVIConfigAudio;
100 class AVIACodecList : public BC_PopupTextBox
102 public:
103 AVIACodecList(AVIConfigAudio *gui, int x, int y);
104 ~AVIACodecList();
106 int handle_event();
108 AVIConfigAudio *gui;
111 class AVIConfigAudio : public BC_Window
113 public:
114 AVIConfigAudio(BC_WindowBase *parent_window, Asset *asset);
115 ~AVIConfigAudio();
117 static int calculate_w(int format);
118 static int calculate_h(int format);
119 int create_objects();
120 int close_event();
121 int generate_codeclist();
122 void update_codecs();
124 AVIACodecList *list;
126 ArrayList<BC_ListBoxItem*> codec_items;
127 ArrayList<BC_ISlider*> attribute_sliders;
128 BC_WindowBase *parent_window;
129 Asset *asset;
130 char string[BCTEXTLEN];
133 class AVIConfigVideo;
135 class AVIVCodecList : public BC_PopupTextBox
137 public:
138 AVIVCodecList(AVIConfigVideo *gui, int x, int y);
139 ~AVIVCodecList();
141 int handle_event();
143 AVIConfigVideo *gui;
146 class AVIVAttributeList : public BC_ListBox
148 public:
149 AVIVAttributeList(AVIConfigVideo *gui, int x, int y);
150 int handle_event();
151 int selection_changed();
152 AVIConfigVideo *gui;
155 class AVIVAttribute : public BC_TextBox
157 public:
158 AVIVAttribute(AVIConfigVideo *gui, int x, int y);
159 int handle_event();
160 AVIConfigVideo *gui;
163 class AVIConfigVideo : public BC_Window
165 public:
166 AVIConfigVideo(BC_WindowBase *parent_window,
167 Asset *asset,
168 int lock_compressor);
169 ~AVIConfigVideo();
171 static int calculate_w(int format);
172 static int calculate_h(int format);
173 int create_objects();
174 int close_event();
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);
182 void reset();
184 AVIVCodecList *list;
185 AVIVAttributeList *attributes;
186 AVIVAttribute *attribute;
187 ArrayList<BC_ListBoxItem*> codec_items;
188 ArrayList<BC_ListBoxItem*> attribute_items[2];
189 BC_WindowBase *parent_window;
190 Asset *asset;
191 int lock_compressor;
192 char string[BCTEXTLEN];
197 #endif