r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / assets.h
blob97dbf6cc816c76435dd78d179ff18989930da0d4
1 #ifndef ASSETS_H
2 #define ASSETS_H
4 #include <stdio.h>
5 #include <stdint.h>
7 #include "arraylist.h"
8 #include "assets.inc"
9 #include "batch.inc"
10 #include "defaults.inc"
11 #include "edl.inc"
12 #include "filexml.inc"
13 #include "guicast.h"
14 #include "linklist.h"
15 #include "pluginserver.inc"
16 #include "sharedlocation.h"
18 class Assets : public List<Asset>
20 public:
21 Assets(EDL *edl);
22 virtual ~Assets();
24 int load(ArrayList<PluginServer*> *plugindb,
25 FileXML *xml,
26 uint32_t load_flags);
27 int save(ArrayList<PluginServer*> *plugindb,
28 FileXML *xml,
29 char *output_path);
30 Assets& operator=(Assets &assets);
32 // Enter a new asset into the table.
33 // If the asset already exists return the asset which exists.
34 // If the asset doesn't exist, store a copy of the argument and return the copy.
35 Asset* update(Asset *asset);
36 // Update the index information for assets with the same path
37 void update_index(Asset *asset);
40 // Parent EDL
41 EDL *edl;
51 int delete_all();
52 int dump();
54 // return the asset containing this path or create a new asset containing this path
55 Asset* update(const char *path);
57 // Insert the asset into the list if it doesn't exist already but
58 // don't create a new asset.
59 void update_ptr(Asset *asset);
61 // return the asset containing this path or 0 if not found
62 Asset* get_asset(const char *filename);
63 // remove asset from table
64 Asset* remove_asset(Asset *asset);
66 // return number of the asset
67 int number_of(Asset *asset);
68 Asset* asset_number(int number);
70 int update_old_filename(char *old_filename, char *new_filename);
75 // Asset can be one of the following:
76 // 1) a pure media file
77 // 2) an EDL
78 // 3) a log
79 // The EDL can reference itself if it contains a media file
80 class Asset : public ListItem<Asset>
82 public:
83 Asset();
84 Asset(Asset &asset);
85 Asset(const char *path);
86 Asset(const int plugin_type, const char *plugin_path);
87 ~Asset();
89 int init_values();
90 int dump();
92 void copy_from(Asset *asset, int do_index);
93 void copy_location(Asset *asset);
94 void copy_format(Asset *asset, int do_index = 1);
95 void copy_index(Asset *asset);
96 int64_t get_index_offset(int channel);
99 // Load and save just compression parameters for a render dialog
100 void load_defaults(Defaults *defaults, char *prefix = 0, int do_codecs = 0);
101 void save_defaults(Defaults *defaults, char *prefix = 0);
102 char* construct_param(char *param, char *prefix, char *return_value);
107 // Executed during index building only
108 void update_index(Asset *asset);
109 int equivalent(Asset &asset,
110 int test_audio,
111 int test_video);
112 Asset& operator=(Asset &asset);
113 int operator==(Asset &asset);
114 int operator!=(Asset &asset);
115 int test_path(const char *path);
116 int test_plugin_title(const char *path);
117 int read(ArrayList<PluginServer*> *plugindb, FileXML *xml);
118 int read_audio(FileXML *xml);
119 int read_video(FileXML *xml);
120 int read_index(FileXML *xml);
121 int reset_index(); // When the index file is wrong, reset the asset values
122 int write(ArrayList<PluginServer*> *plugindb,
123 FileXML *xml,
124 int include_index,
125 char *output_path);
128 // Necessary for renderfarm to get encoding parameters
129 int write_audio(FileXML *xml);
130 int write_video(FileXML *xml);
131 int write_index(FileXML *xml);
132 int update_path(char *new_path);
134 // Path to file
135 char path[BCTEXTLEN];
137 // Folder in resource manager
138 char folder[BCTEXTLEN];
140 // Determines the file engine to use
141 int format; // format of file
143 // contains audio data
144 int audio_data;
145 int channels;
146 int sample_rate;
147 int bits;
148 int byte_order;
149 int signed_;
150 int header;
151 int dither;
152 // String or FourCC describing compression
153 char acodec[BCTEXTLEN];
156 int64_t audio_length;
169 // contains video data
170 int video_data;
171 int layers;
172 double frame_rate;
173 int width, height;
174 // String or FourCC describing compression
175 char vcodec[BCTEXTLEN];
177 // Length in units of asset
178 int64_t video_length;
184 // mpeg audio information
185 int ampeg_bitrate;
186 // 2 - 3
187 int ampeg_derivative;
189 // Vorbis compression
190 int vorbis_min_bitrate;
191 int vorbis_bitrate;
192 int vorbis_max_bitrate;
193 int vorbis_vbr;
195 // mp3 compression
196 int mp3_bitrate;
204 // for jpeg compression
205 int jpeg_quality;
207 // for mpeg video compression
208 int vmpeg_iframe_distance;
209 int vmpeg_bframe_distance;
210 int vmpeg_progressive;
211 int vmpeg_denoise;
212 int vmpeg_seq_codes;
213 int vmpeg_bitrate;
214 // 1 - 2
215 int vmpeg_derivative;
216 int vmpeg_quantization;
217 int vmpeg_cmodel;
218 int vmpeg_fix_bitrate;
220 // Divx video compression
221 int divx_bitrate;
222 int divx_rc_period;
223 int divx_rc_reaction_ratio;
224 int divx_rc_reaction_period;
225 int divx_max_key_interval;
226 int divx_max_quantizer;
227 int divx_min_quantizer;
228 int divx_quantizer;
229 int divx_quality;
230 int divx_fix_bitrate;
233 // Divx video decompression
234 int divx_use_deblocking;
236 // PNG video compression
237 int png_use_alpha;
239 // Microsoft MPEG-4
240 int ms_bitrate;
241 int ms_bitrate_tolerance;
242 int ms_interlaced;
243 int ms_quantization;
244 int ms_gop_size;
245 int ms_fix_bitrate;
247 // Image file sequences. Background rendering doesn't want to write a
248 // sequence header but instead wants to start the sequence numbering at a certain
249 // number. This ensures deletion of all the frames which aren't being used.
250 // We still want sequence headers sometimes because loading a directory full of images
251 // for editing would create new assets for every image.
252 int use_header;
256 // Edits store data for the transition
258 // index info
259 int index_status; // 0 ready 1 not tested 2 being built 3 small source
260 int64_t index_zoom; // zoom factor of index data
261 int64_t index_start; // byte start of index data in the index file
262 int64_t index_bytes; // Total bytes in source file for comparison before rebuilding the index
263 int64_t index_end, old_index_end; // values for index build
264 int64_t* index_offsets; // offsets of channels in index file in floats
265 float* index_buffer;
266 int id;
272 #endif