Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

asset.h

Go to the documentation of this file.
00001 #ifndef ASSET_H
00002 #define ASSET_H
00003 
00004 
00005 #include "arraylist.h"
00006 #include "bcwindowbase.inc"
00007 #include "defaults.inc"
00008 #include "filexml.inc"
00009 #include "linklist.h"
00010 #include "pluginserver.inc"
00011 
00012 
00013 #include <stdint.h>
00014 
00015 // Time code formats
00016 #define TC_DROPFRAME 0
00017 #define TC_NONDROPFRAME 1
00018 #define TC_PAL 2
00019 #define TC_FILM 3
00020 
00021 // Asset can be one of the following:
00022 // 1) a pure media file
00023 // 2) an EDL
00024 // 3) a log
00025 // The EDL can reference itself if it contains a media file
00026 class Asset : public ListItem<Asset>
00027 {
00028 public:
00029         Asset();
00030         Asset(Asset &asset);
00031         Asset(const char *path);
00032         Asset(const int plugin_type, const char *plugin_path);
00033         ~Asset();
00034 
00035         int init_values();
00036         int dump();
00037 
00038         void copy_from(Asset *asset, int do_index);
00039         void copy_location(Asset *asset);
00040         void copy_format(Asset *asset, int do_index = 1);
00041         void copy_index(Asset *asset);
00042         int64_t get_index_offset(int channel);
00043         int64_t get_index_size(int channel);
00044 // Get an english description of the compression.  Used by AssetEdit
00045         char* get_compression_text(int audio, int video);
00046 
00047 // Load and save parameters for a render dialog
00048 // Used by render, record, menueffects, preferences
00049         void load_defaults(Defaults *defaults, 
00050                 char *prefix /* = 0 */, 
00051                 int do_format /* = 0 */,
00052                 int do_compression,
00053                 int do_path,
00054                 int do_data_types,
00055                 int do_bits);
00056         void save_defaults(Defaults *defaults, 
00057                 char *prefix /* = 0 */,
00058                 int do_format,     /* Don't save format which is autodetected by file loader */
00059                 int do_compression,    /* Don't save compression which is fixed by driver */
00060                 int do_path,
00061                 int do_data_types,
00062                 int do_bits);
00063         char* construct_param(char *param, char *prefix, char *return_value);
00064 
00065 // defaults which are specific to format used   
00066         void load_format_defaults(Defaults *defaults);
00067         void save_format_defaults(Defaults *defaults);
00068 
00069 // Executed during index building only
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();  // When the index file is wrong, reset the asset values
00084 
00085         int set_timecode(char *tc, int format, int end);
00086         int reset_timecode();
00087         
00088 // Output path is the path of the output file if name truncation is desired.
00089 // It is a "" if; complete names should be used.
00090         int write(FileXML *file, 
00091                 int include_index, 
00092                 char *output_path);
00093 // Write the index data and asset info.  Used by IndexThread.
00094         int write_index(char *path, int data_bytes);
00095 
00096 
00097 // Necessary for renderfarm to get encoding parameters
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 // Path to file
00104         char path[BCTEXTLEN];
00105 
00106 // Pipe command
00107         char pipe[BCTEXTLEN];
00108         int use_pipe;
00109 
00110 // Prefix used to generate this asset
00111         char prefix[BCTEXTLEN];
00112 
00113 // Folder in resource manager
00114         char folder[BCTEXTLEN];
00115 
00116 // Format of file.  An enumeration from file.inc.
00117         int format;
00118 
00119 // contains audio data
00120         int audio_data;
00121         int channels;
00122         int sample_rate;
00123         int bits;
00124         int byte_order;
00125         int signed_;
00126         int header;
00127         int dither;
00128 // String or FourCC describing compression
00129         char acodec[BCTEXTLEN];
00130 
00131 
00132         int64_t audio_length;
00133 
00134 
00135 
00136 
00137 
00138 
00139 
00140 
00141 
00142 
00143 
00144 
00145 // contains video data
00146         int video_data;       
00147         int layers;
00148         double frame_rate;
00149 
00150 // Timecode information. User setable, in case of errors in source
00151         char reel_name[BCTEXTLEN];
00152         int reel_number;
00153         int64_t tcstart;
00154         int64_t tcend;
00155         int tcformat;
00156 
00157         int width, height;
00158 // String or FourCC describing compression
00159         char vcodec[BCTEXTLEN];
00160 
00161 // Length in units of asset
00162         int64_t video_length;
00163 
00164 
00165 
00166 
00167 
00168 // mpeg audio information
00169         int ampeg_bitrate;
00170 // 2 - 3
00171         int ampeg_derivative;
00172 
00173 // Vorbis compression
00174         int vorbis_min_bitrate;
00175         int vorbis_bitrate;
00176         int vorbis_max_bitrate;
00177         int vorbis_vbr;
00178 
00179 // Theora compression
00180         int theora_fix_bitrate;
00181         int theora_bitrate;
00182         int theora_quality;
00183         int theora_sharpness;
00184         int theora_keyframe_frequency;
00185         int theora_keyframe_force_frequency;
00186 
00187 
00188 // mp3 compression
00189         int mp3_bitrate;
00190 
00191 // mp4a compression
00192         int mp4a_bitrate;
00193         int mp4a_quantqual;
00194 
00195 
00196 // Set by package render during file creation. -1 means square pixels.
00197         double aspect_ratio;
00198 
00199 // for the interlace mode 
00200         int interlace_autofixoption;
00201         int interlace_mode;
00202         int interlace_fixmethod;
00203 
00204 // for jpeg compression
00205         int jpeg_quality;     
00206 
00207 // for mpeg video compression
00208         int vmpeg_iframe_distance;
00209         int vmpeg_progressive;
00210         int vmpeg_denoise;
00211         int vmpeg_seq_codes;
00212         int vmpeg_bitrate;
00213 // 1 - 2
00214         int vmpeg_derivative;
00215         int vmpeg_quantization;
00216         int vmpeg_cmodel;
00217         int vmpeg_fix_bitrate;
00218 
00219 // mjpegtools
00220         int vmpeg_preset;
00221 // top field first
00222         int vmpeg_field_order;
00223         int vmpeg_pframe_distance;
00224 
00225 
00226 
00227 
00228 
00229 
00230 
00231 
00232 // Divx video compression
00233         int divx_bitrate;
00234         int divx_rc_period;
00235         int divx_rc_reaction_ratio;
00236         int divx_rc_reaction_period;
00237         int divx_max_key_interval;
00238         int divx_max_quantizer;
00239         int divx_min_quantizer;
00240         int divx_quantizer;
00241         int divx_quality;
00242         int divx_fix_bitrate;
00243 
00244 // h264 video compression
00245         int h264_bitrate;
00246         int h264_quantizer;
00247         int h264_fix_bitrate;
00248 
00249 // Divx video decompression
00250         int divx_use_deblocking;
00251 
00252 // PNG video compression
00253         int png_use_alpha;
00254 
00255 // EXR video compression
00256         int exr_use_alpha;
00257         int exr_compression;
00258 
00259 // TIFF video compression.  An enumeration from filetiff.h
00260         int tiff_cmodel;
00261         int tiff_compression;
00262 
00263 // Microsoft MPEG-4
00264         int ms_bitrate;
00265         int ms_bitrate_tolerance;
00266         int ms_interlaced;
00267         int ms_quantization;
00268         int ms_gop_size;
00269         int ms_fix_bitrate;
00270 
00271 
00272         int ac3_bitrate;
00273 
00274 
00275 
00276 // Image file sequences.  Background rendering doesn't want to write a 
00277 // sequence header but instead wants to start the sequence numbering at a certain
00278 // number.  This ensures deletion of all the frames which aren't being used.
00279 // We still want sequence headers sometimes because loading a directory full of images
00280 // for editing would create new assets for every image.
00281         int use_header;
00282 
00283 
00284 
00285 // Edits store data for the transition
00286 
00287 // index info
00288         int index_status;     // Macro from assets.inc
00289         int64_t index_zoom;      // zoom factor of index data
00290         int64_t index_start;     // byte start of index data in the index file
00291 // Total bytes in source file when the index was buillt
00292         int64_t index_bytes;
00293         int64_t index_end, old_index_end;    // values for index build
00294 // offsets of channels in index buffer in floats
00295         int64_t *index_offsets;
00296 // Sizes of channels in index buffer in floats.  This allows
00297 // variable channel size.
00298         int64_t *index_sizes;
00299 // [ index channel      ][ index channel      ]
00300 // [high][low][high][low][high][low][high][low]
00301         float *index_buffer;  
00302         int id;
00303 };
00304 
00305 
00306 #endif

Generated on Sun Jan 8 13:38:49 2006 for Cinelerra-svn by  doxygen 1.4.4