r136: This commit was manufactured by cvs2svn to create tag 'hv_1_1_8'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / asset.h
blob6fcdf95c3fceb358efcc857778fcd08db22b445f
1 #ifndef ASSET_H
2 #define ASSET_H
5 #include "arraylist.h"
6 #include "bcwindowbase.inc"
7 #include "defaults.inc"
8 #include "filexml.inc"
9 #include "linklist.h"
10 #include "pluginserver.inc"
13 #include <stdint.h>
16 // Asset can be one of the following:
17 // 1) a pure media file
18 // 2) an EDL
19 // 3) a log
20 // The EDL can reference itself if it contains a media file
21 class Asset : public ListItem<Asset>
23 public:
24 Asset();
25 Asset(Asset &asset);
26 Asset(const char *path);
27 Asset(const int plugin_type, const char *plugin_path);
28 ~Asset();
30 int init_values();
31 int dump();
33 void copy_from(Asset *asset, int do_index);
34 void copy_location(Asset *asset);
35 void copy_format(Asset *asset, int do_index = 1);
36 void copy_index(Asset *asset);
37 int64_t get_index_offset(int channel);
40 // Load and save parameters for a render dialog
41 // Used by render, record, menueffects, preferences
42 void load_defaults(Defaults *defaults,
43 char *prefix /* = 0 */,
44 int do_format /* = 0 */,
45 int do_compression,
46 int do_path,
47 int do_data_types,
48 int do_bits);
49 void save_defaults(Defaults *defaults,
50 char *prefix /* = 0 */,
51 int do_format, /* Don't save format which is autodetected by file loader */
52 int do_compression, /* Don't save compression which is fixed by driver */
53 int do_path,
54 int do_data_types,
55 int do_bits);
56 char* construct_param(char *param, char *prefix, char *return_value);
61 // Executed during index building only
62 void update_index(Asset *asset);
63 int equivalent(Asset &asset,
64 int test_audio,
65 int test_video);
66 Asset& operator=(Asset &asset);
67 int operator==(Asset &asset);
68 int operator!=(Asset &asset);
69 int test_path(const char *path);
70 int test_plugin_title(const char *path);
71 int read(FileXML *file, int expand_relative = 1);
72 int read(ArrayList<PluginServer*> *plugindb, FileXML *xml, int expand_relative = 1);
73 int read_audio(FileXML *xml);
74 int read_video(FileXML *xml);
75 int read_index(FileXML *xml);
76 int reset_index(); // When the index file is wrong, reset the asset values
77 // Output path is the path of the output file if name truncation is desired.
78 // It is a "" if complete names should be used.
79 int write(FileXML *file,
80 int include_index,
81 char *output_path);
82 int write(ArrayList<PluginServer*> *plugindb,
83 FileXML *xml,
84 int include_index,
85 char *output_path);
88 // Necessary for renderfarm to get encoding parameters
89 int write_audio(FileXML *xml);
90 int write_video(FileXML *xml);
91 int write_index(FileXML *xml);
92 int update_path(char *new_path);
94 // Path to file
95 char path[BCTEXTLEN];
97 // Folder in resource manager
98 char folder[BCTEXTLEN];
100 // Determines the file engine to use
101 int format; // format of file
103 // contains audio data
104 int audio_data;
105 int channels;
106 int sample_rate;
107 int bits;
108 int byte_order;
109 int signed_;
110 int header;
111 int dither;
112 // String or FourCC describing compression
113 char acodec[BCTEXTLEN];
116 int64_t audio_length;
129 // contains video data
130 int video_data;
131 int layers;
132 double frame_rate;
133 int width, height;
134 // String or FourCC describing compression
135 char vcodec[BCTEXTLEN];
137 // Length in units of asset
138 int64_t video_length;
144 // mpeg audio information
145 int ampeg_bitrate;
146 // 2 - 3
147 int ampeg_derivative;
149 // Vorbis compression
150 int vorbis_min_bitrate;
151 int vorbis_bitrate;
152 int vorbis_max_bitrate;
153 int vorbis_vbr;
155 // mp3 compression
156 int mp3_bitrate;
164 // for jpeg compression
165 int jpeg_quality;
167 // for mpeg video compression
168 int vmpeg_iframe_distance;
169 int vmpeg_bframe_distance;
170 int vmpeg_progressive;
171 int vmpeg_denoise;
172 int vmpeg_seq_codes;
173 int vmpeg_bitrate;
174 // 1 - 2
175 int vmpeg_derivative;
176 int vmpeg_quantization;
177 int vmpeg_cmodel;
178 int vmpeg_fix_bitrate;
180 // Divx video compression
181 int divx_bitrate;
182 int divx_rc_period;
183 int divx_rc_reaction_ratio;
184 int divx_rc_reaction_period;
185 int divx_max_key_interval;
186 int divx_max_quantizer;
187 int divx_min_quantizer;
188 int divx_quantizer;
189 int divx_quality;
190 int divx_fix_bitrate;
193 // Divx video decompression
194 int divx_use_deblocking;
196 // PNG video compression
197 int png_use_alpha;
199 // Microsoft MPEG-4
200 int ms_bitrate;
201 int ms_bitrate_tolerance;
202 int ms_interlaced;
203 int ms_quantization;
204 int ms_gop_size;
205 int ms_fix_bitrate;
207 // Image file sequences. Background rendering doesn't want to write a
208 // sequence header but instead wants to start the sequence numbering at a certain
209 // number. This ensures deletion of all the frames which aren't being used.
210 // We still want sequence headers sometimes because loading a directory full of images
211 // for editing would create new assets for every image.
212 int use_header;
216 // Edits store data for the transition
218 // index info
219 int index_status; // 0 ready 1 not tested 2 being built 3 small source
220 int64_t index_zoom; // zoom factor of index data
221 int64_t index_start; // byte start of index data in the index file
222 int64_t index_bytes; // Total bytes in source file for comparison before rebuilding the index
223 int64_t index_end, old_index_end; // values for index build
224 int64_t* index_offsets; // offsets of channels in index file in floats
225 float* index_buffer;
226 int id;
230 #endif