ffmpeg param visibility, high422 x264 profile, bd/dvd enhancements
[goodguy/history.git] / cinelerra-5.1 / cinelerra / ffmpeg.C
index 74d1d74522528855c84bcd5bedf766ed99640070..25cfbe70fc6f89dba9877d0d8d4405816dd4f0c7 100644 (file)
@@ -1137,7 +1137,7 @@ void FFMPEG::get_option_path(char *path, const char *type, const char *spec)
                set_option_path(path, "%s/%s", type, spec);
 }
 
-int FFMPEG::get_format(char *format, const char *path, char *spec)
+int FFMPEG::get_format(char *format, const char *path, const char *spec)
 {
        char option_path[BCTEXTLEN], line[BCTEXTLEN], codec[BCTEXTLEN];
        get_option_path(option_path, path, spec);
@@ -1153,6 +1153,22 @@ int FFMPEG::get_format(char *format, const char *path, char *spec)
        return ret;
 }
 
+int FFMPEG::get_codec(char *codec, const char *path, const char *spec)
+{
+       char option_path[BCTEXTLEN], line[BCTEXTLEN], format[BCTEXTLEN];
+       get_option_path(option_path, path, spec);
+       FILE *fp = fopen(option_path,"r");
+       if( !fp ) return 1;
+       int ret = 0;
+       if( !fgets(line, sizeof(line), fp) ) ret = 1;
+       if( !ret ) {
+               line[sizeof(line)-1] = 0;
+               ret = scan_option_line(line, format, codec);
+       }
+       fclose(fp);
+       return ret;
+}
+
 int FFMPEG::get_file_format()
 {
        int ret = 0;