23 #include "filesndfile.h"
25 #include "filethread.h"
27 #include "filevorbis.h"
29 #include "formatwindow.h"
30 #include "formattools.h"
31 #include "framecache.h"
34 #include "pluginserver.h"
36 #include "stringfile.h"
46 format_completion = new Mutex("File::format_completion");
47 write_lock = new Condition(1, "File::write_lock");
48 frame_cache = new FrameCache;
56 if(format_window) format_window->set_done(0);
57 format_completion->lock("File::~File");
58 format_completion->unlock();
61 if(temp_frame) delete temp_frame;
64 Garbage::delete_object(asset);
65 delete format_completion;
67 if(frame_cache) delete frame_cache;
70 void File::reset_parameters()
82 normalized_sample = 0;
83 normalized_sample_rate = 0;
88 playback_subtitle = -1;
92 int File::raise_window()
94 if(getting_options && format_window)
96 format_window->raise_window();
97 format_window->flush();
102 void File::close_window()
106 format_window->lock_window("File::close_window");
107 format_window->set_done(1);
108 format_window->unlock_window();
113 int File::get_options(FormatTools *format,
117 BC_WindowBase *parent_window = format->window;
118 ArrayList<PluginServer*> *plugindb = format->plugindb;
119 Asset *asset = format->asset;
122 format_completion->lock("File::get_options");
123 switch(asset->format)
126 FileAC3::get_parameters(parent_window,
133 FileDV::get_parameters(parent_window,
144 FileSndFile::get_parameters(parent_window,
151 FileMOV::get_parameters(parent_window,
156 format->locked_compressor);
160 FileMPEG::get_parameters(parent_window,
167 FileMOV::get_parameters(parent_window,
172 format->locked_compressor);
174 case FILE_AVI_LAVTOOLS:
177 case FILE_AVI_AVIFILE:
178 FileAVI::get_parameters(parent_window,
183 format->locked_compressor);
187 FileJPEG::get_parameters(parent_window,
195 FileEXR::get_parameters(parent_window,
202 FileYUV::get_parameters(parent_window,
210 FilePNG::get_parameters(parent_window,
218 FileTGA::get_parameters(parent_window,
226 FileTIFF::get_parameters(parent_window,
233 FileOGG::get_parameters(parent_window,
245 ErrorBox *errorbox = new ErrorBox(PROGRAM_NAME ": Error",
246 parent_window->get_abs_cursor_x(1),
247 parent_window->get_abs_cursor_y(1));
248 format_window = errorbox;
251 errorbox->create_objects(_("This format doesn't support audio."));
254 errorbox->create_objects(_("This format doesn't support video."));
255 errorbox->run_window();
261 format_completion->unlock();
265 void File::set_asset(Asset *asset)
267 this->asset->copy_from(asset, 1);
270 int File::set_processors(int cpus) // Set the number of cpus for certain codecs
276 int File::set_preload(int64_t size)
278 this->playback_preload = size;
282 void File::set_subtitle(int value)
284 this->playback_subtitle = value;
287 void File::set_interpolate_raw(int value)
289 this->interpolate_raw = value;
292 void File::set_white_balance_raw(int value)
294 this->white_balance_raw = value;
297 void File::set_cache_frames(int value)
302 int File::purge_cache()
304 return frame_cache->delete_oldest();
317 int File::open_file(Preferences *preferences,
321 int64_t base_samplerate,
322 float base_framerate)
324 this->preferences = preferences;
325 this->asset->copy_from(asset, 1);
329 switch(this->asset->format)
331 // get the format now
332 // If you add another format to case 0, you also need to add another case for the
333 // file format #define.
336 if(!(stream = fopen(this->asset->path, "rb")))
343 fread(test, 16, 1, stream);
345 if(FileDV::check_sig(this->asset))
349 file = new FileDV(this->asset, this);
351 else if(FileSndFile::check_sig(this->asset))
355 file = new FileSndFile(this->asset, this);
358 if(FilePNG::check_sig(this->asset))
362 file = new FilePNG(this->asset, this);
365 if(FileJPEG::check_sig(this->asset))
369 file = new FileJPEG(this->asset, this);
372 if(FileEXR::check_sig(this->asset, test))
376 file = new FileEXR(this->asset, this);
379 if(FileYUV::check_sig(this->asset))
383 file = new FileYUV(this->asset, this);
386 if(FileCR2::check_sig(this->asset))
390 file = new FileCR2(this->asset, this);
393 if(FileTGA::check_sig(this->asset))
397 file = new FileTGA(this->asset, this);
400 if(FileTIFF::check_sig(this->asset))
404 file = new FileTIFF(this->asset, this);
407 if(FileOGG::check_sig(this->asset))
411 file = new FileOGG(this->asset, this);
414 if(FileVorbis::check_sig(this->asset))
418 file = new FileVorbis(this->asset, this);
421 if(FileOGG::check_sig(this->asset))
423 // OGG file. Doesn't always work with pure audio files.
425 file = new FileOGG(this->asset, this);
428 if(FileMPEG::check_sig(this->asset))
432 file = new FileMPEG(this->asset, this);
435 if(test[0] == '<' && test[1] == 'E' && test[2] == 'D' && test[3] == 'L' && test[4] == '>' ||
436 test[0] == '<' && test[1] == 'H' && test[2] == 'T' && test[3] == 'A' && test[4] == 'L' && test[5] == '>' ||
437 test[0] == '<' && test[1] == '?' && test[2] == 'x' && test[3] == 'm' && test[4] == 'l')
442 } // can't load project file
444 if(FileMOV::check_sig(this->asset))
447 // should be last because quicktime lacks a magic number
449 file = new FileMOV(this->asset, this);
455 return FILE_UNRECOGNIZED_CODEC;
459 // format already determined
461 file = new FileAC3(this->asset, this);
469 //printf("File::open_file 1\n");
470 file = new FileSndFile(this->asset, this);
475 file = new FilePNG(this->asset, this);
480 file = new FileJPEG(this->asset, this);
485 file = new FileEXR(this->asset, this);
489 file = new FileYUV(this->asset, this);
493 file = new FileCR2(this->asset, this);
498 file = new FileTGA(this->asset, this);
503 file = new FileTIFF(this->asset, this);
507 file = new FileMOV(this->asset, this);
513 file = new FileMPEG(this->asset, this);
517 file = new FileOGG(this->asset, this);
521 file = new FileVorbis(this->asset, this);
525 file = new FileMOV(this->asset, this);
528 case FILE_AVI_LAVTOOLS:
531 case FILE_AVI_AVIFILE:
532 file = new FileAVI(this->asset, this);
536 file = new FileDV(this->asset, this);
545 // Reopen file with correct parser and get header.
546 if(file->open_file(rd, wr))
553 // Set extra writing parameters to mandatory settings.
556 if(this->asset->dither) file->set_dither();
560 // Synchronize header parameters
563 asset->copy_from(this->asset, 1);
569 return FILE_NOT_FOUND;
572 int File::close_file(int ignore_thread)
582 // The file's asset is a copy of the argument passed to open_file so the
583 // user must copy lengths from the file's asset.
584 if(asset && file->wr)
586 asset->audio_length = current_sample;
587 asset->video_length = current_frame;
593 if(resample) delete resample;
594 if(resample_float) delete resample_float;
602 int File::get_index(char *index_path)
606 return file->get_index(index_path);
613 int File::start_audio_thread(int64_t buffer_size, int ring_buffers)
617 audio_thread = new FileThread(this, 1, 0);
618 audio_thread->start_writing(buffer_size, 0, ring_buffers, 0);
623 int File::start_video_thread(int64_t buffer_size,
630 video_thread = new FileThread(this, 0, 1);
631 video_thread->start_writing(buffer_size,
639 int File::start_video_decode_thread()
641 // Currently, CR2 is the only one which won't work asynchronously, so
642 // we're not using a virtual function yet.
643 if(!video_thread && asset->format != FILE_CR2)
645 video_thread = new FileThread(this, 0, 1);
646 video_thread->start_reading();
650 int File::stop_audio_thread()
654 audio_thread->stop_writing();
661 int File::stop_video_thread()
665 video_thread->stop_reading();
666 video_thread->stop_writing();
673 FileThread* File::get_video_thread()
678 int File::set_channel(int channel)
680 if(file && channel < asset->channels)
682 current_channel = channel;
689 int File::set_layer(int layer, int is_thread)
691 if(file && layer < asset->layers)
693 if(!is_thread && video_thread)
695 video_thread->set_layer(layer);
699 current_layer = layer;
707 int64_t File::get_audio_length(int64_t base_samplerate)
709 int64_t result = asset->audio_length;
712 if(base_samplerate > 0)
713 return (int64_t)((double)result / asset->sample_rate * base_samplerate + 0.5);
721 int64_t File::get_video_length(float base_framerate)
723 int64_t result = asset->video_length;
726 if(base_framerate > 0)
727 return (int64_t)((double)result / asset->frame_rate * base_framerate + 0.5);
732 return -1; // infinity
736 int64_t File::get_video_position(float base_framerate)
738 if(base_framerate > 0)
739 return (int64_t)((double)current_frame / asset->frame_rate * base_framerate + 0.5);
741 return current_frame;
744 int64_t File::get_audio_position(int64_t base_samplerate)
746 if(base_samplerate > 0)
748 if(normalized_sample_rate == base_samplerate)
749 return normalized_sample;
751 return (int64_t)((double)current_sample /
757 return current_sample;
762 // The base samplerate must be nonzero if the base samplerate in the calling
763 // function is expected to change as this forces the resampler to reset.
765 int File::set_audio_position(int64_t position, float base_samplerate)
771 #define REPOSITION(x, y) \
772 (labs((x) - (y)) > 1)
776 if((base_samplerate && REPOSITION(normalized_sample, position)) ||
777 (!base_samplerate && REPOSITION(current_sample, position)))
779 // Can't reset resampler since one seek operation is done
780 // for every channel to be read at the same position.
782 // Use a conditional reset for just the case of different base_samplerates
783 if(base_samplerate > 0)
785 if(normalized_sample_rate &&
786 normalized_sample_rate != base_samplerate &&
790 normalized_sample = position;
791 normalized_sample_rate = (int64_t)((base_samplerate > 0) ?
795 // Convert position to file's rate
796 if(base_samplerate > 0)
797 current_sample = Units::round((double)position /
803 current_sample = position;
804 normalized_sample = Units::round((double)position /
806 normalized_sample_rate);
807 // Can not set the normalized sample rate since this would reset the resampler.
810 result = file->set_audio_position(current_sample);
813 printf("File::set_audio_position position=%d base_samplerate=%f asset=%p asset->sample_rate=%d\n",
814 position, base_samplerate, asset, asset->sample_rate);
817 //printf("File::set_audio_position %d %d %d\n", current_channel, current_sample, position);
822 int File::set_video_position(int64_t position, float base_framerate, int is_thread)
827 // Convert to file's rate
828 if(base_framerate > 0)
829 position = (int64_t)((double)position /
835 if(video_thread && !is_thread)
837 // Call thread. Thread calls this again to set the file state.
838 video_thread->set_video_position(position);
841 if(current_frame != position)
845 current_frame = position;
846 result = file->set_video_position(current_frame);
853 // No resampling here.
854 int File::write_samples(double **buffer, int64_t len)
860 write_lock->lock("File::write_samples");
861 result = file->write_samples(buffer, len);
862 current_sample += len;
863 normalized_sample += len;
864 asset->audio_length += len;
865 write_lock->unlock();
870 // Can't put any cmodel abstraction here because the filebase couldn't be
872 int File::write_frames(VFrame ***frames, int len)
874 // Store the counters in temps so the filebase can choose to overwrite them.
876 int current_frame_temp = current_frame;
877 int video_length_temp = asset->video_length;
878 write_lock->lock("File::write_frames");
883 result = file->write_frames(frames, len);
889 current_frame = current_frame_temp + len;
890 asset->video_length = video_length_temp + len;
891 write_lock->unlock();
895 int File::write_compressed_frame(VFrame *buffer)
898 write_lock->lock("File::write_compressed_frame");
899 result = file->write_compressed_frame(buffer);
901 asset->video_length++;
902 write_lock->unlock();
907 int File::write_audio_buffer(int64_t len)
912 result = audio_thread->write_buffer(len);
917 int File::write_video_buffer(int64_t len)
922 result = video_thread->write_buffer(len);
928 double** File::get_audio_buffer()
930 if(audio_thread) return audio_thread->get_audio_buffer();
934 VFrame*** File::get_video_buffer()
936 if(video_thread) return video_thread->get_video_buffer();
941 int File::read_samples(double *buffer, int64_t len, int64_t base_samplerate, float *buffer_float)
944 if(len < 0) return 0;
946 // Never try to read more samples than exist in the file
947 if (current_sample + len > asset->audio_length) {
948 len = asset->audio_length - current_sample;
951 // Load with resampling
954 // Resample recursively calls this with the asset sample rate
955 if(base_samplerate == 0) base_samplerate = asset->sample_rate;
957 //printf("File::read_samples 2 %d %d\n", base_samplerate, asset->sample_rate);
958 if(base_samplerate != asset->sample_rate)
960 //printf("File::read_samples 3\n");
961 //struct timeval start_time;
962 //gettimeofday(&start_time, 0);
963 if (!file->prefer_samples_float())
967 //printf("File::read_samples 4\n");
968 resample = new Resample(this, asset->channels);
971 //printf("File::read_samples 5\n");
972 current_sample += resample->resample(buffer,
979 //printf("File::read_samples 6\n");
984 //printf("File::read_samples 4\n");
985 resample_float = new Resample_float(this, asset->channels);
988 //printf("File::read_samples 5\n");
989 current_sample += resample_float->resample(buffer,
996 //printf("File::read_samples 6\n");
999 //printf("diff2: %lli\n", get_difference(&start_time));
1005 //printf("File::read_samples 7\n");
1006 if (buffer_float && file->prefer_samples_float())
1007 result = file->read_samples_float(buffer_float, len);
1009 result = file->read_samples(buffer, len);
1010 //printf("File::read_samples 8\n");
1011 current_sample += len;
1014 normalized_sample += len;
1019 int File::read_compressed_frame(VFrame *buffer)
1023 result = file->read_compressed_frame(buffer);
1028 int64_t File::compressed_frame_size()
1031 return file->compressed_frame_size();
1039 int File::read_frame(VFrame *frame, int is_thread)
1041 if(video_thread && !is_thread) return video_thread->read_frame(frame);
1045 int supported_colormodel = colormodel_supported(frame->get_color_model());
1046 int advance_position = 1;
1050 frame_cache->get_frame(frame,
1055 // Can't advance position if cache used.
1056 advance_position = 0;
1060 if(frame->get_color_model() != BC_COMPRESSED &&
1061 (supported_colormodel != frame->get_color_model() ||
1062 frame->get_w() != asset->width ||
1063 frame->get_h() != asset->height))
1066 // Can't advance position here because it needs to be added to cache
1069 if(!temp_frame->params_match(asset->width, asset->height, supported_colormodel))
1078 temp_frame = new VFrame(0,
1081 supported_colormodel);
1084 temp_frame->copy_stacks(frame);
1085 file->read_frame(temp_frame);
1086 cmodel_transfer(frame->get_rows(),
1087 temp_frame->get_rows(),
1088 temp_frame->get_y(),
1089 temp_frame->get_u(),
1090 temp_frame->get_v(),
1096 temp_frame->get_w(),
1097 temp_frame->get_h(),
1102 temp_frame->get_color_model(),
1103 frame->get_color_model(),
1105 temp_frame->get_w(),
1110 // Can't advance position here because it needs to be added to cache
1111 file->read_frame(frame);
1114 if(use_cache) frame_cache->put_frame(frame,
1119 // printf("File::read_frame\n");
1120 // frame->dump_params();
1122 if(advance_position) current_frame++;
1129 int File::can_copy_from(Edit *edit, int64_t position, int output_w, int output_h)
1133 return edit->asset->width == output_w &&
1134 edit->asset->height == output_h &&
1135 file->can_copy_from(edit, position);
1141 // Fill in queries about formats when adding formats here.
1144 int File::strtoformat(char *format)
1146 return strtoformat(0, format);
1149 int File::strtoformat(ArrayList<PluginServer*> *plugindb, char *format)
1151 if(!strcasecmp(format, _(AC3_NAME))) return FILE_AC3;
1153 if(!strcasecmp(format, _(WAV_NAME))) return FILE_WAV;
1155 if(!strcasecmp(format, _(PCM_NAME))) return FILE_PCM;
1157 if(!strcasecmp(format, _(AU_NAME))) return FILE_AU;
1159 if(!strcasecmp(format, _(AIFF_NAME))) return FILE_AIFF;
1161 if(!strcasecmp(format, _(SND_NAME))) return FILE_SND;
1163 if(!strcasecmp(format, _(PNG_NAME))) return FILE_PNG;
1165 if(!strcasecmp(format, _(PNG_LIST_NAME))) return FILE_PNG_LIST;
1167 if(!strcasecmp(format, _(TIFF_NAME))) return FILE_TIFF;
1169 if(!strcasecmp(format, _(TIFF_LIST_NAME))) return FILE_TIFF_LIST;
1171 if(!strcasecmp(format, _(JPEG_NAME))) return FILE_JPEG;
1173 if(!strcasecmp(format, _(JPEG_LIST_NAME))) return FILE_JPEG_LIST;
1175 if(!strcasecmp(format, _(EXR_NAME))) return FILE_EXR;
1177 if(!strcasecmp(format, _(EXR_LIST_NAME))) return FILE_EXR_LIST;
1179 if(!strcasecmp(format, _(YUV_NAME))) return FILE_YUV;
1181 if(!strcasecmp(format, _(CR2_NAME))) return FILE_CR2;
1183 if(!strcasecmp(format, _(MPEG_NAME))) return FILE_MPEG;
1185 if(!strcasecmp(format, _(AMPEG_NAME))) return FILE_AMPEG;
1187 if(!strcasecmp(format, _(VMPEG_NAME))) return FILE_VMPEG;
1189 if(!strcasecmp(format, _(TGA_NAME))) return FILE_TGA;
1191 if(!strcasecmp(format, _(TGA_LIST_NAME))) return FILE_TGA_LIST;
1193 if(!strcasecmp(format, _(MOV_NAME))) return FILE_MOV;
1195 if(!strcasecmp(format, _(AVI_NAME))) return FILE_AVI;
1197 if(!strcasecmp(format, _(AVI_LAVTOOLS_NAME))) return FILE_AVI_LAVTOOLS;
1199 if(!strcasecmp(format, _(AVI_ARNE2_NAME))) return FILE_AVI_ARNE2;
1201 if(!strcasecmp(format, _(AVI_ARNE1_NAME))) return FILE_AVI_ARNE1;
1203 if(!strcasecmp(format, _(AVI_AVIFILE_NAME))) return FILE_AVI_AVIFILE;
1205 if(!strcasecmp(format, _(OGG_NAME))) return FILE_OGG;
1207 if(!strcasecmp(format, _(VORBIS_NAME))) return FILE_VORBIS;
1209 if(!strcasecmp(format, _(RAWDV_NAME))) return FILE_RAWDV;
1213 char* File::formattostr(int format)
1215 return formattostr(0, format);
1218 char* File::formattostr(ArrayList<PluginServer*> *plugindb, int format)
1235 return _(AIFF_NAME);
1244 return _(PNG_LIST_NAME);
1247 return _(JPEG_NAME);
1249 case FILE_JPEG_LIST:
1250 return _(JPEG_LIST_NAME);
1259 return _(EXR_LIST_NAME);
1265 return _(MPEG_NAME);
1268 return _(AMPEG_NAME);
1271 return _(VMPEG_NAME);
1277 return _(TGA_LIST_NAME);
1280 return _(TIFF_NAME);
1282 case FILE_TIFF_LIST:
1283 return _(TIFF_LIST_NAME);
1288 case FILE_AVI_LAVTOOLS:
1289 return _(AVI_LAVTOOLS_NAME);
1294 case FILE_AVI_ARNE2:
1295 return _(AVI_ARNE2_NAME);
1297 case FILE_AVI_ARNE1:
1298 return _(AVI_ARNE1_NAME);
1300 case FILE_AVI_AVIFILE:
1301 return _(AVI_AVIFILE_NAME);
1307 return _(VORBIS_NAME);
1310 return _(RAWDV_NAME);
1313 return _("Unknown");
1319 int File::strtobits(char *bits)
1321 if(!strcasecmp(bits, _(NAME_8BIT))) return BITSLINEAR8;
1322 if(!strcasecmp(bits, _(NAME_16BIT))) return BITSLINEAR16;
1323 if(!strcasecmp(bits, _(NAME_24BIT))) return BITSLINEAR24;
1324 if(!strcasecmp(bits, _(NAME_32BIT))) return BITSLINEAR32;
1325 if(!strcasecmp(bits, _(NAME_ULAW))) return BITSULAW;
1326 if(!strcasecmp(bits, _(NAME_ADPCM))) return BITS_ADPCM;
1327 if(!strcasecmp(bits, _(NAME_FLOAT))) return BITSFLOAT;
1328 if(!strcasecmp(bits, _(NAME_IMA4))) return BITSIMA4;
1329 return BITSLINEAR16;
1332 char* File::bitstostr(int bits)
1334 //printf("File::bitstostr\n");
1341 return (NAME_16BIT);
1344 return (NAME_24BIT);
1347 return (NAME_32BIT);
1353 return (NAME_ADPCM);
1356 return (NAME_FLOAT);
1367 int File::str_to_byteorder(char *string)
1369 if(!strcasecmp(string, _("Lo Hi"))) return 1;
1373 char* File::byteorder_to_str(int byte_order)
1375 if(byte_order) return _("Lo Hi");
1379 int File::bytes_per_sample(int bits)
1409 int File::get_best_colormodel(int driver)
1411 return get_best_colormodel(asset, driver);
1414 int File::get_best_colormodel(Asset *asset, int driver)
1416 switch(asset->format)
1419 return FileDV::get_best_colormodel(asset, driver);
1423 return FileMOV::get_best_colormodel(asset, driver);
1427 return FileMOV::get_best_colormodel(asset, driver);
1431 return FileMPEG::get_best_colormodel(asset, driver);
1435 case FILE_JPEG_LIST:
1436 return FileJPEG::get_best_colormodel(asset, driver);
1441 return FileEXR::get_best_colormodel(asset, driver);
1445 return FileYUV::get_best_colormodel(asset, driver);
1450 return FilePNG::get_best_colormodel(asset, driver);
1455 return FileTGA::get_best_colormodel(asset, driver);
1463 int File::colormodel_supported(int colormodel)
1466 return file->colormodel_supported(colormodel);
1472 int64_t File::get_memory_usage()
1475 if(temp_frame) result += temp_frame->get_data_size();
1476 if(file) result += file->get_memory_usage();
1477 result += frame_cache->get_memory_usage();
1478 if(video_thread) result += video_thread->get_memory_usage();
1480 if(result < MIN_CACHEITEM_SIZE) result = MIN_CACHEITEM_SIZE;
1484 FrameCache* File::get_frame_cache()
1489 int File::supports_video(ArrayList<PluginServer*> *plugindb, char *format)
1491 int i, format_i = strtoformat(plugindb, format);
1493 return supports_video(format_i);
1497 int File::supports_audio(ArrayList<PluginServer*> *plugindb, char *format)
1499 int i, format_i = strtoformat(plugindb, format);
1501 return supports_audio(format_i);
1506 int File::supports_video(int format)
1508 //printf("File::supports_video %d\n", format);
1514 case FILE_JPEG_LIST:
1524 case FILE_TIFF_LIST:
1526 case FILE_AVI_LAVTOOLS:
1527 case FILE_AVI_ARNE2:
1529 case FILE_AVI_ARNE1:
1530 case FILE_AVI_AVIFILE:
1541 int File::supports_audio(int format)
1556 case FILE_AVI_LAVTOOLS:
1557 case FILE_AVI_ARNE2:
1558 case FILE_AVI_ARNE1:
1559 case FILE_AVI_AVIFILE:
1569 char* File::get_tag(int format)
1573 case FILE_AC3: return "ac3";
1574 case FILE_AIFF: return "aif";
1575 case FILE_AMPEG: return "mp3";
1576 case FILE_AU: return "au";
1577 case FILE_AVI: return "avi";
1578 case FILE_RAWDV: return "dv";
1579 case FILE_EXR: return "exr";
1580 case FILE_EXR_LIST: return "exr";
1581 case FILE_JPEG: return "jpg";
1582 case FILE_JPEG_LIST: return "jpg";
1583 case FILE_MOV: return "mov";
1584 case FILE_OGG: return "ogg";
1585 case FILE_PCM: return "pcm";
1586 case FILE_PNG: return "png";
1587 case FILE_PNG_LIST: return "png";
1588 case FILE_TGA: return "tga";
1589 case FILE_TGA_LIST: return "tga";
1590 case FILE_TIFF: return "tif";
1591 case FILE_TIFF_LIST: return "tif";
1592 case FILE_VMPEG: return "m2v";
1593 case FILE_VORBIS: return "ogg";
1594 case FILE_WAV: return "wav";
1595 case FILE_YUV: return "m2v";
1600 PackagingEngine *File::new_packaging_engine(Asset *asset)
1602 PackagingEngine *result;
1603 switch (asset->format)
1606 result = (PackagingEngine*)new PackagingEngineOGG();
1609 result = (PackagingEngine*) new PackagingEngineDefault();