6 #include "bcwindowbase.inc"
11 #include "pluginserver.inc"
17 #define TC_DROPFRAME 0
18 #define TC_NONDROPFRAME 1
22 // Asset can be one of the following:
23 // 1) a pure media file
26 // The EDL can reference itself if it contains a media file
27 class Asset
: public ListItem
<Asset
>, public GarbageObject
32 Asset(const char *path
);
33 Asset(const int plugin_type
, const char *plugin_path
);
39 void copy_from(Asset
*asset
, int do_index
);
40 void copy_location(Asset
*asset
);
41 void copy_format(Asset
*asset
, int do_index
= 1);
42 void copy_index(Asset
*asset
);
43 int64_t get_index_offset(int channel
);
44 int64_t get_index_size(int channel
);
45 // Get an english description of the compression. Used by AssetEdit
46 char* get_compression_text(int audio
, int video
);
48 // Load and save parameters for a render dialog
49 // Used by render, record, menueffects, preferences
50 void load_defaults(BC_Hash
*defaults
,
51 char *prefix
/* = 0 */,
52 int do_format
/* = 0 */,
57 void save_defaults(BC_Hash
*defaults
,
58 char *prefix
/* = 0 */,
59 int do_format
, /* Don't save format which is autodetected by file loader */
60 int do_compression
, /* Don't save compression which is fixed by driver */
64 char* construct_param(char *param
, char *prefix
, char *return_value
);
66 // defaults which are specific to format used
67 void load_format_defaults(BC_Hash
*defaults
);
68 void save_format_defaults(BC_Hash
*defaults
);
70 // Executed during index building only
71 void update_index(Asset
*asset
);
72 int equivalent(Asset
&asset
,
75 Asset
& operator=(Asset
&asset
);
76 int operator==(Asset
&asset
);
77 int operator!=(Asset
&asset
);
78 int test_path(const char *path
);
79 int test_plugin_title(const char *path
);
80 int read(FileXML
*file
, int expand_relative
= 1);
81 int read_audio(FileXML
*xml
);
82 int read_video(FileXML
*xml
);
83 int read_index(FileXML
*xml
);
84 int reset_index(); // When the index file is wrong, reset the asset values
86 int set_timecode(char *tc
, int format
, int end
);
89 // Output path is the path of the output file if name truncation is desired.
90 // It is a "" if; complete names should be used.
91 int write(FileXML
*file
,
94 // Write the index data and asset info. Used by IndexThread.
95 int write_index(char *path
, int data_bytes
);
98 // Necessary for renderfarm to get encoding parameters
99 int write_audio(FileXML
*xml
);
100 int write_video(FileXML
*xml
);
101 int write_index(FileXML
*xml
);
102 int update_path(char *new_path
);
105 char path
[BCTEXTLEN
];
108 char pipe
[BCTEXTLEN
];
111 // Prefix used to generate this asset
112 char prefix
[BCTEXTLEN
];
114 // Folder in resource manager
115 char folder
[BCTEXTLEN
];
117 // Format of file. An enumeration from file.inc.
120 // contains audio data
129 // String or FourCC describing compression
130 char acodec
[BCTEXTLEN
];
133 int64_t audio_length
;
146 // contains video data
151 // Timecode information. User setable, in case of errors in source
152 char reel_name
[BCTEXTLEN
];
159 // String or FourCC describing compression
160 char vcodec
[BCTEXTLEN
];
162 // Length in units of asset
163 int64_t video_length
;
169 // mpeg audio information
172 int ampeg_derivative
;
174 // Vorbis compression
175 int vorbis_min_bitrate
;
177 int vorbis_max_bitrate
;
180 // Theora compression
181 int theora_fix_bitrate
;
184 int theora_sharpness
;
185 int theora_keyframe_frequency
;
186 int theora_keyframe_force_frequency
;
197 // Set by package render during file creation. -1 means square pixels.
200 // for the interlace mode
201 int interlace_autofixoption
;
203 int interlace_fixmethod
;
205 // for jpeg compression
208 // for mpeg video compression
209 int vmpeg_iframe_distance
;
210 int vmpeg_progressive
;
215 int vmpeg_derivative
;
216 int vmpeg_quantization
;
218 int vmpeg_fix_bitrate
;
223 int vmpeg_field_order
;
224 int vmpeg_pframe_distance
;
233 // Divx video compression
236 int divx_rc_reaction_ratio
;
237 int divx_rc_reaction_period
;
238 int divx_max_key_interval
;
239 int divx_max_quantizer
;
240 int divx_min_quantizer
;
243 int divx_fix_bitrate
;
245 // h264 video compression
248 int h264_fix_bitrate
;
250 // Divx video decompression
251 int divx_use_deblocking
;
253 // PNG video compression
256 // EXR video compression
260 // TIFF video compression. An enumeration from filetiff.h
262 int tiff_compression
;
266 int ms_bitrate_tolerance
;
277 // Image file sequences. Background rendering doesn't want to write a
278 // sequence header but instead wants to start the sequence numbering at a certain
279 // number. This ensures deletion of all the frames which aren't being used.
280 // We still want sequence headers sometimes because loading a directory full of images
281 // for editing would create new assets for every image.
286 // Edits store data for the transition
289 int index_status
; // Macro from assets.inc
290 int64_t index_zoom
; // zoom factor of index data
291 int64_t index_start
; // byte start of index data in the index file
292 // Total bytes in source file when the index was buillt
294 int64_t index_end
, old_index_end
; // values for index build
295 // offsets of channels in index buffer in floats
296 int64_t *index_offsets
;
297 // Sizes of channels in index buffer in floats. This allows
298 // variable channel size.
299 int64_t *index_sizes
;
300 // [ index channel ][ index channel ]
301 // [high][low][high][low][high][low][high][low]