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"
45 asset = Asset_GC(new Asset);
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 delete format_completion;
66 if(frame_cache) delete frame_cache;
69 void File::reset_parameters()
81 normalized_sample = 0;
82 normalized_sample_rate = 0;
87 playback_subtitle = -1;
91 int File::raise_window()
93 if(getting_options && format_window)
95 format_window->raise_window();
96 format_window->flush();
101 void File::close_window()
105 format_window->lock_window("File::close_window");
106 format_window->set_done(1);
107 format_window->unlock_window();
112 int File::get_options(FormatTools *format,
116 BC_WindowBase *parent_window = format->window;
117 ArrayList<PluginServer*> *plugindb = format->plugindb;
118 Asset_GC asset = format->asset;
121 format_completion->lock("File::get_options");
122 switch(asset->format)
125 FileAC3::get_parameters(parent_window,
132 FileDV::get_parameters(parent_window,
143 FileSndFile::get_parameters(parent_window,
150 FileMOV::get_parameters(parent_window,
155 format->locked_compressor);
159 FileMPEG::get_parameters(parent_window,
166 FileMOV::get_parameters(parent_window,
171 format->locked_compressor);
173 case FILE_AVI_LAVTOOLS:
176 case FILE_AVI_AVIFILE:
177 FileAVI::get_parameters(parent_window,
182 format->locked_compressor);
186 FileJPEG::get_parameters(parent_window,
194 FileEXR::get_parameters(parent_window,
201 FileYUV::get_parameters(parent_window,
209 FilePNG::get_parameters(parent_window,
217 FileTGA::get_parameters(parent_window,
225 FileTIFF::get_parameters(parent_window,
232 FileOGG::get_parameters(parent_window,
244 ErrorBox *errorbox = new ErrorBox(PROGRAM_NAME ": Error",
245 parent_window->get_abs_cursor_x(1),
246 parent_window->get_abs_cursor_y(1));
247 format_window = errorbox;
250 errorbox->create_objects(_("This format doesn't support audio."));
253 errorbox->create_objects(_("This format doesn't support video."));
254 errorbox->run_window();
260 format_completion->unlock();
264 void File::set_asset(Asset_GC asset)
266 this->asset->copy_from(*asset, 1);
269 int File::set_processors(int cpus) // Set the number of cpus for certain codecs
275 int File::set_preload(int64_t size)
277 this->playback_preload = size;
281 void File::set_subtitle(int value)
283 this->playback_subtitle = value;
286 void File::set_interpolate_raw(int value)
288 this->interpolate_raw = value;
291 void File::set_white_balance_raw(int value)
293 this->white_balance_raw = value;
296 void File::set_cache_frames(int value)
301 int File::purge_cache()
303 return frame_cache->delete_oldest();
316 int File::open_file(Preferences *preferences,
320 int64_t base_samplerate,
321 float base_framerate)
323 this->preferences = preferences;
324 this->asset->copy_from(*asset, 1);
328 switch(this->asset->format)
330 // get the format now
331 // If you add another format to case 0, you also need to add another case for the
332 // file format #define.
335 if(!(stream = fopen(this->asset->path, "rb")))
342 fread(test, 16, 1, stream);
344 if(FileDV::check_sig(this->asset))
348 file = new FileDV(this->asset, this);
350 else if(FileSndFile::check_sig(this->asset))
354 file = new FileSndFile(this->asset, this);
357 if(FilePNG::check_sig(this->asset))
361 file = new FilePNG(this->asset, this);
364 if(FileJPEG::check_sig(this->asset))
368 file = new FileJPEG(this->asset, this);
371 if(FileEXR::check_sig(this->asset, test))
375 file = new FileEXR(this->asset, this);
378 if(FileYUV::check_sig(this->asset))
382 file = new FileYUV(this->asset, this);
385 if(FileCR2::check_sig(this->asset))
389 file = new FileCR2(this->asset, this);
392 if(FileTGA::check_sig(this->asset))
396 file = new FileTGA(this->asset, this);
399 if(FileTIFF::check_sig(this->asset))
403 file = new FileTIFF(this->asset, this);
406 if(FileOGG::check_sig(this->asset))
410 file = new FileOGG(this->asset, this);
413 if(FileVorbis::check_sig(this->asset))
417 file = new FileVorbis(this->asset, this);
420 if(FileOGG::check_sig(this->asset))
422 // OGG file. Doesn't always work with pure audio files.
424 file = new FileOGG(this->asset, this);
427 if(FileMPEG::check_sig(this->asset))
431 file = new FileMPEG(this->asset, this);
434 if(test[0] == '<' && test[1] == 'E' && test[2] == 'D' && test[3] == 'L' && test[4] == '>' ||
435 test[0] == '<' && test[1] == 'H' && test[2] == 'T' && test[3] == 'A' && test[4] == 'L' && test[5] == '>' ||
436 test[0] == '<' && test[1] == '?' && test[2] == 'x' && test[3] == 'm' && test[4] == 'l')
441 } // can't load project file
443 if(FileMOV::check_sig(this->asset))
446 // should be last because quicktime lacks a magic number
448 file = new FileMOV(this->asset, this);
454 return FILE_UNRECOGNIZED_CODEC;
458 // format already determined
460 file = new FileAC3(this->asset, this);
468 //printf("File::open_file 1\n");
469 file = new FileSndFile(this->asset, this);
474 file = new FilePNG(this->asset, this);
479 file = new FileJPEG(this->asset, this);
484 file = new FileEXR(this->asset, this);
488 file = new FileYUV(this->asset, this);
492 file = new FileCR2(this->asset, this);
497 file = new FileTGA(this->asset, this);
502 file = new FileTIFF(this->asset, this);
506 file = new FileMOV(this->asset, this);
512 file = new FileMPEG(this->asset, this);
516 file = new FileOGG(this->asset, this);
520 file = new FileVorbis(this->asset, this);
524 file = new FileMOV(this->asset, this);
527 case FILE_AVI_LAVTOOLS:
530 case FILE_AVI_AVIFILE:
531 file = new FileAVI(this->asset, this);
535 file = new FileDV(this->asset, this);
544 // Reopen file with correct parser and get header.
545 if(file->open_file(rd, wr))
552 // Set extra writing parameters to mandatory settings.
555 if(this->asset->dither) file->set_dither();
559 // Synchronize header parameters
562 asset->copy_from(*this->asset, 1);
568 return FILE_NOT_FOUND;
571 int File::close_file(int ignore_thread)
581 // The file's asset is a copy of the argument passed to open_file so the
582 // user must copy lengths from the file's asset.
583 if(asset && file->wr)
585 asset->audio_length = current_sample;
586 asset->video_length = current_frame;
592 if(resample) delete resample;
593 if(resample_float) delete resample_float;
601 int File::get_index(char *index_path)
605 return file->get_index(index_path);
612 int File::start_audio_thread(int64_t buffer_size, int ring_buffers)
616 audio_thread = new FileThread(this, 1, 0);
617 audio_thread->start_writing(buffer_size, 0, ring_buffers, 0);
622 int File::start_video_thread(int64_t buffer_size,
629 video_thread = new FileThread(this, 0, 1);
630 video_thread->start_writing(buffer_size,
638 int File::start_video_decode_thread()
640 // Currently, CR2 is the only one which won't work asynchronously, so
641 // we're not using a virtual function yet.
642 if(!video_thread && asset->format != FILE_CR2)
644 video_thread = new FileThread(this, 0, 1);
645 video_thread->start_reading();
649 int File::stop_audio_thread()
653 audio_thread->stop_writing();
660 int File::stop_video_thread()
664 video_thread->stop_reading();
665 video_thread->stop_writing();
672 FileThread* File::get_video_thread()
677 int File::set_channel(int channel)
679 if(file && channel < asset->channels)
681 current_channel = channel;
688 int File::set_layer(int layer, int is_thread)
690 if(file && layer < asset->layers)
692 if(!is_thread && video_thread)
694 video_thread->set_layer(layer);
698 current_layer = layer;
706 int64_t File::get_audio_length(int64_t base_samplerate)
708 int64_t result = asset->audio_length;
711 if(base_samplerate > 0)
712 return (int64_t)((double)result / asset->sample_rate * base_samplerate + 0.5);
720 int64_t File::get_video_length(float base_framerate)
722 int64_t result = asset->video_length;
725 if(base_framerate > 0)
726 return (int64_t)((double)result / asset->frame_rate * base_framerate + 0.5);
731 return -1; // infinity
735 int64_t File::get_video_position(float base_framerate)
737 if(base_framerate > 0)
738 return (int64_t)((double)current_frame / asset->frame_rate * base_framerate + 0.5);
740 return current_frame;
743 int64_t File::get_audio_position(int64_t base_samplerate)
745 if(base_samplerate > 0)
747 if(normalized_sample_rate == base_samplerate)
748 return normalized_sample;
750 return (int64_t)((double)current_sample /
756 return current_sample;
761 // The base samplerate must be nonzero if the base samplerate in the calling
762 // function is expected to change as this forces the resampler to reset.
764 int File::set_audio_position(int64_t position, float base_samplerate)
770 #define REPOSITION(x, y) \
771 (labs((x) - (y)) > 1)
775 if((base_samplerate && REPOSITION(normalized_sample, position)) ||
776 (!base_samplerate && REPOSITION(current_sample, position)))
778 // Can't reset resampler since one seek operation is done
779 // for every channel to be read at the same position.
781 // Use a conditional reset for just the case of different base_samplerates
782 if(base_samplerate > 0)
784 if(normalized_sample_rate &&
785 normalized_sample_rate != base_samplerate &&
789 normalized_sample = position;
790 normalized_sample_rate = (int64_t)((base_samplerate > 0) ?
794 // Convert position to file's rate
795 if(base_samplerate > 0)
796 current_sample = Units::round((double)position /
802 current_sample = position;
803 normalized_sample = Units::round((double)position /
805 normalized_sample_rate);
806 // Can not set the normalized sample rate since this would reset the resampler.
809 result = file->set_audio_position(current_sample);
812 printf("File::set_audio_position position=%d base_samplerate=%f asset=%p asset->sample_rate=%d\n",
813 position, base_samplerate, asset.get(), asset->sample_rate);
816 //printf("File::set_audio_position %d %d %d\n", current_channel, current_sample, position);
821 int File::set_video_position(int64_t position, float base_framerate, int is_thread)
826 // Convert to file's rate
827 if(base_framerate > 0)
828 position = (int64_t)((double)position /
834 if(video_thread && !is_thread)
836 // Call thread. Thread calls this again to set the file state.
837 video_thread->set_video_position(position);
840 if(current_frame != position)
844 current_frame = position;
845 result = file->set_video_position(current_frame);
852 // No resampling here.
853 int File::write_samples(double **buffer, int64_t len)
859 write_lock->lock("File::write_samples");
860 result = file->write_samples(buffer, len);
861 current_sample += len;
862 normalized_sample += len;
863 asset->audio_length += len;
864 write_lock->unlock();
869 // Can't put any cmodel abstraction here because the filebase couldn't be
871 int File::write_frames(VFrame ***frames, int len)
873 // Store the counters in temps so the filebase can choose to overwrite them.
875 int current_frame_temp = current_frame;
876 int video_length_temp = asset->video_length;
877 write_lock->lock("File::write_frames");
882 result = file->write_frames(frames, len);
888 current_frame = current_frame_temp + len;
889 asset->video_length = video_length_temp + len;
890 write_lock->unlock();
894 int File::write_compressed_frame(VFrame *buffer)
897 write_lock->lock("File::write_compressed_frame");
898 result = file->write_compressed_frame(buffer);
900 asset->video_length++;
901 write_lock->unlock();
906 int File::write_audio_buffer(int64_t len)
911 result = audio_thread->write_buffer(len);
916 int File::write_video_buffer(int64_t len)
921 result = video_thread->write_buffer(len);
927 double** File::get_audio_buffer()
929 if(audio_thread) return audio_thread->get_audio_buffer();
933 VFrame*** File::get_video_buffer()
935 if(video_thread) return video_thread->get_video_buffer();
940 int File::read_samples(double *buffer, int64_t len, int64_t base_samplerate, float *buffer_float)
943 if(len < 0) return 0;
945 // Never try to read more samples than exist in the file
946 if (current_sample + len > asset->audio_length) {
947 len = asset->audio_length - current_sample;
950 // Load with resampling
953 // Resample recursively calls this with the asset sample rate
954 if(base_samplerate == 0) base_samplerate = asset->sample_rate;
956 //printf("File::read_samples 2 %d %d\n", base_samplerate, asset->sample_rate);
957 if(base_samplerate != asset->sample_rate)
959 //printf("File::read_samples 3\n");
960 //struct timeval start_time;
961 //gettimeofday(&start_time, 0);
962 if (!file->prefer_samples_float())
966 //printf("File::read_samples 4\n");
967 resample = new Resample(this, asset->channels);
970 //printf("File::read_samples 5\n");
971 current_sample += resample->resample(buffer,
978 //printf("File::read_samples 6\n");
983 //printf("File::read_samples 4\n");
984 resample_float = new Resample_float(this, asset->channels);
987 //printf("File::read_samples 5\n");
988 current_sample += resample_float->resample(buffer,
995 //printf("File::read_samples 6\n");
998 //printf("diff2: %lli\n", get_difference(&start_time));
1004 //printf("File::read_samples 7\n");
1005 if (buffer_float && file->prefer_samples_float())
1006 result = file->read_samples_float(buffer_float, len);
1008 result = file->read_samples(buffer, len);
1009 //printf("File::read_samples 8\n");
1010 current_sample += len;
1013 normalized_sample += len;
1018 int File::read_compressed_frame(VFrame *buffer)
1022 result = file->read_compressed_frame(buffer);
1027 int64_t File::compressed_frame_size()
1030 return file->compressed_frame_size();
1038 int File::read_frame(VFrame *frame, int is_thread)
1040 if(video_thread && !is_thread) return video_thread->read_frame(frame);
1044 int supported_colormodel = colormodel_supported(frame->get_color_model());
1045 int advance_position = 1;
1049 frame_cache->get_frame(frame,
1054 // Can't advance position if cache used.
1055 advance_position = 0;
1059 if(frame->get_color_model() != BC_COMPRESSED &&
1060 (supported_colormodel != frame->get_color_model() ||
1061 frame->get_w() != asset->width ||
1062 frame->get_h() != asset->height))
1065 // Can't advance position here because it needs to be added to cache
1068 if(!temp_frame->params_match(asset->width, asset->height, supported_colormodel))
1077 temp_frame = new VFrame(0,
1080 supported_colormodel);
1083 temp_frame->copy_stacks(frame);
1084 file->read_frame(temp_frame);
1085 cmodel_transfer(frame->get_rows(),
1086 temp_frame->get_rows(),
1087 temp_frame->get_y(),
1088 temp_frame->get_u(),
1089 temp_frame->get_v(),
1095 temp_frame->get_w(),
1096 temp_frame->get_h(),
1101 temp_frame->get_color_model(),
1102 frame->get_color_model(),
1104 temp_frame->get_w(),
1109 // Can't advance position here because it needs to be added to cache
1110 file->read_frame(frame);
1113 if(use_cache) frame_cache->put_frame(frame,
1118 // printf("File::read_frame\n");
1119 // frame->dump_params();
1121 if(advance_position) current_frame++;
1128 int File::can_copy_from(Edit *edit, int64_t position, int output_w, int output_h)
1132 return edit->asset->width == output_w &&
1133 edit->asset->height == output_h &&
1134 file->can_copy_from(edit, position);
1140 // Fill in queries about formats when adding formats here.
1143 int File::strtoformat(char *format)
1145 return strtoformat(0, format);
1148 int File::strtoformat(ArrayList<PluginServer*> *plugindb, char *format)
1150 if(!strcasecmp(format, _(AC3_NAME))) return FILE_AC3;
1152 if(!strcasecmp(format, _(WAV_NAME))) return FILE_WAV;
1154 if(!strcasecmp(format, _(PCM_NAME))) return FILE_PCM;
1156 if(!strcasecmp(format, _(AU_NAME))) return FILE_AU;
1158 if(!strcasecmp(format, _(AIFF_NAME))) return FILE_AIFF;
1160 if(!strcasecmp(format, _(SND_NAME))) return FILE_SND;
1162 if(!strcasecmp(format, _(PNG_NAME))) return FILE_PNG;
1164 if(!strcasecmp(format, _(PNG_LIST_NAME))) return FILE_PNG_LIST;
1166 if(!strcasecmp(format, _(TIFF_NAME))) return FILE_TIFF;
1168 if(!strcasecmp(format, _(TIFF_LIST_NAME))) return FILE_TIFF_LIST;
1170 if(!strcasecmp(format, _(JPEG_NAME))) return FILE_JPEG;
1172 if(!strcasecmp(format, _(JPEG_LIST_NAME))) return FILE_JPEG_LIST;
1174 if(!strcasecmp(format, _(EXR_NAME))) return FILE_EXR;
1176 if(!strcasecmp(format, _(EXR_LIST_NAME))) return FILE_EXR_LIST;
1178 if(!strcasecmp(format, _(YUV_NAME))) return FILE_YUV;
1180 if(!strcasecmp(format, _(CR2_NAME))) return FILE_CR2;
1182 if(!strcasecmp(format, _(MPEG_NAME))) return FILE_MPEG;
1184 if(!strcasecmp(format, _(AMPEG_NAME))) return FILE_AMPEG;
1186 if(!strcasecmp(format, _(VMPEG_NAME))) return FILE_VMPEG;
1188 if(!strcasecmp(format, _(TGA_NAME))) return FILE_TGA;
1190 if(!strcasecmp(format, _(TGA_LIST_NAME))) return FILE_TGA_LIST;
1192 if(!strcasecmp(format, _(MOV_NAME))) return FILE_MOV;
1194 if(!strcasecmp(format, _(AVI_NAME))) return FILE_AVI;
1196 if(!strcasecmp(format, _(AVI_LAVTOOLS_NAME))) return FILE_AVI_LAVTOOLS;
1198 if(!strcasecmp(format, _(AVI_ARNE2_NAME))) return FILE_AVI_ARNE2;
1200 if(!strcasecmp(format, _(AVI_ARNE1_NAME))) return FILE_AVI_ARNE1;
1202 if(!strcasecmp(format, _(AVI_AVIFILE_NAME))) return FILE_AVI_AVIFILE;
1204 if(!strcasecmp(format, _(OGG_NAME))) return FILE_OGG;
1206 if(!strcasecmp(format, _(VORBIS_NAME))) return FILE_VORBIS;
1208 if(!strcasecmp(format, _(RAWDV_NAME))) return FILE_RAWDV;
1212 char* File::formattostr(int format)
1214 return formattostr(0, format);
1217 char* File::formattostr(ArrayList<PluginServer*> *plugindb, int format)
1234 return _(AIFF_NAME);
1243 return _(PNG_LIST_NAME);
1246 return _(JPEG_NAME);
1248 case FILE_JPEG_LIST:
1249 return _(JPEG_LIST_NAME);
1258 return _(EXR_LIST_NAME);
1264 return _(MPEG_NAME);
1267 return _(AMPEG_NAME);
1270 return _(VMPEG_NAME);
1276 return _(TGA_LIST_NAME);
1279 return _(TIFF_NAME);
1281 case FILE_TIFF_LIST:
1282 return _(TIFF_LIST_NAME);
1287 case FILE_AVI_LAVTOOLS:
1288 return _(AVI_LAVTOOLS_NAME);
1293 case FILE_AVI_ARNE2:
1294 return _(AVI_ARNE2_NAME);
1296 case FILE_AVI_ARNE1:
1297 return _(AVI_ARNE1_NAME);
1299 case FILE_AVI_AVIFILE:
1300 return _(AVI_AVIFILE_NAME);
1306 return _(VORBIS_NAME);
1309 return _(RAWDV_NAME);
1312 return _("Unknown");
1318 int File::strtobits(char *bits)
1320 if(!strcasecmp(bits, _(NAME_8BIT))) return BITSLINEAR8;
1321 if(!strcasecmp(bits, _(NAME_16BIT))) return BITSLINEAR16;
1322 if(!strcasecmp(bits, _(NAME_24BIT))) return BITSLINEAR24;
1323 if(!strcasecmp(bits, _(NAME_32BIT))) return BITSLINEAR32;
1324 if(!strcasecmp(bits, _(NAME_ULAW))) return BITSULAW;
1325 if(!strcasecmp(bits, _(NAME_ADPCM))) return BITS_ADPCM;
1326 if(!strcasecmp(bits, _(NAME_FLOAT))) return BITSFLOAT;
1327 if(!strcasecmp(bits, _(NAME_IMA4))) return BITSIMA4;
1328 return BITSLINEAR16;
1331 char* File::bitstostr(int bits)
1333 //printf("File::bitstostr\n");
1340 return (NAME_16BIT);
1343 return (NAME_24BIT);
1346 return (NAME_32BIT);
1352 return (NAME_ADPCM);
1355 return (NAME_FLOAT);
1366 int File::str_to_byteorder(char *string)
1368 if(!strcasecmp(string, _("Lo Hi"))) return 1;
1372 char* File::byteorder_to_str(int byte_order)
1374 if(byte_order) return _("Lo Hi");
1378 int File::bytes_per_sample(int bits)
1408 int File::get_best_colormodel(int driver)
1410 return get_best_colormodel(asset, driver);
1413 int File::get_best_colormodel(Asset_GC asset, int driver)
1415 switch(asset->format)
1418 return FileDV::get_best_colormodel(asset, driver);
1422 return FileMOV::get_best_colormodel(asset, driver);
1426 return FileMOV::get_best_colormodel(asset, driver);
1430 return FileMPEG::get_best_colormodel(asset, driver);
1434 case FILE_JPEG_LIST:
1435 return FileJPEG::get_best_colormodel(asset, driver);
1440 return FileEXR::get_best_colormodel(asset, driver);
1444 return FileYUV::get_best_colormodel(asset, driver);
1449 return FilePNG::get_best_colormodel(asset, driver);
1454 return FileTGA::get_best_colormodel(asset, driver);
1462 int File::colormodel_supported(int colormodel)
1465 return file->colormodel_supported(colormodel);
1471 int64_t File::get_memory_usage()
1474 if(temp_frame) result += temp_frame->get_data_size();
1475 if(file) result += file->get_memory_usage();
1476 result += frame_cache->get_memory_usage();
1477 if(video_thread) result += video_thread->get_memory_usage();
1479 if(result < MIN_CACHEITEM_SIZE) result = MIN_CACHEITEM_SIZE;
1483 FrameCache* File::get_frame_cache()
1488 int File::supports_video(ArrayList<PluginServer*> *plugindb, char *format)
1490 int i, format_i = strtoformat(plugindb, format);
1492 return supports_video(format_i);
1496 int File::supports_audio(ArrayList<PluginServer*> *plugindb, char *format)
1498 int i, format_i = strtoformat(plugindb, format);
1500 return supports_audio(format_i);
1505 int File::supports_video(int format)
1507 //printf("File::supports_video %d\n", format);
1513 case FILE_JPEG_LIST:
1523 case FILE_TIFF_LIST:
1525 case FILE_AVI_LAVTOOLS:
1526 case FILE_AVI_ARNE2:
1528 case FILE_AVI_ARNE1:
1529 case FILE_AVI_AVIFILE:
1540 int File::supports_audio(int format)
1555 case FILE_AVI_LAVTOOLS:
1556 case FILE_AVI_ARNE2:
1557 case FILE_AVI_ARNE1:
1558 case FILE_AVI_AVIFILE:
1568 char* File::get_tag(int format)
1572 case FILE_AC3: return "ac3";
1573 case FILE_AIFF: return "aif";
1574 case FILE_AMPEG: return "mp3";
1575 case FILE_AU: return "au";
1576 case FILE_AVI: return "avi";
1577 case FILE_RAWDV: return "dv";
1578 case FILE_EXR: return "exr";
1579 case FILE_EXR_LIST: return "exr";
1580 case FILE_JPEG: return "jpg";
1581 case FILE_JPEG_LIST: return "jpg";
1582 case FILE_MOV: return "mov";
1583 case FILE_OGG: return "ogg";
1584 case FILE_PCM: return "pcm";
1585 case FILE_PNG: return "png";
1586 case FILE_PNG_LIST: return "png";
1587 case FILE_TGA: return "tga";
1588 case FILE_TGA_LIST: return "tga";
1589 case FILE_TIFF: return "tif";
1590 case FILE_TIFF_LIST: return "tif";
1591 case FILE_VMPEG: return "m2v";
1592 case FILE_VORBIS: return "ogg";
1593 case FILE_WAV: return "wav";
1594 case FILE_YUV: return "m2v";
1599 PackagingEngine *File::new_packaging_engine(Asset_GC asset)
1601 PackagingEngine *result;
1602 switch (asset->format)
1605 result = (PackagingEngine*)new PackagingEngineOGG();
1608 result = (PackagingEngine*) new PackagingEngineDefault();
1626 // c-file-style: "linux"