r972: Fix aspect ratio of YUV4MPEG streams.
[cinelerra_cv/ct.git] / cinelerra / filelist.h
blob3024d93f89bbab348db1e9e4f9caf37fab4f1ce4
1 #ifndef FILELIST_H
2 #define FILELIST_H
4 #include "file.inc"
5 #include "filebase.h"
6 #include "filelist.inc"
7 #include "loadbalance.h"
8 #include "mutex.inc"
9 #include "vframe.inc"
11 // Any file which is a list of frames.
12 // FileList handles both frame files and indexes of frame files.
19 class FileList : public FileBase
21 public:
22 FileList(Asset *asset,
23 File *file,
24 char *list_prefix,
25 char *file_extension,
26 int frame_type,
27 int list_type);
28 virtual ~FileList();
30 // basic commands for every file interpreter
31 int open_file(int rd, int wr);
32 int close_file();
34 char* calculate_path(int number, char *string);
35 char* create_path(int number_override);
36 void add_return_value(int amount);
38 int read_list_header();
39 virtual int read_frame_header(char *path) { return 1; };
40 int read_frame(VFrame *frame);
42 // subclass returns whether the asset format is a list or single file
43 virtual int read_frame(VFrame *frame, VFrame *data) { return 0; };
44 virtual int write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit) { return 0; };
47 int write_list_header();
48 int write_frames(VFrame ***frames, int len);
49 VFrame* read_frame(int use_alpha, int use_float);
50 virtual int64_t get_memory_usage();
51 // Get the total writer units for calculating memory usage
52 int get_units();
53 // Get a writer unit for retrieving temporary usage.
54 FrameWriterUnit* get_unit(int number);
56 virtual FrameWriterUnit* new_writer_unit(FrameWriter *writer);
58 // Temp storage for compressed data
59 VFrame *data;
60 // Storage for single frame
61 VFrame *temp;
63 private:
64 int read_raw(VFrame *frame,
65 float in_x1, float in_y1, float in_x2, float in_y2,
66 float out_x1, float out_y1, float out_x2, float out_y2,
67 int alpha, int use_alpha, int use_float, int interpolate);
68 int reset_parameters_derived();
69 ArrayList<char*> path_list; // List of files
70 char *list_prefix;
71 char *file_extension;
72 int frame_type;
73 int list_type;
74 Mutex *table_lock;
75 FrameWriter *writer;
76 int return_value;
77 int first_number;
78 int number_start;
79 int number_digits;
85 class FrameWriterPackage : public LoadPackage
87 public:
88 FrameWriterPackage();
89 ~FrameWriterPackage();
92 VFrame *input;
94 char *path;
100 class FrameWriterUnit : public LoadClient
102 public:
103 FrameWriterUnit(FrameWriter *server);
104 virtual ~FrameWriterUnit();
106 void process_package(LoadPackage *package);
108 FrameWriter *server;
109 VFrame *output;
116 class FrameWriter : public LoadServer
118 public:
119 FrameWriter(FileList *file, int cpus);
120 ~FrameWriter();
122 void write_frames(VFrame ***frames, int len);
123 void init_packages();
124 LoadClient* new_client();
125 LoadPackage* new_package();
127 FileList *file;
128 VFrame ***frames;
129 int len;
139 #endif