+int FileFFMPEG::get_best_colormodel(Asset *asset, int driver)
+{
+ switch(driver) {
+// the direct X11 color model requires scaling in the codec
+ case SCREENCAPTURE:
+ case PLAYBACK_X11:
+ case PLAYBACK_X11_GL: return BC_RGB888;
+ case PLAYBACK_X11_XV: return BC_YUV420P;
+ }
+
+ 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;
+}