wide char tweaks, Features5 update, subtitle triple clk segv
[goodguy/history.git] / cinelerra-5.1 / cinelerra / fileffmpeg.C
index 27bd7de45daa2022ec46d38c2793d32b30cfd1ce..f3f535681234e3bbefe1a17d841eae4443458c55 100644 (file)
@@ -338,35 +338,30 @@ int FileFFMPEG::colormodel_supported(int colormodel)
 int FileFFMPEG::get_best_colormodel(Asset *asset, int driver)
 {
        switch(driver) {
-       case PLAYBACK_X11:
-               return BC_RGB888;
-       case PLAYBACK_X11_XV:
-       case PLAYBACK_ASYNCHRONOUS:
-               return BC_YUV888;
-       case PLAYBACK_X11_GL:
-               return BC_YUV888;
-       case PLAYBACK_DV1394:
-       case PLAYBACK_FIREWIRE:
-               return BC_YUV422P;
-       case VIDEO4LINUX2:
-               return BC_RGB888;
-       case VIDEO4LINUX2JPEG:
-               return BC_COMPRESSED;
-       case CAPTURE_DVB:
-       case VIDEO4LINUX2MPEG:
-               return BC_YUV422P;
-       case CAPTURE_JPEG_WEBCAM:
-               return BC_COMPRESSED;
-       case CAPTURE_YUYV_WEBCAM:
-               return BC_YUV422;
-       case CAPTURE_FIREWIRE:
-       case CAPTURE_IEC61883:
-               return BC_YUV422P;
+// the direct X11 color model requires scaling in the codec
+       case PLAYBACK_X11: return BC_BGR8888;
+//     case PLAYBACK_X11: return BC_RGB888;
+       case PLAYBACK_X11_GL: return BC_RGB888;
        }
 
-       return BC_RGB888;
+       return BC_YUV420P;
 }
 
+int FileFFMPEG::can_render(const char *fformat, const char *type)
+{
+       FileSystem fs;
+       char option_path[BCTEXTLEN];
+       FFMPEG::set_option_path(option_path, type);
+       fs.update(option_path);
+       int total_files = fs.total_files();
+       for( int i=0; i<total_files; ++i ) {
+               const char *name = fs.get_entry(i)->get_name();
+               const char *ext = strrchr(name,'.');
+               if( !ext ) continue;
+               if( !strcmp(fformat, ++ext) ) return 1;
+       }
+       return 0;
+}
 
 int FileFFMPEG::get_ff_option(const char *nm, const char *options, char *value)
 {