X-Git-Url: http://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Ffile.C;h=07cddec4961fc9faf60fc0b36d3cab6622073e2b;hb=8b7ea38c6c4ddf7eab2f606682798aebd5fbb99a;hp=dbcd68899a5e150fe5e79d256fe0276fbefeb1f6;hpb=279d3d4d92fa9c1831332633ce21345b29631fc2;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/file.C b/cinelerra-5.1/cinelerra/file.C index dbcd6889..07cddec4 100644 --- a/cinelerra-5.1/cinelerra/file.C +++ b/cinelerra-5.1/cinelerra/file.C @@ -45,6 +45,7 @@ #include "filecr2.h" #include "filedb.h" #include "filedv.h" +#include "filedpx.h" #include "fileexr.h" #include "fileffmpeg.h" #include "fileflac.h" @@ -210,6 +211,13 @@ int File::get_options(FormatTools *format, FileJPEG::get_parameters(parent_window, asset, format_window, audio_options, video_options, edl); break; +#ifdef HAVE_LIBDPX + case FILE_DPX: + case FILE_DPX_LIST: + FileDPX::get_parameters(parent_window, asset, format_window, + audio_options, video_options, edl); + break; +#endif #ifdef HAVE_OPENEXR case FILE_EXR: case FILE_EXR_LIST: @@ -278,6 +286,7 @@ int File::can_scale_input(Asset *asset) case FILE_MPEG: case FILE_FFMPEG: return 1; + case FILE_DPX: case FILE_EXR: case FILE_JPEG: case FILE_PNG: @@ -379,6 +388,7 @@ const char *File::default_probes[] = { "PPM", "JPEG", "GIF", + "DPX", #ifdef HAVE_OPENEXR "EXR", #endif @@ -392,7 +402,7 @@ const char *File::default_probes[] = { #endif "MPEG", "EDL", - "FFMPEG_Late", + "FFMPEG_Late", }; const int File::nb_probes = sizeof(File::default_probes)/sizeof(File::default_probes[0]); @@ -463,6 +473,13 @@ int File::probe() else continue; return FILE_OK; } +#ifdef HAVE_LIBDPX + if( !strcmp(pref->name,"DPX") ) { // DPX file + if( !FileDPX::check_sig(this->asset, data) ) continue; + file = new FileDPX(this->asset, this); + return FILE_OK; + } +#endif #ifdef HAVE_OPENEXR if( !strcmp(pref->name,"EXR") ) { // EXR file if( !FileEXR::check_sig(this->asset, data)) continue; @@ -589,13 +606,19 @@ int File::open_file(Preferences *preferences, case FILE_GIF_LIST: file = new FileGIFList(this->asset, this); break; - +#ifdef HAVE_LIBDPX + case FILE_DPX: + case FILE_DPX_LIST: + file = new FileDPX(this->asset, this); + break; +#endif #ifdef HAVE_OPENEXR case FILE_EXR: case FILE_EXR_LIST: file = new FileEXR(this->asset, this); break; #endif + case FILE_FLAC: file = new FileFLAC(this->asset, this); break; @@ -658,6 +681,17 @@ int File::open_file(Preferences *preferences, } +// If file type is a list verify that all files match in dimensions. +// Should be done only after the file open function has been performed +// Reason: although this function checks if file exists or not but +// it has no way of relaying this information back and if this function +// is called before open_file the program may accidently interpret file +// not found as file size don't match + if( !file->verify_file_list() ) { + delete file; file = 0; + return FILE_SIZE_DONT_MATCH; + } + // Set extra writing parameters to mandatory settings. if( wr ) { @@ -1262,6 +1296,8 @@ int File::strtoformat(const char *format) if( !strcasecmp(format, _(TIFF_LIST_NAME)) ) return FILE_TIFF_LIST; if( !strcasecmp(format, _(JPEG_NAME)) ) return FILE_JPEG; if( !strcasecmp(format, _(JPEG_LIST_NAME)) ) return FILE_JPEG_LIST; + if( !strcasecmp(format, _(DPX_NAME)) ) return FILE_DPX; + if( !strcasecmp(format, _(DPX_LIST_NAME)) ) return FILE_DPX_LIST; if( !strcasecmp(format, _(EXR_NAME)) ) return FILE_EXR; if( !strcasecmp(format, _(EXR_LIST_NAME)) ) return FILE_EXR_LIST; if( !strcasecmp(format, _(FLAC_NAME)) ) return FILE_FLAC; @@ -1306,6 +1342,8 @@ const char* File::formattostr(int format) case FILE_FLAC: return _(FLAC_NAME); case FILE_GIF: return _(GIF_NAME); case FILE_GIF_LIST: return _(GIF_LIST_NAME); + case FILE_DPX: return _(DPX_NAME); + case FILE_DPX_LIST: return _(DPX_LIST_NAME); case FILE_EXR: return _(EXR_NAME); case FILE_EXR_LIST: return _(EXR_LIST_NAME); #ifdef HAVE_LIBZMPEG @@ -1317,8 +1355,10 @@ const char* File::formattostr(int format) case FILE_TGA_LIST: return _(TGA_LIST_NAME); case FILE_TIFF: return _(TIFF_NAME); case FILE_TIFF_LIST: return _(TIFF_LIST_NAME); +#ifdef HAVE_OGG case FILE_OGG: return _(OGG_NAME); case FILE_VORBIS: return _(VORBIS_NAME); +#endif case FILE_RAWDV: return _(RAWDV_NAME); case FILE_FFMPEG: return _(FFMPEG_NAME); case FILE_DB: return _(DBASE_NAME); @@ -1398,6 +1438,10 @@ int File::get_best_colormodel(Asset *asset, int driver) #endif case FILE_JPEG: case FILE_JPEG_LIST: return FileJPEG::get_best_colormodel(asset, driver); +#ifdef HAVE_LIBDPX + case FILE_DPX: + case FILE_DPX_LIST: return FileDPX::get_best_colormodel(asset, driver); +#endif #ifdef HAVE_OPENEXR case FILE_EXR: case FILE_EXR_LIST: return FileEXR::get_best_colormodel(asset, driver); @@ -1533,7 +1577,9 @@ const char* File::get_tag(int format) case FILE_AU: return "au"; case FILE_RAWDV: return "dv"; case FILE_DB: return "db"; + case FILE_DPX: return "dpx"; case FILE_EXR: return "exr"; + case FILE_DPX_LIST: return "dpxs"; case FILE_EXR_LIST: return "exrs"; case FILE_FLAC: return "flac"; case FILE_JPEG: return "jpg"; @@ -1583,6 +1629,8 @@ const char* File::get_prefix(int format) case FILE_PNG_LIST: return "PNG_LIST"; case FILE_PPM_LIST: return "PPM_LIST"; case FILE_AC3: return "AC3"; + case FILE_DPX: return "DPX"; + case FILE_DPX_LIST: return "DPX_LIST"; case FILE_EXR: return "EXR"; case FILE_EXR_LIST: return "EXR_LIST"; case FILE_CR2: return "CR2";