Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

fileavi.h

Go to the documentation of this file.
00001 #ifndef FILEAVI_H
00002 #define FILEAVI_H
00003 
00004 #include "asset.inc"
00005 #include "assets.inc"
00006 #include "file.inc"
00007 #include "filebase.h"
00008 
00009 #ifdef USE_AVIFILE
00010 #include "avifile.h"
00011 #include <vector>
00012 #endif
00013 
00014 //class IAviWriteFile;
00015 //class IAviReadFile;
00016 //class IAviReadStream;
00017 
00018 #define MAX_STREAMS 256
00019 
00020 class FileAVI : public FileBase
00021 {
00022 public:
00023         FileAVI(Asset *asset, File *file);
00024         ~FileAVI();
00025 
00026         static int check_sig(Asset *asset);
00027         static void get_parameters(BC_WindowBase *parent_window, 
00028                 Asset *asset, 
00029                 BC_WindowBase* &format_window,
00030                 int audio_options,
00031                 int video_options,
00032                 int lock_compressor);
00033 
00034         int get_best_colormodel(int driver, int colormodel);
00035         int open_file(int rd, int wr);
00036         int close_file();
00037         void reset();
00038         int set_audio_position(int64_t x);
00039         int set_video_position(int64_t x);
00040         int write_samples(double **buffer, int64_t len);
00041         int write_frames(VFrame ***frames, int len);
00042         int write_compressed_frame(VFrame *buffer);
00043         int read_compressed_frame(VFrame *buffer);
00044         int64_t compressed_frame_size();
00045         int read_samples(double *buffer, int64_t len);
00046         int read_frame(VFrame *frame);
00047         static char* vcodec_to_fourcc(char *input, char *output);
00048         static char* fourcc_to_vcodec(char *input, char *output);
00049         static char* acodec_to_fourcc(char *input, char *output);
00050         static char* fourcc_to_acodec(char *input, char *output);
00051         static int cmodel_bc_to_avi(int input);
00052 
00053         static void initialize_avifile();
00054 
00055 
00056 private:
00057         static int check_sig_arne2(Asset *asset, int &score);
00058         static int check_sig_arne1(Asset *asset, int &score);
00059         static int check_sig_lavtools(Asset *asset, int &score);
00060         static int check_sig_avifile(Asset *asset, int &score);
00061 
00062         int open_avifile_in(Asset *asset);
00063         int open_arne2_in(Asset *asset);
00064         int open_arne1_in(Asset *asset);
00065         int open_lavtools_in(Asset *asset);
00066 
00067 
00068         int open_avifile_out(Asset *asset);
00069         int open_arne2_out(Asset *asset);
00070         int open_arne1_out(Asset *asset);
00071         int open_lavtools_out(Asset *asset);
00072 
00073 #ifdef USE_AVIFILE
00074         IAviWriteFile *out_fd;
00075         IAviReadFile *in_fd;
00076 
00077         IAviReadStream *astream_in[MAX_STREAMS];
00078         IAviReadStream *vstream_in[MAX_STREAMS];
00079         IAviWriteStream *astream_out[MAX_STREAMS];
00080         IAviVideoWriteStream *vstream_out[MAX_STREAMS];
00081         int out_color_model;
00082     BitmapInfo *out_bitmap_info;
00083         static int avifile_initialized;
00084 
00085 #endif
00086 
00087 
00088 
00089         
00090 
00091 
00092 
00093         unsigned char *temp_audio;
00094         int64_t temp_allocated;
00095         int source_cmodel;
00096 };
00097 
00098 
00099 class AVIConfigAudio;
00100 
00101 class AVIACodecList : public BC_PopupTextBox
00102 {
00103 public:
00104         AVIACodecList(AVIConfigAudio *gui, int x, int y);
00105         ~AVIACodecList();
00106 
00107         int handle_event();
00108 
00109         AVIConfigAudio *gui;
00110 };
00111 
00112 class AVIConfigAudio : public BC_Window
00113 {
00114 public:
00115         AVIConfigAudio(BC_WindowBase *parent_window, Asset *asset);
00116         ~AVIConfigAudio();
00117 
00118         static int calculate_w(int format);
00119         static int calculate_h(int format);
00120         int create_objects();
00121         int close_event();
00122         int generate_codeclist();
00123         void update_codecs();
00124 
00125         AVIACodecList *list;
00126 
00127         ArrayList<BC_ListBoxItem*> codec_items;
00128         ArrayList<BC_ISlider*> attribute_sliders;
00129         BC_WindowBase *parent_window;
00130         Asset *asset;
00131         char string[BCTEXTLEN];
00132 };
00133 
00134 class AVIConfigVideo;
00135 
00136 class AVIVCodecList : public BC_PopupTextBox
00137 {
00138 public:
00139         AVIVCodecList(AVIConfigVideo *gui, int x, int y);
00140         ~AVIVCodecList();
00141 
00142         int handle_event();
00143 
00144         AVIConfigVideo *gui;
00145 };
00146 
00147 class AVIVAttributeList : public BC_ListBox
00148 {
00149 public:
00150         AVIVAttributeList(AVIConfigVideo *gui, int x, int y);
00151         int handle_event();
00152         int selection_changed();
00153         AVIConfigVideo *gui;
00154 };
00155 
00156 class AVIVAttribute : public BC_TextBox
00157 {
00158 public:
00159         AVIVAttribute(AVIConfigVideo *gui, int x, int y);
00160         int handle_event();
00161         AVIConfigVideo *gui;
00162 };
00163 
00164 class AVIConfigVideo : public BC_Window
00165 {
00166 public:
00167         AVIConfigVideo(BC_WindowBase *parent_window, 
00168                 Asset *asset, 
00169                 int lock_compressor);
00170         ~AVIConfigVideo();
00171 
00172         static int calculate_w(int format);
00173         static int calculate_h(int format);
00174         int create_objects();
00175         int close_event();
00176         int generate_codeclist();
00177         void generate_attributelist();
00178         void update_attribute(int recursive);
00179 // Get text associated with current attribute
00180         char* get_current_attribute_text();
00181         char* get_current_attribute_value();
00182         void set_current_attribute(char *text);
00183         void reset();
00184 
00185         AVIVCodecList *list;
00186         AVIVAttributeList *attributes;
00187         AVIVAttribute *attribute;
00188         ArrayList<BC_ListBoxItem*> codec_items;
00189         ArrayList<BC_ListBoxItem*> attribute_items[2];
00190         BC_WindowBase *parent_window;
00191         Asset *asset;
00192         int lock_compressor;
00193         char string[BCTEXTLEN];
00194 };
00195 
00196 
00197 
00198 #endif

Generated on Sun Jan 8 13:38:54 2006 for Cinelerra-svn by  doxygen 1.4.4