repair cpanel zoom
[goodguy/history.git] / cinelerra-5.1 / cinelerra / file.C
index 264be2e8ff0c7d44efa338e4647f06c4c3c01d06..13e1b457463a2876c411725d4c6ad2ff700c9336 100644 (file)
@@ -171,9 +171,11 @@ int File::get_options(FormatTools *format,
        getting_options = 1;
        format_completion->lock("File::get_options");
        switch( asset->format ) {
+#ifdef HAVE_CIN_3RDPARTY
        case FILE_AC3: FileAC3::get_parameters(parent_window, asset, format_window,
                        audio_options, video_options, edl);
                break;
+#endif
 #ifdef HAVE_DV
        case FILE_RAWDV:
                FileDV::get_parameters(parent_window, asset, format_window,
@@ -192,11 +194,13 @@ int File::get_options(FormatTools *format,
                FileFFMPEG::get_parameters(parent_window, asset, format_window,
                        audio_options, video_options, edl);
                break;
+#ifdef HAVE_LIBZMPEG
        case FILE_AMPEG:
        case FILE_VMPEG:
                FileMPEG::get_parameters(parent_window, asset, format_window,
                        audio_options, video_options, edl);
                break;
+#endif
        case FILE_JPEG:
        case FILE_JPEG_LIST:
                FileJPEG::get_parameters(parent_window, asset, format_window,
@@ -262,13 +266,23 @@ int File::get_options(FormatTools *format,
        return 0;
 }
 
-
-
-
-
-
-
-
+int File::can_scale_input(Asset *asset)
+{
+       switch( asset->format ) {
+       case FILE_MPEG:
+       case FILE_FFMPEG:
+               return 1;
+       case FILE_EXR:
+       case FILE_JPEG:
+       case FILE_PNG:
+       case FILE_PPM:
+       case FILE_TGA:
+       case FILE_TIFF:
+               if( asset->video_length < 0 )
+                       return 1;
+       }
+       return 0;
+}
 
 
 int File::set_processors(int cpus)   // Set the number of cpus for certain codecs
@@ -376,11 +390,13 @@ int File::probe()
                        file = new FileFFMPEG(this->asset, this);
                        return FILE_OK;
                }
+#ifdef HAVE_COMMERCIAL
                if( !strcmp(pref->name,"DB") ) { // MediaDB
                        if( !FileDB::check_sig(this->asset) ) continue;
                        file = new FileDB(this->asset, this);
                        return FILE_OK;
                }
+#endif
                if( !strcmp(pref->name,"Scene") ) { // scene file
                        if( !FileScene::check_sig(this->asset, data)) continue;
                        file = new FileScene(this->asset, this);
@@ -455,11 +471,13 @@ int File::probe()
                        file = new FileVorbis(this->asset, this);
                        return FILE_OK;
                }
+#ifdef HAVE_LIBZMPEG
                if( !strcmp(pref->name,"MPEG") ) { // MPEG file
                        if( !FileMPEG::check_sig(this->asset) ) continue;
                        file = new FileMPEG(this->asset, this);
                        return FILE_OK;
                }
+#endif
                if( !strcmp(pref->name,"EDL") ) { // XML file
                        if( data[0] != '<' ) continue;
                        if( !strncmp(&data[1],"EDL>",4) ||
@@ -495,10 +513,11 @@ int File::open_file(Preferences *preferences,
                if( ret != FILE_OK ) return ret;
                break; }
 // format already determined
+#ifdef HAVE_CIN_3RDPARTY
        case FILE_AC3:
                file = new FileAC3(this->asset, this);
                break;
-
+#endif
        case FILE_SCENE:
                file = new FileScene(this->asset, this);
                break;
@@ -559,17 +578,19 @@ int File::open_file(Preferences *preferences,
        case FILE_TIFF_LIST:
                file = new FileTIFF(this->asset, this);
                break;
-
+#ifdef HAVE_COMMERCIAL
        case FILE_DB:
                file = new FileDB(this->asset, this);
                break;
+#endif
 
+#ifdef HAVE_LIBZMPEG
        case FILE_MPEG:
        case FILE_AMPEG:
        case FILE_VMPEG:
                file = new FileMPEG(this->asset, this);
                break;
-
+#endif
        case FILE_OGG:
                file = new FileOGG(this->asset, this);
                break;
@@ -1264,7 +1285,9 @@ const char* File::formattostr(int format)
        case FILE_FLAC:         return _(FLAC_NAME);
        case FILE_EXR:          return _(EXR_NAME);
        case FILE_EXR_LIST:     return _(EXR_LIST_NAME);
+#ifdef HAVE_LIBZMPEG
        case FILE_MPEG:         return _(MPEG_NAME);
+#endif
        case FILE_AMPEG:        return _(AMPEG_NAME);
        case FILE_VMPEG:        return _(VMPEG_NAME);
        case FILE_TGA:          return _(TGA_NAME);
@@ -1346,7 +1369,9 @@ int File::get_best_colormodel(Asset *asset, int driver)
 #ifdef HAVE_DV
        case FILE_RAWDV:        return FileDV::get_best_colormodel(asset, driver);
 #endif
+#ifdef HAVE_LIBZMPEG
        case FILE_MPEG:         return FileMPEG::get_best_colormodel(asset, driver);
+#endif
        case FILE_JPEG:
        case FILE_JPEG_LIST:    return FileJPEG::get_best_colormodel(asset, driver);
 #ifdef HAVE_OPENEXR
@@ -1361,7 +1386,9 @@ int File::get_best_colormodel(Asset *asset, int driver)
        case FILE_TGA_LIST:     return FileTGA::get_best_colormodel(asset, driver);
        case FILE_CR2:
        case FILE_CR2_LIST:     return FileCR2::get_best_colormodel(asset, driver);
+#ifdef HAVE_COMMERCIAL
        case FILE_DB:           return FileDB::get_best_colormodel(asset, driver);
+#endif
        case FILE_FFMPEG:       return FileFFMPEG::get_best_colormodel(asset, driver);
        }