3 * Copyright (C) 2010 Adam Williams <broadcast at earthling dot net>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include "bcsignals.h"
29 #include "filesystem.h"
32 #include "indexstate.h"
39 : Indexable(1), ListItem<Asset>()
44 Asset::Asset(Asset &asset)
45 : Indexable(1), ListItem<Asset>()
48 this->copy_from(&asset, 1);
51 Asset::Asset(const char *path)
52 : Indexable(1), ListItem<Asset>()
55 strcpy(this->path, path);
58 Asset::Asset(const int plugin_type, const char *plugin_title)
59 : Indexable(1), ListItem<Asset>()
68 int Asset::init_values()
71 // Has to be unknown for file probing to succeed
72 format = FILE_UNKNOWN;
85 ff_audio_options[0] = 0;
86 ff_video_options[0] = 0;
98 vorbis_min_bitrate = -1;
99 vorbis_bitrate = 128000;
100 vorbis_max_bitrate = -1;
102 theora_fix_bitrate = 1;
103 theora_bitrate = 860000;
105 theora_sharpness = 2;
106 theora_keyframe_frequency = 64;
107 theora_keyframe_force_frequency = 64;
110 vmpeg_iframe_distance = 45;
111 vmpeg_pframe_distance = 0;
112 vmpeg_progressive = 0;
114 vmpeg_bitrate = 1000000;
115 vmpeg_derivative = 1;
116 vmpeg_quantization = 15;
117 vmpeg_cmodel = BC_YUV420P;
118 vmpeg_fix_bitrate = 0;
121 vmpeg_field_order = 0;
130 tiff_compression = 0;
139 void Asset::reset_audio()
147 void Asset::reset_video()
151 actual_width = width = 0;
152 actual_height = height = 0;
154 vmpeg_cmodel = BC_YUV420P;
160 void Asset::boundaries()
162 //printf("Asset::boundaries %d %d %f\n", __LINE__, sample_rate, frame_rate);
163 // sample_rate & frame_rate are user defined
164 // CLAMP(sample_rate, 1, 1000000);
165 // CLAMP(frame_rate, 0.001, 1000000);
166 CLAMP(channels, 0, 16);
167 CLAMP(width, 0, 10000);
168 CLAMP(height, 0, 10000);
169 //printf("Asset::boundaries %d %d %f\n", __LINE__, sample_rate, frame_rate);
172 void Asset::copy_from(Asset *asset, int do_index)
174 copy_location(asset);
175 copy_format(asset, do_index);
178 void Asset::copy_location(Asset *asset)
180 strcpy(this->path, asset->path);
181 strcpy(this->folder, asset->folder);
184 void Asset::copy_format(Asset *asset, int do_index)
186 if(do_index) update_index(asset);
188 audio_data = asset->audio_data;
189 format = asset->format;
190 strcpy(fformat, asset->fformat);
191 channels = asset->channels;
192 sample_rate = asset->sample_rate;
194 byte_order = asset->byte_order;
195 signed_ = asset->signed_;
196 header = asset->header;
197 dither = asset->dither;
198 mp3_bitrate = asset->mp3_bitrate;
199 use_header = asset->use_header;
200 aspect_ratio = asset->aspect_ratio;
202 video_data = asset->video_data;
203 layers = asset->layers;
204 program = asset->program;
205 frame_rate = asset->frame_rate;
206 width = asset->width;
207 height = asset->height;
208 actual_width = asset->actual_width;
209 actual_height = asset->actual_height;
210 strcpy(vcodec, asset->vcodec);
211 strcpy(acodec, asset->acodec);
213 strcpy(ff_audio_options, asset->ff_audio_options);
214 strcpy(ff_video_options, asset->ff_video_options);
215 ff_audio_bitrate = asset->ff_audio_bitrate;
216 ff_video_bitrate = asset->ff_video_bitrate;
217 ff_video_quality = asset->ff_video_quality;
219 this->audio_length = asset->audio_length;
220 this->video_length = asset->video_length;
223 ampeg_bitrate = asset->ampeg_bitrate;
224 ampeg_derivative = asset->ampeg_derivative;
227 vorbis_vbr = asset->vorbis_vbr;
228 vorbis_min_bitrate = asset->vorbis_min_bitrate;
229 vorbis_bitrate = asset->vorbis_bitrate;
230 vorbis_max_bitrate = asset->vorbis_max_bitrate;
233 theora_fix_bitrate = asset->theora_fix_bitrate;
234 theora_bitrate = asset->theora_bitrate;
235 theora_quality = asset->theora_quality;
236 theora_sharpness = asset->theora_sharpness;
237 theora_keyframe_frequency = asset->theora_keyframe_frequency;
238 theora_keyframe_force_frequency = asset->theora_keyframe_frequency;
241 jpeg_quality = asset->jpeg_quality;
244 vmpeg_iframe_distance = asset->vmpeg_iframe_distance;
245 vmpeg_pframe_distance = asset->vmpeg_pframe_distance;
246 vmpeg_progressive = asset->vmpeg_progressive;
247 vmpeg_denoise = asset->vmpeg_denoise;
248 vmpeg_bitrate = asset->vmpeg_bitrate;
249 vmpeg_derivative = asset->vmpeg_derivative;
250 vmpeg_quantization = asset->vmpeg_quantization;
251 vmpeg_cmodel = asset->vmpeg_cmodel;
252 vmpeg_fix_bitrate = asset->vmpeg_fix_bitrate;
253 vmpeg_seq_codes = asset->vmpeg_seq_codes;
254 vmpeg_preset = asset->vmpeg_preset;
255 vmpeg_field_order = asset->vmpeg_field_order;
257 ac3_bitrate = asset->ac3_bitrate;
259 png_use_alpha = asset->png_use_alpha;
260 exr_use_alpha = asset->exr_use_alpha;
261 exr_compression = asset->exr_compression;
263 tiff_cmodel = asset->tiff_cmodel;
264 tiff_compression = asset->tiff_compression;
267 int64_t Asset::get_index_offset(int channel)
269 return index_state->get_index_offset(channel);
272 int64_t Asset::get_index_size(int channel)
274 return index_state->get_index_size(channel);
278 char* Asset::get_compression_text(int audio, int video)
283 if( acodec[0] ) return acodec;
290 if( vcodec[0] ) return vcodec;
297 Asset& Asset::operator=(Asset &asset)
299 printf("Asset::operator=\n");
300 copy_location(&asset);
301 copy_format(&asset, 1);
306 int Asset::equivalent(Asset &asset,
310 int result = (!strcmp(asset.path, path) &&
311 format == asset.format);
313 if(result && format == FILE_FFMPEG)
314 result = !strcmp(fformat, asset.fformat);
316 if(test_audio && result)
318 result = (channels == asset.channels &&
319 sample_rate == asset.sample_rate &&
320 bits == asset.bits &&
321 byte_order == asset.byte_order &&
322 signed_ == asset.signed_ &&
323 header == asset.header &&
324 dither == asset.dither &&
325 !strcmp(acodec, asset.acodec));
326 if(result && format == FILE_FFMPEG)
327 result = !strcmp(ff_audio_options, asset.ff_audio_options) &&
328 ff_audio_bitrate == asset.ff_audio_bitrate;
333 if(test_video && result)
335 result = (layers == asset.layers &&
336 program == asset.program &&
337 frame_rate == asset.frame_rate &&
338 width == asset.width &&
339 height == asset.height &&
340 !strcmp(vcodec, asset.vcodec));
341 if(result && format == FILE_FFMPEG)
342 result = !strcmp(ff_video_options, asset.ff_video_options) &&
343 ff_video_bitrate == asset.ff_video_bitrate &&
344 ff_video_quality == asset.ff_video_quality;
350 int Asset::operator==(Asset &asset)
353 return equivalent(asset,
358 int Asset::operator!=(Asset &asset)
360 return !(*this == asset);
363 int Asset::test_path(const char *path)
365 if(!strcasecmp(this->path, path))
371 int Asset::test_plugin_title(const char *path)
376 int Asset::read(FileXML *file,
381 // Check for relative path.
384 char new_path[BCTEXTLEN];
385 char asset_directory[BCTEXTLEN];
386 char input_directory[BCTEXTLEN];
389 strcpy(new_path, path);
390 fs.set_current_dir("");
392 fs.extract_dir(asset_directory, path);
395 // Take path of XML file.
396 if(!asset_directory[0])
398 fs.extract_dir(input_directory, file->filename);
400 // Input file has a path
401 if(input_directory[0])
403 fs.join_names(path, input_directory, new_path);
411 result = file->read_tag();
414 if(file->tag.title_is("/ASSET"))
419 if(file->tag.title_is("AUDIO"))
424 if(file->tag.title_is("AUDIO_OMIT"))
429 if(file->tag.title_is("FORMAT"))
431 const char *string = file->tag.get_property("TYPE");
432 format = File::strtoformat(string);
434 file->tag.get_property("USE_HEADER", use_header);
435 file->tag.get_property("FFORMAT", fformat);
438 if(file->tag.title_is("FOLDER"))
440 strcpy(folder, file->read_text());
443 if(file->tag.title_is("VIDEO"))
448 if(file->tag.title_is("VIDEO_OMIT"))
453 if(file->tag.title_is("INDEX"))
461 //printf("Asset::read 2\n");
465 int Asset::read_audio(FileXML *file)
467 if(file->tag.title_is("AUDIO")) audio_data = 1;
468 channels = file->tag.get_property("CHANNELS", 2);
469 // This is loaded from the index file after the EDL but this
470 // should be overridable in the EDL.
471 if(!sample_rate) sample_rate = file->tag.get_property("RATE", 48000);
472 bits = file->tag.get_property("BITS", 16);
473 byte_order = file->tag.get_property("BYTE_ORDER", 1);
474 signed_ = file->tag.get_property("SIGNED", 1);
475 header = file->tag.get_property("HEADER", 0);
476 dither = file->tag.get_property("DITHER", 0);
478 audio_length = file->tag.get_property("AUDIO_LENGTH", (int64_t)0);
480 file->tag.get_property("ACODEC", acodec);
485 int Asset::read_video(FileXML *file)
487 if(file->tag.title_is("VIDEO")) video_data = 1;
488 actual_height = file->tag.get_property("ACTUAL_HEIGHT", actual_height);
489 actual_width = file->tag.get_property("ACTUAL_WIDTH", actual_width);
490 height = file->tag.get_property("HEIGHT", height);
491 width = file->tag.get_property("WIDTH", width);
492 layers = file->tag.get_property("LAYERS", layers);
493 program = file->tag.get_property("PROGRAM", program);
494 // This is loaded from the index file after the EDL but this
495 // should be overridable in the EDL.
496 if(EQUIV(frame_rate, 0)) frame_rate = file->tag.get_property("FRAMERATE", frame_rate);
498 file->tag.get_property("VCODEC", vcodec);
500 video_length = file->tag.get_property("VIDEO_LENGTH", (int64_t)0);
505 int Asset::read_index(FileXML *file)
507 index_state->read_xml(file, channels);
511 // Output path is the path of the output file if name truncation is desired.
512 // It is a "" if complete names should be used.
514 int Asset::write(FileXML *file,
516 const char *output_path)
518 char new_path[BCTEXTLEN];
519 char asset_directory[BCTEXTLEN];
520 char output_directory[BCTEXTLEN];
523 // Make path relative
524 fs.extract_dir(asset_directory, path);
525 if(output_path && output_path[0])
526 fs.extract_dir(output_directory, output_path);
528 output_directory[0] = 0;
530 // Asset and EDL are in same directory. Extract just the name.
531 if(!strcmp(asset_directory, output_directory))
533 fs.extract_name(new_path, path);
537 strcpy(new_path, path);
540 file->tag.set_title("ASSET");
541 file->tag.set_property("SRC", new_path);
543 file->append_newline();
545 file->tag.set_title("FOLDER");
547 file->append_text(folder);
548 file->tag.set_title("/FOLDER");
550 file->append_newline();
552 // Write the format information
553 file->tag.set_title("FORMAT");
555 file->tag.set_property("TYPE",
556 File::formattostr(format));
557 file->tag.set_property("USE_HEADER", use_header);
558 file->tag.set_property("FFORMAT", fformat);
561 file->append_newline();
563 // Requiring data to exist caused batch render to lose settings.
564 // But the only way to know if an asset doesn't have audio or video data
565 // is to not write the block.
566 // So change the block name if the asset doesn't have the data.
569 // index goes after source
570 if(index_state->index_status == INDEX_READY && include_index)
573 file->tag.set_title("/ASSET");
575 file->append_newline();
579 int Asset::write_audio(FileXML *file)
581 // Let the reader know if the asset has the data by naming the block.
583 file->tag.set_title("AUDIO");
585 file->tag.set_title("AUDIO_OMIT");
586 // Necessary for PCM audio
587 file->tag.set_property("CHANNELS", channels);
588 file->tag.set_property("RATE", sample_rate);
589 file->tag.set_property("BITS", bits);
590 file->tag.set_property("BYTE_ORDER", byte_order);
591 file->tag.set_property("SIGNED", signed_);
592 file->tag.set_property("HEADER", header);
593 file->tag.set_property("DITHER", dither);
595 file->tag.set_property("ACODEC", acodec);
597 file->tag.set_property("AUDIO_LENGTH", audio_length);
601 // Rely on defaults operations for these.
603 // file->tag.set_property("AMPEG_BITRATE", ampeg_bitrate);
604 // file->tag.set_property("AMPEG_DERIVATIVE", ampeg_derivative);
606 // file->tag.set_property("VORBIS_VBR", vorbis_vbr);
607 // file->tag.set_property("VORBIS_MIN_BITRATE", vorbis_min_bitrate);
608 // file->tag.set_property("VORBIS_BITRATE", vorbis_bitrate);
609 // file->tag.set_property("VORBIS_MAX_BITRATE", vorbis_max_bitrate);
611 // file->tag.set_property("MP3_BITRATE", mp3_bitrate);
617 file->append_newline();
621 int Asset::write_video(FileXML *file)
624 file->tag.set_title("VIDEO");
626 file->tag.set_title("VIDEO_OMIT");
627 file->tag.set_property("ACTUAL_HEIGHT", actual_height);
628 file->tag.set_property("ACTUAL_WIDTH", actual_width);
629 file->tag.set_property("HEIGHT", height);
630 file->tag.set_property("WIDTH", width);
631 file->tag.set_property("LAYERS", layers);
632 file->tag.set_property("PROGRAM", program);
633 file->tag.set_property("FRAMERATE", frame_rate);
635 file->tag.set_property("VCODEC", vcodec);
637 file->tag.set_property("VIDEO_LENGTH", video_length);
643 file->append_newline();
647 int Asset::write_index(FileXML *file)
649 index_state->write_xml(file);
655 const char* Asset::construct_param(const char *param,
660 sprintf(return_value, "%s%s", prefix, param);
662 strcpy(return_value, param);
666 #define UPDATE_DEFAULT(x, y) defaults->update(construct_param(x, prefix, string), y);
667 #define GET_DEFAULT(x, y) defaults->get(construct_param(x, prefix, string), y);
669 void Asset::load_defaults(BC_Hash *defaults,
677 char string[BCTEXTLEN];
679 // Can't save codec here because it's specific to render, record, and effect.
680 // The codec has to be UNKNOWN for file probing to work.
684 GET_DEFAULT("PATH", path);
689 GET_DEFAULT("AUDIO_CODEC", acodec);
690 GET_DEFAULT("VIDEO_CODEC", vcodec);
695 format = GET_DEFAULT("FORMAT", format);
696 use_header = GET_DEFAULT("USE_HEADER", use_header);
697 GET_DEFAULT("FFORMAT", fformat);
702 audio_data = GET_DEFAULT("AUDIO", 1);
703 video_data = GET_DEFAULT("VIDEO", 1);
708 bits = GET_DEFAULT("BITS", 16);
709 dither = GET_DEFAULT("DITHER", 0);
710 signed_ = GET_DEFAULT("SIGNED", 1);
711 byte_order = GET_DEFAULT("BYTE_ORDER", 1);
715 channels = GET_DEFAULT("CHANNELS", 2);
716 if(!sample_rate) sample_rate = GET_DEFAULT("RATE", 48000);
717 header = GET_DEFAULT("HEADER", 0);
718 audio_length = GET_DEFAULT("AUDIO_LENGTH", (int64_t)0);
722 height = GET_DEFAULT("HEIGHT", height);
723 width = GET_DEFAULT("WIDTH", width);
724 actual_height = GET_DEFAULT("ACTUAL_HEIGHT", actual_height);
725 actual_width = GET_DEFAULT("ACTUAL_WIDTH", actual_width);
726 program = GET_DEFAULT("PROGRAM", program);
727 layers = GET_DEFAULT("LAYERS", layers);
728 if(EQUIV(frame_rate, 0)) frame_rate = GET_DEFAULT("FRAMERATE", frame_rate);
729 video_length = GET_DEFAULT("VIDEO_LENGTH", (int64_t)0);
732 ampeg_bitrate = GET_DEFAULT("AMPEG_BITRATE", ampeg_bitrate);
733 ampeg_derivative = GET_DEFAULT("AMPEG_DERIVATIVE", ampeg_derivative);
735 vorbis_vbr = GET_DEFAULT("VORBIS_VBR", vorbis_vbr);
736 vorbis_min_bitrate = GET_DEFAULT("VORBIS_MIN_BITRATE", vorbis_min_bitrate);
737 vorbis_bitrate = GET_DEFAULT("VORBIS_BITRATE", vorbis_bitrate);
738 vorbis_max_bitrate = GET_DEFAULT("VORBIS_MAX_BITRATE", vorbis_max_bitrate);
740 theora_fix_bitrate = GET_DEFAULT("THEORA_FIX_BITRATE", theora_fix_bitrate);
741 theora_bitrate = GET_DEFAULT("THEORA_BITRATE", theora_bitrate);
742 theora_quality = GET_DEFAULT("THEORA_QUALITY", theora_quality);
743 theora_sharpness = GET_DEFAULT("THEORA_SHARPNESS", theora_sharpness);
744 theora_keyframe_frequency = GET_DEFAULT("THEORA_KEYFRAME_FREQUENCY", theora_keyframe_frequency);
745 theora_keyframe_force_frequency = GET_DEFAULT("THEORA_FORCE_KEYFRAME_FREQUENCY", theora_keyframe_force_frequency);
747 GET_DEFAULT("FF_AUDIO_OPTIONS", ff_audio_options);
748 ff_audio_bitrate = GET_DEFAULT("FF_AUDIO_BITRATE", ff_audio_bitrate);
749 GET_DEFAULT("FF_VIDEO_OPTIONS", ff_video_options);
750 ff_video_bitrate = GET_DEFAULT("FF_VIDEO_BITRATE", ff_video_bitrate);
751 ff_video_quality = GET_DEFAULT("FF_VIDEO_QUALITY", ff_video_quality);
753 mp3_bitrate = GET_DEFAULT("MP3_BITRATE", mp3_bitrate);
755 jpeg_quality = GET_DEFAULT("JPEG_QUALITY", jpeg_quality);
756 aspect_ratio = GET_DEFAULT("ASPECT_RATIO", aspect_ratio);
758 // MPEG format information
759 vmpeg_iframe_distance = GET_DEFAULT("VMPEG_IFRAME_DISTANCE", vmpeg_iframe_distance);
760 vmpeg_pframe_distance = GET_DEFAULT("VMPEG_PFRAME_DISTANCE", vmpeg_pframe_distance);
761 vmpeg_progressive = GET_DEFAULT("VMPEG_PROGRESSIVE", vmpeg_progressive);
762 vmpeg_denoise = GET_DEFAULT("VMPEG_DENOISE", vmpeg_denoise);
763 vmpeg_bitrate = GET_DEFAULT("VMPEG_BITRATE", vmpeg_bitrate);
764 vmpeg_derivative = GET_DEFAULT("VMPEG_DERIVATIVE", vmpeg_derivative);
765 vmpeg_quantization = GET_DEFAULT("VMPEG_QUANTIZATION", vmpeg_quantization);
766 vmpeg_cmodel = GET_DEFAULT("VMPEG_CMODEL", vmpeg_cmodel);
767 vmpeg_fix_bitrate = GET_DEFAULT("VMPEG_FIX_BITRATE", vmpeg_fix_bitrate);
768 vmpeg_seq_codes = GET_DEFAULT("VMPEG_SEQ_CODES", vmpeg_seq_codes);
769 vmpeg_preset = GET_DEFAULT("VMPEG_PRESET", vmpeg_preset);
770 vmpeg_field_order = GET_DEFAULT("VMPEG_FIELD_ORDER", vmpeg_field_order);
772 ac3_bitrate = GET_DEFAULT("AC3_BITRATE", ac3_bitrate);
774 png_use_alpha = GET_DEFAULT("PNG_USE_ALPHA", png_use_alpha);
775 exr_use_alpha = GET_DEFAULT("EXR_USE_ALPHA", exr_use_alpha);
776 exr_compression = GET_DEFAULT("EXR_COMPRESSION", exr_compression);
777 tiff_cmodel = GET_DEFAULT("TIFF_CMODEL", tiff_cmodel);
778 tiff_compression = GET_DEFAULT("TIFF_COMPRESSION", tiff_compression);
783 void Asset::save_defaults(BC_Hash *defaults,
791 char string[BCTEXTLEN];
793 UPDATE_DEFAULT("PATH", path);
800 UPDATE_DEFAULT("FORMAT", format);
801 UPDATE_DEFAULT("USE_HEADER", use_header);
802 UPDATE_DEFAULT("FFORMAT", fformat);
807 UPDATE_DEFAULT("AUDIO", audio_data);
808 UPDATE_DEFAULT("VIDEO", video_data);
813 UPDATE_DEFAULT("AUDIO_CODEC", acodec);
814 UPDATE_DEFAULT("VIDEO_CODEC", vcodec);
816 UPDATE_DEFAULT("AMPEG_BITRATE", ampeg_bitrate);
817 UPDATE_DEFAULT("AMPEG_DERIVATIVE", ampeg_derivative);
819 UPDATE_DEFAULT("VORBIS_VBR", vorbis_vbr);
820 UPDATE_DEFAULT("VORBIS_MIN_BITRATE", vorbis_min_bitrate);
821 UPDATE_DEFAULT("VORBIS_BITRATE", vorbis_bitrate);
822 UPDATE_DEFAULT("VORBIS_MAX_BITRATE", vorbis_max_bitrate);
824 UPDATE_DEFAULT("FF_AUDIO_OPTIONS", ff_audio_options);
825 UPDATE_DEFAULT("FF_AUDIO_BITRATE", ff_audio_bitrate);
826 UPDATE_DEFAULT("FF_VIDEO_OPTIONS", ff_video_options);
827 UPDATE_DEFAULT("FF_VIDEO_BITRATE", ff_video_bitrate);
828 UPDATE_DEFAULT("FF_VIDEO_QUALITY", ff_video_quality);
830 UPDATE_DEFAULT("THEORA_FIX_BITRATE", theora_fix_bitrate);
831 UPDATE_DEFAULT("THEORA_BITRATE", theora_bitrate);
832 UPDATE_DEFAULT("THEORA_QUALITY", theora_quality);
833 UPDATE_DEFAULT("THEORA_SHARPNESS", theora_sharpness);
834 UPDATE_DEFAULT("THEORA_KEYFRAME_FREQUENCY", theora_keyframe_frequency);
835 UPDATE_DEFAULT("THEORA_FORCE_KEYFRAME_FREQUENCY", theora_keyframe_force_frequency);
839 UPDATE_DEFAULT("MP3_BITRATE", mp3_bitrate);
841 UPDATE_DEFAULT("JPEG_QUALITY", jpeg_quality);
842 UPDATE_DEFAULT("ASPECT_RATIO", aspect_ratio);
844 // MPEG format information
845 UPDATE_DEFAULT("VMPEG_IFRAME_DISTANCE", vmpeg_iframe_distance);
846 UPDATE_DEFAULT("VMPEG_PFRAME_DISTANCE", vmpeg_pframe_distance);
847 UPDATE_DEFAULT("VMPEG_PROGRESSIVE", vmpeg_progressive);
848 UPDATE_DEFAULT("VMPEG_DENOISE", vmpeg_denoise);
849 UPDATE_DEFAULT("VMPEG_BITRATE", vmpeg_bitrate);
850 UPDATE_DEFAULT("VMPEG_DERIVATIVE", vmpeg_derivative);
851 UPDATE_DEFAULT("VMPEG_QUANTIZATION", vmpeg_quantization);
852 UPDATE_DEFAULT("VMPEG_CMODEL", vmpeg_cmodel);
853 UPDATE_DEFAULT("VMPEG_FIX_BITRATE", vmpeg_fix_bitrate);
854 UPDATE_DEFAULT("VMPEG_SEQ_CODES", vmpeg_seq_codes);
855 UPDATE_DEFAULT("VMPEG_PRESET", vmpeg_preset);
856 UPDATE_DEFAULT("VMPEG_FIELD_ORDER", vmpeg_field_order);
859 UPDATE_DEFAULT("AC3_BITRATE", ac3_bitrate);
862 UPDATE_DEFAULT("PNG_USE_ALPHA", png_use_alpha);
863 UPDATE_DEFAULT("EXR_USE_ALPHA", exr_use_alpha);
864 UPDATE_DEFAULT("EXR_COMPRESSION", exr_compression);
865 UPDATE_DEFAULT("TIFF_CMODEL", tiff_cmodel);
866 UPDATE_DEFAULT("TIFF_COMPRESSION", tiff_compression);
871 UPDATE_DEFAULT("BITS", bits);
872 UPDATE_DEFAULT("DITHER", dither);
873 UPDATE_DEFAULT("SIGNED", signed_);
874 UPDATE_DEFAULT("BYTE_ORDER", byte_order);
881 UPDATE_DEFAULT("CHANNELS", channels);
882 UPDATE_DEFAULT("RATE", sample_rate);
883 UPDATE_DEFAULT("HEADER", header);
884 UPDATE_DEFAULT("AUDIO_LENGTH", audio_length);
888 UPDATE_DEFAULT("HEIGHT", height);
889 UPDATE_DEFAULT("WIDTH", width);
890 UPDATE_DEFAULT("ACTUAL_HEIGHT", actual_height);
891 UPDATE_DEFAULT("ACTUAL_WIDTH", actual_width);
892 UPDATE_DEFAULT("PROGRAM", program);
893 UPDATE_DEFAULT("LAYERS", layers);
894 UPDATE_DEFAULT("FRAMERATE", frame_rate);
895 UPDATE_DEFAULT("VIDEO_LENGTH", video_length);
908 int Asset::dump(FILE *fp)
910 fprintf(fp," asset::dump\n");
911 fprintf(fp," this=%p path=%s\n", this, path);
912 fprintf(fp," index_status %d\n", index_state->index_status);
913 fprintf(fp," format %d\n", format);
914 fprintf(fp," fformat=\"%s\"\n", fformat);
915 fprintf(fp," ff_audio_options=\"%s\"\n", ff_audio_options);
916 fprintf(fp," ff_audio_bitrate=%d\n", ff_audio_bitrate);
917 fprintf(fp," ff_video_options=\"%s\"\n", ff_video_options);
918 fprintf(fp," ff_video_bitrate=%d\n", ff_video_bitrate);
919 fprintf(fp," ff_video_quality=%d\n", ff_video_quality);
920 fprintf(fp," audio_data %d channels %d samplerate %d bits %d"
921 " byte_order %d signed %d header %d dither %d acodec %c%c%c%c\n",
922 audio_data, channels, sample_rate, bits, byte_order, signed_,
923 header, dither, acodec[0], acodec[1], acodec[2], acodec[3]);
924 fprintf(fp," audio_length " _LD "\n", audio_length);
925 fprintf(fp," video_data %d program %d layers %d framerate %f width %d"
926 " height %d vcodec %c%c%c%c aspect_ratio %f\n",
927 video_data, layers, program, frame_rate, width, height,
928 vcodec[0], vcodec[1], vcodec[2], vcodec[3], aspect_ratio);
929 fprintf(fp," video_length " _LD " \n", video_length);
935 int Asset::get_audio_channels()
940 int Asset::get_sample_rate()
945 int64_t Asset::get_audio_samples()
950 int Asset::have_audio()
955 int Asset::have_video()
970 double Asset::get_frame_rate()
976 int Asset::get_video_layers()
981 int Asset::get_program()
986 int64_t Asset::get_video_frames()