6 #include "filelist.inc"
7 #include "loadbalance.h"
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
22 FileList(Asset
*asset
,
30 // basic commands for every file interpreter
31 int open_file(int rd
, int wr
);
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
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
60 // Storage for single frame
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
85 class FrameWriterPackage
: public LoadPackage
89 ~FrameWriterPackage();
100 class FrameWriterUnit
: public LoadClient
103 FrameWriterUnit(FrameWriter
*server
);
104 virtual ~FrameWriterUnit();
106 void process_package(LoadPackage
*package
);
116 class FrameWriter
: public LoadServer
119 FrameWriter(FileList
*file
, int cpus
);
122 void write_frames(VFrame
***frames
, int len
);
123 void init_packages();
124 LoadClient
* new_client();
125 LoadPackage
* new_package();