00001 #ifndef ASSET_H
00002 #define ASSET_H
00003
00004
00005 #include "arraylist.h"
00006 #include "bcwindowbase.inc"
00007 #include "bchash.inc"
00008 #include "filexml.inc"
00009 #include "garbage.h"
00010 #include "linklist.h"
00011 #include "pluginserver.inc"
00012
00013
00014 #include <stdint.h>
00015
00016
00017 #define TC_DROPFRAME 0
00018 #define TC_NONDROPFRAME 1
00019 #define TC_PAL 2
00020 #define TC_FILM 3
00021
00022
00023
00024
00025
00026
00027 class Asset : public ListItem<Asset>, public GarbageObject
00028 {
00029 public:
00030 Asset();
00031 Asset(Asset &asset);
00032 Asset(const char *path);
00033 Asset(const int plugin_type, const char *plugin_path);
00034 ~Asset();
00035
00036 int init_values();
00037 int dump();
00038
00039 void copy_from(Asset *asset, int do_index);
00040 void copy_location(Asset *asset);
00041 void copy_format(Asset *asset, int do_index = 1);
00042 void copy_index(Asset *asset);
00043 int64_t get_index_offset(int channel);
00044 int64_t get_index_size(int channel);
00045
00046 char* get_compression_text(int audio, int video);
00047
00048
00049
00050 void load_defaults(BC_Hash *defaults,
00051 char *prefix ,
00052 int do_format ,
00053 int do_compression,
00054 int do_path,
00055 int do_data_types,
00056 int do_bits);
00057 void save_defaults(BC_Hash *defaults,
00058 char *prefix ,
00059 int do_format,
00060 int do_compression,
00061 int do_path,
00062 int do_data_types,
00063 int do_bits);
00064 char* construct_param(char *param, char *prefix, char *return_value);
00065
00066
00067
00068
00069
00070 void update_index(Asset *asset);
00071 int equivalent(Asset &asset,
00072 int test_audio,
00073 int test_video);
00074 Asset& operator=(Asset &asset);
00075 int operator==(Asset &asset);
00076 int operator!=(Asset &asset);
00077 int test_path(const char *path);
00078 int test_plugin_title(const char *path);
00079 int read(FileXML *file, int expand_relative = 1);
00080 int read_audio(FileXML *xml);
00081 int read_video(FileXML *xml);
00082 int read_index(FileXML *xml);
00083 int reset_index();
00084
00085 int set_timecode(char *tc, int format, int end);
00086 int reset_timecode();
00087
00088
00089
00090 int write(FileXML *file,
00091 int include_index,
00092 char *output_path);
00093
00094 int write_index(char *path, int data_bytes);
00095
00096
00097
00098 int write_audio(FileXML *xml);
00099 int write_video(FileXML *xml);
00100 int write_index(FileXML *xml);
00101 int update_path(char *new_path);
00102
00103 double total_length_framealigned(double fps);
00104
00105
00106 char path[BCTEXTLEN];
00107
00108
00109 char pipe[BCTEXTLEN];
00110 int use_pipe;
00111
00112
00113 char folder[BCTEXTLEN];
00114
00115
00116 int format;
00117
00118
00119 int audio_data;
00120 int channels;
00121 int sample_rate;
00122 int bits;
00123 int byte_order;
00124 int signed_;
00125 int header;
00126 int dither;
00127
00128 char acodec[BCTEXTLEN];
00129
00130
00131 int64_t audio_length;
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145 int video_data;
00146 int layers;
00147 double frame_rate;
00148
00149
00150 char reel_name[BCTEXTLEN];
00151 int reel_number;
00152 int64_t tcstart;
00153 int64_t tcend;
00154 int tcformat;
00155
00156 int width, height;
00157
00158 char vcodec[BCTEXTLEN];
00159
00160
00161 int64_t video_length;
00162
00163
00164
00165
00166
00167
00168 int ampeg_bitrate;
00169
00170 int ampeg_derivative;
00171
00172
00173 int vorbis_min_bitrate;
00174 int vorbis_bitrate;
00175 int vorbis_max_bitrate;
00176 int vorbis_vbr;
00177
00178
00179 int theora_fix_bitrate;
00180 int theora_bitrate;
00181 int theora_quality;
00182 int theora_sharpness;
00183 int theora_keyframe_frequency;
00184 int theora_keyframe_force_frequency;
00185
00186
00187
00188 int mp3_bitrate;
00189
00190
00191 int mp4a_bitrate;
00192 int mp4a_quantqual;
00193
00194
00195
00196 double aspect_ratio;
00197
00198
00199 int interlace_autofixoption;
00200 int interlace_mode;
00201 int interlace_fixmethod;
00202
00203
00204 int jpeg_quality;
00205
00206
00207 int vmpeg_iframe_distance;
00208 int vmpeg_progressive;
00209 int vmpeg_denoise;
00210 int vmpeg_seq_codes;
00211 int vmpeg_bitrate;
00212
00213 int vmpeg_derivative;
00214 int vmpeg_quantization;
00215 int vmpeg_cmodel;
00216 int vmpeg_fix_bitrate;
00217
00218
00219 int vmpeg_preset;
00220
00221 int vmpeg_field_order;
00222 int vmpeg_pframe_distance;
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232 int divx_bitrate;
00233 int divx_rc_period;
00234 int divx_rc_reaction_ratio;
00235 int divx_rc_reaction_period;
00236 int divx_max_key_interval;
00237 int divx_max_quantizer;
00238 int divx_min_quantizer;
00239 int divx_quantizer;
00240 int divx_quality;
00241 int divx_fix_bitrate;
00242
00243
00244 int h264_bitrate;
00245 int h264_quantizer;
00246 int h264_fix_bitrate;
00247
00248
00249 int divx_use_deblocking;
00250
00251
00252 int png_use_alpha;
00253
00254
00255 int exr_use_alpha;
00256 int exr_compression;
00257
00258
00259 int tiff_cmodel;
00260 int tiff_compression;
00261
00262
00263 int ms_bitrate;
00264 int ms_bitrate_tolerance;
00265 int ms_interlaced;
00266 int ms_quantization;
00267 int ms_gop_size;
00268 int ms_fix_bitrate;
00269
00270
00271 int ac3_bitrate;
00272
00273
00274
00275
00276
00277
00278
00279
00280 int use_header;
00281
00282
00283
00284
00285
00286
00287 int index_status;
00288 int64_t index_zoom;
00289 int64_t index_start;
00290
00291 int64_t index_bytes;
00292 int64_t index_end, old_index_end;
00293
00294 int64_t *index_offsets;
00295
00296
00297 int64_t *index_sizes;
00298
00299
00300 float *index_buffer;
00301 int id;
00302 };
00303
00304
00305 #endif